Famous Quotes

There are no "knowns." There are things we know that we know. There are known unknowns. That is to say there are things that we now know we don't know. But there are also unknown unknowns. There are things we do not know we don't know.

-Donald Rumsfeld

Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Friday, May 18, 2012

Emacs in Maximized mode by default


I hope that many would agree that emacs is one of the greatest editors made by the one and only R.M.S!!

 

It happens to be  my favorite too..

 

Well, one of the problems i face,when i use emacs in interactive mode is.. i need to press maximize icon everytime to go to full screen..

 

And thats when python came to rescue..

Open the config file of emacs.. That will be there in your home folder..
If you prefer terminal, then,

1.  Type cd
    
         **-desktop$ cd

2.  Open .emacs file

         **-desktop$ emacs .emacs

If you go by GUI, then,

1. Go to your home folder
2. Enable 'Show hidden files' option in View menu
3. Browse through the folder to find .emacs and then open it.. 


Add this code in the file...

(defun toggle-fullscreen ()
  (interactive)
  (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
        '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
  (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
        '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
)
(toggle-fullscreen)


Now that should open emacs in Maximized mode with all the icons  unlike -fs mode which disables few toolbars..

Voila!!

Coutesy: Source of this code :) 






Tuesday, July 5, 2011

FIrst day with Python

        Seriously this is an awesome language.For those guys who don't know what python is,(Oh come on,you know i never mentioned about that mountain snake) check out this link..The Official Website of Python.. It is totally cool!!

        I preferred to a book called "Dive Into Python" rather than the normal 'docs' that come along with the software.. That book speaks to us.. I literally mean it.. The author have taken a very good effort to make the book reader-friendly.. The first day, i was able to cover more than 50 pages(Given that it contains only basics and i already knew a bit about it out of curiosity).. Still i was not fed up to continue reading..


       This got to me one of the important feature of the text book.. It should never lead us away rather than bonding with us.. And this book rightly did it.. I know i am blabbering the same for the past two stanzas.. But this comes out of pure enthu that i have got for this book right now.. I wish i would continue to show the same enthu in the days to come.. In these many pages i was able to find just one bug that too a typo error- replacing 0 by 'theta'.. I believe you got it..


       insert(), append(), remove(), pop(), sys.path, index, count, in, print(), tuples, list, sets.......Man I totally love it.. I hope this first day victory(Let me call that pls) wouldn't get into my mind and spoil the oncoming days..