Create test data in Windows

Posted: November 11, 2010 in Technical
Tags: , , , ,

Using VB scripts is one of the easiest ways of creating test data in Windows environment. I usually use this technique to create file based test data. This is quite an efficient and effective method of creating test data with XML, EDI, Flat etc like file types.

Here what you all have to do is create a VB script and name it as ‘filename.vbs’, place it somewhere in your Windows machine and double click the file to execute it.

I’ll try to elaborate 2 simple methods of creating test data;

Method 01

Create a large test data file by duplicating a part of content within the same file (with certain changes in relevant areas to gain the uniqueness of test data)

Sample test file

sample_01.xml

sample_01.xml

Requirment

Create multiple packages while keeping the uniqueness of the data (Assumption: within the <Order>, ‘n’ number of <Package> can be available)

Solution

In this case, we just build the required test data file from scratch within the VB script. Here you can change the ‘numOfPackages’ variable to get the desired number of packages in the resultant file.
solution_01.vbs

solution_01.vbs

Output

output_01.xml

output_01.xml

 

Method 02

Create large number of test data files by duplicating a particular sample file (produced files should contain unique data)

Sample test file

sample_02.xml

sample_02.xml

Requirment

Create multiple files with unique packages (‘n’ number of files with 1 unique package included in each file)

Solution

In this case we use sample test data file as a template and produce required test data files based on it. You can change ‘numOfFiles’ variable to produce the desired number of files.

solution_02.vbs

solution_02.vbs

Output

output_02_1.xml

output_02_1.xml

output_02_2.xml

output_02_2.xml

output_02_3.xml

output_02_3.xml

Mal Pita Mal – Chords/Lyrics/Audio

Posted: September 6, 2009 in Music
Tags: , , ,

Mal Pita Mal is a nice song by Amal Perera and I was waiting for guitar chords of this song while searching all possible places. Finally gave up searching and come up with own set of chords for the song :) . So this may not 100% accurate, but something to play with. Hope you guys will pinpoint, if you see anything wrong. I’ve included the audio (which is in video format due to some constraints) track of the play of song to help you to identify the chord changings. Hope this helps. Cheers!

Mal Pita Mal – Am - 4/4 (Amal Perera)

Intro

| Am | G | F | E |

Chorus

| Am | G | F | G |

| Am | G | F | E |

| Am | G | Dm | Am |

| Am | G | F | G |

Inter

| Am | G | Dm | - |

| E | - | Am | G |

| Dm | - | E | - |

| Am | G | F | E |

Verse

| F | G | Am | - |

| F | G | Am | - |

| Dm | - | E | - |

| F | G | Am | - |

Mal Pita Mal

Shirley Wijayantha

Posted: August 26, 2009 in Music
Tags: , , ,

“Hi ! So nice I am french and I don’t understand anything to the lyrics but makes me thrill. Could someone give me the meaning in english please !? Where can I find other audio or video documents of Sherly ? Thanks a lot.” – cantatricechauve

After making some serious combinations of word searching, I have been able to find 3-4 songs of Shirley’s in YouTube. I was bit disappointed about the availability of Sirley’s songs in a place like YouTube (with compared to the brand new guys pop-up in the srilankan musical industry), but suddenly I saw a comment made by french guy/gal on my selection and truly it made me happy. Sharing the video for the ppl who love Shirley Wijayantha (I know there is a lot in srilanka)

Audio Songs : http://www.infolanka.com/miyuru_gee/art/shirley.html

classical_guitarThough I’m not an expert, I’ve just thought of sharing the first lesson (that I’ve learnt) of playing rhythm guitar for potential beginners. I’ve seen so many guys buy a guitar, try out & gave it up in the process. But let me tell you a true story, which will encourage you for sure.

There was a friend of mine, who has thrown out from the music class of his school due to lack of ability & always threatened by friends when he try to support while we sing songs. But this guy badly wanted to learn rhythm guitar and he was succeeded after few months of continuous practices under the supervision of a good trainer. With this experience, I personally believe “anyone who can put reasonable effort/commitment can become kind of a guitarist” regardless of the skill or the blend of music with your soul.

Here we go the first lesson …

Malata Bambareku Se – 4/4 (Clarence Wijewardhane)

Intro/Inter

| D | - | - | - |

| G | - | - | - |

| Em | - | A | - |

| A7 | - | D | - |

Chorus
| D | - | - | - |

| D | - | G | - |

| G | - | D | - |

| D | - | Em | - |

| A7 | - | D | - |

Verse

| D | - | G | - |

| G | - | D | - |

| D | - | G | - |

| C | - | A | - |

| A7 | - |

Following numbering of the left-hand use when you play relevant chords

HandNumberedOpt

  malata_bambareku_se

Nice set of sinhala guitar chords can be found @ http://chords.orgfree.com/

Srilankan team getting closer of T20 Cricket World Cup 2009 and I feel like we can get hold of it. So it’s time to keep the spirits up & looking for the great moment. I’ve already started, listen to a nice old song by “Gypsies” – “Srilanka Kollo Wasay” & wear “Gone for a six” T-Shirt. How crazy ah.. :) .

AlfrescoContent Management Systems (CMS) play a vital role in any kind of business or organization. So it is always good to aware of the options available. I had an opportunity of doing a simple survey on CMSs and select a nice one which serves the purpose of my present employment.

Alfresco is the ultimate finding based on survey and I dare to say that it is the best open source content management system available at the moment. Alfresco is far more ahead from the other CMSs on look & feel, user friendliness, features, extendibility & flexibility.

Rich GUI & Features

Alfresco has excellent GUIs where you can’t expect from an open source solution. Following images give you an idea of how it looks like and it has built-in features like image galleries, forums, blogs etc. Most impressive feature to me is content version controlling with check-in/check-out option.

spaces

contents

Admin Functions

Administration console is available in order to perform most of the admin functions like manage users, groups & privileges. System users can be assigned with set of pre-defined user roles which give nice control over the users and set privileges on space (content folder) level with or without privilege inheritance.

admin_console_trimed

Steps to configure Alfresco in Linux/MySql/JBoss environment will follow in another post.

  

Working with logs in Linux

Posted: June 9, 2009 in Linux, Technical
Tags: ,

linuxWhen working in Linux environment, referring log files is a very common task. Following tips may help you to perform very basic tasks with log files.

View running log
Command : # tail -f <log_file_path>
Example   : # tail -f /server/log/server.log
Comment : Dynamic log view will be the output

View the final part of the log
Command : # tail -n <num_of_lines> <log_file_path>
Example   : # tail -n 5000 /server/log/server.log
Comment : According to the example, the output will show the last 5000 lines of the log file as a static view.

View the log from start
Command : # less <log_file_path>
Example   : # less /server/log/server.log
Comment : Output will be a static log view, from the start of the log & can be navigate through using Space, Enter, Page Up, Page Down …etc keys.

View the lines which contains specific string part
Command : # cat <log_file_path> | grep <string>
Example   : # cat /server/log/server.log | grep “Failure in”
Comment : According to the example, this will display all the lines which included “Failure in” string.

I’ve started to use sinhala Unicode few months back & feel great. This installation of Unicode will allow you to chatting, blogging ..etc in sinhala. Use following link to select the relevant installation for you;

http://locallanguages.lk/sinhala_how_to_install_in_english.html

1

Most interesting part of playing with sinhala Unicode is online singlish to sinhala converter (Web application done by University of Colombo). It has the capability of converting singlish to sinhala on the fly & you can access it via following URL;

http://www.ucsc.cmb.ac.lk/ltrl/services/feconverter/t1.html

2

Who is your favorite singer?

Posted: April 24, 2009 in Music
Tags: , ,

Chandana Liyanarachchi

I would prefer “Chandana Liyanarachchi” as my favorite. As I can remember, Chandana marked his appearance in srilankan music with “Polruppawe Dangakala” song and went through the path in slow pace with collection of good songs. Nice control of voice, clear live performances & calm character make him best for me.

I’ve found a song in the YouTube to feel his voice (Though the lyrics and video is not much relevant :-) ).

Hello…

Posted: March 9, 2009 in General

Friends,

It is time to share some thoughts with the guys around. I’ve been waiting for a quite a long time to start post on an own blog (language factor delayed the start of play [:)] ). Anyway now I feel like, good to start with something on hand other than waiting for everything. So I’ll post some day-to-day thoughts here when I got spare time.