Posts

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...

Additional Drivers in Ubuntu 12.10 Quantal Quetzal

Image
Ubuntu 12.10 Quantal Quetzal was released day before yesterday and I happily upgraded my laptop. I have Nvidia graphics card on my laptop and was using proprietary Nvidia drivers. But the upgrade replaced the driver with Nouveau open source driver. The only problem was it made my laptop horribly slow and Unity wouldn't work displaying only black or red and nothing. It took some struggling to find out that it wasn't using Nvidia driver but once I knew this it was very easy to enable it. Open 'Additional Driver' and choose Nvidia right? Wrong. There is no program called additional drivers. Hmm, it was renamed from Hardware drivers or something like that so maybe they renamed it back. There must be a team of people on Canonical who doesn't have any significant work and only make bullshit changes. But no there is no hardware drivers either. So after going to applications on unity and clicking more suggestions I found 'Additional Drivers'. I was installing it ...