Apple Keyboards
rentzsch.com: Pulling a Double Shift:
"If you have a last-generation PowerBook or a MacBook Pro, here's some weirdness for you to try out:In fact, when you hold down both shift keys, a bunch of keys go dead. Function keys F1 through F9 become non-responsive."
- Fire up TextEdit.
- Press the Q key. A lowercase 'q' results.
- Press and hold the left shift key and press the Q key. An uppercase 'Q' results.
- Here's were it gets weird. Press and hold both shift keys and press the Q key. Nothing happens.
I have confirmed this particular weirdness and it happens in other applications as well.
Posted in web pages | no comments |
Where's your cave?
Rands In Repose: A Nerd in a Cave:
"It's an ominous name: Cave. It alludes to a dark, damp place where you are likely to be eaten by a grue. The irony is that the purpose of a Cave is not to insulate, its purpose is to germinate. I'll explain."
(Via joel:reddit.)
A Nerd in a Cave is one of the most interesting article I have seen in a while. In short, it epitomizes the crux of what being a programming nerd is all about. This is definitely the article to send to someone when you are sick and tired of explaining for the umpteenth time to someone else why you work the way you do.
Also, if you have never heard of a cave, you might just be interesting in making your own after reading the article.
Also, recommended: Nerd Attention Deficiency Disorder (N.A.D.D)
Posted in web pages | no comments |
Switchers
I read John Gruber's article about a week ago concerning how Mark Pilgrim has switched to Ubuntu after using the Mac operating system since its early days. Though there are very good reasons for switching, I decided that it was not a big deal for some long time Mac users to switch to a different operating system, especially if it is not Windows. After all, there must be a ton of users switching operating systems everyday, right?
However, today O'Reilly Radar posted an article on Pilgrim's switch. Pilgrim is joined by Cory Doctorow (he might be really famous to some, but to me he is just another contributor at BoingBoing, nothing more nothing less). And then after that article was released, it was slashdotted, generating a lot of comments. I suggest you go read that article first since there are a lot of valid points from both sides of the camp on this issue.
If this switch were to happen to a Windows user switching over Linux or Mac OS X, there will not be too much hype about it. In fact, Jason Kottke might be a bit presumptuous in saying:
"If I were Apple, I'd be worried about this. Two lifelong Mac fans are switching away from Macs to PCs running Ubuntu Linux: first it was Mark Pilgrim and now Cory Doctorow. Nerds are a small demographic, but they can also be the canary in the coal mine with stuff like this."
Switching operating systems is a rather normal part of a computer user's life. Only die hard fan boys will stick to their favorite operating system from bygone years even though there is no longer any support for it. I believe the hype is due to the fact that no prominent figure has yet switched from a Mac to another operating system. Especially since Cory Doctorow is supposed to have a Mac icon tattooed to his bicep somewhere. However, many fail to remember that Steve Jobs himself switched from a Mac (or Apple) to OpenStep. And subsequently, OpenStep was incorporated to become OS X. I am actually glad that he did. Before OS X, the Mac operating system was rapidly crumbling and losing market share. Steve saw that OpenStep was better than what OS 9 was. He took the plunge and was rewarded for it.
Similarly, I guess that both Pilgrim and Doctorow have seen that there is something better out there for them. In this case, it happens to be their little pet peeve with closed and proprietary file formats. For most people, this is not going to be an issue. After all, there are open source alternatives to most of the applications that come installed with OS X. However, as Pilgrim himself notes, he is going to miss a lot of the OS X applications. No, and I really mean no open source software on Linux can compete with iLife. Google's Picasa comes very close though as a decent iPhoto replacement.
Some people feel that they have been bitten by the closed source formats because they cannot switch applications to view the same files. Nonetheless, few realize that most file formats that Apple uses is actually easily exchangeable with other applications. For text, there is always plain old .txt or even .rtf and .pdf. For images, you can easily organize your photos by folders named by date and keep your photos in .png or .jpeg. Similarly, you can always elect to store your other information in plain txt. And most Apple applications allow you to do this.
Pilgrim himself gives an example of how his iTunes database was corrupted. He postulates that had the iTunes database been open format, he would have been able to try to recover it. I, and some of the people who left comments on this blog, have a better idea: back it up! Corruption is tricky thing. Sometimes recovery is possible, but that is if the file format is designed to support that in the first place by introducing some redundancies. Most of the time, a restore from backup is still the best option.
When the bough breaks [dive into mark]:
"Why keep running them on an operating system that costs money and restricts my rights and my usage?"
Because, as many people will tell you, some of us just do not have the time to fiddle with the settings in an open source operating system no matter how well documented it is. Some programmers just need to code in Java or Ruby. The internals of the operating system matters very little. Or imagine your normal school teacher. Would she care if the file format is proprietary or open source? So the question everyone should ask themselves: do I care enough about open source formats? Don't just drink the kool-aid that all open source software is good and benevolent and all closed source software is bound to lead you down to future incompatibilities. Pilgrim might have the clairvoyance to worry about being locked down to the Mac in the future. However, potential switchers should be prudent enough to weigh their options at the moment and decide on the best time to switch. It's anybody's guess how Apple might change their operating system in the future. While completely making it open source sounds a bit far-fetched (as I recall, all dying operating systems in the past became open source projects during their end of days. I will be interested to see the future of Open Solaris 10) Apple might just be more transparent with their file formats. So, holding off the switch might not be such a bad idea considering the pain that comes from switching from one of the more user-friendly operating systems out there to one where you have to actually edit a text file to change your screen resolution.
Anyway, my prediction on this? I supposed that some other people (who are already on the verge of switching, mind you) will see this as the impetus they need to switch from the OS X to some other operating system. However, this number is going to be small. And it is going to be offset by the number of people who switch from some operating system to OS X. Moreover, people who can think objectively by themselves will be able to make up their own decisions. And not be influenced by these two people, be they Mac Nerds or not.
Heck, if Steve Jobs leaves Apple, I might be tempted to switch too. Who knows what kind of operating system his successor might approve of. It's all a matter of time and the number of choices available. At the moment, Windows XP is definitely not worth switching to. But who knows, Vista might be able to offer something better? Or Linux distros might have gotten so much better in a few year's time that it is worth switching over? But right now, yes this very moment, I do not see any reason to switch from OS X. It serves me well and I do not really care about open source formats.
Oh yeah, by the way, no matter how hard Ubuntu becomes for these two prominent figures, I predict that they will NEVER swallow their pride and switch back. Well, maybe they will but that is another story altogether. And then we will get another round of excellent slashdot comments.
By the way, here is a link to an article on LinuxDevCenter.com. The author is a long time linux user and just could not get used to the restrictive nature of OS X. In such a scenario, I agree that it is a perfectly good reason to switch back to Linux.
Posted in paradigm, web pages | no comments |
Deface any website! Including this one
No, it's not a real defacement, but it is pretty fun. I could picture myself using the shooting mode on some useless sites. To join in the fun, head over to netdisaster.com
Posted in web pages | no comments |
What's a Ph.D in CS?
Stevey's Blog Rants: Wizard School:
"You hire a Ph.D., it's hit-or-miss. Some of them are brilliant. But then some subset of virtually every educated group is brilliant. The problem is that the notion of a Ph.D. has gradually been watered down for the last century. It used to mean something to be a Doctor of Philosophy: it meant you had materially advanced your discipline for everyone. Von Neumann, Nash, Turing -- people like that, with world-changing dissertations, they just don't happen that often anymore, at least not in CS. Well, they probably occur at the same frequency, but it's one in a thousand at best.
Instead, what usually happens is a bright young Ph.D.-to-be chooses a school based on expedience: finances, or location, or parental pressure. There might be a dozen or so advisors to choose from, and the department as a whole has only one or two really big, prestigious areas of focus, areas for which the school is known (and hence funded). So if a kid goes to a school that does a lot of X, chances are pretty damn good the kid's going to do her Ph.D. thesis in X. But it's probably specialized to death, and the kid will wind up working for years on some tiny slice of almost-nothing: little prototype mobile doodads that track forest monkeys or something. And the kid will lose faith, stop hoping their thesis will ever mean anything, and they'll go through the motions until their advisor pities them and lets them defend."
Go read the article. It's (mostly?) fictitious but it does incorporate some snippets of truth.
Posted in readings, web pages | no comments |
Exploding and swelling laptops

My mom is using a Dell. I sure hope that it is not the same model that exploded above. The hot and humid weather here is just within the ideal temperature range for operating the laptop. But you never know what can happened. I bet they people in the picture were operating that laptop inside an air-conditioned room. It's most probably an isolated case but it is still dangerous. Imagine if your clothes caught on fire.
The MacBook Pro is not that safe as well. There have been pictures circulating about the swelling batteries that plague the earlier models. And here is something that is rather disturbing: a distended battery:

Posted in web pages | no comments |
When a search engine advertises on TV, something is not right
Ask.com Promoting Hard Via Commercials:
"2.) The commercials creep me out. They royally creep me out. I don't think chimps, apes, orangutans or any type of primate is funny. I hate commercials that put primates in people clothes, though not as much as I hate commercials or movies that make people look like apes. It just seems like such a cheap trick to me, old and overdone. I would have expected something more innovative from Ask."
If you have not watched them, you can find them here.
The features that are highlighted are useful but it would not be the deciding factor for which search engine people use. Just try searching for a phrase and then compare the results from Ask.com and Google. Even with all so called nifty features, Ask.com has much less results. Maybe they would claim that their searches are more relevant compared to those from Google but relevance is a very subjective term. And when everyone is free to define their own relevance, more choices is usually better.
And those features are nothing new. A couple of other search engines already have it. Unless you have something really nifty that people cannot understand (which means that it is a bad idea in the first place) you should really not be advertising.
Anyway, back to the point. Advertising on the TV for an Internet search engine seems to imply certain doom.
Posted in paradigm, web pages | no comments |
Software engineer and college professor are the best jobs in America
"MONEY Magazine and Salary.com researched hundreds of jobs, considering their growth, pay, stress-levels and other factors. These careers ranked highest.
1. Software Engineer
2. College professor..."
(Via Slashdot | Software Engineers Ranked Best Job in America.)
Just the motivation I needed to continue with graduate studies in software engineering. I am seriously thinking of working as a software engineer or a college professor. And this decision was before this ranking was announced. It is either one of the other, does not seem that it is possible to be both. A college professor sounds more interesting though.
Posted in web pages | no comments |
Coding Like a Girl
Beautiful code, test-first - Signal vs. Noise (by 37signals):
"I was talking with a friend recently and discovered we have a failing in common: we both have a tendency towards a peculiar form of perfectionism. He was telling me how he feels like he has to sit and tweak his code over and over until it not only acts right, but looks right. It cannot be merely functional, it must be beautiful, as well."
(Via Code Like a Girl.)
While programming in Squeak, I find that I am compulsive about making the code beautiful. And the Smalltalk language makes that really possible because of its syntax. Also, reading the book Smalltalk: Best Practice Patterns helps too. And I do not mean doing ridiculous stuff like making beautiful function headers. I mean making Smalltalk code look like it should: short, simple and human readable.
I am not an expert at this, but from looking at the source code and reading the book, here are some of the things that I notice.
- Minimal comments
Some people like having comments there. I agree that sometimes comments are necessary but with code like Smalltalk or Ruby, having comments would easily make the ratio of comments to code increase dramatically.
Bin >> run
"Tell my station to process me."
self station process: self
- Put methods in the right protocols
I am not sure why other languages do not have this facility, but you can group methods in Smalltalk into protocols. This makes it really easy to see those methods that you need. For instance, want to find out how to create the object, look at the methods in theinstance creationprotocol. Want to convert from objectA to objectB? Look into theconvertingprotocol. Grouping methods into the proper protocols really makes it easier to find those that you need. - Use polymorphism instead of compare statements
Smalltalk did away with long if...else and case statements. And because of that , it forces you to think in a more dynamic sense as well. - Short methods
Most methods in Smalltalk should be about 3 - 4 lines of code. And this is actually enforced by the way that methods are being displayed in the code browser. Unlike traditional source code viewers, in Squeak, you can only view one method in one window at any time. Of course you are free to open multiple windows, but each window can only show one method at a time. And the size of the pane for showing the method is not that big either. So it forces you to write short methods since it is really hard for you to keep track of stuff otherwise. - Using collections
Smalltalk provides a rich set of collections: Arrays, Dictionaries, OrderedCollections, SortedCollections, Sets, etc. In fact because these collections are so fundamental, they are being used everywhere. It is completely nonsensical to cook up your own data structure when there are so many provided for you. - Readable code
chatSession sendMessage: 'Hello there!' to: 'myfriend@friend.com'
You understand what it means instantly because it reads correctly. Not many languages out there have the sense to make their parameters key-word based.
The point being that code that is not following those standards feel really, really bad and sloppy. It is almost like leaving spaghetti stains on your white shirt. Sure no one would care about it since you are still clothed and all, but it just becomes an eye sore.
Regardless of the programming language, one should always stick with the proper convention of doing stuff. Program in C, stick to the C convention. Program in Java, stick to the Java style.
Posted in development, web pages | no comments |
Interviewing Ruby Programmers
Interviewing Ruby Programmers - O'Reilly Ruby:
"Compare and contrast Ruby with your second-favorite language.
...
Describe any two features you'd remove from Ruby to improve it, and explain what changes would be required in the lexical analyzer, bison parser, and interpreter in order to effect these changes.
...
Describe in detail the name-resolution chain for constants (i.e., if you reference a Constant in your function, where does the interpreter look for the definition of that constant?)
...
If you were to write a Ruby Style Guide for your company, what are some of the things you'd put in it? Would you include a maximum line length? If so, how long would it be?
...
Can you think of any possible justification for the Ruby on Rails core source code using a line-wrap width of 500 characters, or whatever the hell it is?
...
Pick any five C++ or Java 'design patterns' and explain how to accomplish the same effect in a tiny amount of Ruby code.
(Can you tell I'm a harsh phone-screener?)"
These are not your average interview questions. Instead of asking how you would solve a problem, they are asking how much you know about the language. In this case, they are asking about some of the features of Ruby that distinguishes it from the rest. Unless you have been programming long enough in Ruby and have used some of its advanced features, this is probably going to be a very bad round of interview for you. There are of course ways to answer all of those questions, but you must ask yourself, is the Ruby way? If those questions were asked in Java, there is also a Java way of doing things. Now, the question remains, who asks such questions?
The author is certainly a die-hard Ruby fan. But then again, he is trying to recruit the best Ruby programmers. And those questions above are not his only set of killer questions. If you go and read his article, he is going to ask all sorts of other stuff that I doubt most people would know (well, maybe I am wrong, but the people I have worked with do not really know this). Stuff like metaprogramming (which is language dependent) is something that he considers very important for a Ruby programmer.
Bottom line, if someone passes all those questions, he is certainly a good candidate for hire. And I mean a real good candidate. For bonus points, if he or she can answer all the above questions (with some modifications) for at least 2 other languages, you definitely have a good hire. Or do you? Wouldn't you be scared that one day he or she will higher paid than you?
Posted in paradigm, web pages | no comments |