Friday, December 29, 2006

Does Google Ever Sleep?

The Google calculator is not a new feature but I just got around of using it. You can do things like:
1 cubic centimeter in ml
Pretty self explanatory but this will give you the conversion of one cubic centimeter in milliliters or
1 cubic millimeter in ml
= one cubic millimiter in milliliters or
65 mph in km/h
= 65 miles per hour in kilometers per hour The guide to the calculator is at

Thursday, December 28, 2006

IE and Firefox Friendly Filenames from ColdFusion

When generating files from ColdFusion (such as Excel) it is important to make the filename friendly to both Internet Explorer and Firefox. On top of that, when using Windows, the filename should not contain any special characters (as considered by the OS). Here is a regular expression that will remove replace special characters and multiple consecutive spaces with a dot (".").
<cfset fileName = fileName.replaceall('["\/\\\[\]:;\|=,\*\?]|\s+', ".") />

Wednesday, December 27, 2006

Reclaim Your Memory from Firefox

1. Open Firefox and go to the Address Bar. Type in about:config and then press Enter 2. Right Click in the page and select New -> Boolean 3. In the box that pops up enter config.trim_on_minimize. Press Enter 4. Now select True and then press Enter 5. Restart Firefox Here is the full info:

Why I Love Regular Expressions

If you haven't used Regular Expression, you haven't lived. It's as simple as that :-) I used the following RegEx to rename a bunch of files in the nifty XYplorer (more on that in another post):
(The)\s(.*)\.(.*)>$2, $1.$3
In the case of XYplorer, what that did was rename a bunch of files from "The Stupid File.rar" to "Stupid File, The.rar". Pretty neat...not like the good old days when you'd have to rename each file by hand.

Christmas is Over...Thank God!

I know I probably should be grateful for Christmas and all that but wow, it was a major pain in the ass this year. Getting presents for everybody, running around town to visit different families and not being appreciated one bit really sucks. Next year we'll be taking a vacation somewhere just like in the movie "Christmas with the Cranks" (well, almost, they planned a vacation but let their neighbors bully them into doing Christmas anyway)

Thursday, December 21, 2006

How to make Ajax calls with Prototype

You can get prototype from Some docs and tutorials on using it: Here is an example of an Ajax call passing form variables.
Function:  AjaxRequest
   formID    string - the form id to be used in the request
   pageUrl   string - the page url to call for the results
Return Value: None
   Retrieves the contents of the server side page defined
   in 'pageUrl' using Ajax */
function AjaxRequest(pageUrl, formID)
 // Disable the form - 'formID' is the id of the form that was passed in

 // Serialize the form parameters to pass them along as part of the form submission
 var params = Form.serialize(formID);

 // Make an ajax request with the 'get' method, passing it the serialized form
 // and using 'ReportErrors' function to show any errors
 // and 'ProcessResults' function to process the retrieved results
 // To use the 'post' method, simply change the method to 'post'
 new Ajax.Request(
  { method: 'get', parameters: params, onFailure: ReportError,
  onComplete: function(request) {
  evalScript: false

Function:  ProcessResults
   responseTextstring - the response from the Ajax call
Return Value: None
   Processes the Ajax call results */
function ProcessResults(responseText)

Function:  ReportError
   request    string - the response from the tracking results call
Return Value: None
   Shows an error message if an error occurs durring the ajax request */
function ReportErrors(responseText)

How to Create a Alpha Range Drop-Down List

Let's say you have a query that returns a bunch of users by last name. Now you want to be able to let the user pick users with last names starting with 'A', 'B' or 'C'. The code below will create a drop down options like 'A-C', 'D-F', 'G-I'...etc.
<!--- Setup the alphabet list --->
<cfset alphaFilterList="a b c d e f g h i j k l m n o p q r s t u v w x y z">

<!--- Loop through the alphabet list --->
<cfloop from=1 to=26 step=1 index="listPosition">
    <!--- Get the current letter in the alphabet --->
    <cfset alpha=ucase(listgetat(alphaFilterList, listPosition, ' '))>

    <!--- Build a list of three letters --->
    <cfif currentItems eq ''>
        <cfset currentItems=alpha>
        <cfset currentItems=currentItems & '-' & alpha>

    <!--- If there are 3 letters in the current list, display them --->
    <cfif listPosition mod 3 eq 0>
        <option value="#currentItems#">#currentItems#</option>
        <cfset currentItems=''>
    <!--- If the loop iteration is at the last position of the alphabet, display the items --->
    <cfelseif listPosition eq 26>
        <option value="#currentItems#">#currentItems#</option>

Cisco Router at Home...the Saga Continues

I was trying to use VLANs to setup the router on one Ethernet interface but it turns out that would not work unless I had a managed switch capable for trunking. I'd have to put that in front of the router to handle the two separate virtual LAN segments. My next option was to buy a second Ethernet interface card for the router. The WIC-1ENET seemed like a good choice. Doh! I wish I had done more research on it. Apparently, it does work with the Cisco 2612 routers - another $50 wasted on Ebay. Now it's back trying to look for the whole network module.

Monday, December 18, 2006

Configuring Cisco 2612 as a Home Router

What a pain this has been! I learned something tonight: "er flash" = BAD, he he. If I've only paid attention in my Cisco networking classes.... Since this has been such a freaking struggle for me, I'll post the complete guide on how to do it once (if ever) I get it to work.

Friday, December 15, 2006

Place a Call Directly from Google Maps

This might be new to some and not others, but it's new to me: You can place a phone call directly from Google Maps. To try it out: 1. Look for a business in your area 2. If they have a phone number listed, you will see a "Call" next to the phone number 3. Enter your number and click "Connect for Free" Your phone will ring and when you pick it up you will be connected to the number you decided to call from Google Maps. Pretty nice and handy feature.
// //]]>