Category Archives: another snippet | code

Code/Uncode Discussion Posts

“The Library” is here

“The Library” is a collection of several popular encyclopedias. It is your one stop for popular game guides and TV show trivia. You can search, and bookmark articles from various encyclopedias. What’s more? Each time the app is launched, it displays a random featured article from the encyclopedia you last viewed! Explore more about your […]

CardBox – Personalize a card for every occasion

We[the CardBox developers], have recently launched a brand new app, CardBox, which allows you to create and instantly share greeting cards for almost any occasion! CardBox allows you to create cards for the following occasions currently: Birthdays Anniversaries Christmas New Year’s day Valentine’s day Women’s day Mother’s day Father’s day Parents’ day Grandparents’ day Halloween […]

How to get a File object of an Android raw resource using reflection

Context: You have a URI to a resource which is placed in the raw directory inside the Android resources directory, res.┬áSay you want to take that raw resource(let’s say it’s an image) and add it to an attachment using FIleBody to a MultiPartEntity. Both these classes are available in the Apache HTTP Components library. FileBody […]

Calculate the REAL scale factor and the angle of rotation from an Android Matrix

After performing transformations such as rotation of a bitmap about an arbitrary point, the scale is lost. Of course, this makes sense because the bitmap is rotated inside the same bounds. To get the real scale now, along with the most reliable degree of rotation, I had to follow this method. Hope it saves the […]

Multi Touch in Android – Translate, Scale, and Rotate

Here’s a quick and easy implementation of Android’s multi touch feature – one finger to move, two to zoom, and three to rotate the image. Assuming you have a basic understanding of 2D matrix transformations, the Matrix class in Android uses a 3×3 matrix to achieve all of the 2D transformations. The source code and […]

recursive get from an FTP server

As we all know, downloading a directory from an FTP server over FTP over the command line is not possible. Some, have found mget to be the holy grail, I certainly do not. I was restoring my music backup from my NAS, and I didn’t want to do it the GUI way, so CLI is […]

SEED hits the pit again #iknowvention

SEED continues to make mistakes. So is today’s challenge: #include int main(int argc, char *argv[]) { printf(“%d”,4["seed"]); return 0; } The answer for the above is 0, as the fourth element in the array “seed” does not exist. This is because of the index value, which starts from 0. Had it been 3, then it […]

SEED makes Blunder! #iknowvention

Alright, so I’m taking part in this SEED Infotech C programming contest, and here’s one of yesterday’s challenges: main() { if(printf(“C for yourself how it works \n”); main(); } One of the options were a) C for yourself how it works infinate times Now isn’t that catchy? Look at it clearly, there’s one pair of […]

/usr/local/bin/waitpid

A quick script to wait for a certain pid, then once that quits, execute a command. You may ask, why not just do command1 && command2 ? Well, if command1 exits with a non-zero exit status value, command2 will not get executed. Hence, I’ve brewed a quick script for this purpose. File: /usr/local/bin/waitpid #!/bin/sh # […]

Coloured /var/log/messages at tty12

Reading logs could never become any more easier, at just a keystroke, you have your logs displayed where you want, in some fancy colour. They look great too. TTY’s can be accessed by pressing Alt + Ctrl + F[1 - 12] simultaneously. In the following, you’ll get a decent, colourized log display of /var/log/messages when […]

QEMU | Quick Networking for TCP/UDP

Networking with a guest in QEMU is often a headache, TUN/TAP, seriously? Too hectic, let’s stick to the basics, TCP/UDP based. Instead of setting up a really complex set of configuration files, wouldn’t it be easy to just emulate the network card, DHCP the guest, and let it work right out of the box? Well […]

visual basic 6 revisited – linux – wine

Earlier this year, I had written an article on running Visual Basic 6 on linux under wine, this is an update for it, the prior one is depreciated Getting Visual Basic 6 to work on linux is pretty easy, not much trouble, all the basic things work, as of what I’ve tested. Here’s how you […]

embedded gentoo [uclibc] | nothing beats this

A few uclibc embedded gentoo facts: the compilation of the box takes around 15 minutes at boot up, takes less than 3 megabytes of RAM disk space: 17 megabytes boots in under 8 seconds on a pentium3 link to stage3 tarballs archive # this is my make.conf, it should be the same in the stage3, […]