Usha Guduri

SVN+SSH: network connection closed unexpectedly

After a long time, I had to work-from-home today because I hurt my shoulder badly. And something with the firewall and/or VPN settings seems to have changed that I couldn’t access the code base anymore. What more can you ask for WFH ;-)

I spent enough time to figure this out that I thought best to note it here. svn was caughing with:

$ svn ls svn+ssh://myhost/myrepo
svn: To better debug SSH connection problems, remove the -q option from ‘ssh’ in the [tunnels] section of your Subversion configuration file.
svn: Network connection closed unexpectedly

MYSQL Effects on Views from Changes to Table Structure

Au contraire, there are no effects of changing a table’s structure on a dependent view in MySQL! I’ve heard that other databases like Oracle automatically pick up changes on the table’s structure, but in MySQL the view is frozen upon creation.

CREATE VIEW my_view AS SELECT * from my_table;
ALTER TABLE my_table ADD COLUMN my_new_column <data and constraints>;

Database Migrations: Continue on Expected Errors

Ever ran into a situation where the migrations would work just as expected in production, but for some reason, are not applicable to other environments? Could be either because the tables exist in production, but for saving space, the other environments use views on it or because you had to manually add the column to set up the new data, so that the application would not come crashing down.

Your approach would really depend on how the migrations are set up. A simple solution no matter what(if you are using straight SQL), is to surround the actual migration sql in a stored procedure and set up continue handlers only for errors that you are already expecting like so:

Dates & Times - Front & Back

Not that I did not learn anything the past week but that so much has been happening that i failed to make time to write about it!

Now to the mystery behind dates transferred between the front end(client browser) getting changed when coming back from the backend (Java)…

If you think creating Date objects is so simple, behold! there is something called a “timezone” which gets used for generating the Dates - both by Javascript and Java. And it depends on where the machine is located - in some countries it also depends on what part of the year with the stupid and confusing “daylight savings time”.

Advanced Watir Use

…if you want to call hacking Watir to work with certain “advanced” UI elements that!

Element in the works: jQuery UI’s Slider

There’s nothing straightforward in Watir to change the slider and trigger the events as if the user interacted with the slider. In a normal slider implementation, that would either be the ‘change’ or ‘stop’ events on the slider. So how do you do that? Use the execute_script to directly do what you need via javascript.

Finding Watir Elements with XPATH

We recently got into automated ui testing with watir.

First impression: Awesome!

Then we added rspec and rake when the nightmares began - more about that later perhaps.

For a simple page with a few DOM elements, its pretty straightforward. Enter a highly dynamic, complex rendering logic and the DOM access breaks down. Something even as intellectually simple as: