13
Javascript Helpers
Combined with my old favorites of Dynamic Drive, DHTML Goodies and Brain Jar, I’ve added the following to my list of Javascript sources.
Combined with my old favorites of Dynamic Drive, DHTML Goodies and Brain Jar, I’ve added the following to my list of Javascript sources.
The current US financial situation has claimed a victim in the Web 2.0 world — Uber. I’m not sure if this is the first significant name, but it will not be the last site running MySQL where investors will be quick to cut losses and move on.

Every website page content uses two basic elements, HyperText Markup Language (HTML) and Cascading Style Sheets (CSS). Each of these has various standards, HTML has versions such as 3.2, 4.0, 4.01, and the new XHTML 1.0,1.1, 2.0 along with various version flavors know as strict, transitional & frameset. CSS also has various versions including 1, 2 and 3.
Each browser renders your combined HTML & CSS differently. The look and feel can vary between FireFox, Safari, Chrome, Internet Explorer and the more less common browsers. Indeed each version of a product also renders different. With IE 8 just being released, it’s common versions now are 5.0, 5.5, 6.0 and 7.0. This product alone now has 5 versions that UI designers must test and verify.
To minimize presentation and rendering problems, adhering to the standards can only assist, and greatly benefit the majority of entrepreneurs, designers and developers that are not dedicated resources. There are two excellent online tools from the standards body, the World Wide Web Consortium (W3C) that an easily assist you.
You can also link directly to these sites, so it’s easier to validate your HTML and CSS directly from your relevant webpage. For example, HTML Validation and CSS.
It’s not always possible to meet the standards, and when you are not the full-time developer of your site, it can be time consuming if you don’t check early and regularly.
Choosing a domain name for your brand identity is the start. Protecting your domain name by registering for example .net, .org, and the many more extensions is one step in brand identity.
However a recent very unpleasant experience in New York, resulted in realizing some companies also register undesirable domain names. I was one of many unhappy people, mainly tourists as I was showing an Australian friend the sights of New York. We had chosen to use the City Sights NY bus line, but we caught with some 100+ people in a clear “screw the paying customers” experience.
I was really annoyed that my friend, only in New York for 2 days both had to experience this, and missed out on a night tour. I commented, I’m going to register citysightsnysucks.com, and share the full story of our experience, directing people to use Gray Line New York, which clearly by observation were providing the service we clearly did not get.
To my surprise, the domain name was already taken. To my utter surprise, the owner of the domain is the same as citysightsny.com. Did they do this by choice, or did another unhappy person (at least in 2006) register this, only to be perhaps threatened legally to give up the domain.
I would generally recommend in brand identity this approach, especially when select common misspellings and hyphenated versions if applicable can easily lead to a lot of domain names for your brand identity.
$ whois citysightsny.com Whois Server Version 2.0 Domain names in the .com and .net domains can now be registered with many different competing registrars. Go to http://www.internic.net for detailed information. Domain Name: CITYSIGHTSNY.COM Registrar: INTERCOSMOS MEDIA GROUP, INC. D/B/A DIRECTNIC.COM Whois Server: whois.directnic.com Referral URL: http://www.directnic.com Name Server: NS0.DIRECTNIC.COM Name Server: NS1.DIRECTNIC.COM Status: clientDeleteProhibited Status: clientTransferProhibited Status: clientUpdateProhibited Updated Date: 31-dec-2006 Creation Date: 28-nov-2004 Expiration Date: 28-nov-2011 Registrant: CitySights New York LLC 15 Second Ave Brooklyn, NY 11215 US 718-875-8200x103 Fax:718-875-7056 Domain Name: CITYSIGHTSNY.COM
$ whois citysightsnysucks.com Whois Server Version 2.0 Domain names in the .com and .net domains can now be registered with many different competing registrars. Go to http://www.internic.net for detailed information. Domain Name: CITYSIGHTSNYSUCKS.COM Registrar: INTERCOSMOS MEDIA GROUP, INC. D/B/A DIRECTNIC.COM Whois Server: whois.directnic.com Referral URL: http://www.directnic.com Name Server: NS.PUSHONLINE.NET Name Server: NS2.PUSHONLINE.NET Status: clientDeleteProhibited Status: clientTransferProhibited Status: clientUpdateProhibited Updated Date: 26-jun-2007 Creation Date: 11-aug-2006 Expiration Date: 11-aug- Registrant: CitySights New York LLC 15 Second Ave Brooklyn, NY 11215 US 718-875-8200x103 Fax:718-875-7056 Domain Name: CITYSIGHTSNYSUCKS.COM
Domain names historically have been www.example.com, written also with the protocol prefix http://www.example.com, but in reality www. is optional, only example.com is actually needed.
www. is technically a sub-domain and sub-domains incur a small penalty in search engine optimization.
There is no right or wrong. What is important is that you choose one, and the other needs to be a 301 Permanent Redirect to the one you have chosen.
You also need to know that creating a server alias in your web server configuration, for example Apache or Tomcat is not a permanent redirect, in-fact it is technically duplicate content, with two web sites the same also incurring a penalty for search engine rating.
So what do the big players do. Here are a few.
Use www
Do not use www
Show duplicate content
Curiously youtube.com uses a 303 redirect, microsoft.com, stumbleupon.com and craigslist.org a 302 redirect.
How do you check? Use a CLI tool such as wget.
$ wget www.google.com --2008-09-22 19:56:48-- http://www.google.com/ Resolving www.google.com... 72.14.205.99, 72.14.205.103, 72.14.205.104, ... Connecting to www.google.com|72.14.205.99|:80... connected. HTTP request sent, awaiting response... 200 OK $ wget google.com --2008-09-22 19:57:56-- http://google.com/ Resolving google.com... 64.233.167.99, 64.233.187.99, 72.14.207.99 Connecting to google.com|64.233.167.99|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: http://www.google.com/ [following] $ wget www.facebook.com –2008-09-22 20:07:59– http://www.facebook.com/ Resolving www.facebook.com… 69.63.178.12 Connecting to www.facebook.com|69.63.178.12|:80… connected. HTTP request sent, awaiting response… 200 OK Length: unspecified [text/html] $ wget facebook.com –2008-09-22 19:59:43– http://facebook.com/ Resolving facebook.com… 69.63.176.140, 69.63.178.11 Connecting to facebook.com|69.63.176.140|:80… connected. HTTP request sent, awaiting response… 301 Moved Permanently Location: http://www.facebook.com/ [following] $ wget digg.com –2008-09-22 20:10:47– http://digg.com/ Resolving digg.com… 64.191.203.30 Connecting to digg.com|64.191.203.30|:80… connected. HTTP request sent, awaiting response… 200 OK Length: 15322 (15K) [text/html] $ wget www.digg.com –2008-09-22 20:14:06– http://www.digg.com/ Resolving www.digg.com… 64.191.203.30 Connecting to www.digg.com|64.191.203.30|:80… connected. HTTP request sent, awaiting response… 301 Moved Permanently Location: http://digg.com/ [following] $ wget twitter.com –2008-09-22 20:26:18– http://twitter.com/ Resolving twitter.com… 128.121.146.100 Connecting to twitter.com|128.121.146.100|:80… connected. HTTP request sent, awaiting response… 200 OK Length: 2655 (2.6K) [text/html] $ wget www.twitter.com –2008-09-22 20:26:41– http://www.twitter.com/ Resolving www.twitter.com… 128.121.146.100 Connecting to www.twitter.com|128.121.146.100|:80… connected. HTTP request sent, awaiting response… 301 Moved Permanently Location: http://twitter.com/ [following]
Professionally, I prefer shorter and simpler without www.
References:
Web 2.0 Expo NY keynotes are happening today. Technology in use included CrowdVine which I’d not heard of, and plenty of Twitter feeds such as w2e_NY08.
The opening keynote was Fred Wilson from Union Square Ventures with his presentation New York’s Web Industry From 1995 to 2008: From Nascent to Ascendent .
Some stats, Seed and early stage deals.
Fred first asked “New York is not an alley. Call it Broadway, or just New York.”
Here is a summary of his history of New York Web Industry.
New York is now 1/3 of Silicon valley, compared to 1/8 of funded Internet companies.
One thing mentioned is a documentary called “We live in Public”. Some of the footage from 1999, is so early Big Brother.
I came across the OStatic Free hosting service that provide Solaris + Glassfish (Java Container) + MySQL.
They offer “Now you can get free Web hosting on Cloud Computing environment free of charge for up to 12 months. ”
The catch “accumulate 400 Points for participating on the site“.
A rather novel approach, you get 100 points for registering, but then only 5-15 points per task. The equates to approximately at least 30 tasks you need to perform, such as answering a question, or reviewing somebodies application. That seems like a lot of work?
In this case, Free has definitely a cost and time factor to consider.
It may sound like either a astronomical research project or a Star Wars spin- off, but Project Darkstar is an open source infrastructure from Sun Microsystems that states “simplify the development and operation of massively scalable online games, virtual worlds, and social networking applications.”
The advertising sounds promising like many sites, the emphasis seems to be on gaming throughout the material, interesting they threw in the term “social networking applications” specifically in opening descriptions.
I believe worthy of investigation, if only to see how that solve some classic problems. So, Learn some more, Start your rockets and Participate.
I was one of the invited panel speakers to A panel on Cloud Computing this week in New York. As one of 2 non vendor presenters, it was a great experience to be invited and be involved with vendors.
While I never got to use my slides available here, I did get to both present certain content, and indeed questions and discussions on the night were on other points of my content.
Cloud computing is here, it’s early days and new players will continue to emerge. For example, from the panel there was AppNexus, reviewed favorably at Info World in comparison with EC2 and Google App Engine, 10gen, an open source stack solution and Kaavo which from an initial 60 seconds of playing provide a management service on top of AWS similar to what ElasticFox provides. I need to investigate further how much the feature set extends and would compete with others like RightScale for example.
The greatest mystery came from Hank Williams and his stealth Kloudshare. He did elaborate more on where they aim to provide services. A new term discussed was “Tools as a service”, akin to moving use metaphorically from writing in Assembly language to the advanced frameworks of today’s generation of languages such as Java and Ruby.
Thanks to Murat Aktihanoglu of Unype who chaired the event.
BuildBot is a system to automate the compile/test cycle required by most software projects to validate code changes.
Here is my environment.
$ uname -a Linux app.example.com 2.6.18-53.el5 #1 SMP Mon Nov 12 02:14:55 EST 2007 x86_64 x86_64 x86_64 GNU/Linux $ python Python 2.4.3 (#1, May 24 2008, 13:57:05)
Here is what I did to get it installed successfully.
CentOS
$ yum install python-devel $ yum install zope
Ubuntu
$ apt-get install python-dev $ apt-get install python-zopeinterface
$ cd /tmp # installation of Twisted $ wget http://tmrc.mit.edu/mirror/twisted/Twisted/8.1/Twisted-8.1.0.tar.bz2 $ bunzip2 Twisted-8.1.0.tar.bz2 $ tar xvf Twisted-8.1.0.tar $ cd Twisted-8.1.0 $ sudo python setup.py install # installation of BuildBot $ cd /tmp $ wget http://downloads.sourceforge.net/buildbot/buildbot-0.7.8.tar.gz $ tar xvfz buildbot-0.7.8.tar.gz $ cd buildbot-0.7.8 $ sudo python setup.py install And a confirmation.
$ buildbot --version Buildbot version: 0.7.8 Twisted version: 8.1.0
You will notice a few dependencies. I found these out from the following errors.
$ python setup.py install .... gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtun e=generic -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.4 -c conftest.c -o conftest.o building 'twisted.runner.portmap' extension creating build/temp.linux-x86_64-2.4 creating build/temp.linux-x86_64-2.4/twisted creating build/temp.linux-x86_64-2.4/twisted/runner gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtun e=generic -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.4 -c twisted/runner/portmap.c -o build/temp.linux-x86_64-2.4/twisted/runner/portmap.o twisted/runner/portmap.c:10:20: error: Python.h: No such file or directory twisted/runner/portmap.c:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token twisted/runner/portmap.c:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token twisted/runner/portmap.c:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PortmapMethods’
$ buildbot start /home/buildbot/master/
Traceback (most recent call last):
File "/usr/bin/buildbot", line 4, in ?
runner.run()
File "/usr/lib/python2.4/site-packages/buildbot/scripts/runner.py", line 939, in run
start(so)
File "/usr/lib/python2.4/site-packages/buildbot/scripts/startup.py", line 85, in start
rc = Follower().follow()
File "/usr/lib/python2.4/site-packages/buildbot/scripts/startup.py", line 6, in follow
from twisted.internet import reactor
File "/usr/lib64/python2.4/site-packages/twisted/internet/reactor.py", line 11, in ?
from twisted.internet import selectreactor
File "/usr/lib64/python2.4/site-packages/twisted/internet/selectreactor.py", line 17, in ?
from zope.interface import implements
ImportError: No module named zope.interface
Installation was the easy part, configuration a little more complex.
I will be speaking on July 29th in New York at an Entrepreneurs Forum on A Free Panel on Cloud Computing. With a number of experts including Hank Williams of KloudShare, Mike Nolet of AppNexus, and Hans Zaunere of New York PHP fame is should be a great event.
The focus of my presentation will be on “Extending existing applications to leverage the cloud” where I will be discussing both the advantages of the cloud, and the complexities and issues that you will encounter such as data management, data consistency, loss of control, security and latency for example.
Using traditional MySQL based applications I’ll be providing an approach that can lead to your application gaining greater power of cloud computing.
Ronald Bradford provides Consulting and Advisory Services in Data Architecture, Performance and Scalability for MySQL Solutions. An IT industry professional for two decades with extensive database experience in MySQL, Oracle and Ingres his expertise covers data architecture, software development, migration, performance analysis and production system implementations. His knowledge from 10 years of consulting across many industry sectors, technologies and countries has provided unique insight into being able to provide solutions to problems. For more information Contact Ronald.
With my continued investigation of evaluating alternative data management with cloud computing options, I’m now evaluating Amazon Simple DB. Still in restricted beta, it helps to have a friend on the inside.
Working through the Getting Started Guide (API Version 2007-11-07) was ok, annoying in parts. Here are some issues I found. I was working with Java as the programming language.
#!/bin/sh # http://docs.amazonwebservices.com/AmazonSimpleDB/2007-11-07/GettingStartedGuide/?ref=get-started SDB_HOME="/put/directory/to/unzip/here" export CLASSPATH=$CLASSPATH:\ $SDB_HOME/src/com/amazonaws/sdb/samples/\ $SDB_HOME/lib/amazon-simpledb-2007-11-07-java-library.jar:\ $SDB_HOME/third-party/log4j-1.2.14/log4j-1.2.14.jar:\ $SDB_HOME/third-party/commons-codec-1.3/commons-codec-1.3.jar:\ $SDB_HOME/third-party/commons-logging-1.1/commons-logging-1.1.jar:\ $SDB_HOME/third-party/jaxb-ri-2.1/jaxb-xjc.jar:\ $SDB_HOME/third-party/jaxb-ri-2.1/activation.jar:\ $SDB_HOME/third-party/jaxb-ri-2.1/jaxb-impl.jar:\ $SDB_HOME/third-party/jaxb-ri-2.1/jaxb-api.jar:\ $SDB_HOME/third-party/jaxb-ri-2.1/jsr173_1.0_api.jar:\ $SDB_HOME/third-party/commons-httpclient-3.0.1/commons-httpclient-3.0.1.jar
CreateDomain Action Response
=============================================================================
CreateDomainResponse
ResponseMetadata
RequestId
f04df8eb-71fa-4d4e-9bd5-cc98e853a2e4
BoxUsage
0.0055590278
Well it took me longer to write this post, then to run through the example, but at least on a lazy Sunday afternoon, a first look at SimpleDB was quite simple.
I did also run into an error initially. I first started just via CLI under Linux (CentOS 5), but switched back to installing Eclipse on Mac OS/X for better error management, and of course this error didn’t occur.
I came across a wicked cool tool at wondle.net. I wanted to create a word cloud for the back of a business card, now I know how.
Thanks to my friend Dustin, and his EC2 demo using Elasticfox Firefox Extension for Amazon EC2 I got an EC2 image setup. With other references Link 1,Link 2,Link 3 I was also able to create my own AMI.
Some notes specific for my configuration.
Pre-config ElasticFox key for launching directly from ElasticFox SSH connections.
mkdir ~/ec2-keys mv ~/Downloads/elasticfox.pem ~/ec2-keys/id_elasticfox chmod 600 ~/ec2-keys/id_elasticfox chmod 700 ~/ec2-keys/ ssh -i /Users/rbradfor/ec2-keys/id_elasticfox root@ec2-99-999-999-999.compute-1.amazonaws.com
Installed Software.
apt-get update apt-get -y autoremove apt-get -y install apache2 apt-get -y install mysql-server # Prompts for password (very annoying) apt-get -y install php5 apache2ctl graceful echo "Hello World" > /var/www/index.html echo "< ? phpinfo() ?>” > /var/www/phpinfo.php
Configuration to save AMI.
scp -i ~/ec2-keys/id_elasticfox ~/ec2-keys/id_elasticfox pk-CHK7DP4475BWUKIUF4WFDIW3VMYDYOHQ.pem cert-CHK7DP4475BWUKIUF4WFDIW3VMYDYOHQ.pem root@ec2-99-999-999-999.compute-1.amazonaws.com:/mnt
ec2-bundle-vol -d /mnt -c cert-CHK7DP4475BWUKIUF4WFDIW3VMYDYOHQ.pem -k pk-CHK7DP4475BWUKIUF4WFDIW3VMYDYOHQ.pem -u AccountNumber -r i386 -p ubuntu804_lamp ec2-upload-bundle -b rbradford_804_lamp_ami -m /mnt/ubuntu804_lamp.manifest.xml -a AccessID -s SecretKey
Yesterday I took a more serious look at Google App Engine, I got a developer account some weeks ago.
After going though the getting started demo some time ago, I chose an idea for a FaceBook Application and started in true eXtreme Programming (XP) style (i.e. What’s the bare minimum required for first iteration). I taught myself some Python and within just a few minutes had some working data being randomly generated totally within the development SDK environment On my MacBook. I was not able to deploy initially via the big blue deploy button, the catch is you have to register the application manually online.
Then it all worked, and hey presto I’ve got my application up at provided domain hosting at appspot.com
Having coming from a truly relational environment, most notably MySQL of recent years I found the Datastore API different in a number of ways.
Having developed a skelaton FaceBook application before in PHP, I figured a Python version would not be that much more work, but here is where I good stumped Information at Hosting a Facebook Application on Google AppEngine leveraging the PyFacebook project didn’t enable me to integrate Google App Engine with FaceBook just yet.
This had me thinking I need to resort to a standalone simply Python Facebook application to confirm the PyFacebook usage. Now my problems started. Under Mac it’s a lot more complex to install and configure Python/Django etc then under Linux. I tried to do it on my dedicated server, but drat Python is at 2.3.4, and it seems 2.5.x is needed.
Still it was a valuable exercise, I dropped the FaceBook goal and just worked on more Google App Engine stuff. Still early days, but it was productive to try out this new technology.
What I need to work on now is how to hold state within Python infrastructure so I can manage a user login and storing and retrieving user data for my sample app.