Friday, January 31, 2014

Messing with QML

Just started learning QML and yeah, it's totally new age! It's going to take me some time to get in gear and know the various internals. 
So I am just messing around and trying to learn the trade lang for Qt 5.

Thursday, January 30, 2014

[Android] Factory/ Hard reset of Karbonn S1 Titanium

Power down the phone.
Press Power + Volume Plus button combo for about 5 sec's. You will get to green screen; don't let go of the buttons. After another 5 sec's display will turn red.
Let go of buttons, and a menu will be shown with various options for installing update/ reset/ cache wipe / data wipe etc.
Move to data wipe option using Vol +/- options. And select the option using power key.
Below the options, the result can be seen. Once data wipe is done, select Reboot phone option.
After reboot the phone should return to factory condition.

Wednesday, January 29, 2014

[Android] Boot animation change, subsequent hangup and hard reset thereafter!

[UPDATE ] The hard-reset phone kept with old animation worked for a while but after I installed a s***load of apps, it went keput again! So had to do another hard reset; and this time after the reset I installed BAC (Boot Animation Changer) and restored the stock animation back.
Now I have re-installed almost all the apps and it's going okay. Hmmm, maybe no custom boot anim for me.
                                                                               --- *** ---

Just tried Boot Animation Changer on my Karbonn S1 Titanium. Had to root it first; framaroot took care of that. It's a nice app! Later I installed BAC(Boot animation changer) and put in an animation of Cynogenmod that I got hold of on a site.

After rebooting though, the karbon won't get to homescreen. The last three seconds of the animation kept repeating itself. So I had to factory reset it. So after couple of fiddly reboots, it's factory reset (Full factory reset + cache wipe!). And the cynogenmod boot animation is still there! So I am gonna keep it for now. Hussh! Was scared that I had bricked it! :D

Should get a recovery image prepared! But I am too tired these days to even dig in XDA-DEV site...

Monday, January 27, 2014

[PostgreSQL] Query to check no of tables in a database

Often times we are needed to check if any database we are connected to has any tables or not. In this case following query proves helpful:

select count(*) from information_schema.tables where table_schema = 'public'

Saturday, January 25, 2014

PostgreSQL script to keep postgreSQL server running



set PSQL="C:\Program Files\PostgreSQL\9.1\bin"

set DBNAME="template1"

set USER="postgres"

set PORT="5432"

set RES="Not Pinging"

%PSQL%\psql -Atq -c "SELECT 'ping'" -p %PORT% -U %USER% %DBNAME% > _Res.txt

set /p RES=<_Res.txt

IF %RES% EQU ping (echo "Postgres running... ") else (echo "PostgreSQL seems not pinging.. Restarting..."
sc start postgreSQL-9.1 > NUL

ping -n 10 > NUL

goto loop

A sleep starved day

Its the middle of the week. I have stayed up quite a while the previous night. So with about three and half hours sleep on my schedule I have been feeling foggy whole day. But I have slogged on through, moving code from one place to another, building the binaries and fixing whatever build issues I stumble upon.

It has been a grueling day spend fighting with messy code and various idiosyncracies anything that's fairly old seem to acquire. And now as I move in the train still about an hour away from home and one full hour into the return commute, my brain wants to shut down.

The shuffled playlist has Rihanna singing 'stay'. I know tonight I am gonna sleep like dead. I have pulled such ultra-late nights before. And I have seen too many foggy days. I miss my folks. I miss my cats. I miss the jungle. And its been so many years here, but I can't stop feeling like a refugee in this concrete jungle.

And Rihanna sings, 'I want you to stay', but it doesn't feel like there's anything here for me to stay!

Friday, January 24, 2014

[Qwt] How to plot discontinuous curves

In the current project we are using Qwt for doing some plotting. There was a problem with data loss and how to represent it on the graphs. While discussing possible solutions and researching on how to implement them, I stumbled upon this thread which was good for a solution.

Thursday, January 23, 2014

[Link] Magic and More Magic

A frenzy of realeses

Recently I was required to develop and deploy a feature to all of our clients. At present there are 8 branches of code under maintenance phase in svn. I was required to add the feature in all these branches.

Of course that included the actual development of the feature and its deployment at all these clients.

The development took four days and unit testing and fixing bugs/ inconsistencies etc took another two days. So I made first release for a client. The feature was demoed and approved with couple of minor changes.

I incorporated the changes and moved onto deployment in other branches. The average development and release time was about 8 hrs per branch. I observed a few things.

First, the current code base could use some modularization, in that pluggable modules comprise of features. The feature I worked on could just be one such module. And that would have saved almost 6 days of development-release time.

Next, the code was easy to replicate since there was almost no dependency on the branch. But because we don't have any automated build process, I was required to spend time building all the releases for both unit testing and actual binary releases. This meant I was waiting for the build to finish for almost half the time. 

Next the dependencies of the feature included incorporating two libraries into the branches and the initial release of those was not up to the quality level expected which meant I had to spend some time debugging the errors in libraries and creating fixes in both libraries and the feature code that went into the branches along with the libraries. This could have saved almost a day.

So this simple activity of introducing one feature gave me a good perspective on where we are lacking and what needs to be done.

Monday, January 20, 2014

Extending plugins - a peculiar case

Link to Code Archive

I hit upon a very weird scenario recently and found out that there was no easy way to get the plugin working for this scenario.

So after searching a while for the possible solution and understanding that the solution would be indeed difficult to implement, I stumbled upon a post that gave me the solution. 

The scenario first: consider that there's some functionality in the Plugin container that you want to access from within the plugin. Lets consider a main thread ( GUI thread) refresh function that updates some part of GUI which the plugin provides the data for. And we want to call this refresh from plugin after certain operations in plugin are completed. Lets say that the plugin updates some values and that need updating the main GUI.
So we have seen how interface objects let us access plugin functionality and by creative use of base class pointers and container calls how we can access objects and functionality in the plugin. So here we are going to be more creative and call main GUI functionality from plugin. 

Below we get a QDialog from the plugin and add it to main window.

The formula is same. In qt the signals themselves are just functions or at least appear as functions. So we are declaring the signal in the plugin as another function. While in main class I. E. Our plugin container, we will use a dynamic cast of the interface object itself to QObject from which we will receive the signal.

Here is the connect function code that does this magic. 

In plugin we declare this signal as any other signal. And use it just so. Its not a straight forward way to do things but it works!

Tuesday, January 14, 2014

[LINK] Windows 8.1 Graphics Driver Availability Status

At this page you get latest available driver version via MS windows update. For AMD/NVIDIA  gfx you should of course go to their own websites to get latest drivers but for us poor people stuck with Intel gfx this page has link to the needed drivers.

Mind though, you need to open this link in IE as it involves installing MS Software Catalog plugin which lets you download the drivers. Thankfully the provided drivers worked like a charm for me. So many thanks to MS!!!


Moments for breaths.
Dough for moments.
Breaths for dough.
I remember reading a book. It was about some people that were able to haul off breaths from other dying  people. Then there are other people who could give away their breaths for money.
And then there was the hero who was a breath thief. He's dark and clouded in mystery. I don't remember the name of the novel. I remember Belisarius series. I remember another book that was fatally fantastical but ultimately sad in its ending. Books shouldn't end sad. Movies with a rating of 10/10 end up with a sad ending. Unless they are batman movies in which 3 movies end up with a beaten up batman and the fourth does some justice.


Monday, January 13, 2014

Windows 8.1 Preview on Acer eMachines e727

    So, Windows 8.1 is out. And people are saying it's lot better than Windows 8. There was overall positive feedback on the net about this. So I thought what the heck! Lets install this new thing and see how it works out. Now my eMachines laptop is ancient by current hardware standards. It's a strictly entry level laptop that I bought for INR 24k. That was like $500 back in Nov 2010. It's three years and it has seen all windows from XP to Win 8 (barring Vista of course!) and a shitload of Linux installs. 
    So first getting the OS. Thanks to so many Pirate friends it was not so difficult. Next task was getting it onto a bootable media. Or try upgrading existing installation. So I started with upgrade path considering the non-availability of drivers etc for my ancient hardware. That promptly failed as the Setup told me that my version of Win 7 was 64 bit and setup itself is 32 bit. I was feeling adventurous, so I popped in my year old Win 7 disk, and let it install Win 7 32 bit while I listened to some Evanescence. 
    After the setup was done, I again started the Win 8.1 setup. It progressed some and then failed with 'some error'. OK. So now time to get it into either USB or DVD. It was fairly late in the night to get a DVD. So I downloaded rufus tool and created a bootable USB. Somehow it failed at first try (Story of my lifetime! ) but worked on the second try. So I booted from the USB and let the setup load. The setup itself was straightforward and nothing seems to be amiss anywhere.
    I noticed the problem after I was done installing. The graphics was configured at 1024x768. Sucks! But after searching some on the net I found out that the update takes care of it. Sadly I am not fond of MS Updates so I let it sit like that. I installed my favorite programs and stuff and soon I was enjoying fifth season of The Mentalist. The resolution did make Patrick Jane appear a bit fat and Lisbon a bit filled! 
    The system performance is snippy. It took about 150MB less RAM for same setup as my old Win 7. The zipping around of stuff and the animations etc make it feel lively. 
    Overall I would say MS is on a really good track and at least on the surface Win 8.1 looks like a worthy upgrade to Win 8.

Wednesday, January 8, 2014

Into the new year 2014 and some resolutions

So 2013 was kind of meh. I was into a new job and a new place and yeah I didn't have much of any agenda. Thankfully that was a good thing. The year was totally hectic, I have been travelling 5 hrs a day and on top of that working on some really messed up codebase. So a year later I can say that on personal level I may have achieved nothing, but I have done some real good work to the code I have been working on.

The year saw all my close friends go through job change. Couple of them moved to new places. Few more got married. Couple of the others already married had kids. In short life is moving ahead. My life though felt like stuck at a single point. My hectic daily schedule left no time for extra-curricular activities. I have done no new translation of anything, I have not reviewed any distros, I have stayed close to the Elementary OS installation I have and all through the year, I have updated it only thrice. The only new thing I can proudly say of is I have started Cycling. Bought an entry level Roadbike and got in the scene.

Been trying to be regular on weekends but it's become almost a fortnightly activity.

My laptops keyboard lost 3 keys; couple of them directional keys and so I had to finally stop playing NFS Most Wanted! It was no fun with remapped keys. My 3 Yr old Acer can't play any new games so I guess the broken keyboard is the nail in the coffin for my Gaming activities. I could replace the keyboard but it's not completely broken; I can still do most of coding activities (what little I do these days).

Another thing of much say is that I finally gave in to the Droid Temptation and got an entry level Android phone. Yeah, my now - 2.5Yr Old Samsung Omnia W is still working great and kicking it all, but I have always wanted a droid. Unfortunately I didn't have the budget to get a great droid and the value one's were too slow for my use. So the phone I got is Karbonn S1 Titanium. It cost me INR 7500/-; that's about $120 going by dollar's current value of about 62INR. This is a quad-core droid though it uses Qualcomm's first-gen quads (S4 play) which have average performance, 1GB RAM, 4GB inbuilt Memory, Dual SIM, Android 4.1. The overall performance is goof enough, the screen is good enough, touch response is a bit finicky, but the battery lasts whole day so overall it was a good purchase.

On professional growth part, I have managed to upgrade my coding skills quite a bit thanks to my current organization. We use Qt/ PostgreSQL and the solution runs on both Windows and Linux. For the year my work has been divided into about 50% R&D; 30% Product; 20% Projects. Being a senior member of the development team with much more exposure to Linux and Qt; I was handed over a lot of R&D activity where a lot of new functionality was to be developed. Some of them were:
Working with OpenSSL and Qt and create an Authentication mechanism for use with existing product.
Working with existing product to add mechanism to maintain data integrity and notify data quality
Working with external statistical libraries to create bulk data analysis tool.
Porting existing product to Qt5 from Qt4.5
Restructuring existing product to separate core functionality and modularize it so that extra functionality can be added in the form of plugins

So overall it was a busy year in the company and I will remember many nights coming home totally tired; having dinner and promptly falling asleep only to wake up by 6AM next day for another cycle.

As to 2014; I don't have any plans neither have I set any goals. I need change. I need to make my life easier. And I need to get back to open source and start working on some of the amazing stuff all these talented people are working on. And I am still wondering how I am going to do that. Maybe I'll figure it out in 2014 and my next 'Another year gone' post will mention it.

( :P Couldn't help!!!)