Its been more than 10 months since I had blogged and this post will be a start for DYK series. This involves facts, trivia, useful information from Technology, Software, Programming, Sports, Internet etc. If you already know any of these stuffs, kindly ignore it, others enjoy and learn . . This is Part one of series and I hope many will follow.
1) Lets start with Google Chrome. We all know about Instant search in www.google.com. How many of you know how to invoke it from Chrome’s Omni bar ?? There is a simple way to do (Idea Courtesy: Internet).
On running the above program, we will get that strings are not equal. This is a very small example and when used in a large or a sufficiently large program leads to bizarre results. So better use strcmp method or equivalent in that programming language in which you code. (I remember studying this in C books, but recently when I had to do some comparison, used == and faced issues. So writing it so that it will be like a brush up of basic stuffs in languages.)
3) The next thing is about an Android App I recently came across and using it quite well. SmSpopup it is. This is an App that intercepts the incoming messages and displays in a pop up box on the phone and it works even when the screen is locked. One can also reply to the message via the same popup(see in screenshots, voice input also included). This is the fastest way of sending and receiving messages and when your Android’s default messaging system is slower(just as mine), this is *the* app for you.
4) The next DYK is regarding another OSS, Notepad++. For those who needs to use Windows in office and those who like it(, there will be very less ppl.. But W7 has wonders and we will have an argument about it at a later time).
There are multiple features in this software and it is fully loaded with many plugins one needs to use. Some of these are
5) Fifth thing looks a bit of techie stuff(), but very easy to understand. You would have heard about Jquery, a JS library which is used for Rapid web development. There are infinite modules with jquery which one can use easily in the websites we design. This DYK is based on my experience, where I am using two jquery modules in a single webpage and one didn’t work properly. I had to Google to find the mistake I was doing- Initialising the class of the jquery twice. Each module comes up with a different version of jquery.js to include. I had included both the js files. What was happening is the second time one includes it, the whole jQuery object gets updated and over writes the plugin you already initiated. So ensure that, you include only one js file of the plugins.
6) The final thing in this part is about shell programming. When you are writing shell scripts, often errors may occur and easiest way to debug those is by use of “bash -x” for running the script. This will tell where the exact error is. Another way of doing this is by including “#!/bin/bash -xv” as the first line of script. Many such tips for debugging are provided in this website(http://www.cyberciti.biz/tips/debugging-shell-script.html).
That’s all for this post folks. If you find any mistakes or have suggestions do mail me or leave a comment and I will look into it. Till next time., –Naveen DS
1) Lets start with Google Chrome. We all know about Instant search in www.google.com. How many of you know how to invoke it from Chrome’s Omni bar ?? There is a simple way to do (Idea Courtesy: Internet).
- Download and install Google Chrome dev channel. If you have previously pin the Chrome icon to your taskbar, unpin it.
- Go to “Start -> All Programs -> Google Chrome“. Right click on the Google Chrome entry and select Properties.
- Enter “
--enable-match-preview
” at the end of the shortcut target. Click Ok. - Launch chrome now and you will be able to see instant search results as you type. Such an easy thing to do.
#include<stdio.h> int main() { char a[10]="Hello",b[10]="Hello"; if(a==b) printf("The strings are equal"); else printf("The strings are not equal"); return 0; }
On running the above program, we will get that strings are not equal. This is a very small example and when used in a large or a sufficiently large program leads to bizarre results. So better use strcmp method or equivalent in that programming language in which you code. (I remember studying this in C books, but recently when I had to do some comparison, used == and faced issues. So writing it so that it will be like a brush up of basic stuffs in languages.)
3) The next thing is about an Android App I recently came across and using it quite well. SmSpopup it is. This is an App that intercepts the incoming messages and displays in a pop up box on the phone and it works even when the screen is locked. One can also reply to the message via the same popup(see in screenshots, voice input also included). This is the fastest way of sending and receiving messages and when your Android’s default messaging system is slower(just as mine), this is *the* app for you.
The best part of this is, it is Open Source.Screens have been taken from project’s Google code website. It is fully customizable and has plenty of settings to tweak and play with.
4) The next DYK is regarding another OSS, Notepad++. For those who needs to use Windows in office and those who like it(, there will be very less ppl.. But W7 has wonders and we will have an argument about it at a later time).
There are multiple features in this software and it is fully loaded with many plugins one needs to use. Some of these are
- The compare plugin – A simple button click to compare two files.
- Column wise selection – Select by clicking Alt+Left mouse button. you can easily select columns.
- The good one I think is Bookmarking a line. You can bookmark any number of lines and can perform various editing operations. This would be mostly useful in bulk text files where selecting a line and click find. In the Find dialog box, check mark line and press the Find all button. This will bookmark all the lines matching. Then we can delete or cut, copy paste, invert , toggle etc. Here is a screen for it.
5) Fifth thing looks a bit of techie stuff(), but very easy to understand. You would have heard about Jquery, a JS library which is used for Rapid web development. There are infinite modules with jquery which one can use easily in the websites we design. This DYK is based on my experience, where I am using two jquery modules in a single webpage and one didn’t work properly. I had to Google to find the mistake I was doing- Initialising the class of the jquery twice. Each module comes up with a different version of jquery.js to include. I had included both the js files. What was happening is the second time one includes it, the whole jQuery object gets updated and over writes the plugin you already initiated. So ensure that, you include only one js file of the plugins.
6) The final thing in this part is about shell programming. When you are writing shell scripts, often errors may occur and easiest way to debug those is by use of “bash -x” for running the script. This will tell where the exact error is. Another way of doing this is by including “#!/bin/bash -xv” as the first line of script. Many such tips for debugging are provided in this website(http://www.cyberciti.biz/tips/debugging-shell-script.html).
That’s all for this post folks. If you find any mistakes or have suggestions do mail me or leave a comment and I will look into it. Till next time., –Naveen DS
Nice :) :) :)
ReplyDeleteNice post :) ..I specifically liked the JQuery & Android App part..it kind of talks about cool stuffs :)
ReplyDeleteAndroid app is cool :-) Nice post :-)
ReplyDelete@Above all .. Thanks for your feedback ..
ReplyDeleteCool! :-)
ReplyDeleteI didn't really know about bash -x :P It helped! Keep up the good work!
Thanks Venki. I too didnt know this until I went into a problem and googling found me this. Thought it will be useful so shared with all ..
ReplyDeleteThanks for bash -x tip da. Should be very useful!
ReplyDeleteA couple of clarifications:
i) I am not sure what you mean by a jquery module. If by that you mean a jquery plugin, it does not overwrite the jquery object. In fact each plugin receives the object and adds methods to it. You can see that the plugin starts with (function($){ where $ is the jquery object. But if you download two versions of jquery then its just your bad :P Since there is no concept of a class in js, it will just overwrite the $ object.
ii) In the C code you are comparing pointers and will always be false unless they are pointing to the same location. In php and other languages, == should work just fine. As I understand, strcmp and == are inverses in php. i.e., if(!strmp($s,$t)) is the same as if($s == $t)
Cheers
Sanjeev,
ReplyDeletei) About jquery, yes I did tell about plugins. I just downloaded two versions of jquery and tried it out :P, hence I said, it will overwrite..
ii) Yes, what you say is absolutely correct in C. But in php, what I observed is it worked randomly. I don't remember the exact strings I was trying to compare, one time it will tell they are equal and other time it says unequal(not for same input thought). And about inverse, yes it strcmp and == are inverses in php.
Thanks for you comments..