logo

Author Archive

Apple updates iPad video to remove Flash

Monday, February 1st, 2010
Apple’s introduction video for the new iPad has undergone some changes, quietly.
When Steve Jobs demoed Safari on the iPad on stage, it was obvious that Flash wasn’t on there. Several sites he visited had the now-traditional blue block in place of the Flash player.
In the introductory video that was previewed and later put online, around 2:11 you see the New York Times homepage. A section of the page that uses Flash is clearly visible in the video. This has led to speculation that the iPad will indeed support Flash. No such luck for those that want it.
In an un-announced update to the video, that section has been re-edited to show the blue block.
View the videos yourself and compare. Right around 2:11.
Original: http://www.youtube.com/watch?v=h-aVbSmfTFs
Updated: http://www.apple.com/ipad/
(On a side note, I am on the side of *not* wanting Flash on the iPhone OS (iPhone, iPod Touch, iPad). Its slow, buggy, and just a bad experience overall.)

Apple’s introduction video for the new iPad has undergone some changes, quietly.

When Steve Jobs demoed Safari on the iPad on stage, it was obvious that Flash wasn’t on there. Several sites he visited had the now-traditional blue block in place of the Flash player.

In the introductory video that was previewed and later put online, around 2:11 you see the New York Times homepage. A section of the page that uses Flash is clearly visible in the video. This has led to speculation that the iPad will indeed support Flash. No such luck for those that want it.

In an un-announced update to the video, that section has been re-edited to show the blue block.

ipad

View the videos yourself and compare. Right around 2:11.

Original: http://www.youtube.com/watch?v=h-aVbSmfTFs

Updated: http://www.apple.com/ipad/

(On a side note, I am on the side of *not* wanting Flash on the iPhone OS (iPhone, iPod Touch, iPad). Its slow, buggy, and just a bad experience overall.)

How to run a web server from Virtual Box

Thursday, November 12th, 2009

VirtualBox is a free, lightweight virtual machine simulator from Sun. The current version is 3.0.10.

One of the uses of VirtualBox is to run a web server or other application from a virtual operating system on your computer, whether it be Windows, Linux, or Mac.

So, the point of this short post is to describe how to access your web server from your host machine. For whatever odd reason, I simply could not find this documented *anywhere* that was simple. This requires no installation of extra software or configuration of anything on your computer or on your virtual server.

Ok, I’m assuming that you already have your server installed.

  1. Shut it down if its running.
  2. Open up Virtual Box. In the left panel, select your VM and then click the yellow Settings button above it.
  3. In the new view, click on the Network button off to the right along the top.
  4. By default, Adapter 1 should already be selected. If not select it, or if you are configuring a different adapter, select that one.
  5. You should see menus called Adapter Type, Attached To, and Name. Name is probably greyed out.
  6. Under Attached To, select Bridged Adapter. The Name menu should now be clickable.
  7. Under the Name menu, select the network adapter that your computer is using for its internet connection. I am on a Mac on wireless, so my network adapter is en1: Airport. Yours might be one of the others if you are connected via ethernet.
  8. Hit OK, and this window will go away.
  9. Now start your VM image and log in.
  10. Once it is started up, you have to find the IP address that the VM is now using.
  11. If you are running a Linux server like Ubuntu, type “ifconfig” on the command line. Look for “eth0″ and the “ifnet addr” near it. In my case, it is 192.160.0.7.
  12. If you are running Windows, open your command prompt and type “ipconfig”. Look for a similar type of IP address.
  13. The IP address you found will be the one that you use to contact your virtual web server.
  14. Open a browser and type that number in as the address. If your server is up and running, you should now see a web page from it.

As an added bonus, its easy to configure a local name that points to this IP address and makes it easy to access your web page in the future. The steps are nearly identical for Mac, Linux, and Windows users. Since I am on a Mac, I will describe the process for us. For Windows users, do a quick search on where to find your Hosts file. The information I describe here applies, but your hosts file is in a different location.

  1. Mac users: Open a terminal.
  2. Type ’sudo pico /etc/hosts’ and enter.
  3. Somewhere at the end of the file, add something like “localubuntu 192.168.0.7″. Of course, “localubuntu” is the address I want to use. Feel free to name it whatever you like. Also, the IP address has to match the one that you found in the earlier steps with “ifconfig” or “ipconfig”.
  4. Hit control-o and enter to save the changes. Closing the terminal window will save the changes system wide. No reboot should be necessary.
  5. Now go back to a browser and try going to “localubuntu” or whatever you named yours and you should now be hitting your web server.

Feel free to leave comments, suggestions, or questions about any of this.

Why I use a Mac and not Windows

Sunday, November 8th, 2009
I’m a front-end engineer with a side hobby in video production. I have a Macbook for personal use. I use a high-end Mac desktop at work. For my video editing, I use a high-end machine I built myself that has Windows 7 on it. (more…)

Quick tips on UTF-8 encoding on a Mac running Java & Tomcat6

Monday, November 2nd, 2009

I ran into a problem today with UTF-8 encoding on my Mac(10.5.8), running a Java/Tomcat6 environment. It took a while to figure out, so I’m posting here in the hopes it helps others in the future.

Mac OS uses its own variant of the Java SDK. The default character encoding is MacRoman. (Read this page, scroll to “Character Encoding”). This can cause problems, such as my situation, where we are consuming a service that encodes its data as UTF-8, operates or transforms the data within our application, then outputs it again as UTF-8. The original UTF-8 data was being converted to MacRoman and then back out to UTF-8. Corruption ensued.

Depending on exactly what your problem is, I identified 2 general fixes. I only needed the first one, but I want to document the 2nd as well.

  1. Add URIEncoding to both the Java HTTP and AJP Connectors
  2. Add “-Dfile.encoding=UTF-8″ to your JAVA_OPTS environment variable.

Fix #1:

  1. Edit your server.xml file. This is typically in /apache-tomcat/conf/server.xml.
  2. Look for the HTTP Connector, mine looks like this: <Connector port=”8080″ protocol=”HTTP/1.1″ connectionTimeout=”20000″ redirectPort=”8443″ useBodyEncodingForURI=”true”/>
  3. Add the uriencoding to it: <Connector port=”8080″ protocol=”HTTP/1.1″ connectionTimeout=”20000″ redirectPort=”8443″ useBodyEncodingForURI=”true” uriencoding=”UTF-8″/>
  4. Look for the AJP Connector: <Connector port=”8009″ protocol=”AJP/1.3″ redirectPort=”8443″/>
  5. Add the uriencoding to it: <Connector port=”8009″ protocol=”AJP/1.3″ redirectPort=”8443″ uriencoding=”UTF-8″/>

Fix #2:

  1. In my setup, I have added my JAVA_OPTS and other environment variables to my ~/.bash_profile. I am assuming that you already have your dev environment setup and know where your JAVA_OPTS are. This is my setup.
  2. From the terminal: sudo pico ~/.bash_profile and find the line with your JAVA_OPTS. Again, this is my config line and yours may be different.
  3. Add “-Dfile.encoding=UTF-8″ to it: export JAVA_OPTS=”-Xmx768m -XX:MaxPermSize=256m -Djava.awt.headless=true -Dfile.encoding=UTF-8″

It took me a few hours of searching around and it seems like these are the general settings that most people recommend. For me, it was the combination of both Connectors that made it work. It will probably be different for other people depending on your setup.

For extra info, visit these links for more info:

Tomcat and UTF-8

Apple’s Java Docs

Install Google Page Speed into Firefox 3.5 Beta

Monday, August 17th, 2009

The Goal – Get Page Speed Running on Firefox3.5 Beta I’ve been using Firefox3.5b as my primary browser more frequently because its just damned faster than FF3.0. I’m also a front-end engineer and my life online isn’t complete without Firebug. So I installed that, and on a whim wanted to install Google’s Page Speed Firebug extension. Except it wouldn’t. You probably aren’t reading this unless you know what Page Speed is already, but if you don’t and want to know more visit http://code.google.com/speed/page-speed/. Needless to say, I got this running. Kinda. Page Speed has some “bugs” in FF3.5 right now. This is simply a write-up on how to get it installed right now. This document will likely be out of date in a couple months.

Also, I am not providing a download for my modified Page Speed extension because:

  1. It will be out of date soon.
  2. I don’t want to deal with hosting it.
  3. And I don’t want to deal with comments from people who just install it and get any of the errors that result. This is just a how-to.

What’s Needed

You need Firefox 3.5 Beta. Go here.

You need Firebug 1.4 Beta. Go here.

You need Page Speed. Go here.

Install the Firefox 3.5 Beta. When you get that going, install the Firebug 1.4 Beta extension.

STOP HERE. READ ON FIRST.

The Problem – Page Speed Isn’t Designed For Firefox 3.5 Beta

After I got this going, Page Speed was giving some errors. Basically, it looks like the page performance tab works just fine, but the page speed activity tab doesn’t. And it produces some errors. Oh well, lets continue.

What we’re doing is increasing the “maxVersion” value in the page-speed.xpi extension to allow FF3.5 to install it.

Steps

  1. Download the page-speed.xpi and save it locally on your machine. Direct Link
  2. Rename the file from “page-speed.xpi” to “page-speed.zip”.
  3. Un-archive the zip, aka unzip. This creates a directory called “page-speed”.
  4. Navigate to “page-speed” directory.
  5. Edit “install.rd” with your favorite text editor.
  6. Search for “3.0.*”
  7. Change to “3.5.*”
  8. Save the “install.rdf” file.
  9. On a Mac, select all of the contents of the page-speed directory, right-click and choose “Compress 6 items”. This creates “archive.zip” in the page-speed directory.
  10. Are you on Windows? I’m sure the steps are similar. You really should just get a Mac, because “I’m a Megan”, not a piece of under-performing commodity hardware with an over-priced OS and no quality pre-installed software.
  11. Rename “archive.zip” to “page-speed.xpi”.
  12. Drag the new “page-speed.xpi” into any open Firefox 3.5 Beta window and you should get the extension install dialogs. A restart of the browser is required after installation.

If you get an error like: “Error: Firefox could not install the file at because: Install script not found -204″ its because you created the archive wrong. See notes from above.

After Installation

Assuming everything went well, you should now have Page Speed available in Firebug. In my testing, the Page Speed tab works great. However, the Page Speed Activity tab generates some errors and won’t run. I have no idea or ambition to fix this particular problem. Maybe someone more outgoing than I am can come up with a fix for this.

How to spoof a MAC address on Mac OS X Leopard 10.5.6

Sunday, May 10th, 2009

Lots of people have been having problems spoofing their MAC addresses on their Macs with Leopard 10.5.6. The technique has changed just a bit in the last couple of OS updates, but its really, really easy. There’s a couple of gotchas that can make it confusing, so I’m going to lay those out. Make sure you read everything first.

(more…)

Easy jQuery Tooltip

Friday, March 6th, 2009

Pretty basic post here. At work the other day, I needed a quick tooltip and didn’t want to install an over-burdened jQuery plugin, so I whipped this up. The usage is pretty basic, in that it uses the the “alt” attribute for the tooltip text. You can change the “x/y” variables to control the position offset from the mouse. Customize the styling in your own stylesheet. A sample is provided below.


var tooltips = { //tooltip to show Alt text
init:function(selector){
x = 10;
y = 10;

jQuery(selector).hover(function(e){
var tip = jQuery(this).attr('alt');
jQuery("body").append("

"+ tip +" ");
jQuery("#btooltip").css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px").fadeIn(250);

}, function(e){ jQuery('#btooltip').remove(); });

jQuery(selector).mousemove(function(e){

jQuery(selector).css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px");

});

}
}

jQuery(document).ready(function(){
//init tooltips
tooltips.init(jquerySelectorHere); //use any kind of normal jQuery selector.
});



You also need some simple styling. The only thing required is for display to be none for the fade-in to work. Here’s a sample.


#btooltip{
display:none;
background-color:#cc0000;
border:2px solid #000;
padding:5px;
}

How to Use Multiple Twitter Accounts on One Gmail Account

Friday, February 20th, 2009

There are many times when you might want multiple Twitter accounts. You might have one for your personal use and one for your company.

Twitter restricts accounts to one per unique email address. Who wants to manage multiple email accounts unnecessarily?

Add Some Variety to Your Gmail Address

Gmail has a cool feature that’s been around for many years. You can extend your email address by applying “+uniquetext” to the end of your address before the @ symbol.

For example, my personal Twitter account is http://twitter.com/geuis. I also have another one I just started for Javascript conferences, http://twitter.com/jsconferences.

For my personal account, I signed up with ‘geuis.teses@gmail.com’. For jsconferences, I used ‘geuis.teses+jsconferences@gmail.com’. Twitter recognizes each as a unique email address, and Gmail nicely delivers mail to both addresses to my one email account.

Keeping Organized: Apply Labels Automatically

If you’re running multiple Twitter accounts, all of those notification emails could get confusing. Lets filter them into their own labels in Gmail.

If you’re new to labels, just think of them as versatile folders. Also, Gmail offers “filters”, which are similar to “Rules” in a mail program like Outlook.

Ok, there’s 2 steps.


  1. 1) Make the label(s).

  2. 2) Setup the filter(s).


Make the Label

Go to your inbox and at the top look for the Labels drop down button. Click on “Manage Labels” at the bottom of the menu.

On the Settings screen that appears, at the very bottom create a new label. For me, I’m adding “jsconferences”. Click the Create button to make it so.

Setup the Filter

Click the Filters tab, then click “Create a New Filter”. In the To: field, put your email address with the “+uniquetext” you used to register your Twitter account. For me, this is geuis.teses+jsconferences@gmail.com.

Click the “Next Step” button.

Check the box “Apply the label” and the label you created a minute ago from the list. When you’re ready, click the “Create Filter” button. You’re done!

Testing

Send an email to your email address with the “+uniquetext” text. When it is received back in your inbox, it should now have the label.

That’s it. Twitter on!

Detecting Technological Advancement in Alien Civilizations

Wednesday, January 28th, 2009

Here in the U.S. we are converting all of our tv broadcast signals from analog to digital for the first time since people started broadcasting television signals. It indicates an advancement that is potentially detected far beyond our own blue marble. It prompted a thought about SETI’s search for an alien civilization’s broadcast signal over the years, and how we might be able to detect their rough level of advancement if we listened long enough.

There’s some hypothetical assumptions we have to make to illustrate this idea. First, that we have detected an alien civilization’s broadcast signals and have been listening for a while. Second, that we have been able to get more information from the signal beyond the fact that it exists. It not only has to be strong enough to be detectable, it must still be carrying information we can decode.

A fact that has been widely talked about over the years is that since people started broadcasting radio in the early 20th century, there has been an ever-expanding envelope of radio signals emanating from the earth and into surrounding space. By now, its possible that our earliest radio and tv signals have spread across a volume of space almost 90 light years in all directions. There are thousands of stars in this small region of space, and a sufficiently advanced civilization living out there could have been listening to us for decades.

In our scenario, lets switch roles. We have detected a civilization that isn’t too far away and have been recording their broadcasts for a number of decades. Over the years, we’ve seen their signals get stronger and more sophisticated. If we are able to interpret their broadcasts, we could get a lot more information about their societies that would add to our estimates of their development. Depending on the rate of change over time, we can make rough estimates about their level of technological advancement.


  1. If the change has been slow, we might assume they have are advancing at a slower rate than we are.

  2. Alternatively, we might deduce they are advancing more quickly than us.

  3. If we detect a variable level of complexity in their signals over a long period of time it could indicate a civilization-wide war, natural disaster, or even economic collapse has occurred that set them back.

  4. Finally, if their signals stop suddenly and never return it might indicate either a complete collapse or it could be an indicator that they have gone through their own Singularity.


Point 4 has some special meaning. If the complexity of another civilization’s signals have steadily increased over the years and then suddenly stopped or drastically altered in a short amount of time, this could be interpreted as a very good indicator of a Singularity event. Depending on the civilization’s distance from our own and how long the delay is between when it was broadcast and when it was received, this could be an early warning indicator that we could be on the receiving end of first contact in a short amount of time. It might be our only warning before we encounter whatever came out the other end of their Singularity. A short review of human history teaches good lessons for what happens to the less-developed in situations like that.

We should look at our own progress over the last 100 years and imagine what another species nearby might be seeing.

ReloadCSS Stylesheet Reloader – make development a bit easier

Tuesday, January 27th, 2009
ReloadCSS Bookmarklet: Reload CSS

The ReloadCSS source: Source


A while back I ran into an annoying problem. I was working on a couple of projects that were Java/JSF/JSP based. We were using Eclipse with Tomcat to run the project. The annoying bit was that whenever I made a change to a stylesheet, it would take several seconds to a minute before Eclipse updated the working deployment. Despite refreshing the browser repeatedly, a simple change just wouldn’t refresh immediately.

Also, if the remote dev servers for the database were running slow, each page refresh would take a while depending on what the application was trying to do.

My continuing interest in jQuery as a primary javascript development platform led me to a quick temporary solution. I wanted to make a JS bookmarklet that would dynamically reload all of the stylesheets on the page. I’ve since updated it a bit to make it more robust.

I’ve set this up as a code demo. You can add the bookmarklet to your browser by dragging the link to your toolbar in Firefox, or adding it as a favorite in IE. Safari is a little trickier, but basically just add it as a bookmark and it should work.

When you are on a page you are working on, hit the Reload CSS bookmarklet. This will insert a “Reload CSS” button floating in the top-right of the browser window. Every time you click this it will reload all stylesheets loaded via <link> tags. Sorry, it doesn’t load stylesheets with @import right now.

Each <link> tag href attribute gets a counter incremented as #num. This tricks the browser into updating the CSS.

The bookmarklet checks for jQuery in the DOM, then loads in v1.3.1. If you already have jQuery loaded, it isn’t loaded again. The script itself is then loaded from from my code stash here. When I make updates, they’ll automatically be updated. Also, feel free to copy the code itself if you want to use it or host it locally.

This has been tested and verified working in Firefox 3 and Safari on Mac OS and Windows. This is where I do my primary development and was my only concern when developing this.

Feedback is really appreciated, and hopefully this will help someone out.

ReloadCSS Bookmarklet: Reload CSS

The ReloadCSS source: Source