Via Simon, Harry Fueks has a helluva article on PHP5. I only skimmed it, but one neat thing I learned is that PHP has some overloading built in as of PHP 4.3.0. Now if I can only use their iterator feature I'd have some of what I wanted to switch to Python for. As of PHP5 I may be not-pissed enough at PHP to want to switch from it anymore.
Since Java IO is such a pain in the ass, and I never remember how to read and write files (not even the experts can), I'm going to post sample code for future reference here.
Also see Sun's tutorial on Java I/O.
Ack! You can't do a .putback() on a BufferedInputStream, even though it's buffered! What the hell. I still say that C++ is often easier than Java.
Ok, I really, really hate Java. All of my other driver programs worked just fine, but I had to make a special case for the special child that is Java because when I passed it the absolute path name of the driver program, it considered the full path a class name and then complained it couldn't find the class. Hello?? Freaking slashes (/) aren't allowed in class names anyway! Get a clue.
Anyway, here's the driver program I promised:
import [MY SECRET CLASS]
import java.io.*;
public class driver{
public static void main (String args[]){
if(args.length < 2){
System.out.println("Usage: driver input_file output_file\n");
}else{
Object o = null;
X x = new X(); // my secret class
try{
FileInputStream fin = new FileInputStream(args[0]);
o = x.load(fin);
fin.close();
}catch (IOException e){
System.err.println ("Something borked reading the file");
System.exit(1);
}
try{
FileOutputStream fout = new FileOutputStream(args[1]);
fout.write(x.dump(o).getBytes());
fout.close();
}catch (IOException e){
System.err.println ("Something borked writing the file");
System.exit(1);
}
}
}
}
What's also super annoying is that Java has separate but pretty much symmetrical I/O class hierarchies that are different only because one deals with bytes and one deals with characters. I know with Unicode characters aren't necessarily bytes anymore, but it seems like there must have been a better way to handle that.
If you had an input stream and were able to specify that you should open it in character mode, Java should be able to filter that just like it can do with the character-based I/O classes. I don't see why they needed a whole separate class hierarchy to do that. I'd want to give the designers the benefit of the doubt on this one, but Java has traditionally been riddled with so many poor design decisions that this is probably just more of the same.
Lastly, I'm finding that Java has a much higher cognitive load than any other language I know of, including C++. If they had allowed operator overloading it would have made things easier. str.charAt(n) instead of str[n]? str.equals(foo) instead of str == foo? Give me a break.
I just watched the Creative Commons Flash introduction. It's excellent! It's a really interesting and entertaining introduction to Creative Commons licensing. Before watching, I was only vaguely familiar with Creative Commons, and didn't have any strong opinions on it. After watching, I think it's a really fantastic idea. Who knows if it'll catch on enough to really have an impact, but they get points for trying.
Note to everybody who creates something: Show me a freaking example of it! A sample file of your markup language, some sample code that uses your library or API, anything more a stupid useless grammar or a function reference would be nice. Do it right on your home page, or have a link that says "What does it look like?" clearly visible. Don't frustrate me! Don't expect people to read your grammar and grok it. You might even make up some use-cases to explain to people how they can expect to be able to use your creation. If I can't go to your site and understand what the hell you're doing in 30 seconds or less, you've already frustrated me and I'm mad at you.
Via Simon, check out the Doomsday Algorithm, which lets you calculate the day of the week for any date. With a little work at memorizing this and getting proficient at it, you may never have to ask "What day is that again?" when setting up a meeting 
Simon has some links about RDF... Shelly Powers: RDF: Ready for Prime Time. From the Mozilla project: examples of RDF in Mozilla and RDF in fifty words or less. I've never understood the point of RDF, but everyone else seems to think it's neat, so I suppose I should understand it more, even if I still think it's stupid aftewards.
I just created a wiki page for RDF full of links to RDF stuff. Feel free to add your own.
I hate ASP.NET
I hate ASP... I was doing wonderswith PHP, then suddenly one of myclients...
Johnies: Mar 17, 6:14am