Manish Chakravarty's Blog

Thoughts. Musings. Suggestions, Ramblings


Gitk on OSX
manish_chaks

Gitk on OSX
Originally uploaded by Manish Chakravarty
While there is GitX available on OSX, I wondered what it would be like
to run gitk on OSX.
I installed git from MacPorts and it included gitk as well.

All you have to do is to launch "gitk" from the OSX terminal. X11 is
automatically launched , followed by gitk.
This is much slower than launching gitx, and I did this just for kicks

Long cohabitation of couples is presumption of marriage , says Supreme Court
manish_chaks
This was a pretty interesting article, particularly this part:

The Supreme Court has held that if a man and a woman are residing together for a long time and have been accepted by the society as husband and wife, a presumption of a valid marriage can be drawn.

"A long cohabitation and acceptance of society of a man and woman as husband and wife goes a long way in establishing
a valid marriage," a Bench of Justices S B Sinha and Cyriac Joseph observed.


Yet, in India, live-in relationships are not looked upon very well by the society at large.

The verdict goes on further to say
The Bench said when disputes of valid marriages comes into question, courts can rely not only on the various material placed before it, but also draw a presumption on the basis of the conduct between the two parties. "In arriving at a finding of fact, indisputably the learned trial judge was not only entitled to analyse the evidences brought on record by the parties so as to come to a conclusion as to whether all the ingredients of a valid marriage as contained in Section 5 of the Hindu Marriage Act, 1955 stand established or not.

This is particularly interesting. If you go through the entire ruling emphasis is given on the relationship between the couple in question and the society.

I had an interesting conversation on these lines with a fellow TWer on friday night. He said that on these matters, taking the views of the society as a whole into account is important as well. The way I see marriage, it's the couple asking for acceptance for staying together from the society as a whole.

I haven't been in a live-in relationship myself but have close friends who were/are. I fully support the right of two adults to live together without marriage.

Sometimes the people around them ( neighbors mainly ) have frowned on the live-in couple and sometimes they have been supportive.

If I may say so, I find the stand of the Supreme Court a little weird. Consider this

1. A guy and a girl can get married without having to take the consent of anyone as long as a. they're above a certain age b. 2 witnesses are present
2. According to the latest ruling, a guy and a girl who live happily together is the presumption of marriage as long as the society accepts them

I see a problem.
1. How do you prove the society likes your living together?
2 You dont need acceptance of the society to marry someone legally but you do need their acceptance if you dont marry but wanna be called married :)

If you're reading this, I'd love to hear your opinions.


PS: I normally dont post non-tech stuff on this blog. I post such stuff to my other blog. This blog is syndicated at blogs.thoughtworks.com ; I would like to hear the opinions of my fellow TWers from India and abroad.

Reliance EVDO :Pathetic speeds!
manish_chaks
I just bought a Reliance Netconnect Broadband+ EVDO USB modem.

I was promised speeds "upto" 3.1 Mbps. You can check the link above for their tall claims.

These are the speeds I am getting in an area with 100% signal strength at 10PM, according to speedtest.com

ping 208ms (to my ISP's server in Mumbai)
dL 0.83 Mbps
upload 0.02 Mbps


Download Benchmark ( again speedtest.com )
mp3 File - 5MB - 49sec
Video Clip 35 MB - 6 mins
Movie 800MB 129 min



Their claim of speeds is basically a lie and a scam.
While i've gotten tricked and paid 3.5k for this piece of junk, I hope you dont make the same mistake.

Cowsay Man page: hilarious!
manish_chaks
This is /NOT/ fiction.. have a look at the screenshot to know more ..
( and yes install it! )
cowsay(1)

                     cowsay(1)

NAME
       cowsay/cowthink - configurable speaking/thinking cow (and a bit more)

SYNOPSIS
       cowsay [-e eye_string] [-f cowfile] [-h] [-l] [-n] [-T
tongue_string] [-W column] [-bdgpstwy]

DESCRIPTION
       Cowsay  generates  an  ASCII  picture of a cow saying something
provided by the user.  If run with no arguments, it accepts standard
input, word-wraps the message given at about 40 columns, and prints
the cow saying the given message on
       standard output.

       To aid in the use of arbitrary messages with arbitrary
whitespace, use the -n option.  If it is specified, the given message
will not be word-wrapped.  This is possibly useful if you want to make
the cow think or speak in figlet(6).  If
       -n is specified, there must not be any command-line arguments
left after all the switches have been processed.

       The -W specifies roughly (where the message should be wrapped.
The default is equivalent to -W 40 i.e. wrap words at or before the
40th column.

       If any command-line arguments are left over after all switches
have been processed, they become the cow's message.  The program will
not accept standard input for a message in this case.

       There  are  several  provided  modes  which change the
appearance of the cow depending on its particular emotional/physical
state.  The -b option initiates Borg mode; -d causes the cow to appear
dead; -g invokes greedy mode; -p causes a
       state of paranoia to come over the cow; -s makes the cow appear
thoroughly stoned; -t yields a tired cow; -w is somewhat the opposite
of -t, and initiates wired mode; -y brings on the cow's youthful
appearance.


       The user may specify the -e option to select the appearance of
the cow's eyes, in which case the first two characters of the argument
string eye_string will be used.  The default eyes are 'oo'.   The
tongue  is  similarly  configurable
       through -T and tongue_string; it must be two characters and
does not appear by default.  However, it does appear in the 'dead' and
'stoned' modes.  Any configuration done by -e and -T will be lost if
one of the provided modes is used.

       The  -f option specifies a particular cow picture file
(``cowfile'') to use.  If the cowfile spec contains '/' then it will
be interpreted as a path relative to the current directory.
Otherwise, cowsay will search the path specified in
       the COWPATH environment variable.  To list all cowfiles on the
current COWPATH, invoke cowsay with the -l switch.

       If the program is invoked as cowthink then the cow will think
its message instead of saying it.

COWFILE FORMAT
       A cowfile is made up of a simple block of perl(1) code, which
assigns a picture of a cow to the variable $the_cow.  Should you wish
to customize the eyes or the tongue of the cow, then the variables
$eyes and $tongue may be  used.   The
       trail  leading  up  to  the  cow's  message  balloon is
composed of the character(s) in the $thoughts variable.  Any
backslashes must be reduplicated to prevent interpolation.  The name
of a cowfile should end with .cow, otherwise it is
       assumed not to be a cowfile.  Also, at-signs (``@'') must be
backslashed because that is what Perl 5 expects.

COMPATIBILITY WITH OLDER VERSIONS
       What older versions? :-)

       Version 3.x is fully backward-compatible with 2.x versions.  If
you're still using a 1.x version, consider upgrading.  And tell me
where you got the older versions, since I didn't exactly put them up
for world-wide access.

       Oh, just so you know, this manual page documents version 3.02 of cowsay.

ENVIRONMENT
       The COWPATH environment variable, if present, will be used to
search for cowfiles.  It contains a colon-separated list of
directories, much like PATH or MANPATH.  It should always contain the
/usr/local/share/cows directory, or at least
       a directory with a file called default.cow in it.

FILES
       /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_cowsay/work/destroot/opt/local/share/cows
holds  a sample set of cowfiles.  If your COWPATH is not explicitly
set, it automatically
       contains this directory.

BUGS
       If there are any, please notify the author at the address below.

AUTHOR
       Tony Monroe (tony@nog.net), with suggestions from Shannon Appel
(appel@CSUA.Berkeley.EDU) and contributions from Anthony Polito
(aspolito@CSUA.Berkeley.EDU).

SEE ALSO
       perl(1), wall(1), nwrite(1), figlet(6)

                                     $Date: 1999/11/04 19:50:40 $

                     cowsay(1)

--
Manish Chakravarty
Blog: manish-chaks.livejournal.com/
LinkedIn: www.linkedin.com/in/manishchakravarty
Twitter: twitter.com/ManishChaks
Facebook: www.facebook.com/manish.chakravarty

First Chapter for my selenium book
manish_chaks
I have tentatively called the book "Selenium Internals"

You can download the book from here

please send your reviews, feedbacks, suggestions coming.

Look forward to posting one chapter everyday :)

Writing a book on selenium: Outline
manish_chaks


Chapter 1 - Introduction
Goals
• Introduce participants to each other
• Establish the goals of the program
• Do a “warm up” on selenium
• Setup Environment ( IDE, repo etc )
Architecture

Chapter 2: Selenium Core
Goals
User should be able to…
• Write a simple test case in Selenese
• Demonstrate understanding of core and core-less
• Demonstrate understanding of core profiles
• Familiarity with various JS files
• Demonstrate how to build and deploy core part to Maven
Agenda
• Building the Selenium Core
Outline
• Explain the source tree layout
• Create sample HTML page
• Create Selenese test case
• Include the test case in the actual suite ( conditions configure for
specific browser etc)
• Building the selenium core
• Describe conversion
• looking at pom.xml for selenese ant task
• Describe important JS files which are part of Selenium Core.
• Describe how Selenium coreless creates profile
• Firebug
• Windows Registry
• difference between PI mode and non PI mode ( diff between the JS
files being loaded )
Links
• Starting with Selenium
• Setting up Apache on OS X
• Ajax Testing with Selenium using waitForCondition
• Agile Testing with Selenium

Notes
browser launcher, launcher util, WindowsUtils, creation of firefox
profile and extension, ie registry modification, fire bug extension,
fire fox 3 patch, iedoc.xml geberation with rhino
selenium-api.js, selenium-browserbot.js, selenium-remoterunner.js,
selenium-testrunner.js, different between PI mode loading and non-pi
mode loading of js files

Chapter 3 – Selenium Server
Goals
User should be able to demonstrate understanding of
• the source structure of Selenium Server
• how selenium server and selenium core talk to each other (Incase of
selenese test case – selenium-testrunner.js and driver commands )
• diff context paths in the selenium server
• how selenium server handles requests
Outline
• Talk about source structure of SS ( talk about selenium server =
(SeleniumCore +SeleniumCoreLess ))
• Describe architecture of the Selenium Server
• Describes the commands Selenium Core sends to Selenium Server
( Excercise: Do this with FireBug; involve students )
• How selenium server handles selenese test cases
• How selenium server handles test cases driven by driver
• Talk about SSL certificates.
Notes
proxy handler
static content handler (classpath resources)
cache content handler
selenium driver handler

Chapter 4 – Selenium Driver
Goals
User should be able to demonstrate and understanding of ….
• How selenium converts iedoc.xml XML to Java/ruby/python driver
interface and implementation with iedocXXX.xml xslt & Converting
selenese test case to Java test case with XLateHTML2Java and handling
special conditions while test case conversion
• How to run test cases from Java driver end.
• Selenium Driver <—> Selenium Server interactions
Outline
• From the XML doc generated in Chapter one, we will talk about how
code is generated out of it.
• In case of Java binding , how they are creating Java test case from
selenese test case.
• What if we dont want them to generate the system automatically?
• getEval (“WaitUntilPresent”)
• how to get rid of getEval and extending the Selenium driver
( inheritance OR composition )
• patterns (do, get , is )

Chapter 5 – Selenium Driver
Goals
User should be able to demonstrate and understanding of ….
• Understanding hooks
• Understanding how to extend the selenium core objects
• How things would differ from PI and non PI mode
Outline
• Taking the click and the wait ; such that click implicitly calls a
wait

Chapter 6 – Selenium Modes
Goals
User should be able to demonstrate and understanding of ….
• IEHTA/chrome #Running a functional test case under different
browsers
• Page ranking algorithm
• Multi-domain issues
• How to exclude files from injection
Outline
• Talk about IEHTA and Chrome modes
• Demonstrate running the functional tests under different browsers
Facilitated Discussion – “What are the major cross-browser issues have
you faced in general and with Selenium in particular?”

Chapter 7 (part 1) XPath
Goals
User should be able to demonstrate and understanding of ….
• difference between XPath implementation in IE and firefox
• how to change the XPath library used for IE
Outline
• Talk about XPath Implementation in IE and firefox
• Attendees will be asked to find out how to change the XPath library
for IE
• Explain the difference between the two javascript implementations
• Talk about the pros/cons of the native IE XPath implementation
( Including issues with MSXML )
NotesChapter

MSXML cannot deal with malformed HTML documents. That is why a
JavaScript library is needed to deal with XPath.

Chapter 8

This Chapter is more of discussions regarding Selenium issues
• Running selenium test cases in parallel (Selenium Grid)
• Slow JS
• Flex Driver
• Selenium-Flash demo Topics to vary wrt to time. Participation from
audience encouraged
Outline
• Demonstrate the stuff mentioned in the goals and talk in detail

Chapter 9: Wrap Up
Facilitated discussions regarding
• Twist

Conducting a traning programme on Selenium. Interested?
manish_chaks


After the last months successful (and first meet ) of the Indian selenium user's group , I have decided to go ahead and hold a selenium training camp at the Bangalore TW office [1]

The meet was really good, there was 50+ attendance and as you know this was the first ever meet!


The outline can be found here.

Feel free to sign up. ( All you need to do is reply to the thread or reply to me directly )


[1] = some people have requested a web-based training solution as they cannot physically travel to Bangalore. I am looking at exploring all options.

Alert! VMware breaks with Debian upgrade + fix
manish_chaks
I have VMPlayer installed on my debian lenny.

Here's the output of "uname -a" : Linux manish-laptop 2.6.26-2-686 #1
SMP Thu May 28 15:39:35 UTC 2009 i686 GNU/Linux
After the kernel upgrade from 2.6.26-1-686 to 2.6.26-2-686, the linux
headers are not installed ( if you installed linux-headers for the
previous kernel they stay as is but they are not upgraded)

VMPlayer (or any other flavor of VMWare) then breaks. You need to execute
"sudo apt-get install linux-headers-`uname -r`" which will fetch the
correct version of the linux headers.

The VMWare starts up, fixes the module stuff ( see attached
screenshot) and then boots up just fine.

I wonder why the Debian guys dont automatically install the newer
version of the headers when 1. The user already has an older version
of the kernel headers installed 2. An automatic upgrade does upgrade
the older kernel.

Snapshot of my desktop
manish_chaks
My workspace becomes even more crowded......

What I am trying to do is launch firefox from within the code base
using a proxy server ( code's in eclipse)
Firefox has been custom-profiled to auto-load Venkman ( the window
with "JavaScript debugger") and that is being used to control the
recording and playback using the Selenium IDE (top left of right
screen) .. the recording/playback mechanism is behind-the-scenes (and
thus another use of Venkman)

Had a long hard day's work today

Google Chrome on Linux!
manish_chaks
Took the latest build [1] of chromium for a swing. (this is not a
review since chrome for linux is not ready for primetime yet)

To test, I got down the latest build of Chromium for Linux.
Installation was as simple as downloading and unzipping the file and
then doing a "./chrome".
Everything looks fine, I have used for a while .. GMail, iGoogle,
Yahoo all opened and worked just fine. Changing the language in
iGoogle from English to Hindi cause Chrome to not display anything in
the browser, this was strange. This is probably some
internationalization issue in Chromium which would be fixed later.

I will spend more time with Chrome and will give you and update after
a while of using it more.

[1] = build.chromium.org/buildbot/snapshots/chromium-rel-linux/...

You are viewing manish_chaks