Posts

Showing posts from February, 2014

A tangle with shared memory

Code: https://drive.google.com/file/d/0BxorjNRCBW61Ri1ib3ZLa2t6Tk0/edit?usp=sharing Recently I was thinking about inter-process communication and especially how to pass/ share data/ information between two running applications. The thing was, I wanted to check out inter-process communication interfaces and see if there was anything Qt provided that I could use.  My requirement is not finalized or anything. The rough idea is to have a channel of communication between two apps. Here my thoughts diverge a bit in that, I am yet not sure of the method of communication. There are two approaches:  1. The message system should be a message board where many processes post messages for each other and periodically access the boards to check out their messages. 2. The message system should be P2P. One process sends a message to another and that message (preferably named) makes other process do something like maybe send an acknowledgement.  Now after digging through the various approaches,

Working on Some Qwt Graphs

Image
Link to previous Article  though it doesn't have any code.  This is Link to Code I am back with some more code. Recently I found working on some QWT graphs and as I dug deeper into Qwt I found that it's quite easy to work out something quite functional.  So I developed a small utility to display Qwt's graphs and a small logic that would detect spikes in a data stream.  Here's a screen shot of the actual thing in action. The left graph shows a curve and the right graph shows the detected spikes in that curve. I am showing both up and down-ward spikes.  The time is shown as units and there are some tutorials on how to get correct time to shoe on X-Axis. But here it doesn't matter as this is just a Proof of concept.  I have used a c_sinewave header to get the sinewave and I am introducing spikes using a simple randomizing logic.  On detection part, I have following comments above the block:  // tmp is current point; listOfSinePo

flappy bird - this is a bad game!!!

Image
Simple yet very difficult to play game!

Classes for Logging messages to a file and Truncate that file at routine intervals

Code at:  https://drive.google.com/file/d/0BxorjNRCBW61VlVhbllEV0Njb1E/edit?usp=sharing I often used to think that what a simple logging interface would look like. So I went ahead and wrote couple of classes that would do just that.  The classes are simple. First class LogService has two constructors that set the logFileName. This class also has a function logMessageToFile that writes the provided string to the logFile. LogService(QString); void logMessageToFile(QString); Now the second class LogTruncateService has similar constructors. But this class implements a QThread. So we have run function as well. LogTruncateService(QString ); void run(); The run function contains an infinite while loop which keeps checking the time stamps stored in logFile and resets the file after certain no of days are past. Here I have set that time to 10 days. The limitation is that we need to provide log messages in given format. Else this parser fails. But that is feasible when we are only loggin

Current karbonn droid homescreen

Image
Apex launcher Miui theme