Sunday, May 28, 2006

Learn how to comment

This wikipedia tells about different commenting styles and how they can be helpful while programming.
http://en.wikipedia.org/wiki/Comment#Summary

Comments could summarise code or explain the programmer's intent. This is called the why rather than how approach. The two are often close, but not always. According to this school of thought, restating the code in plain English may be a waste of time; the need to explain the code may be a sign that it is too complex and should be rewritten.

"Don't document bad code – rewrite it" (The Elements of Programming Style, Kernighan & Plauger).
"Good comments don't repeat the code or explain it. They clarify its intent. Comments should explain, at a higher level of abstraction than the code, what you're trying to do." (Code Complete, McConnell)
Happy Coding !!
Link from : Kshitij's Blog

vi survival guide

A comprehensive guide to a famous text editor "vi", written in vi itself.

read more | digg story

Installing and using Linux for the total newbie

So you've heard about Linux and you want to try it out, but you're scared you may screw up Windows or that it's too hard to install. Well fear no longer, here is a guide for the total newbie.

read more

I'm Back...

Now i'm back here after enjoying holidays at home...

Sunday, April 23, 2006

Endsems..

I had been not able to post here as my semester end exams are going on....
So will be back when these are over.....

Wednesday, April 19, 2006

State of the Blogosphere

David Sifry posted Sifry's Alerts: State of the Blogosphere, April 2006 Part 1: On Blogosphere Growth at technorati weblog:

The State of the Blogosphere is strong. The blogosphere is over 60 times bigger than it was only 3 years ago.
The Facts:

  • Technorati now tracks over 35.3 Million blogs
  • The blogosphere is doubling in size every 6 months
  • It is now over 60 times bigger than it was 3 years ago
  • On average, a new weblog is created every second of every day
  • 19.4 million bloggers (55%) are still posting 3 months after their blogs are created
  • Technorati tracks about 1.2 Million new blog posts each day, about 50,000 per hour
The blogosphere tracked by technorati is doubling about every 6 months, as the chart below shows:


read more

Wednesday, April 12, 2006

graph plotting with gnuplot

Gnuplot is a free, command-driven, interactive, function and data plotting program.
Here i' m providing a quick reference guide for plotting graphs (as many of us don't bother to go in detailed documentation).
On Unix/Linux systems start Gnuplot by simply typing:
gnuplot

first the formal syntax :

plot {[ranges]}
{[function] | {"[datafile]" {datafile-modifiers}}}
{axes [axes] } { [title-spec] } {with [style] }
{, {definitions,} [function] ...}

To plot functions simply type: plot [function] at the gnuplot> prompt
gnuplot> plot sin(x)
gnuplot> splot sin(x*y/20)
gnuplot> plot sin(x) title 'Sine Function', tan(x) title 'Tangent'


Now for plotting data points firstly data points should be written in text file with axis ranges as columns.Data files should have the data arranged in columns of numbers. Columns should be separated by white space (tabs or spaces) only, (no commas). Lines beginning with a # character are treated as comments and are ignored by Gnuplot. A blank line in the data file results in a break in the line connecting data points. '
Plotting a graph from data file "plot.data" , do
gnuplot>plot "plot.data"

Now customizing the plot :



set xlabel "x-axis data"

# will set a label "x-axis data" in graph
set ylabel "y-axis data"

set title "x vs y"
# will set title for graph
set xrange [0.001:0.005]
# Change the x-axis range:
set yrange [20:500]
# Change the y-axis range:
set logscale
# plot using log scale
set autoscale
#let gnuplot determine ranges
plot "file.data" with lines
#will join data points with lines
plot "file.data" smooth csplines with lines
#will join plot graph using smooth curves
Gnuplot can mathematically modify your data column by column:
to plot sin( col.3 + col.1 ) vs. 3 * col.2 type:

plot 'force.dat' using (3*$2):(sin($3+$1))

To print graph (this will store graph in post script(.ps) file do this before plotting graph:

set output "graphs.ps"
set terminal postscript
plot "file.data" using lines


This will save the graph in graph.ps
For more help type 'help' in gnuplot mode :
gnuplot>help


somelinks
www.duke.edu/~hpgavin/gnuplot.html
A simple guide to GNU plot
Introduction to GNU plot