Installing PyCharm on ubuntu

I was searching for a decent ide for learning python. Browsed through a few blog posts and zeroed in on pycharm. It’s community edition is more than sufficient for me.  I was surprised to see many long articles and videos about installation process on linux. Let me assure you that it’s not at all complex. Here are the steps to install pycharm on ubuntu.

  1. Download Pycharm from here.
  2. Unzip it .
  3. Go to bin folder and type
    ./pycharm.sh
  4. If you get any jdk related error follow theses instructions to install java .

Installing Java 8 on ubuntu

  1. Check if java is already present
     java-version 
  2. If open jdk is present remove it by using
    sudo apt-get purge openjdk* 
  3. Now add the repository, update it and install java 8
    sudo add-apt-repository ppa:webupd8team/java
    
    sudo apt-get update
    
    sudo apt-get install oracle-java8-installer
    
    
  4. Lastly , set the environment variables. I would suggest you to use defaults 🙂  
    sudo apt-get install oracle-java8-set-default

Mounting windows 8.1 partition in ubuntu

After upgrading to windows 8.1 I couldn’t able to mount windows partitions in ubuntu. Had to google it and finally deciphered the mystery behind fast booting time of windows 8.1. Actually it keeps all drives in hibernate mode even when you shutdown.   That is why ubuntu finds it difficult to mount . To resolve this, you just run command as an administrator in windows and type “powercfg.exe /hibernate off”  .

Warning : you are windows booting time will increase drastically 🙂

Strange issue in gcc windows

Last week I came across a strange situation in gcc for windows. I have written some c++ codes in linux where some of the function bodies i kept in header files only.

like this

class temp

{

string m;

public:

void setm(string param){ m = param;}

string getm(){ return m;}

}

 

This is working fine when compiled and used in linux. But when I use same gcc version in windos 64 , it compiles but crashes at run time as it couldn’t locate function bodies. Will look into this farther .

Commit to Github

Here are simple steps (only commands) to install ,setup a repo and commit to github . I assume that you are having root access(These instructions are from linux only. ) and a github account .

  1. Go to the folder containing code , which you want to commit.
  2.  sudo apt-get install git   # install git
  3. Next step is to setup github with your detailsmonai@monai:~/imraw$ git config –global user.name “Your name”
    $ git config –global user.email ” your mail ”
    $ git config –global credential.helper cache   # to remember password
  4. Next step is to add files to repo
    git add *
  5. Now we are ready to commmit changes
    git commit *
  6. In case you get any fatal error regarding creation of index.lock , userm -f ./.git/index.lock
  7. Now we are ready to push our changes to github.com
    $ git remote add origin https://github.com/yourname/projectname.git
    $ git push origin master
  8. That’s it. Remember you can always use force , in case you encounter some error and you know the system is wrong 🙂

Finally got Kitkat :-)

image

Never waited so eagerly for kitkat before. Finally got it an hour back. Apart from some icon changes , haven’t noticed anything visually striking yet. One thing i can confirm that this one is fast. Can’t resist myself any farther , lets explore . Will write more later

Reducing size of executable in mingw/gcc

I was compiling some basic codes in qt. I observed that even for a hello world project , it is taking close to 1 mb , even in release mode. So did a google search on that. Found that main culprits are

  • Included debuging info.
  • included standard libraries.
  • RTTI , EXCEPTION handling, usage of templates.

In my case, usage of templates is the main reason. Seems like compiler loves to generate different codes for each template instances. Eg. vector<int> and vector<string> will have different implementation.

Solution is to disable the above mentioned features using some compiler options

-fno-rtti
-fno-exceptions

For complete list of options check this. You may also consider packing your executable using UPX.

Micromax A110 (Poor man’s galaxy s3 :)

I was waiting for a smart phone upgrade for quite a while. I could have waited another 2-3 months ( wanted to see blackberry 10) but  Micromax a110 simply ruined my plan. Very rarely I get so impressed with any stuff. You can just buy it for the screen it is providing. A 5 inch ips screen at just 10k !!

  Already there are plenty of unboxing reviews done for this one. So I am not going to do that ( Actually I don’t have patience to film a gadget before start using it 🙂 ). I will just mention my findings about this gadget.                               1. Don’t expect a galaxy like display, but the display is superb.

2. One very good thing about this phone is, it’s radiation is very low (0.7 probably).

3. Don’t read too much about ram. I tried following apps without any trouble :

Angry birds (All variants 🙂 ), bad piggies,ninja jump, asphalt,cut the rope,instagram, temple run,saavn,vlc, google maps( The gps navigation is flawless, and very fast too ) etc.

As you can see, I tried all types of apps required for daily use.

Continue reading “Micromax A110 (Poor man’s galaxy s3 :)”