Posts

Showing posts from 2013

App Comparison - Wallbase App for Android and Windows Phone

Website: wallbase.cc I have been an ardent follower of wallbase.cc. The site's got some awesome design and the wallpapers there easily transform your everyday average desktop experience into awesomeness!  So when I stumbled onto the Windows Phone app of wallbase, I was expecting something that would be fairly basic. I thought that it would let you see the categories, top images and let you do some basic stuff. But when I used the app I was totally surprised. The design and the functionality provided really knocked the socks off me. The app looked awesome, was very responsive and fast, heck, it worked absolutely fine even on my 2G connection. Then there was the downloading of images which was awesome-start a download and go back to main screen to browse the images. Depending on the speed the download would finish and you get a popup. No more being blocked to the download screen or anything. It kind of defined what a smartphone app should be.  Then couple of months ago I got hold...

Qt Application Plugins

Link for Code on Google Drive . As it happens, recently I was needed to learn about Qt Plugins. The problem scenario was as follows: We have an application which has a number of dialogs. There's one dialog we customize for each client. We have to branch the application in SVN. Normally this would not be a problem but we are introducing incremental functionality into the core of the app and it becomes tiring to sync all the changes into all the branches. So it's decided that we would separate the single dialog which differs from client to client, into a plugin and make branches for that. This way we will be saved from headache of syncing so much code across all the branches. Instead the branches will contain only the dialog which is different for every client. So as a primary R&D on Qt plugins I prepared a basic application which shows a PluginContainer class which supports plugins and couple of plugin classes namely FivePlugin and SixPlugin.

Developer mode droids speed up the animations

There are developer mode settings available in almost all Chinese oem phones many of whom are sold here in India by Micromax, Karbonn, Lava etc.  These phones have developer mode settings available in settings menu. There you can change the speed at which various animations are run at. Setting these speeds to 0.5x can speed up the interface dramatically. 

Android APK download straight from Play Store

Evozi provide a service that lets you download app APK's directly from play store.   http://apps.evozi.com/apk-downloader/ All you need to do is paste the play store URL of the App from its page and paste it into given textbox.  Then press Generate download button.  You also can paste the package name directly and get the APK.  When compared to the websites providing APK files the advantage of this is that you usually get latest version of the app. 

Online COD of battery for Samsung Omnia W

Image
This online purchase on tradus.in cost me 469 INR only. I also got one battery for the same phone from local dealer for reference which cost me 700 INR. Well, sometimes you get great deals shopping online!

Battery replacements

Recently my Samsung's battery died after two and half years of use. After searching for a fair amount of time, I came across a seller who had some in stock. This listing I found on www.tradus.in. I promptly ordered one for the total cost of 469 INR. Couple of days later when I got some time to look in local market, I searched for the battery for my phone. After going through 3-4 shops I got one at a shop for 700/-. Since the tradus order was at least 3-4 days to reach mw, I got it. Also since I wanted to check the one ordered online against this one. So today on 18th Nov '13 the tradus order shipped. Its manufacturing date is later than the one I procured locally. It looks fairly standard. So now I have two batteries and my Sammy Omnia W's future looks bright.

Resetting the Omnia W

My Omnia W completed two and a half years in my hands this month. It has been a great journey so far. The phone has been great in my hands, the timely updates added to its charm and made it speedier. And its tough body has held through ay least half a dozen falls. Recently though I was experiencing some hiccups and slight lag once in a while. So being the adventurous soul, I decided to go ahead and reset the phone. Having gone through about half a dozen resets, I didn't miss any data and settings. Managed to get all the important stuff backed up. So I reset it and after it restarted and came back with the initial setup, I went through the steps and added the accounts back. Its fairly straight forward process. And in about 20 minutes the phone was up and I was into the marketplace hunting my favorite apps. After couple of hours of installing the various apps and setting up things to my liking, I noticed 10 updates. And to my pleasure, they were all to the Samsung supplied apps. So I...

Moving image on dialog resize

Image
A side effect as observed in one of the apps I'm currently working on. The size of the image is bigger than the label in which it's shown. So when we increase the dialog size, the label size changes changing the amount of image displayed. It's a surprising side-effect!

[LINK] Making Software Successful

Original Link: http://smackerelofopinion.blogspot.in/2013/10/making-software-successful.html Making software successful What makes good software into excellent usable software?  In my opinion software that fails to be excellent software generally lacks some key features: Documentation A README file in the source is not sufficient for the end-user.  Good quality documentation must explain how to use all the key features in a coherent manner.  For example, a command line tool should be at least shipped with a man page, and this must cover all the options in the tool and explain clearly how each option works. Documentation must be kept up to date with the features in the software.  If a feature is added to a program and the documentation has not been updated then the developer has been careless and this is a bug. Out of date documentation that provides wrong and useless information make a user lose faith in the tool. Try to include worked e...

Separation, MVC, Threads and signal-slots

In Qt you can't display anything from other than the Gui thread. I didn't know this. In Qt you need to set the GUI class parent to the thread class to access the Main GUI Thread. I didn't know this. In fact I didn't know much about the current thing that I was working on. So 1. I tried to use threads to directly modify the GUI. Failed with aborts! 2. Wrote a wrapper in main that would modify the gui and called it by setting main class as parent. Still there are aborts. Then spent some time thinking about alternative solutions. And found some stuff about inter-thread communication. So stumbled upon solution of using Signal-Slots for inter-thread communication. Got a lot of weird errors involving MOC and stuff. Further googling and furious search led to the pristine knowledge that we need a Q_OBJECT macro when we have a signal in a class. OK. Put in the macro; still more errors! Ok some more googling, and came to know that we need to qmake it all. OK, so after a super...

Replace String in multiple files using Perl

1. Create a list of files that you want to replace the word in e.g find . | grep Makefile | grep -v Makefile. > list.txt This will list all Makefile's and exclude Makefile.am etc 2. create a script replace.sh #!/bin/bash while read line do perl -pi -e "s/user1/user2/g" $line done 3. give executable permissions to the script chmod +x replace.sh 4. run replace script as ./replace.sh < list.txt

[LINK] Want to Evade NSA Spying? Don't Connect to the Internet

Image
Original article: http://www.wired.com/opinion/2013/10/149481/ Want to Evade NSA Spying? Don't Connect to the Internet By Bruce Schneier 10.07.13 6:30 AM Photo: Ariel Zambelich / WIRED; Illustration: Ross Patton / WIRED Since I started working with Snowden's documents, I have been using a number of tools to try to stay secure from the NSA. The advice I shared included using Tor, preferring certain cryptography over others, and using public-domain encryption wherever possible. I also recommended using an air gap , which physically isolates a computer or local network of computers from the internet. (The name comes from the literal gap of air between the computer and the internet; the word predates wireless networks.) But this is more complicated than it sounds, and requires explanation. Since we know that computers connected to the internet are vulnerable to outside hacking, an air gap should protect against th...

Parenting in Qt

Qt has the concept of parenting the widgets. The reason is  to arrange the widgets in a hierarchical manner. This way you can access / find almost all child widgets using a pointer / object of the parent. The reason I'm highlighting it here is that when you are trying to generate the UI at runtime, this ability of able to find almost any widget comes in very handy. Recently I had to work on a small utility which basically used an external configuration file to generate the contents of a form dynamically. The external file would contain the field definition and the constraints and I would create a corresponding widget and assign it the properties. Now to access these, I didn't even have any pointers since everything was getting generated dynamically, I used the object names. I assigned them object names that would correspond to the data that was contained in them. Then I would use findChildren method to get the matching objects. But you didn't hear anything about parenting h...

Moving from CentOS 5 to CentOS 6

Recently we ended up upgrading the base OS at my organization from CentOS 5 to CentOS 6. Our product is an application built in Qt with dependencies on PostgreSQL and Qwt. Now with the old solution being based off CentOS 5, Qt 4.5 and Qwt 5.1, there were a number of stability and performance issues that were observed. So finally we decided to bite the bullet and decided to shift to CentOS 6. The reason for not proceeding earlier was there are a number of hardware peripherals and interfaces that our system uses which doesn't have upgraded drivers etc. So the task fell on me to go through all the pieces and get a good estimation of efforts required for this jump and what problems we would face. It was decided that we would also upgrade to Qt 5 and Qwt 6 alongwith jump to CentOS 6. After getting a fresh installation ready we - me and one of my colleagues, started going through the requirements one by one. PostgreSQL was easy. Add the repository and fetch the required version. Qt ...

[External] Fingerprints are Usernames, not Passwords

Image
Good Read ! Original Link: http://blog.dustinkirkland.com/2013/10/fingerprints-are-user-names-not.html As one of the maintainers of eCryptfs , and a long time Thinkpad owner, I have been asked many times to add support to eCryptfs for Thinkpad's fingerprint readers. I actually captured this as a wishlist bug in Launchpad in August 2008, but upon thinking about it a bit more, I later closed the bug "won't fix" in February 2009 , and discussed in a blog post , saying: Hi, thanks so much for the bug report. I've been thinking about this quite a bit lately. I'm going to have to mark this "won't fix" for now.  The prevailing opinion from security professionals is that fingerprints are perhaps a good replacement for usernames. However, they're really not a good replacement for passwords.  Consider your laptop... How many fingerprints of yours are there on your laptop right now? As such, it's about as secret as your username. ...

About QFtp and stuff

Recently I started work on one module where I had to integrate FTP on the application. My focus was on getting a clean design and a good implementation. I didn't have any idea about ftp in Qt. So I dug into the documentation and found about QFtp. After going through the main class and some related stuff I started coding. I referred to the sample application. And as I went on coding I came to understand how easy to use the class implementation is. In about 300 lines of code my simple get file functionality was coded. Now I'm working on bulletproofing my code and I can see the perfectly logical ways in which QFtp's error handling is. In short I'm very impressed by QFtp's implementation. And kudos to whoever coded this brilliant class!

Tech sanyas

Would not checking fb means you have taken fb sanyas? Well, one of my colleague haven't logged in to Facebook in last three months. That made me take a look at my use patterns. I usually log in/ check out Facebook 3-5 times a day. Then there are all those morning tech news sites - my favorites are the verge, Engadget, anandtech, gsmarena. Sometimes I check out tomshardware and ZDNet too. Then there are the stupid Google maps detours when I'm not feeling particularly productive. And yeah besides tech, I also visit bikeszone for bicycle related news and discussions.  And sometimes when I'm feeling musical I visit rolling stone for music reviews. And imdb/ rottentkmatoes for movie reviews. Damn, that's a lot of misc internet use. And I don't think I can cut any of it off. But what if I am to take tech sanyas? What would I cut off? Big question this!!!

WP7 and the ActiveSync supported Host Internet Sharing

 Did you know that WP7 supports Host's Internet Sharing via Zune? To see that enable Airplane mode and connect your WP7 device to your computer. Now open zune, and let it connect to your phone. Once your phone is detected, open Internet Explorer on your phone and see if you can open any website. Provided your computer is connected to internet, websites should open on your phone. You must also know that media access is not allowed in a WP7 device while connected to computer. Which means that you can't really use the computer's internet connection to do much useful things. But if your WP7 device is unlocked then you can use WPHack to enable media access while connected to computer and that make it possible to use your WP7 device as normal internet connected device where you can download anything, store it in phone storage and as such. It also allows you to update apps/ install new ones from marketplace/ download stuff from internet via various apps. In short, it makes your ...

Using Qwt Plots: more functionality in the app

Image
Added some more functionality. Now we can see the source and the prediction graph on left side. On right I'm showing the filtered results. The algorithm is still a bit whacked up, but the UI does look good. The additions were: Stylesheets for styling the groupbox and the graphs - canvas and curves. I also used QPens to make the curves look better. Also added a checkbox for providing anti-aliasing. It doesn't look that good on current graph but if there's a simpler graph then that may benefit from anti-aliasing.

Using Qwt plots

Image
I wrote a small app for stream processing some data. This is the front-end which shows a stream of data (simulated as of now ) and plotted in a qwt plot on the right. This in itself is not the important thing - that's some logic I'm going to write to filter the data. But this form helps me in visualizing the real thing.

Experience creating and deploying Hello world app for windows phone

Recently I unlocked my Samsung Omnia W which I previously upgraded to WP7.8 using Heathcliff's unlock for Samsung second generation devices. Afterwards I got hold of some xap's and deployed them to the phone to test out the unlock and things worked out quite well. Thus now I have a device that I can code for and put my code in. So just to test the development environment I tried installing the SDK and coding a simple Hello World app for my wp. There I ran into a few problems and I had to run circles to find solutions / workarounds for them. The first problem was I had WP7 sdk which is incompatible with Windows 8 (which is my current desktop OS of choice along with elementoryOS). So after looking at a few workarounds for the incompatibility which involved downloading a few update packages and messing with the system. I discarded them since I didn't want to mess with my Win8 installation which is already finicky enough. So I decided to keep the existing WP7 SDK install si...

xev to check xinput events

xev is a utility that draws a window on screen and processes all events occurring in that window like mouse in, mouse out, mouse move with screen coordinate output. Very useful when checking touchscreen input values.

CentOS installation in GUI mode to a terminal where you get only text mode

To get GUI mode over vnc, you need to edit the first option and append "linux vnc vncpassword=qwerty" to the line and boot using that. This will basically start a vnc server on the terminal and you can login to that machine using any vnc viewer with "qwerty" as password. The need for GUI mode maybe anything - e.g. advanced partitioning options which are not available in text mode.

Samsung Windows Phone Diagnosis App

Samsung ATIV S (Also work on Samsung Omnia W) ##MFG# displays (and installs) the "Diagnosis" app. ##3282# gives many alternatives to edit/read on another user's GT-I8750 Lots of options [from ##3282] on my SGH-T899M as well (different model ATIV S) Install diagnosis app via ##634# code and you type 3 digits starting with 15 (last digit doesn't matter) you will have access to hidden test menu... For example we can view Samsung ROM version (mine is I8750XXAMC1) Unfortunately [the user] couldn't take a screenshot while viewing that menu. Here are some codes for ATIV S, these are intended to be inserted in the Diagnostic Dialer Imei Number Prompt: *#06# Screen and vibration test menu: *#0*# Battery test menu: *#0228# Firmware version prompt: *#1234# FTA SW Version menu: *#1111# FTA HW Version menu: *#2222# FTA HW Version menu: *#8888# FTA SW Version menu: *#9999# Basic information Testmode menu: *#0011# Vibrations test menu...

Ducky

Ducky is a small project showing a duck picture and moving it around the screen. Link to File

Public - Private key encryption using OpenSSL

Original Link:   http://www.devco.net/archives/2006/02/13/public_-_private_key_encryption_using_openssl.php Public – Private key encryption using OpenSSL 02/13/2006 Sometimes I need to encrypt some stuff but do not want to install PGP or GPG . I typically use OpenSSL for this kind of thing and have written a simple frontend script to achieve strong password based encryption using OpenSSL. Sometimes you need public / private key encryption though, below will show you how to do it using just OpenSSL. Public/Private key encryption is a method used usually when you want to receive or send data to thirdparties. The system requires everyone to have 2 keys one that they keep secure – the private key – and one that they give to everyone – the public key. Data encrypted using the public key can only ever be unencrypted using the private key. This method of encryption that uses 2 keys is called asymmetric encryption. So by example if Person A want t...

[LINK] OpenSSL tutorial

http://shanetully.com/2012/06/openssl-rsa-aes-and-c-oh-my/

Hello World

Syntax Highliter in Use // understanding call-by-value vs call-by-reference #include int f1 (int, int, int); int f2 (int&, int&, int&); int f3 (int, int&, int); void main () { int i, j, k; i=1; j=2; k=3; cout

[Article Link] Publish Source code in Blogger

http://oneqonea.blogspot.in/2012/04/how-do-i-add-syntax-highlighting-to-my.html

Refactoring n configuring

We have a set of scripts in one of the products in my current company. I have been maintaining them for last six months. They are simple scripts which perform some routine maintenance task like logging etc. So I have been steadily improving them and adding more options and hardening them. But I wasn't able to spend some considerable time and finish them off with some real world unit testing and accompanying documentation with guidelines for use in various scenarios. I finished this big task this week. I have made considerable changes to make them very configurable so that they can be used in one of 7-8 possible use cases with minimal amount of changes. I also added logging capability and fine tuned it. That was a feature we were jn sore need of having. The logging capability will let us perform statistical analysis based on the logs. Overall this was the one great task of the week. On the documentation front I have created a standard document which depicts all the scenarios i...

And I thought Qt's documentation was average

Till I encountered OpenSSL!!!

Upload files to a FTP site via batch script

http://www.howtogeek.com/50359/upload-files-to-an-ftp-site-via-a-batch-script/ Original Script:     @ECHO OFF ECHO Upload to FTP ECHO Written by: Jason Faulkner ECHO SysadminGeek.com ECHO. ECHO. REM Usage: REM UploadToFTP [/L] FileToUpload REM REM Required Parameters: REM    FileToUpload REM        The file or file containing the list of files to be uploaded. REM REM Optional Parameters: REM    /L    When supplied, the FileToUpload is read as a list of files to be uploaded. REM        A list of files should be a plain text file which has a single file on each line. REM        Files listed in this file must specify the full path and be quoted where appropropriate. SETLOCAL EnableExtensions REM Connection information: SET Server= SET UserName= SET Password= REM ---- Do not modify anything below this line ---- SET Commands="%TEMP%\SendT...

OpenSSL vs the Me

I have been working on openSSL integration for some time. And its been quite some experience. I knew openSSL by name only. I was aware of SSL certificates - you know how sometimes things fail when you get some invalid certificate error. So I have learned a lot about both OpenSSL and authentication. I have also learned about public key encryption. But this has not been easy. I got stuck at almost every step. The problem was OpenSSL looks easy to use and as long as you are generating some certificates and using them with your web hosts. Look towards integration with existing software and then you need to take some easy chill pill. Basically I didn't even wanted to touch openSSL. I wanted to use Qt's inbuilt openSSL support and be done with it. But the requirements changed midway and Qt just couldn't extend far enough. I tried everything till inheriting QSslCertificate but it just wasn't designed to serve our requirement. So after going through some OpenSSL research ...

something nontechie - this time it's about vegetables...

You will find here alphabetical list of all vegetables used in indian kitchen along with their names in English and Indian languages, Hindi, Marathi and Kannada. This a list of culinary vegetables . That is, some of these are actually fruits but are used as vegetables. So they are included in this list. We are still adding to this vegetable list. Please let us know if we have missed any vegetables using the comments below or our comment form. Thank you in advance. English Hindi Marathi Kannada Ashgourd Petha Kohala Budkumbalkai Artichoke Hathichouk Aubergine-Eggplant -Brinjal Baigan Baingan Vangi Badnekai Banana-raw Kachcha Kela Kachchi Keli Balekai French Beans Farasbi Farasbi Hurlikai Beans - Runner Farasbi Farasbi Hurlikai Beetroot Chukandar Beetroot Beetroot Bell Pepper/Capsicum Simla Mirch Dhobli Mirchi Donmensinkai Bitter Gourd Karela Karle Hagalkai Bottle Gourd Lauki - Kaddu - Doodhi ...

Boot a USB Flash Drive in VirtualBox

Image
Original URL: http://www.pendrivelinux.com/boot-a-usb-flash-drive-in-virtualbox/ Here, we show you how we booted from a USB Flash Drive in VirtualBox. This process will allow you to run your Portable Linux from the USB Flash Drive or external hard drive while still running from Windows. By default VirtualBox does not support USB Boot. However this is easily attainable by mapping a virtual machine to the USB Drive. VirtualBox Website : http://www.virtualbox.org How to Boot from a USB Flash Drive in VirtualBox Download and Install VirtualBox (Install to the default path) Click Start > Run Type diskmgmt.msc and click OK (In Vista/Win7 use the Start > Search Box) (1) Locate your USB Disk # Open a command prompt cmd.exe (run as admin in Vista/Win7) Type cd %programfiles%\oracle\virtualbox Type the following (replace # with your USB Disk number from step 2) VBoxManage internalcommands createrawvmdk -filename "%USERPROFILE%"\.VirtualBox\usb.vmdk...

Dependency walker

Dependency walker is a great program that tells you what dlls your windows program is using. So you can ship your program with only those dlls and not need to carry a number of unnecessary files.

SDM - SATA disk module

For last few days I have been working on a SDM based system. The goal was to setup a lightweight system with a SDM instead of a SATA hdd as main storage. The concern was that the SDM is supposed to have write failure protection. This will prevent data corruption in case of power failure. The SDM was an apacer module and was of 4GB capacity. As I had worked on such small scale systems the task of installation and configuration was handed to me. The installation was straight forward. We were going to start with a minimal CentOS Desktop and add extra packages as per need. So to safely test it I started with a 4GB virtual machine in VirtualBox. I installed CentOS in it and that took about 1.6GB of available space. Next I put a minimal QT and QWT library package plus our Client software on top of that. This consumed about 300 MB of more space. Finally I installed PostgreSQL v9.1 as required. This took another 180MB after creating the empty databases etc. Later I installed telnet, vsft...

Fixing Turbo C in windows 7

There's a FIXED version of tc floating around in the net and for general programs it works well. But one of my friends being an adventurous soul wanted to try some graphics functions and the program wouldn't run. The error was related to the path to the BGI files. The problem came to me and I remembered this being caused by the c:\Program Files location of turbo c folder. So I had him copy it to C drive and modify the path accordingly. With updated path the program stared working and a circle appeared on the screen. Made me recall my own college days.

GPS run/cycling trackers

I have wanted to track my exercise for a long of time. But I don't exercise that much - couple of long walks a week plus some aerobics. So I really was being lazy at it. But I've decided to up my efforts and so I was looking for an app that would help me keep track of my efforts and the amount of distance I passed on and the speeds etc. After going through the measly no of such apps on my WP Omnia, I stumbled across "run the map". And after using it for a few times I think it's a great app for tracking your exercise. The main interface is divided into 3 pages - first page shows Recorder i.e. speed, distance and elapsed time. This page also has start-stop button as well as exercise selector. Below these, we get current values for speed and altitude. Next page is maps which shows your real time path updated at regular intervals. The last page is mixed mode where you get to see both the map and recorder values. Also available are features to export GPX or KML fil...

Batchgeo.com

A nice website to let you put people on map.

Very interesting discussion

I was searching for a decent way to kill hung jobs and stumbled onto following discussion: Orig URL: http://superuser.com/questions/49024/kill-9-programs-but-they-still-hang-on It's very informative! --------------------------- A: I tried to kill all my background jobs submit earlier under KUbuntu by kill -9 $(jobs -p) Although this command immediately gave the message like [1] Killed myjob1 [2] Killed myjob2 I can still see their processes hanging in the output of top and the CPU and memory usages are not changed in the output of uptime and free. So I guess I must have not killed them properly. Can someone please explain what's happening to me and what shall I do? I found that in top, if type k and input the PID I can kill the processes one by one. SO is this different from the command kill? I also found somewhere online http://www.ruhr.de/home/smallo/award.html about not recommending kill -9 Useless Use of Kill -9 form letter (Quote abomina...
Image
One line of code made so much change! this->setPalette(QPalette(QColor(rand()%255,rand()%255,rand()%255)));

Image Processing

Image
If you are familiar with image processing textbooks and articles, you must have seen the following picture: Following is an extract from the comp.compression FAQ : For the curious: 'lena' or 'lenna' is a digitized Playboy centerfold, from November 1972. (Lenna is the spelling in Playboy, Lena is the Swedish spelling of the name.) Lena Soderberg (ne Sjooblom) was last reported living in her native Sweden, happily married with three kids and a job with the state liquor monopoly. In 1988, she was interviewed by some Swedish computer related publication, and she was pleasantly amused by what had happened to her picture. That was the first she knew of the use of that picture in the computer business.  A scan of the original Lenna from Playboy is available from: http://www.lenna.org The editorial in the January 1992 issue of Optical Engineering (v. 31 no. 1) details how Playboy has finally caught on to the fact that their copyright on Lena Sjooblom...