~:: kalyan ::~

January 23, 2009

emacs tweak

Filed under: emacs, open-source, Script — Tags: — skalyanasundaram @ 5:58 pm

In my old project there used to be many #if 0 .. #endif which does not fall in to the comment-face of the c-mode. This always confuses me. It would be good if that block is colored like a comment. So that i can just ignore that place.

I wrote the following elisp code which adds the #if 0 section to the comment section keywords of the c-mode.
(font-lock-add-keywords
'c-mode
'(("\s-*#\s-*if\s-*0\s-*n\(.*n\)*?\s-*#\s-*endif\s-*" 0 font-lock-comment-face append)))

I have left \s-* in many places as it is because even using back reference does not improve any readability.

Advertisements

December 25, 2008

LOC counter

Filed under: open-source, Script — Tags: — skalyanasundaram @ 6:19 pm

I moved to a new project at work. I thought i would count the loc. AWK is cool for this job.

BEGIN {x=0}
{
if ($0 ~ /^[[:blank:]]*/*/ )  {x=x+1}
if(x > 0 && $0 ~ /.**/[[:blank:]]*$/) {x=x-1}
else if(x==0 && $0 !~ /^[[:blank:]]*/// && $0 !~ /^$/) {
print $0
}
}

There are lot of free loc counters available. May be i am re-inventing the wheel. Anyway it is my version. Comments are welcome. This does not count the single line comment and multiline nested comments and all blank lines are ignored.

You need to call this explicitly like, > find . -name *.c -or -name *.h | awk -f ./abovefile.awk | wc -l

June 9, 2008

Emacs project

Filed under: emacs, General, Linux, open-source — Tags: — skalyanasundaram @ 3:46 pm

I had faced several configuration issue while using emacs as my primary development environment. All is configurable,. but it is just to put together.

I use desktop.el, cscope+.el, etags and each one of them annoyed by conflicting desktop files, having cscope key bindings while using erc or gnus, conflicting etgas between multiple projects correspondingly…

I had tried few things like, ecb, cedet but nothing suited for my requirement. So this is the initiative to make it nice.

I had kept my epr file here and here

May 16, 2008

emacs save all modified files

Filed under: emacs, open-source — Tags: — skalyanasundaram @ 10:43 pm

Few time I got bugged up with the situation where I forgot to save the buffer and trying to blame make, automake tools. It would be nice if there is some function which saves all modified buffers like “Save All” from any IDEs.

I was trying something like this

(setq var (buffer-list))
(unless (null var)
(string-match “.+.[ch].*” (buffer-name (car var)))
(save-buffer (car var))
(setq var (cdr var)))

ofcourse did not work with the last argument of string-match. Latter found save-buffer only saves current buffer and does not take buffer as argument. But which leads me to find save-some-buffers, and this what I was trying to write my own. :-/

save-some-buffers C-x s , saves all modified buffers which are all associated with files. It also ask for many questions. The beauty is if you dont remember what changes have been made in the buffer you can make a diff between the file and the buffer like the below. Review each hunk with M-n

***************
*** 19,25 ****

#include <config.h>

! #include <ctype.h>
#include <stdlib.h>
#include <string.h>
//Test
— 19,25 —-

#include <config.h>

! #kalyaninclude <ctype.h>
#include <stdlib.h>
#include <string.h>
//Test

Diff finished. Fri Jan 18 10:25:55 2008
There is an another option C-r which takes us to the modified buffer too.

Yet another nice feature 🙂

NetBeans supports emacs key bindings!!

Filed under: emacs, open-source — Tags: — skalyanasundaram @ 8:21 pm

I am working on DHCP JavaConsole recently. I though will give a try in NetBeans and I need to work on jdk1.4. Finally got NetBeans 5.0 which is compatible with jdk1.4. Surprisingly NetBeans supports the emacs key bindings. Tools=>Options in the option dialog the keybinding option need to be selected. It is satisfactory. But sometime I am getting confused with the key bindings like M-C-n M-C-p.. It would be good if NetBeans could understand .el files. So that I can customize for my own need. 😉

March 23, 2008

Brainshare week

Filed under: dhcp, General, life, Linux, open-source — Tags: — skalyanasundaram @ 6:18 am

Made my first trip to Brainshare, in SLC. Things went well. Customers partners and issues, requests, satisfication, queries and many more. I had given a talk in BrainShare on DNS/DHCP on OES2 linux, the new features and migration. There were two sessions. I guess in the first session many ppl find it difficult in my indian accent. I could correct that to some extend in my second sessions but still I guess it was difficult.

Had a chance to attend the Hack week demo from the middle. Srini, calvin, Brady’s,.. demo was amazing. The sharing of tasks, notes using giver and evolution meeting setup and openoffice animations all seems to me great stuff. The session was started before I go, so dont know how much i missed it.

Hope this week I get chance to work with NCP and DST folks closely and get some brain food.

Apart from the work could not get much time. We tried to go Antelope island and ofcourse nothing to see much and the to SLC temple, again we cant enter but we could get into assembly hall and other buildings. I met sister low in the assembly hall and the surprising thing is she welcomed me in Tamil. She is basically Malasian and grown up in a tamil family. She showed us the pin drop where with out a mike and speakers you could hear a pin drop sound. Basically to explain the tallent of the mormons civil architects in the earlier.

Moved to provo today or yesterday. Lets see about this week.

(Photos latter)

January 1, 2008

Happy New Year

Filed under: emacs, General, life, Linux, open-source — skalyanasundaram @ 11:47 am

After the Mumbai trip, had a chance to go to home. Novell had announced a shutdown for four days.  Good for me, home food, sleep, TV, Movie  and sleep all the remaining time. Unfortunately Jan 1st is the working day. I planned to return and not to take leave and I need to take more leaves on this month itself.  But I decided not to spend the new year in the travel, so did a day time travel. But still I thought I am going be late for just few mins or seconds for the new year. I was sad but luckily I got down at banaglore at 11:55, people started firing crackers for the new year. I felt like my arrival is being celebrated at bangalore. 😉 hehe I should be happy. Had called up few of my friends and slept alone thats all.

Emacs: 
I do not want the ERC> prompt. It actually confuses, because every channel buffer has the same prompt. Either remove it and keep a simple “>” mark like rcirc or make like #emacs>,  #dns> depend on the channel name. This following code actually helps

(setq erc-prompt (lambda ()
(if (and (boundp ‘erc-default-recipients) (erc-default-target))
(erc-propertize (concat (erc-default-target) “>”) ‘read-only t ‘rear-nonsticky t ‘front-nonsticky t)
(erc-propertize (concat “>”) ‘read-only t ‘rear-nonsticky t ‘front-nonsticky t))))

October 11, 2007

gmailfs

Filed under: Linux, open-source, web — skalyanasundaram @ 8:41 am

I came across of this gmailfs while crawling for fuse related stuff. It is a very (beautiful && (useful for the required ppl)). A normal gmail user might not want this. It is very useful for the file transfers. For file transfer we do attach the file in the mail and save it as a draft atleast i did and this gmailfs also does the same. But it is basically a file system. It does more than that

I dont need to bring my pen drive to take copy of my docs from office to my home. I can simply do cp myfiles ~/gmailfsfolder and in home I can do cp ~/gmailfsfolder MyFolder. Thats all. Isnt useful. But the only problem is you have keep your gmail password in the conf file as plain text.

How i configured gmailfs for my account is here

October 9, 2007

dhcp-ldap patch temporarily not available

Filed under: dhcp, Linux, open-source — skalyanasundaram @ 11:48 am

The link for the project dhcp-ldap integration which i had mention in my previous page (http://home.ntelos.net/~masneyb/dhcp-3.0.5-ldap-patch) is temporarily not available due to Brian’s personal reason. I had requested him to provide a new link in some other public server.

Till then hold on. If anybody is interested i can generate the whole patch and give you.

Hope I will get a reply from him soon.

It is back again here

May 23, 2007

Using Thunderbird instead of evolution

Filed under: General, Linux, open-source — skalyanasundaram @ 1:47 pm

I generally keep changing things. Desktop place, Window manager , applications…

So this time i have tried out thunderbird as a replacement for evolution

It looks pretty in some feature but not in every aspects.

The features i like

  1. Each account is maintained separately, the mails which are not falling through any filter sits in inbox of that account. But in case of evolution it is different. There will a common inbox there all unfiltered messages will go which i dont like to organize them manually.
  2. The second damn thing i like is themes. Evolution cant support this feature. Look at my vista look at linux 😉 thunderbird-vista
    Just for a change. I can show up to my windows friends. 😉 The firefox users feel more comfortable with this theming feature it is as same as firefox
  3. The third feature i like is add-ons. There are lot as usual . The add-ons i am using is
    • Talk back — http://talkback.mozilla.org/
    • Splash screen — Just show splash screen fully customizable even the image , text , color, font(http://splash.mozdev.org/)
    • Signature switch – If you have multiple signature you can add them. (http://mozext.achimonline.de/)
    • Provider for google calender atthunderbird (http://mozilla.kewis.ch/) It works really. 🙂 I think there is small bug it always set thing one hour late. Yes it uses the xml address (ORANGE one). But in evolution it uses the ICL address (GREEN one). But after adding up the address in evolution it gives read only calender. Not sure it is bug or some configuration. I have clearly checked it.
    • Gmail UI — to provide gmail effect like archiving and searching. I think it works with small bugs. Not using much. I always want my mails to be classified. Not interested to put everything in a single archive folder.
    • Contact side bar – this is another good addon. I liked it. Shows the address book in the left pane. Quick add when a new mail is sent.
    • Filters i like it. Filters are associated with the account and they are not global like evolution. In evolution many times i had this problem of missing of mails. It just goes to some other folder due to the misconfiguration of filters.
  4. The other feature i like is lightening . Yes a calender program. Ofcourse u can configure with sunbird as a separately application. But who wants to maintain one more application. So lightening comes handy , it is a add-on on thunderbird. It works well i guess. I have not faced any problem. I have configured google calender and worked with it.
  5. Display mails as thread. It shows a tree view with a vertical dot view. That looks nice. Eyes just need to follow the link when the thread is too big. But in evolution there is nothing provided. Only arrow button to show it has child mails and indentation is maintained which i felt little difficult.

As of now i have not configured IMAP on both the mail client. So let it be with my groupwise.

The feature which i dont like or which i feel missing in thunderbird comparing to evolution

  1. Task maintenance is missing out in thundebird which evolution provides perfectly.
  2. Online LDAP servers can be used. ( i think it is available in thunderbird also)
  3. Integration with gaim accounts and system calender. I have just said in evolution sync with gaim. It is done simply. The task i can and appointments i can see in my gnome calender. It is just cool. Thunderbird has to add these feature
  4. Evolution can export the address book vcard format or as csv (evolution-addressbook-export –format=csv >contact_list.cvs
    ). There should be ldif format supported. But i felt difficult converting them to thunderbird. Thunderbird was showing some field matching for exported CVS formated address book that mostly goes bad. Somhow from google i exported the CVS file and that mostly worked except for few contacts
  5. When i send a mail evolution does it silently. It first keep it in outbox and send it in the background. But thunderbird keep running in front. There will be progress bar running and showing connected to this outgoing server and sending. Which need to be done at the back. (Does any setting available for that, i guess i have not missed it out)
  6. It will have more support on groupwise accounts probably (I have never tried it but seen ppl using it like johnny) because groupwise and evolution is supported by Novell and i am an employee of Novell 🙂
  7. Finally evolution looks native. 🙂 may be used to be it.

Lets see. For now i am using thunderbird. Heared some new features are coming out in the lattest build (labeling like gmail, layout changing which already in thunderbird. I like the task management and contact detail syncing feature from evolution. I will switch back to evolution after some time when i feel i need a change or when some attractive feature available which ever comes first

Older Posts »

Blog at WordPress.com.