Archive Page 2

Small DAM virus outbreak

You think people are conscious enough to delete spam mails; at least not dump enough to open one and execute a suspicious attachment inside a spam. Check out the following video on F-Secure’s WorldMap Live showing an outbreak early this year, of malware named Small.DAM(a Trojan which comes as attachments in spam emails) which loads a malicious service named “wincom32″  in turn creating backdoors for other malicious activities

This shows how many people are still ready to click on suspicious attachments in emails!

Template specialization

Template specialization

Templates are a great way of generic programming.Generalized set of functions/classes can be used from the STL or you can go create one for yourself.But in every genral situations there might be exceptional or special situatiions in which u want a specialized reaction,not the usual one.To sight an example conside creating a template class string.A class which encapsulate an (char,unicode etc) array with whole spectrum of functions to manupulate it.But consider the situation in which you are going to store arabic string in the same :).Dont forget arabs read/write from right-to-left and imagin a situation in which our dear arab says insert at position 0 like String::Append(0,arb) will it insert at the left ya right.So in situations like this we need specialized templates which accompanies the main template to deal with special situations like this.

Let see how this string template will loook like withe the specialization for arabic languages

template<class E>
class String
{
Public:
   E GetAt( int nIndex ) const  {    //General:for languages written from right to left }
   void SetAt( int nIndex, E ch ){     …    }
 .
 . 
};

template<>
class String<Arabic>
{
Public:
  Arabic GetAt( int nIndex ) const   {   //Special case:for languages written from left to right}
  void SetAt( int nIndex, Arabic ch ){     …           }
 .
 . 
};

Do note the empty ‘<>’ after keyword ‘template’ and in the next line <Arabic> tag  affixed with class name String.

Reference to Pointers

Have you ever come across declarations like int* &var. I guess you last spotted it in one of your framework function definition. This little code is called a reference to a pointer. To understand what it means all you need to know is what exactly is the difference between a ‘reference’ and ‘pointer’. For that purpose this example of reference to a variable will help

void swap(int& i, int& j)
  {
       int tmp = i;
       i = j;
       j = tmp;
  }
 
 int main()
  {
       int x, y;
      

       swap(x,y);
      

  }

Here i and j are aliases for main’s x and y respectively. In other words, i is x — not a pointer to x, nor a copy of x, but x itself. Anything you do to i gets done to x, and vice versa. In case of pointers it’s a separate ‘pointer variable’ which points to ‘our variable’. If u change the pointer variable value noting happens to the variable it points to. So as Marshall Cline says ‘please do not think of a reference as a funny looking pointer to an object’ 

Now you know what exactly a reference is; just think of a reference to a pointer. Its simply is the reference for the pointer variable;just a new name for our old pointer.

Bill Gates no longer the “world’s richest man”

After 13 years of dominance Bill Gates is no longer the world’s richest man, having been surpassed by Mexican telecommunications giant Carlos Slim, according to an estimate by a Mexican financial publication. Bill Gates who’s estimated currently at $59.2 billion, has been surpassed by Slim as his telecommunication company, American Movil, whose shares recently surged in price by 27%, boosting his net worth to $67.8 billion.But is he good enough to give Bill Gates a tough run in this billion$ race? I don’t think so….shares bloom then fades. 

Infosys acquiring Capgemini!

The latest news to hit Indian IT industry today morning was that of Infosys bidding for Europe’s largest IT services giant, Capgemini.While both sides denies these facts, the European stock market is having a harvest with Capgemini shares value rises 4.6% to a two week high of 53.78 euros. Whether this whole thing is another hoax or not, the trust European investors shows on this Indian IT giant is worth noting and can be summarized by the statement from a Dresdner Kleinwort analyst- “Infosys is big enough and none of the large Indian players has made a large acquisition in Europe” and he is definitely optimistic about Infosys doing something big like this.  

If such a merger were to happen, the combined strength of the two companies in terms of turnover would stand at around $14 billion, still some way behind global leaders IBM, EDS and Accenture but definitely will end up as the undisputed king of Indian service industry. The fact that consulting business for Infosys is still on the investment mode and they have shown interest in inorganic growth, will this be yet another India Inc rising clout into the global market?

Microsoft founders - Then & Now!

Hope all are familiar with this below pic. The Microsoft group photo back in 1978,December. The first 11 who kicked off all this fire. Of course you recognize Bill gates in this photo, but just for a thought; what happened to others? Where are they? What they doing now? Are they still with Microsoft?

Microsoft Group photo 

Waiting for answers? Read on. 

Top Row


Steve Wood Programmer. Left Microsoft in 1980. Married to Marla Wood. Now runs a telecommunications company. EW $15 million.
Bob Wallace Production manager-designer. Left Microsoft in 1983. Was a psychedelic-drug advocate. Died in 2002. EW $5 million.
Jim Lane Project manager. Left Microsoft in 1985. Now owns his own software company. EW $20 million.
 
Middle Row


Bob O’Rear Chief mathematician. Left Microsoft in 1993. Now a cattle rancher. EW $100 million.
Bob Greenberg Programmer. Left Microsoft in 1981. Helped develop Cabbage Patch dolls for Coleco. Now makes software for golf courses. EW $20 million.
Marc McDonald Programmer. Microsoft’s first employee. Left Microsoft in 1984 because it was “too big”, then rejoined the company when they bought Design Intelligence, the company he was working for. Has the honor of wearing badge number 00001. EW $1 million.
Gordon Letwin Programmer. Left Microsoft in 1993. Now an environmental philanthropist. EW $20 million.
 
Bottom Row


Bill Gates Co-founder. Still Microsoft chairman and chief architect. Now the richest person in the world. EW $50 billion.
Andrea Lewis Technical writer. Left Microsoft in 1983. Now a freelance journalist. EW $2 million.
Marla Wood Bookkeeper. Married to Steve Wood. Left Microsoft in 1980, then sued the company for sex descrimination. Now a self-described “professional volunteer”. EW $15 million.
Paul Allen Co-founder. Left Microsoft in 1983 but remains a senior strategy advisor to the company. Now sports team owner, space enthusiast, and philanthropist. EW $21 billion.

Spin buffers

Have you ever thought of a situation in which two threads need to communicate between each other? Let’s suppose one is a producer thread which produces data which will be used by a consumer thread. The obvious method to tackle this issue is to keep a common buffer right between them where the producer dumps its data into the buffer and the consumer reads the same. The one and only over head involved is that of, when the write operation is done the buffer will be locked by the producer thread. So the consumer thread has to wait until the buffer is released before it starts reading. This approach is fine until situation become some thing like the number of transactions between the threads goes around few thousands/sec. In fact situations like that occurs very frequently in game servers which require thousands of requested to be handled on per second basis. In such demanding situations the performance seem to come down drastically just because the consumer thread is put on hold when ever a write operation is on.

Classic Approach  

One good  solution for this problem is the Ring buffer. The idea is simple and classy. They use 2 pointers one for read and one for write. Using write pointer the data is written into the buffer while the read pointer reads the written data. When the read pointer and write pointer points to the same location, the buffer is empty. One important condition that needs to be checked out is that of the read pointer overtake write pointer, you know what happens ;)

The concept of Spin buffers is a direct extension of the Ring buffer. Spin buffers contains three internal “ordered” buffers. The buffers are ordered as 0, 1, and 2. Two pointers are maintained — one that points to a buffer that a reader reads from, and another one that writes. At any time there can be an assigned read buffer (R), an assigned write buffer (w), and free one (f). The buffers can be implemented as fixed-sized arrays.

 Spin_Buffer 

Now lets take a look at how write method is implemented:

  1. Put the item into the write buffer.
  2. If the next buffer is free, make the free buffer become the write buffer, and the current write buffer becomes free. 

It’s just the vice-versa with read method: 

  1.  Read the item from the read buffer.

  2.  If the current read buffer is empty and the next buffer is free, make the next buffer the read buffer, and the current read buffer becomes free.

 But you might be thinking where is that big advantage that you where hyping about. Look closely and you will notice the whole idea doesn’t involve any level of synchronization between the read and write methods. This means there is no dependency on each other and no one waits for the other. No locks means no wait means lots of time saved.

The BRIC (Brazil-Russia-India-China) thesis

Check this extract from wikipedia.org on BRIC thesis :-

BRIC or BRICs are terms used to refer to the combination of Brazil, Russia, India, and China.General consensus is that the term was first prominently used in a thesis of the Goldman Sachs investment bank. The main point of this 2003 paper was to argue that the economies of the BRICs are rapidly developing and by the year 2050 will eclipse most of the current richest countries of the world.

Goldman Sachs argues that the economic potential of Brazil, Russia, India, and China (BRIC)is such that they may become among the four most dominant economies by the year 2050. The thesis was proposed by Jim O’Neill, global economist at Goldman Sachs. These countries are forecast to encompass over forty percent of the world’s population and hold a combined GDP [PPP] of 14.951 trillion dollars. On almost every scale, they would be the largest entity on the global stage

Microsoft Surface - Behind the scene

The Microsoft geeks are back after years of core development with as simple as a coffee table.  Ya right I am talking about Microsoft surface. Its time to use table top as your computer display which recognizes objects placed on the surface and skips the traditional keyboard and mouse in favor of a touch screen(in fact much more than a touch screen).Take a look at how this master technology is crafted in this behind-the-scene movie videoed  right inside Microsoft labs.

 

‘Model-View-Controller’ - A birds eye view

This is one of the most popular design patterns which have been widely adopted in applications which require multiple views of the same data. Typical examples of such applications are web based client-server applications in which many servers are busy browsing through our database and presenting data in different flavors to please a million users staring at their browsers. 

The primitive and blunt way of creating such applications was to integrate whole of the view and the logics into a single layer which is tightly linked to each other and also to the data representation back in the database. So when ever a change occurs at the database layer it directly affects the code written at the logics level since they are dependent on each other. Similar is the situation when you try to make a UI change you are unnecessarily ploughing through the logics code. It just mess-up the whole production in fact it becomes impossible to maintain and test such applications. 

With MVC pattern, first and foremost aim was that of a clean separation of objects into one of three categories — models for maintaining data, views for displaying all or a portion of the data, and controllers for handling events that affect the model or view(s).Model is a data representation which holds ALL the data of the application structured based on the domain. In fact it represents the whole of the data on which the application stands on. The controller is the logics part which  handles events triggered from the browser and makes corresponding changes to the model/View. 

The MVC abstraction can be graphically represented as follows.

MVC 

Events typically intimates the controller to change a model, or view, or both. Whenever a controller changes a model’s data or properties, all dependent views are automatically updated. Similarly, whenever a controller changes a view, for example, by revealing areas that were previously hidden, the view gets data from the underlying model to refresh itself.

Lets explain the MVC pattern with the help of a simple component which consists of a text field and two arrow buttons that can be used to increment or decrement a numeric value shown in the text field.

 MVC_example

The data is held in a text model that is shared with the text field. The text field provides a view of the current value. Each click on the arrow button  is an event source, that triggers an action event every . The buttons can be hooked to an action listener that eventually handles that event. Depending on the source of the event, the action listener either increments or decrements the value held in the model — The action listener is an example of a controller.The text model represent the model and the text box control - the view.

PS : Dig more on MVC here!

Patterns…Patterns…and more Patterns…

So the basic question - what the hell is a Pattern? :) .In software industry certain techniques has been used over and over again for tackling common design issues. These collections of most commonly used techniques are called Design patterns. 

This whole new adventure with patterns caught my interest very recently when our architect Nicholas Manson talked a bit too much about what all patterns he used in our project. I was bit puzzled at my ignorance towards some thing so basic and interesting. So as a matter of selfrespect :) I thought its time for some digging, emmm may be the easiest one to start with…the MVC pattern; you are right, we have heard bout it a thousand times ‘Model-View-Controller’. But for my surprise the amount of depth involved in this architecture just puzzled me up. It din take much time before I realized MVC pattern is not just about a view and model being manipulated by a controller, in fact it is an elegant integration of many smaller patterns. So I decided its time to dive deep and to spend some quality time with regard to this matter. So as and when I get hold of these little guys I will be coming up with some compilations, may be very soon.

Chinese World Power Map

Last day I accidentally came across this interesting map which shows China’s sphere of influence as a regional power currently and as a world power in future. But in both scenarios its worth noticing that India and Japan are out of their influence. What does that mean? Are we Indians big a fish to swallow? Answer is –We are big fish indeed. But we fail to realize that the threat posed by Chinese are much more grave and potential than that of Pakistan even .Looking back at history, Indo-China relations were never smooth going and the news is even bad as Chinese team up with Pak for their extended reach in Persian Gulf. With the current GDP growth of China and the way they are flexing their economic muscles it’s just a matter of decision, when we should move more barrels right into those cold northern borders.

China

Update:-

Emigrating to Brazil doesn’t seem to be a bad idea ;)

China-Missile Range

Virtual Barber

This time its a different ritual before I start blabbering.

Put on your headphones…(no speakers dear!)..Play the below clip…and just close your eyes…. 

             |Download VirtualHaircut. MP3(6.16 mb)|

Now.Now.Now-this wonderful technology is called binaural recording. A technology truly developed keeping in mind the average human ear canal length. The technology goes to the extent of two high end microphones mounted in a dummy head, inserted in ear-shaped molds to fully capture all of the audio frequency adjustments that happen naturally as sound wraps around the human head and is “shaped” by the form of the outer and inner ear.

My orkut survey on job satisfaction at Infosys,TCS & Wipro

As a frustrated associate when I left tcs, I wondered how people actually survive in situations so unprofessionally managed by some of the worst managers of the industry. But I wondered, is this just happening in tcs?or is it just my project? . So for curiosity sake I started new polls in all of these MNC’s orkut communities to get a first hand opinion of what each of these employees think about their employer. I posted a poll in each of the TCS, Wipro and Infy communities and here are the results as on 29/feb/07.  

|Click for enlarged image|Polls are still active in their respective communities|

  Orkutpoll  

The poll result by itself is self explanatory. I have no intentions to weigh which of these three is the best or worst. But just to remind you what is actually happening in all three of these so called indian-IT-service-industries. I Hope whole of the freshers and new joiners talk to your seniors who are working there, scout through Community threads, some how do a detailed research about your posting and project before jumping into conclusions and taking up offers.The fact is ,there are few good projects with quality work. But there are hell lots of black holes, of course with onsite frills. So if your intensions are onsite oriented its worth the risk, others, may god bless you!

Google April fool pranks!

Every year on April 1st Google play pranks on its users….check out this year’s collection ;)  

« Previous PageNext Page »


 

July 2008
S M T W T F S
« Mar    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

Blog Stats

  • 29,660 hits

Last 100 Visitors

Map IP Address

Map IP Address