A short while back, Sammy quizzed me on linked list based problems; singly linked list.
I am recording those problems, solutions and my experience as a two part series. In the first part, I am introducing the linked list class, which I wrote for packaging the implementation of the solutions. This class pertains to the context of the problem(s) and cannot be used as a general purpose linked list. A std::list might more pertinent in the context of the general purpose implementation of a list.
More ...
I gave SMS FireWall a refresh with a couple of features requested by users:-
Hope they are useful to others too. And let me know if you need any other features to be in the application.
More ...
Hugh pointed out a bug in the OrderedThreadPool.
I think there is a small window for error in the OrderedThreadPool class. Basically, if an item of work is queued, then a worker thread runs, takes the item off the queue and is about to call wcb(state)
β but at that instant is (say) context switched. Then another item gets queued and another worker thread runs and dequeues the item and then again is about to call wcb(state)
. There is scope here for the two operations to run concurrently or even out of orderβ¦
A short while I was engaged in a little project where I had to interact with a third party service provider who required a (30 length) unique id as part of the transaction. I am little dumb and am used to GUIDs for a long time when it comes to unique ids. But GUIDs are more than 30 in length. I was trying out some stupid ways like stripping out the trail part of the GUID to make 30 length unique but my intuition wasnβt convinced about the tricks I was working out. More ...
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.
More ...
Dennis Ritchie1, 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, for a moment, he looked like Jesus to me. I would say that the divinity in his face pulled into the world of programming.
More ...
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.
So with the above features, doing the task and tracking it has become super easy. Despite all the handy features, it is all in your hands to do your task. It is just not about marking it done.
More ...It is always fun to program in C# (besides C++). If so, how would I feel if I was able to program in C# on Android? 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 guys1 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. Thus we relish writing C# code for Android. More ...
One hint that should be helpful in building our solution is that we got to get retained after every wave of removal (until nobody else remains). That means it got to be really some special number or special kind of number. We could do what functional programmers would do. Write down the steps of removal for every queue size N, and it is not worth trying for very large N; in our case, even 20 or 30 could be large. But the point is we could iterate the steps manually and find a position K for every queue size N, where K is the position that remains after all the waves of removal. Once we are done with that, we should stare intensely π on every K to derive a pattern, which would tell us something about those Ks, and with that we should be able to solve the problem. More ...
Sriram quizzed:
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?
More ...