Saturday, November 28, 2009
Why, Sun, why?
If java.util.LinkedList has a toArray() method, why doesn't it have a fromArray() method? The number of times I've needed to do this honestly does upgrade it from a method-I-should-have-write-myself-in-every-project to a this-is-completely-intuitive-and-easy-and-should-be-done-for-me level.
... Besides, if Python has it, why can't Java? :-P
Tuesday, November 10, 2009
iPhoto and the rapid death I wish upon Apple
Seriously, Apple? You're going to hide people's iPhoto libraries in a package? Sure, it hides the great big pile of shit that you call an organizational scheme. But it also hides anyone's photos from an uploading tool--I guess, that is, besides ones built into iPhoto.
No, really, Apple. Fuck you in the face, you horrible, horrible people. I can't wait until Google makes an OS and kicks your asses.
No, really, Apple. Fuck you in the face, you horrible, horrible people. I can't wait until Google makes an OS and kicks your asses.
Thursday, November 5, 2009
Oh Google
So, apparently, the internet is full of noobs.
I will grant that my question "does Java pass by reference or pass by value" was among those, but only if you grant that it was easily the most nuanced question up there.
I will grant that my question "does Java pass by reference or pass by value" was among those, but only if you grant that it was easily the most nuanced question up there.
Thursday, October 29, 2009
Moronic Means of Managing IT
I'm sorry, but when you're administering the serving of a database for students to access in a group project, it is absolutely ass-backwards to only allow them to access it from a wired connection, on campus. Every other resource in the department is available through the appropriate use of usernames and passwords, including an svn repo that I have been using without any problems, whatsoever. But for some reason, databases should not be accessible from the web, and should be restricted to specific IP addresses.
Are you kidding me? Is it really so hard to expect even just some amount of parallelism between policies? To have completely different philosophies on what is accessible from off campus and what is not, baffles me.
Monday, October 26, 2009
Minor JavaScript Sucess
I got JavaScript to remove the previous content of a page and create a whole new form area!
That is all.
Java API FTW
I'm no big fan of software engineering in general, and if you're not, you might as well just scroll on by here, but if you're looking to implement the Factory pattern, did you know that Java has a built in generic class called Class? All you've got to do is
- define an abstract parent class for your objects, (called PARENT here)
- with an abstract method that returns an object of its type, (called CREATE here) and then
- define the class that's going to generate your objects (called FACTORY here),
- with a method that looks something like:
As well, this actually throws an unchecked casting warning, so it probably needs a little tweaking. But everything else seems to upgrade the issues from a class cast warning (that you know of course won't happen, since C extend PARENT, and PARENT is abstract, and has abstract method CREATE that returns an object of class C)--from a class cast warning to a full-blown compiler error with the generics, so...
Sunday, October 25, 2009
Twitter and Javascript
So, here's some code for displaying your twitter feed in text.
Yes, a bunch of it's just referring to someone else's googledocs project. ... Whatever.
AJAX
So here I was, thinking AJAX was some magical combination of various elements. Apparently not.
At least, not on the client side. You just have an "XMLHTTPRequest" object that you
There. Ignoring IE 5 and 6 (which every sane person should do), there's your API for a client side AJAX script.
- define a field called onreadystatechange as a lambda function for what to do when the server hits you back,
- open() with options to
- read or write, like a file,
- locate the script running the server, and
- whether or not to run asynchronously
- send() after you've opened.
Subscribe to:
Posts (Atom)

