Skip to main content

Posts

Showing posts from 2011

Sms Firewall !!!

Tired of prank SMSes. Need a simple way to block them, and keep your inbox clean? Don't worry. You got it!
SMS Firewall is a simple and cute (hope you like it!) Android application to block and quarantine unwanted SMS from reaching your inbox. Unwanted are those who are neither in your contacts list nor in the allowed list, which is provided by the application. Phone numbers or sender names such as your bank or mobile service provider can be added to the allowed list. You got an option to either notify you of the blocked SMS or ignore it, in which case you will have check the quarantine vault by yourself. Besides, you have a 'Just Monitor' mode, which is primarily used for debugging purposes or when you don't want to block SMS from unknown sender(s) (for a while). When this mode is switched on, SMS from unknown senders will reach the inbox and also a copy of it is saved in the quarantine vault.
Here are a few screen shots to get you attracted...
You can download the la…

To Ritche !!!

Dennis Ritchie, whom we all know as the creator of the C programming language passed away on Oct 12, 2011. We have lost one of the brilliant minds of mankind. I owe him this post for he has been one of the greatest inspirations in my life and the very reason that I am into programming.
The first time I saw Ritchie's picture, I felt him like Jesus. I would say that the divinity that his face reflected pulled into the world of programming. It was during my college days that I lay hands on his book - The C Programming Language. It is one of the most influential computer books I have read. I had read it at least a couple of times and referred it a thousand times. I felt it like a lecture by Ritchie. And so I had marked a lot of pages with comments and questions as if they are addressed directly to Ritchie himself. I had the book with me almost all the time. I even hide myself in the last row during other lectures to read the book. I felt excited reading the book. The book has a special…

Seinfeld Calendar Update !!!

We have released an update for Seinfeld Calendar with a bunch of some exciting features and defect fixes. I hope they are exciting for you too. NOTES: You can add notes or additional information for a task on a month basis. Again, the notes are maintained month wise and not date wise. It is just to keep it simple, since adding it date wise would require a special selection mechanism for marking a date as completed.REMINDERS: When you create a new task or edit an existing task, you will now be able to add reminders for a task, or disable them too if you added one already. As you might have guessed it, the reminder pops up a notification at the specified time reminding you to do the task. It could be jogging in the morning or taking your pills at night. The tool is now improved to not only keep track of your task status, but also helps you to do it everyday by reminding you. So you will not miss doing it!HOME SCREEN WIDGET: We have added the facility to drop home screen widgets on your …

Android meets .NET !!!

It is always fun for me to program in C# (besides C++). If so, how would I feel if I was able to program for Android in C#? You may be wondering what in the world I am talking about. Android development environment is all Java and open source stuff. How could this Microsoft thing fit onto it?
Well, it seems that some clever guys had huddled up and ported Mono for Android, developed .NET libraries for the Android SDK, and also supplemented it with a 'Mono for Android' project template in Visual Studio; and called it mono for android. Thus we end up writing C# code happily for Android.

After a bunch of installations, fire up your Visual Studio (2010) and you should be seeing a new project template 'Mono for Android' under C#.

Create a new 'Mono for Android' project, which by default comes with an activity - C# code.

The project layout for most of the part is similar to the native Android project. The layout resources files are named *.axml, and the strings.xml i…

Quiz: Beauty of Numbers

Sriram asked:Imagine there is a queue of people for getting a ticket for a movie or somehing. Where should be standing in the queue to last until the manager or some guy keeps removing people at odd indices. For instance, if the queue has 5 people given a token A to E, first we remove the first set of odd numbered positions in the queue, so A, C and E are gone. Now B and D remain. Again we remove the odd numbered positions. This time B alone is gone, and D is the winner. So in a queue like that, what is the lucky position you should hold so that you survive the wave of removals?I could give you the solution right here in front of your eyes. But that would not give you time to think to solve it on your own. So solve it and\or read the solution here.

To Hold or Not to Hold – A story on Thread references !!!

void SomeMethod(int x, double y) { // some code .... new Thread(ThreadFunc).Start(); } What do you think about the code above? Some may say nothing seems to be wrong. Some may say there is not enough information to comment. A few may say that it is awful to spin off a thread like that (the last line of the method), and that there is a probability for the thread to be garbage collected at an unexpected point of execution. That is something interesting to discuss about. Before presenting my thoughts and supporting facts, the short answer is NO. A thread spun off like that will not be garbage collected as we expect, although one should be morally insane to write such code. Alright, let us discuss. The Thread class is like any other reference type in the BCL. When an instance of a reference type holds no more outstanding references, it is a candidate to be garbage collected. Even worse, it could become a candidate even while it is executing an instance method, while there are n…

Crazy Brackets - [](){}();

What does this cryptic bracket sequence mean? What programming language is it? Is it valid syntax? If there is even a weak chance of this syntax being valid, then what does it mean? Alright, alright, alright.....It is C++. That would calm most people; with all their love (pun) for C++. Specifically, it is C++0x. Amongst many other features that we have been waiting for, C++0x gives us the power of lambdas. The formal definition of a lambda in C++0x is as follows:- [capture_mode] (parameters) mutable throw() -> return_type { body } So a lambda may capture one or more variables in scope by value or by reference, or it may capture none. Specifying return_type is not necessary if the type can be inferred or is void. For instance, a std::for_each's functor based code could be inlined with a lambda as follows:- std::for_each(v.begin(), v.end(), [](int x) { cout << x << std::endl; }); A lambda definition could be assigned to a variable and then used or invoked la…

Wetting my feet in Android - Seinfeld Calendar

A couple of my colleagues and I huddled up to learn a bit of Android. I think I told you about that a short while back. We developed a very simple application - The Seinfeld Calendar.Seinfeld calendar, or otherwise called the habit calendar, is Seinfeld's productivity secret. The secret of achieving your goal is practising something, whatever your goal is, everyday and make it a habit. And mark it in your calendar each day you practice, and make sure you do not break the chain. Our application helps you keep track of your everyday tasks.Our application does not jog or meditate or quit smoking for you. You have to do your tasks. Our application provides the facility to create tasks for the habits you wish to pursue, which in certain cases like smoking means quitting. And then you mark each day in the calendar if you pursued your task, else you don't mark and break the chain. And no cheating!The application is in very nascent stage and does not provide you (fancy) statistics an…

Anonymous Classes vs Delegates !!!

I am not a java programmer. By that, I do not mean I am against Java. As a programmer by profession and passion, I try to learn things along the way. That includes a little of bit of Java. I should say that my proper encounter, so to say, with Java is a simple application that I am trying out with Android. There might be some hard core differences and/or limitations in the Android version of Java. But I am almost certain that I am using only primary level features of Java. In android, there is this OnClickListener interface, which is used as a callback interface for a button click. So, it is used something like this:- // Create an anonymous implementation of OnClickListener private OnClickListener mCorkyListener = new OnClickListener() { public void onClick(View v) { // do something when the button is clicked } }; protected void onCreate(Bundle bundle) { ... Button button = (Button)findViewById(R.id.someButton); button.setOnClickListener(new OnClickLis…

Quiz - Where am I?

The question is, in C++, how do detect if an object is allocated on the stack or heap.On Windows, the stack address is in the range of 0x80000000. If the address of the variable is in this range, then you could say that the object is allocated on the stack; else it is allocated on the heap. This technique of detecting is not preferrable since it may not work on other operating systems (such as linux), and deals with the platform specific information making it a non-portable solution.Let us try to use standard C++ stuff to solve the problem. Ok, we want to know where an object is allocated. In C++, new operator is responsible for allocating an object.It was very thoughtful of Stroustoup to keep the object allocation and initialization\construction separate. new operator is responsible only for allocation. The compiler is responsible for woving up the code for allocation and calling the constructor. It was also very thoughtful of being able to specify the location where the object needs…