My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping


Tuesday, August 10, 2010

Two methods for Accepting User Input in Windows Command Line Prompt

Recently there was a task in Adobe that involved automation of entire Code Coverage Automation System. This involved calling one script after other. As the whole task involved some 100 number of scripts and I had to check the status of system say after execution of script number 56. So I had to interrupt in between in such a way that this interruption does not cause any data loss and we can continue from where we paused. For this I employed user input trick.

Method 1:

You can interact with a user and ask for any data to be entered. The traditional DOS O[perating System had a "Choice" command for a limited interaction. It is now superceded in Windows XP/Vista by the more versatile "set /p".

The syntax is:
set /p variable= [some string]

Here "variable" is the name of the variable that will be assigned to the data that you want the user to input. "some string" is the message that the user will see as a prompt. If desired, the string can be omitted.

Here is an example that asks the user to enter his or her id:
set /p u_id= What is your UserId?

This will create a variable %u_id% whose value is whatever the user enters. Note that the user must press the "Enter' key after typing the input.

You can also access this variable using following syntax:

For example to print what was entered earlier just pass following command on command prompt: echo %u_id%

Method 2:

You can use "copy con" command to achieve somewhat similar goal. The syntax is:

copy con

This command accepts user input (including commas and enter keys) and dumps it into a file specified by the given file name. The reading continues till it is stopeed by Ctrl+z key combination. From there it can be read thereafter.

For example, if you have to prompt user to enter his user id, you can do the following:

echo Please enter your UserId
copy con abc.txt

I tested both the methods and personally found method 2 to be more satisfying. Though I find both methods to be error free, easy and enjoyable, yet you may have your own taste!!

So Happy Tasting (Not Happy Testing ;)

You can write me at
To Know me professionally visit ..Linked In..
You can befriend me at ..FaceBook..
Read jokes at ..Jokes Limitless..
You can also know more about me at ToughJamy : An Informal Me!!

Thursday, August 5, 2010

Bewitched Apps using the Genie Effect or Slow Motion Effect in Mac OS X

Have you heard about famous Genie Effect in Mac. It is also regarded as Slow down effect.

You can see this by holding down shift when clicking on the window minus button or documents in the dock. As discussed, I am showing another use of this Genie effect that would make UI of apps in Mac distorted yet perform well.

The trick is to Open up any App or say Safari browser and navigate to a nice long web page.

For instance you can visit MeOnShow.Com or even open one of my another blog Jokes Limitless

Now Launch up a Terminal and type “Killall Dock”. Do not press enter at this time. Also make sure that your App or Safari window is in the background and Terminal is your active window. Now Hold down the shift key and click the minimize button on your App or Safari window. Now in midway of minimizing window press the enter key on terminal to execute your Terminal command. You will be amazed to see that your application, or Safari window in this case, would stuck in a distorted shape. You can scroll through webpage or App, navigate and use your App, Click On buttons, do interaction, in a distorted shaped window. This is the secret logic and trick behind my famous Bewitched Apps Trick that has amazed many of my colleagues in TCS, CSC, Patni, HCL, Adobe and Amazon.

You can write me at
To Know me professionally visit ..Linked In..
You can befriend me at ..FaceBook..
Read jokes at ..Jokes Limitless..
You can also know more about me at ToughJamy : An Informal Me!!

Happy Programming and Happy Hacking.

How to remove Thumb.db file

We all know that Thumb.db file is a cache of the current picture in that directory. But sometimes it become necessary to remove it. In order to remove it go for following step:

2--> go to "TOOLS".
3--> open "FOLDER OPTIONS".
4--> go to "VIEW".
5--> see 1st section "FILES & FOLDERS".
6--> click on the "DO NOT CACHE THUMBNAILS".

Now the thumbnail file will be removed from the computer system. And once you do this the file will be never created.

Some Useful shortcuts tricks and tips in Mac OS X

Today I am writing about several shortcuts and tricks in Mac OSX Platform. Some may be know to few people but some may really amaze you.

a) Select text in your browser and then drag and drop it onto your desktop. There will be a basic text file with your text in it.

b) cmd-click Finder window title: It shows a Pop-up menu showing path to current folder/document

c) Command Key and Tab Key can be used to cycle through your running apps as was done in Win platform using tab key alone.

d) Many do not know that you can change the style of the text/icons of a window by command clicking on the little button in the top right of the window of a program. That small button has more functionality too. Explore!!

e) Have you heard about famous Genie Effect in Mac. It is also regarded as Slow down effect. You can see this by holding down shift when clicking on the window minus button or documents in the dock. I will further explain this in Genie effect blog post separately.

f) Voice over Utility:
You can use apple logo key and F5 to launch Voice over utility App. You may also find this by default at /application/utilities/voiceover. I will write about this utility at some later time but if you explore yourself, you will be more benefitted.

g) Resizing a column divider in a Finder window is simple. But there is yetr another trick. Press Alt-click and drag column divider in Finder column view resizes columns evenly. This would resize width of columns in all finder windows opened.

h) Pressing F11 would engage expose and move all windows to the edge of your screen

i) Negative Vision Trick.
I discovered this a year earlier. Since then I used this many times to stun my younger sis, or for that matter my MBA Wife. Use control+alt (option)+command+8. This would make your screen go like a negative vision of your screen. You can do again the same to revert back.

Write your opinion.

You can know more about me at ..Linked In..
You can befriend me at ..FaceBook..
Read jokes at ..Jokes Linitless..

Emac from Unix to Mac.

The command emac can be used to play some games or some refreshing exercise once you get bored through your usual routine job. I do not know about its history but can be surely searched at Wikipedia. But today I will tell about some tricks with emac.

1) One trick is pressing control+option+command+8.

Another one is going to terminal then typing "emacs", then press "esc" and then "x", then type "doctor" or "tetris" or “life”. The effects are that ‘Tetris’ would pop up the classic ‘tetris’ game, ‘life’ shows the cell division process.

2) If you are a little bit bored, you can try M-x hanoi. If you are considerably bored, give it a numeric argument. If you are extremely bored, then try an argument of 9. Sit back and watch the Hanoi Towers been created.

3) If you want self involvement, try M-x gomoku, which plays the game Go Moku with you.

4) M-x dunnet runs an adventure-style exploration game, which is a bigger sort of puzzle.

5) As told, M-x tetris runs an implementation of the well-known Tetris game. What was not told is that, M-x snake provides an implementation of the famous Snake game.

6) When you are frustrated, try the famous Eliza program. Just do M-x doctor. End each input by typing RET twice.

7) When you are feeling strange, type M-x yow.

8) The command M-x zone plays games with the display when Emacs is idle.
So in this way you can counter react to the boredom at work if it occurs on Unix or Mac platform. One’s who are in luck to always deal with black screen of traditional Unix based system would really know what I mean when I speak of boredom ;)

And yes, do not forget ending with emcs—ctrl+q then ctrl+c .

So, Happy Emac-ing (I prefer calling e-mack-ing)

Mohd Anwar Jamal Faiz meets Ankit Fadia at Adobe QE Summit 2010

Many have asked me (rather requested) to share some hacking tips. For that matter, one thing is to always keep in mind that nothing is not-hackable and no trick is always a sure-hack. The tricks are merely a tweak until user/administrator or the product supplier do not correct them. And when they correct them, there is yet another trick germinating in some mind at some corner of planet. So this is an endless Cycle. This idea of mine which germinated years back got more nourishment on 16th July 2010 at Adobe QE Summit 2010.

I happened to meet Ankit Fadia.

The guy is just genious, no doubt. And his introductory speech that talked about how much prone we are to the hacking and stuff was so very humorous and informative. His sarcasm and his knowledge in his domain is excellent. I could not resist and had a autograph from him on which he inscribe “Happy Hacking Anwar”. It was a memorable experience actually more of becoz you are meeting with a guy who is as young as you and who has a long list of achievements enuff to surpass even a simple NASA chief ( Yes I would call him ‘a simple’)
You can know more about him at Ankit Fadia Official Website or can surely dig him at the Wikipedia

Many, I don’t know why, have started saying that I am inspired by him. I should not say, but I must say, that I do not say what I want to say. And what I want to say is that truly, I wanted to become one like him. But who cares! There are many more paths left where u can manifest your path-breaking stunts.
I attended two of his lectures one on basic computer security and other in detail on tools and analysis of network security. It was nice experience, though many of tricks and tools he talked about was known to me. In particular when you are working as an API and Security Tester in the WhiteBox Team of a Product Company as big as Adobe itself, the you yourself are into the same boots of hacker. Because ethical hacking (incidentally again the term coined by Ankit Fadia) becomes your bread and butter.

You can know more about me at ..Linked In..
You can befriend me at ..FaceBook..
Read jokes at ..Jokes Linitless..

Monday, August 2, 2010

How Google Search Suggest or "did you mean" Algorithm works

According to Douglas M., former CTO of Google , the logic behind suggestions is as follows:

1) Anyone writes a ( misspelled ) word in google

2) If the person does not find what he/she wanted then he/she does not click on any results that came.

3) He/she realizes that there was a typo error. So a rewrite of the word in the search box happens by him/her. That is he/she enters the correct word.

4) He/she finds what they want. They proceed by clicking on any of the result.

This is where the catch is. This pattern multiplied millions of times, by zillions of users, show what are the most common misspells and what are the most "common" corrections. So based on this Goggle corrects the searched query (rather suggests a correct query).

Enjoy Googling!!!

Mohd Anwar jamal Faiz
Jokes Limitless
Puzzles in Job Interviews