Tuesday, May 31, 2005

C++ code: Decimal to Hex and viceversa

Decimal to Hex
char* decimalToHex(int dec)
static char hexStr[2];
char *str="0123456789ABCDEF";
hexStr[1] = str[(dec & 15)];
hexStr[0] = str[(dec >> 4)];
return hexStr;

Hex to Decimal

static int hexToDec(char chr)
char* str = "0123456789ABCDEF";
char modifiedChar = toupper(chr);
int index = -1;
int i=0;
for (i = 0; i < 16;i++)
if (str[i] == modifiedChar)
return index;

Monday, May 30, 2005

Science: Innovators are older than ever

Slashdot article

Tuesday, May 17, 2005

Engineering and Consciousness

Princeton Engineering Anomalies Research

Scientific study of consciousness related physical phenomenon

For Brains rusted with Logic


- Azim Premji

Every company normally faces one common problem of high employee turnout ratio. People are leaving the company for better pay, better profile or simply for just one reason' pak gaya '. This article might just throw some light on the matter......

Early this year, Arun, an old friend who is a senior software designer, got an offer from a prestigious international firm to work in its India operations developing specialized software. He was thrilled by the offer. He had heard a lot about the CEO of this company, charismatic man often quoted in the business press for his visionary attitude.
The salary was great. The company had all the right systems in place employee-friendly human resources (HR) policies, a spanking new office, and the very best technology, even a canteen that served superb food. Twice Arun was sent abroad for training. "My learning curve is the sharpest it's ever been," he said soon after he joined. "It's a real high working with such cutting edge technology." Last week, less than eight months after he joined, Arun walked out of the job. He has no other offer in hand but he said he couldn't take it anymore. Nor, apparently, could several other people in his department who have also quit recently. The CEO is distressed about the high employee turnover. He's distressed about the money he's spent in training them. He's distressed because he can't figure out what happened. Why did this talented employee leave despite a top salary? Arun quit for the same reason that drives many good people away. The answer lies in one of the largest studies undertaken by the Gallup Organization. The study surveyed over a million employees and 80,000 managers and was published in a book called First
Break All The Rules. It came up with this surprising finding: If you're losing good people, look to their immediate supervisor. More than any other single reason, he is the reason people stay and thrive in an organization. And he's the reason why they quit, taking their knowledge, experience and contacts with them. Often, straight to the competition. "People leave managers not companies," write the authors Marcus Buckingham and Curt Coffman. "So much money has been thrown at the challenge of keeping good people - in the form of better pay, better perks and better training - when, in the end, turnover is mostly manager issue." If you have a turnover problem, look first to your managers. Are they driving people away? Beyond a point, an employee's primary need has less to do with money, and more to do with how he's treated and how valued he feels. Much of this depends directly on the immediate manager. And yet, bad bosses seem to happen to good people everywhere.. A Fortune magazine survey some years ago found that nearly 75 per cent of employees have suffered at the hands of difficult superiors. You can leave one job to find - you guessed it, another wolf in a pin-stripe suit in the next one. Of all the workplace stressors, a bad boss is possibly the worst, directly impacting the emotional health and productivity of employees. HR experts say that of all the abuses, employees find public humiliation the most intolerable. The first time, an employee may not leave, but a thought has been planted.. The second time, that thought gets strengthened. The third time, he starts looking for another job. When people cannot retort openly in anger, they do so by passive aggression. By digging their heels in and slowing down. By doing only what they are told to do and no more. By omitting to give the boss crucial information. Dev says : "If you work for a jerk, you basically want to get him into trouble. You don't have your heart and soul in the job."
Different managers can stress out employees in different ways - by being too controlling, too suspicious, too pushy, too critical, but they forget that workers are not fixed assets, they are free agents. When this goes on too long, an employee will quit - often over seemingly trivial issue.
It isn't the 100th blow that knocks a good man down. It's the 99 that went before. And while it's true that people leave jobs for all kinds of reasons- for better opportunities or for circumstantial reasons, many who leave would have stayed - had it not been for one man constantly telling them, as Arun's boss did: "You are dispensable. I can find dozens like you." While it seems like there are plenty of other fish especially in today's waters, consider for a moment the cost of losing a talented employee.There's the cost of finding a replacement. The cost of training the replacement. The cost of not having someone to do the job in the meantime. The loss of clients and contacts the person had with the industry. The loss of morale in co-workers. The loss of trade secrets this person may now share with others. Plus, of course, the loss of the company's reputation. Every person who leaves a corporation then becomes its ambassador, for better or for worse. We all know of large IT companies that people would love to join and large television companies few want to go near. In both cases, former employees have left to tell their tales. "Any company trying to compete must figure out a way to engage the mind of every employee," Jack Welch of GE once said. Much of a company's value lies "between the ears of its employees". If it's bleeding talent, it's bleeding value. Unfortunately, many senior executives busy travelling the world, signing new deals and developing a vision for the company, have little idea of what may be going on at home.That deep within an organization that otherwise does all the right things, one man could be driving its best people away.

Sunday, May 15, 2005

Next Step in Human Evolution

Genetics, cybernetics complicate forecast for species

Discussion in Slashdot

Wednesday, May 11, 2005

India eyes open-source license


A Vision of Terror

New visualization software tools give intelligence officers the ability to create special representations of digital communications. And that, they say, is helping track down terrorists. By John Gartner.

Search engines may be more than adequate to comparison shop or to identify the capital of Moldova (it’s Chisinau) -- but searching the electronic universe to find patterns indicating terrorist activity requires higher-caliber technology.

A new generation of software called Starlight 3.0, developed for the Department of Homeland Security by the Pacific Northwest National Laboratory (PNNL), can unravel the complex web of relationships between people, places, and events. And other new software can even provide answers to unasked questions.
Anticipating terrorist activity requires continually decoding the meaning behind countless emails, Web pages, financial transactions, and other documents, according to Jim Thomas, director of the National Visualization and Analytics Center (NVAC) in Richland, Washington.
Federal agencies participating in terrorism prevention monitor computer networks, wiretap phones, and scour public records and private financial transactions into massive data repositories.
"We need technologies to deal with complex, conflicting, and sometimes deceptive information," says Thomas at NVAC, which was founded last year to detect and reduce the threats of terrorist attacks.
In September 2005, NVAC, a division of the PNNL, will release its Starlight 3.0 visual analytics software, which graphically displays the relationships and interactions between documents containing text, images, audio, and video.
The previous generation of software was not fully visual and contained separate modules for different functions. It has been redesigned with an enhanced graphical interface that allows intelligence personnel to analyze larger datasets interactively, discard unrelated content, and add new streams of data as they are received, according to John Risch, a chief scientist at Pacific Northwest National Laboratory.
Starlight quadruples the number of documents that can be analyzed at one time -- from the previous 10,000 to 40,000 -- depending on the type of files. It also permits multiple visualizations to be opened simultaneously, which allows officers for the first time to analyze geospatial data within the program. According to Risch, a user will be able to see not only when but where and in what proximity to each other activities occurred.
"For tracking terrorist networks, you can simultaneously bring in telephone intercepts, financial transactions, and other documents…all into one place, which wasn't possible before," Risch says.
The Windows-based program describes and stores data in the XML (extensible markup language) format and automatically converts data from other formats, such as databases and audio transcriptions.
Risch says that as the volume of data being collected increases, the software has to be more efficient in visually representing the complex relationships between documents. "Starlight can show all the links found on a Web page, summarize the topics discussed on those pages and how they are connected [to the original page]."

PNNL is also continuing to enhance IN-SPIRE, its software that extracts the meaning of large datasets and allows users to pose alternative hypotheses and to see data supporting that scenario, according to director Thomas. For instance, an analyst could posit that Osama Bin Laden is planning an attack on a European nation at a given time and with a particular weapon. IN-SPIRE will look for relationships between documents validating the hypothesis; for example, the software would look for the most likely nearby locations where such a weapon could be acquired and if secondary or tertiary associates have visited those areas.

Thomas says IN-SPIRE can search documents in multiple languages simultaneously and enables the "discovery of the unexpected," says Thomas.
Visualizations generated by both of PNNL’s programs graphically depict relationships between content by displaying them in a variety of formats, such as a star cluster showing more popular topics as larger stars; topographic maps; or a river of information showing interest in a topic over time. Generating visualizations instead of relying on text-based searches "allows the human mind insight into fuzzy relationships and tries to resolve uncertainty," says Thomas.
NVAC is not the only organization developing analytical software for the federal government. The Department of Defense is using software from Intelligenxia called IxReveal to track online message threads and give "answers to questions that haven't been asked," according to Ren Mohan, co-chairman and CTO of the Jacksonville, Florida-based data analysis company.
Mohan says that, because "we often don’t know what we don't know" about terrorist activities, analysts employ the company's IxReveal to extract the topics that are being discussed most frequently rather than searching for specific items. This approach can overcome analyst bias by exposing all of the important concepts currently being discussed in chat rooms, email, or user groups, according to Mohan.

IxReveal can drill down through multiple paths simultaneously, enabling analysts to see multiple dimensions and possibilities, according to Mohan. The value of textual data is often hidden and must be extracted by automatically identifying key ideas that focus on concepts instead of the details, and do so in a timely fashion, he says.
"We are trying to address the secondary questions (about data)," Mohan says, adding that his company takes input from analysts to refine the technology.

Not so surprisingly, the number of researchers working on visualization software will greatly increase this year. What’s more, the Department of Homeland Security is looking to create new generations of terrorism-tracking software by tapping into the "fresh ideas" of current university students, according to NVAC's Thomas.

This year, NVAC will establish five regional analytics centers to tackle specific applications for fighting terrorism. It has selected Stanford University as the first center, with a mission that includes analyzing computer networks to detect network intrusions. The regional centers will be a way to introduce both students and faculty to anti-terror efforts and the science of protecting homeland security, according to Thomas.

Thomas said 85 people are currently working on NVAC's software development effort, and up to 500 individuals could be involved after all of the regional centers are established.
"The biggest challenge is getting a common understanding of the core science" used to analyze large volumes of data, Thomas said. "If we can clearly articulate it, then that's half the problem solved."

Monday, May 09, 2005

Does the future belong to China ?

An article in the MSN Newsweek

'Extremely Critical' Bugs Found In Firefox

By Gregg Keizer, TechWeb News

A pair of unpatched vulnerabilities in Mozilla's Firefox Web browser -- rated as "extremely critical" by one security firm -- could allow an attacker to take control of a PC simply by getting a user to visit a malicious Web site, Mozilla said Sunday.

Because proof-of-concept code has been leaked -- as were the vulnerabilities -- before a patch was ready, Mozilla recommended that Firefox users either disable JavaScript or lock down the browser so it doesn't install additional software, such as extensions" or themes, from Web sites.

The vulnerabilities were discovered by a pair of security researchers, who had notified Mozilla earlier in the month, but were keeping mum until a patch was written. However, details of the vulnerabilities were leaked by someone close to one of the researchers.

According to Danish security vendor Secunia, which tagged the bugs with a highest "extremely critical" warning -- the first time it's used that to describe a Firefox flaw -- a hacker can trick the browser into thinking a download is coming from one of the by-default sites permitted to install software automatically: addons.mozilla.org or update.mozilla.org.

"Changes to the Mozilla Update web service have been made to mitigate the risk of an exploit," the Foundation announced on its security site Sunday. Specifically, Mozilla re-pointed the two update sites to a new URL, and instructed users not to add that new site to their list of Allowed Sites. The change, however, only defends against the current proof-of-concept that's circulating, not the vulnerabilities themselves.

While that reduced the risk of an immediate attack, Mozilla doesn't have control over the numerous sites that users might have added to their Allow, or whitelist, list. Popular plug-ins, called "extensions" by Firefox, could also be the root of attacks, since users must give an extension site installation permission. To close all possible doors, Mozilla recommended that users either disable JavaScript or turn off installation from Web sites. To disable Web site software installs, users can select Tools/Options/Preferences in Firefox 1.0.3, the current edition. Users can still install extensions or user interface themes manually by first downloading the file, then running them from Firefox's File menu.

A security update -- which will be dubbed Firefox 1.0.4 -- will be issued as soon as possible. "Mozilla is aggressively working to provide a more comprehensive solution to these potential vulnerabilities and will provide that solution in a forthcoming security update," the organization's security alert continued.

While the leaked information included proof-of-concept code that demonstrated how a malicious site could run code of the attacker's choice and install it on machines using Firefox, Mozilla discounted the risk. "There are currently no known active exploits of these vulnerabilities," it said Sunday. The release of Firefox 1.0.4 would be the fourth security update to the browser since the beginning of the year. Others appeared in late February, late March, and mid-April. In that time, Microsoft has released two patches for its Internet Explorer browser.


Rotation in OpengGl

Fixed the rotation for the rendered colon mesh in opengl.

Basic problem was the disabling of the reshape(width,height) function in the main.

got a better idea about the mouse rotation concept in OpenGl.

Here is a link

The source code is given as under

static GLuint tb_lasttime;
static GLfloat tb_lastposition[3];

static GLfloat tb_angle=0.0;
static GLfloat tb_axis[3];
static GLfloat tb_transform[4][4];
static GLuint tb_width;
static GLuint tb_height;

static GLint tb_button=-1;
static GLboolean tb_tracking=GL_FALSE;
static GLboolean tb_animate=GL_TRUE;

float dx,dy,dz;
int rotate_id,zoom_id,pan_id;

static void _tbPointToVector(int x,int y,int width,int height,float v[3])
float d,a;

v[0] = (2.0 * x - width) / width;
v[1] = (height - 2.0 * y) / height;
d = sqrt(v[0] * v[0] + v[1] * v[1]);
v[2] = cos((3.14159265 / 2.0) * ((d < 1.0) ? d : 1.0));
a = 1.0 / sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
v[0] *= a;
v[1] *= a;
v[2] *= a;

static void

_tbStartMotion(int x, int y, int button, int time)
assert(tb_button != -1);

tb_tracking = GL_TRUE;
tb_lasttime = time;
_tbPointToVector(x, y, tb_width, tb_height, tb_lastposition);

_tbStopMotion(int button, unsigned time)
assert(tb_button != -1);

tb_tracking = GL_FALSE;

if (time == tb_lasttime &&amp; tb_animate) {
} else {
tb_angle = 0.0;
if (tb_animate)

tbAnimate(GLboolean animate)
tb_animate = animate;

tbInit(GLuint button)
tb_button = button;
tb_angle = 0.0;

/* put the identity in the trackball transform */
glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat *)tb_transform);

assert(tb_button != -1);

if (rotate_id)
glRotatef(tb_angle, tb_axis[0], tb_axis[1], tb_axis[2]);
else if (zoom_id)
else if (pan_id)
glMultMatrixf((GLfloat *)tb_transform);
glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat *)tb_transform);

glMultMatrixf((GLfloat *)tb_transform);

tbReshape(int width, int height)
assert(tb_button != -1);

tb_width = width;
tb_height = height;

tbMouse(int button, int state, int x, int y)
assert(tb_button != -1);

if (state == GLUT_DOWN && button == tb_button)
_tbStartMotion(x, y, button, glutGet(GLUT_ELAPSED_TIME));
else if (state == GLUT_UP && button == tb_button)
_tbStopMotion(button, glutGet(GLUT_ELAPSED_TIME));

tbMotion(int x, int y)
GLfloat current_position[3];

assert(tb_button != -1);

if (tb_tracking == GL_FALSE)

_tbPointToVector(x, y, tb_width, tb_height, current_position);

/* calculate the angle to rotate by (directly proportional to the
length of the mouse movement */
dx = current_position[0] - tb_lastposition[0];
dy = current_position[1] - tb_lastposition[1];
dz = current_position[2] - tb_lastposition[2];
tb_angle = 90.0 * sqrt(dx * dx + dy * dy + dz * dz);

/* calculate the axis of rotation (cross product) */
tb_axis[0] = tb_lastposition[1] * current_position[2] -
tb_lastposition[2] * current_position[1];
tb_axis[1] = tb_lastposition[2] * current_position[0] -
tb_lastposition[0] * current_position[2];
tb_axis[2] = tb_lastposition[0] * current_position[1] -
tb_lastposition[1] * current_position[0];

/* reset for next time */
tb_lasttime = glutGet(GLUT_ELAPSED_TIME);
tb_lastposition[0] = current_position[0];
tb_lastposition[1] = current_position[1];
tb_lastposition[2] = current_position[2];

/* remember to draw new position */

void reshape(int w,int h)


void mouse(int button,int button_state,int x,int y)

void motion(int x,int y)

void rotate(int=0)


void init(void)



void idle()

void refresh(int=0)

void instance(int=0)

void dispmode(int=0)

void display()


/* RENDER mesh here */


void main(int argc, char* argv)

/* initialize */



/* other formalities */


Not the best code to enable totally flexible, trackball-type movement of the image, but the code does serve it's purpose of providing basic rotation in order to view the colon from a different angle.

Saturday, May 07, 2005

Dances With Robots

Japan is working on a new generation of humanoid robots that may change once and for all the way we relate to our machines.
A humanoid robot named 'Actroid', able t
Yoshikazu Tsuno / AFP-Getty Images
Greetings, Human: Actroid, a robot, welcomes visitors to the World Expo in Aichi

By Christian Caryl
Newsweek International

May 9 issue - Norihiro Hagita recently put a 3-year-old girl and her mother into a room with a robot and kept them there for two hours. At first, the girl and the robot chatted and played. When the robot asked her to give him a hug, she happily complied. But after a time the two of them ran out of new things to do, and the little girl plopped down on the floor for a nap. The robot waited to make sure the girl had truly lost interest, then approached her mother and struck up a conversation. "Now here's the interesting part," says Hagita, pointing to the girl on videotape. "See how she sits up and watches? The robot is interacting with her mother and that's got her upset." He can't help but grin. "The robot has made her jealous."

While engineers in most of the world try to make robots that perform specific and usually unpleasant tasks, from fighting wars to performing deep-sea salvage, Japanese engineers are obsessed with making the machines more human. Having put the country squarely in the lead of the industrial robot market for the past two decades, they're now working on a new generation of robots that will serve as playmates, pets and social workers. Says Hagita: "The goal is to build an intelligent environment for the symbiosis of robots and humans in everyday life. The real challenge is to come up with robots that can actually communicate with people."

The key is to solve the myriad technical problems that stand in the way of making robots that are easy to live with—everything from understanding speech and gestures to making eye contact and having an awareness of a humans' "personal space." Roboticists in Japan talk about a machine's "social intelligence" or "shared experience."

The first members of the new humanoid generation are having a coming-out party of sorts at the World Expo in Aichi, which opened in March and runs through September. Guests are welcomed by an android female receptionist who speaks 30,000 phrases in four languages and even knows how to fend off unwelcome advances from male Homo sapiens. Sony's remarkably limber dancing robot QRIO demonstrates why he's even served as an unofficial ambassador for Prime Minister Junichiro Koizumi on some of his trips abroad. Toyota's Partner robots, which play musical instruments using artificial lips and lungs, have been drawing sellout crowds at their concerts. Although these robots are a big improvement over the clunky devices of a few years ago, they're only a first draft. Scientists working in the laboratory are readying a new army of even more sensitive machines.

Giving robots a sense of touch is an important way of making them more human. At the Advanced Telecommunications Research Institute International, or ATR, near Kyoto, Hagita and his colleagues are working on outfitting a prototype robot with thick, cream-colored skin made of silicon layers embedded with myriad tiny sensors. When you touch the robot on the back, it turns around and greets you.

Getting robots to understand real-life human speech may be the hardest job of all. Separating words from background noises and parsing language has proved to be a formidable problem. For this reason, scientists are trying to give robots means other than language to understand what people are telling them. One promising technology is intended to help robots figure out the relationships among their human interlocutors. Hagita and his colleagues are programming robots to note how long people spend with each other in a room and to take friendships among people into account when communicating with them. Understanding the variety of gestures and signs that people use to supplement language would help, too. Other ATR scientists have been drawing up crib sheets that they can program into robots to help them figure out that a smiling human is probably happy, while a frowning one usually isn't.

One of the most effective ways to overcome communication challenges, it turns out, is to help robots talk to each other. Two humanoid robots sharing notes with each other would be able to pool information about their human charges to figure out what they want. Robots could pick up information from the Internet, PDAs or closed-circuit TVs.

Wireless ID tags are another rich potential source of information. At a trade fair, a robotic receptionist could use ID tags to identify visitors and acquire information about them—what sort of work they do, where they're from and so forth. It might gather additional data about the visitor from "ubiquitous sensors," ranging from microphones to biometric sensors to closed- circuit TVs—noting where they like to eat, or what talks they prefer to attend. Hagita's researchers have already used ID tags during a trial in an elementary school, where kids who had been equipped with the tags were surprised when the robots addressed them by name. Hagita gleefully recalls one sixth grader who boasted to his friend that the robot "likes me better" because the robot addressed him by name more often than the other boy. Other children told researchers that they felt sorry for the robot because no other children were playing with it. "This is also a human relationship," says Hagita. "We've developed an agent. He's already a kind of human simulation."

That emphasis on the future function of robots as companions and helpers seems to be deeply Japanese. The reason may have much to do with Japanese popular culture, where robots like the cartoon cat Doraemon or the sweet 1960s, vintage Astroboy, tend to be portrayed as beneficent, friendly types. The tendency to regard lifelike machines as unthreatening may have deeper roots in Japan's animist Shinto culture, where inanimate objects—ranging from teapots to samurai swords—can have souls. There's also the social imperative: as the population ages, the Japanese are increasingly looking toward robots to help make up the labor shortfall.

The government, says Hagita, is promoting projects that have social applications, like nursing or child care. That may well give a push to the development of humanoids—for if robots are doing social work, they'll have to look and act considerably more like people than they do right now. And if Hagita and his colleagues have their way, that will happen sooner than you think.

© 2005 Newsweek, Inc.

Friday, May 06, 2005

India launches World's first Stereo Imaging Satellite

Congrats to ISRO !

Wednesday, May 04, 2005

Toddlers help 'feeble' robot

AAP 03may05

A ROBOT developed by a Sony subsidiary has been
attending a nursery school in California since
March to play with children up to 2 years of age.
The experiment is hoped to help develop a robot
that can "live in harmony with humans in the

Sony Intelligence Dynamics Laboratories Inc's
Qrio robot spends time each day with more than
10 toddlers at the nursery school located in San

The project is being conducted in collaboration
with the University of California.

"We want to continue (the experiment) more than
six months to collect data," Sony Intelligence
researcher Fumihide Tanaka said.

The company gained approval from all the parents
of Qrio's classmates prior to the start of the

Qrio is always accompanied by a researcher, who
is in charge of making sure everything goes

While the children were at first apprehensive
about the automatically moving Qrio, they became fully
used to it in about a month, according to
Sony Intelligence.

They now dance with Qrio and help it get up when
it falls.

"It seems (the children) think of (Qrio) as a
feeble younger brother," Tanaka said.

Based on observations over the past month, Tanaka said
he believes a robot needs to have two contradictory
functions to be able to live in
harmony with humans - one for making "timely responses
to human approaches" and the other
for showing "unexpected, accidental moves".

He said a robot should have the two functions
in a well-balanced manner.

© The Australian

Tuesday, May 03, 2005

The future of Windows' Graphics Technology

Longhorn's Graphics Technology