User Profile

Collapse

Profile Sidebar

Collapse
darktemp
darktemp
Last Activity: Sep 17 '10, 05:19 AM
Joined: Feb 11 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • darktemp
    replied to Multiple image randomizer?
    in PHP
    My code already randomizes pictures listed in a folder. What I want is to have multiple images either from that folder or another folder stitched together into one image and displayed together.

    Also I don't think JavaScript will work since it has to display an image in the format .jpg.
    See more | Go to post

    Leave a comment:


  • darktemp
    started a topic Multiple image randomizer?
    in PHP

    Multiple image randomizer?

    Hi, I am quite new with PHP so please bear with me.

    I would like to update old code I have that I use for signatures. Currently it functions like so:

    - Pulls one image from a folder at random, the file names are not directly associated with the code so it is possible to put new images without changing the code.
    - Is able to display some text that used to be used, but was later disabled.

    Problems:...
    See more | Go to post

  • Can 'hexvalue' be padded with NUL then?

    What I am trying to do is write to a file in which my other program pulls information out of it. The information is stored in a 4 byte cell block. Spaces would make the hex representation 30 which would change the value of the stored number so would it be possible to store it as NUL instead of spaces?
    See more | Go to post

    Leave a comment:


  • Hello again, the improved method you suggested did fix issues with hex values that had single digits/characters but is there a way to make the hex value output a line of leading zeros? The 4 length string requirement is strict otherwise the program crashes if the decimal value is small. I was thinking of padding it, but there is no way to know how many leading zeros there are, at most there is only 7, but can range from 0-7.

    Example:...
    See more | Go to post

    Leave a comment:


  • I'll use this example:

    Say I have a number 91000465, its hex value would have to be 056c8e91 and when it becomes a string it would be a 4 character string of the representation of 05, 6c, 8e, and 91. The method you gave me does this fine but it shows '56c8e91' instead of '056c8e91'. Showing the first would cause a bug in translating it to string as it would get the first character for hex 56, then c8, then e9, and then 1. Also to note,...
    See more | Go to post

    Leave a comment:


  • Thanks for the prompt reply! I tried your method and it works great, can it be modified in a way where single digits/characters in hex have a zero preceding it?

    Hex value of '5' will be '05' instead. I was thinking of string manipulating it but I don't want all of the first hex values to have a zero preceding it.

    Thanks!
    See more | Go to post

    Leave a comment:


  • How do you convert a hex representation into a string?

    I have a small program that converts a set of decimal numbers into string. What I can do is convert it from decimal to hexadecimal then to string, but I have the feeling there is a more easier way of doing it. For example:

    '1650811246' is the number I am given. The output should be 'bean'. The hexadecimal representation should be '6265616E'.

    All my strings and hexadecimal representations of the numbers will be in a set of...
    See more | Go to post

  • Thanks again bvdet! :]
    See more | Go to post

    Leave a comment:


  • How do you read up to a specific character in a line of text?

    I have a line of characters that need to be separated. One example is like this:

    513413;dialog_5 13413;Sally Mae has some jobs for you.;

    Three sets of data all split into three groups placed in one line. What I would like to do is be able to read each group up to the semicolon (obviously without including it when it becomes displayed or used in the program).

    So in conclusion I would just like to know a...
    See more | Go to post

  • darktemp
    replied to Assigning a number that starts with 0
    I was sorting tiles of images from 000 to 999. Had to make the first 10 pictures in a row, then start a new row.

    Your snippet of code helped me accomplish this by outputting the value as a string which was enough to sort the images nicely.

    Thank you!
    See more | Go to post

    Leave a comment:


  • darktemp
    started a topic Assigning a number that starts with 0

    Assigning a number that starts with 0

    Is there a way to assign a value of '000' to '099'?

    I have a file sorter program that has files with 000 in their filename and the best way to identify them is with the number. The numbers range from 000 to 999.
    See more | Go to post

  • darktemp
    started a topic creating a loading bar?

    creating a loading bar?

    I've always loved how McAfee made a boot time loading bar that basically looks like a spinning bar of /, |, \, -, /, | iterated over and over. Unfortunately I have no idea how to delete things that are already printed in console. Anyone have any ideas?

    I appreciate the help :].
    See more | Go to post

  • darktemp
    replied to using a string to call a method
    Wow that was really quick and nicely made. Thanks :].
    See more | Go to post

    Leave a comment:


  • darktemp
    started a topic using a string to call a method

    using a string to call a method

    Is it possible to use a string to call a method?
    Say I got a string x = txt (which is a known file extension to my program) and I have a method called txt(value). When x changes to doc, is there a way to make my program call to doc(value)? I tried x(value) (which is a nonexistent method) and I get a string object not callable.

    I hope I am clear enough about it. Thanks :].
    See more | Go to post

  • darktemp
    replied to XOR Encryption?
    I managed to find a method for xoring which is very simple. bvdet's code is also good, but since xoring is the same method for encrypting and decrypting, it would be simpler to keep encryption and decryption as the same method. I'll just finish and contribute with the code I found.

    Code:
    def xor_crypt_string(data, key):
        return ''.join(chr(ord(x) ^ ord(y)) for (x,y) in izip(data, cycle(key)))
    So to call this:...
    See more | Go to post

    Leave a comment:


  • darktemp
    started a topic XOR Encryption?

    XOR Encryption?

    Is there a simple method that can allow for xor encryption on python? What I want to do is pass a file into the method along with the key or integrate the key into the method.

    I have seen the ones on google, but they don't really work. The long one only accepts certain file types, and the second one doesn't work at all.

    I appreciate all the help!
    See more | Go to post

  • Thanks! it works as it should now. Thanks for your support!
    See more | Go to post

    Leave a comment:


  • Code:
        offsetraw = file.read(4)
        offset = offsetraw[::-1]
        hexoffset = ''.join([hex(ord(letter))[2:] for letter in offset])
        offsetvalue = int(hexoffset, 16)
        print hexoffset
        print offsetvalue,
    I just tried your method and it doesn't solve the problem, I think that way only works with single hex strings.

    With my code it reads from a defined file by 4 characters and places...
    See more | Go to post

    Leave a comment:


  • Just tried this way and it outputs the same thing. Maybe I am just doing it wrong, but it seems that python doesn't see the hex value as 07 compared to 7 which changes the values when more hex values are put in place.

    I really appreciate everyones help though :].
    See more | Go to post

    Leave a comment:


  • Is there a way for this code to read the hex value as 07 and not 7? The example I posted up gives me a different value.

    07 07 95 33 = 117937459
    7 7 95 33 = 7836979
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...