May 20, 2009

vim and end-of-line on the last line

VIM (the best editor on earth. ahem!) believes that lines in a text file should always end with a end of line character, and last line is no exception.

But, sometimes during coding JSPs I have encountered problems with end of lines in the last lines. <jsp:include file=""/> constructs in jsps add undesired line breaks in your including jsps. After trying to work around it for a long time now, I decided to see what option is it in vim that can skip the end-of-line character on the last line (Vim has got to have an option for everything, definitely not the kind of ctrl-alt-shift-and-stretch-your-finger-to-key-you-cannot-reach-emacs-option - ahem!)

Now, to the point, the basic idea is to set the specific file as 'binary' and ask vim not to include eol

:set binary
:set noeol

as simple as that. Now, there won't be any new lines at end of files. These settings are local to the buffer and won't affect your other files in the same window.

Say you want to set those options permanently for that file, you can automatically direct vim to set those options for the buffer by adding them in the comment.

In case of jsp, the following line either at the beginning or the end of file will do:

<!-- vim: noeol binary --%><%
// rest of your code goes here
%>

Thanks for flying Vim!

January 12, 2009

Count your search queries !!

Carbon dioxide emission for each search query on google amounts to your car driven for a meter !

In terms of greenhouse gases, one Google search is equivalent to about 0.2 grams of CO2. The current EU standard for tailpipe emissions calls for 140 grams of CO2 per kilometer driven, but most cars don't reach that level yet. Thus, the average car driven for one kilometer (0.6 miles for those in the U.S.) produces as many greenhouse gases as a thousand Google searches.

Read more..
http://googleblog.blogspot.com/2009/01/powering-google-search.html

September 25, 2008

[ref] opensource build and test workshop

Free Open Source Build and Test Workshop - coming to a city near you

Learn how you can leverage open-source RIA application server technology from Appcelerator to rapidly build Ajax applications. Learn how you can leverage open-source testing tools (Selenium, soapUI, PushToTest, TestGen4Web, HTMLUnit) for functional testing, load and performance testing, and business service monitoring, with more flexibility than traditional solutions provide.

September 19, 2008

Introduction to htmlunit-interpreter

Using htmlunit-interpreter
video.jpg

HtmlUnit interpreter is a translator for testgen4web recordings. It is a wrapper around htmlunit library which does an excellent job in emulating the browser.

The tool isn't new, it has been around for a while. TestMaker from pushtotest ships with both testgen4web and htmlunit-interpreter.

More documentation at:
http://developer.spikesource.com/wiki/index.php?title=Projects:TestGen4WebDocs#Installation_and_running_translators

Download latest copy from:
http://developer.spikesource.com/frs/?group_id=14

I recorded a video demonstration for using htmlunit-interpreter. A less well known tool compared to its firefox

Using htmlunit-interpreter
video.jpg

You can find other video tutorials here:
http://developer.spikesource.com/wiki/index.php?title=Projects:TestGen4WebDocs#Tutorials

September 17, 2008

Video Tutorial Series - Looping over steps based on a variables value

I put together a video tutorial today to explain looping based on a variable. Here it goes:

"Looping steps based on a variable's value"
video.jpg

You can find other video tutorials here:
http://developer.spikesource.com/wiki/index.php?title=Projects:TestGen4WebDocs#Tutorials

June 27, 2008

TestGen4Web update 1.0.0

I am excited to announce testgen4web 1.0.0
This is a great release with lots of new features.

Download here: http://developer.spikesource.com/frs/?group_id=14&release_id=107

Note: I have tested this on only firefox 3 - Please let me know if you need a firefox 2 version, and it can be tested there too!

Here are the list of features:

New features added:


  1. brand new shiny editor: All new editor with easy to use interface. Much more simplified from the previous versions of the editor. See screenshot!.

    tg4w-screenshot2.png

    New features include:


    • Nicer editing featues

    • Shows status of the current step when running the recording by adding a >> at the begining of the step in the editor

    • "Run Status" tab on the right pane of the editor shows the status of the player/recorder, status of the datasets and variables

      runstatus.png

    • "Debug" tab provides easy way to run javascript on the page, build a xpath and try it out before running the actual command

      debug.png



  2. execute-js action: execute random javascript during execution of the script. This would help developers work around some quirks of firefox and testgen4web. eg: http://developer.spikesource.com/forums/viewtopic.php?t=865

  3. assert-text with xpath: this action until now was pretty much ignored. Now the user has an option to select where to assert the text. There are 2 ways

    • * as xpath will search the entire page

    • specify an actual xpath will search in that area


  4. detachable bar: you don't have to be thethered to the main window anymore. detach the testgen4web toolbar and keep it on the side for editing long recordings easily. detach.gif

  5. Simple xpath support: Now you can record with simple xpath. This xpath generating script will be complete xpath (NOTE: that your recording might break if simple things on your webpagee changes. I would still recommend that you use the 'smart xpath' option.
    simple-xpath.png

December 20, 2007

New Video Tutorial Series - Using csv files to load data with TestGen4Web

First a little introduction for those who don't know what TestGen4Web is:

TestGen4Web is a 2 part tool.

1. A firefox extension where you can capture your navigation on the webpage and play it back.
2. A Unit Test generator to run tests on the command line without using firefox.


More details at http://developer.spikesource.com/wiki/index.php/Projects:TestGen4Web

There was a comment on our forum about lack of documentation about features - I decided to take action - thanks for rholder.

I have introduced a video tutorial series - which I will hopefully keep up and add more videos in the future.

http://developer.spikesource.com/wiki/index.php/Projects:TestGen4WebDocs#Tutorials

And finally ... the first tutorial ... drum roll ... introducing ....

"Using CSV Files with TestGen4Web"
http://developer.spikesource.com/docman/view.php/14/850/tg4w-dataset.htm

TestGen4Web Tutorial Series - Using simple conditions

"Using Simple Conditions with TestGen4Web"
video.jpg

Prompted by a post on the forums, here comes the 2nd video tutorial demonstrating creating a "simple condition" with testen4web.

There was one other video tutorial before this. Find all the links here:
http://developer.spikesource.com/wiki/index.php/Projects:TestGen4WebDocs#Tutorials

November 5, 2007

[citation] Linus Torvalds on Open Source: 'A Much Better Way to Do Things'

"Linux really wouldn't have gone anywhere interesting at all if it hadn't been released as an open source product. I also think that the change to the GPLv2 from my original 'no money' license was important, because the commercial interests were actually very important from the beginning. The commercial distributions were what drove a lot of the nice installers and pushed people to improve usability," said Linux creator Linus

Complete story here:
http://www.technewsworld.com/story/60052.html


While this blog talks about the creator of Linux, I have heard many different ways people pronounce 'linux'. Here is how Linus Torvalds - the creator pronounces it himself.

http://www.paul.sladen.org/pronunciation/

September 24, 2007

[link] delete old mail in thunderbird

There are some folders on your mail which keep accumulating junk, and the only messages that matter are the latest ones.
You can set "Message Retention Policy" in thunderbird for each folder.

http://kb.mozillazine.org/Message_aging

Steps:
1. Right click on the desired folder - click on "Properties"
2. Click on "Retention Policy" tab
3. Set your desired preferences


Sample screenshot:
tb_retention_policy.png