Wednesday, July 25, 2012

Comparing DB2 objects

I had a task to compare 2 db2 schemas, one that we have, and the other one from the client DB

This process can be done manually, by generating script for both databases and comparing the generated script file with any text comparison tools, notepad++ can do this, of course this is not efficient and repeating costs time and effort

It can also be done by tools, I had some db2 tool from IBM, IBM Data Studio, I started looking into it, found it very interesting

You can select any object from the database source explorer, and do right click then select Compare with –> Each other

I was able to do that while selecting 2 tables, or 2 schemas, or 2 databases, seems that you can compare between any objects in the database


The results also looks very nice, organized, detailed


This was perfect, except that you can only export the results as XML, no other options, hope this comes in next releases.

You can download the tool from IBM web site

Then you will be able to compare db2 schemas, compare tables, compare 2 db2 databases, etc.. very easily

Thursday, July 19, 2012

Recovering files after change to file and folders names to symbols

My camera SD card, after plunging into infected computer, the files on the SD card were not accessible anymore, instead of the files, there was 2 folders, and couple of files with symbolic names.

I tried renaming these files, this wasn’t working

I tried following the instructions here

the attribute command was failing giving an error  ‘the target of the symbolic link does not exist”

I tried to boot with linux live CD, but was not able due to some reasons.

The last thing I tried and it worked with me, followed the below steps:

-Right click on the SD card drive

-Select properties

-Select Tools

-Select Check now, then check the 2 checkboxes


-Click on start

-Wait till it finishes

Check the drive, when I checked the drive, the files with symbolic names are no longer there, and there was a hidden folder called Found.000, inside this folder there were lots of *.CHK files

I opened a command prompt, opened this folder, typed a rename command to rename all .CHK to .JPG

ren *.chk *.jpg

Doing that, I found all the images on the CD card inside the Found.000 folder, and I was able to recover my files, hope this helps anyone who is facing similar problem

Tuesday, July 10, 2012

testlink: Removing columns from Query Metrics report

We wanted to remove 2 columns from the excel version only of the Query Metrics report, the Build and the Time.

I did play with the php code for some while for the file resultsMoreBuilds.php located in lib\results, then I discovered that I can only hide the values.

To hide the whole column, I need to look into the template.

I opened the template file \testlink\gui\templates\results\resultsMoreBuilds.tpl

located the lines for these 2 columns, 6 lines, 2 for the header,



and the same header lines for suit summaries

then another 2 lines for the data

<td style="text-align:center;">{$gui->builds_html[$inst.build_id]|escape}</td>

<td style="text-align:center;">{$inst.execution_ts|strip_tags|escape} </td>

In order to hide these columns from the excel only, which has the value of 3, I added if condition before these lines,

{if ($gui->report_type <> 3)}

In order to pass the report type with the gui object, I have modified \testlink\lib\results\resultsMoreBuilds.php, added a line just after this line $gui = initializeGui($db,$args,$date_format_cfg);

I added $gui->report_type = $args->report_type;

For example the first line will be like this

{if ($gui->report_type <> 3)}<th>{$tlImages.sort_hint}{$labels.th_build}</th> {/if}

Applying the same for the rest of the 6 lines, the 2 columns, Build and Time where not displayed in the extracted excel file

If someone wants to hide these columns from all report types, then simply instead of the if condition, just add an comment, like will look like

<!--<th>{$tlImages.sort_hint}{$labels.th_build}</th> {/if}-->

Sunday, July 8, 2012

Mostly used visual studio keyboard shortcuts

below are the shortcuts that I mostly  use in visual studio, descriptions taken from



CTRL+F Displays the Quick tab of the Find and Replace dialog box.
CTRL+SHIFT+F Displays the In Files tab of the Find and Replace dialog box.
CTRL+H Displays the replace options on the Quick tab of the Find and Replace dialog box.
CTRL+SHIFT+H Displays the replace options on the In Files tab of the Find and Replace dialog box.
CTRL+F3 Finds the next occurrence of the currently selected text, or the word at the cursor.
CTRL+SHIFT+F3 Finds the previous occurrence of the currently selected text, or the word at the cursor.
F3 Finds the next occurrence of the search text.
SHIFT+F3 Finds the previous occurrence of the search text.
CTRL+K, R or SHIFT+F12 Displays the list of references for the selected symbol.
F7 View code, For the selected item, opens the corresponding file and puts the cursor in the correct location.
SHIFT+F7 Switches to Design view for the current document. Available only in Source view.
F12 Go to definition
CTRL+M, CTRL+A Collapses all regions on the page to show just the outermost groups in the hierarchy; typically the using/imports section and the namespace definition.
CTRL+M, CTRL+T Hides the selected HTML tag and displays an ellipsis (. . .) instead. You can view the complete tag as a tooltip by putting the mouse pointer over the ellipsis.
CTRL+M, CTRL+O Collapses existing regions to provide a high-level view of the types and members in the source file.
CTRL+K, CTRL+D or CTRL+E, D Formats the current document according to the indentation and code formatting settings specified on the Formatting pane in the Options dialog box, for the current language.
CTRL+L Cuts all selected lines, or the current line if nothing has been selected, to the Clipboard.
CTRL+SHIFT+L Deletes all selected lines, or the current line if no selection has been made.