Source Code

This category contains 13 posts


Second post in the series Back to Basic Display the Nth Node from the End


I am starting a series of posts that are targeted towards Data Structures that I had been wanting to write for a long time. They are simple code snippets. For many this might not be useful but for some, it might be. So here we go, the first one is to print the contents of … Continue reading

AIR 2.0 Native Process Batch File

I really wanted this feature almost a year back when I was working on Adobe Mobile Packager with AIR 1.0. The very reason why we didn’t build the UI with AIR was its inability to interact with Native processes. And finally now with the 2.0 release of AIR, the feature has been made available to … Continue reading

Python – Terminating Threads

According to me Thread management in any language is a messy affair and probably there are a lot of examples that I have come across that illustrates how to terminate threads. Here is a very good and clean example of how to terminate threads from the main (Parent) The program also illustrates a very nice … Continue reading

Python – Redirect Stdout

There are two ways to redirect the Stdout to a file. The first technique is based on redirecting sys.sysout┬áby assigning a writable object (such as a file object) to it. The print┬ástatements that follow will write to that object, instead of the default standard output. The drawback is that you should remember to reset sys.sysout … Continue reading

Python – Find and Replace

Here is a simple python script that would help in finding and replacing text in a file using python

Python – Monitor Process CPU using WMI

The following code lets us monitor a process running in windows using the WMI package designed for Python language. I have tested the same on multiple windows boxes and the results have been mostly accurate. Enjoy

Symbian – TPtrC to TText* conversions

To create a TText* from a TPtrC we need to access the Ptr() function of TPtrc. Here is the sample code snippet To Create a TPtrC using a TText* is same as that of creating a TPtrC from a TBuf either using the constructor or the Set method

Symbian – TBuf/TBufC to TPtrC conversions

To Create a TPtrC from TBuf/TBufC is straight forward and can be achieved in two ways, Using the constructor Using the Set Method Here you go, The variable buffer can be of either TBuf or TBufC To convert a TPtrC to TBufC is pretty simple Once the we have the TBufC we can convert it … Continue reading

Symbian – TBufC to TBuf conversions

This is the first post in the series of Symbian Descriptors conversions. If you want to learn the basics of String and Descriptors, check out this link. The first one is TBufC to TBuf Conversion. A TBuf can be obtained from a TBufC using the Des() method of TBufC Here is a simple code snippet … Continue reading