Monday, 24 October 2016

Advanced Linux Commands

Here are a few linux commands that are pretty useful. However no one every bothers teaching you these commands. However, here at Programing Wonders we never leave out such awesome stuff. Like how to create this:

whiptail to create password box






Friday, 7 October 2016

How to Dive into Android

Introduction


How to  begin android programing
Android Programing
Recently I dived or rather scuba dived into android. Around three months ago I knew practically nothing about android as far as app development was concerned. Just installing Android Studio on Ubuntu seemed a daunting task. Once the installation was done, looking at the interface of android studio kind of scared me. Around 30 days of resource and knowledge gathering  and I was good to go. 60 days latter I had written a entire app having an interface as good as Whatsapp, OCR and database. In case, you wish for the code, it will be released soon.

Saturday, 10 September 2016

Execute Commands at a Specific Time in Linux-"at"

The other day I was reading about Reliance Jio Offers. Most of their plans come with limited data, but during night times you get unlimited usage. The catch is that night time period is only three hours 2:00 am to 5:00 am.

Unless you are either nocturnal animal like an owl, or a bi-phasic / polyphasic sleeper this implies that you cannot use the unlimited night time benefit. While this might be the case for an average user but for expert users(people who read my blog :-P) this is no problem.

Guess what Linux offers multiple ways to solve this problem

  1. Cron : Read about this yourself. I will not be covering this in the current article. This is more suitable for recurring jobs.
  2. At: The at command this is more suitable for one time jobs. This will be covered in this article.
Android also offers this facility. You might need to have root access for this though. I have covered this in one of earlier articles about Tasker.

Ps: I have no knowledge about IOS, Windows , or Mac platform pertaining to this automation issue. So go figure it out yourselves, in case you are using one of these platforms, leave a comment below explaining how you did it. And I will create a new post for the same.

Wednesday, 7 September 2016

Identify Mobile Operating System using Python and ADB


Q:Write a Python/Java/C+ program to verify the operating system name and version of Mobile devices.


Note: This program will only work for android devices. (Since Iphones do not have anything equivalent to adb. )No wonder android is the favorite platform when it comes to app development. Android market is also more developer friendly as compared to its ios counterpart.

Errors: In case you get an error about insufficient permission, either edit udev rules or borrow a phone from your friend, having a well known global manufacturer.

OS:Fedora 20 64 bit
Phone: Sony Xperia
Language: Python
Dependencies: Just adb package,No need for sdk
fedora:               <yum install adb>
ubuntu:              <apt-get install adb>

Friday, 2 September 2016

Common Logical Errors in C and C++

Today I spent over two hours discovering this stupid mistake in my code.
a=a++;
Thus I came up with the idea to make a cheat-sheet for common programing mistakes. I hope this is useful to you during your practical exams preparations, debugging times and coding competitions. In case, I have not mentioned one of the mistakes that you make just leave a comment and I will add it.

Thursday, 1 September 2016

Mondo DB with Java for processing Images


Q:Use MongoDB to process semi structured and unstructured data collections such as Rfid, images, blogs use python/Java MongoDB interface.

Testing Environment


Mongo DB version : 2.6.3
Network : switched LAN(Ethernet)
IDE: Eclipse (Java EE)
OS: Fedora 20 (64 bit )

Finding primes in a range of numbers

The fastest way(yet easy to understand and implement) to test a prime number is Rabin-Miller Prime Test. However, it suffers from two issues:
  • It is suitable for a single number
  • It may give false positives
When it comes to finding primes from 1 to say 10^6. This method is not suitable. Since this method doesn't use any previously generated information. So the program will end up testing each number.

Sieve Algorithm on the other hand, uses previously generated results and works faster when determining the primes in a range.

Here is a code snippet for the same

Friday, 26 August 2016

SQL with JDBC

Q: Design at least 10 SQL queries for suitable database application using SQL DML statements:
Insert, Select, Update, Delete Clauses using distinct, count, aggregation on Client-Data sever (three tier).

Use Python for Socket Programming to connect two or more PCs to share a text file.

Os: Fedora 20
Network: Switched LAN(Ethernet)

Note: Program fails to work on Local Area Network. Program works flawlessly on localhost.

While this script works perfectly fine on loop back ie on the same machine, it fails on networks.For some unknown reasons I havent' been able to get this script running of a local network consisting of fedora linux machine despite tweaking with the firewall. I don't get much time to work on local networks and am currently busy with some other endeavors.