Spoken Wikipedia

Just noticed the list of Spoken Articles.
Interesting indeed. While listening to Marie Curie notied that it was edited a little from the spoken article was uploaded.
Should the spoken wiki, also follow the wiki way? No, its not so easy.

Freedom Foundation gets Swiss aid for AIDS care


Freedom Foundation, Bangalore, has received a grant of Rs. 49.5 crores to be spent over five years, from the Geneva-based Global Trust Fund for treating persons with HIV/AIDS.


Source

noticed this with system-config-packages

system-config-packages says Preparing to Install when Removing Packages. Thought it could be a bug.

Anyway, lets see.


Happy Birthday Daddy!

Many more happy returns of the day,Daddy. :)

Macromedia missing plugin install works for FireFox 1.5

The title should say it all. With the previous versions of firefox, direct plugin install had invariably failed for me and I used to manually link it to the plugin directly. Now found that buy clicking that Lego shaped Logo for missing, Firefox 1.5 directly installed the macromedia plugin. whoosh! :)
Next comes Java, the need hasn't arisen yet. lemme see how it goes.

ljseek.com

I used blogger for a long time as a store of my notes,ideas and I could easily search them using google. When I decided to move to LJ the first doubt I had was, how will I search the entries of my notes. Now thats resolved. Thanks to ljseek.com.
More usage aspects of LJ I discoved were, I could syndicate XML feeds of my friends.

KDE India

KDE India is launched and interesting thing was, I was one of the founding members. :D

Fun!

command prompt here on win xp

yeah, cmd.exe is very limited. its bad. yet, when you need to use it. have to option of command prompt here from the explorer window with the following steps.

On M$ Windows XP:
1) Open Windows Explorer and Go to Tools -> Folder Options.
2) Go to File Types.
3) Select None Folder.
4) Click Advanced.
5) Select New and Give the values:
6) For Action: "Command Prompt here" (w/o quotes) and Application "cmd.exe" (w/o quotes again)
OK.
now, when you open the explorer have the facility to open the cmd.exe prompt easily at any level folder.

vim users,lets map

http://www.frappr.com/vim

SourceForge.net FireFox searchplugin

Mozdev Search
Writing one is fairly easy. Tried the above,it worked. Before submitting,I searched mozdev.org to find that someone already felt the need and has made it available.

leetspeak in python

Struggled with the print statement as it adds '\n' and a space.
Found that my friend's usage of print with ''.join([leet.get(x,x) for x in str]) worked!
So, here's the python way:
http://sarovar.org/snippet/detail.php?type=snippet&id=63

I should be more organized

Yesterday for reaching FOSS.IN venue, I had struggled a lot and reaching there, cursed myself for being not very planned and organized.
Left my delegate pass at office itself and could not attend today.

How Bram is helping Uganda

Please take some time to read his report here:
Bram's Report and
Pictures.

coming from FOSS.IN

Satisfied after attending the talk of Alan Cox. :) He spoke about why and how of OpenSource. Noticably he was a nice person. Had a photo shoot. Shall upload when I get it from my friend. I think the video and the slides will be availble at FOSS.IN soon.

Rapple 1.0 Release :)

Project Site: http://sourceforge.net/projects/rapple
Home Page: http://rapple.sourceforge.net

From: Alan Moran
Mailed-By: lists.sourceforge.net
To: rapple-devel@lists.sourceforge.net
Date: Nov 27, 2005 6:06 PM
Subject: [Rapple-devel] Rapple 1.0 Released!

I have just released rapple 1.0 via FRS onto
sourceforge.net. This release (along with tests,
resources and website docs) has been tagged
Release-1_0.

Many thanks to all involved in meeting this deadline.
There are still places where we can improve and
features we can add but I think it is important that a
functional version is made public so that we can begin
to understand how end users see the tool. The
progress we have made so far in quality (e.g., unit
test framework) and documentation (e.g., Doxygen and
website) is great and gives us a good basis to start
from.

I have tentatively put together a roadmap for release
1.1 (you can see this on the website now) so let's put
some ideas together for what should be done and what
we need to fix or improve on in the current
implementation!

Thanks for all your input!

Regards,
Alan.

leetspeak

Not a python version yet. but a simple C version is here:

http://sarovar.org/snippet/detail.php?type=snippet&id=62

senthil_or@WXP-GWQ581S /cygdrive/c/uthcode
$ ./a.exe
This is a leet speak!
7/-/15 15 4 1337 5|o34|<!
Funny Little Program!
|=(_){\}{\}`/ 117713 |o1206124/\/\!
Can you decode this?
[4{\} `/0(_) [)3[0[)3 7/-/15?

todo:

As I am learning python.While browsing, just came up with a small program idea.
English to Leet speak translator.

sale item

C Programming Language Course

lets see.

wikipedia featured picture of the day

Noticied it today. If you go to http://en.wikipedia.org, you might find the featured picture of the day.


662px-LutraCanadensis_fullres


Otters

Digraphs in vim

How do you get Digraphs in vim?

Find the available ones by:

:diagraphs

Then in the insert mode, Cntl +K
Cntl +K At gives the @
Cntl +K Co should give the copyright symbol.

Discover Sherlock holmes in your mailbox

http://sherlockholmes.stanford.edu/ just registered to received the look alike copies of The Strand Magazines Sherlock Holmes series every friday till Jan 2006.
Will ofcourse make a good and would be a collectors edition as well.

All your text belongs to Vim


How to have your txt file icons associated to vim icon.
- Go to Control Panel
- Open Folder Options and File Types Tab
- Under the Registered File Types click on TXT.
Now, before changing the program from NotePad to Vim.
Click on Advanced. ( If you don't have Advanced, wherein you have already changed the default program, click restore and then you get the advanced)
In the Edit File Type Dialog box. Click Change Icon and browse to gvim.exe or vim.exe in your installation. There you get the standard vim icons. Associate them and then carry on changing the default program from notepad to the sweetest vim.

btw, I am searching for this icon for association and unable to find as to which file contains this.

Read TinTin; Python doc and others..

150px-TintinCigars

Just finished reading, Cigars of Pharoh. Yeah, it was indeed interesting. Reading TinTin always enjoyable and you feel the amusement either in the way the story goes, or at snowy's expressions!
It was funny, when TinTin is thrown in inside the Indian Jungles and finds himself admist of elephants. He saves one elephant and the group of elephants accept tintin and snowy as their guests. Tintin while being amongst them learns the elephant language; creates a tumpet using the bamboo trees and informs snowy that he would like to see if he can speak with them. He tests by asking a shower to the elephant and there you see in picture of TIntin in trousers taking the water shower from elephant tusks.

Python for the first time was gripping. Need to go more.

lj.net

trying with a client for LiveJournal. lj-net
lemme see how it looks. Work with Silktest going on and daily dose of vim as well.
need to get back to rapple quickly and majorly and take up withuthcode as well.
More todo:
- Python
- Linux networking.
- egovernance.

mpegtv for Linux

Got some VCDs from Home. Apollo 13, Dil Chata Hai, Nala Damayanthi,Terminator 2, Bad Boys,Lion King,Aladdin and got "The Making of the Mahatma" today.
Xine, Mplayer,Totem Player have always created havoc with Fedora and had decided that today at I shall explore a good number of options to get the VCD thing working on my linux.
While trying, stubled across Mpegtv (http://www.mpegtv.com/download.html). The Only software which worked straight after the install for VCD so far!. Phew!. But this does not follow the Linux way of doing things. This is a shareware not a free software.
But for quick and dirty way of enjoying movies, me gonna use mtvp

If you have a your Totem player playing your VCDs you get at shops, plz let me know how and what did you do. I have tried many many options few months back and gave up due to lack of time, I shall pull back this exercise again.

Back from Home

Visit to Madurai was very eventful. Interesting times of my life. Spent some 9 days at Madurai after a long long time ( june 2002? after the college got over). A good and relishing break.
Hope you all enjoyed your Diwali!. I enjoyed mine, very well.

Vim tips

:set wildmenu
:set nocompatible

And now try with some command like :color the bottom status line changes to your choice line, which you can choose from using the arrow keys.


Struggled a lot with :put command to basically do some text processing work. I had to repeat a a block of text, formatted in a particular way, and in each block changing and incrementing the number.
My skills with vim are so less that I spent some 2 hours trying the ways, I could do that, (meanwhile, learnt many new things) only at the end to go back to the normal routine unintelligent way, which I was able to do it in 1/2 hour. The completion of the job was more important.

LiveJournal

It was nice to know that bluesmoon had added me as a friend. Yeah, I read his blog and he is a famous geek in bangalore.
Also added two of my other friends sajith and his roommie abdul.
I am basically trying with something new and different after using usr.blogspot.com for a long time now.
Again, if I start using this journal,then this will basically have notes taken when working with Linux.

Fwd: appending and incrementing the numbers from a particular point

From: Tim Chase
Subject: Re: appending and incrementing the numbers from a particular point
To: Senthil Kumaran

> My requirement is to add more rows with incrementing numbers upto say 2300.
> like:
> 2191 Default SomeText
> 2192 Default SomeText.
> 2193
> 2194
> 2195
> .
> .
> .
> .
> .
> 2300
> ~
> ~
> How should I go about doing this in vim.

Well, there are several ways to go about it (as usual...this *is* vim ;)

The first that comes to mind is something like the following:

:let i=2193 | while (i <= 3000) | put =i | let i=i+1 | endwhile

When executed on the "2192" line, will add a whole bunch of other lines
afterwards. If you want your default text stuff in there too, you can
simply change the "put =i" to

put =i." Default Some Text"

which will pre-populate it with values if you want. If you like to be
left at the top of that inserted stuff, you can try the inverse. On a
blank/emtpy line below "2192", you can do

:let i=3000 | while (i > 2192) | put! =i | let i=i-1 | endwhile

This would be a direct answer to your question of "how to add more rows,
incrementing a number each time".

If, however, you'd like to have it auto-number, something like this
mapping might do the trick for you (all one line):

:inoremap <cr> <cr><c-o>:let i=substitute(getline(line('.')-1),
'^\(\d*\).*', '\1', '')<cr><c-r>=i>0?(i+1).' ':''<cr>

It can be done without a holding "i" variable, but it becomes about
twice as large, as both instances of "i" would be replaced with the
entire contents of the "substitute()" call.

It should gracefully handle lines with numbers and lines without numbers.

Help on the following topics should give you more details on what's
going on there.

:help getline()
:he line()
:he i_^R
:he while
:he let
:he :put
:he substitute()
:he /\d

Hope this helps,

-tim

Gnome Easter Egg (Wanda the Fish)

mricon: : "Gnome Easter Egg (Wanda the Fish)




Hit Alt-F2

type 'free the fish'

hit enter

VisVim

its fun! like when you are using VC++ and you are so used to and like vim, then you want your vim as an editor whereever any editing function is needed.

yeah. Go to your Windows installation of vim. (You dont use it? Hey, get it now at www.vim.org and start using it. In a year or so, you might start appreciating it). yeah coming back, go to your windows installation of vim, which had OLE enabled and read the file called README_VisVim.txt. It gives the directions as how to integrate vim as an editor to your visual studio.

Found it One way. Debug mode is not possible. Big miss. Visual Commands are not recognized. But found a link in web to come around this. ( have not tried it) And the vim editor stands out of the IDE, it does not embed itself into the visual studio framework.

After you enable it as your editor, basically you can disable it with a hot-key and return to the normal editor, toggle its usage, after the debugging is over, you can load it again to vim using some hot keys. that readme explains them well.



So, I just started with both. Vim has lot to go :) getting to start liking it,what might take to go more into it! :D

GnomeTinTin

You like Gnome and you have always loved reading TinTin. Get a feel of both with this wallpaper.





tried new default apps with linux

Happened to try a lot of new Linux apps today. Basically it started with ripping the Swades CD Songs using the Sound Juicer to Ogg format.
Now Ogg happens to be something which most of the linux multimedia application should understand, so Helix Player played it. Helix does not have a playlist kind of facilty. So, tried if any other application can player this, my often wondered question of why the hell totem-player is present in the distro was answer as it played Ogg without requiring any external plugin :D Btw, thats sound,I have not seen a video yet on Totem.

We often use the mount command to mount a particular windows share on Linux:

mount -t smbfs -o username=<username>,password=<password> //<server-ip>/share /media/<mount-point>

And have always struggled with Connect to Server option presented by the Gnome Nautilus.
Tried it again today. But gave only the following:
- Service Type: Windows Share
- Server: IP
- Username
And Connect. And it established the connection. Had so long tried in vain with providing share name,folder, name to use blah blah blah..
mount command always seemed to require a second level directory, so I was always trying giving the share name in the Connect to server dialog box.

Now after the smb connection, that network share comes as an Icon in the Computer as well in Desktop. Thats become easy.

What else: Yeah, rhn applet was constantly blinking. Which I have no requirement for as I am over Fedora Core4. (Why is Fedora Distro carrying rhn applet??) So, I did.

rpm -e up2date-4.4.23-4 up2date-gnome-4.4.23-4 rhn-org-trusted-ssl-cert-1.0-1 rhnlib-1.8-6.p24.1 rhn-applet-2.1.17-3 firstboot-1.3.42-1.noarch

Now its clean.

Yeah, used Dia too effectively.

Endianess

Endianess refers to the ordering of bytes in a multi-byte number. Big endian refers to the architecture where the most significant byte has the lowest address, while the opposite Little endian, the most significant byte has the highest address.
You can find the endianess of your architecture using the following programming snippets:


int x = 1;
if(*(char *)&x == 1)
printf("little-endian\n");
else printf("big-endian\n");



#define LITTLE_ENDIAN 0
#define BIG_ENDIAN 1

int machineEndianness()
{
short s = 0x0102;
char *p = (char *) &s;
if (p[0] == 0x02) // Lowest address contains the least significant byte
return LITTLE_ENDIAN;
else
return BIG_ENDIAN;
}

Endianess Wiki page for #c on FreeNode.

Tip for MediaWiki Users: mediawiki recognizes hot-keys ( thats php, not ajax) and play with alt+x on your favorite wiki site.

Doom3 the linux

There is Doom3 for Linux from id software. Tried on my Fedora Core 4 having 1 GB Ram. The Game was still very slow. The reasons I read at some performance comparisions that Doom3 was written using VC .Net and GCC optimization was not perfect. So there will always be 10% different.
Adding to this was the inbuilt video card of my machine.

VGA compatible controller: Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device (rev 01).

At #linux IRC channel while discussing this issue, came to know that this inbuilt video card does not support OpenGL graphics well and might have performance lags. The suggested ones are nVidia and ATI.

After downloading the game id software's ftp server.
- The Installation was breeze,using ncurses. Cool way for Linux for a big application.
- Had to change some settings in my X.org conf file. Increased the Depth to 24.
- To improve the performance on Linux with inbuilt video card,Added something called VideoRam 128000 under Device section and turned off all the advanced options from the game.

Now, its playable, but I need to figure out how to play it :)

brace expansion in BASH

mkdir {A..C}{a..c}{1..3} did a nested brace expansion and created the 27 directories. that was cool.
rm -rf {A..C}{a..c}{1..3}

Tip source: aplawrance

shell pi

pi=$(echo "scale=10; 4*a(1)" | bc -l)

ok; bc -l gives floating point value.
a(1) returns arc tangent of 1.
scale is the scable you assign to the bc.

how 4 * a(1) is pi?

cowsay

Cowsays


______________________________________
/ Don't worry about anything... Go out \ and have a good time. /
--------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/ ||----w |
|| ||

Patch How To

The command you need is:

# diff -ruP libsmbios-0.10.0_beta5 libsmbios-0.10.0_beta5_SENTHIL

Where the libsmbios-0.10.0_beta5_SENTHIL/ directory has your
modifications
. Make sure that you run a "make distclean" in both
directories and look at the patch to ensure no stray files got in.

After this, go ahead and send it as an attachment. Doing the patch
inline is excellent for reviewing, but because of the line-wraps your
email client puts in, it is not possible to apply it this way.
--
Michael

getup to oo

"'Well, grok bugzilla / your personal collection of tricky MS files, find some scab and pick at it' he says. He continues, 'the first thing to do is to download the latest ooo-build, and build it yourself, then go over the My First Hack page. Be sure to pop onto IRC and ask for help."

using rdesktop

rdesktop seems a nifty tool.

To use it,invoke with the options:

rdesktop -u <user_name> -d <domain_name> -g <resolution> <windows_machine_hostname/ip>

I used resolution as 800x600. the -g option is a must I guess;I googled for usage of it, cause I could not figure out using it by running the tool, using --help,man etc..

rdesktop on your linux and Cygwin/X on your windows might make a nice handshake!

talk to wumpus

Everying is talking about talk.
Check About talk by Right Clicking on the talk Icon in the windows panel.


Google Blogoscopednoticed something interesting there.
It reads: “play 23 21 13 16 21 19 . 7 1 13 5”.
Interesting.noticed these were all numbers that could represent letters from the alphabet (a = 1, b = 2, c = 3 and so on).
gives "play wumpus.game"

Felt very excited when I came to know about this. Tad tried with Wumpus sometime ago. Glad that Google has brought it back to spotlight!.

Wumpus Page has the C code as well. You can try it on your Linux/cygwin/windows(not sure) box.

GAIM does not seem to play wumpus.game on talk!

visual treat


Copy of IMG_22231, originally uploaded by gdatuk2k.

A good capture by Giri

Same Hot-Key (F) for two fields in Evolution



Bug!

Install Java Plugin for Firefox in Linux

Browser: Firefox 1.0.4
Distro: Fedora Core 4.
Need to Install Java Plugin.
- Download J2SE 1.5.0
- Install the RPM.
- Open a terminal and change to the Firefox plugin directory and symlink it the jre plugin just installed.

cd /usr/lib/firefox-1.0.4/plugins/
ln -s /usr/java/jdk1.5.0_04/jre/plugin/i386/ns7/libjavaplugin_oji.so

Help available at FireFox FAQ points to ns7-gcc29; linking to it Crashed my FireFox. So you need to link it to the correct plugin.
Faced problems like, only the root mode firefox displayed applets, but I tried again with uninstall and install and taking some care to be as user and then su to symlink and luckily the Java Plugin is installed for my FireFox!

Flash Player Installation for FireFox on Linux

Automatic Installation of Flash Plugin Failed.
After checking that Macromedia Flash was missing, giving the option to install,License Agreement etc.when proceeded to install. It failed and informed me to do a manual install.
- Flash Plugin can be downloaded here.
- extract and run the flashplayer-installer.
- it will ask:

Please enter the installation path of the Mozilla, Netscape,
or Opera browser (i.e., /usr/lib/mozilla):

Giving anything other than your Installed Browser's lib directory will fail.
Here,after googling and checking few forums, I did locate firefox | grep lib and got the answer as /usr/lib/firefox-1.0.4/. Yeah, Firefox
lib directory is at /usr/lib/firefox-X.X.X where X.X.X is the version number and plugin directory is present inside this.
-Verify your flash-plugin installation by checking this.
Note: I did not have to close my firefox browser when I installed the plugin.

Hollywood at its Best




Warne has survivied and excelled under conditions which are very different and not so normal.
Read the Nirmal Shekar's article here.

Troubleshooting X server resolution problem in Linux

X was in a very bad shape after I followed the workaround for the problem in FC4. Only 600X800 resolution was available. tried many things(Xorg -configure,system-config-display..etc),upto the downloading a new X11 and not knowing what to do. Finally went to the 600x800 mode only went to display resolutions and saw that video card is incorrectly indentified. Changed it to Intel 815e and restarted X. Now its working. I was thinking of reinstall FC4 to FC3 itself for this. :(

Library installation in linux

Libraries have been installed in:
/usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.



Most of time, I have been adding the path to the /etc/ld.so.conf and doing ldconfig. Need to understand the other options.

Re: Assignment for July 19

Senthil wrote :
> Write a Linked List Program in C and C++.
> Single Linked List only.
>
/* Linked List program. A very simple one to understand the basics */

#include<stdio.h>
#include<stdlib.h>

struct node {
int data;
struct node* next;
};

int main(int argc,char **argv)
{

struct node* head=NULL;
struct node* second=NULL;
struct node* third=NULL;

head=malloc(sizeof(struct node));
second=malloc(sizeof(struct node));
third=malloc(sizeof(struct node));

head->data=1;
head->next=second;

second->data=2;
second->next=third;
third->data=3;
third->next=NULL;

return 0;

}

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

/* Linked List Program in C Plus Plus */
#include<iostream>
using namespace std;

class list
{
private:
struct node {
int data;
struct node *next;
};
struct node *head,*first,*second;
public:
list();
~list();
void addnode();
};

list::list()
{
head=NULL;
first=NULL;
second=NULL;
}

list::~list()
{
while(head != NULL)
{
node *temp;
temp=head;
head=head->next;
delete temp;
}
}

void list::addnode()
{
head=(node *)malloc(sizeof(struct node));
first=(node *)malloc(sizeof(struct node));
second=(node *)malloc(sizeof(struct node));

head->data=1;
head->next=first;

first->data=2;
first->next=second;

second->data=3;
second->next=NULL;
}

int main(int argc,char **argv)
{

list listobj;
listobj.addnode();
}

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Observations:
- Struct node * head,first,second; does not serve the purpose. Either
they should as in the first program or as in the second program
- Allocation of memory, the first program accepted without typecasting
to (node *) whereas the second cpp program did not.

--
O.R.Senthil Kumaran
http://uthcode.sarovar.org

Unix Blog

http://unixblog.port5.com/
where I plan to put my unix learnings while working from home. Coz, I need to do ftp/rsync from the shell where the local unixblog folder will be present.

Its powered by Nanoblogger.
If you have a Unix Machine online, give it a try.

Re: Ant: Re: Ant: Re: link checker task ?

#include<stdio.h>
#include<expat.h>
#include<string.h>

#define string_t char *
#define XML_BUFFER_BLK 8192

void *
memalloc(size_t n)
{
void *mp;
int errno=0;
if((mp=(void *)calloc(n,sizeof(string_t)))==NULL)
fprintf(stderr,"Out of Memory");
return mp;
}

static void
link_start(void *data,const char *el,const char **attr)
{
int i=0;
printf("\n<%s>",el);

for(i=0;attr[i];i++)
printf("\n%s",*(attr+i));
}

static void
link_end(void *data,const char *el)
{
printf("\n<\\%s>\n\n",el);
/* why do we need this function */
}

int
link_parser(string_t filename)
{
XML_Parser parser;
char *xml_buf;
int flag;
size_t length;
FILE *fp;
string_t msg;

if((fp=fopen(filename,"rb"))==NULL)
{
fprintf(stderr,"Could not open the file");
exit(-1);
}

if((parser=XML_ParserCreate(NULL))==NULL)
{
fprintf(stderr,"Could not create the parser");
exit(-1);
}

XML_SetElementHandler(parser,link_start,link_end);

/* parse the document */

xml_buf=(string_t)memalloc(XML_BUFFER_BLK+1);

do
{
length=fread(xml_buf,1,XML_BUFFER_BLK,fp);
flag= length < strlen(xml_buf);

if(XML_Parse(parser,xml_buf,length,flag)==XML_STATUS_ERROR)
{
fprintf(stderr,"Parse Error at line %d\n%s\n",XML_GetCurrentLineNumber(parser),XML_ErrorString(XML_GetErrorCode(parser)));
exit(-1);
}

}while(!flag);

return 0;
}

int main(int argc,char **argv)
{
link_parser(argv[1]);

return 0;
}

Hi Alan,
Greetings!

I could manage to write a basic outline of the link-parser(self-contained).
I have output the tags and the way of identifying links. It will display
tags <a> ,href and URL. Got enormous help from expat doc,files as well as
digestp.c.

But these are yet to be done.
- Check to See if the resource being pointed exists.
- Generate link Report
I shall be working on it as well.

Please find my linkparser.c below (and as an attached file):
Let me know your comments:

---
#include<stdio.h>
#include<expat.h>
#include<string.h>

#define string_t char *
#define XML_BUFFER_BLK 8192

void *
memalloc(size_t n)
{
void *mp;
int errno=0;
if((mp=(void *)calloc(n,sizeof(string_t)))==NULL)
fprintf(stderr,"Out of Memory");
return mp;
}

static void
link_start(void *data,const char *el,const char **attr)
{
int i=0;
printf("\n<%s>",el);

for(i=0;attr[i];i++)
printf("\n%s",*(attr+i));
}

static void
link_end(void *data,const char *el)
{
printf("\n<\\%s>\n\n",el);
/* why do we need this function */
}

int
link_parser(string_t filename)
{
XML_Parser parser;
char *xml_buf;
int flag;
size_t length;
FILE *fp;
string_t msg;

if((fp=fopen(filename,"rb"))==NULL)
{
fprintf(stderr,"Could not open the file");
exit(-1);
}

if((parser=XML_ParserCreate(NULL))==NULL)
{
fprintf(stderr,"Could not create the parser");
exit(-1);
}

XML_SetElementHandler(parser,link_start,link_end);

/* parse the document */

xml_buf=(string_t)memalloc(XML_BUFFER_BLK+1);

do
{
length=fread(xml_buf,1,XML_BUFFER_BLK,fp);
flag= length < strlen(xml_buf);

if(XML_Parse(parser,xml_buf,length,flag)==XML_STATUS_ERROR)
{
fprintf(stderr,"Parse Error at line
%d\n%s\n",XML_GetCurrentLineNumber(parser),XML_ErrorString(XML_GetErrorCode(parser)));
exit(-1);
}

}while(!flag);

return 0;
}

int main(int argc,char **argv)
{
link_parser(argv[1]);

return 0;
}

---

Warm Regards,
Senthil

> Thanks for the update - I realise that it will take time to get up to
> speed (there is a lot to read through ;)
>
> All the best,
> Alan.
>
> senthil@puggy.symonds.net schrieb:
> Alan,
> Just to keep you updated. I am still reading the code,understanding and
> trying to get started.
> Understood the recent updates,which I viewed using cvs diff.
> I shall email you with things I can puttogether and with the questions I
> have.
>
> ~, just to keep you updated...
>
> Thanks a lot!
> Senthil
>
>
>
>
>> Thanks,
>>
>> In that case I will assign you the link task. Don't worry about the
>> other
>> bugs (incl. -d) option for now as these are code stability details
>> (rather
>> than features) so I will clean them up as I would like to create a
>> workable distribution tarball reasonably soon.
>>
>> Now that you have installed, configured and got rapple to run then any
>> feedback concerning the documentation on the web would also be useful
>> (or
>> indeed anything you think needs to be added to the faq).
>>
>> Regards,
>> Alan.
>>
>>
>> senthil@puggy.symonds.net schrieb:
>> Hi Alan,
>>
>> Yeah, I would like to work on this module.
>> I have updated the rapple cvs and saw the digest file as well. But did
>> not
>> check the functionality yet.
>> I shall work on both the parser and handler part. I was also looking
>> into
>> the -d option feature request.
>>
>> I shall start the work on Monday, if it is ok with you. else, u can
>> assign
>> me any other other task as well.
>>
>> I am going to attend my friends wedding tommrow and I will be back home
>> only on Monday.
>>
>> Thanks for explaining this to me. I have come across and coded few
>> parser
>> related snippets from K&R, Together with that and with the other rapple
>> files, I think I should be able to do this.
>>
>> Regards,
>> Senthil
>>
>>
>>
>>
>>> Senthil,
>>>
>>> Here is a suggestion for a self contained but
>>> challenging task you might be interested in: do you
>>> want to give a try at writing the link checker parser
>>> (Task 115866) ?
>>>
>>> The idea is that there are two files involved: a
>>> parser and a handler. The handler invokes the parser
>>> and passes files to it, e.g., the handler would
>>> recursively traverse a directory tree and invoke the
>>> parser on each transformable file it can find.
>>>
>>> The parser is limited to processing inndividual files
>>> but would work like this: it reads the input file and
>>> scans it looking for certain elements that have
>>> attributes that link to resources (e.g., "img", "a").
>>> When it finds such an element it checks the
>>> appropriate attribute (e.g., for "img" it is "src" and
>>> for "a" it is "href") and checks to see if the
>>> resource being pointed to exists (e.g., is the "src"
>>> or "href" file present in the datastore). For now I
>>> would not propose you check external links (e.g., if
>>> "href" begins with "http://" then just ignore it and
>>> also ignore "mailto:" links etc.) The parser should
>>> generate a link report as it goes along (perhaps just
>>> naming files that are missing).
>>>
>>> If you have never worked with parsers before (they can
>>> be a bit confusing at first) then take a look at
>>> "digestp.*" files (which are the parsers) and
>>> "catalog.*" (which are handlers) for the digest parser
>>> I wrote last weekend (you will have to update your
>>> local working copies if you have not done so
>>> recently).
>>>
>>> If you like I can write the handler for you so that
>>> you can focus on the parser - other parser examples
>>> can be found in the examples directory of the expat
>>> source code.
>>>
>>> Let me know what you think.
>>>
>>> Regards,
>>> Alan.

Cntl + Alt +Fn* Does not work in Fedora Core 4

Yeah, I faced it and there was a discussion about this at the Fedora Core list as well.

But thing is this is a bug in Fedora Core 4.Quite a serious one dude, especially if you cant switch to Virtual Terminal after X has loaded using Cntl+Alt+Fn.Finger poining to Somebug in latest X.org offering will not do.

For people who have stumbled here, try the below suggestion. It worked for me.

From Mike A. Harris
Bojan: Please try replacing the libvgahw.a module (after backing up the
original), with the following one:

ftp://people.redhat.com/mharris/libvgahw.a

This one is taken from the latest FC3 errata release, and many people
claim it solves the problem. If you could confirm this for me, it would
help us in solving the problem for a future update.

Thanks in advance.

Genesis



Imagine a world as being covered with a dark atmosphere, choking with smoke and clouds, air so thick that no light could glimmer through it - well, this is what our earth would soon look like. The black background symbolizes this darkness, pollution, smoke and all the bad elements arising out of man's creation.

With growing temperature, rising global warming, ozone layer depletion, and the earth is becoming a ball of fire. The varying shades of yellow, orange and red in concentric circles depict the exponential growth of the intensity of fire with time.

To prevent his cherished creation going in perils, God comes to rescue. This super human power extends his hand to help mankind. His touch creates a spark, giving rise to a strong thought of a new green revolution on earth. Man needs to be aware of this to bring back the old greener earth where he lived. As this small thought gets created on each human mind, the beautiful twigs sprout into tender green leaves.

Let this GENESIS of thought for a "green revolution" be deep rooted in the human mind.

- Collage by Praveen,Aarthi,Raj and Senthil prepared for the Environment day.

To known only uncommented lines

Whenever I look at any config files, it has some settings as well as comments on it.
Now I want to extract only the settings to a different file to concentrate on it,add more,delete etc. and keep the commented file for reference only.
How do I separate the settings from the comments.
For eg, In /etc/Muttrc
#
# System configuration file for Mutt
#

# default list of header fields to weed when displaying
#
ignore "from " received content- mime-version status x-status message-id
ignore sender references return-path lines

# imitate the old search-body function
macro index \eb '/~b ' 'search in message bodies'
---------------------------------------

Separate the following lines from above.

ignore "from " received content- mime-version status x-status message-id
ignore sender references return-path lines
macro index \eb '/~b ' 'search in message bodies'



:g/^#/d


and then saving to a different file should do.

man page under vim

<leader> K - thats it!

which means that the cursor is under the topic and you press Capital K.

ctags and some vim stuff

If you are editing a C program using vim, then create a tag file using ctags

:!ctags . [ . for the current file ]
OR
:!ctags * [ * for all the .c and .h files, if you are in a src directory]

Now, the next time you stumble across a function name,variable name and you want to know its declaration, then just do a CNRL + ]. Thats it! Quite useful.

Another feature of Vim is Auto-completion. for example
#include<expat.h> has number of XML related declarations typing the first few characters of variable and then doing CNTL+N
should provide you list for the auto-completion. Interesting, huh?

XML_ERROR_JUNK_AFTER_DOC_ELEMENT
XML_SetProcessingInstructionHandler
XML_SetUnparsedEntityDeclHandler
XML_SetExternalEntityRefHandlerArg

I could have never typed the above properly (without losing my sense, CNTL+N helped me)


...creating a tags file is the first thing I do when browsing a program
- Bram Moolenar in Vim: Seven habits of effective text editing.

gt

This is gt a shell script in my /usr/local/bin


#!/bin/bash

# Calling gnome-terminal which fills the display area
# hides the menu bar
# when used as a startup, this would give a terminal over the X
# Thus helping the people who have the habit of opening the gnome-terminal the first thing, they login in init 5.
# Those kind prefer init 3 in the /etc/initrd, but this script should help provide a near possible setup ;)

exec gnome-terminal --geometry=125x39+0+0 --hide-menubar --tab --active --tab --tab

exit 0

I have put this script to load as a startup program in GNOME using gnome-session-properties.
looking for command line way to include scripts / bins in the startup (when X starts).
Peeking through. the .gnome2 in the ~/ had some file called session-manual which had

[Default]
num_clients=2
0,RestartStyleHint=3
0,Priority=50
0,RestartCommand=/usr/bin/firefox
1,RestartStyleHint=3
1,Priority=50
1,RestartCommand=/usr/local/bin/gt

As always, there should be a better way, a more understandable way, to include a script/ bin to start automatically at the startup.



~

Commenting Lines using vim for bash,conf file etc

It was needed that I comment a number of lines in a file. The comments of a configuration file are usally like a # in the begining of the line.
So
Line 1
Line 2
Line 3
Should become

#Line 1
#Line 2
#Line 3

HOWTO:

1) Go to the First Column of the First Line.
2) Select the Block using cntl-v (for Linux) and cntl-q(for Windows, because cntl-v is mapped to paste function in gvim under windows)
3) With the Selected test, give the command :s/^/#/
4) That should do!

But vim users always look for yet another way, so I am.

Changeformat.sh

#!/bin/sh

# Change the Format from the ogg files in a directory to aiff

for i in `ls -1 *.ogg`
do
sox $i `echo $i|sed -e "s/ogg/aiff/"`

done

exit 0

Rapple

Rapple is Lightweight XML based transformation tool written in C that builds upon expat, tidylib and XSLT to tranform authored web content (incl. Word processor generated HTML) into styled web content suitable for publication.

Its a nice feeling when becoming member of a sourceforge project.
Thanks a lot Alan, for including me in the development list.
Try the Rapple Demo now!!

Is ``int* p;'' right or is ``int *p;'' right?

Both are "right" in the sense that both are valid C and C++ and both have exactly the same meaning. As far as the language definitions and the compilers are concerned we could just as well say ``int*p;'' or ``int * p;''

The choice between ``int* p;'' and ``int *p;'' is not about right and wrong, but about style and emphasis. C emphasized expressions; declarations were often considered little more than a necessary evil. C++, on the other hand, has a heavy emphasis on types.

A ``typical C programmer'' writes ``int *p;'' and explains it ``*p is what is the int'' emphasizing syntax, and may point to the C (and C++) declaration grammar to argue for the correctness of the style. Indeed, the * binds to the name p in the grammar.

A ``typical C++ programmer'' writes ``int* p;'' and explains it ``p is a pointer to an int'' emphasizing type. Indeed the type of p is int*. I clearly prefer that emphasis and see it as important for using the more advanced parts of C++ well.

The critical confusion comes (only) when people try to declare several pointers with a single declaration:

 int* p, p1; // probable error: p1 is not an int*
Placing the * closer to the name does not make this kind of error significantly less likely.
 int *p, p1; // probable error?
Declaring one name per declaration minimizes the problem - in particular when we initialize the variables. People are far less likely to write:
 int* p = &i;
int p1 = p; // error: int initialized by int*
And if they do, the compiler will complain. Whenever something can be done in two ways, someone will be confused. Whenever something is a matter of taste, discussions can drag on forever. Stick to one pointer per declaration and always initialize variables and the source of confusion disappears.

Bjarne Stroustrup

Network Install of Fedora Core

Tried with a Network Install of Fedora Core 4 Test 2. Not from the Fedora Download Server, but from the internal server where Linux isos are kept.

Network Install is easy as breeze.
There was directory called os where all the rpms,srpms where located.

1) Download and Write boot.iso. This was present inside: /os/images/
2) Boot using boot cd and select Network Install option ( I selected http)
3) Determines the DHCP, prompts for the Server name or IP and then Folder in which the Fedora Packages for the architecture are located.
4) Rest of Install is same as you with the cd.

Difference between network install and cd based install is, you dont have to download and write CDs and the network install is slower than install using cds. ( you can start the install at night,go to sleep and get the Fedora System up in the morning).

Internet through Tata Indicom

Using LG LSP -345
To Connect to Internet, got the help from avinashbrathod's page.

On Fedora Core 3:
Step 1: Setup wvdial.conf
#cat /etc/wvdial.conf
[Modem0]
Modem=/dev/ttyS0
Baud=115200
SetVolume=0
Dial Command = ATDT
init1=ATZ
init2=AT+CRM=1
FlowControl=Hardware(CRTSCTS)
[Dialer Indicom]
Username=internet
Password=internet
Phone=#777
Stupid Mode=1
Inherits = Modem0

Step 2:
#wvdial Indicom

[root@localhost Modem]# wvdial indicom
--> WvDial: Internet dialer version 1.54.0
--> Initializing modem.
--> Sending: ATZ
--> Sending: ATQ0
ATQ0
OK
--> Re-Sending: ATZ
ATZ
OK
--> Initializing modem.
--> Sending: ATZ
--> Sending: ATQ0
ATQ0
OK
--> Re-Sending: ATZ
ATZ
OK
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: AT+CRM=1
AT+CRM=1
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Tue Apr 12 10:43:17 2005
--> pid of pppd: 3613
--> Using interface ppp0

Ip addresses will be displayed.
This will have Primary DNS and Secondary DNS Addresses as well


Step 3: Copy the Primary DNS and Secondary DNS address to /etc/resolv.conf


nameserver [primary DNS]
nameserver [primary DNS]

Step 4: Shoot your FireFox and Go.

Captured Unix time 1111111111





Well its like being there during 22/2/2222! Just for a rough comparision to Gagan whom I found very difficult to persuade as to whats so special in this.

Unix time 2222222222 will be on Sat, 02 Jun 2040 03:57:02 GMT

1111111111

#!/bin/bash

while [ $(date +%s) != 1111111111 ]

do
echo "Not Yet!"
done

echo "Unix Time"

date +%s

echo "on `date`"
echo "so we captured the history!"

exit 0

How to print * continuously in vim

/***********************************************/
   These kind of lines might be required while commenting
/***********************************************/
 
The Command to use is simple appending the text.
[count]append[char]
 
- Press Esc to make sure you are in command mode.
- Press count. For eg: 10
- Press a. Mode changes to insert.
- Press the character to repeat. here it is *. one * will be inserted
- Press Esc. You will see the command take effect.
 
      **********
 
 

Mozilla FireFox Extension - Linky

In one the the previous posts, I had mentioned about a need to select a portion of the page, right click and open the hyperlinks in tabs.
Found something called Linky.

Sun Solaris 10


Tried Solaris today as Solaris 10 is now available for download and is applicable for x86 architecture.Dont really plan to move it, but wanted to check how it really looks.
Got a feel fo Java Desktop System ( thats Gnome!) and other things.

I will be getting more fam with Freak though.

Freak


Why would I want an LFS system?

There are a lot of reasons why somebody would want to install an LFS system. The question most people raise is 'why go through all the hassle of manually installing a Linux system from scratch when you can just download an existing distribution?'. That is a valid question which I hope to answer for you.

The most important reason for LFS's existence is teaching people how a Linux system works internally. Building an LFS system teaches you about all that makes Linux tick, how things work together, and depend on each other. And most importantly, how to customize it to your own taste and needs.

One of the key benefits of LFS is that you are in control over your system without having to rely on somebody else's Linux implementation. You are in the driver's seat now and are able to dictate every single thing such as the directory layout and boot script setup. You will also know exactly where, why and how programs are installed.

Another benefit of LFS is that you can create a very compact Linux system. When you install a regular distribution, you end up installing a lot of programs you probably would never use. They're just sitting there taking up (precious) disk space. It's not hard to get an LFS system installed under 100 MB. Does that still sound like a lot? A few of us have been working on creating a very small embedded LFS system. We installed a system that was just enough to run the Apache web server; total disk space usage was aproximately 8 MB. With further stripping, that can be brought down to 5 MB or less. Try that with a regular distribution.

If we were to compare a Linux distribution with a hamburger you buy at a supermarket or fast-food restaurant, you would end up eating it without knowing precisely what it is you are eating, whereas LFS gives you the ingredients to make a hamburger. This allows you to carefully inspect it, remove unwanted ingredients, and at the same time allow you to add ingredients to enhance the flavour of your hamburger. When you are satisfied with the ingredients, you go on to the next part of putting it together. You now have the chance to make it just the way you like it: broil it, bake it, deep-fry it, barbeque it, or eat it raw.

Another analogy that we can use is that of comparing LFS with a finished house. LFS will give you the skeleton of a house, but it's up to you to install plumbing, electrical outlets, kitchen, bathtub, wallpaper, etc.

Another advantage of a custom built Linux system is added security. You will compile the entire system from source, thus allowing you to audit everything, if you wish to do so, and apply all the security patches you want or need to apply. You don't have to wait for somebody else to provide a new binary package that fixes a security hole. Besides, you have no guarantee that the new package actually fixes the problem (adequately). You never truly know whether a security hole is fixed or not unless you do it yourself."




I had my Freak ready on Feb 22, 2005. Excited!

LFS User ID:14897

FireFox and Slashdot

I guess Firefox and Slashdot are very poor companions!



First is this bug which I often face, while trying to submit a story or while commenting!



Invalid form key: Q9jRDo9JhK



Chances are, you're behind a firewall or proxy,

or clicked the Back button to accidentally reuse a form.

Please try again. If the problem persists, and all other options

have been tried, contact the site administrator."

I've mailed this to the Bill Cowboy as well.

This is not observed /encountered if using M$ ie.





And the next most irritating thing I am facing with FireFox + Slashdot is: My Login is not retained.



I login to slashdot and have customized light-weight outlook with reading only +5 comments. But I tend to lose the logged in account inconsistenly. Sometimes, just hitting the refresh button. sometimes while doing "Read More" in a new tab, times when trying to submit a story, times when commenting.



If this happened to you, would you not be irritated?

I thought it was some cookie related, but set things right ( to accept all cookies and retain cookies from parent site) but nothing worked!



Has anyone else faced the same problem? Am I alone in this world?

Ode to a School Computer

Ode to a School Computer
By David Ahl

I was stay'in after school a week or so ago
'Cause I told a teacher where she could go

She had me settin' in this big old room
With a bunch of machines that just looked like doom

There's this big Mutha machine with flashing' lights
And a couple of funny-looking' electric typewrites

Well I thought I'd type somethin' for the fun of it
So I hunted and pecked out just one word - "shit"

Before I could lean back in my chair and get steady
That machine typed WHAT, and then it said READY

So I typed a whole line of them four-letter words
But it just replied WHAT and READY like it hadn't heard

Well I figured since I couldn't go out fishin'
I'd teach that stupid machine to listen

So I picked up this book called Teach yourself BASIC
And sat down at that Teletype prepared to face it

First I found to make that machine type my bit
I just had to put a PRINT in front of it

And then I found out that thing could add
And subtract and multiply and divide like mad

I found out too it knew all kinds of games
Like craps and blackjack and a cannon to aim

I was havin' all kinds of fun when that teacher walked in
She just looked at my output and started to grin

I kind of sheepishly asked if I could stay a while more
She said: "Sure; when you just shut the door".

I tried some more games like football and poker
And a parachute jump written by some kind of joker

There was one where I could try to land on the moon
It would crash and blow up if fired the engines too soon

Well, I played on through supper and into the night
And then finally quit when I saw dawn's first light.

Some girls, I know are while lot cuter
But I found a new kind of high with that computer.

find in linux

find / -name "regex"

find / | xargs grep -r -A5 -B5 "regex"

LiveJournalPhoe6 journalPhoe6 friends
Get your own code!

Google Summer of Code

Powered By Blogger