September 19

Faster! Faster! Fox!

Today my webbrowsing with Firefox just got a little bit better since I stumbled upon the FasterFox extension. I have been reading here and there about tweaking the network configuration (hint: type about:config in the address bar) to get better network mileage when browsing but FasterFox brought everything under one roof. It provides 4 preset configurations ranging from default(non-optimized) to turbo-charged (increased webserver load) and an option to customize the settings to your liking.

 I only used the optimized preset and the difference was very noticeable. I am satisfied with that setting so I opted against trying the turbo-charged setting since that will just add to the webserver load for a few measly seconds. A few seconds is not enough justification for being greedy. πŸ™‚

ciao!

August 22

Extra-terrestial browser

Existence of extra-terrestial browser has been confirmed when visitors from outer space left clues to what tool they use when surfing the intergalactic information super-highway…

http://lug.oregonstate.edu/gallery/firefox-crop-circle/mg_5491_1
http://lug.oregonstate.edu/gallery/firefox-crop-circle/mg_5572
http://lug.oregonstate.edu/gallery/firefox-crop-circle/mg_5587
http://lug.oregonstate.edu/gallery/firefox-crop-circle/mg_5491_1
http://lug.oregonstate.edu/gallery/firefox-crop-circle/mg_5572
http://lug.oregonstate.edu/gallery/firefox-crop-circle/mg_5587
http://www.youtube.com/watch?v=-DsHlev5Dg4

Credits to Ariz and Gideon for providing the links!

πŸ˜€

ciao!

Category: FLOSS, Humor | LEAVE A COMMENT
July 18

Wanted: Optical trackballs

I am currently on the hunt for a good optical trackball for use here in the office. Apprently trackballs are a dying breed in today’s computer marketplace. I have hit a couple of online computer stores here in the Metro and nobody carries any trackball, even the non-optical kind. I also went to TipidPC to see if any enterprising individuals is offering or offloading an optical trackball. Nada, not even a single trackball hit.

I have also scoured the Glorietta shops since that is the nearest mall in the office and the only thing I saw was an overpriced Logitech wired trackball that seems to belong to the first generation of pointing devices.

Hopefully I can see a good trackball when we go malling this weekend . Neth still owes her nieces and nephew a trip to ‘Hall of Asia‘. πŸ™‚

ciao!

May 12

LLTHW: Importing Eclipse projects

I thought I was starting a new acronym but it seems NetHack has already first dibs on Lessons Learned The Hard Way. πŸ˜€ Anyway, any posts that I tag with this acronym should be self-explanatory. πŸ˜€

One of the training machines we are using is encountering a weird error because the user could not launch the plugin project for debugging. To make the matters worse, the error message just contains an empty string. The other machines does not seem to exhibit the problem.

After an hour of trial and error, we finally figured out the problem. Eclipse does not like importing projects that are placed in the C:\ (or root drive). The solution was to place the project code base in a intermediary directory (C:\Something) and then proceed with importing it in the workspace.

I do not know the rational explanation for this one and my initial google searches does not reveal anything that is remotely related. I will just chalk this one as a lesson learned the hard way.

ciao!

March 16

WordPress write functions resulting to a 404 (page not found) error

This week I encountered an error when writing the wget post since saving or publishing it causes a page not found (or 404 in techie parlance) error. I found this thread in the wordpress support forum and tested the “limit” scenarios which did not fully apply in my case. Posting a short test message works but somehow even one paragraph from my wget post causes the 404 message.

Later on the support thread I read a mod_security issue that causes in the post with the word curl in the post. That hit me, curl is a download utility similar to wget!!! Just like in the post, I just enclosed wget in span element and voila, problem solved!

+1 karma for internet support groups!

March 13

Using wget

I use wget from time to time (via cygwin when I am in the office) but the most I have used on its parameter is the -c option. This post is a reminder of the options and tips that I could use and have used for the wget utility. Why not just consult the manpage? It is because it is easier to put it here for further reference. There are a thousand wget tutorial sites out there, so why waste space here? The answer to that is because I can. πŸ˜›

Usage: wget [options] URL

  • Instead of specifying the proxy using the environment variable http_proxy, consider putting it in /etc/wgetrc instead. Not advisable if you dont have a consistent single source of connection (e.g. prepaid cards,etc)
  • -c – continue the file being downloaded. nifty if you are downloading a big file although it requires the download site to support resuming.
  • –user-agent=”UA_STRING” – based on a tip from the PLUG list. Spoofs the user agent to look like the download request is from a browser. This is good for sites that disallow dowloads from download managers. Example would be -user-agent="Mozilla/4.0 (compatible; MSIE 5.0b1; Windows NT 5.1*) "
  • –limit-rate=[number] – limits the download rate so wget does not hog all the bandwidth. Appending a k at the end of the number signifies kilobytes per second.

More updates as I use more options. πŸ™‚

January 18

Tidy XML configuration for PSPad

Working in Windows in inevitable but that does not mean that I am without the good things that the Free Software (FLOSS or otherwise) has to offer.

My previous text editor of choice was UltraEdit but not all of my project has license for it so I started to look for “worthy alternatives”. The closest alternative that I found and currently use is PsPad which has most of the functionalities offered by UltraEdit, and then some.

Since my work brings me into contact with a lot of XML-type of content, the built-in tidy support is very useful especially if I want to do comparison (but I use WinMerge for that). Below is my configuration for XML pretty-print:

[TiDy Fix XML indent]
input-xml:yes
indent-attributes:yes
break-before-br:no
doctype:AUTO
fix-bad-comments:yes
indent:yes
indent-spaces:4
markup:yes
output-xml:yes
quiet:yes
tidy-mark:no
uppercase-attributes:no
uppercase-tags:no
wrap:100
wrap-attributes:yes
write-back:yes

F/LOSS life is sweet. πŸ™‚

ciao!

November 29

One liner: get the last field

Problem: I need to get a list of all java libraries in our repository so I can create a matrix of when they are being used and what is type of license they are using. I tried using a pure Windows approach but it is taking too much time so I used Cygwin instead. Getting all JAR files is easy with find but I am having difficulty brewing the correct regexp syntax so why prolong the agony and not switch to another tool instead: awk!

find . -name *.jar | awk -F/ ´{$NF}' | sort | uniq

where:

– find searches recursively from the current directly for all files that end with ‘.jar’
– all resulting file paths are piped to awk which, using the forward slash as the column delimiter, prints out the last column
– and finally the list of JAR files are sorted alphabetically and duplicates are removed.

This could probably be done in a whole lot of ways (perl, python, sed, etc.) but the beauty of FLOSS is we can use whatever we can to get the same result. πŸ˜€

ciao!

August 29

Some Java and MySQL Connector/J tips

Ok, I and others have been bitten by some of these oversights so I hope it will be of some use to some:

1. Dont use the jar file ending with -g. That will require the aspectj libraries which is a paradigm for simplifying inclusion of boiler plate code (e.G. Debugging, etc.). Use the other one.

2. At least in the development phase: DO NOT WANTONLY OVERRIDE EXCEPTION MESSAGES AND STACKTRACES. They may seem ugly but they have their purposes. Handle the exceptions but output the error somewhere to help you debug. You can remove the debugging statement later.

As an added tip, use a unique word to tag statements that you will remove later (e.g. prepending System.out.println messages with “[REMOVE]”) to facilitate search and remove later on. Or use the task feature of Eclipse if you are using it (i.e. start a comment with “//TODO” and it will appear in the task list) .

3. Use PreparedStatement calls whenever possible. However, DO NOT USE them when executing SQL INSERT statements with embedded SELECT statements. Construct your SQL statement via plain-jane string manipulation and execute them with Statement objects.

When constructing SQL statements for PreparedStatement objects, escaping strings that will be dynamically specified are not required. Just make sure that the question marks have spaces before and after.

4. The latest MySQL Connector/J drivers require JRE 1.4.x. Aside from that, aim for the lowest JDK possible to ensure maximum compatiblity. Java Runtime Environments are usually backward-compatible.

5. Modularize your code. This way you can do unit tests on your methods before integrating them to the main code structure.

6. Maximize comments. Make sure you create comments for all methods (no matter what the scope is) to describe what it needs to do. It is also good to create multi-line comments on how you would proceed in the body of the method. It gives focus on what you need to do and what will come after it.

I’ll just post additional ones as I encounter them.

ciao!