Pages

Thursday, November 22, 2012

Android: Understanding Intents and starting activity from it..

Basic understandings of Android Intents and starting activity from it..
....................................................................................................................


Toast and its simplest work to show the text:

Toast.maketext(getActivity(),textview.getText().toString(),Toast.LENGTH_SHORT).show();


Starting Activity:

>startActivity(i); //if i is a defined Intent object already;
>startActivity(new Intent("name of the class from manifest.xml");
>startActivity(new Intent(this, "name of the java class");


Intents in Android and its invocations 

1>Intent i = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse("http://website"));
startActivity(i);
2> Intent i = new Intent(android.content.Intent.ACTION_VIEW);
i.setData(Uri.parse("http://website"));
startActivity(i);
****************
Uri.parse can take values as such to be shown:
Like :>
geo---for map application or activity;
tel--->for telephonic activity
http-->for web browser activity
****************
3>For default action or dynamic data:
  Intent i = new Intent(android.content.Intent.ACTION_PICK);
  i.setType(ContactsContract.Contacts.CONTENT_TYPE);
  startActivity(i);
  
  Intent can contain the following information:
    >Action
    >Data
    >Type
    >Category
 >To choose from options..
 add:
    > category in the manifest file:
       eg.       and 
       add in the main java file
       as 
       Intent i = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse("http://webaddress"));
 startActivity(Intent.createChooser(i,"choose");

Tuesday, September 25, 2012

Why study of algorithms are still very important in computing

Algorithms is the mother of computing science(If Mathematics is the father!!). The very first concept of computing was the algorithm on which depended the first simple operations and all that followed.
             Yes, it was algorithms which preceded all the fancy big and small systems and electronics that has enabled us to visualize  all the fascinating results it yields according to it. 
Derived from the name of Al Khwarizmi, the great mathematician who invented algebra, it lays down the basic step of realizing the solution to any problem being dealt. One great thing about it is that it involves all the mathematical details of the problem and gives a worthy information about its speed and space complexity. And hence, it provides a summative look on how the problem is going to be solved and all its estimates for the operation.
A great thing one might want to know is that "Good algorithms are better than  Supercomputers".
 It may seem rather dubious but the fact is it holds true. Over the last 5 decades many new techniques and theories have been playing around, like we have better than ever memory chips and processors, yet, a good algorithm can make a turnaround and make a simple PC do what a supercomputer can do. So its a thing of millions of dollars and work hours a good algorithm can reduce and make it happen. A simple example, the Quicksort can do sorting in an instant for a billion counts in a PC of what it would take years with Selection sort in a Supercomputer.
This is the beauty of a good algorithm and the miracle it can cause.

And again we may say that "Good algorithms are better than bad algorithms". This is obvious to follow as it changes a lot from all the space and  time complexity from one algorithms which has quadratic complexity to the one with logarithmic complexity. 

Study of good algorithms is very essential in computing sciences. It affects the design of efficient code which is a must ingredient for any good application. 

 

Saturday, September 22, 2012

How to compete online programming competitions


It so happened to me this month that I broke the final barrier of not being a rated member of Codechef and Codeforces. 
It has been a bit of time since I registered at both the reputed online programming platforms. Though I have been practicing some problems, still it didn't occur to me to make it a point when it came to the contests on this two sites- The coveted Long and Short contest of Codechef and regular contest for Codeforces.
About how I did....Nothing so extra ordinary because all it needed was just one thought and determination that "I had to do it this time..at all cost". It paid off and now I am rated in both the platforms. Its a small step yet it is a big leap because it makes me motivated in all that I do now and  yes, I can say that I am more confident now than I was and this will help me in doing better.

If there is anyone still not being a part of these things, I sincerely invite you to it. Not just that we can improve our skills but that it makes us motivated and learn a great deal which would otherwise take a lot more time and devotion. 

I would like to tell that all we need are:
>> Firm and solid knowledge of a programming language.
>> If not, then not stopping to learn one of it.
>> Never say die spirit, this will keep us moving and reach us to our goal.
>> Being interactive and active in all participations.
>> Just give a try...come on...do it..and you can(Believe this!!)

                To anyone with  passion of coding, it brings the joy of accomplishment and fire to burn for more as one goes on. Coding is not just about ending in a company. One who has the command over it knows it certainly well of what it is capable of and where it can take. One is never born without limitations or nor with all the trophies. Needless to say that hardwork pays.
 So happy coding!!!

Thursday, September 13, 2012

Machine Learning: Creating Efficient Intelligence


Advent of Machine Learning
 Artificial Intelligence has been used extensively in many applications over the last 3 decades. Areas of prime importance such as manufacturing, research, healthcare,finances and banking has been using AI on an extensive and intensive basis. 
    Over the recent years, researches has been conducted on the sidelines of AI to make its application much more productive. Things such as Data Mining popped up following the internet explosion and took a very pleasing growth proving its use in industrial scale applications. 
    One question has though  been asked since its inception:"Whether the machine themselves can be made to learn on its own?". This lead the researchers to conceive the idea of "Machine Learning",where the machine itself will learn from its own experience and derive appropriate action for a thing in future based on this, without having to write any program necessarily for the same. This almost seems to conjunct with the quest for building the ultimate the human-intelligent machine, but speculations are far from achieving that. 
Yet it may be said numerous application of machine learning has sprouted up today, powering many startups and giving invaluable services to many firms which would have been otherwise financially so burdening and time consuming.
Start ups like Predilytics are using machine learning algorithms to help the healthcare industry with its large data dynamics. Not just that, even more fancier applications can be made with this technique to the extent of multiple voice recognition and individual partition. Recently a Forbes column wrote of using machine learning algorithms to automatically generate contents of a book. 
Powered by Moore's law obedient,ever increasing memory power industry and the advancement in the processing techonology makes Machine Learning a potent technology of the future. The demand end has also been impressive with todays industries involving a lot of analysis and planning, it could make its growth quickly as anticipated.
Where career is concerned, Machine learning has indeed been 
listed as top skill in demand of the current times(computer world).

Sunday, July 15, 2012

Unable to open drives on double-click: How to solve it


Sometimes we get a buggy thing happening with us when most of our USB slots are filled up and we try to open a disk-drive by double clicking and we can't open except using  right-click options. 

Well, many post and many suggestions go for checking the virus-stuff in the USB drive providing links to many third party tools and other anti-virus options.
On the contrary of all these superficial tweets....I found my problem solved through a simple handling with the computer management tool for disk management.
Before jumping on to the steps for solving the problem, I would like to highlight that the main cause for this problem is due to external disk(s) connected with the system bus. Each disk drive is allotted a unique letter from C - Z. Sometimes due to multiple connection, there may perhaps be a collison for the names and the system cannot recognize them. So,it does not allow it to be open through d-clicking!

How to solve it..

You must be logged on as an administrator to perform these steps.
If you don't like the letter Windows has assigned to a new drive or you want to organize your drive letters in a certain way, you can change the drive letter.
You can assign the letters C through Z to each drive on your computer. A and B are usually reserved for floppy disk drives, but if your computer does not have floppy disk drives, you can assign A and B to volumes. You can see which drive letters are used on your computer by opening Computer.

Now do the following:

You can change, add, or remove a drive letter by using Computer Management.

>>Open Computer Management by clicking the Start button , clicking Control Panel, clicking System and Maintenance, clicking Administrative Tools, and then double-clicking Computer Management.  Type the password(If needed) or provide confirmation.

>>In the Navigation pane, click Disk Management(It can also be simply reached by right clicking  My Computer icon and selecting Manage).

>>Right-click the partition or drive that you want to change, and then click Change Drive Letter and Paths.

Do one of the following:

**To assign a drive letter if one has not already been assigned, click Add, click the letter that you want to use, and then click OK.

**To change a drive letter, click Change, click Assign the following drive letter, click the letter that you want to use, and then click OK.

**To remove a drive letter, click Remove, and then click Yes to confirm that you want to remove it.

Remember:

 MS-DOS and Windows programs make references to specific drive letters. If you change a drive letter, some programs that you have installed on your hard disk might not work correctly.

You cannot change a drive letter if the drive is either a system partition or a boot partition. If you get an error, the partition or drive you are trying to change might be in use. Close any program or window that is using the partition or drive and try again.
    Have a nice hack!!

Monday, June 11, 2012

Applications of Scala Programming language:


According to TIOBE index Scala stands at 34th position with 0.290% rating.However, it has wide and good applications built on it( The list though does not account for anything related to the quality of the languages listed..its just based on popularity).
  I read about Scala and was amazed to find out its varied and robust applications,,which is used in many popular applications of today).
  Some of the many are listed here:
  
  1>Twitter..this describes the best.
  ....Also Twitter uses Scala very robustly(as I learnt from this blog as of 2008). May be it has changed now.
  2>LinkedIn..this link describes the best.
  3>Novell ..See this link
  4>Foursquare...Know more from here.
  ......Foursquare is said to be built almost 100% using Scala(See this Quora link).
  5>UBS..and HSBC bank.
  
  Having said all these,,I will also like to add that Scala has two web frameworks developed, namely Lift and Play. Akka actors is good concurrency framework.Eclipse too has good support for it.
  Some more applications developed using Scala are given in the following links
  
  Take a look at Jonas Bonér's blog series beginning with Real-World Scala: Introduction
  And this link for real world applications too.
 On google code I found this out link. Its an  application written in Scala for language processing and I like it.
  
 Way to goo..

Thursday, April 12, 2012

LXML: Installation simplified


Its easy.., but sometimes it is troublesome with the installation of lxml module of Django. Here is the simplified steps to do it:


Step 1>Download easy installer from this link-(Ok!, if you have already), the "setuptools-0.6c11.win32-py2.6.exe" file.
or search-> easy installer for python.


Step 2>Download lxml.egg from this link


Step 3> To install,just type the following:
easy_install lxml.egg(this should be at the command window at the directory where lxml.egg lies->you can open command window by holding the shift key and then clicking on the right mouse button and then choosing from the context menu).


The easiest method:
download lxml.exe from here
and simply install it your way..!!

Tuesday, April 3, 2012

Pip and its installation on windows



The python software pip is a replacement for *easy_install*  .One may say it as a wrapper for easy_install, and indeed it is.
It is used mainly to provide installation for python packages.


First method:


Step 1>Download the last easy installer for Windows that fits your installed python version: (download the .exe at the bottom of http://pypi.python.org/pypi/setuptools ). Install it.
Step 2>Add c:\Python2x\Scripts to the Windows path (replace Python2x with the correct directory)
Step 3>Open a new (!) DOS prompt. From there run easy_install pip
For the 64 bit operating system refer to this link


Second method:
Step 1>Download the last pip version from here:       
Step 2>Uncompress it
Step 3>Download the last easy installer for Windows: (download the .exe at the part of   http://pypi.python.org/pypi/setuptools ). You can install it directly.
Step 4>Go to the uncompressed pip directory from the command prompt and type:
                     python setup.py install
Step 5>Add your python c:\Python2x\Scripts to the path
You are done.


Now you can use pip install package to easily install packages like you do in Linux :))

Friday, March 30, 2012

Directory navigation in command line: Tips and Tricks





 Well it may be absurd for someone who is not so used to with all the command line stuff that one has to undergo, but for the geeks, its the things that keeps using computing enjoyable and something Geekyy!!
  Some people really do not know and may be perhaps do not care for the command line interface commands.
  That's why I have wriiten this piece of information for all those who wanna keep the geeky thing up in themselves
           
1> To move to the next directory we use
     cd:\Destination_folder
2> To move to long  destination you can also type:
     cd:\folder1\folder2\......\folder-n
3> To get into a diferent folder at the same root level
     eg: pics and movs at c:\de\film
     and you are at 
      c:\de\film\mov  and you want to navigate to pics
   then type:
      cd../pics
4> To move back one step up to the parent folder 
    type:
        cd../
5> To move directly to the root folder
     type:
        cd /d drive_letter:\
6> To change drive cd /d drive_letter:\


  Hope it helps!
Adios amigos  

Django: A setup tutorial guide from A-Z

Django is one of the most commonly used frameworks for web development today. It can be used in multi functional large scale database driven web application. Though it was created mainly for the means of rapid development of web application, it has well proven on its account for reliability and scalability. So here I am going to share some of my experience during the set up process which many of us find awkward. Hope this simplified version makes it easy for you all.
Download:
                Download Django from www.djangoproject.com(get the latest and fail not to check out          which version of python it supports)
                Download Python- and this should be the one supported by the version which you     downloaded        
Installation:
 >Install python in your  machine 
 >Extract the tar file of Django you have downloaded
 >cd to the the folder you extracted and type the following:
    python setup.py install
    This will install all the required files in
               C:\Python27\Lib\Site-Packages\Django 
Now that Django is installed in your system, You can start creating projects.But before   that lets put the django-admin.py in the path environment variable of the system. 
So go to>MyComputer>Properties>Advanced System Settings>Environment


   Then go to down slab for system path and 
            click Path double times. This will pop up edit window and do the following there:
             >add a semi colon(;) and paste the following:
                                  C:\Python_version\Python.exe;C:\Python_version\Scripts;C:\Python27\Lib\site-packages\Django\bin;
            >to extpath add .PY
 and then hit ok button couple of times and close all the command window  

Project Creation: 
To create a project, create a folder say Djang in C:\ as 
     C:\Django-admin.py startproject project_name


********If it does not work here, checkout the following:*********
>Type regedit in run window
>Goto HKEY_CLASSES_ROOT>py_auto_file>command
   and change the current value to 
Now type ""C:\Python27\python.exe" "%1"%*" instead of the current value
and there you go...
   After that cd to the foldr of your project and 
 type:
         python manage.py runserver
 Check out the result by typing localhost:8000 in your browser. You should be getting  the same  as given below

Happy Coding!

Tuesday, March 27, 2012

Today,Tomorrow and Forever...

We humans,are the weakest and I would also say the wicked form of species of this great planet...
Filled with greed and everlasting hunger for selfish gains.
One thing I would like to share of what I have experienced  conversely is that there is also plenty of love around. May be that's why we still have families around. Surely without love being inherited , we would not have known how to give it to others.  And that is why we know love and how to give love. Though people term it as emotion, it is love and its commonness amongst all of us that make us able to thrive together.
Now, I had begun this post writing about greed and arguably decried the general conscience of our human mentality pointing towards greed. And yes this is true! we have love in all of us, yet greed seems to overtake our mindset as we continually try to adjust to the current economic scenario.
Recessions, job losses, rising food prices and all that modern corporate fallouts have indeed succeeded in making us rigid in our thoughts and actions setting up the greediest phase of this civilization.


The reason that I see for this is not that all of us had really liked to be in this  way. May be its our ambition and all those pressures we  conjure that makes us do so.
I think that greed is highly localised, got to do with situations that arises! 'coz a person may be corrupt for someone but may be a hero for someone else.


Generally speaking, when one confronts with a situation that softens our stand for justice, we tend to lose our grip over our emotions which tends to make us commit all those things.
 When things get limited, everyone goes for their own run, which is the major cause of greed and corruption today. In every situation this is the main cause for all the corruptive activities and greedy politics. One country is in race of getting what other country holds. And so is the same at every level of societal functionaries.


But like this great saying" The world has enough for everyone's needs but not enough for everyone's greed " , I think this is a workable thing which can be applied for all of irrespective of what we do and  how much we earn.
Needs based maintenance of our daily policy will greatly help to heal the problem we are facing.
And why not, we can do it, nothing is impossible!  

Thursday, March 15, 2012

Procedure, and the objective experience of Python

Assignment Operation( Its totally fun programming!)
                                           One more thing in python that fascinates us is its ability to hold the values of the variable even after assignment operation.
Like say:
              a=2
        b=a
This is bound to keep the values of both a,b intact without any change.
 so doing things like:
                                print a,b
                gives #a=2,b=2
And!!
           One more important thing to remember is sequential assignment: what I mean is assignment is sequential in its nature.
 So if we have things like:
                                      a,b=b,a
 then the actual assignment format takes place. The result will be
                                        a=b 
                       b=a
Procedures: The sword of every programming language
                Yes! its function in c and c++ , method in Java which are used for modular construction and abstraction of every program. In Python, functions or the procedures form the basis of writing  module. Lets take a look at  the module writing techniques . 
                          def function_name():
                   #code lines
                   #
                   
                  The novice awkwardness of python is its indentation of code blocks and absence of curly braces->{}. However with time  as one goes down the road, it can be said that it becomes fun and enjoyable with it.
Object Orientation......The face of higher language programming
                            Yes, now we are coming  to the point. It always begins with the already known Class thing. It is done in this way:
                              class class_name:
                      def function_name(self):   
                                                #code block
                                                #....
Hold your breathe!, the self here is a way of providing access to objects form the methods.Without it,none of the methods will have access to the object itself, the object whose attributes  they are supposed to manipulate.
  As reminded from the past, we have Private and Public things to maintain. 
Private variables can be declared using, 
                                                  __(2 underscores) before function_name
                                   eg. def __inaccessible(self):
Objects can be created in the obvious manner:
 Simply, 
                 class class_name():
                #code
                #
         object=class_name()
 and it can refer to any function as:
                      object.function()
So this was just a brief intro from the many features of Python.
                                                                                      More to follow...

Saturday, March 10, 2012

List:The technical beauty of python

Array..so long
Data organization and structure is one of the main concern of every programming language. The early languages for example C, C++ laid emphasis on using the primitive data structures such as array to store the grouped data. It had one more thing to remember, and that it was being strongly typed.
  With the evolution of modern higher level language we could make the earlier so called 'typed structures' to a  more friendly and indeed beautiful implementation which could be made  to be more comprehensive as well.
Python...its beauty
 Higher programming language such as python gives us more power in making such things. Its feature of list makes it so easy for many a things that one can make use of. It makes it easy of doing all the things of doing the  functionality of an array and other related operations such as sorting, deleting , indexing,slicing , and  many others.
With these rich features provided, we can make use it many tricky situations of doing the things we like.
using the features it has we find its use in all of the major implementations of the python such as the web crawler which is used in search engines, and all other important procedures of the Python framework.
The part of type checking is once removed being in the Python fold and so we can do many things using it.
Stack Features..
 One more important thing is that like its C++ counterpart, it provides stack operations like the POP, PUSH and APPEND functions which comes in handy for many procedural applications in many functions.
Though by default, it treats all its elements as under one type, we can however make use of the type checking facility to make sure that we have used the correct input.  
 This is a little basic of the part of  its many good feature we all use. Hopefully to be followed soon with other uses. Adieu! 

Tuesday, February 7, 2012

The Amazing Python...comes here.


Amazing...at all ..
                  Well I have been programming in python for almost 2 years.But as it goes on, it has not only proved efficient but also very easy to pick up language. Hats off..to all the guys involved in making this wonderful language. 
                           One thing I have seen over these years is that there has been a tremendous amount of interest  as well as contribution from all across the globe.Libraries have been  updated and many more modules are included in the latest release.

Graphics in python..
  One noticeable fact of Python is its easiness in graphics programming. The graphics libraries are extremely rich and very much easy to use. Compared to C++ , I would rather say that it is much easier to program in python. And even when compared to Java, for its natural AWT libraries, I would rather pick the normal ws widget libs which though a bit premature compared to the former, is easier in a lot more ways. But yes, it is still to have  somthing like Applets which can set its mark of crown.

Growth and application in real time projects..
 Being open source in its nature, naturally it falls in line of those offering open source products. To name a few, Google is the best example. It employs very large scale implementations in its core of  search applications. Even the newbie start ups like Quora makes a heavy  use of python in its noble endeavours. 
 Not only in these fronts, lot more python based products are coming up in the industry , including mail servers, 3d game engine etc. 


Application in maths and science using python is increasingly becoming popular in many institutions, including the famous Massachusetts Institute of Technology. 

Maintenance..
 The python community involves many contributors around the globe. It is maintained by the PSF or the Python Software Foundation(www.python.org).. and amazingly all are welcome to visit this site either its for tutorial or contributing to this great organisation.
  
 Once again, its open source so everyone's invited.

 

Sunday, February 5, 2012

Gsoc.....coming on the way ...getting ready !!

Its gonna be really exciting this time...hope so
                                         The Google summer of code has just arrived.Hope its gonna be hit for me this time. Lotta interesting organisations  to see through....say like..Drupal,Wordpress, Samba,Sakai,RockBox and OpenIntents. Gonna catch up with the  code early on..m learning patches and diff stuff. Will see What I can do. 
      My favourite goes with sakai and drupal, both of which goes to give the great products to the people, and honestly I'd liked Sakai for its involvement in the educational field. Drupal is good and  m trying out on its code. Hope its gonna be all right m gonna get selected in one of them...

Wednesday, January 18, 2012

Android:beauty and its woes

Android: the most popular mobile platform in the current times. Yet in the due course of its learning, one may feel a little awkward owing to its different way or otherwise platform based coding. The main problem one may find is syntax and the libraries one has to learn and know for a better programming.
 Still, with passion one does not have to really worry..coz its the same old saying that  where there is a will there is a way.
The main development areas for android in the coming ways will be in the cloud based services. Things like cloud based development and storage provision are coming round the corner and yet we may see many more to come in the near future..
So guys ...all my fellow programmers..go and go for it..wish u all  happy coding!

Sunday, January 8, 2012

How to get back the data lost during OS installation.

Well its not bad to have made mistakes ..after all its from them we learn.Today I 'd like to talk about problems relating to data loss during os installation. Sometimes our  disk is corrupt and terribly fails during the installation process, wiping away all the precious data stored in our hard drive.
If it's that you ,then do the following(I did it):


1> Don't touch any rearrange any of your folders or even a small file. If it done then it will  wipe away all the boot record and ultimately the file content will go.
2> Then install windows xp on a small portion of the disk say 5 gigs(make it, if its not present as such small amount).
3>Install the data recovery software(Easeus is really good)  in where os is installed.Don't touch the remaining part of the disk. 
4> Then use any good external hard drive to make the recovery of the lost data.But make sure you dont use the same drive for recovery.
5>Then its done. Now install any other os you want or if  you want to continue using the XP then you can go ahead and format the drives.


                                                                      ..Tell if it doesn't work

 

Blogroll

About