Johnny [Life & Code]

Semper Exploro!

Archive for the ‘CODE’ Category

Thinkpad X230 & Ubuntu 12.10

with 2 comments

Trackpad:

  • No easy tool to control touchpad.

Using xinput

jony@Icarus:~/bin$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ TPPS/2 IBM TrackPoint id=13 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ Integrated Camera id=9 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
↳ ThinkPad Extra Buttons id=12 [slave keyboard (3)]

To switch off trackpad : xinput set-prop 11 “Device Enabled” 0

To switch on trackpad : xinput set-prop 11 “Device Enabled” 1

  • How to control the sensitivity of trackpoint?

Audio Issues:

  • Internal speakers doesn’t work. Fixed with the new kernel (3.5.0-18-generic) update.
  • Mute button light is inconsistent. Sometime it comes up sometimes it doesn’t

Laptop Mode

Written by Johnny

November 10, 2012 at 9:10 am

Posted in CODE, Tech

Tagged with ,

Sublime Text syntax definition for Google Protocol Buffers

leave a comment »

Sublime Text  Syntax definition for Google Protocol Buffers.

Not robust – But its a start.

{ “name”: “ProtoBuf”,
“scopeName”: “source.proto”,
“fileTypes”: ["proto"],
“foldingStartMarker”: “{“,
“foldingStopMarker”: “}”,
“patterns”: [
{ "match": "\\s+[0-9]*”,
“name”: “constant.numeric.proto”,
“comment”: “Field numbers”
},
{ “match”: “double|float|int32|int64|uint32|uint64|sint32|sint64|long|fixed32|fixed64|sfixed|sfixed64|bool|string|bytes”,
“name”: “storage.type.source.proto”,
“comment”: “Scalar Value types.”
},
{ “match”: “optional|required|repeated|default”,
“name”: “storage.modifier.source.proto”,
“comment”: “Field Rules”
},
{ “match”: “^message|^package|^option|^import|^extend|^service”,
“name”: “entity.name.function.proto”,
“comment”: “Message section”
},
{ “match”: “\/\/.*”,
“name”: “comment.line.double-slash.proto”,
“comment”: “Comments”
}
],
“uuid”: “f6a112ba-072a-47b3-b3e3-7714156b3614″
}

Update : Moved to emacs. But still still two-timing …

Update : Moved to emacs.

Written by Johnny

June 8, 2012 at 1:11 pm

Posted in CODE, Tech

End of a book : Johnny in Novell

with 13 comments

Last day in Novell.

Started out as an intern in the GNOME team about 5 years back. Jumped between Evolution and iFolder a few times for different (voluntary/involuntary) reasons. Met a lot of good engineers. Had both good / bad times. Learned a lot work / non-work.

Gnomers,

I loved working on Evolution, Evolution MAPI (may not be perfect, but had a awesome time with it And i’m yet to cash in on the few beers i’ve been offered), Attachment Reminder (Trivial, but looks like you guys liked/hated/loved it), Redesign of Evolution search bar and so on. Best bug that I’ve worked on so far was changing a ’1′ to ‘-1′ in EText (Oh those early days! Had no clue what GDB can do.. Used hundreds of ‘printf’s, lots of coffee and tested the patience of office night guards and that adrenalin rush!). Thanks to Novell for the opportunity to contribute full-time and getting paid for that.

Special thanks to my mentor Srini. I’m looking forward for more new awesome fun things in GNOME.

Thanks.

I’ll miss the 1-1 coffee breaks talking games/gadgets/music, discussions on research papers that I don’t have a clue about, conversations during ‘tea breaks’ outside office (you would see me very inspired/productive after those sessions), thursday nights ;-) & nice friends that I found beyond ‘work’.

The End.

Written by Johnny

March 4, 2011 at 12:00 pm

Push Email for GNOME Evolution’s Exchange MAPI provider (exchange 2007)

with 13 comments

 

After few days of crazy bug hunting (and creating the same) , we have a nice push event notification framework for Evolution-MAPI. When Evolution is running all the changes happening in user’s mailbox in server would immediately be synced. This avoids those long fetches from server.  A short screen cast (watch in HD) :
Currently I’ve got “new mail” event handled and is limited to mailer. Would be working on other events. This feature has some major issues to be solved before it can land in master.
It is FUN !

 

Written by Johnny

November 24, 2009 at 7:28 pm

Me.

with 3 comments

Johnny Jacob

Written by Johnny

July 20, 2009 at 6:13 pm

Posted in CODE, LIFE, Tech, Thoughts

GDB Scripting : A short article for a internal magazine

with 10 comments

I wrote a small article for a internal magazine and few of my friends wanted me to post it to this blog.

This is for people who are new to GDB and still exploring itz features. So if you’ve used GDB for more than few weeks please ignore and skip :)

GDB – Scripting

A good majority of novice programmers tend to use printf functions to trace function calls and to printout the debug data. This forces you to change the code and compile again and again. To eliminate these superfluous tasks from your day-to-day work, use GDB. The GDB has facilities for scripting and helps in saving plenty of your time.

Tracing Function Calls

If you want to know whether a function is called or not, create a break point and write a simple script.

<code>

#Set the breakpoint

(gdb) b mapi_sync

Breakpoint 1 at 0x7fffd75f36e2: file camel-mapi-folder.c, line 741

#Tell GDB what to do when the breakpoint is reached

(gdb) commands

Type commands for when breakpoint 1 is hit, one per line.

End with a line saying just “end”.

> continue

> end

(gdb)

</code>

continue – Come out of break and continue

end – terminate command list

Run the program now. The GDB prints the function name when the breakpoint is hit and automatically continues running the program.

Breakpoint 1, mapi_sync (folder=0xc9c1a0, expunge=0, ex=0xf3a0c0) at camel-mapi-folder.c:741

741             CamelMapiStore *mapi_store = CAMEL_MAPI_STORE (folder->parent_store);

Using the GDB Scripts for Analyzing the Data

Suppose that you have a singly-linked list that has strings in it. At some point, you might want to know the contents of the list. To do this, use the GDB scripting instead of adding the debug statements in your code.

<code>

#Example for gslist traversal.

define p_gslist_str

set $list = ($arg0)

while ((GSList *)$list->next != 0)

p (char *)(GSList *)$list->data

set $list = (GSList *)$list->next

end

end

document p_gslist_str

p_gslist_str <list>: Dumps the strings in a GSList

end

</code>

Add the above snippet into a file and load it into the GDB as follows:

<code>

(gdb) source /home/jjohnny/scripts/gdb/gslist.gdb

</code>

Now, anywhere you want to take a look in the GSList, simply break and

<code>

(gdb) p_gslist_str server_uid_list

$17 = 0x7fffd81101b0 “7666BC1E000000015870BD1E00000001″

$18 = 0x7fffd810e330 “7666BC1E000000015970BD1E00000001″

$19 = 0x7fffd810cbe0 “7666BC1E000000015C70BD1E00000001″

</code>

Simple scripts thus can save you a lot of time from adding or removing the debugging statements from your code. Now go ahead and create a suite of scripts to aid the library you are writing.

More cool developer tricks later. Have fun !

— End —

Thanks to Radhika for editing the article.

Btw when is Archer branch  (Python scripting) getting into GDB ? I’ve been using it a bit .

GDB

- Scripting

A good majority of novice programmers tend to use printf functions to trace function calls and to printout the debug data. This forces you to change the code and compile again and again. To eliminate these superfluous tasks from your day-to-day work, use GDB, the GNU Project Debugger. The GDB has facilities for scripting and helps in saving plenty of your time.
Tracing Function Calls
If you want to know whether a function is called or not, create a break point and write a simple script.
<code>
#Set the breakpoint
(gdb) b mapi_sync
Breakpoint 1 at 0x7fffd75f36e2: file camel-mapi-folder.c, line 741
#Tell GDB what to do when the breakpoint is reached
(gdb) commands
Type commands for when breakpoint 1 is hit, one per line.
End with a line saying just “end”.
> continue
> end
(gdb)
</code>
continue – Come out of break and continue
end – terminate command list
Run the program now. The GDB prints the function name when the breakpoint is hit and automatically continues running the program.
Breakpoint 1, mapi_sync (folder=0xc9c1a0, expunge=0, ex=0xf3a0c0) at camel-mapi-folder.c:741
741             CamelMapiStore *mapi_store = CAMEL_MAPI_STORE (folder->parent_store);
Using the GDB Scripts for Analyzing the Data
Suppose that you have a singly-linked list that has strings in it. At some point, you might want to know the contents of the list. To do this, use the GDB scripting instead of adding the debug statements in your code to print out the data.
</code>
#Example for gslist traversal.
define p_gslist_str
set $list = ($arg0)
while ((GSList *)$list->next != 0)
p (char *)(GSList *)$list->data
set $list = (GSList *)$list->next
end
end
document p_gslist_str
p_gslist_str <list>: Dumps the strings in a GSList
end
</code>
Add the above snippet into a file and load it into the GDB as follows:
<code>
(gdb) source /home/jjohnny/scripts/gdb/gslist.gdb
</code>
Now, anywhere you want to take a look in the GSList, simply break
<code>
(gdb) p_gslist_str server_uid_list
$17 = 0x7fffd81101b0 “7666BC1E000000015870BD1E00000001″
$18 = 0x7fffd810e330 “7666BC1E000000015970BD1E00000001″
$19 = 0x7fffd810cbe0 “7666BC1E000000015C70BD1E00000001″
</code>
Simple scripts thus can save you a lot of time from adding or removing the debugging statements from your code.
Now go ahead and create a suite of scripts to aid the library you are writing.
More cool developer tricks later. Have fun !

Written by Johnny

July 7, 2009 at 8:56 am

openSUSE 11.1 on PS3

with 9 comments

Woohoo ! After a long delays and issues (in the last few days) I’ve managed to install openSUSE 11.1 in my PS3.  Running a full blown desktop is very sluggish. Reminds me of my first computer (amdk6 500mhz). Some screenies :

6 SPEs

Now onto get the Cell SDK running … Synergetic Processing Elements (SPE) here i come !

Written by Johnny

July 4, 2009 at 10:41 am

Posted in CODE, GNOME, LIFE, Linux Fun, PS3, suse, Tech

Makespace – Plugin for GNOME Evolution

with 6 comments

I’ve written (incomplete) simple plugin for Evolution which provides a combo box + menu for switching folders. Now you can hide the sidebar. This really helps in freeing up some space in your screen and can have good vertical view layout. This would help computers with smaller screen size.

Screenshots :

makespace-thumbSidebar hidden. Small combo box in top left corner

makespace-expanded-thumb1

Switching folders

To try out this plugin / For more information :   http://www.johnnyjacob.org/makespace.html .

One other feature that I would like to have is simple folder bookmarks. Bookmarked folders would appear in the top of the menu (You don’t have to navigate all the way down in the menus)

Let me know what you think and if you would like to have any features put it down in the comments. :)

Written by Johnny

April 7, 2009 at 3:59 pm

Posted in CODE, GNOME, Programming, suse, Tech

Evolution MAPI update release. (0.26.0.1)

leave a comment »

Hello,  I just released a update to evolution-mapi. 0.26.0.1 has fix for Bug 574784 without which the package is totally unusable.

Thanks !

Written by Johnny

March 19, 2009 at 10:55 am

Posted in CODE, Evolution, GNOME, suse, Tech

Tagged with ,

1 reason to run GDB & 2 reasons to run emacs from source

with one comment

CODE :

GDB : Compiling from Project Archer, you get to have python scripting inside gdb. This opens up numerous possibilities and nice tricks that helps you to debug  faster. http://tromey.com/blog/?cat=17 has few example + demo scripts.  Falling in love  with these ..

EMACS : emacs 23 (in cvs) gives you MultiTTY Support , XFT Font rendering (and more). Looks better with XFT and multitty support rocks !

LIFE :

??

Written by Johnny

February 8, 2009 at 1:08 pm

Posted in CODE, Emacs, Linux Fun, Tech

Evolution MAPI : Debut tarball release & RPM Repos are online

with 16 comments

Written by Johnny

December 15, 2008 at 1:08 pm

Posted in CODE, Evolution, GNOME, suse, Tech, Work

Tagged with

Evolution MAPI : Contributions… Testing… Bugzilla …

with 2 comments

Development is more active after our move to new svn ! Julien (of openchange.org) has patched evolution-mapi to be compatible with libmapi 0.8 .Patches are welcome :) !

Some of the cool things with libmapi 0.8 is the possibility of having multiple exchange accounts (multiple sessions) in Evolution (Yep. you read that right! ). But they will hit the trunk little later .

Now more focus is on real world testing on servers other than few test servers we are running. What doesn’t work in different setups is something we would like to know and fix them all ! Thanks to those who have been reporting issues and TIA :)

NEWS :

+ evolution-mapi is proposed for GNOME 2.26. Yay !

+ we have a new product ‘evolution-mapi’ in GNOME bugzilla.

+ Wiki page is updated with information on building evolution-mapi .

Written by Johnny

November 24, 2008 at 10:03 am

Posted in CODE, Evolution, GNOME, suse, Tech, Thoughts, Work

Tagged with

Follow

Get every new post delivered to your Inbox.

Join 453 other followers