Thursday, September 5, 2013

Google Chrome Apps Launcher Misconception -- Launcher Icons Can Be Standalone Too!

Today, Google released a new category of apps previously known as "packaged apps", and they've now dubbed them as just "Chrome Apps", as announced on both Lifehacker and TechCrunch. Both articles state that a new launcher icon will appear in the task bar of Windows and, eventually, in Mac OS as well.

However, for developers and application designers who strive for a more "standalone" user experience, this may appear as a shock. While those articles are factually true, the articles overlook one very important point: These apps also get their very own launcher icons that can be found in the Windows Start Menu and in the Mac OS Finder Applications folder.

Under the hood, these launcher icons use a command-line startup flag called --app-id that takes the application id, found in the "Window -> Extensions" section of Chromium. When run, this command launches only the app, without starting a browser window.

In Windows, and on Linux, it's actually a shortcut, but on Mac OS it appears to be a binary file.  Below is an example of a few launcher icons from some example apps I've installed, as well as Synclio, the WebRTC VOIP Chrome application I'm building at work with our team.



Perhaps this hasn't been announced because it's still in progress, but rest assured that Google and the Chromium team are diligently working hard to make sure that our apps will appear standalone, providing the user with a seamless user experience up to and including how the apps are launched.

Saturday, August 20, 2011

Restoring Lost Hard Drive Partitions With TestDisk

After 6 months of running Windows 7 on my Sony Vaio, I accidentally ran a rogue EXE file while trying to install a driver for an HTC Evo so I could install an Android app on a co-worker's smartphone.

By the next day, my Windows 7 installation was showing some signs of being defeated. By 5pm that Friday, I was no longer able to boot into Windows 7.

To make a long story short, I installed Ubuntu 11.04 after moving all the data from the laptop to an external media drive. Since that time, I have been struggling to get the 11.04 installation running smooth on the laptop.

I installed Linux Mint 11 to see if it would be any better. Since it is based on Ubuntu 11.04, it suffered from the same freezing problems.

After following some advice on the vaio-f11-linux Google Group, I upgraded Mint 11 to the 2.6.39 Kernel. I started with Linux Mint because it wasn't my production OS and all my data was still accessible on the Ubuntu partition. Mint is also based on Ubuntu, so if he kernel upgrade went without problems, I may consider doing the same on Ubuntu. On Mint, with the new kernel, the problem I was facing with the laptop freezing appeared to be resolved.

Because I've been telling my coworkers I'm going back to Windows 7 if this isn't resolved, I went ahead and repartitioned my hard drive and installed Windows 7. Also, I'm facing a problem with my USB Controller, which Sony says can be resolved by updating the BIOS, a task only possible from Windows 7 64 Bit. I left the other operating systems intact and also left room for more Linux OS installs to see if another platform might run better on the Vaio. Even if I move to Windows, I still want to see if I can get a good, stable Linux platform running on the Sony Vaio.

So, I ended up triple booting Ubuntu 11.04, Linux Mint 11, and Windows 7.

However, after recovering Grub2 after the Windows 7 install removed it, I noticed that all of the Logical partitions on the extended partition were missing, and in their place was 1 large unallocated block.

GParted and the Ubuntu Disk Utility both showed the same scenario. I decided to just go ahead and reinstall Mint as all of the steps I did to make it stable were still fresh in my mind.

After getting the live CD loaded, I thought to Google the situation first. I'm glad I did, because it led me to a really cool utility by CGSecurity called TestDisk.

TestDisk 6.12 detected the lost partitions and repaired them, all from the Mint Live CD. After rebooting and running update-grub, I'm now writing this article from my formerly missing Linux Mint 11 installation.

Had it not been for this tool, I'd be spending another weekend installing operating systems.

Basically, if you think you've done something to your hard drive. STOP! Download TestDisk, and see if it can help you rebuild your partition tables or save any lost data.

Sunday, June 12, 2011

Building Social Networks for Experts

I created a Building Social Networks proposal on StackExchange for a Q&A site dedicated to questions for expert and enthusiast Social Network builders.

The purpose of the site is for people to ask and answer questions related to building social network platforms. Sites like Facebook, MySpace, and LinkedIn have prompted the creation of other innovative social networking platforms, such as Wisedame and many other mobile social networks.

As mobile gains more and more of a foothold in terms of connecting people, those experts who are building these networks will need a place to ask great questions and contribute knowledge back to the community.

If you want to see this proposal succeed, please check out the StackExchange "Building Social Networks" proposal on Area51. Please be sure to "Follow" the proposal. We need 50 followers to proceed to the next phase.

Friday, March 18, 2011

How to Use IE7 in Windows 7

Try to ignore the fact that this post is about a Microsoft tool. After my rant about how Microsoft people are horrible, anyone reading this is probably a bit perplexed about the title.

To make a long story short, I got a new laptop, and it came with Windows 7.

I am working on deploying live chat software for a client, and despite my hatred of Internet Explorer, more than 50% of the world's population still uses it, and it's up to me to put aside my personal distastes and make my clients' happy.

I found a bug in IE7 using IECollections. Generally, when I find IE bugs that I can't seem to immediately find the answers to, I figure it's just caused by the fact that I'm not using a real version of IE7. I spent over an hour trying to find someone in the organization who had IE7 installed, and another 20 minutes trying to get a screen share started to verify that we were really looking at IE7.

Well, after stumbling around Webmasters Stack Exchange, I found this question about How to Test IE7 on Windows 7. It turns out it's very simple. That link will show you a picture that will speak a thousand words. Go ahead, check it out!

Wednesday, March 9, 2011

StackOverflow Changes Name to StackExchange

The best time to make changes to something is during times of change. If you know your name isn't marketing your products to the right target market and need to change it, the best time to make that change is when everyone is watching, such as when you're recently awarded $12 million in venture capital funding.

If no one is watching and you change your name, there is a very strong likelihood you could skip away into obscurity. If no one was paying attention, there will be no transition of existing brand loyalty and brand recognition to help keep you afloat.

The name "StackOverflow" speaks to programmers, but it is meaningless to non-programmers. Non-programmers know "StackOverflow" as some wierd, obscure programming term. If you're a Motor Vehicle Repair enthusiast and your friend tries to convince you to join this Q&A network that was originally a Q&A site for programmers called StackOverflow, they may look at you like your crazy and pretend they never got your email invite to the private beta.

The reason for the name change was to fit the contours of the other Q&A sites that have absolutely nothing in common with programming. It was a strategic decision, and it was the right decision.

It's important to understand that the famous programming Q&A Site, http://stackoverflow.com, is still called Stack Overflow. The company changed it's name, not the Q&A site itself.

I am working on one of the newest Q&A sites, targeted at project managers. Project Management Stack Exchange is in public beta and has some great, experienced users who are able to help answer your professional project management question. If you have project management experience, we could use your expertise. Sign up for an account today!

Monday, March 7, 2011

How to Convince Project Team Members to Use Web-Based Tools

As Web technologies get more and more advanced, and as user interfaces become richer and snappier, desktop tools will decline. However, it's tough to convince some people to use the Web based tools.

According to this resource on How To Encourage Team Members to use Web Collaboration Tools, it's important to get over the initial reluctance.

There are some tips that you can use to help motivate people to accept the change:


Show them the value of the tool

Managers want to know that the tool isn't something that you just happen to find on some obscure website that hasn't seen a pageview of more than 10 in the last two years. From a risk perspective, if no one else is using the tool, then what's the point of the original developers spending their time maintaining it. Managers want to see that there are recent updates and that other reputable organizations are using the tool. It also helps to show a Google Insights search demonstrating upward trends.


Get support from others in the organization

As a project manager, it's your job to persuade people to join your cause. To accomplish this, you'll need to be attentive to who your audience is. While managers want to see low risk, employees on the team want to know that it's not going to create more unnecessary processes that impede their workflow.

The best time to try something new is during a time of change. For example, if the team has reorganized and has a new technical leader, he or she may be open to new ideas simply because no patterns have yet been established. If the team has new employees, the training they receive can include the new software. Trainers should approach the new employees with the software as if it were something already used within the organization.


Sign up users for a test drive

Sometimes the best way to gain support for a new tool is to just simply start using it. For push-based tools like Basecamp or Manymoon, this is easy, just sign up members of your team so that they get emails from the tool. With Basecamp, for example, the users who reply to the emails end up unwittingly using the tool. After a few weeks, it will become a habit to continue using it.

Some of these tips were originally suggested by Pawel Brodzinski, a consultant and coach in the field of software project management. For more information, check out the Project Management Stack Exchange Q&A Site.

Saturday, February 19, 2011

How to Use Stack Exchange Area51 Advertisements

I was part of the Project Managers Stack Exchange Private Beta. We were brainstorming some ideas as to how to promote the site, and so far the ideas we came up with include a Facebook page and blog articles. The idea of placing banner ads on a blog or website is of course another creative way to help spread the word.

The problem is, the only banner ads available are within the Stack Exchange network itself. They're essentially inlined into the page using data:image URLs, which doesn't make it easy to just grab some code and place it on your website.

Armed with Chrome Debugger, I set out to see what would be involved in placing an Area51 banner on my blog.

On one of the Stack Exchange sites, I used the inspector to view the HTML for one of the banner ads. It consists of inline CSS, a DIV and TABLE element that contains a hyperlink to the Area51 proposal, and the commit percent. The hyperlink innerHTML contained the name of the proposal.

While It's possible to paste the CSS, HTML, and JavaScript in an HTML page, the only way Blogger would accept the inlined CSS was through an IFRAME. As you can see, I've embedded the Running Q&A Proposal in this article:



DISCLAIMER: Stack Exchange and Area51 images and content are property of the Stack Exchange Network and are subject to the Terms and Conditions. Use of this content in this article falls within the "fair use" section of the Terms and Conditions. You must obtain written permission from Stack Exchange prior to use of this content.

Feel free to view the source of the IFRAME to get the code. Just paste everything within the opening and closing BODY tag on your site, or copy the entire HTML page to your Web server and use an IFRAME to embed the advertisement in the desired location.

I made comments in the code to show the 3 items that represent the proposal link, proposal display name, and percent committed.

View Ad Source

Since the view source link doesn't work in the inferior Internet Explorer browsers, you can also download the code here by right-clicking and selecting "Save File As", or "Save Link", or whatever the most popular way to save files in Internet Explorer is these days.

Tuesday, February 15, 2011

Project Management Stack Exchange Launches Public Beta

Project Management Stack Exchange is now in public beta, meaning that anyone can now join the Q&A site and contribute by asking questions or posting answers.

The site is in need of more expert level project managers. Many questions are basic questions, but I'd like to see more questions asked that are more advanced. Most basic information about any field is available in droves; it's the specialized, expert-level information that is oftentimes more difficult to obtain.

With three years in the field, I'm no expert, but I'm also beyond many of the basic questions about the definition of change management, for instance.

However, some individuals have posted some thoughtful questions, such as How to approach a project given to new PM during execution with vague requirements?. The question involves a specific experience by a project manager and not a random what-if scenario.

The site is still in it's infancy, and it's success will be defined by it's early members. If you have experience with project management -- no matter if your field is software, construction, engineering, or some other project management field -- create your account today at Project Management Stack Exchange.

Wednesday, February 9, 2011

Project Management Stack Exchange Begins Private Beta

On February 7th, 2011, the Stack Exchange network launched the private beta of the Project Management Stack Exchange website, a Q&A site run by the community to address questions regarding the field of Project Management.

The site is a place where professional project managers can go to ask objective or subjective questions regarding their field. The people who run the site encourage participation by professionals who either have a problem they seek the answer to or who would like to help other project managers improve their skills.

The Stack Exchange network works on a voting system, similar to Yahoo Answers. Users who ask really good, helpful, well-written questions will be rewarded with upvotes awarded by other users on the site. Similarly, users can vote on answers given by other users.

Upvotes and downvotes affect users' total reputation score, which represents how well the community trusts the user. As a user increases his or her reputation, the number of priviledges on the site increases. After reaching a score of 10,000, a user pretty much has access to the same tools as the moderators.

In short, this means that you, the user, runs the site. With enough reputation, you have the tools and community trust to close questions that are off topic or spam, edit questions and answers to clean them up, see vote counts, create chat rooms, and much more.

Out of the 57 total questions as of the time of this writing, here are a few of the questions asked so far:

How To Resolve Leadership Conflicts In The Project?

One of My Projects Was Cancelled Very Early. Will This Be Deterimental To My Career?

Do Technical Leaders Compete With Project Managers?


The Stack Exchange network consists of 44 different Q&A sites spanning from Programming, IT, Website Management and other technical topics to music, cooking, and parenting. It began as a single Q&A site, Stack Overflow, as a place for software engineers to ask objective questions.

New sites first go through a proposal phase where the community picks examples of on topic and off topic questions. After the proposal phase, the site undergoes a committment phase where a certain number of users must commit to asking at least 10 questions or submitting 10 answers in order to help get the site started.

After the committment phase, the site enters a private beta phase. The purpose of the private beta is to seed the website with some really good questions and answers, so that when the site launches the public beta, it already has some really strong content to attract good, professional project managers.

Although the site is still in private beta, anyone can view the current questions and answers by following the link to the Project Management Stack Exchange Site.

Saturday, December 4, 2010

Why I will Never Use Spring Tag Libraries in my HTML

The Facts - Web Design and Web Development Involve Completely Different Skills


I work with a team of developers and a team of designers. The designers I work with know Photoshop like they know the back of their hand. They are experts in writing clean, standards based, cross browser compatible HTML and CSS. They design and produce high-quality, beautiful, $15k websites for our clients. Their code validates with W3C validators. The results are amazing.

Our web developers know Java. They can pound away at any server-side problem and produce a solution. They use Struts, Spring, Restlets, JSP, JSTL, Velocity, they can configure Jetty and Tomcat, and they can look at log files and solve problems.

However, if you give them an HTML document, they'll give it such a severe beating that it becomes unrecognizable by it's original creators.

The beautiful HTML turns into a 3 headed monster with unclosed tags, numerous validation errors, and no IE support. The developers struggle for days with guesswork of adding a tag here, removing a tag there, editing a CSS rule here, and who knows what else there.

Of course, the designers are unable to help because of the code soup that results from mixing JavaScript, Java, and HTML into a JSP page.

The resulting web application looks great on the outside, but under the hood it's an absolute nightmare! Ask the designers to go back in and make a design update, and their faces go blank. A 4 hour change takes weeks! The developers can't make the changes because they barely got the HTML integrated with the backend system.

So developers and designers sit side by side trying to understand all of the complexity. The designers can't determine what the application is doing with the HTML, and the developer can't understand what modifications to make to the HTML. Logic mixed in with the HTML is of course overwhelming and makes the code completely unmaintainable.

In summary, designers and developers just plain have different skill sets, at least at my company, and it's foolish of us to think that designers and developers can use the same tools. People do better at what they specialize in, and to try to force that change is wasted energy.

How do I know this, you ask? Because I've fought this fight for years and have continued to lose miserably. "Eclipse is a software development tool, not a design tool", they tell me, "and we're not using it". End of discussion.

Of course, I have convinced a designer or two to try it out. In the end it just slowed both them and me down because Eclipse would inevitably break, and I would end up having to help fix it. Afterwards, we both silently agreed it was a bad idea. The designer stopped using it, and I stopped asking questions.


Light at the end of the tunnel - Keep Content and Behavior Separate



Recently, I took on the project of testing out a new Google App Engine feature and put together a prototype of Google's new ChannelAPI using Google App Engine SDK 1.4.0. Since we have chat designs, I used this as an opportunity to experiment with some new ideas regarding HTML integration with a J2EE application. Below are the details:

  • The HTML exists as a static HTML page. My rule for this experiment is no JSP pages!

  • I use JQuery to bind all my click event handlers dynamically, which leaves my HTML free of pockmarks and other markup that would bind it to the framework.

  • Chat applications involve inserting data in a message window. I used the concepts of manual templating to inject the messages dynamically, without mixing HTML and JavaScript. I'll describe more on this below.

  • My application sends messages to the server using AJAX. Calls to the server are made through the bound click event handlers. No tag libraries! Only client-side code!



I've observed designers over the years, and I've also observed developers. Our designers put placeholders in the HTML they create to mark where the dynamic content would go. The pages can be loaded as static files, and look just like the final result except the fake data. Below is an example of the body of an HTML file, with the placeholder in bold:

<body>
   <input type="text" name="alias" value="James" />
   <button id="join" value="Join Room!">Join room!</button>
   <button id="leave" value="Leave Room!">Leave room!</button>
   <button id="test" value="Test Message receive!">Receive Test Msg!</button>
   <div id="messages">
      <div class="message">
          <div>
              <span class="name"></span>
              <span class="timestamp"></span>
          </div>
          <div class="text"></div>
      </div>

   </div>
   <textarea id="messageBox"></textarea>
   <button id="sendBtn" value="Send">Send</button>
</body>

Now, my development team would normally be tempted to solve this problem by pulling out the bold HTML and placing it in the JavaScript callback method as follows:

// create the div for the message
var message = "<div class='message'><div><span class='name'>"+name+"</span><span class='timestamp'>"+timestamp+"</span></div><div class='text'>"+message+"</div></div>";

// inject the div onto the page
document.getElementById("messages").innerHTML += message;


When our designer needs to add a new feature to the chat application, he'll have to study the HTML that's inside the JavaScript to figure out where to make the changes. Instead of focusing on his area of expertise, the front-end, he'll have to become an expert on the actual application's inner workings. He'll need to understand Comet, JavaScript, and how the application works. As you can imagine, this is an extremely inefficient use of his time.

A better approach would be to use a templating engine, such as Velocity or Freemarker:

      <div class="message">
          <div>
              <span class="name">${NAME}</span>
              <span class="timestamp">${TIMESTAMP}</span>
          </div>
          <div class="text">${MESSAGE}</div>
      </div>

This is better, but it's still based on old ideas that still suffer from the same problems. I can't give a JSP file to a designer who knows nothing about Spring, Tomcat, Jetty, Eclipse, JavaBeans, and other technologies that bind the document to the framework. In addition, even if he did understand these technologies, he doesn't have 4 hours to spare to setup his development environment for just a 2 hour change. Even with templating, the files can't really be loaded outside of the JVM and outside the context of the framework.

Velocity and Freemarker are marketing ideas that in practice are failures. Anything that involves a developer mixing non-HTML markup with HTML will create more problems than it solves.

Instead, I took the approach of leaving the fake, empty HTML-valid message in the HTML and using it as the actual template:

var template;
$(document).ready( function() {
chat_template_read_only = $('.message'); // store the original template from the HTML (in bold) for later use.
};

Now, in my callback method, I do the following:

// make a copy from the template I saved earlier
var message = chat_template_read_only.clone();

// now use JQuery DOM methods to inject the content in the appropriate places in the copy.
message.find('.name').html(name);
message.find('.timestamp').html(timestamp);
message.find('.text').html(text);

// dynamically inject the new message into the HTML.
$('#messages').append(message);


Here you can see I'm accomplishing the same goal. I'm placing the dynamic content in an HTML block and injecting it into the DOM. Now, if in 6 months the design team needs to add a department header and maybe a response time to each chat, we can give them the current, live, HTML file and they can load it outside the context of the web framework, code their changes, and then send it back to the development team.

We can integrate new changes simply by making changes to the Jquery CSS selectors in the JavaScript files! There is no need for the web designers to understand anything about Eclipse, Java, Jetty, Tomcat, how to configure the application, or any of the applications inner workings.

Let me repeat that one more time: The HTML document is not bound to the framework and can be loaded outside the framework. It can be loaded from an Apache server, it can be loaded from the desktop by clicking on the file. It can be modified by the designers without needing to look at any Java, JSP, or JavaScript.


Spring Taglibraries



I was looking at Spring's JSTL tag, which is used to bind server-side data to an HTML form element so the form can be rendered with a session ID and any preloaded data from the server. The server-side tag generates an HTML form tag.

The benefit here is that web designers are supposed to be able to work with these tags, or at least that's what they say. In practice, in all my years of software development and programming, I have yet to ever see this magical unicorn walk out of the shadows and into the sunlight.

Where are these mystical organizations that operate in this manner? I'd like to meet one of these developers. Are they human? Do they eat and breathe like I do or are they just mere fiction?

This tag is useful in cases where a developer needs to pre-load the form with data from a persistent object. Although I'd love to just ask the developers not to use it anymore, but that's just as difficult as trying to set the web designers up with Eclipse! It just ain't gonna happen!

The problem with these templating languages and tag libraries is that they completely alienate the web designers while simultaneously encouraging the developers to trash the HTML. These frameworks make it impossible for designers to use their own tools. Although these templating engines claim their goal is to allow everyone to work together, they fall way short of the mark. These frameworks were obviously developed by programmers who have absolutely no clue about design.


JQuery Manual Templating



While looking at a <form:form> tag, I thought to myself: "Now wouldn't it be nice if I could use some tool on the server-side to bind my data to that form dynamically, without having to actually make any changes whatsoever to the actual HTML document, just like I did on the client side with JQuery?

Then it hit me! Java doesn't have anything like this that I know of, but since JQuery can run in server-side JavaScript, perhaps Rhino or Claypool is the answer! Imagine using JQuery to manipulate HTML documents on the server side without ever having to modify or template the code.

What I picture is a form of binding server-side tags dynamically. If we can use CSS selectors on the client side, why not create a method of doing so on the server side. I picture a solution such as this:

Import server-side JQuery into our JSP page:

<script type="extjs" src="server-side.js"><script>

// server-side.js
$('form').replace('form:form');
$('input').replace('form:input');


Now, instead of editing the HTML directly, we can bind our server side tags dynamically. When the designer needs to update the page, he can load it completely independent of the Spring environment, make modifications to it, and give the file back to the developer.

There is currently no solution out there for this, but I would greatly appreciate any advice from anyone who has ideas/suggestions for how to get this concept started!

Saturday, May 22, 2010

Google, Pacman, and the Enemies of Fun

You might think Google dropped a bomb on some small country or fed small kittens to snakes. Today, there is a lot of noise about Google's method of celebrating the anniversary of Namco's Pacman, which today turned 30.



I'm glad I don't work with all of the naysayers and complainers and whiners on the Internet who obstinately declare that they're now changing their search engine to Bing! What's funny is that deep down inside in the depths of their subconscious, they've had this burning desire to do so all along.

Microsoft has really been beating Bing into our skulls. Whenever I turn on the television, I see references to it in pop culture. On Vampire Diaries, Supernatural, and other television programs on the CW, the main characters made several references to it and even used "Bing" as a verb. This is what savvy marketing people refer to as "brand awareness" while in reality it's just brainwashing.

You people that are complaining about Google putting up an interactive widget aren't really angry at Google. You're angry at yourselves for being too stupid to understand how to use a computer, and as any psychologist will tell you, you're using displacement to redirect your anger at yourself onto Google for actually thinking that something that was meant to bring joy was a virus. You're using this moment as the excuse you've been looking for to run to Bing.

Brainwash successful!

To the complainers out there, the world isn't going to wait for you. It's moving on with or without you. I'm warning you now, you'd better catch up or you'll be standing in the unemployment line in 10 to 20 years, complaining about how your job went to India or China or someone much younger and with more drive than you, and you'll be bitching about how both your life and the the government both suck.


I am really exited to hear if the grass really is greener on the other side in Bingland. As for me, I'm sticking with Google. I'm staying on the cutting edge where life is more exciting. Why, because you can't please all of the people all of the time. If you want to be spoon fed and treated like the whiny infant that you sound like, then go to AOL or Bing. Good riddens, I say! Google's products and services will only get better if they market them to people with open minds who are willing to experiment. They're better off without you.

As for anyone coming out of college or anyone looking for a job, here is some unsolicited advice:


  • You can tell a lot about an employer by looking at the tools they use. If they support Google and openness and get really excited about new technologies, chances are you're really going to enjoy the environment and the people you work with. In that organization, you'll be important, and you'll make a difference in the world. Most importantly, you'll have a lot of fun while you do it.


  • Now, if they support Microsoft or ban a specific technology because of some ridiculous moment of hypoglycemia, lack of sleep, and confusion, then I suggest you run the other way. Well, unless you are the enemy of fun and like working with a bunch of stiffs who get hypertension because they spent money on virus software today instead of spending it on taking a computer class like they should have years ago.



In summary, I really enjoyed the Friday break. So did many of my coworkers. I feel really sorry for all of the people who were offended by something so non-offensive. Go back to your stone knives and bearskins.

Saturday, June 13, 2009

Revolutionary Testing Tools for AJAX Applications

Revolutionary Testing Tools for AJAX Applications

http://blog.browsermob.com/2008/12/faq-how-do-you-compare-to-selenium/

A few years ago, we used JMeter to try and load test a chat application we were building. Since the chat application used Comet and AJAX, I knew that the JMeter test was going to be grossly inaccurate. However, we did the best we could with tools that clearly weren't right for the job, as nothing was out there that could simulate an AJAX or Comet load test.

A few weeks ago, while working with some other consultants on a project, we discussed the use of Selenium to run some functional testing on a Firefox Extension that inserts signatures into an email. We needed a tool that could automatically send an email using Gmail, Yahoo, and Hotmail, and verify that the signature was still injecting. From my days writing HTML Reply Signatures for Gmail, I knew that this was indeed important, as any change by these third parties could have a drastic effect on the tool's ability to insert a signature.

Today, one consultant and I worked to try to insert an email address into the "To" field of the Gmail Compose window using Selenium. I've done this already in the Firefox extension, and anyone who has ever written a Greasemonkey script or Firefox extension that works with Gmail 2 can attest that this is not always an easy task if you are working outside of the API exposed by Gmail. Google engineers have put lots of effort in writing server-side code that ensures that all the id attributes in the Gmail application randomly change each session. Their creativity has sparked our creativity, and we have solved this problem. With enough time and patience, any problem can be solved.

Anyway, with Selenium, one must locate elements in the HTML of a web application by using XPATH queries. Armed with my trusty Firebug tool, I inspected the element in question and worked my way up the tree one element at a time, writing down the element tag names and positions at each step. Like a complex code, we ended up with long XPATH queries, a seemingly endless series of div[1]/div[2]/div[1]/div[1]. Although I would have preferred to just use JavaScript and a good for loop or regular expression to locate what I wanted, being a code cracker and approaching this problem from another angle was an eye-opener, XPATH is perhaps the way to go!

So that's a little background on my experience so far with testing tools. Selenium isn't a load testing tool of course, but it's a great tool to automate functional testing. It's almost like a macro recorder, similar to iMacros. Our plan is to set our test up on a VMWare image and configure this to run automatically every day. We'll get emails with our signature if it's successful, and broken or no email if it's not successful. We're also configuring it to be really loud and obnoxious if it does detect that something is amiss, just so we don't gloss over the automated emails.

Selenium can do functional testing, but what about load testing? Sure, Selenium can do load testing as well! Selenium uses real web browsers in testing, but it's up to the person doing the tests to go out and purchase the hardware to run the tests. In other words, if you want to do a 100 user load test with Selenium, you need to have 100 computers in your lab and 100 people to all click "Run" at the same time.

This is analogous to a symphony with you as the conductor who tells everyone exactly when to click "Run Test".

Of course, coordinating such an event can be costly, so one of the developers of Selenium Remote Control founded BrowserMob. BrowserMob solves this issue by providing the hardware. They claim to load test your web application using Selenium scripts and N number of real web browsers! I would be really interested to know how this was accomplished and how the costs have been kept so low.

To start, they probably use VMWare and Linux, which is one way to reduce the amount of physical hardware while still trying to simulate real hardware. They say they use Firefox 3.0, which is available on Linux. Finally, if Selenium Remote Control launches Firefox browsers to simulate functional tests, then my guess is BrowserMob is controlling a series of Selenium Remote Control instances, all running on VMWare Linux machines, and allowing BrowserMob to monitor the load.

While there are some costs associated with BrowserMob, I imagine one could use Selenium Remote Control installed on several VMWare images to run a small load test. If anyone has experience with either Selenium Remote Control or BrowserMob, I'd love to hear your thoughts on the two products!

Wednesday, December 17, 2008

Break out the Country Crock

I read an intriguingly funny article tonight. The reason it's so funny is that it's very applicable to me at the moment. My brother and I have been burning firewood for heat this winter in Portland, Oregon. We've actually obtained our fire wood from many different Craigslist advertisements, such as the one featured in this article's screen shot, and we have made some extra income selling our surpluses to people who are either in need of heat or just want the ambiance provided by a nice warm fire.

Seasoned wood does not in fact refer to seasoning the wood with pepper and salt and Italian spices although the idea does create some interesting mental pictures. For those who don't know, seasoned wood is wood that has been aged and naturally dried so that it will burn well. In order to be seasoned, most firewood must be aged for at least 1 to 2 years.

Although seasoned wood isn't seasoned in terms of teeming with lemon-pepper or garlic and oregano, burning the many different kinds of wood does indeed produce a plethora of different uniquely enticing and delicious smells. Black walnut is perhaps my favorite. Sit a piece in front of your fireplace just inches from the transfer of potential to kinetic energy. Watch the blue flames emanating from a few well-seasoned, dry chunks of maple as the walnut slowly heats up. After awhile, it smells like freshly baked bread and makes you want to go break out the Country Crock and dig in. We did that one night and the wood smelled so good I felt I could almost take a bite out of it!

With a fireplace, who needs Dish Network. It's all the entertainment I need.

Sunday, September 21, 2008

Dreamhost Hosting Special

I work with a client who uses Dreamhost as the hosting provider for a new web application. My client works with several other contractors besides myself. Some have been only temporary contracts while others have been more long-term. For the initial phase of development, all development was done on local servers, and there was only one hostname for the website.

One of the newest consultants spent just a small portion of his time in setting up some tools that would not only make development more efficient; but also, these tools will help prevent catastrophic mistakes that oftentimes can occur. Manual, repeated tasks are prone to error, and it's not a matter of if a failure occurs, but when will the failure occur.

The consultant set up several domain names for us to use in the deployment process. Previously, the site was deployed to the server under the www subdomain. While this is fine for code that has been tested on the hosting platform, it's not fine when deploying live. We now have a "testing" subdomain and a "stage" subdomain where "testing" is where untested code can be tested using a separate build of the website. "Stage", of course, mirrors whatever is deployed live and acts as a staging ground for final tests of changes to ensure that they are indeed production ready.

The consultant also set up Trac, which is an open-source wiki, bug tracking package, and project management platform all rolled into one web application. It integrates with the Subversion repository, which the consultant also setup and configured using Dreamhost's web panel.

Dreamhost offers these features as part of the standard hosting package, all for the low cost of $5.95 per month, depending on the length of your committment. Of all of the hosting providers that I've looked at, Dreamhost is the best for new startups looking to establish a web presence using PHP, Perl, Ruby, and some other popular programming languages. You'll never have to worry about running out of databases, as Dreamhost will supply you with an endless supply of MySql databases!

Some of the things that really stood out to me were things like the Jabber Chat server, a full Unix shell, the Debian Linux operating system, and IMAP access so you can download your email to a mail client. There is a one-click install feature for installing many popular packages, such as Wordpress, Moodle, and Joomla. In addition, through the shell you can install other applications, such as Trac!

To make this deal even sweeter, you can get unlimited disk space and unlimited bandwidth if you sign up now by clicking on the link in the left section on my website! This leaves lots of room for growth, and this perhaps may be the last hosting package you'll ever need!

The only catch, there are only 1111 slots left open for unlimited disk space and bandwidth, so sign up today!

Click here to learn more



Monday, September 1, 2008

Google Chrome Browser

While most of us spent our Labor Day weekend camping, barbecuing, or in my case, moving into a new home, the marketing team at Google was laboring away releasing marketing materials on what seems to be the next evolution of the web!

Google Chrome, a fully open source multi-process web browser, addresses many of the woes that most web surfers encounter on a daily basis. Instead of being concerned with browser lock ups and ensuring that we don't go over 35 to 40 tabs in Firefox for fear of the dreaded browser crash, we can rest assured knowing that the most we will ever have to worry about is a "tab crash".

What is a tab crash? According to the Google Chrome Comic book, each tab is launched as a separate process. What this means is that if there are N tabs open, there will be N JavaScript threads running, N copies of the global data structures, and a significantly reduced chance that a rogue JavaScript function will bring a user's web experience to a grinding halt.

Both Firefox and IE run as a single process. While IE does tout the advantage of running each tab in a different thread, the memory is still shared; and all tabs are still susceptible to crashes. In either case, the result is the same.

However, I am very interested to see this new browser in action. How impervious to crashes is it going to be? What is this going to mean for web development? Will we need more CSS and HTML magicians to step forward and deal with yet another browser hack? Or will Google Chrome follow web standards and allow the same ease of web application development as Firefox and Safari do?

One question that I have is in regards to add-ons. Will this new browser be as extensible as Firefox? Is there or will there eventually be a market for Google Chrome add-ons?

More importantly, is this the first step towards the Google Operating System?

I guess tomorrow we will find out.

Monday, July 21, 2008

JavaScript and Java are Pass By Value

Proof that JavaScript and Java are Pass By Value



Pass by value and pass by reference can be daunting at times, and I too have been confused and frustrated at all of the babbling about whether or not Java is one or the other, that is, until I saw an article featuring the Litmus test. I've seen the Litmus test in college, but it didn't make sense completely until reading Scott Stanchfield's "Dammit" article.

Today I was reading Jeff Cogswell's article asserting that JavaScript is pass by value. The blog author is indeed correct in his assertions; however, there were many comments rebutting his arguments. I thought it would be best to support his arguments by applying the Litmus test to JavaScript to prove once and for all whether or not JavaScript is pass by value or pass by reference.

Java is clearly pass by value. Scott Stanchfield's statement says it best: "Objects are not passed by reference. A correct statement would be Object references are passed by value."


The JavaScript Litmus Test



I decided to apply the Litmus test to JavaScript and see what the results are. Here is what I have so far:


function doLitmusTest() {
     var a1 = 5;
     var a2 = 7;
     swap(a1,a2);
     alert(a1 + ","+a2);
}

function swap(a,b) {
    var temp = a;
    a = b;
    b = temp;
}

window.addEventListener("load",function() { doLitmusTest(); },true);



The output is as follows:

5,7

The values were not swapped. JavaScript fails the Litmus test, as Java did. This means that JavaScript is also pass by value.

In Java, there is a workaround to being able to implement the swap function, and it also works in JavaScript:


function anotherTest() {
     var obj1 = { value: 5 }; // JSON notation
     var obj2 = { value: 7 }; // JSON notation
     swapValue(obj1,obj2);
     alert(obj1.value + "," + obj2.value);
}

function swapValue(objA,objB) {
     var temp = objA.value;
     objA.value = objB.value;
     objB.value = temp;
}

window.addEventListener("load",function() { anotherTest(); },true);



The output is:
7,5

In Java, data can be "wrapped" in an object to allow the value to be changed. JavaScript behaves in the same manner. All values, both primitives and object references are passed by value. With primitives, changes we make to one copy of a variable do not affect changes to another copy.

The rule is the same with Object references. Objects are not passed in as parameters in Java or JavaScript, object references are passed as parameters. References point to a specific location in memory. Three references can all point to the same location, so if the data located at that spot in memory is changed, the change will be reflected for all of the references that point to that spot.

However, changes to the reference itself are not reflected. A rule of thumb to remember is that when implementing the swap method, you can only change data by calling setter and getter methods, or by accessing public properties. However, making changes to the object reference instruct the object reference to point to a different location. This is why swapValue worked as expected while swap did not.

Below is a sequence of "visual art" to demonstrate the concepts visually:


new operator uses new memory space

Object A and Object B are instantiated and new memory is allocated on the heap.



using new on object A creates new space in memory

Object A is assigned a reference to new memory space because the "new" keyword was used.



using setter changes value in memory location

The value of the object referenced by B is changed to a new value, but the object reference still points to the same location in memory.

For A, the "new" operator created new space in memory and instantiates a new object. The "12" is located in a different spot in memory.

B, on the other hand, has a value that was set using a setter method. Thus, the value has changed from "7" to "2" without destroying the original object.



multiple objects reference the same memory space
Objects A, C, and D all point to the same place in memory. If a setter method is called on one of the object references, the value is changed in all 3 object references because they all point to the same location in memory.

A good analogy to use to explain this concept is "nicknames". For instance, my name is James, but people also refer to me by Jim. Additionally, I've been called "Mort" before as well. All three names point to the same object, me! In the example I've shown you, A, C, and D are all names of the same object.

Sunday, July 13, 2008

XSLT Transformations with XML Namespaces

As of the date of this article, there are currently not a lot of resources on the Internet regarding how to transform XML that contains namespaces. Yahoo's Weather Web Services API returns data in the form of RSS, and this data is formatted not only with elements and attributes, but also with namespaces.

I'm experimenting with the Yahoo Weather API for a potential project I may work on. Considering that there may be other Weather API's used, it makes more sense from an architectural design standpoint to tranform Yahoo's data into my own XML data structure. This ensures that if the client decides that he/she likes Google's Weather API, or the Fox News API, all we need to do is create a new XSLT stylesheet to convert the data into the format recognized by our server.

Here is part of the Yahoo Weather Data, taken from here.:


<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>

<title>Yahoo! Weather - Portland, OR</title>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Portland__OR/*http://weather.yahoo.com/forecast/97206_f.html</link>
<description>Yahoo! Weather for Portland, OR</description>
<language>en-us</language>
<lastBuildDate>Sat, 28 Jun 2008 4:53 pm PDT</lastBuildDate>
<ttl>60</ttl>
<yweather:location city="Portland" region="OR" country="US"/>

<yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/>
<yweather:wind chill="101" direction="300" speed="10" />
<yweather:atmosphere humidity="22" visibility="10" pressure="29.82" rising="2" />
<yweather:astronomy sunrise="5:24 am" sunset="9:03 pm"/>
<image>
<title>Yahoo! Weather</title>
<width>142</width>
<height>18</height>
<link>http://weather.yahoo.com</link>
<url>http://l.yimg.com/us.yimg.com/i/us/nws/th/main_142b.gif</url>
</image>
<item>

<title>Conditions for Portland, OR at 4:53 pm PDT</title>
<geo:lat>45.52</geo:lat>
<geo:long>-122.68</geo:long>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Portland__OR/*http://weather.yahoo.com/forecast/97206_f.html</link>
<pubDate>Sat, 28 Jun 2008 4:53 pm PDT</pubDate>
<yweather:condition text="Fair" code="34" temp="101" date="Sat, 28 Jun 2008 4:53 pm PDT" />
<description><![CDATA[
<img src="http://l.yimg.com/us.yimg.com/i/us/we/52/34.gif"/><br />
<b>Current Conditions:</b><br />
Fair, 101 F<BR />
<BR /><b>Forecast:</b><BR />
Sat - Mostly Clear. High: 97 Low: 65<br />
Sun - Mostly Sunny. High: 91 Low: 66<br />
<br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Portland__OR/*http://weather.yahoo.com/forecast/USOR0275_f.html">Full Forecast at Yahoo! Weather</a><BR/>
(provided by The Weather Channel)<br/>
]]></description>
<yweather:forecast day="Sat" date="28 Jun 2008" low="65" high="97" text="Mostly Clear" code="33" />
<yweather:forecast day="Sun" date="29 Jun 2008" low="66" high="91" text="Mostly Sunny" code="34" />
<guid isPermaLink="false">97206_2008_06_28_16_53_PDT</guid>
</item>

</channel>
</rss><!-- api1.weather.sp1.yahoo.com compressed/chunked Sat Jun 28 17:19:32 PDT 2008 -->



Note that the temperature and other weather data is stored within elements that are part of the yweather namespace. The XSLT stylesheet below demonstrates how to obtain the temp attribute from the yweather:condition element:


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0">

<xsl:template match="/">
<html>
<body>
<h2>Weather</h2>
<table border="1">
<xsl:for-each select="rss/channel">
<tr>
<td>title</td>
<td class="title"><xsl:value-of select="title" /></td>
</tr>
<tr>
<td>link</td>
<td class="link"><xsl:value-of select="link" /></td>
</tr>
<tr>
<td>curCond</td>
<td class="curCond">
<xsl:value-of select="//yweather:condition/@text" />
</td>
</tr>
<tr>
<td>curTemp</td>
<td class="curTemp">
<xsl:value-of select="//yweather:condition/@temp" />
</td>
<td id="curTemp">
<xsl:value-of select="//yweather:condition/@temp" />
</td>
</tr>
<xsl:for-each select="//yweather:forecast">
<tr>
<td>forecast</td><td class="day">day: <xsl:value-of select="@day" /></td>
</tr>
<tr>
<td></td><td class="date">date: <xsl:value-of select="@date" /></td>
</tr>
<tr>
<td></td><td class="low">low: <xsl:value-of select="@low" /></td>
</tr>
<tr>
<td></td><td class="high">high: <xsl:value-of select="@high" /></td>




On another note, I've done XML conversions before the hard way: By parsing the XML with PHP or JSP and dynamically rebuilding the XML! While this would also work to solve my problem, using XSLT will allow me to keep the transformation layer separate from the business logic.

Although this was somewhat time consuming getting started with XSLT and converting XML with namespaces, I can already feel the weight being lifted off my mind knowing that changing my data sources won't involve troubleshooting PHP errors!

Saturday, July 5, 2008

Share VMWare Image between Dual-Boot Operating Systems


How to Share a VMWare Image Between Windows XP and Ubuntu 8.04


Sharing a VMWare Image in a dual-boot setup involves the following prerequisites:

- One ntfs partition with Windows XP Professional installed
- One ext3 partition with Ubuntu 8.04 installed
- One fat32 partition, shared between Ubuntu and Windows
- At least 1GB of RAM
- VMPlayer installed in both Windows XP and Ubuntu 8.04
- VMImages, stored on the fat32 partition


Stored on the fat32 partition is one Windows XP Home VMImage. I don't have VMWare Workstation. So you may be wondering how I was able to create my own Windows XP Home image. I'll get to that later.

I first boot into the Windows XP Home installation using the Windows XP Pro host. I moved some files around, made some changes to some files. Then shutdown the VMImage. I reboot the computer into Ubuntu 8.04, started VMPlayer, and boot into the very same Windows XP Home image I was just working with on the XP host. My changes were all there!

Windows XP VMPlayer on Ubuntu select copied

When I first started up the VMImage in Ubuntu, the system asked me if I moved or copied the VMImage. Well, I didn't move it, but I didn't copy it either. Since I wasn't sure what option to pick, I selected the "copied" option recommended by VMPlayer if you don't know whether or not you moved or copied the image. This will happen again when I switch back to the Windows host. So far, selecting "copied" has not negatively affected performance.

The first time booting the image in the new host, networking didn't immediately work. Wait a few minutes and it may fix itself. You can also go into VMWare tools, if it's installed, and make sure your Ethernet card is enabled. So far, I've had no issues with networking.

I'm very impressed with VMPlayer! I can run Windows XP in a VMimage in both Windows and Linux. It's stable, fast, and allows me to work on Windows projects on both Ubuntu and Windows hosts.

Boot Windows XP in Ubuntu using VMPlayer


Using Microsoft Virtual PC to Create Image and Convert with VMWare Converter



Previously, I was using Microsoft Virtual PC 2007, which wasn't cross-compatible with Linux. To answer the above unanswered question of how I created a Windows XP Home VMWare image without VMWare Workstation, I used VMWare Comverter to convert my Windows XP Home Virtual PC image to VMWare. In Virtual PC, it took a long time to boot up. Once booted, response was slow and unusable. I quit using the Virtual PC image long ago because it was simply too slow.

In VMPlayer, I feel that the Guest operating system runs smoother than the Windows XP host itself! I'd recommend this setup for anyone who wants to run Windows from Linux and Windows from Windows. Additionally, although Virtual PC is slow, it's a great tool to allow you to create a Virtual image and then convert it to VMWare using the VMWare Converter.

UPDATE: I've been using this setup for over a month and I'm still happy with it!

Saturday, June 28, 2008

Cisco VPN on Ubuntu 8.04

Deadlines approach fast! In times like these, it's oh so helpful to be able to dig a tunnel from your office to your home so that you have access to the tools that you need! Right now you have images of me under the ground with a shovel slowly scooping through layers of packed dirt. I'm not using shovels. I didn't break a sweat, and I didn't have to use a single gallon of gasoline!

I installed Cisco VPN on Ubuntu 8.04. Essentially, I did create a tunnel from my office to my home, expanding the bubble that is our corporate network to surround my makeshift home office. It was both easier than I thought and harder than I thought. It was easier thanks to the wonderful community of Ubuntu users, yet harder because it required kernel patches and Google searches and a little patience and persistence.

I found a link to fix the Cisco VPN Installation Issue with Ubuntu 8.04 Hardy Heron. There are in fact several of them, which helps to confirm that the steps you follow won't cause your refrigerator to start leaking. A poster in the forum also described my exact problem that I was facing. He was using an older version of the VPN Client, as I was. And according to another poster, it wasn't compatible with the new kernel. He supplies the reader with a link to the patch, which can also be found all over the net.

After pulling our friendly IT Specialist from his episode of Babylon 5, I was able to obtain the latest version of the VPN Client. It was in fact the same version listed in the forum that the poster recommended. After applying the patch to the new version, all was good. Well, almost. I couldn't get the VPN to start. It was complaining that the profile couldn't be found. What it should have done was laughed at me, called me an idiot, and told me to put the profile configuration file in the correct directory! Then it should have shook it's head and told me to try reading the usage instructions more carefully and to omit using the .pcf file extension in the command I was using.

After reading further in the forum, I found that the Ubuntu community was nice enough to remind me of this fact, without laughing at me, and without the shake of a head.

Easy enough. I started the VPN Client and am now on the way to meeting my deadline, all without leaving the house! In addition, I can now login on nights and future weekends, workaholic that I am, and be able to get more work done!

I must say I'm pretty impressed with Ubuntu 8.04! I'm glad I tried it out. I haven't boot into Windows XP Pro in over a month now! And so far there hasn't been a need. Of course, I do have VMPlayer installed on here with a Windows XP Home VMImage, and am kind of cheating, but that's another adventure!

Friday, June 27, 2008

HTML Multiple Reply Signatures for Gmail 1.0.2.3

Don't get too excited. The Multiple HTML Reply Signatures Extension 1.0.2.3 update doesn't include too many new features. I got rid of the red update link that appears in the toolbar. I don't think it was working correctly. In addition, it took up valuable browser real estate. Bad idea.

I did try to see what would happen in Firefox 3. Sadly, the Firefox Extension doesn't work in Mozilla's newest and fastest browser. The problem isn't the editor or even the signature injection. It's the module that reads data from the XML file. This was a hack anyway. I could probably get by with using the Firefox RDF API or perhaps store the signatures using the preferences system.

The good news is, converting to Firefox 3 wouldn't be hard. The bad news is that I don't have time to do it. We just need to fix the mechanism that reads signatures from the XML data file! That's it! Everything else appeared to work when I tested it!

Anyone know any JavaScript who is bored? HTML Multiple Reply Signatures for Gmail is licensed under the GPL! You can crack open the XPI and try to fix this yourself! I'll even tell you what files to modify if you email me!

I did start working on a version for Gmail 2. Interestingly enough, there aren't many solutions out there for Gmail 2, yet there was tons of competition for Gmail 1. I have a prototype that Susan Hemmersmeier has happily tested for me. It's very buggy though. Too buggy to put up on the blog, and too buggy for her to use.

Susan asked me when this will be finished. I hate to keep promising that "I'll eventually get to it.". You see, thanks to this blog, I landed some contract work! It's a lot of fun, but it takes up a lot of time. As a result, it would appear that HTML Multiple Reply Signatures for Gmail may be a (sniff...) dying project...

Do you have the skills to resurrect it from it's ashes? Let me know! I can definitely provide the moral support and answer technical questions, I just can't devote programming time to it at the moment.


James
Google