Something I enjoy:
Finding a class that implements what I was going to write by hand.
I’m looking at you, ReentrantReadWriteLock.
Something I enjoy:
Finding a class that implements what I was going to write by hand.
I’m looking at you, ReentrantReadWriteLock.
Programming is like Buddhism. No one can tell you how to do it. You must do it for yourself. You are the only one who can get in touch with your own reality.
Programming is like the Matrix. There is a difference between knowing the path and walking it. I can only show you the door. You have to go through it.
Programming is like mathematics. There is a crucial relationship between syntax and semantics that fills the soul with ecstasy.
Programming is like the brain. The line is blurred between what is static and what is dynamic.
Programming is like the mind. It is everything and it is nothing. It is you and me, and everything in between.
Programming is like music. The answers are out there, it just requires the right kind of person to capture it and tell it to the world.
The answer to life, the universe, and everything is out there, it just takes some time for the global consciousness to understand everything there is to understand. Communication is critical.
Things I want to do right now instead of study:
People who want to put an email address up on a web page often write it out like this
|
or use some variation. The purpose is to effectively “hide” the email address from an eeevil program which searches the web, looking for email addresses so that it can send them spam about Viagra and whatnot. This seems to be a leftover from earlier days of the Internet, cause it should be pretty simple for a computer program to figure out an email address from a string of that form. For example, the following simple regular expression will match an email like the one above:
|
This is, of course, non-comprehensive and would match false positives in many cases, but it is just an extremely simple example which matches the test string I gave above. One could easily modify the email address regular expression given at http://www.regular-expressions.info/email.html to include addresses with the @ and . symbols written out as English words.
I have seen a couple of seemingly effective deterrents from eeevil programs which might use a regular expression such as this to find email addresses.
|
If you were really committed to scraping email addresses from webpages, you could just give your eeevil program access to a JavaScript interpreter, interpret the JavaScript on the webpage, then check the output for email addresses in the usual way.
|
The output will look something like this:![]()
This is roughly how your email address is displayed under your “Info” on your Facebook profile.
Again, if you were really committed to scraping email addresses from webpages for some reason, I suppose you could use a program that involves optical character recognition to convert the images to text and then spam away.
Duff’s device is an optimization in C for copying bytes by means of loop unrolling. It is a clever use of C’s notoriously lax syntax. Note that the inventor of this method, Tom Duff (“Duffman thrusting in the direction of the problem!”), was originally copying a series of bytes into a single destination register, so the to pointer in his code below is never incremented:
|
Cute right? Here’s an example in which I use it to copy a string (notice that I increment the destination pointer in Duff’s device, resulting in an exact copy of the source string):
|
Save this code (for example, as duff.c), then compile it and run it with
|
Update: further explanation is given below.
I get an inordinate amount of enjoyment out of writing a computationally expensive program, making my computer execute it, and then hearing the computer’s fans start spinning frantically as heat build up in the processor, RAM, etc.
Some developers in Africa (or at least with an interest in helping African people) are developing a platform for accumulating crisis information called Ushahidi. This is a good thing. It makes me feel happy when people do things to help other people. That’s how I know that people helping other people is a good thing to do.
In the spirit of software freedom, the idea with this system is (1) free flow of information and (2) power in numbers. Things are easier when knowledge is freely available and when everyone can contribute and learn. Keep an eye out for projects like this, especially those popping up in African countries and other developing nations, and help them survive.
Sometimes when I’m feeling down, I take a look at the changelog for the most recent development release of Wine. Just look at all those beautiful bug fixes and implemented features. Wine is one of the most actively developed projects around, and its cool to see real improvement going down.
Makes me remember that this is paradise.