September 07, 2007
Make Your Computer Sing With Festival
Festival is a free speech synthesis system from The Centre for Speech Technology Research at The University of Edinburgh in Scotland. Besides doing typical Text to Speech tasks that most operating systems can do today, Festival has a special Singing mode, which can accept an XML input file full of words to sing, pitches, and durations. Here is an example from the documentation:
<?xml version="1.0"?>
<!DOCTYPE SINGING PUBLIC "-//SINGING//DTD SINGING mark up//EN"
"Singing.v0_1.dtd"
[]>
<SINGING BPM="30">
<PITCH NOTE="G3"><DURATION BEATS="0.3">doe</DURATION></PITCH>
<PITCH NOTE="A3"><DURATION BEATS="0.3">ray</DURATION></PITCH>
<PITCH NOTE="B3"><DURATION BEATS="0.3">me</DURATION></PITCH>
<PITCH NOTE="C4"><DURATION BEATS="0.3">fah</DURATION></PITCH>
<PITCH NOTE="D4"><DURATION BEATS="0.3">sew</DURATION></PITCH>
<PITCH NOTE="E4"><DURATION BEATS="0.3">lah</DURATION></PITCH>
<PITCH NOTE="F#4"><DURATION BEATS="0.3">tee</DURATION></PITCH>
<PITCH NOTE="G4"><DURATION BEATS="0.3">doe</DURATION></PITCH>
</SINGING>
I decided to create a song based on a Barbershop Quartet from a book in my collection. To do this, I created one XML file for each of the four parts and played them individually while recording them into an audio program. Then I combined them all into a single audio file. Voila! Here is the final product - a computerized version of the song M-O-T-H-E-R:
Mother.wav (6 MB)
Mother.m4a (580k, for iTunes and QuickTime)
Here are the XML files I created that were inputted into Festival:
mother1.xml
mother2.xml
mother3.xml
mother4.xml
Lyrics:
M is for the million things she gave me.
O means only that she's growing old.
T is for the tears were shed to save me.
H is for her heart of purest gold.
E is for her eyes with love-light shining.
R means right and right she will always be.
Put them all together they spell MOTHER,
A word that means the world to me.
NOTE: Keep in mind that only the source code for Festival is officially released. If you wish to use it, you will need to either build the binaries from the sources or find the binaries somewhere online. I was able to get the Windows binaries from a project called Flinger, which uses speech synthesis to sing based on a MIDI input. I did notice that Flinger did not include all of the configuration files needed for singing via an XML, so I had to also download the Festival sources and add them to my Flinger install. You might have to play around with it a little bit, but you should be able to get Festival/Flinger to sing from an XML file without too much trouble.
Posted by Chuck at 03:58 PM | Comments (0)
July 02, 2007
How to Convert a YouTube Video to an Animated GIF
With the right tools, it is very easy to convert a YouTube video to an animated GIF in a nearly automated way. This tutorial should work roughly the same way on any operating system as long as you have the required tools:
1. Make sure you have access to all the required tools. As far as command line tools go, you will need wget, grep, sed, and xargs. These come with almost all Linux installations, or on Windows, you can use Cygwin. In addition, you need to have MPlayer installed.
2. Create a script called youtube.sh on the file system with the following contents:
wget -q -O - http://www.youtube.com/watch?v=$1|grep "/watch_fullscreen?.*video_id=.*\&t="|sed "s/^.*\&t=//"|sed "s/\&.*//"|xargs -i wget -O $2 http://youtube.com/get_video?video_id=$1\&t={}
Make it executable by typing chmod +x youtube.sh
3. Find the YouTube video you would like to convert. Make sure it is short, as a 5 minute video will become an animated GIF that is about 36 MB. The URL for the video should look like the following:
http://www.youtube.com/watch?v=34Sb0hGUNIQ
Note the part after the ?v=, e.g. 34Sb0hGUNIQ. Copy this code to your clipboard or write it down.
4. Run the script as follows:
./youtube.sh 34Sb0hGUNIQ ducktales.flv
This will download the video to your computer in Flash Video format. The file will be called whatever you specified when you ran the script, e.g. ducktales.flv. Now we just need to use MPlayer to convert it to an animated GIF.
5. Do the conversion by typing:
./mplayer -vo gif89a ducktales.flv
It takes about as long as the video normally runs in order to finish converting. When it is done, there will be a new file in the same directory called output.gif. Try dragging it into a browser to see it run.
You have just successfully converted a YouTube video to an animated GIF! Click here to see the final output. Note that if it seems slow, it is most likely because the video (7.5 MB) is still loading.
![]()
Posted by Chuck at 03:51 PM | Comments (2)
June 06, 2007
Firefox, Gmail, and GPG Encryption with FireGPG
FireGPG is a FireFox extension that hooks into GPG to allow you to encrypt, decrypt, sign, and verify text in the browser using various encryption keys. Though it can work with any text in the Firefox browser, there are also special buttons that appear specifically in Gmail.
For those who don't know, GPG is a GNU version of PGP, which allows data to be encrypted and sign via public and private keys (among other features). GPG is command-line software, but FireGPG hooks it into Firefox in a completely graphical way.
The first step to getting started is to install GPG on your computer. It is available for many operating systems, and can be downloaded here. Make sure to download the binaries for your specific operating system. As an alternative to installing on a Windows machine, you can also install Cygwin and add the GPG package during the Cygwin installation.
Once GPG is installed, you should install FireGPG. The install is very similar to other Firefox extension installs. Make sure to restart the browser when you are finished.
Now that you have both pieces of software installed, you need to make sure that the Firefox extension has the proper path of your GPG install. In Firefox, go to Tools --> FireGPG --> Options. If you get a message about how GPG cannot be found, manually change the path in the options window to the 'gpg' (or gpg.exe in Windows) command in your filesystem. The other options can be left alone, though you can definitely edit them if you have a need.
Now that the Firefox extension is configured properly, we need to generate a private / public key combination for you. Once this is done, you can give other people your public key and they can encrypt messages and send them to you. Only you will be able to decrypt them since you have the private key (and the password you will create). In addition, you can sign a message with your private key and when you send it to others, they will be able to verify that it actually came from you with the public key.
From the command line (in Windows, click on Start --> Run and then type 'cmd' and click 'OK'), change to the GPG directory (in Windows, type:
cd "\Program Files\GNU\GnuPG"). Then, type 'gpg --gen-key'. Follow the instructions to generate your key. You can always hit Enter to accept the default, which is probably a good idea unless you know what you are doing. Make sure to enter your real name and email address. The comment on the key is optional. Once you finish following the prompts, your key will be stored in the GPG keystore. You can now close the command line window.
Now that you have your own key, you want to give others your public key so that they can send you messages. Open Firefox and go to Tools --> FireGPG --> Export, choose the key you just created and click OK. Your public key will be displayed in a new window. Copy the entire thing and paste it into an email, document, etc. in order to give your key to others.
Likewise, other people will most likely be giving their public keys to you so you can send them encrypted messages and verify their signature. To import a key, highlight it on a page in the browser. You can use my signature as an example. Right-click on the selection and choose FireGPG --> Import. Assuming the key is valid, you will see a message that it was imported successfully.
To send someone an encrypted message, highlight some text in the browser, right-click and choose FireGPG --> Crypt. A window will appear asking you to choose which public key. Choose the public key of the person you are sending the message. The encrypted text will appear. Copy the entire thing into your message and send it to them. If you are using Gmail, you can use the new buttons that appear while creating a message for encrypting, signing, etc.
If someone sends you an encrypted message with your public key, you can use your private key to decrypt it by highlighting the message, right-clicking, and choosing FireGPG --> Decrypt.
FireGPG also makes it very easy to sign messages and verify other messages that are signed. To sign a message with your private key, highlight the message, right-click, and choose FireGPG --> Sign. To verify a message that someone has signed with their private key, highlight the signed message, right-click and choose Verify. The window will then prompt you to choose the public key of the person that signed it. Assuming the message verifies, you will get a message saying the signature is valid.
Keep in mind that while FireGPG works great as is, it is still actively being developed, so new features and fixes should be released regularly. There is an active forum that people participate in for troubleshooting and bug reporting. For instance, users have requested to be able to sign and encrypt a message at the same time. In addition, many users do not like the command prompt windows that open and close quickly when using FireGPG with Windows.
As you can see, FireGPG makes it very easy to encrypt / decrypt and sign / verify messages in Firefox, as well as import public keys. Give it a try and you will see how easy it is to use FireGPG once it is installed. Feel free to send me a message using my public key to chuck at chuckcaplan d o t com and I will respond.
Posted by Chuck at 01:09 PM | Comments (0)
March 01, 2007
Thank Goodness for Wikipedia
I have always been fascinated by Wikipedia. Even though it shouldn't be used in academic papers, it is still a great resource for finding information on just about anything. There are times that I can go on and just go from page to page, finding information about any number of random things I never would have thought of. I think this comic sums it up nicely:
By the way, you can download the little Java app I wrote to make this entry HERE. Just pass in the text file to be converted as an argument. Jakarta Commons IO is required for runtime.
Posted by Chuck at 11:17 AM | Comments (1)
February 02, 2007
What are the Best Super Bowl Squares?
While I don't typically gamble, almost every year I take part in a friendly Super Bowl Squares Pool. This year I thought it would be fun to figure out which numbers win most often, to sort of gauge my likelihood of winning. I figured that 0, 3 and 7 would be the best numbers, just because a team is very likely to either not score or score once. However, I was not sure just how good these numbers were.
To come up with the answer, I started to manually add up all the scores from every Super Bowl using Wikipedia. Then my good friend Chris Federowicz decided to write a PERL script to do the same thing. Here are the results. Each number, 0-9 is shown, as well as how many times that number would have won the pool for a single quarter:
Digit 0: 91
Digit 1: 16
Digit 2: 8
Digit 3: 51
Digit 4: 34
Digit 5: 8
Digit 6: 26
Digit 7: 63
Digit 8: 9
Digit 9: 14
As you can see, 0, 3 and 7 are the big winners, with 1, 4, 6 and 9 coming in much lower. 2, 5 and 8 hardly won any at all.
Since my numbers this year are 9 and 8, I will be needing some serious luck.
UPDATE:
Part 2 of the results - Most popular combinations of scores (Thanks again Chris):
0, 7 = 19
0, 3 = 15
0, 0 = 12
0, 4 = 10
4, 7 = 10
3, 7 = 10
3, 6 = 7
7, 7 = 6
3, 4 = 6
3, 3 = 6
0, 9 = 5
0, 6 = 5
6, 7 = 5
0, 5 = 4
0, 2 = 3
1, 7 = 3
1, 5 = 3
0, 8 = 3
6, 8 = 3
1, 4 = 3
0, 1 = 3
7, 9 = 2
4, 9 = 2
2, 7 = 2
6, 6 = 2
5, 9 = 1
8, 9 = 1
2, 9 = 1
6, 9 = 1
1, 6 = 1
1, 8 = 1
2, 4 = 1
1, 9 = 1
2, 8 = 1
4, 4 = 1
1, 3 = 1
Posted by Chuck at 01:51 PM | Comments (0)
January 25, 2007
OpenSearch Digg Plugin for Firefox 2 and IE 7
I created my first OpenSearch plugin, which searches stories at Digg. When you install it, if you are using Firefox 2 and above, Digg will be added to the search engines to the top right of the screen. It will also work with Internet Explorer 7. Thanks to Justin for testing.
To install, click here. The source can be found here.
Posted by Chuck at 02:58 PM | Comments (0)
January 18, 2007
Introduction to AJAX
An introductory article about AJAX that I have written has been published in the January, 2007 edition of System i News. Access to my specific article would typically require a paid ProVIP subscription. My contract for this specific article, however, allowed me to post the full contents online:
Posted by Chuck at 10:17 AM | Comments (0)
September 01, 2006
A Quick Printer-Friendly Page In Javascript
In my job, we often have to make printer-friendly views of pages that do not include various headers, footers, and menus so the user can print out exactly what they need.
This can be done either manually (e.g. creating a new page with the content to be printed from scratch) or by having a separate CSS stylesheet that does not display the header, footer, and menus (make sure media="print" is in the stylesheet declaration).
One thing that we have noticed is that with the CSS solution, users still want the link to the printer-friendly page, even though all they have to do is print the original page and the printer-friendly version will be printed. Therefore, we had to figure out a way to have a printer-friendly link that could be easily added without us having to manually make printer-friendly pages for each page that needs to be printed. Enter Javascript.
The following HTML code has a DIV tag with the content that needs to be printed. The printer friendly link simply opens a new window to the page print.html. Since print.html knows it was opened via another HTML page, it can use Javascript to access the calling page and output the contents of the caller's DIV tag on its own page. Since the only thing showing on print.html will be the content that needs to be printed, the user can manually print that page like they would with a normal printer friendly page.
The advantage of this is that the only code needed is the 1 line of Javascript it takes to access the calling page's DIV tag. A disadvantage is that at this point, the id of the DIV tag must be hard-coded, though I am sure it can be passed to the printer-friendly page with little modification.
Calling Page:
<html><head><title>Calling Page</title></head><body>
HEADER GOES HERE<br><br>
<a href="print.html" target="blank">Printer Friendly Version</a>
<div id="mainContent">CONTENT I WISH TO PRINT</div>
<br>FOOTER GOES HERE
</body></html>
Printer-Friendly Page (print.html):
<html><head><title>Printer-Friendly Page</title></head><body>
<script language="javascript">
document.write(window.opener.document.getElementById("mainContent").innerHTML);
window.print();
</script>
</body></html>
Posted by Chuck at 11:17 AM | Comments (3)
June 27, 2006
KeePass Password Safe - Manage all of your passwords easily.
When it comes to passwords, most people only have one, which they use for a multitude of machines and websites. The problem with this is that anyone who finds out that one password now has your password to everything. In addition, if you ever decide to change that password, it would be very time-consuming and you probably would not be able to remember all the places that you need to change.
Enter KeePass Password Safe. KeePass is a password manager and secure password generator that allows you to have a different password for each website you frequent. In fact, I don't even know any of my passwords except for the one password needed to get into KeePass. All I know is that they are all different and they are all a jumbled mix of letters, numbers, and other characters.
Now, if someone hacks a website I frequent and gets access to my password, they will not be able to log on to anywhere else because all my passwords are different.
Some other features include an optional key-disk (so even if someone steals my password file and knows the master password, they still won't be able to access anything without the key-disk), a secure password generator, the ability to export the database, and support for multiple languages. The program also allows you to categorize your passwords into different groups (shopping, discussion boards, etc.) and can put an expiration date on passwords that need to be changed after a certain length of time.
Of course, KeePass is open-source so if there is a feature you want, you can always add it (the program is written in C++). There is also a plug-in architecture that you can take advantage of to extend the program even more.
The core KeePass program is only for Windows, but there are ports to Linux, Mac OS X, PalmOS, and Pocket PC so it can be used pretty much anywhere. I would recommend keeping your password file on a USB drive or FTP site so that you can easily access it from anywhere.
Give it a try. I am sure that once you do, you will wonder how you functioned without it.
Posted by Chuck at 04:50 PM | Comments (1)
June 19, 2006
In the Trenches – J2EE Software Developer
The technology job search-engine Dice.com recently published an article in their Career Resources section that I wrote about getting a job as a Java Developer. The article explains what beginning Java programmers should know about interviews, what companies are looking for, what skills they should have, etc.
Posted by Chuck at 01:21 PM | Comments (0)
June 15, 2006
Survivor
I'd like to veer away from my usual technical posts and instead post an abbreviated conversation that happened recently between myself and a friend:
Friend: Hey Chuck, have you read any good books lately?
Me: Well actually, I am reading Survivor by Chuck Palahniuk right now.
Friend: That's cool. How many pages is it?
Me: Around 290.
Friend: Nice. And what page are you on?
Me: 275.
Friend: So you are almost done?!
Me: Well, no...
Posted by Chuck at 11:48 AM | Comments (1)
June 05, 2006
JavaOne 2006
Last month I was sent to Sun's JavaOne Developer Conference. It was held in San Francisco's Moscone Center and had several hundred Java-related sessions and labs. I took some pictures and also uploaded a summary PowerPoint presentation of everything I saw that I made for work. Check it out.
In addition, PDF's of all of the technical sessions have been posted online.
The catalog to search for specific sessions is here.
Posted by Chuck at 03:59 PM | Comments (0)
March 22, 2006
Cold, Hard (Geo) Cache
Now that it is starting to get a little warmer, I would like to start taking advantage of Columbia, MD's pathways and trails again. When Columbia was first built (by Edward Norton's grandfather, no less), they purposely planned to have these pathways throughout the entire city. It makes it very easy to walk from one place to another and also allows me to get some much needed exercise.
Since I am also a technology buff, I have recently started getting into Geocaching, which allows me to exercise and use technology at the same time.
In the activity of geocaching, someone hides a 'cache', which is typically a plastic container full of a few trinkets and a log book. They then post the latitude and longitude of the location of the cache (found with a GPS) online at a site like geocaching.com. Other people will then plug the coordinates into their own GPS and try to find it. Once found, they can sign the log book, swap out a trinket for one of their own, take a picture, etc. They would also post online that they found the cache.
There are many variations of geocaching and they are found all over the place. For instance, there are 64 caches listed that are 5 miles or less from my house. The closest one was about a 10 minute walk.
I highly recommend this activity and hope to find about one cache a week for the duration of the Spring and Summer. You can track my progress by looking up user ChuckCaplan on geocaching.com.
Here are some other links that I recommend:
Maryland Geocaching Society
Reading a GPS using Java
Posted by Chuck at 12:23 PM | Comments (2)
March 10, 2006
The Acid2 Browser Test
Digg recently had a story on the front page about the latest build of Opera passing the Acid2 Test. I decided to verify this for myself, as well as check how Firefox and Internet Explorer did.
For those who don't know, the Acid2 Test tests how well web browsers conform to certain standards. If the browser passes, the page should like like a smiley face. Otherwise, it will look bad. How bad depends on how well the browser conforms to the tested standards.
Opera Build 8265 (Looks great!)

Firefox 1.5.01 (Disappointed)

Internet Explorer 6.0.2900.2180 (Looks HORRIBLE)

On the bright side, I have heard that the IE 7.0 beta passes the test and I am sure that Firefox won't be far behind.
Posted by Chuck at 02:53 PM | Comments (1) | TrackBack
February 23, 2006
Bookmarklets Old and New
Note: The bookmarklets in this entry are designed for Firefox.
According to Wikipedia, a Bookmarklet is:
"A small JavaScript program that can be stored as a URL within a bookmark in most popular web browsers, or within hyperlinks on a web page."
Here is what the bookmarklets in my browser currently look like (outlined by a red rectangle):

As you can see, it is now very easy for me to post something to del.icio.us, email a page, look up something on Wikipedia, etc. All of these bookmarklets have integrated Javascript that pop up windows for search queries or use text that I have highlighted on the screen as the query input.
I have been using bookmarklets for a long time, but had never actually written any myself. Here are 2 new ones that I hope someone will find useful. To install these, drag the links to your Bookmarks Toolbar.
1. Calculator - This bookmarklet either pops up a window asking you for an equation or uses the text currently selected on the screen as the equation and then shows you the result. This may be handier than opening a Calculator program every time you need to do a simple calculation. To test, install this bookmarklet, highlight the following text, and run it: 6 * (5 / 3) - 3 + (7 / 2)
2. ROT13 Encrypter / Decrypter - ROT13 Encryption is a very simple encryption scheme that is used on newsgroups and on my new favorite site Geocaching.com. Here is a description of how it works and why it is used. Much like the calculator bookmarklet, you can either enter the encrypted / decrypted text in a popup window or select the text on the screen first. To test, install this bookmarklet, highlight the following text, and run it: Pbatenghyngvbaf! Gur obbxznexyrg vf vafgnyyrq.
Here are the ones I use that other people have made. These are links to the pages describing the bookmarklets, not the actual bookmarklets themselves:
Posted by Chuck at 02:42 PM | Comments (0) | TrackBack
February 07, 2006
RSS - What is it and why do I need it?
A friend recently asked if I could explain RSS (Really Simple Syndication) in a non-technical way as a blog entry. Apparently, he had heard that it was useful but didn't really know all the details. So Chris, as well as others who come to this site but rarely understand what I am talking about, this is for you:
I read a lot of websites that are updated frequently as well as some that are rarely updated at all. These sites include blogs, news, photo galleries, technology tutorials, etc. Right now, I would estimate the number of sites that I frequent to be around 30. Think that's a lot? Once you download an RSS Reader, your list will quickly increase.
Some sites, like Digg, are updated continuously through the day. Others, like Wall Street Programmer are only updated once every few weeks, but I still would like to know when. That is why there is RSS.
Before RSS, I would have had 30 different browser bookmarks. Then, several times throughout the day I would have to check each bookmark to see if there was any new content. On most sites, there would be nothing new, but I would still have to take the time to check. That would have been very time-consuming.
Fortunately, all 30 of the websites I frequent also offer an RSS Feed. This means that I can add all 30 feeds to my favorite RSS Aggregator and with a click of a button can find out which sites have new content and which do not.
In other words, by clicking a single button, my RSS reader will check all 30 sites, one after another and alert me if there is a new news story, blog entry, photo, etc. in any of them. So instead of taking 10 minutes to check for new content on 30 websites, I can take 10 seconds, which gives me much more time to write blog entries which people besides myself might read.
If you have your own blog, you more than likely already have an RSS feed that is automatically updated every time you add an entry. This is true for LiveJournal, Blogger, WordPress, MovableType, etc.
I recommend you that you check your favorite websites for RSS Feeds. They may be labeled as XML, Syndicate This Site, RSS, Live Feed, etc. Then, download an RSS Reader like Sage or SharpReader and see how much time it saves you.
If you have any questions, post a comment and I will post a response.
Posted by Chuck at 03:03 PM | Comments (2) | TrackBack
December 30, 2005
Cruise the World with the Google Maps API
For my first foray into the Google Maps API, I decided to plot the Silversea 2007 World Cruise. For only $53,000, you can take a 126 day cruise to 6 continents. While I most likely will not be on that cruise ($53k is a little much), I thought it would be tedious fun to chart out all of the destinations using the API.
For the most part, the coding was pretty straight-forward. I used Google Earth to find the latitude and longitude of almost all the stopping points. I was not able to find coordinates for all destinations though, so the below map does not show all points on the cruise. However, it does show the idea of what the cruise route will be.
One thing I did not anticipate was the API's handling of polylines across the International Date Line. Let's say there is one point on each side of the International Date Line and you try to connect them with a polyline. Instead of drawing a short line between the two points, the API will instead draw a long line all the way across the world to connect them. There is a discussion about this behavior here. To combat this problem, I had to make two different polylines, one for each side of the Date Line.
The finished product is below, or you can see it on its own page here. The starting point is Fort Lauderdale, FL and it goes South from there. You will have to use your imagination and connect the points between French Polynesia and Fiji as that is where the Date Line problem lies. After going around the world, the trip ends at New York, NY.
Posted by Chuck at 09:48 AM | Comments (3) | TrackBack
December 06, 2005
A Simple JSP to View Everything in Your Classpath
TSIA:
<!-- This page prints the classpath URL's under the current System
classloader. -->
<%
ClassLoader sysClassLoader = ClassLoader.getSystemClassLoader();
java.net.URL[] urls = ((java.net.URLClassLoader)sysClassLoader)
.getURLs();
for(int i=0; i < urls.length; i++)
{
out.println(urls[i].getFile() + "<BR>");
}
%>
Sample Output:
/C:/JRun4/servers/lib/
/C:/JRun4/servers/lib/pbclient42RE.jar
/C:/JRun4/servers/lib/pbserver42RE.jar
/C:/JRun4/servers/lib/pointbase-service.jar
/C:/JRun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cfusion.jar
/C:/JRun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/
/C:/JRun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/bcel.jar
etc...
Code modified from A Java Geek's Diary.
Posted by Chuck at 04:11 PM | Comments (1) | TrackBack
November 15, 2005
The Last Minute of 2005 to Have 61 Seconds
The announcement was made by the International Earth Rotation and Reference Systems Service (IERS), an international body located at the Paris Observatory which is responsible for collecting and combining measurements of the Earth's rotation made at observatories around the world.
read more | digg story
Posted by Chuck at 08:45 AM | Comments (0) | TrackBack
October 26, 2005
Bugzilla and mySQL 5.0
I have been using Bugzilla for several months as a way to track bugs and features in various projects.
Here is the official description from bugzilla.org:
"Bugzilla is server software designed to help you manage software development."
It is not designed to work with mySQL 5.0 (yet), but I wanted to get it to work so I could start playing around with some of mySQL 5's new features like triggers, stored procedures and views. Here is how I did it.
The key problem is the way mySQL 5 handles JOIN's compared to mySQL 4.1. From the Release Notes:
Incompatible change: Beginning with MySQL 5.0.12, natural joins and joins with USING, including outer join variants, are processed according to the SQL:2003 standard. The changes include elimination of redundant output columns for NATURAL joins and joins specified with a USING clause and proper ordering of output columns. These changes make MySQL more compliant with standard SQL. However, they can result in different output columns for some joins. Also, some queries that appeared to work correctly prior to 5.0.12 must be rewritten to comply with the standard. For details about the scope of the changes and examples that show what query rewrites are necessary, see Section 13.2.7.1, 'JOIN Syntax'.
Let me say that I do not use nearly all of the features available in Bugzilla. I do however open, look at and re-assign bugs, make comments, etc. Even though these changes worked for me, install them at your own risk.
The following code allowed Bugzilla Version 2.18.3 to work with mySQL 5.0.15-NT on my PC. Basically, I just had to put parentheses around the table names after the FROM but before the JOIN.
C:\Bugzilla\Bugzilla\Search.pm, line 1110
change " FROM $suppstring"
to " FROM ($suppstring)"
C:\Bugzilla\Bugzilla\FlagType.pm, line 104
change "FROM flagtypes, flag${type}clusions " .
to "FROM (flagtypes, flag${type}clusions) " .
C:\Bugzilla\Bugzilla\FlagType.pm, line 59
change my @base_tables = ("flagtypes");
to my @base_tables = ("(flagtypes");
C:\Bugzilla\Bugzilla\FlagType.pm, line 363
change push(@$tables, ", flaginclusions");
to push(@$tables, ", flaginclusions)");
I also had to run this SQL:
alter table bugs change keywords keywords mediumtext null;
alter table bugs change status_whiteboard status_whiteboard mediumtext
null;
Good luck!
Posted by Chuck at 07:31 PM | Comments (17) | TrackBack
October 04, 2005
Just Added - Del.icio.us Bookmarks on Sidebar
Using an idea from Jeffrey Veen as well as the Feedsplitter PHP package, I added my 10 most recent del.icio.us bookmarks to my blog sidebar via a del.icio.us RSS Feed. Now, people can see which sites I consider worth bookmarking from right here. If you don't already use del.icio.us, I recommend it as a great place to keep track of your bookmarks as well as a place to find user-contributed pages on any subject. I also recommend this Greasemonkey script.
Note - I edited a Feedsplitter XML file in order to customize the way the feed looks on my site. You can download the updated file here. For whatever reason, the original XML file was not well-formed, but it still seems to work.
Posted by Chuck at 10:19 AM | Comments (1) | TrackBack
August 29, 2005
Java - 'private' does not really mean Private...
In the following example, I am going to show how to access private fields and methods from another Java class using Reflection. Typically, private access from another class is not allowed in Java. However, the AccessibleObject class, which is the parent class of Field and Method (among others) contains a method called setAccessible(boolean flag), which allows a programmer to override the permissions governing access to private fields and methods.
Take a look at these two example classes:
Private.java
PrivateTest.java
Private.java contains a private int field, String field and void method, none of which should be accessible outside the class. However, PrivateTest.java uses reflection to call setAccessible(true) and gains access to all of these members. It then prints the values of the private fields and invokes the private method.
Is there any way around this? Kind of. By invoking the JVM with "-Djava.security.manager" (no quotes), the JVM will be using the Java Security Manager, which will throw an error whenever setAccessible(true) is called to access a private method when it shouldn't. The specific error will be:
java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
In addition, the JVM argument "-Djava.security.policy" (again, no quotes) allows you to use a custom security policy file that lets you be very specific as to what is allowed and what is not. More information on security policies is available here. However, there is no way to guarantee that a user will be using the Security Manager with your specific policies being enforced.
So what does this mean? Basically, if someone really wants to access a private field or method in any Java class, they can do so. As you code anything private, you should at least be aware of this, especially if what you are coding is proprietary or confidential.
The best analogy I can give is about locks on a house. If your house has locks, it may deter some people from breaking in and robbing you. However, if someone really wants to gain access, a lock is not going to stop them. The same is true for private methods in Java.
Posted by Chuck at 11:20 AM | Comments (1) | TrackBack
August 23, 2005
A Google IM Client?
UPDATE (8/24/05 9:15am) - Google Talk is live. Check it out.
UPDATE (8/23/05 7:15pm) - I have been able to logon to the Jabber server at talk.google.com with my GMail username and password using Gaim. If you are able to as well, send me an IM (ccaplan).
There has been a lot of speculation lately about whether or not Google will release its own Instant Messaging client in the next few days. One of the rumors going around is that talk.google.com is actually a Jabber server. For those who don't know, Jabber is an open Instant Messaging framework that offers many advantages over more mainstream IM services like AIM.
I decided to try to verify the rumor that talk.google.com is a Jabber server for myself. I started by pinging it:
C:\Documents and Settings\charlesc>ping talk.google.com
Pinging talk.l.google.com [64.233.167.125] with 32 bytes of data:
Request timed out.
This verified that talk.google.com was a valid address as it resolved to an IP address as well as the domain talk.l.google.com.
I then telnetted to the server on port 80 and got this response:
HTTP/1.1 302 Found
Location: http://www.google.com/talk/
Content-Type: text/html
Content-Length: 151<HTML><HEAD><TITLE>302 Moved</TITLE></HEAD><BODY><H1>302 Moved</H1>The document
has moved <A HREF="http://www.google.com/talk/">here</A>.</BODY></HTML>Connection to host lost.
That shows that while there may not be a site there now, Google has at least attached talk.google.com to a web server. You can see for yourself by going here.
Finally, I telnetted to it on the port that Jabber uses to communicate (TCP port 5222) and sent it a request using an example from the O'Reilly book Programming Jabber:
C:\Documents and Settings\charlesc>telnet talk.google.com 5222
After connecting, I sent the following String:
<?xml version='1.0'?><stream:stream xmlns:stream=
'http://etherx.jabber.org/streams' to='yak' xmlns='jabber:client'>
And I got a response:
<stream:stream from="yak" id="C13304A4"
xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
So it is confirmed. The server talk.google.com is actually running a Jabber server. Hopefully, there will be good things to come concerning Google and IM in the next few days...
Posted by Chuck at 12:32 PM | Comments (3) | TrackBack
August 16, 2005
Track Any Flight Online
My wife is currently flying to Chicago, but I am at work. Normally, I would have no idea if there was a delay, when she would be arriving or where in flight she was. Fortunately, I can track her trip in real-time with a flight tracking service like FlightView from RLM Software. With FlightView, I can enter any airline and flight number along with a date and it will give me real-time stats on the flight, such as altitude and speed. The site also features a map so I can see exactly where the plane is at any given time:
![]()
This technology has been around for a while, but I think it deserves another mention because I rarely hear about it anymore.
Posted by Chuck at 09:35 AM | Comments (1) | TrackBack
August 01, 2005
A 15-Minute Guide to Using CVS with WDSc
My first published article, "A 15-Minute Guide to Using CVS with WDSc" has been printed in the August, 2005 edition of iSeries News. It is free to subscribe to the printed version of the magazine, but online access to my specific article requires a paid subscription. If you happen to have a subscription, you can read the article online here: iSeries News - August, 2005
Posted by Chuck at 01:14 PM | Comments (0) | TrackBack
July 12, 2005
GCJ - Compile Java into Native Machine Code
Have you ever wanted to convert a Java program into a Windows executable (EXE) or native Linux program? One need for this is that a JRE would not be required on the machine in order to run the program. GCJ, part of the GNU Compiler Collection can accomplish this.
GCJ is the GNU Compiler for the Java Programming Language and it allows you to compile Java source code or .class files into native machine code. As a quick example, I am going to create a simple HelloWorld Java class and convert it into HelloWorld.exe.
Requirements:
- Cygwin, along with the Development package (Note - Cygwin is not required to use GCJ on Windows, I just chose to use it in this example. There is also a version that has been ported to Windows using MinGW. The same instructions will work for both versions.)
- Knowledge of Java, compiling, Windows environment variables and DOS and Shell commands are recommended.
Instructions:
- Create HelloWorld.java or download it here.
- Start Cygwin and change to the directory of your Java file.
- Compile the Java into a .o file by typing: gcj -c -g -O HelloWorld.java
- Link the file and create a .exe by typing: gcj --main=HelloWorld -o HelloWorld HelloWorld.o
- You have now created a file called HelloWorld.exe. However, if you run it you will see the error:
This application has failed to start because cygwin1.dll was not found. Re-installing the application may fix this problem.
The reason for this error is because Windows cannot find a Cygwin library needed to run the code. To fix this, add the bin directory of your Cygwin installation, i.e. C:\cygwin\bin to your PATH environment variable. This can be done by right-clicking on My Computer, choosing Properties, going to the Advanced tab, and clicking on the Environment Variables button. Then, edit the 'Path' System variable and add ;C:\cygwin\bin to the end. You will not need the semi-colon in the beginning if there is already one there. Be careful when doing this as this could mess up your system if not done correctly. - Once you add the bin directory to your Path, close all DOS and Cygwin windows that are open, open a new DOS window and run HelloWorld.exe. You will then see the correct output, all without needing a JRE.
NOTE - After adding the Cygwin 'bin' directory to your Path, certain applications may stop working. For example, my Mozilla Firefox installation does not work after doing this. The reason is that the Cygwin library may conflict with other installed libraries. Therefore, you should probably only add the bin directory to your path before running a program compiled with GCJ and then you should remove it after the program has completed. If necessary, create a batch file that adds the path, runs the GCJ-compiled program and then removes the entry from the path. Make sure to only remove the entry and not the entire path.
Posted by Chuck at 12:12 PM | Comments (4) | TrackBack
June 08, 2005
Greasemonkey - Take Control of Your Web Experience
Greasemonkey is a Firefox extension that allows you to embed DHTML in any web page. For instance, If I type:
javascript:document.images[0].style.display = "none"; void 0;
in the address bar while at http://www.chuckcaplan.com, my most recent mobile photo will disappear (Thanks to fellow Duquesne alumn Ben Schmaus for this example). Taking this a step further, a script could be written to remove the ads from Yahoo! Mail or to do any number of things to enhance your web experience. I personally like some of the scripts written for IMDB.
For my first Greasemonkey script, I stole followed a suggestion by Justin Curtis to remove the ads MapQuest puts on the page when you print directions. The script can be found here. To use this script:
- Install Firefox
- Install Greasemonkey
- Install my User Script by going here and then going to Tools --> Install User Script
People have written scripts much more complicated than that, some using regular expressions to search for text and some using XPath to search for certain parts of an HTML page. An excellent place to find Greasemonkey scripts is here.
I encourage you to take a look at this technology and start writing scripts to make your surfing more enjoyable. If you come up with anything interesting, let me know.
Posted by Chuck at 09:43 AM | Comments (0) | TrackBack
May 11, 2005
It's Me, or Not...
Pretty much everyone has Self-Googled themselves at one point or another. Some people are just curious. However, some people have legitimate reasons, like celebrities who need to monitor what is being said about them or webmasters who need to monitor where in the search results they appear. This article even suggests you Self-Google once a day. That seems a little extreme, but I am noticing that the more I post to this blog, the higher up this site gets when I search for my name.
Here are some interesting pages about people who have the same name as me but are not me. Apparently, I not only saved many of America’s most prominent leaders from certain danger and possible death in 1919 but am also a convicted felon in England who is notorious for illegally exporting poison gas.
- Packaged Threats: Danger in Disguise - On May 5, 1919, a New York City mail clerk became a postal legend. With one heroic deed, Charles Caplan saved many of America’s most prominent leaders from certain danger and possible death.
- Illegal Export of Poison Gas - Yun was monitored while Charles Caplan asked him to procure a quantity of the deadly nerve gas Sarin.
- The Rainier Valley Harmonizers - Baritone
- 2001 Junior Olympics - Third Place in Under 16 Boys Table Tennis
- The Mayor of a Fictional Town
- A Dentist - Dr. Charles Caplan, of Madison, Wis., never found a chair that comfortably supported his tall body, so he founded a company that eventually became known as Orascoptic Research. He was one of the first to develop a fully adjustable chair with arms, one that resolved many ergonomic issues. But it still could not be positioned low enough for other clinicians.
Posted by Chuck at 02:24 PM | Comments (0) | TrackBack
May 06, 2005
What's the most popular number (under 976)?
I had never messed around with the Google Web APIs before so I figured I'd download them and give them a try. As a quick test, I queried each number between 0 and 976 (I tried for 1000 but my program timed out) to see which numbers were the most popular.
You can download the Java code here and you can see the list of results here. It took a few seconds for each query, so the whole program took well over an hour to run.
It looks like the most popular number was 1 with 340,000,000 results and the least popular number was 958 with 645,000 results. The only thing I am confused about is that the number of results I got using the API was different than the number of results Google's website gives. For example, when I searched for 1, the API told me there were about 340,000,000 results, but when I searched Google's Website, I was told there were about 1,490,000,000 results. I am sure there is a good reason for the difference, but I am just not sure what it is (nor have I bothered to research it)... If anyone knows the answer, please let me know.
Some other popular numbers were: 1 2 4 3 5 8 10 7 12 306 25 11 9
Some other unpopular numbers were: 958 959 884 948 897 969
By the way, sign up here to get your own Client Key, or do a search for "String clientKey =" to find some random ones people have accidentally posted on the web. You need a Client Key in order to submit your own queries to Google via the API.
Posted by Chuck at 04:39 PM | Comments (2) | TrackBack
May 05, 2005
Google Web Accelerator - A Small Hack
Google Labs released a Web Accelerator yesterday that is supposed to make your web surfing faster by serving you compressed pages and images right from Google's servers. From the site:
Google Web Accelerator is an application that uses the power of Google's global computer network to make web pages load faster. Google Web Accelerator is easy to use; all you have to do is download and install it, and from then on many web pages will automatically load faster than before.
I have seen this for dial-up connections from companies like NetZero and Netscape but not for a broadband connection like this. My first thought was that it must be using some sort of proxy server. This happened to be the case. However, it took me a while to get the specifics.
When Web Accelerator is turned on, you can go to Tools --> Internet Options --> Connections --> Lan Settings in Internet Explorer and see that "Use automatic configuration script" has been checked and an address of http://localhost:9100/proxy.pac has been entered. However, going to that page as well as http://localhost:9100 did nothing. I then decided to search my computer for proxy.pac but found nothing. Then, on a whim I decided to search for *.pac, which found one file: C:\Documents and Settings\Chuck\Local Settings\Temp\GoogleWebAccelerator.pac -- However, this file was locked by the application so I could not view, copy, move or delete it. There was nothing I could do to view the contents of this file and when I stopped the accelerator, the file disappeared.
I tried a number of things, including abruptly turning off the computer and restarting in Safe Mode, as well as creating a batch file with a continuous loop to try to copy the file to another location. My last thought was to download a Live Knoppix CD in order to try to read it directly from the file system but I did not feel like downloading a 700 meg file and running the CD when I wanted to know the contents of the file now.
I finally realized that when the Web Accelerator starts, GoogleWebAccelerator.pac has a size of 0 bytes. Once I go to a web page, the file increases to 2k or so. This told me that Internet Explorer must be going to http://localhost:9100/proxy.pac a single time and finding the proxy information. Then, GoogleWebAccelerator.pac fills with the same information which I could not access.
What I finally decided to do was use the Win32 implementation of wget from UnixUtils to view the file before Internet Explorer did and I was finally able to see the contents of proxy.pac / GoogleWebAccelerator.pac. The exact command was wget http://localhost:9100/proxy.pac. This places proxy.pac in the directory where you ran the command. Make sure to run this after starting the accelerator but before going into Internet Explorer. Here is what was inside (Pardon the formatting):
function FindProxyForURL_2831062(url, host) {
return "DIRECT";
}
var private_re = new RegExp("^((0\\.0\\.0\\.0)|(127
\\.\\d+\\.\\d+\\.\\d+)|(10\\.\\d+\\.\\d+\\.\\d+)|(172\\.(1[6789]|2[0-
9]|3[01])\\.\\d+\\.\\d+)|(169\\.254\\.\\d+\\.\\d+)|(192\\.168
\\.\\d+\\.\\d+)|(22[3-9]\\.\\d+\\.\\d+\\.\\d+)|(2[3-5][0-9]
\\.\\d+\\.\\d+\\.\\d+)|([^.]*\\.[^.]*\\.google\\.com)|([^.]*))$");
var bypass_re = new RegExp("^((gmail\\.google\\.com)|
(.*windowsupdate\\.microsoft\\.com)|(.*download\\.windowsupdate\\.com))$");
function FindProxyForURL(url, host) {
if (host == "localhost" || host == "127.0.0.1")
return "DIRECT";
var url_proxy = FindProxyForURL_2831062(url, host);
if (private_re.test(host) ||
bypass_re.test(host) ||
url.substring(0,5) != "http:" ||
"DIRECT" != url_proxy
)
return url_proxy;
else
return "PROXY localhost:9100; " + url_proxy;
}
The JavaScript functions try to differentiate between local and Internet requests. If it is an Internet request, the String
"'PROXY localhost:9100; ' + url_proxy" is returned. Otherwise, the site is loaded using a DIRECT connection.
I have not dug too much further into this besides what I have just written. I just wanted to relay my experience of how I was able to see inside a locked file that required some tinkering in order gain access.
Posted by Chuck at 04:00 PM | Comments (7) | TrackBack
April 14, 2005
Where's My Data?
At my current job, we have an Oracle database with several hundred tables. This database holds all the information for a piece of web-based software with many features and hidden corners.
Typically, when a user fills out a form, one or many tables get updated. However, it can get tricky when you are not sure which tables were affected.
Luckily, Oracle has generated tables available called ALL_TAB_COLUMNS and USER_TAB_COLUMNS, which show every column and table in either all schemas or whatever schema you are currently using. With this table, I can loop through each column in each table and scan for a specific value.
For example, let's say that there is a row in some table that has 'Elm St.' somewhere inside it but I am not sure of the table or column name. All I would need to do is select every column and its associated table from ALL_TAB_COLUMNS and then check each column for that value.
Here is a Java program that will do just that. It has come in very handy for me because in a few seconds I can know each table and column in the database that contains a certain value.
Posted by Chuck at 04:00 PM | Comments (0) | TrackBack
March 21, 2005
Copying a really long row in SQL
Programmers are typically lazy when it comes to coding and therefore do not like to type more than they have to.
Every once in a while, I need to repeat the entire contents of a very long database row but change just a few fields like the primary key and description. In other words, I need to copy the row and append it at the end of the table after making a few minor changes. Here is a method to allow you to easily do this without typing INSERT INTO longtable (field1, field2, field3, etc.) VALUES (value1, value2, value3, etc.);
--create a temporary table to copy the long row into
create global temporary table tmpLongTable as select * from longtable;
--copy the row into the temporary table
insert into tmpLongTable (select * from longtable where primary_id = 23);
--update the temporary table to reflect the new data
update tmpLongTable set primary_id = 26, description_txt = 'New Description' where primary_id = 23;
--insert the updated copied row back into the main table
insert into longtable (select * from tmpLongTable);
--drop the temporary table - not needed, but better safe than sorry
drop table tmpLongTable;
--see if everything worked
select * from longtable where primary_id = 26;
--your database supports transactions, right?
commit;
I have tested this in both Oracle and DB2. Another way to accomplish this is: INSERT INTO mytable (select 'myvalue1', 'myvalue2', FIELD3, etc. from mytable); I personally like the first way better.
Posted by Chuck at 04:00 PM | Comments (1) | TrackBack
March 17, 2005
News only nerds would care about...
Tomorrow, Fri, 18 Mar 2005 01:58:31 UTC will be exactly 1,111,111,111 seconds since the Epoch. See for yourself here. The Epoch as it relates to computer timestamps occurred on January 1, 1970. Many operating systems and programming functions rely heavily on the number of seconds or milliseconds since the Epoch for various calculations.
Posted by Chuck at 03:36 PM | Comments (1) | TrackBack
March 15, 2005
Fun With Regular Expressions
The Java Development Kit (JDK) has supported Regular Expressions without any external libraries since version 1.4. Regular Expressions are great because they allow you to do things in one line that would normally take many lines of code. Though Regex's (a common nickname for Regular Expressions) can be very cryptic, they are extremely powerful.
If you are new to Regex's, check out this tutorial. Then take a look at some things you can do with Java and Regex's to make your life easier.
Here is a quick example. Suppose I had a String with a sentence containing any number of words, some of which were email addresses. Also, suppose that I wanted to remove all the email addresses for privacy reasons. With Regular Expressions, I can easily (though cryptically) find each email address within the String and replace it with something else using the String.replaceAll() function. Below, strSentence is the example String prefilled with any number of words and email addresses:
strSentence = strSentence.replaceAll("[\\w-]+(?:\\.[\\w-]+)*@(?:[\\w-]+\\.)+[a-zA-Z]{2,7}", "<EMAIL REMOVED FOR PRIVACY>");
In this case, the Regex (unescaped) is: [\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7} - Note that I had to escape all the back slashes in order to put it in a Java String.
Now, my sentence is exactly the same except all email addresses have been replaced with "<EMAIL REMOVED FOR PRIVACY>".
Regex's can also do things like password constraint validation (i.e. your password must be at least 5 characters long and contain a letter and a number), complex pattern matching & replacing and other types of validation such as credit card numbers and SSN's. Struts makes heavy use of Regex's for form validation. Maybe you should too.
Posted by Chuck at 08:03 PM | Comments (0) | TrackBack
January 07, 2005
Using Javascript and XSLT with ANT
Apache ANT has become the standard Java-based build and deployment tool. Many things can be done using ANT's core and optional tasks, such as chmod, copy, jar, and FTP. However, this article on sitepen.com does a good job of explaining how to use external scripting such as Javascript and XSLT along with ANT.
Here is an example of how to use Javascript with ANT:
<project name="helloWorld" default="main" basedir=".">
<target name="setup">
<script language="javascript"> <![CDATA[
echo = helloWorld.createTask("echo");
main.addTask(echo);
echo.setMessage("Hello World!");
]]> </script>
</target>
<target name="main" depends="setup"/>
</project>
Make sure to read the article and download the correct JAR files.
Here is an example of how to make an XSL Transformation request with a parameter:
<style in="src/webProject.xml" out="temp/index.html" extension="html" style="webSite.xsl" processor="trax"> <param name="pageId" expression="com.sitepen.pages.home"/> </style>
If you are tasked with creating ANT scripts, you should take a look at this article.
Posted by Chuck at 09:54 AM | Comments (0) | TrackBack
January 03, 2005
HTTP-Tunnel - Access the Content You Need
More and more companies are adding corporate firewalls that restrict network traffic going in as well as out. This increases security but decreases capabilities for a select few that need access to the ports being blocked. Enter HTTP-Tunnel (for Windows, from $4.99 / month). HTTP-Tunnel allows access to would-be-blocked ports while still maintaining the level of security that the firewalls represent.
According to their website:
HTTP-Tunnel NG acts as a socks server, allowing subscribers to use your Internet applications despite of restrictive firewalls anonymously. Your Internet application sends data to the HTTP-Tunnel NG Client, which in turn tunnels the data over HTTP (port 80) to the HTTP-Tunnel servers. The servers then send the data to the intended destination and forward the responses back to the HTTP-Tunnel NG client. This forwarding technique effectively bypasses firewalls, permitting the users to successfully use most Internet applications.
What does this mean? Let me give you two examples, both of which have happened to me:
1. I want to transfer a data file to a client via FTP but my company's firewall is blocking port 21 - This is easy to fix with HTTP-Tunnel. Just go into the HTTP-Tunnel client and tell it that whenever you access the client on port 21, have it go to whatever FTP site you need. Then, point your FTP client to "localhost" instead of the FTP site and HTTP-Tunnel will take care of the rest. This technique can be used for almost any program that accesses data on different ports.
2. I want to access a technology tutorial on a site that is hosted on port 8080 but my company only allows access to sites on port 80 - Luckily, HTTP-Tunnel includes a SOCKS server that is compatible with most browsers. Just change the proxy settings of your browser to have the SOCKS server point to localhost:1080 and you will be good to go.
As you can see, HTTP-Tunnel makes it possible to access necessary content, even behind a corporate firewall. Please do not use this software to violate your company's Internet Access Policy. When in doubt, ask. Use HTTP-Tunnel at your own risk.
Posted by Chuck at 10:41 AM | Comments (1) | TrackBack
December 29, 2004
Aggregate Your Favorite Web Logs and News Sources with Bloglines
Each day, like many people I know, I track several different websites ranging from friends, technology columnists and news sources. Originally, I had a list of bookmarks and every morning I would go through each site and see if any new information was posted. However, I recently found a site that allows me to aggregate all of this information into a single page, which greatly shortens the time needed to go through everything.
Bloglines is a free service that allows you to take XML feeds (typically RSS or RDF) from any website that offers them and track them all from a single page. For instance, the XML feed on this page (and many other blogs) is available from the link on the right side of the page that says "Syndicate this site (XML)". Bloglines is also smart enough to automatically use feeds from sources like LiveJournal, Blogger, and Yahoo! Groups based on user name or group name.
I can now track all of the syndicatable content I read from one source. I can also quickly see which sources have new content and which do not. Now, my original 10 minute morning process has been slashed to under 2 minutes. In addition, I can create clippings of all the articles I feel are interesting and want to save.
In case you are interested, here is a list of all the sites I currently frequent that are also syndicated:
Alex Albrecht - RDF
Justin Curtis - RDF
Sarah Lane - RDF
Chris Piers - RSS
Kevin Rose - RSS
Slashdot - RSS
Yahoo! News: Technology - RSS
Posted by Chuck at 10:12 AM | Comments (2) | TrackBack
December 27, 2004
So your Web Host doesn't offer Telnet access... Here's a solution.
I have been hosting chuckcaplan.com with iPowerWeb for almost 2 years. While I would not call them a phenomenal host, in general they are fine. And $8 a month for 2 gigs of space is not bad. If you are interested in using iPowerWeb, let me know so I can refer you.
One of the biggest issues I have had with iPowerWeb is that they do not offer shell access, meaning I cannot Telnet to the host in order to run standard Unix commands that would make maintaining my site easier, such as find, grep, mv, cp, rm, etc.
Fortunately, I came across CGI-Telnet by Rohitab Batra.
CGI-Telnet is a CGI script that allows you to execute commands on your web server. It is a useful tool if you don't have telnet access to your server.
I can now do almost any command via the CGI script that I could do with a Telnet client. The downside is that since it is a web client and not a real Telnet client, only simple request and response commands can be used, such as typical Unix commands. Any commands that require multiple lines of input, such as mysql and vi cannot be used. In addition, be aware that this script can do serious damage to your site if you do not know what you are doing. If you are unfamiliar with a specific command, research it before using it.
Still, I have found this script very useful in maintaining my site and would recommend it to anyone who needs Telnet access but whose site does not support it.
Posted by Chuck at 10:45 AM | Comments (0) | TrackBack
December 23, 2004
Suggest - A New Way to Google
Google Suggest was added to Google Labs on 12/9/04. Other graduates of Labs include Web Alerts, Google Deskbar, and Search by Location.
The Google Suggest homepage looks very similar to the Google homepage. However, when you type your search query, Suggest automatically tries to figure out what you are looking for and gives you example queries that might save you some typing time, much like Internet Explorer does when you type a URL you have already been to. It might also give you better suggestions on what to search for. This is a very interesting piece of technology and I recommend checking it out.
Underneath the hood, the bulk of the work is done with Javascript. Chris Justus does a pretty good job dissecting all the code.
Posted by Chuck at 10:14 AM | Comments (0) | TrackBack
December 22, 2004
Elf Rock
In the holiday spirit, Carol Maker from zefrank is an interesting flash animation that is kind of like a MIDI sequencer style piano roll with elf voices for notes. Fun (very fun, actually) and technologically interesting - what more can you want? Thanks to Sarah Lane for the link.
Posted by Chuck at 10:26 AM | Comments (0) | TrackBack
December 21, 2004
The Professional's Gateway to the World's Markets
My current broker of choice is Interactive Brokers. With the risk of this entry sounding too much like a sales pitch, here are the top 5 reasons:
5. Cheap Commissions - Since IB has direct access to the markets, commissions are much lower than a full-service broker. Trading 100 shares of stock typically costs about $1 per side. A full commissions list can be found here.
4. Trade Anywhere - The IB Trader's Workstation (TWS) is java-based, so it can be run on any system that supports Java. In addition, there is also trading via mobile phones, networks behind firewalls, and telephone-directed ordering (for a fee).
3. Trade Anything - Whether it is Futures in Sydney, Stocks in Tokyo, or Options in London, you can trade it with IB. While I am currently not trading any international securities, it is great to know that they are available. Keep in mind that you may have to pay data fees in order to trade in some markets and that each market has different trading requirements.
2. Trade Any Time - Even though your market of choice may be closed, there is always a market open somewhere in the world. With IB, you can participate in almost any world market at any time, as long as it is open for trading.
1. Application Program Interface Software
- IB currently has API Software available for Java, C++, ActiveX, and Excel DDI. You can use these socket-based API's to access market data, place orders, etc. I have set up a Wiki about the API here and there are also excellent discussion forums here and here. In addition, the API documentation can be found here.
What sold me, of course, is the API software. The idea of writing a completely automated program in Java to buy and sell securities is very intriguing to me. I am currently doing this in my spare time so if I all of a sudden stop writing about Java and start writing about the new Ferrari's I am constantly buying, you know it worked out.
There are some people, however, that IB is not for. The biggest group would be those that do not have sufficient knowledge of how the markets work. IB makes it very easy to trade in a variety of markets, but many of the specific options associated with those trades can be daunting. Make sure you know what you are doing before hand. In addition, those who want the advice of a financial advisor should probably stay away as well.
Still, if you feel that a direct access broker is for you and you want the ability to write programs that integrate with the markets, I highly recommend IB.
Posted by Chuck at 02:04 PM | Comments (0) | TrackBack