Pages

Friday, November 30, 2007

cUp and cAp - Pictorial representation of words in English





Look at the image I drew, the 'U' signifies that a cup is in that shape and it can hold stuff. The 'A' on the other hand signifies that a "cap" is a COVER, the 'A' symbol is like the one that closes on top.

just a illustration to state that objects were named based on the characters.

this is just my theory ---

contradiction:
Umbrella starts with a 'U' and as per the previous theory it should have been starting with a 'A', to signify that umbrella is to cover us from rain...

to disprove:
oh may be this way, holding us against rain :) In this case they chose the literary meaning; "holding". what ever that holds be it holding for OR holding against starts with a 'U'.

Another example to prove/disprove: 'Utensil' / 'Atom'

I enjoy viewing my thoughts from different stand points, trying to contradict and approve. (this is one of the reflections)

Thursday, November 29, 2007

A peek in to internal product names

Having worked with several product companies in the past, I have come across fancy names being given to the products internally.

Where did this notion start?

May be IT guys are bored hearing of all the technical jargon's all the time or lack of new words. The most common names that I have come across are the names of products after mountains, lakes, islands, Greek mythology and names after movies too.

When a new guys walks in to the company, he learns the various jargon's the company produces (each month :)) and on top of that the product names that are no way related to the technology.

names that I have come across:
Pluto, katmai, Yukan, Orcas, Longhorn, Apache, Octurus, Aruba, Kokomo, Matrix, Batman, Batman & Robin, Xfiles, Helios, Apollo, Gabriel, Luna, Sparc, ....

Wednesday, November 28, 2007

Programming traditions --foll--from--the--past>

Whenever you learn a new computer language, you come across typical traditional programs and naming conventions.

Digging the etymology of them below:

1. You learn C, C++, Java, C# the first program in many books/tutorials is the print "Hello World!".

probably it is attributed to K&R who created 'C' language which is introduced a phenomenal way in which programming are done today. May be using this as baseline, all the programming languages start with the print "Hello world" program. Do not know what do they used to teach during COBOL/FORTRON days.

World's biggest Hello world program

//C code

void main()
{
printf("Hello world");
}

//Java code
public class HelloWorld
{

public static void main (String[] args)
{
System.out.println("Hello, world!\n");
}

}

//C# code
public class Program
{
static void Main(string[] args)
{
System.Console.WriteLine("Hello World");
}
}

2. Function name is foo()?
what is foo btw - click here
origin of foo()

remember this:
// C code
void foo()
{
bar();
}
void bar()
{
foo();
}
// Neither foo() nor bar() accomplish anything useful,
// and the use of either will lead to a stack overflow error

void foobar()
{
foo();
bar();
}


3. local integer variable names i, j and not a, b?
May be (I)nteger starts with 'i'?, well may be... some one started it and it continues. Or people from maths started using j, k as they were close to integers (See the link below for more) as computers are after all math based !!!
slightly different but from a math world - why is J used for set of integers

4. --More to add--

Monday, November 19, 2007

C# using indexes on Enums

This is a sample code snippet:

Definition of your enum:
----------------------------------------------
public enum ETagNumbersForHTML
{
None = 0,
One = 1,
Tiny = 5,
Small = 10,
Medium = 50,
Large = 100,
ExtraLarge = 1000,
SuperLarge = int.MaxValue
}

Main method:
---------------------------
static void Main(string[] args)
{
Random rnd = new Random(0);
int value;
Array values = Enum.GetValues(typeof(ETagNumbersForHTML));
int myRnd = rnd.Next(0, values.Length);
value = (int)values.GetValue(myRnd);
Console.WriteLine(value);
Console.Read();
}

Thursday, November 15, 2007

another puzzle

There are N(>1) balls in a row. Each ball is of a different colour. I make lot of swaps where in each swap I interchange the position of two different balls. After K swaps, I see that the original order of balls is restored. In other ways, the order is just the same as it was before we started to do any swaps. Prove that K is always even?

Wednesday, November 14, 2007

Thursday, November 08, 2007

Monday, October 29, 2007

Bull mkt Bear mkt




You must have come across these terms in any financial news. Wondered why these market derivations are termed after animals.

This is the reason:
It has to do with the way these two animals attack their targets.

Bull:
A bull will lower his head and push up with his horns in order to throw the offending target into the air. Thus, a bull market is one that is on its way up.

Bear:
A bear will swipe down with its claws in order to knock its prey to the ground. Thus, a bear market is one on the way down.

What will you call a hanging market?
Any guesses?

..............
..............
..............
..............
..............
..............
..............
..............
..............
..............
..............
..............

May be Batmarket :)


useful links:
1. http://www.investopedia.com/ask/answers/129.asp
2.http://financialphilosopher.typepad.com/thefinancialphilosopher/2007/10/allocation-2008.html
3. http://en.wikipedia.org/wiki/Bear_market
4. About.com

Thursday, October 25, 2007

IT is all about money. (ECONOMY)

My roomie and myself had a discussion on economy of countries, India and US in particular. My roomie has a good understanding of the basics, he spoke about when to buy property, how does bank works etc. Here are the excerpts of our conversation.

Thumb of rule is that anything that goes high should come down one day, economy is the same and any industry is the same. A very simple example is the IT slowdown or the burst that happened in the period 2K. OK now when you take a closer look at today's Indian economy, we know the stronger rupee and positive India. But so is the soaring prices of land and houses, obviously when there is an economic progress/boom every monkey tries to make the best out of it. And the top players are real estate business men. So why do they increase the price and still people buy? (could call it a hype?) People are made to believe that the economy will continue to grow stronger and waiting further more is not utilizing the capital they poses. (I'm talking about the ordinary middle class man here) And so does bank increase the loans and rates.

Have you ever wondered how does bank give interest rate, though always the deposit are more than the spending, in simple terms the people who deposit are always more than the people who get loan from banks. Yes, so what does banks do? In order to make profit and give money to their investors, in turn banks invest in stock/trade (recent times) and from the old days the preferred area is real estate. So what happens if the economy is good, the banks investment in real estate will be good and they keep their profits. Say what happens if the economy is slow/sluggish/going down, there are very less people to buy the lands. which will in turn cause the bankers not to expect the ROI (Return Of Investment). Banks do not invest directly themselves, mostly they go by big players in the particular industry, in our case say real estate business leader abc holds bank xyz money. Then abc will tell xyz that i cannot give the money back because no one is ready to buy any property and all the money invested is sitting idle now. So the banks go under loss. Then a governing body comes in to picture to rescue the situation, automatically forcing the interest rate and increasing the flow of money in the market, so that the people will spur the economy again.

So whenever the economy is booming, it will hit a threshold and come down and the cycle repeats. But the threshold is a very speculative level here, no one really knows.

But there will be a set of people, I call the watchers here; will be having money ready to invest and they will exactly wait for the economic slow down and go and grab the things, this second set of people will inturn provide as a supplier of money and the number will increase to grow to make them the set one and then this vicious circle will keep going on and on and on.

One small story to end, the context here is people and the money market.
A merchant comes to a village and offers people 10 rupees for each monkey they catch. The villagers were so interested and they all start catching the monkeys, which are in huge numbers in their village. A month passed by and poor villagers who have not seen money started seeing it now. Now that the monkeys are not much available in the village, the merchant comes for the second time and tells, now i will give you 20 rupees for a monkey catch. Part of the villagers who still wanted money started reaching out of the village in and around and got some monkeys. Now the merchant comes for the third time and tells I will give your 30 rupees, not many are interested as they have already seen money now. But still the few of them went out of the village and caught monkeys, again the merchant comes and offers 40, for which a tiny group of people went out (really far) and caught monkeys and they were exhausted. The merchant comes again and tells now the offer is 50, no one is interested, but he also tells here after my assistant will take care of the business with your village. Assistant encourages the villagers, the fed up villagers say there are no monkeys, then the assistant tells OK, lets make a deal here. If we cooperate, we can earn money. The villagers asked how? the assistant says we have to cheat the merchant, I will get all the monkeys without his knowledge and you can give him as new monkeys. The assistant says, you have to give me 35 per monkey that i give you and you will make 15 since the merchant will give you 50. The assistant came to the village gave all the monkeys and got 35 for each monkey. But the merchant never came back. Finally the merchant and assistant made more money leaving all the monkeys to villagers. The villagers lost the money.

The moral is in the system, we forget where we get money and where it goes...

Think and act SMART.

Do you really wanna fly?

http://www.wtop.com/?sid=1274631

Wednesday, October 17, 2007

Preparing for interviews with topnotch technology comapnies

Here are few tips/tricks, based on my interviews with some of the leading technology companies in the world. I attended Oracle, eBay, Amazon, Microsoft in the past month and here it goes.

All these companies expect you to be strong in problem solving, logical thinking and most important is to apply your common sense.

1. Given a problem, find a solution
a. Take your time, think - never run up to a solution with no prior thoughts.
b. Always problem's do not have one correct answer, the solution you are
going to come up could be the best.
c. All they look for is, how you go about analysis and approach
d. Do not panic, if you have no clue about the problem, ask for more
questions
e. Try to relate the given problem with similar problems you know before
(applying solutions from known issues).
f. Break down the problem in to smaller problems and then try and figure out
solutions independently and then integrate them.

2. If some one says I want you to code for this.
a. Always start with the design, make sure you understand the question.
b. Do not hesitate to verify the question and put it in your words to the
interviewer, you can make sure you got it correct.
c. Write the algorithm, even if the interviewer does not tell explicitly they
expect it, if some one says this is a pure coding round(usually they
don't) then you may want to check with them if they want to see your
algorithm.
d. Choosing the language to code. Say the interviewer gives
you choice for example say C, C++, C#. See first what you are
comfortable with. And then certain problems would be easy by the way the
language is designed. If some one asks you to insert a node in a linked
list, it would be easy to pick a language like C or C++ because they are
very close to pointers, instead of you beginning to write things in C#
using Unsafe. Say if some one gives you a problem where you need to be
tracking n things at different instances using the available collections
in C# is much simpler than using STL in C++. But be sure to choose the
language you are most comfortable with.

3. Asking questions
a. Ask questions, I like this one in Amazon
, they have
explicitly mentioned to be prepared to ask questions to interviewers.
b. Asking correct questions to the correct people makes a big difference, it
gives them an impression that you are inquisitive, interested and willing
to learn.
c. But do not ask questions for the sake of it, it will give a negative
impact, definitely not better than not asking any questions.

4. Be prepared
a. Be prepared to face any kind of questions.
b. Think loud and take the interviewers help, some interviewers treat the
candidates as their own team mates and try to help. But do not ask some
silly stuff that would irritate the interviewer.
c. On the other hand, it is always a good practice to be prepared on what to
expect.
d. Browse online for questions and answers
e. Understand for what team/position you are being interviewed for, it is as
simple as reading the email description of the job/team and digest the
information. Know the basics of the product or try to learn quickly
something online so that at least you can relate to terms.

Finally be honest and say "I do not know", for the things you do not know. What they expect here is, you do not make blind assumptions. Say a manager would want to know what you knew and what not. Say for example: after you join they give you some task and the manager goes on vacation and after (s)he is back to see you have done nothing. That is horrible and unacceptable. Tell them upfront that you do not know, that will help them in guiding you and getting things/material you need to get prepared and do the job. At least when they are back, they can see your efforts and appreciate it.

Last but not least, wear a smile and be cool. Most of the interviews click when you are cool and relaxed, that will help you be confident and think loud/better.

Wish you all the best :)

Here are some references:
----------------------------------------
1. Universal search engine GOOGLE
2. http://www.techinterviews.com/
3. http://www.careercup.com/
4. http://www.w3schools.com/ - learn basics
5. http://www.wikipedia.org/ - Global definitions
6. Amazon
7. The Guerrilla Guide to Interviewing
8. Microsoft
9. Intel

Friday, October 12, 2007

PC Phone hi-tech's brain child

PC and Phone are the brain and blood of technology that constantly invents...
World is changing the way it is using the two common technological components of our time the PC and Phone. Both have evolved in different ways and in different stages of mutation.

Now they are becoming more cohesive, PC having capabilities of all types of communication and Phone having capabilities of all the little things that can be done on a PC and even more.

Products being released every now and then, with all possible combinations like communication capable, GPS, Speech recognition, Image Analysis, Decision making based on events, Touch screen, Games/multi media, file sharing/collaboration, office tools, camera for picture and video capture, video mixer, music composer....endless list.

The best way of source of input is changing from keyboard/keypad to speech and the best way of response or rather output is changing to display screens.

HD DVD Vs Blu ray and what's neXt ?









Long before I wrote about technology wars, here is another one..
Yet another competition to keep the technology advancements ticking, as if the world stopped for some reason. Anyways high tech guys wanted to play with the little us.
Video technology is one that reached paramount advancements and still going headstrong.
OK whats the deal HD DVD vs Blu ray?, both have come as an advancement to the laser technology that is used in scribing on the discs (scribing may sound to be a mean word :) anyways). The LASER being used in the so called past is red, which is being taken over by the blue laser beam now. So whats the difference? Well they say that you can write more in the same given space, so the discs remain the same dimension but their capacity has zoomed. It does not stop here, there will be eXtra features and enhancements to what the user sees as options, like controlling the picture parameters while playing the video.
And there are two groups of titans clashing on taking the market lead. On one side is the HD group including heavy weights like Toshiba and a whole bunch of studios and on the other side industry champions Sony, Philips, HP, Dell and few studios. You get the exclusive list of contributors/developers/boasters here...

So now arises some question whether the DVD players being used is compatible with the new discs? No way, dragons be here... being said this is entirely a new laser beam. Why can't they add a patch in hardware?, as in software for just upgrading or replacing the laser portion of the device, well that's hardware it cannot be done, because whole bunch of other stuff needs change. And at least tell me this, whether HD DVD player is compatible with Blu ray and vice versa? Are you kidding me, then why the hell are they fighting (namely the two groups). hmmm OK enough, lets talk about special reviews by CNET.
So which one are you feeling to like Blu ray or HD DVD? lets see who establishes the standard. Or wait a minute these things have happened before, so you may even see a
HD ray or a High Blu Definition. some consortium will be formed and there will be forums and groups to take the best of both the worlds and give it a new name. Then they will tell all your Blu ray and HD players will not work, better buy a HD ray / High Blu Definition player, by the time the TV standards would have changed to Sooper High Def or Sooper Dooper High Def and then an array of new disc makers. And also there will be some advancements in the broadcasting/satellite networks, so your TV standards would change and this is a vicious circle. After all change is the only constant thing. Be patient, the world is to play and you will be played too.

Thursday, October 04, 2007

my reasoning question

Offlate i have been attending interviews

I was asked different puzzle/logical questions, I thought let me create my own. This is it, a simple one.

You are given a set of spirals (say n spirals)and you are asked to find which one has less number of spiral's in it. You are not given time to take a look at each one and compare. And you cannot touch and calculate, what is the strategy will you use?

Saturday, September 22, 2007

.NET remoting – speed / security

.NET remoting is a guaranteed mechanism of talking between multiple objects in different appdomain. What is appdomain? If you know the difference between managed world and un-managed world then you should have come across appdomains. CLR when started (it will start when the application is being run) will occupy a section of the un-managed memory (we call it un-managed because the developer is responsible for creation and deletion) and makes a section with in it, managed memory. Hence forth whatever objects are being created in the application is run within the managed segment of memory and the whole boundary is termed as appdomain or application domain.

Using remoting the various appdomains can interact/exchange data; this could be in the same machine or machine to machine across firewalls etc.

The design of the remoting could be such that of a client server model. Say if you are designing the provider with interfaces so that their implementation will be inheriting MarshalByRefObject and hence the clients/consumer (which sits in other appdomains) can access the data using the activator methods. There could be some potential issues with respect to security if you expose the interfaces directly, say in my case I have the consumer and the provider sitting in the same machine. And the provider uses certain DLL’s to play with the data. The consumer should be restricted with the data access the provider defines the scope of the data for the consumers, in this case if the provider exposes the interfaces, which could be re-casted.

And also when the interfaces implementation directly inherits MarshalByRefObject then what happens is the consumer gets the actual object each time, this means each time you need to pull a data your request and the connection is going to be really slow, can I overcome it, yes ask for more data at one shot. Dough well I do not know when I have to ask data, say the server/provider gives the data, there will be events raised and you will be monitoring the events and have the data flow back and forth. So in this case what to do?
Yep you got to think of a dataset (ADO.NET) kind off model, pass a duplicate copy each time and let that be a structure (at least in my case) so that all the data that are changed and needs to be shown in the GUI or front end is got as one shot. What happens constantly if the server/provider’s data is changing queue some data wait for some time and then re-send the structure each time, by this mechanism you have the duplicate copy each time. What does that mean? Well when some is taking the actual copy then you are asking the main provider to wait until the consumer is done with the object/data. So you are essentially ending up in a synchronous scenario, has any design be considered a good one if it is synchronous only in normal scenario? We know the answer it is NO, so we have to do it the above way to make it asynchronous. Who ever gets the data or has will not trouble the other. And by doing this we save the multiple clients requests that are waiting to be answered by the provider.

How did we end up like the above design?, what happened was the consumer/provider access model made the whole application slog, just to get a single data and this happened more often when more data is passed. So the pipes have been heavily used and the operation was slow. Though the advantage is we have a thread safe code, but total impact was slow. And the irony was my application is called Extreme tuning utility that means faster performance of the hardware based on the algorithms we run, can this itself ruin the machine’s speed…no ways….So we need to think of faster mechanism as described above. And also not allowing the hackers to interpret the interfaces the way they wanted, remember the re-casting stuff I started in the beginning.