Posts

Essential adb Command Examples

Copy file to your Android device from your computer adb push    - copy file/dir to device example: adb push c:\mygame.apk /sdcard Copy file from your Android device to your computer adb pull    - copy file/dir from device example: adb pull /sdcard/mymovie.avi c:\downloads Install app from your computer to your Android device adb install [-r] [-s] - push this package file to the device and install it                                  ('-r' means reinstall the app, keeping its data)                                  ('-s' means install on SD card instead of internal storage) example: adb install c:\mygame.apk Uninstall an app from your Android device adb uninstall [-k] - remove this app package from the device                     ...

Breaking Up With Ubuntu

Image
After using exclusively for more than seven years, I'm breaking up with Ubuntu. I got a new laptop, turned it on, got rid of Windows, installed Ubuntu and fast forward a week I'm still struggling to set up the video driver and audio driver. My clients are tired of waiting for my computer to get fixed, emails have started to pile up, and at this moment I remember the statistics of Linxu being popular among college students only. I've listed several bugs here which have been haunting me, but none of these is the reason for giving up on Ubuntu. Every software has some bug and, with time they will get fixed along with welcoming new ones. I'm giving up on Ubuntu because of the change in vision of Canonical. They are trying to do everything that any other big companies are doing, Ubuntu one, Ubunt Phone, Ubuntu tablet etc. This is fine, but you need to have a solid foundation beforehand you start experimenting with other products. Ubuntu on a desktop is not perfec...

Logging Handler With Buffering And Uses Amazon SES For Python

This Python logging handler can be used to combine multiple log message in one email message and send the log email using Amazon SES . Boto is used to send email using Amazon SES. Email will be send once the buffer reaches the capacity you've specified. To force send the email before it reaches the buffer capacity you can shutdown the logger by calling its shutdown method.You can simultaneously keep logging in file or other places by adding more handler.

Fake SMTP Server For Development

Image
This fake SMTP server comes handy when you have to do development which requires sending hundreds of email. This will act as an SMTP server but doesn't relay emails but saves them in a file in predefined location and also display the emails in the GUI itself as they comes. This is cross compatible Java jar file and can be launched easily by typing: java -jar fakeSMTP.jar after downloading it from this website.

Fix Bad Distorted Audio And Sound In Geanymotion

Image
Geanymotion is a great product. As soon as I knew about this, I've been using this for my Android development. One problem bothering me was the audio and sound coming from Geanymotion was totally bad and distorted. Not only that any sound playing in my computer would get distorted for few seconds when sound was playing in Geanymotion. Turns out Geanymotion was using Alsa instead of PulseAudio. To fix this: Open VirtualBox. Yes not Geanymotion. You'll see list of all the Android devices you've created from Geanymotion here. Click on the Android device you want to fix and click settings. Go to Audio tab in settings. In Host Audio Driver change from Alsa to PulseAudio. Press OK to close the settings. Repeat this process for all Android devices. Now run your Android device normally from Geanymotion and you should hear problem free perfect audio.

Skype doesn't start

On Ubuntu 13.04 my Skype refused to start. Maybe something went wrong while trying to install driver for ATI Radeon 7730m graphics card. So the first thing to do to troubleshoot is to try, to run Skype from terminal. Open terminal and type skype and press enter. If you get the following error: skype: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory Then run the following command in terminal again and this should fix Skype not starting problem. sudo apt-get install --reinstall libgl1-mesa-glx:i386

Slice Bitmap Image In Android

With this simple function you can slice one bitmap image and return array with the sliced images. Just pass in the bitmap you want to slice and number of rows and columns you want it sliced into. public static ArrayList GetSplittedBitmap(Bitmap picture, int numRow, int numColumn){ ArrayList imgs = new ArrayList (); int pieceHeight = picture.getHeight()/numRow; int pieceWidth = picture.getWidth()/numColumn; for(int i=0; i for(int j=0; j imgs.add(Bitmap.createBitmap(picture,j*pieceWidth,i*pieceHeight,pieceWidth,pieceHeight)); } } return imgs; }

Number System Conversion

Convert numbers between decimal, binary, octal, hexadecimal or any other number within base 2 and 36.

Interview Question

Problem: For a given pyramid find out the largest possible sum of numbers while travelling down from the top. ======================================================================== EXAMPLE 1: 1 2 3 4 5 6 The possible routes going down on this pyramid would be 1+2+4 1+2+5 1+3+5 1+3+6 ANS: 10 ======================================================================== EXAMPLE 2: 1 2 3 4 5 6 7 8 9 1 The possible routes going down on this pyramid would be 1+2+4+7 1+2+4+8 1+2+5+8 1+2+5+9 1+3+5+8 1+3+5+9 1+3+6+9 1+3+6+1 ANS: 19 Solution in Python: #!/usr/bin/env python # -*- coding: utf-8 -*- def findMaxHeight(items,pyramidHeight):     '''     This def returns the greatest path.     Logic:  From second last line for each element find if its left or right child is greatest.             Replace that element with sum of that eleme...

The dark side of catch all

Image
I use my own domain for email service which uses Google Apps For Your Domain . I had almost 0% spam in my mailbox. For this I used variety of approaches like: Mailinator: I've been using Mailinator from a very long time for signing up for any non important website. After webmaster became aware of popularity of mailinator they began blocking Mailinator and its affiliated domain for signup. After that I setup my own mx record to work with Mailinator . You can also use anything@extra.roshankarki.com.np and check your email at anything.mailinator.com . If you haven't realized yet anything, can be literally anything. The only problem with this method is you can't use this with more personal website. The + trick:  The beauty of Gmail is that you can add anything in your email address username part by adding +. So whenever you've to signup for websites you can use email address like username+newwebsite@gmail.com . If you start receiving spam on  this ema...

Cool CSS tricks

CSS to turn everything in website upside down: body { -webkit-transform: rotate(180deg); transform: rotate(180deg); } CSS to blur everything in website for every 30 seconds body { -webkit-animation: blur 30s infinite; } CSS to spin everything in website body { -webkit-animation: spin 5s linear infinite; animation: spin 5s linear infinite; } CSS to flip all images of website img { -webkit-transform: rotate(180deg); transform: rotate(180deg); } CSS to change font of everything of website to Comic Sans  body, p, body p, body div p { font-family: 'Comic Sans MS', cursive !important; } CSS to spin all images of website  img { -webkit-animation: spin 1s linear infinite; animation: spin 1s linear infinite; } CSS to hide second paragraph of a website p:nth-child(2) { display:none !important; } CSS to change cursor of website to wait permanently  html { cursor:wait !important; } CSS to hide t...

Earthquake alert in SMS or Email

Image
Not everyone can afford Earthquake alarm. But something is always better than nothing. Even if you don't have earthquake alarm you can use this method to get quick SMS/email alert after an earthquake comes. Go to  https://sslearthquake.usgs.gov/ens/ and you'll be greeted like this. Here sign up for the service after which you can configure your alert, i.e. choose which location you like to receive alert for and what magnitude of earthquake. From now on right an earthquake you'll receive an email. In the screenshot above you can see that I got SMS after an earthquake of more than 5.0 in magnitude for my country Nepal. To receive SMS, in the email form use +977yourmobilenumber@sms.ncell.com.np, if you're Ncell user from Nepal. For Nepal Telecom user go to nearest shop and buy yourself a SIM card with better service i.e. Ncell.

aTorrent - Best Android Torrent Client

Image
Most of the time there is no electricity in my Country. I am using that time to watch movies on my phone. It is easier to run phone and Wi-Fi router on battery backup than the computer so I started searching for best torrent client for Android phone. My verdict is aTorrent . aTorrent comes in three versions: 1) Free 2) Pro 3) Beta . So this matches rich set of audience. The client itself uses beautiful Android Holo Light theme. Features The must feature that makes this the best torrent client for me are: Download on Wi-Fi only Download only when external power is connected Speed limit Rich notification Easy, beautiful and rick UI Apart from these, the app  comes with: * Torrent search dialog * Magnet links support * Open torrents right from browser * Add torrent from file * Choose download folder * Partial download (choose files from torrent) * Multiple parallel downloading *  Supported protocols: BitTorrent P2P, DHT, Advanced DHT...

JSP and JAVA Project For IT Students With Source Code - 2

Image
Exam Management Information System Exam management information system is a technology from where a successful exam can be conducted. This system allows an examiner to create exams by creating questions first or assigning already defined questions. After that an examiner can create examinee and assign the created exam to him or her. The examinee can login with provided login details and give exam in allocated time period. After that the result will be processed and saved permanently in database. This system will be very useful in any place that conducts exam. Such place can be school, college, IT institutes, educational institutes, job hiring and son on. The questions, exam and examinee are all different entity in this system. Thus they can be easily edited, removed or created without depending on another. Hence, removing an exam won't remove already defined questions from the system. Objective of the Study High-speed response for users. Easy to handle and flexible. ...

JSP and JAVA Project For IT Students With Source Code

Image
Website visitor analyzer Website visitor analyzer is a technology from where a webmaster can see the performance of his website. Website visitor analyzer can be installed in existing or new websites. After that, the software will start monitoring web stats like visitor’s number, country, IP, browser, screen resolution and son on. Website visitor analyzer is analyzing software, runs on web server and tracks the website performance. Any website gets numerous visits which are all unique in terms of IP address, user’s browsers properties like screen resolution and constants like date and time and so on. When a user visits a site, the server can know about all these properties. In addition, the website visitor analyzer also support public viewing of the analysis and allow creation of user who can have limited access to the analysis, i.e. they may be able to see only a particular section of the software. Objectives of the Study To equip graduate students with an integrated se...

Fixing the unbroken: Google Plus Comment System

Image
If I were to do something about Google Plus Comment system I'd do the following. Before talking about doing something the factor that I find missing in the Google Plus sharing and comments system is integration. I share a video on Youtube, Youtube has it's own share of comments and the share on Google Plus has its own. I'd replace the comment system from Youtube, Blogger and all other Google platforms with Google Plus. Whenever one shares a video or other items, the comments will also get included. So the video and comments will act as one entity rather than separate ones. Like Disqus , I'd add these tabs, Recent Best Worst Current Popular Your Share Your Circle The first four are self explanatory. The fifth tab, "Your Share" will show only comments generated from my share. And the sixth tab, "Your circle" I think is the best one. This will show the comments from all my circles or the circle I choose. It would be nice to encounte...

Easily Hack Android Games With GameCIH

Image
GameCIH allows you to modify variables of any program you are running. Because of this power many gamer uses this program to increase their score, coins, gold coins, high score, money, level, HP and so on. Only requirement to this simple  yet powerful program is you need to be rooted. The reason you can guess is Android doesn't allow one program to modify other program's value directly. I'll be using this game Hill Climb Racing  to increase my coins level from 100 to 99999999. First let's  download  GameCIH from its website and install and open it. After that let's install/open the game "Hill Climb Racing". As you can see in the picture below I've only 100 coins. The small gray rectangle on top left is GameCIH in minimized mode. We can click that rectangle to bring the full menu. We can click the "Up/Down" arrow to move the menu on different parts of the screen. I've moved it to bottom to easily see the coin numbers. N...