Irritating Checkbox margin

The IE checkbox has a margin/padding around it that cannot be removed even by setting both of them to zero. You can observe it by checking it and looking at the dotted line surrounding it. Firefox doesn’t have this issue.

http://www.webmasterworld.com/css/3282586.htm

This forum gives the solution as setting its height and width to 13. I tried 12, and the checkbox was shrunk…

Linux Antivirus

Quote of the Day:

With Linux you actually get to use your system’s resources for doing what you want to do, not for running a whole bunch of utilities designed to protect it. Linux is protected by its design, not by third party products.

– simongrahamuk (http://www.certforums.co.uk/forums/thread8164.html)

Was helping to look for Linux antivirus and came across the above comment. Come to think of it, it sounds dumb to run Windows plus a suite of programs on top just to protect Windows. Then again if Windows tries to build more security into its OS will it become another anti-competition saga?

Escaping

I’ve always felt that networking problems and concepts are useful in application programming as well, as the problems will appear again at a higher level. Escaping is just another one of them.

In networking, signals/packets have special sequences to indicate special conditions such as the end of a frame. However the same special sequence may appear in data. By escaping and the sequence in the data, the receiver will be able to interpret the packet and the data correctly.

At the application programming level, the simplest example is with a quoted String: “This String has “some” quotes.” The some is being quoted in a quoted String. Escaping typically defines an escape character, such as a backslash (\). Therefore when the quote is prefixed by a backslash, it is interpreted as a data quote. All other special characters can now be prefixed with a backslash to indicate it is a special character.

Using an escape character causes another problem: the backslash now cannot be represented, and requires escaping as well. Using yet another escape character may solve the current problem, but it causes the same problem again. The usual solution to this is to use the escape character itself to escape itself. Therefore a backslash is represented as a double backslash (\\).

Other common escaping examples include VB quotes (” becomes “”) and HTML entities (< becomes &lt;). Thus the next time you encounter problems with data containing control sequences, think of this solution! 1. Escape all control sequences using an escape sequence. 2. Escape the escape sequence using itself.

The geek is alive

There’s a lack of new posts here. On the contrary, it doesn’t mean I’m not hitting nice problems to post, but its overwhelming that I’ve no time to post all of ’em. In the meantime here’s a few links to keep you occupied (if there were really any visitors to this site…)

http://ask-leo.com/what_is_thumbsdb_and_can_i_delete_it.html

Explains layman tech stuff to layman in layman terms. Great when you have laymen asking you tech questions.

http://www.computerworld.com/action/article.do?command=viewArticleTOC&specialReportId=9000342&articleId=9024364

Computerworld’s “100 Best Places to Work in IT 2007”. I happen to be in one of them, but I’ve yet to feel that its a good place yet. Maybe a few more years.

Symbols

Ruby symbols are so regularly used but are mystic to the amatuer developer. There’re several explanations what they are and how they should be used. To me, they are String constants, whose value is the name of the constant itself. Therefore :something contains the value “something” and cannot be changed.

This is preferred over using “something” in Ruby directly because unlike Java it doesn’t have a String pool and using “something” over and over creates separate String objects in memory. As such, symbols are useful if a particular String is repeatedly used in your application. Now go read again about the confusing stuff about being able to to_i and being an instance of a Symbol class. It should make a little bit more sense.

Ruby on Rails

Its somewhat amusing for me to be working on RoR. First I don’t really know the langauge, even though it OO it’s cryptic enough to a Java programmer. Second I’m literally amused by its syntax, such as:


return true unless read_fragment(name)

when_fragment_expired 'fragname', 20.seconds.from_now do
end

Also things like gem (Ruby, Gem, get is just as clever as the way Java Beans and Jakarta project relate to Java itself. Anyway, here’s a vid to tell you it’s the end of JARs…

http://www.youtube.com/watch?v=PQbuyKUaKFo

IE renders web page bigger than FF

If for an unknown reason your Internet Explorer seems to show things bigger than Firefox, and you’ve checked that it’s not the Text Size, it may be because of your screen DPI settings. The most obvious symptom is when images in IE appear larger and low quality (jagged edges) due to the enlargement.

If so, open your Display Properties, choose “Advanced” under the “Settings” tab. The view here might vary by display card, but look out for an option for DPI settings. For my case I was having 120dpi instead of 96dpi. Once I changed it back and restarted the machine IE was doing fine. However doing so makes my other screen fonts too small on the high-res monitor.

To fix that you’ll have to manuall adjust the fonts in the Display Properties again. I was too lazy so I switched back to 120dpi again, and stayed with the IE tab plugin…

Anonymous Inner Class Constructors

Have been writing anonymous inner class for many years, when I suddenly hit a question today while writing a quick dirty test class. I needed to initialize stuff within the anon inner class, but how?

Found this link to teach me how to do that — just by using braces { }.

Musings of Laurie

Solved my problem, but had me thinking. I can’t call super() to call the parent constructor, what if I do not want to override the default constructor? After an hour of thinking, I realized the answer was right there too. To declare the anon inner class I have already specified which constructor to call before the declaration of the anon inner class, like this:


// i'm calling the JButton(String) constructor
new JButton("asd") {
  {
    // override constructor
  }
};

Certification doesn’t mean you know and remember everything!

System Quality

A lot of software is being produced today. Yet I personally feel that there are many that do not meet quality standards. Granted, there’s no perfect system and bugs will exist in systems, but how many are really satisfied with the system the wrote? How many admit to themselves that despite being launched, it’s not good at all?

Reading this reminds me of the comparison between completion and success. Systems that get to production are just completed but may be barely usable, or even helpful in the production environment. I’ve seen systems that are so difficult to use and buggy that manual processes have to be employed in tandem with the system. It actually results in double work instead of achieving any efficiency.

In this era where software houses compete to offer the lowest price to build a system; where anyone can pick up a book or read an online tutorial and be able to code; the quality of systems will only hit an all-time low. When that happens software will not be bought because it is cheaper (or even free), but at how stable it is and how well it is able to perform its intended function. This should help promote the necessity for the quality of system, and in turn, the quality of developers.