Can't you just use perl -pie? Easier to remember and mmm... perl pie. Also, that's only reversible if the word starts with the letter being replaced. If you were to do /d/california/, then any original instances of california in the file (not likely in a JPEG) will be mangled when you do /california/d/.
@uzimonkey Thanks for watching! Using -pie won't work. (I double-checked just now.) Secondly, it doesn't matter what the word STARTS with. All that matters is that the new pattern that is created doesn't already exist in the target file. That's what I mean by one-to-one and many-to-one pattern substitutions. I didn't explain this fully or give examples since I wanted to keep the video short. Also I figured people who are interested would experiment around and figure it out that way.
@blackturtleshow Actually, it will work if california already exists in the file and you use c. If you do /c/california/ it would end up as califroniaalifornia, which will go back to california when you do /california/c/.
If i'm using windows 7 and I wanted to execute this out of a command prompt directly from a .pl file, i assume this would not be the correct syntax. could you respond back what would be?
That's really neat!!! One time I was messing around in terminal and completely locked myself out of my own computer. It is really awesome that you know this stuff. I know who to come to if I ever have anymore iMac problems :)
Probably the header portion of the file became corrupted. Try some different substitutions (a/ask, w/mind, b/card, or whatever). I first stumbled upon this trick while messing around on a Linux machine and I just re-tested it on a machine running Ubuntu. You might try the trick with the image I used in the video (available at the link provided in the video description).
The organization of PNG and JPG files is quite different. Looking at my copy of Graphics File Formats (Murray and VanRyper) these differences become quite apparent. I did a quick experiment with a PNG file and found that it did not tolerate substitutions well at all, as you pointed out! My guess is that some substitutions may work nonetheless, it's just that PNG files will be pickier (and substitutions may have to be character for character, not single to multiple).
Good point! Actually I have a plan for a trapizium video. I'm going to write a Java applet that will generate background. I have a green screen ordered and it should arrive in a few days. It may be a week or two, but I should be able to put something together on the trapizium idea pretty soon!!!
Yes, you never know what you'll get! And a series of these substitutions can yield even more interesting results. Of course, there is also the chance of corrupting the file so much that it won't open as an image! By substituting a long pattern (like california) for a single letter increases the chances of being able to "recover" the file.
Actually, I could see a practical use for that as a cheap and easy encryption substitute if there's particular files you don't want certain people looking at. And, actually, I kind of liked the corrupted image.
It's fun to experiment with this trick since the corrupted file turns out different depends on the substitution(s) made. Chaining together a series of these substitutions can be interesting too. Sometimes the file will become so corrupted that it will no longer open. Also it's fun to see if you can undo a chain of substitutions. And like I said, some substitutions are irreversible.
Can't you just use perl -pie? Easier to remember and mmm... perl pie. Also, that's only reversible if the word starts with the letter being replaced. If you were to do /d/california/, then any original instances of california in the file (not likely in a JPEG) will be mangled when you do /california/d/.
uzimonkey 4 weeks ago
@uzimonkey Thanks for watching! Using -pie won't work. (I double-checked just now.) Secondly, it doesn't matter what the word STARTS with. All that matters is that the new pattern that is created doesn't already exist in the target file. That's what I mean by one-to-one and many-to-one pattern substitutions. I didn't explain this fully or give examples since I wanted to keep the video short. Also I figured people who are interested would experiment around and figure it out that way.
blackturtleshow 4 weeks ago
@blackturtleshow Actually, it will work if california already exists in the file and you use c. If you do /c/california/ it would end up as califroniaalifornia, which will go back to california when you do /california/c/.
uzimonkey 4 weeks ago
@uzimonkey True, but in that case you're modifying an existing pattern as opposed to replicating an existing pattern.
blackturtleshow 4 weeks ago
machontosh huh, im a loyal windows user but mac is pretty popular these days
PIKAMONjake 5 months ago
@PIKAMONjake Actually, I have a Windows computer, as well as two Macs and two Linux boxes. It might be some kind of addiction! ;)
blackturtleshow 5 months ago
If i'm using windows 7 and I wanted to execute this out of a command prompt directly from a .pl file, i assume this would not be the correct syntax. could you respond back what would be?
wowonice1 5 months ago
@wowonice1
$str =~ s/T/U/g;
This line substitutes a U for all instances of T in the string $str (in this case a nucleotide sequence).
blackturtleshow 5 months ago
@wowonice1 Actually the demo program is really short, so here's the whole thing:
#!/usr/bin/perl
$str = "TTAAGGCCATGCGGATACACGATGAC";
print "ORIGINAL: $str\n";
$str =~ s/T/U/g;
print "AFTER SUBSTITUTION: $str\n";
FROM:
blackturtle.us/BIOINFO/BIOPERL2/bp2_02.html
blackturtleshow 5 months ago
lol perl.
tehpr0lol 2 years ago
ur ugly
colleeto5 2 years ago
That's really neat!!! One time I was messing around in terminal and completely locked myself out of my own computer. It is really awesome that you know this stuff. I know who to come to if I ever have anymore iMac problems :)
magiceric311 2 years ago
Doesn't work on Linux for me. Just gives me a decompression error when trying to open the file. :/
AnonymousCthulhu 2 years ago
Probably the header portion of the file became corrupted. Try some different substitutions (a/ask, w/mind, b/card, or whatever). I first stumbled upon this trick while messing around on a Linux machine and I just re-tested it on a machine running Ubuntu. You might try the trick with the image I used in the video (available at the link provided in the video description).
blackturtleshow 2 years ago
It worked. I guess it doesn't do so well with .png files. :)
AnonymousCthulhu 2 years ago
The organization of PNG and JPG files is quite different. Looking at my copy of Graphics File Formats (Murray and VanRyper) these differences become quite apparent. I did a quick experiment with a PNG file and found that it did not tolerate substitutions well at all, as you pointed out! My guess is that some substitutions may work nonetheless, it's just that PNG files will be pickier (and substitutions may have to be character for character, not single to multiple).
blackturtleshow 2 years ago
i think it would be better to use the word "trapiziums" don't you think? : ]
TheDocter7 2 years ago
Good point! Actually I have a plan for a trapizium video. I'm going to write a Java applet that will generate background. I have a green screen ordered and it should arrive in a few days. It may be a week or two, but I should be able to put something together on the trapizium idea pretty soon!!!
blackturtleshow 2 years ago
Awesome good job! : ]
TheDocter7 2 years ago
So, if you had used something other than "california" as the substitute would the corrupt file have a different pattern outcome?
thefrozenghost 2 years ago
Yes, you never know what you'll get! And a series of these substitutions can yield even more interesting results. Of course, there is also the chance of corrupting the file so much that it won't open as an image! By substituting a long pattern (like california) for a single letter increases the chances of being able to "recover" the file.
blackturtleshow 2 years ago
Actually, I could see a practical use for that as a cheap and easy encryption substitute if there's particular files you don't want certain people looking at. And, actually, I kind of liked the corrupted image.
kenrg 2 years ago
It's fun to experiment with this trick since the corrupted file turns out different depends on the substitution(s) made. Chaining together a series of these substitutions can be interesting too. Sometimes the file will become so corrupted that it will no longer open. Also it's fun to see if you can undo a chain of substitutions. And like I said, some substitutions are irreversible.
blackturtleshow 2 years ago
I couldn't believe it when I saw the video length.
If it HAD featured music, two minutes and forty four seconds would be like a 12-inch dance cut for you lol
BillyBughead 2 years ago
I tried to get this one down to under two minutes, but I just couldn't do it!
blackturtleshow 2 years ago