My Tech notes: October 2008
Subscribe

Unix Documentation

Free Online Unix Training Materials

Lists many links to free Unix training materials.

Pointers and Arrays Materials

Pointers and Arrays materials Explained for C beginners

C FAQ and General Questions C Interview Questions

Powered By

Free XML Skins for Blogger

Powered by Blogger

Thursday, October 30, 2008

strtok Simple Usage Example string words seperate

How to get string words separate? Separate each word from string of /share/test/
Here is simple code snippet which also demonstrate use of string token (strtok() function);
Below is simple C code;
#include 
#include

int main()
{
char df_buf[120];
char *name1,*result;
int i;
char *tmp;
char str_array[7][50];

strcpy(df_buf,"/share/test/path/");
result=strtok(df_buf,"/");

//printf("%s\n",result);
while(result!=NULL)
{
tmp=strdup(result);
strcpy(str_array[i],tmp);
result=strtok(NULL,"/");
printf("%s and %s\n",result,tmp);
i++;
}
printf("i=%d\n",i);
printf("%s\n",str_array[0]);
printf("%s\n",str_array[1]);
printf("%s\n",str_array[2]);
return 0;
}
The output will be
share
test
path
ie /share/test/path string is separated into words;

Wednesday, October 29, 2008

Delete Last Char in String C program Simple Way

How to delete the last character in a string?
Lets say I have a string "/data/share/" I want to delete the last character from the string ie "/" so that output will be "/data/share"; Here are some methods to do this in C language.
one way could be use of strncat() function;
char * strncat(char *restrict s1, const char *restrict s2, size_t n);
The strncat() function appends not more than n characters from s2, and
then adds a terminating `\0'.
  #include 

Another simple way is,
say the string variable is str_p
Then simply put
str_p[(strlen(str_p)-1)] = '\0';
And you are done;

Tuesday, October 28, 2008

Source Code Browsing In Linux-CTAGS usage

How to use ctags command in linux? explained in simple steps.
CTAGS is a good utility for source code browsing in Linux through vi editor. To use ctags , at the source code directory enter

# ctags -uR *

This will create tags file in the source code.

Open a file in that source code using vi editor & set the tags file for that file using " ESC + :set tags=tags" ( path of tags file . if it is at different level then give the entire path like ../tags or ../../tags ).

Once the tag file is set for that file, then you can look the at function definitions, variable declarations, .......... by placing the cursor on that function call or variable & press "CRTL + }" and for coming back to same place press "CTRL + t" key sequence.

Follow CTAGS documentation for more insight.

Monday, October 27, 2008

Encyclopedia of Life

Highly attractive and important website.
clipped from www.eol.org
The Encyclopedia of Life (EOL) is an ambitious project to organize and make available via the Internet virtually all information about life present on Earth.
At its heart lies a series of Web sites—one for each of the approximately 1.8 million known species. Each site is constantly evolving and features dynamically synthesized content ranging from historical literature and biological descriptions to stunning images, videos and distribution maps.
Join us as we explore the richness of Earth’s biodiversity!
clipped from www.eol.org
SCARLET IBIS
clipped from www.eol.org
Dolomedes triton
clipped from www.eol.org
STOAT
clipped from www.eol.org
CADDISFLY
clipped from www.eol.org
HOUSE MOUSE
 blog it

Friday, October 24, 2008

Diwali Decoration Rangoli Design Youtube Collection

How to make simple diwali design or rangoli, check out below selected videos from youtube;
This diwali I made some design; Diwali Decoration Rangoli Design Youtube Collection
Diwali Rangoli


Rangoli making


Rangoli Floor Designs

want to send some free animated e-cards check this link
To send you dipavali wishes in marathi read more;

Thursday, October 23, 2008

SAMBA Access From Windows Error

When I was trying to access samba shares from windows I was able to access the shares with entered user name and password but that was happening only once; as windows was storing the session details; I was not able to login with different user name other share access; I was getting error
"Multiple connections to a server or shared resource by the same user,
using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again.."

one solution to this is reboot the windows system and try again. But that's very rude solution.
Simple solution is
Open a Command Prompt and type these commands:

net use (to see all existing connections)
net use * /del /yes (to delete all existing connections)
Great..

Wednesday, October 22, 2008

About NTFS Tools and Library ntfsprogs Download

NTFS file system one can make use of it from ARM-Linux using below two methods one is install and down load user space modules and other approach is install and download kernel space drivers.

ntfsmount is part of ntfsprogs package. It relies on libntfs, thus it has more features than kernel driver.
ntfsmount supports file overwrite with changes to file size, has limited file and directory creation/deletion support, can operate with named data streams and supports special Interix files (symlinks, block and character devices, FIFOs and sockets).

Requires FUSE- Filesystem in userspace
download FUSE
http://fuse.sourceforge.net/

Download NTFS Tools and Library for ntfsprogs
The ntfsprogs package contains userspace tools: mkntfs, ntfscat, ntfsclone, ntfscluster, ntfscp, ntfsfix,
ntfsinfo, ntfslabel, ntfsls, ntfsresize, ntfsundelete, etc and a shared NTFS library. This package does not require nor contain the NTFS kernel driver.
http://www.linux-ntfs.org/doku.php?id=downloads

for Kernel driver
The NTFS-3G driver supported read/write NTFS driver for Linux,
It provides safe and fast handling of the Windows XP, Windows Server 2003, Windows 2000 and Windows Vista file systems.
http://www.ntfs-3g.org/index.html
Will add more once I done with NTFS.

Monday, October 20, 2008

Never Say Die: Why We Can't Imagine Death

The common view of death as a great mystery usually is brushed aside as an emotionally fueled desire to believe that death isn’t the end of the road. And indeed, a prominent school of research in social psychology called terror management theory contends that afterlife beliefs, as well as less obvious beliefs, behaviors and attitudes, exist to assuage what would otherwise be crippling anxiety about the ego’s inexistence.

Yet a small number of researchers, including me, are increasingly arguing that the evolution of self-consciousness has posed a different kind of problem altogether. This position holds that our ancestors suffered the unshakable illusion that their minds were immortal, and it’s this hiccup of gross irrationality that we have unmistakably inherited from them. Individual human beings, by virtue of their evolved cognitive architecture, had trouble conceptualizing their own psychological inexistence from the start.
clipped from www.sciam.com
  • Almost everyone has a tendency to imagine the mind continuing to exist after the death of the body.
  • Even people who believe the mind ceases to exist at death show this type of psychological-continuity reasoning in studies.
  • Rather than being a by-product of religion or an emotional security blanket, such beliefs stem from the very nature of our consciousness.
  • yet people in every culture believe in an afterlife of some kind or, at the very least, are unsure about what happens to the mind at death. My psychological research has led me to believe that these irrational beliefs, rather than resulting from religion or serving to protect us from the terror of inexistence, are an inevitable by-product of self-consciousness.
    Because we have never experienced a lack of consciousness, we cannot imagine what it will feel like to be dead. In fact, it won’t feel like anything—and therein lies the problem.
     blog it

    Thursday, October 16, 2008

    Beautiful Women in Beautiful Dresses by J.W. Waterhouse

    - oh and a mermaid
    John William Waterhouse: The Crystal Ball [with the skull] - 1902
    Waterhouse's works are perhaps the best of the Pre-Raphaelites (although really a Neoclassic). His combination of mythology, poetry and mystique femme fatale is absolutely outstanding and soulfully touching
     Fair
    Rosemund
    Psyche
    opening the Golden Box
     Destiny
    Ophelia
    Lady of
    Shallot
    Ophelia
    The Lady
    Clare
    Lamia
    St. Cecilia
    Finding the
    head of  Orpheus
    Miranda the Tempest
    Circe
    Invidiosa 
    The
    Charmer    
    Cupids Garden
     I am
    half sick of shadows
    Nymps
    finding the head of
    Orpheus
    The Rose
    The
    Mermaid      
    Pandora
    Boreas
    La Belle
    At the Shrine
    Circe
    offering the cup to Ulysses
    Juliet
    Miranda in
    the South
    The Sorceress
    The picture
    Flora
    Gather Ye
    Rosebuds
    The Danaides
    The Magic
    Circle
    Ariandne
    Thisbe
    Apollo and
    Daphine
    Echo and
    Narcissus
    Penelope and
    the Suitors
    Sweet Summer
    The
    Awakening of Adonis
     blog it