Tuesday, May 17, 2011

Documentation using Doxygen

Doxygen is a great tool to document the code in a neat style in most of the desired formats like html, chm, pdf, latex and also rtf!  Most of the customization of the doxygen output is possible through the options in configuration file of doxygen, generally called Doxyfile, unless named something else while generation.
All the commands that Doxygen understands are documented here.
Below is a list of some options that I found useful for the documentation of my code, extracted from the above link only:

1. To undcoument sections of code from the doxygen output:

#ifndef DOXY_DOC_SKIP
code-segment-to-skip-from-documentation
#endif

 Define this in the configuration file of Doxygen, which is Doxyfile if no name has been provided while generation of the initial configuration.           
PREDEFINED = DOXY_DOC_SKIP

2. To undocument/document some section from the doxygen comments:
/**
doxygen-captured comments
\if WANTED_ENABLED
doxygen uncaptured comments
\endif
*/

This will disable the documentation of the block in the \if &\endif construct, if at any later stage you want in the documentation, Put the flag in configuration file at the
ENABLED_SECTION = WANTED_ENABLED
This would enable in the documentation.

3. To have numbered documentation:
/**
* -# Numbered list
*    -# sublist
**/

4. To enable the documentation of the static functions in C, edit the configuration file in
EXTRACT_STATIC = YES

5. To enable the hyperlinks in pdf generated by doxygen and have the Table of Contents in the pdf document
PDF_HYPERLINKS         = YES
SHOW_DIRECTORIES       = YES

6. To capture tables and ascii charts/images put in the comment block as it is in the doxygen generated documentation, enclose the section in the \verbatim construct. For instance,
/**
  * - This is just to show the use of verbatim
  *\verbatim
 ________________________
|  S.NO.      | Command  |
|========================|
|     1.      |  printf  |
|     2.      |  scanf   |
| _______________________|
   \endverbatim
**/

Sunday, May 1, 2011

Ubuntu 11.04 and wireless connectivity problem

Wireless connection worked absolutely fine with the Broadcom STA driver on my lenovo machine - i386 until I upgraded to 11.04 when the natty narwhal's wireless connection became actually notorious! ;)
What finally worked for me to get the wireless connection working, Thanks to Eric Moon, is this. The last answer here did the trick.

I was getting the network UNCLAIMED status with

$sudo lshw -C network
PCI (sysfs) 
  *-network UNCLAIMED    
       description: Network controller
       product: BCM4311 802.11b/g WLAN
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:04:00.0
       version: 01
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: latency=0
       resources: memory:f0000000-f0003fff
  *-network
       description: Ethernet interface
       product: NetLink BCM5906M Fast Ethernet PCI Express
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:06:00.0
       logical name: eth0
       version: 02
       serial: 00:1e:ec:96:04:3d
       size: 100Mbit/s
       capacity: 100Mbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.116 duplex=full firmware=sb v3.04 ip=192.168.1.8 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
       resources: irq:44 memory:b8000000-b800ffff

and with

$ sudo iwconfig 
lo        no wireless extensions.

eth0      no wireless extensions.

Thus I connected to a working wired connection and installed the missing piece of two softwares, namely, firmware-b43-installer and b43-fwcutter; after deactivating the current Broadcom STA driver under Shortcuts->Additional Drivers, section.

Then running the following command activates the newly installed driver:

$ sudo modprobe b43

Still I did not get the wireless lit up as indicated in the post there, and that was because the wireless was not active in my laptop. In my lenovo machine FN+F5 is the shortcut to turn on/off the wireless. So that combination got my wifi finally up!
Now on executing:

 $ sudo lshw -C network 

no UNCLAIMED network was reported...
Also,

$ sudo iwconfig

stated a wlan0 connection!!

Sunday, April 3, 2011

Multitasking and its blunders

Too many things to do. Finally nothing done!

A bird in hand is worth two in the bush! How true this is, I understand now. For me the reality is::: 100 flying birds and 0 bullets in the gun --> FRUSTRATION!!!

Things I want to do:

  1. Map volume keys to answer and reject calls on N900, instead of the touch option.
  2. Automatically answer call in the time set, if headphones are plugged in, thereby saving the effort of picking the phone out of pocket..
  3. Django powered chefschatter.com
  4. Start a food joint-"Ghar ka Khana"
  5. Write an application that helps me keep track of how many Thursday fasts have I successfully completed.
  6. Buy a second hand or not very costly bicycle..
  7. Understand the basic or internals of Linux.. Its been almost three years and I am still a noob when it comes to making use of it.. Troubleshooting still means to me--GOOGLE!! I am handicapped without a working net connection!
Many others...

(Any and all suggestions on how to's for the above list, would be highly appreciated)

The list goes on and on.. These tasks being not organised are running with & in the end and other small tasks like washing clothes, cleaning the room, cooking and earning a living, (the only good part is that atleast my work environment doesn't place me far from my tux.), taking up stupid freelancing projects.. eat up on the time I have.. Yeah, not to forget the time I kill in small talks..

 The big question is will I keep cribbing or break the important tasks into achievable chunks and put them to 'fg' ...

I just wish, I take control on most of the ways I spend the days, hours and minutes of my life.. and at the end I have no thoughts like "what if..", "if I had just done it.."

Its important I learn the most important thing in life - "Stay hungry, stay foolish and stay dirty!"

TBF: Dos an Don'ts

(FYI; TBF may be expanded to: To Be Followed ;)