Category: another snippet | code
-
Download your Coursera lectures using JS, bash and wget
So, in light of recent events, I was unable to follow up on my Coursera Algorithms course. Trying to find a way to download all the lectures at once, I couldn’t find a way that worked for me – I found two, but they simply didn’t work. With the help of some JavaScript that I…
-
“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…
-
Uncyclopedia App for Android – On GitHub
| androidI’ve decided to open source the Uncyclopedia app for Android, which some of you may remember was available on the Play store during the first quarter this year. Browse the code on GitHub. The source code is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
-
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
| androidHere’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 #…
-
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 deprecated 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…