RSS feed
<< December 2007 | Home | February 2008 >>

Laura Lemay

I started writing web pages in the 1990's. At the time, it wasn't as if you could run over to your local bookstore and pick up a book on HTML. I remember spending hours with the MS DOS Edit program. I'd edit my web pages in Edit and test them on mosaic. I became really good at making a change and reloading it to see it's effect. In fact, to this day my process is pretty much the same. I use different programs but the idea of editing in one program and seeing the effects in another hasn't changed.

At some point books started to hit the shelves on how to edit HTML. There was The Mosaic Handbook for Microsoft Windows [1565920945]. I don't remember being pretty excited about finding it. Some time later I discovered a book by Laura Lemay - Teach Yourself Web Publishing In 14 Days [1575210142]. I remember devouring that Lemay book. Not only did it explain how to write HTML but it went into detail about style and best practices. She would offer advice on creating links seamlessly and avoiding the "click here" malady suffered by so many HTML writers at the time. In short, she offered a holistic approach towards writing web pages. She also had a knack for delivering the information so that it was easy to understand. Unlike some elitist technophile authors who expect you to figure out the preliminaries on your own, she explained things so that you could start editing right away.

A friend of mine liked the book so much that they ended up borrowing it permanently. When I last saw it, it was marked up like a religious fanatic's bible. Highlighter marks and post-its littered the pages like the frantic markings of someone who saw the future racing towards them faster than ever before. As it turns out, that's pretty much what happened. The web spread like a virus and changed everything.

Not surprisingly, Lemay became a prolific writer of web howto books in the years to follow. If you wrote HTML in the 90's you no doubt recognize the name. Recently, I was making a reference to an idea in one of Lemay's books. I decided to add a link to Lemay's Wikipedia page in case the intended recipient of the email didn't recognize the name. I was surprised to discover that there wasn't already a Laura Lemay Wikipedia page. In an attempt to correct that obvious oversight, I've added a new Wikipedia page. It's terribly basic but I'll add more when I find the time. Aside from my trivia note on the daisy bell page, it's the only contribution I've made so far to the Wikipedia site.

Montage-a-google

Grant Robinson has published a cool little app that does a montage of a Google image search. The click-able thumbnail on this post uses suicide girl as the search text.

Lacie file move sluggish

I have two Lacie NAS drives that I use on my network at home. The drive is configured with two share points, and copying from one share point to another takes a very long time. I thought I'd open a dialog with Lacie to see what they thought. Here's a transcript of that conversation.

Posted: January 24, 2008 @ 12:00 AM
Moving files from one share to another on the same device is extremely slow. Several gigs can take over an hour to move. I would expect this sort of operation should only require the device to update the directory structure not perform an actual move of the data from one place to another. Can you suggest a shortcut method for doing this that doesn't require so much time (and bandwidth)?
Posted: January 25, 2008 @ 12:00 AM
[Me],

Thank you for contacting LaCie Technical Support. When you drag and drop files from one share to another, it actually copies the files from the first share to the second share. When reading and writing from the same network drive, the connection will be slower then if you were writing to the drive from your computer.

If you are transferring a lot of small files (lets say 10,000 files that is 10GB’s worth) with the same drive as someone else that is transferring a single 10GB file you will notice a very drastic difference in transfer rates and speeds. This is due to network overhead. The more files that are being transferred the more the overhead. This applies to all NAS devices.
Posted: January 25, 2008 @ 12:00 AM
Jeff,

Thank you for your response. I understand what you've explained. What I don't understand is why "it actually copes the files from the first share to the second share." The files themselves haven't changed, only their location on the file system has.

If I were to issue the "mv" command on an ext3 Linux file system, the command would be nearly instantaneous regardless of their location on a Samba share. Is there something I can do to improve the performance of the move since I know that both the source and the destination are on the same file system? My beer is getting flat waiting for this thing to do it's thing.

Thanks, [Me]
Posted: January 25, 2008 @ 12:00 AM
[Me],

You can try to copy and paste the files instead of dragging them from one share to another. Unfortunately we have no other options or suggestions.
Posted: January 25, 2008 @ 12:00 AM
Jeff,

Would you agree that this is an undesirable characteristic of the product? If so, may I suggest that an enhancement request be added calling for a correction to this behavior? I suspect that I'm not the only person experiencing this problem.

Thanks, [Me]
Posted: January 28, 2008 @ 12:00 AM
[Me],

I have forward your concerns to the product manager for review.
Posted: January 28, 2008 @ 12:00 AM
Jeff,

Thank you for all your help.

You might mention to your product manager that the reason I am even using more than one share is because I need two sets of permission on the drive. One share is read only and the other is read/write. If the drive supported file level permissions, then I would only need one share and the issue of moving the files from one share to the other would be moot.
Posted: January 29, 2008 @ 12:00 AM
[Me],

Thank you for the updated information. I will pass this information along.

Bros before hoes

T-shirt Hell has some of the most politically incorrect t-shirts on the net. I just couldn't resist posting about the "Bros before hoes" one. I know it's absolutely terrible. It's racist, it's sexist and it's demeaning. Still, it has a catchy ring to it, doesn't it?

SOAP shell script

Yesterday I demonstrated a SOAP request using vbs. Here is a comparable shells script. If you don't have /usr/bin/nc then you can try substituting it with /usr/bin/telnet. I've had trouble with telnet escaping certain characters.

#!/bin/sh
hst=swanandmokashi.com
url=/HomePage/WebServices/QuoteOfTheDay.asmx
act=http://swanandmokashi.com/GetQuote

[ -z "$1" ] && { echo "Specify the file you wish to trasfer." ; exit 0 ; }
[ ! -f "$1" ] && { echo "Cannot open $1." ; exit 0 ; }
{
  echo "POST $url HTTP/1.1" ; \
  echo "Host: $hst" ; \
  echo "Content-Type: text/xml; charset=utf-8" ; \
  echo "Content-Length: `stat -c%s $1`" ; \
  echo "SOAPAction: \"$act\"" ; \
  echo ; \
  cat $1 ; \
  sleep 3 ;
} | \
/usr/bin/nc $hst 80  2>/dev/null | tr -d '\15\32' | \
{
  while [ "`read r; echo $r`" != "" ]; do \
    test ; \
  done ; \
  cat ;
}

SOAP droplet

Here's a simple example of a vbs script that takes an XML file, sends it to a remote server and displays the results in an explorer window. I've included a sample XML file to request a "Quote of the day" and modified the vbs to point to the "Quote of the day" service. I've included the body of the request and response. The request is an empty GetQuote element. The response is a GetQuoteResult element which contains two child elements with the quote and the author. To test the script, follow the instructions below. Repeat the steps as many times as you like. The vbs script is a handy way to test XML HTTP services. You can modify the constants at the top of the script, and the contents of the xml document to test other services. This particular service wraps the request and response in a SOAP envelope.

  1. Download quote.xml (Save as) and quote.vbs (Save as)
  2. Drag and drop quote.xml onto quote.vbs
<GetQuote xmlns="http://swanandmokashi.com" /> 
<GetQuoteResult>
  <QuoteOfTheDay>
  The person who is not hungry says that the coconut has a
  hard shell.
  </QuoteOfTheDay> 
  <Author>African Tribal Saying</Author> 
</GetQuoteResult>

I feel pretty

The "I feel pretty" clip is my favorite part of the movie Anger Management movie.

Camera records 1000 times slower than normal

Slow motion capture can make ordinary events seem extraordinary. I'm not sure where this footage is from but it looks like one of the Phantom cameras from Vision Research. Casio introduced the Casio EX-F1 at this year's CES. It can record 40 times slower than normal (30fps * 40) frames per second and is expected to sell for $1000.

The Weiner Circle

In Chicago there's a place where a bad attitude actually improves business.

Number 5

You might remember the movie Short Circuit. Somebody has improved some of the dialog from that movie. By the way, that's "The Plague" form the movie Hackers; and, no the robot is not F---zilla. The resemblance is uncanny though.

Admission

Admission is changing the way people see advertisements. They provide rich ads that adapt to the interests of the viewer.


The downfall of the Cowboys

Hitler is a bloodthirsty Cowboys fan in this spoof of the Jessica Simpson / Cowboys mess.

Separating flash player from content

When you load a YouTube video there are two components that actually get loaded, the object that plays the video and the video itself. If you know the location of the video you can replace the player with one of your own. The video below combines a YouTube video with Jeroen Wijering's FLV player.

If you look at the source for the embedded object you'll notice that the player is pulled from www.jeroenwijering.com and the video is being pulled from some youtube.com machine.

<embed
src="http://www.jeroenwijering.com/extras/mediaplayer.swf"
width="424"
height="350"
allowfullscreen="true"
flashvars="file=http://ash-v51.ash.youtube.com/get_video?video_id=xj8ZadKgdC0"/>

To get the URL of the video, I fired up a packet sniffer (Ethereal), clicked on the player, and made note of any packets going to and from my machine. The traffic looked something like this. First it tried to figure out who www.youtube.com was, then it asked the web server for a resource. It then tried to figure out who youtube-925.vo.llnwd.net was and made a request of it, this time the request contained the URL of the video, make apparent by the flv extension.

Standard query A DNS www.youtube.com
GET /get_video?video_id=jWPY7b35vF4&t=OEgsToPDskIuwBgwhnC7XCouUAwCOKaB&eurl=http%3A%2F%2Fwww%2Eqicboy%2Ecom%2F
Standard query A youtube-925.vo.llnwd.net
GET /d1/01/4D/jWPY7b35vF4.flv

This might not be useful for YouTube necessarily but it suggests an alternative for accessing flv files available on the web, possibly as a way of circumventing the configuration (cross domain option) of the flash player usually bundled with that flv file. Alternatively, it can provide a simple solution to embedding FLV files whose player doesn't have an obvious way of copying the embed/object code. Simply determine the fill path to the FLV file you want to embed and use it to replace the path to the FLV file in the example.

Digital television coupon

At midnight on Feb 17, 2009, television stations will stop broadcasting in analog. If you do not have an digital tuner you will not be able to receive any channels. Congress created a coupon program so that households can continue to use their analog TV sets by connecting it with a TV converter box. Each household is eligible for two coupons each worth $40 that can be applied towards the cost of eligible converter boxed. You can apply for these coupons online or through the usual alternate methods. Coupons expire 90 days after they're mailed. You can request the coupon between Jan 1, 2008 and Mar 31, 2009. They will continue to issue coupons until the $990 million fund runs out (there is also a $510 million continuation fund for over-the-air users).

Use windows 'Print to file' option and Linux to create PDF files

I try to keep my computers as vanilla as possible. Recently I make a purchase online and wanted to keep a copy of the receipt. I wanted a PDF copy of the page but I wanted the software I installed to be kept to a minimum. Here's a quick and dirty way of creating a PDF if you a Linux machine handy. The trick is to send the job to a postscript printer and but selecting the "Print to file" option in the Print dialog so that the results are saved to a file instead of sent to the printer itself. Once you have the postscript file, you can transfer it to a Linux machine and run ps2pdf.

I originally sent the job to an HP printer but ran into errors on the ps2pdf so I installed the Generic Postscript Printer and that worked without a hitch.

To automate this process even further, Henrik Schmiediche has instructions on installing all the tools necessary to omit the Linux machine from the process entirely.

[patrick@sprout pdf]$ ps2pdf output.ps
%%[ ProductName: GNU Ghostscript ]%%
%%[Page: 1]%%
%%[LastPage]%%
[patrick@sprout pdf]$

Burning Man tickets

Burning Man tickets go on sale at 10AM PST today.

New California traffic laws for 2008

Here's a list of new laws for 2008. I received this in an email and the details seem to check out. I think it's funny that we adopted a law based on an urban myth that MythBuster busted on at least two shows (Episode 72 and 84 to be precise). I suppose we can look forward to laws banning the igniting of flatulence. (see original) Forget it, there's actually some truth to that myth. I'm glad to see they're hard at work keeping the coffers full by grabbing the last dollar we didn't leave at the pumps.

False Registration Consequence: A new law allows peace officers to tow a vehicle that displays false registration, false license plates or fraudulent registration. The old law allowed officers to cite and tow cars with registration that was expired by more than six months.

New Smoking Restriction: California drivers will no longer be allowed to smoke in the presence of children under a new state law that took effect Tuesday. Drivers who are stopped for a traffic violation and found to be smoking in a vehicle where anyone under the age of 17 is a passenger will face a $100 fine.

No Tricky Devices: Starting Tuesday, January 1 2008 it is illegal to use or sell a product that impairs the reading of a license plate by electronic devices, such as red-light cameras and toll booth cameras. The fine for obscuring a plate is $146, and the fine for selling such a product is $900 $250.

Slow Down: Drivers should also be prepared to slow down near schools. AB 321 now allows local jurisdictions to establish a speed limit of 15 mph within 500 feet of a school.

Street Racing: Under SB 67, police officers can now impound a vehicle for 30 days when a person is arrested for street racing, exhibition of speed or reckless driving.

Bikers, Light Up: Bikers riding during darkness must use lights and reflectors while riding on highways, sidewalks or bikeways.

Segway Safety: It is also illegal to operate an electric personal assistant mobility device, such as a Segway, at an unsafe speed for conditions, in a reckless manner or a speed that endangers the safety of others.

Hands-Free In July: Later in the year, a state law goes into effect prohibiting drivers from using cell phones and other mobile devices, unless they are equipped with a hands-free speaking and listening system.

No Cellular Phones for Under 18: That goes into effect on July 1. And at the same time, drivers under the age of 18 will not be allowed to use a wireless telephone or other mobile service device, even if it's hands-free, while operating a vehicle.

OLPC spin-off

One of the designers of the OLPC, Mary Lou Jepsen, has spun off to create her own company, Pixel Qi, aimed at creating a $75 laptop. The name of the company comes from combining the word for a picture element, like you would find on a screen, with Qi (pronounced chee) for "the circulating life energy that in Asian philosophy is thought to be be inherit in all things". Design of the laptop just started and it is expected to be available late 2009 or early 2010.

Digg election

Digg is a web 2.0 technology that lets people share content on the web. If you see a webpage you like, you "digg" it. All kinds of information gets "dugg": interesting articles, websites, even digg users themselves. In a sort of pseudo election, digg has the presidential candidates listed as users. Ron Paul is ahead with 17,760 diggs. In contrast, Clinton has only 1,232 diggs.

Preventing video thumbnails

The other day I had a family member was trying to view a video file on his PC. Every time they opened the folder and highlighted the icon for the video, explorer would lock up. When I opened the task manager I could see drwatson.exe startup in the task manager. Doctor Watson, by the way, is a terrible name for that process; unless, of course, you have a distinct hatred for doctors. The drwatson.exe process isn't so much a doctor as a grim reaper. He comes along to collect information on the deceased process. It should probably be called reaper.exe. It does its thing for a minute or so and then a dialog appears. It's almost as if Microsoft's reaction to user's complaints about system crashes was to obscure the crash so that the user wouldn't be sure which program was crashing or even if the program was crashing at all. Rest assured, this program was crashing. I decided to disable the creation of thumbnails for videos with the following command.

regsvr32 /u shmedia.dll 

You can also disable the creation of image thumbnails with the following command.

regsvr32 /u shimgvw.dll 

To reinstall the feature, run the same commands with out the /u switch.

Wimoweh astronauts

Someone made this video of astronauts doing their thing with Wimoweh as the background music.

Jon Stewart reacts to Hillary Clinton emotional meltdown

I've seen this a couple times and I have a hard time understanding how it's made it into the ears of just about everyone I know. Ask someone if they've heard about Hillary's emotional breakdown and I imagine they've heard of it. Still there are plenty of news stories that get neither as much air time or as much attention from the public. How does this happen?

Sprout 3.0

Today was a tough day for Sprout. The BareBones OS-I 630EU Sprout 1.0 behind this web site has been running loyally for several years since I purchased him back on Jun 29 2001 to replace the the AlaphaStation 200 (Sprout 1.0) that preceded it. It has been suffering from Kernel panics for the last couple months. I've refused to upgrade the operating system because I didn't want to invest the time until I had found some new hardware. Today, as I stared at the receipt for $398.46 I realized I had received more than my money's worth. I broke down and purchased a shiny new PowerEdge SC1435. It should be here by the end of next week.

I'd been seeing this Kernel panic when I would try to restart Tomcat. It would only happen on the third or fourth restart since I'd booted the machine. Today I made a very minor change to the configuration file and when I restarted tomcat it caused the Kernel panic. I had configured Tomcat to start automatically on boot (chkconfig --add 35 tomcat) so when I booted the machine it tried to start. This time however it would crash consistently the first time. I had to start the machine in single user mode (hit space at the grub menu, hit the a key and append the string with the word "single"). I had to prevent tomcat from starting (chkconfig --del tomcat) and reboot. While I was at it I even set initdefault in /etc/inittab to 3 instead of 5. I figured the extra free memory couldn't hurt. I've included system information, the odd change to the configuration that causes the error, Tomcat startup information and the kernel panic information. Once I removed the changes to the configuration file, it stopped crashing right out of the gate.

Fedora Core release 3 (Heidelberg)
Linux version 2.6.9-1.667 (bhcompile@tweety.build.redhat.com) (gcc version 3.4.2
 20041017 (Red Hat 3.4.2-6.fc3)) #1 Tue Nov 2 14:41:25 EST 2004
diff -bBdNrw -U5 /usr/local/apache-tomcat-5.5.17/conf/server.xml /usr/local/apache-tomcat-5.5.17/conf/server.xml.evil
--- /usr/local/apache-tomcat-5.5.17/conf/server.xml	2008-01-11 07:29:46.000000000 -0800
+++ /usr/local/apache-tomcat-5.5.17/conf/server.xml.evil	2008-01-11 09:59:33.057210977 -0800
@@ -187,13 +187,13 @@
       -->
 
       <!-- Define the default virtual host
            Note: XML Schema validation will not work with Xerces 2.2.
        -->
-      <Host name="localhost" appBase="webapps"
+      <!--<Host name="localhost" appBase="webapps"
        unpackWARs="true" autoDeploy="true"
-       xmlValidation="false" xmlNamespaceAware="false">
+       xmlValidation="false" xmlNamespaceAware="false">-->
 
         <!-- Defines a cluster for this node,
              By defining this element, means that every manager will be changed.
              So when running a cluster, only make sure that you have webapps in there
              that need to be clustered and remove the other ones.
@@ -366,14 +366,14 @@
       </Host>
       <!--<Host name="www.qicboy.com">
         <Context path="" reloadable="true" debug="0"
          docBase="/usr/local/apache-tomcat-5.5.17/webapps/pebble" />
       </Host>-->
-      <Host name="www.bidfairy.com">
+      <!--<Host name="www.bidfairy.com">
         <Context path="" reloadable="true" debug="0"
          docBase="/home/patrick/websites/www.bidfairy.com/bidfairy" />
-      </Host>
+      </Host>-->
 
     </Engine>
 
   </Service>
Starting Tomcat service: Using CATALINA_BASE:   /usr/local/apache-tomcat-5.5.17
Using CATALINA_HOME:   /usr/local/apache-tomcat-5.5.17
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-5.5.17/temp
Using JRE_HOME:       /usr/java/jdk1.6.0_03
ds: 007b   es: 007b   ss: 0068
Unable to handle kernel NULL pointer dereference at virtual address 00000090
 printing eip:
021067d2
*pde = 00000000
Oops: 0000 [#13]
Module linked in: paraport_pc lp paraport autofs4 i2c_dev i2c_core sunrpc md5 ipv
6 odci_hcd snd_intel8x8m snd_trident snd_ac97_codec snd_pcm_oss snd_mixer_oss sn
d_pcm snd_timer snd_page_alloc gameport snd_util_mem snd_mpu401_uart snd_rawmidi
 snd_seq_device snd soundcore sis900 floppy dm_snapshot dm_zero dm_mirror ext3 j
bd dm_mod

CPU:    0
EIP     0060:[<021067d2>]    Not tainted VLI
EFLAGS: 00010006   (2.6.9-1.667)
EIP is at show_registers+0xb0/0x15e
eax: 023d5000   ebx: 023d5f78   ecx: 00000242   edx: 00000000
esi: 023d5fac   edi: 00000068   epb: 00000001   esp: 023d5e48
ds: 007b   es: 007b    es: 0068
Unable to handle kernel NULL pointer dereference at virtual address 00000090
 printing eip:
021067d2
*pde = 00000000
Recursive die() failure, output suppressed
 <0>Kernel panic - not syncing: Fatal exception in interrupt

Loftware printer device

Loftware Print Server provides software to combine form data and pre-built forms. Their software a few interfaces (a file interface and a TCP/IP Socket Interface, for example) (refer to chapter 1, page 3 of the LPS documentation). They failed however to offer what in my mind was the most obvious interface, a Windows Printer interface, so I've included instructions on how to add this interface yourself by using Russell Lang's Redirection Port Monitor. These instructions create a windows printer named Loftware that forwards the print job to the Loftware file interface. The latter is set configured by default on a fresh installation of the software (at least on version 9.1 which was the version I tested this on).

  1. Check to see if there is a port redirector and if so jump to step 3
  2. Download and extract redmon17.zip (save as) to "c:\redmon17".
  3. Run "setup.exe".
  4. Open the Printer and Faxes applet from the Control Panel and choose "Add a printer". This will start the "Add Printer Wizard".
    1. On the "Welcome to the Add Printer Wizard" dialog press "Next".
    2. On the "Local or Network Printer" dialog configure the printer as a "Local printer attached to this computer" (do not click "Automatically detect and install my Plug and Play printer"). Press "Next".
    3. On the "Select a Printer Port" dialog choose "Create a new port" and select "Redirected Port". Accept the suggested Port Name. Press "Next".
    4. On the "Install Printer Software" dialog, choose "Generic" as the Manufacturer and "Generic / Text Only" as the Printer. Press "Next".
    5. On the "Use Existing Driver" dialog choose "Keep Existing Driver", choose "Keep existing driver (recommended)". Press "Next".
    6. Give the printer the name "Loftware" without the quotes and select "No" for "Do you want to use this printer as the default printer". Press "Next".
    7. On the "Printer Sharing" dialog choose "Do not share this printer". Press "Next".
    8. On the Location and Comment dialog Press "Next".
    9. On the "Print Test Page" dialog select "No" and Press "Next".
    10. On the "Completing the Add Printer Wizard" dialog press "Finish".
  5. Right click on the newly created "Loftware" printer and select the "Ports" tab. Click the "Configure Port" button. Configure port with the following settings.
    Rediect this port to the program:
    C:\redmon17\redfile.exe
    
    Arguments for this program are:
    C:\PROGRA~1\LOFTWA~1\WDDrop\loftware%04.pas
    

Anonymous browser

Anonymity on the Internet is important to everyone. Whether you're concerned about protecting your identify from online predators; and, lets face it, if you're assuming that the credit card companies are watching out for you then you're in for a rude awakening; or, if you're one of those people that live in the gray area of of the law for which the general population has little sympathy, then hiding who you are is something that has at least crossed your mind.

Our bureaucratic legal system takes time. While it's wrestling over such clearly morally ambiguous issues such as whether sex toys should be legalized, the citizens of this "free" country are being convicted of acts which many of us have engaged in at least once.

Furthermore, there will always be a need to protect against forces which stand contrary to the beliefs of this country such as when a leader, domestic or otherwise, challenges the basic idea that we should secure the blessings of liberty, and be secure against unreasonable searches and seizures.

So it stands to reason that as we evolve technologically, we implement failsafes to protect the very freedom which makes a country great. One such innovation has been the introduction of anoymizing software to the ubiquitous internet program: the web browser in a simple to use package. The xbBrowser (save as) combines the technology of the Onion Router (Tor) with a portable version of the Firefox browser.

When you visit a website, your activity on that website is recorded. The information is logged for a variety of reasons including, web site analysis. When a web browser makes a web requests it often gives the server information about the web browser itself, the operating system its running on and the add-ons that are installed on the browser. It also gives the web server the address of the machine that's making the request. This address, the IP address, can be used to determine the location of client's machine and can even disclose the organization and user responsible for that address.

The onion router helps obscure the identify of the client by routing the request through other peers on the onion network.

Extraordinary skills

YouTube is filled with videos on people with extraordinary skills. Odee.com has a list of 10 real life super heroes. The list includes Daniel Tammet, the savant with an incredible facility with numbers and Ben Underwood, the boy who can see using sonar. While not as extraordinary as that list of 10, this video includes some people with some pretty incredible skills.

Scripting headless signed Java applet

When I originally set out to write the Sendmail applet, I had the intention of using an HTML form to prompt the user for information. As it turns out, the applet requires heightened security. That's why you see asking if you want to run the application. Java applets typically prevent you from connecting to a server. other than the one you downloaded the original applet from. I need to sign the applet to get around this security restriction. I had an invisible applet that I could call using JavaScript. When i tried it with the signed applet I discovered that I ran into the security restriction again. Here's a sample of how to access Java applet methods from within JavaScript. Unfortunately, the function being called throws a security exception.

<applet 
alt="Browser has Java disabled" 
name="sendmail" 
width="0" 
height="0" 
code="SendmailHeadlessApplet"
archive="http://www.qicboy.com/files/2008/01/12/sendmail.jar">
</applet>

<script>
function send() {
  document.sendmail.send(
    'smtp.someisp.net', 
    'you@yourisp.net', 
    'them@someisp.net', 
    'Hello world');
}
</script>

<form>
<input type="button" onclick='send();' value='Send'/>
</form>
java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.net.smtp)
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPackageAccess(Unknown Source)
	at sun.applet.AppletSecurity.checkPackageAccess(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	at Sendmail.send(Sendmail.java:33)
	at SendmailHeadlessApplet.send(SendmailHeadlessApplet.java:6)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at sun.plugin.javascript.JSInvoke.invoke(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
	at sun.plugin.liveconnect.PrivilegedCallMethodAction.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)

Click-first objects

One of the challenges of writing a blog, or any type of website for that matter, is having the right balance of media and text so that you achieve the type of look you're striving for without subjecting your audience to a long wait while the page loads. Each piece of media extends the amount of time it takes for the web page to load. Some companies make a business out of handling content so that it is presented to the user efficiently. YouTube, for example, offers a video player that users can include in their blogs. This video player download the video immediately, it requires the reader to click on the object first. this allows the author to include multiple video players on their site without subjecting the readers to unnecessary downloads. Still, the player itself needs to load and, once it's loaded, it consumes memory. Also, the YouTube player isn't the only object someone might put on their site. These objects add up and some of them can take a long time in and of themselves to load on the client's machine.

One way around this problem is to load an image of the object on the page instead of the object itself. We can make the image a Hyper link that takes us to the object itself. This way, the user can choose which objects they wish to load. This can be very handy with objects that take considerable time to load (like the Impossible quiz) or with objects that require special user interaction (like a signed Java applet.

The code sample below demonstrates the use of an image to preface the loading of a object.

<p>
  <a target="_blank"
  href="http://www.notdoppler.com/files/theimpossiblequiz2.swf">
    <img 
    border="0" 
    src="http://www.qicboy.com:80/files/2007/05/27/quizbig.jpg"/>
  </a>
</p>

The problem with the previous code is that it sends the user to another page. The YouTube object, remember, doesn't send the user to another site, it merely starts the download of the video. To accomplish the same effect we can make use of the inline frame tag. The iframe allows us to include another web page within our web page.

The following code makes use of two additional pages. One page displays the image and a second with the object code. When they user clicks on the first page the second page is loaded in place of the first one containing the image. The rest of the page remains unchanged. The first portion is included in another, larger page. The second portion contains the source to sendmail0.html (the page included in the larger page). The second portion includes the source to sendmail1.html (the page linked to from the first page). I use a sort of screen shot with a play button overlay (save as) overlay to give the users an idea of what the object will look like. The result is a familiar look and feel.

<iframe 
noresize="noresize" 
style="border:0px" 
frameborder="0" 
scrolling="no" 
marginwidth="0" 
marginheight="0" 
width="425" 
height="350" 
frameborder="0"
src="http://www.qicboy.com/files/2008/01/05/sendmail0.html">
</iframe>
<a href="http://www.qicboy.com/files/2008/01/05/sendmail1.html">
  <img border="0" src="http://www.qicboy.com/files/2008/01/05/sendmail.jpg"/>
</a>
<applet 
alt="Browser has Java disabled" 
name="sendmail" 
width="425" 
height="350" 
code="SendmailApplet" 
archive="http://www.qicboy.com/files/2008/01/05/sendmail.jar">
</applet>

Hacking HTML email

If you use a GUI email client and you're trying to edit your HTML email to look just so, it can feel like riding a bike with training wheels that won't come off. HTML has introduced a very powerful way to communicate over email. Many email clients prevent us from making the sort of changes we'd like to the body of our email. Try adding background music to your email in Microsoft Outlook for example. Or try changing the name of the recipient to "Undisclosed recipients". If you have a Linux machine, the solution is simple, use the sendmail command.

$ /usr/sbin/sendmail them@someisp.net < mail.msg

If you're on a Windows machine, there is no sendmail command and what's worse, you're probably sending your email to an exchange server that will reject your email if it doesn't like what it sees. I've written a a Java applet to get around these limitations. I've also included a sample email to send to demonstrate including background music.

Test the form with your own information to make sure you have it working properly with information you know should work, then modify it to suit your needs.

  1. Find the name of your SMTP server and put this name in the server field.
  2. Replace the "From' field, the "To" field and the "To" information in the message body with your email address. Make sure you replace Undisclosed recipients with your real name.
  3. Click send.

The first step is by far the hardest step in this process. Tool | E-mail Accounts | "View or change existing e-mail accounts". Select the accounts you want to use and click "Change...". You should see the "Outgoing mail server (SMTP). If you're using exchange then use the "Microsoft Exchange Server" as the SMTP server.

The following code includes background music in the message. Replace the text between the boundary tags with the text below.

Content-type: text/html

<DIV dir=ltr align=left><SPAN 
class=668451817-03012008>Can you hear this music?</SPAN></DIV><BGSOUND 
balance=0 src="http://www.jhpro2.com/email_audio/CrazyEmail.mp3" volume=0 
loop=infinite>

If you're using a Microsoft Exchange server, I should warn you, they have the most convoluted rules I've ever seen for accepting emails. The sample background music email will fail if it's modified even slightly.

This example used to cause the email client to crash.

Content-type: text/html

<html>
<form>
<input type crash>
</form>
</html>

Simple email service request

My previous post briefly explains the language that a web server uses to communicate. Web servers aren't the only services on the internet. Another really popular service is the one that handles the transmission of email. This server uses SMTP instead of HTTP to communicate. I've included some sample code to demonstrate a conversation in SMTP.

This is a vbs script to send an email. I've replaced the items in bold with bogus information to avoid pissing off any admins.

dim objShell
Set objShell = CreateObject("wscript.shell")
objShell.Run "telnet smtp.someisp.net 25"
WScript.Sleep 1000
objShell.SendKeys "EHLO test.com{ENTER}"
WScript.Sleep 1000
objShell.SendKeys "MAIL FROM: someone@someisp.net{ENTER}"
WScript.Sleep 1000
objShell.SendKeys "RCPT TO: someone@someisp.net{ENTER}"
WScript.Sleep 1000
objShell.SendKeys "DATA{ENTER}"
WScript.Sleep 1000
objShell.SendKeys "Subject: Test script message{ENTER}"
WScript.Sleep 1000
objShell.SendKeys "This is a test message.{ENTER}"
WScript.Sleep 1000
objShell.SendKeys ".{ENTER}"
WScript.Sleep 1000
objShell.SendKeys "QUIT{ENTER}"

Here's a shell script (UNIX) to run the commands automatically.

{ sleep 1 ; echo "EHLO test.com" ; echo "MAIL FROM: patrick@qantel.com" ; echo "RCPT TO: patrick@qantel.com" ; echo "DATA" ; echo "Subject: Test script message" ; echo "This is a sample body." ; echo "." ; echo "QUIT" ; sleep 1 ; } | telnet smtp.qantel.net 25

Here's a transcript of the conversation again with info in bold replaced.

220 smtp.someisp.net Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 re
ady at  Fri, 11 Jan 2008 13:40:10 -0800
EHLO test.com
250-smtp.someisp.net Hello [208.228.218.144]
250-TURN
250-SIZE
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-TLS
250-STARTTLS
250-X-EXPS GSSAPI NTLM
250-AUTH GSSAPI NTLM
250-X-LINK2STATE
250-XEXCH50
250 OK
MAIL FROM: someone@someisp.net
250 2.1.0 someone@someisp.net....Sender OK
RCPT TO: someone@someisp.net
250 2.1.5 someone@someisp.net
DATA
354 Start mail input; end with .
Subject: Test script message
This is a test message.
.
250 2.6.0  Queued mail for del
ivery

Simple web service request

Yesterday I briefly explained how programs listened on ports. Some of these programs, like web servers, use very simple to understand commands. When you use a web browser to communicate with a web server, the browser sends the commands for you. The commands are actually so simple that you can send them yourself and avoid using the web browser entirely. When you point your browser at http://www.google.com/ your browser contacts the web server and requests the default page also known as /. If you typed something in the search bar and hit search you could request another web page. If your address bar read http://www.google.com/search?hl=en&q=TEST&btnG=Google+Search then it would indicate it was requesting /search?hl=en&q=TEST&btnG=Google+Search page.

You could request the default page yourself using a program called telnet. Simply open a command prompt and type telnet www.google.com 80 and hit enter. The next command will be invisible so make sure you're hitting the right keys. When the screen clears, type GET / and hit enter. The web server should respond with a bunch of HTML.

These are the basics of speaking in HTTP. Many applications are being either retrofitted or designed from the onset to support HTTP requests. One of the more popular examples of using HTTP communication is the stock quote. Here is a simple example of making a request to get the value of Google stock. If you look closely you can see that it's valued at 638.25 today.

GET /stockquote.asmx/GetQuote?symbol=GOOG
HTTP/1.1 200 OK
Date: Fri, 11 Jan 2008 21:43:45 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 728

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://www.webserviceX.NET/">&lt;StockQuotes&gt;&lt;Stock&gt;&lt;
Symbol&gt;GOOG&lt;/Symbol&gt;&lt;Last&gt;638.25&lt;/Last&gt;&lt;Date&gt;1/11/200
8&lt;/Date&gt;&lt;Time&gt;4:00pm&lt;/Time&gt;&lt;Change&gt;-8.48&lt;/Change&gt;&
lt;Open&gt;642.70&lt;/Open&gt;&lt;High&gt;649.47&lt;/High&gt;&lt;Low&gt;630.11&l
t;/Low&gt;&lt;Volume&gt;4973601&lt;/Volume&gt;&lt;MktCap&gt;199.7B&lt;/MktCap&gt
;&lt;PreviousClose&gt;646.73&lt;/PreviousClose&gt;&lt;PercentageChange&gt;-1.31%
&lt;/PercentageChange&gt;&lt;AnnRange&gt;437.00 - 747.24&lt;/AnnRange&gt;&lt;Ear
ns&gt;12.783&lt;/Earns&gt;&lt;P-E&gt;50.59&lt;/P-E&gt;&lt;Name&gt;GOOGLE&lt;/Nam
e&gt;&lt;/Stock&gt;&lt;/StockQuotes&gt;&lt;/string>

This is a shell script (UNIX) to run the commands automatically.

{ echo "GET /stockquote.asmx/GetQuote?symbol=GOOG{ENTER}" ; sleep 3 ; } | telnet www.webservicex.net 80

This is a vbs script (WINDOWS) to run the commands automatically.

dim objShell
Set objShell = CreateObject("wscript.shell")
objShell.Run "telnet www.webservicex.net 80"
WScript.Sleep 3000
objShell.SendKeys "GET /stockquote.asmx/GetQuote?symbol=GOOG{ENTER}"

Update: I've updated the results so the quote values may not be the same as they were on the day this post was written.

Why use a router at home

If you use a router at home, you're going a long way to ensuring that your computer is protected from malicious software. If you don't have a router, you should really consider getting one. The reason is because when you connect your computer to the internet, you're potentially exposing yourself to service attacks. When you surf the web, your web browser creates a connection to a web server to download a web page. Imagine that you point your web browser at http://www.google.com. Your browser will contact a program at Google called a web server. Your browser sends it a command to retrieve a page, and the web server responds with the page itself. The browser needs to know how to contact the web server. The URL you entered (http://www.google.com) provides the browser with the information it need to contact this web server. It includes, for example, the name of the machine to contact (www.google.com). The machine running the web server may also be running services other than the web server. It might, for example, be running a service that accepts emails. Internet clients distinguish one service from another by an identifier called the port. There are many "well known" port numbers and services can even choose to ignore the web known port number and use an entirely different port number. The well known port number for web servers is port 80. You can generally specify the port number in a URL by appending it after the name of the machine as in http://www.google.com:80.

Services, like web servers, that need to accept client connections, can listen on a port. If you connect your PC directly to the internet, and you have one of these services running, other people on the internet may be able to connect to one of these services. PCs and the operating system that run on them were designed to be flexible, so you can easily install software that runs one of these services. If your PC is connected to a router however then the router acts as a go between for information going to and from the internet. Internet traffic doesn't go to your machine unless the router explicitly sends it there. In fact, if you want to run a web server from your PC you have to go into the router configuration and tell it that it's OK to forward the traffic.

To get an idea of which services are running on your PC, open a command prompt and type "netstat -a". Lines ending in LISTEN indicate a service that is listening on a port.

You can find inexpensive routers for around $40. I had a Netgear router that went down like a cheap whore. I replaced it with a Linksys one and haven't had to reboot it since I installed in. The WRT54G sells for $50 at Amazon but I expect you should be able to find it for less at your local discount computer store.

Add digg to your blog

Web 2.0 encompasses a variety of new ideas many of which reflect a new paradigm for engaging users to collaborate on an idea instead of simply consuming it. I love this concept because it is one of the principles of the Burning Man movement: Participation. Digg is one of these new Web 2.0 technologies, it offers a collaborative approach to sharing content. I've altered this blog to now include Digg links for each posting. If you think an article is worth sharing you can click on the Digg link for that article.

If you run a Pebble blog, you can edit your blogEntry.jsp file with the diff information in the code sample below to add Digg links to your own blog.

diff -bBdNrw -U5 WEB-INF/jsp/blogEntry.jsp.rel 
WEB-INF/jsp/blogEntry.jsp
--- WEB-INF/jsp/blogEntry.jsp.rel       2007-06-25 20:05:30.000000000 -0700
+++ WEB-INF/jsp/blogEntry.jsp   2008-01-10 12:16:21.210626630 -0800
@@ -11,11 +11,23 @@
 </c:choose>

   <%@ include file="/WEB-INF/fragments/blogEntryLinks.jspf" %>

   <a name="a${blogEntry.id}"></a>
-  <h1><a href="${blogEntry.permalink}">${blogEntry.title}</a></h1>
+  <h1>
+<div style="float:right; text-align:right;">
+<!--[digg]-->
+<script type="text/javascript">
+digg_url = '${blogEntry.localPermalink}';
+digg_skin = 'compact';
+digg_window = 'new';
+</script>
+<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
+<!--[/digg]-->
+</div>
+<a href="${blogEntry.permalink}">${blogEntry.title}</a></h1>
+
   <h2>${blogEntry.subtitle}</h2>

   <div class="contentItemBody">
     <c:choose>
       <c:when test="${displayMode == 'detail'}">

If you use blog software other than Pebble you can add the code segment below to add Digg to your site. Place the code wherever you want the link to appear. You will need to replace ${blogEntry.localPermalink} with the URL for the article. Visit the Digg integration page for more information.

<!--[digg]-->
<script type="text/javascript">
digg_url = '${blogEntry.localPermalink}';
digg_skin = 'compact';
digg_window = 'new';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
<!--[/digg]-->

On the old Blogger templates you <$BlogItemPermalinkUrl$> will work. If you're running the old templates you should see a toolbar item under the Template tab that erads "Customize Design". It's between "Pick New" and "AdSense". The page allows you to "UPGRADE YOUR TEMPLATE". If you are using the new templates, there is an option to revert to the classic template. This option is under the "Edit HTML" item in the Template tab. It's between "Fonts and Colors" and "Pick New Template". Be careful as you're likely to lose any customization changes you've made in your new template, I'm not sure.

<< December 2007 | Home | February 2008 >>