Aug 31, 2008

Adding a View Source Link to a Page

I'm creating some JQuery examples and I wanted to add a view source link to each HTML page. After a little Googling I found this article on how to do it. But this just loads the page into the current window. I think it would be better if it popped up into a new windows.

Here is the code I created to view the source in a new window.

   1:<a href="javascript:void(window.open('view-source:'+document.location,
   2:'_blank'))">View Source</a>

Aug 28, 2008

eee pc 1000 Pretty Cool

Well as you may have guessed from an earlier post, I splurged and got myself an eee PC 1000 last week. If you aren't familiar with the eee, its a line of ultra portable laptops from Asus. The machines generally weigh less than 3 pounds and can cost as little as $350. The more inexpensive models have a very small 7 inch screen, small keyboard, and limited disk storage.

The eee 1000 has a 10 inch screen with a 1024x600 resolution, a 40gig solid state hard drive (SSD), and a fairly good sized keyboard. In addition, the 1000 uses the new very power efficient Intel Atom processor. Although at $670, the 1000 isn't exactly cheap, it is a pretty good price considering what you get (the SSD being a prime example). And its really inexpensive if you compare it to the $1800 starting price of a Macbook Air.

First Impressions

Here are some of my first impressions after a week

  • The 1000 has a great screen, bright and colorful. Web surfing works well as most sites fit in the 1024 pixel width. You do end up running all your applications full screen, but the eee has a Windows like task switcher so that is not really an issue.
  • The built in speakers are amazingly good. You won't need a separate set of speakers with this laptop.
  • The Xandros Linux distro seems to be very stable and easy to use. Since its Debian based, its easy to install new applications. A much better experience than the one I had with the HP 2133 and its crappy SUSE distro.
  • Configuring the UI can be a little tough as discussed in my previous post. But just adding the Start menu solves most of those problems. I don't really plan to make many changes to the base setup.
  • Web surfing performance is quite good. I have tried the Wifi at a couple different places and sites load smoothly and quickly.

Overall I am quite impressed with this little machine. If you are interested in trying an ultra portable, but don't want to mortgage the house, give the eee pc 1000 a look.

Aug 26, 2008

iPhone Signal Complaints

I keep reading about the iPhone G3 and how it has a poor signal, etc... I have noted that the phone almost always shows only 1 or 2 bars of signal strength wherever I go. However, when I actually make calls, the actual signal is better.

I really wonder if there are real signal issues or this is merely a perceived problem because the phone doesn't show 5 bars all the time? My advice to Apple would be to just show more bars in there software and I bet that "fixes" the problem. :)

Aug 25, 2008

Add an eee pc start menu

For geeks, the eee pc leaves off a couple vital utilities from its user interface. Namely a terminal and a text editor. Now you can get to a terminal by typing Cntl-Alt-t or by launching one from the eee File manager. But the built in terminal uses a very small font and does not seem to be configurable. The file manager uses KDE's konsole, which works great, but I need a quicker way to get to it.

After searching around I bit, I discovered you can add a start menu to the eee's user interface. This seems to be the easiest and most unobtrusive way to add some simple customization to the eee. The steps are described on the LinuxOSS blog. Basically they are

  1. Open a terminal by pressing Ctrl+Alt+T
  2. Type “sudo bash” to get root access
  3. Create a hidden folder by typing: mkdir /home/user/.icewm
  4. Copy a config file by typing: cp /etc/X11/icewm/preferences /home/user/.icewm/
  5. Copy a sample menu so you have something to start with: cp /etc/X11/icewm/menu /home/user/.icewm/
  6. Type: vi /home/user/.icewm/preferences to edit the file. If you don't know how to use vi, you should learn to. :)
  7. Scroll down until you find “TaskBarShowStartMenu,” and change the 0 to 1
  8. Next time you reboot or restart your X server by hitting Ctrl+Alt+Backspace you will have a shiny new start menu.

Now you can edit the /home/user/.icewm/menu file and customize the menu. The basic structure for each menu item is: prog “title” icon_name program_path. So to add the Konquerer text editor, I would add a line: prog “Text Editor” kwrite /usr/bin/kwrite. Voila! I know have a link to the kwrite editor on the start menu.

Icon Location

The first question I had after add a few test entries was, where do you get the icons for your applications? It must be getting a kwrite icon from somemplace? By default, the eee looks for icons in the /usr/share/pixmaps directory. If you navigate there you will see a number of icons. You can reuse these for most of your applications. In addition, more icons can be found at /opt/xandros/share/AsusLauncher, but you will need to put in the full path icons in this directory.

Aug 21, 2008

Smultron Text Editor for OS X

What is Smultron you ask? A long forgotten transformer perhaps? No its actually a free open source programmer's text editor for OS X 10.5, Leopard. Although, there are a number of free open source Java IDEs and editors that work well on the Mac, it has always lacked a good free editor that was OS X native.

A friend at work tipped me off the to program. I haven't used it much yet, but from what I have seen, it is very nice. Check it out at:

http://smultron.sourceforge.net/

Aug 19, 2008

iPhone Review

A quick review of my iPhone g3 is in order, especially after all the negative press I have been reading. Complaints include poor battery life, bad reception, and the installation of apps from the app store bricking the phone. So far my experience has been this.

Speed

The new iPhone is faster than its predecessor. It renders web pages much faster. The g3 network has been only slightly faster than the edge network (a bit disappointing). From what I have read, the design of the 3g network simply does not scale well. But if you are running off Wifi you will notice a big improvement in performance.

Signal

For whatever reason, the iPhone g3 almost always shows 1 bar of signal strength, pretty much wherever you are. The actual signal is much improved. I talk to my parents once a week on my phone long distance. They have raved about the improved sound quality. In addition, we seem to have less trouble with dropped calls. So the signal quality is much better, even though it appears to be worse.

Battery Life

The stand by battery life is much better. You can leave your phone on for a couple of days and the battery hardly goes down. With the old iPhone, I had to keep it turned off as much as possible. Just leaving the phone on over night would run down the battery quite a bit.

The run time battery life seems to be worse. It looks like to me the phone will only last about 3 hrs if kept on constantly. That is not good for someone who uses their phone all the time. I think the screen, which seems much brighter, may be sucking up all the juice. But, I'm just guessing.

Apps

I have only installed a Disney Card game app and that is it so far. No problems. Leo Laporte suspects the bricking problems are caused by downloading applications directly to your iPhone. If you download to iTunes and then sync, there are no issues. I haven't found any apps that really interest me much. Thought about getting the AIM client, but it had bad reviews and Meebo seems like a better choice anyway.

Summary

In summary, my experience has been good. I don't talk on the phone all day so the run time is not a problem for me. A faster phone, better signal, no special headphone jack, and more capacity (16gig) all make for an improved phone.

Apple has to solve the battery life issues. People who use their cell phones a lot are not gonna be happy.

Aug 14, 2008

Getting an Approximate File Count

A quick Unix tip I thought I should share. If you need to get an approximation of how many files are in a directory and its subdirectories, the du command is a great help. By default, to use the du command you would type something like this:

du .

This command lists all the subdirectories of the current directory and their size in 512 byte blocks.

The following is a more useful version of the command.

du -ak .

That command lists all the subdirectories and files in the current directory and lists their size in kilobytes. This command can be very useful when used with grep to do quick searches.

Finally, if I want to get a line count, I add the following:

du -ak . | wc -l

The wc -l command counts the number of lines in the output of the du command. Since there is one line per directory and file its not an exact file count, but it can be real useful for quick comparisons and the like.

Aug 11, 2008

Faster Web Pages

I found this story on Giga OM that points to this story on making web sites faster. A tool for FireBug called YSlow is covered in the story. Looks interesting, it is not something I have used, but I intend to give it a try.

VNC Built Into OS X 10.5 Leopard

I ran across this when searching for a VNC client for the Mac. It turns out OS X has one built in. To use it do the following:

  1. Give Finder the focus
  2. Type AppleKey-K. This opens up the Connect to Server dialog
  3. Type in a VNC URL. For example, vnc://hostname.domain.com. Or if using a display number other than the default, 5900 + the display number. For example, the URL for display 16 would be: vnc://hostname.domain.com:5916
  4. Assuming a VNC server is there, you connect the server and VNC starts. Right click the Screen Sharing icon that appears in the doc and select Save to Doc. That makes the icon available to you for future sessions and you no longer have to mess with Finder.

Enjoy your new VNC client for OS X.

Aug 7, 2008

Internet Explorer innerHTML Gotchas

Someone commented on my innerHTML post earlier in the week suggesting I should mention the IE gotchas. (I approved the comment but somehow it has disappeared. Weird.) Anyhow, I was working a little on the Web 2.0 course so I decided to look up the details. I found the answer here:

http://ajaxian.com/archives/innerhtml-gotchas

Turns out a few HTML elements in IE are read only. So if you try to write to them, but things happen. Details in the link.

Aug 5, 2008

Speaking of Search, Yahoo is trying something new

I ran across this story on webware.com on Yahoo making their search results more open. The gist of the story is this, if you add some code to your web site, developers can provide richer information in the search results. Yahoo calls this technology SearchMonkey and they are previewing it with results from LinkedIn and Yelp.

As mentioned in the article, scaling could be an issue. You definitely could not just turn on extra information for all sites. But it is still an interesting idea.

Is Cuil Cool?

I was gonna blog about Cuil last week, but when it debuted last Monday, it didn't seem to work so good. It seems to be fixed now though. :)

Cuil is a new search engine created by some of the former higher ups at Google. Apparently frustrated by the Google UI and search methods for the back end, they left to create a new search engine.

What they have come up with doesn't seem to be a lot different. The search summaries are a lot more scrunched up. Looks pretty much the same. No ads yet. It will be interesting to see how much traction they get. Can anyone take on Google? We shall see.

The company name comes from the Irish name McCool or McCuil. Taken from the Irish folklore character Finn McCuil.

Aug 1, 2008

Sun Ajax Development Best Practices

I ran across this link to Sun blueprints today while doing a little background research on a course. Written by Greg Murray, formerly of Sun and now with Aptana, it is a nice little summary of good Ajax programming practice. Well worth saving a link to.

DOM v innerHTML Performance

Ran across this page (http://www.quirksmode.org/dom/innerhtml.html) today by PPK on quirksmode while verifying some course content. I'm sure there are lots of links to this article as it comes up near the top of the Google list, but I wanted to save a reference for myself.

To summarize, innerHTML is way, way, way, way, faster than DOM. :)

Wildflowers 2008

I was playing around with Flickr late last night and uploaded a few Wildflower photos from my Spring Chautauqua hikes. The Bluebells start blooming in late April and are usually gone by June. They seem to change from blue to purple as they pass through the season and are quite spectacular when they are kind of bluey/purply. Anyhow, one blue phase photo and three purple phase turned out. Missed the mid phase this year.

http://www.flickr.com/photos/23323057@N05/sets/72157606483474174/