Blog :: All


You can filter this page to certain types of posts:

May 08, 2008

Q: Given an array of size N in which every number is between 1 and N, 
determine if there are any duplicates in it.
Ans: I'll try to do it in O(N) w/o using any additional memory. The key is
to use content of the array as index into array, checking in O(1) if 
that number has been seen already.
bool HasDups(int * a, int N)
{
bool fHasDup = false;
for (int i = 0; i < N; i++) {
int index = a[i] % N;
if (a[index] > N) {
fHasDup = true;
break;
}
a[index] += N;
}

//restore the array
for (int j = 0; j < i; j++)
if (a[j] > N) a[j] %= N;

return fHasDup;
}

Keywords: duplicate, duplicate in array

Posted by Algorithm Design and Analysis - Anshul Malik | 0 comment(s)


void quicksort (int[] a, int lo, int hi)
{
// lo is the lower index, hi is the upper index
// of the region of array a that is to be sorted
int i=lo, j=hi, h;
int x=a[(lo+hi)/2];

// partition
do
{
while (a[i]<x) i++;
while (a[j]>x) j--;
if (i<=j)
{
h=a[i]; a[i]=a[j]; a[j]=h;
i++; j--;
}
} while (i<=j);

// recursion
if (lo<j) quicksort(a, lo, j);
if (i<hi) quicksort(a, i, hi);
}

Keywords: quick sort, sorting

Posted by Algorithm Design and Analysis - Anshul Malik | 0 comment(s)


May 05, 2008

Anoothi Vishal | May 06, 2008

http://www.rediff.com/

The man who wants to create a McDonald's-style chain of Indian-Chinese food insists there's a subtle difference between improvising and massacring a cuisine.

A little over four years ago, when Ashish Kapur quit his job as an engineer with GE, packed his bags and came back home from America, his parents were appalled. "No one in my family had been an entrepreneur till then, not even working in the private sector, everyone had been in government service," he says.

Worse, Kapur was to meet his prospective in-laws, out-of-work, sans even the economic security that family money can provide. "My wife married me when I was jobless," he chuckles, clearly savouring his tale as much as the crispy pork spring rolls on our table. Within three months of that eventful day, however, Kapur was in business, quite literally.

The first Yo! China outlet was on its feet in Delhi, all bright and shiny and dare we say plastic-y (in a McDonald's sort of way, clearly an inspiration). And Kapur was well on his way to creating a pan-Indian brand that would aspire to parallel the Big Mac - only it would serve up the "aspirational" Indian-Chinese to the aam janta; manchurian, chilli chicken, cliches and cornflour, (but also the relatively unheard of dim sums, of which the company has gone on to sell more than 10 million pieces in its four years, I am told ) packaged as contemporary fast food for everyone from the average Joe at the BPO to the multiplex-goer to a small-towner in Patna, where a Yo! China "store" has just opened, making it the only branded food outlet in that city.

Spice Route, the superb restaurant at the Imperial, New Delhi, has not been the first choice for this lunch. Ashish Kapur has, as expected, suggested, that we meet at his flagship Yo! China store. He tells me (later) that he eats there four times a week, takes his wife and kid out to the same and conducts business such as this out of its premises, and that he "honestly" does not feel the need to go anywhere else for Chinese food.

The cuisine is clearly his favourite but when he asks, "What is the difference between Yo! China and this (Spice Route)?" quite rhetorically, as if the answer could be nothing but "no difference", I almost choke on the water I am sipping.

Then, he adds, "If you say, 'ambience', I would have no issue. But if you say, 'food', I don't buy that." I try to gently point out that there is a (huge) difference between what we'll be eating here and the Yo! China fare I've sampled earlier (and only once not regretted) and jump into a huge discussion on cuisines, their migration, authenticity, organised food retail in India ("350 million people multiplied by three meals a day equals an opportunity of a billion meals") and so on.

This is a discussion that will finally end in Kapur conceding that yes, consistency can be a problem in a chain operation the size of Yo! China, that yes, he's actively tackling it, and that yes, his menu needs revision "very soon" since Indians have developed more sophistication in these four years than chilli chicken dunked in huge amounts of "gravy" would suggest. He invites me to future food tastings and it is a conciliatory note that we manage to strike. But first, the order.

"Let's order chilli chicken?" Kapur says, quite dead-pan. And then seeing my grin says, "You'd be surprised at how many people would still order that even in restaurants such as these." I acknowledge the truth of the matter but the Spice Route, which does a fine act of balancing the creativity of its chef (the redoubtable Veena Arora) with populism, does not have declasse dishes such as the above.

Not to be outdone, Kapur asks the waiter, "So, what do you have that's closest to chilli chicken?" The waiter must have heard that one before because he's quick to point out Kai Phirk Thai Dum, Thai-style, stir-fried chicken that turns out to be quite excellent.

Digging into it, I ask Kapur whether he gets upset at all when people deride Indian-Chinese that he's so successfully peddling (40 outlets, 12 cities, ambitious plans of taking Yo! China global in a McDonald's like fashion since there are no truly "global Chinese food chains").

He philosophises, "There's a difference between improvising and massacring a cuisine." By his complicated logic, massacring would involve the likes of sending ketchup sachets with, say, take-away pizza (or spring rolls?).

"Some Indian chains did that in the beginning. But you would notice Pizza Hut never does that," he says. "We also have a responsibility of educating customers, after all." Improvising, on the other hand, could mean a "sambhar cooked in a north Indian home" that may taste nothing like the original but would still find takers.

That's the equivalent of manchurian, invented in India and American chopsuey as we know it, neither American nor Chinese. It's a thin divide and Kapur clearly sees himself on the right side.

Our main course has arrived - in a break from Chinese, this is minced chicken with basil (Thai) and coconut-flavoured fish (south Indian). Kapur, still in a ponderous mood, says "Coconut is one of those difficult flavours." The other is garlic. What he means is that there is less mass acceptance for such flavours in his line of work (local sensitivities mean that there is a Jain-Chinese Yo! China outlet in Ahmedabad) and thus dishes obviously need to be tailored accordingly.

He admits that Chinese chefs whom he hires from the Mainland or centres such as Hong Kong are shocked by such tailoring required to suit Indian palates. "On the other hand, the world of food is increasingly getting globalised," he points out, "I was at a restaurant in Hong Kong, for instance, where they were serving naan with authentic Chinese food!"

Besides, Indian-Chinese is clearly the flavour of the moment. "We may deride it but the world over, people are consciously looking for its flavours." His dream of growing a McDonald's style chain in the next few years clearly has potential.

What's more, with Matrix India having recently invested in the company, the growth plan to take the brand "everywhere, anytime"- to airports, leisure complexes, home delivery (the fastest growing segment in food retail) - is well underway.

But such ambition can be punishing. Kapur sighs at the 14-18 hour days he needs to put in, says that his wife has banned all newspapers from his house on Sundays, and he certainly misses his days in America when his time was indeed his own.

"I didn't even have my boss' mobile phone number. People respected your leisure time and if something was to be discussed, it would be in office." In India, obviously, things don't work the same way and the biggest myth, Kapur says, is the fact that labour is cheap here because "for every one person who is supposed to work, you need to hire two more to ensure that!"

Our lunch is almost at an end now. The forks have been pushed away. Kapur, ever the gentleman, offers to pay. When I decline, he says, "Oh! But would you mind if I packed (the leftovers) and took this?" That's to give to the beggars on Delhi's roads and traffic stops. I nod.

As we step out, our guest touchingly confides a stray thought. "Once I gave some Thai red curry to a man on the street but wonder later whether he liked the flavour." We don't know if he did. On the other hand, the promised new flavours at Yo! China may find larger approval.

Posted by Rahul Malik | 0 comment(s)


January 30, 2008

PCWorld reported that Dell overtook HP as the largest US PC vendor in the forth quarter of 2007. Dell shipped 5.5 million units while HP was able to ship, a still impressive, 4.5 million units – give or take a few. While both PC makers offer XP as an option on their BTO systems, Dell has made a much bigger deal about its prefrence for XP. Now, no one has let the cat out of the bag on how many XP machines Dell has shipped since Vista, but one has to wonder if Dell’s fourth quarter numbers weren’t padded by their XP option. Additionally, with SP3 for XP coming out, it makes an XP machine look pretty good.

Posted by computer general Questions - Anshul Malik | 0 comment(s)


Fields that we have to give to the student's coordinator:

Enrollment no. Dateofbirth Address PhoneNo. emailid CurrentBacks BacklogCredits Dreamcompany SkillSets 

Posted by PlacementUSIT2005 - Anshul Malik | 0 comment(s)


Sony Image sensor

Today Sony researchers in Tokyo unveiled a digital SLR component that's actually drool-worthy: a CMOS sensor the size of 35mm film that registers 24.81 effective megapixels—close to 26 million total. It's also built for speed with an all-pixel scan time of 6 frames per second, in 12-bit color. Sony isn't about to pop it in one of its Alpha models, at least not as far as we can tell. In fact, Nikon would be a more likely customer for this sucker when it ships this summer, the better to compete with Canon's $8,000 EOS-1Ds Mark III DSLR, which has its own 21.1-megapixel full-frame CMOS. (Those pro guys really like it when their sensors are the same size as the film they used to use.) Now, who ever said the megapixel race was over? Cuz they're wrong. Press release after the jump. [sony]

Sony Develops 35mm full size CMOS Image Sensor with 24.81 Effective Mega pixel resolution and extremely high signal conversion speed for use in Digital SLR Cameras

~ All-pixel scan mode of 6.3 frame/s ~

Tokyo, Japan - Sony Corporation today announced the development of a 35mm full size (diagonal:43.3mm/Type 2.7) 24.81 effective megapixel, ultra-high speed high image quality CMOS image sensor designed to meet the increasing requirement for rapid image capture and advanced picture quality within digital SLR cameras.

Development background
In recent years, the demand for digital SLR cameras featuring high resolution and wide graduation ranges capable of capturing every detail of the subject matter has continued to increase, particularly among high-end amateur users. Additionally, the increasing user requirement to shoot from the same focal length and angle as 35mm film cameras using interchangeable lenses has led to significant interest in the development of 35mm, full size CMOS image sensors.

However, there are a number of technical challenges to developing full (large) size image sensors, such as the propagation delay caused by using extended power circuitry and signal lines, and the difficulty of maintaining uniform sensitivity and signal saturation across the surface of the screen.

Furthermore, because current semiconductor exposure systems are unable to cover the entire chip surface of 35mm full size CMOS image sensors, multiple exposures are required. This results in the difficulty of accurately controlling exposure variance and matching circuit patterns.

Advantages of this device
The newly developed CMOS image sensor combines unique circuit design technology with Sony's advanced fabrication expertise, including a system of joining multiple exposed patterns together and advanced planarization for minimizing fluctuation, to realize 35mm, full size, 24.81 effective megapixel resolution. Sony's"Column-Parallel A/D Conversion Technique"also provides each column within the sensor with its own A/D converter, minimizing image degradation caused by the noise that arises during analog processing while at the same time delivering an extremely high signal conversion speed.

The enhanced image quality generated by the sensor's 24.81 effective megapixel resolution, wide range of graduation expression achieved by its full size broad dynamic range, and the low noise, high resolution, ultra-responsive performance provided by Sony's Column-Parallel A/D Conversion technique enable it to meet the ever-increasing requirements within high performance digital SLR cameras.

Sony will target for mass production of this CMOS image sensor within this year.

<Major features>
1)High picture quality in 35mm full size image sensor with 24.81M effective pixels
2)"Column-Parallel A/D Conversion method" achieves high S/N and high-speed imaging
・CDS/PGA(24dB)Circuit (PGA: Programmable Gain Amplifier)
・12bit-AD Converter on chip
・Diversified readout mode
・All-pixel scan mode 6.3 frame/s (12bit)
・Window readout
3)High-speed digital output(12 channel parallel LVDS output)

<Device Structure>
Image size Diagonal width 43.3mm (Type 2.7)
Total number of pixels 6236(H) x 4124(V) approx. 25.72M pixels
Number of effective pixels 6104(H) x 4064(V) approx.24.81M pixels
Number of active pixels 6096(H) x 4056(V) approx.24.73M pixels
Chip size 41.0mm (H) x 31.9 mm (V)
Unit cell size 5.94μm (H) x 5.94μm (V)

From: http://gizmodo.com/

Keywords: sensor, sony

Posted by Electronics and Gadgets - nick | 0 comment(s)


January 25, 2008

MacBook Air the thinnest laptop by apple

here have a look

http://www.apple.com/education/ 

Keywords: apple, laptop, macbook

Posted by Electronics and Gadgets - Anshul Malik | 0 comment(s)


January 23, 2008

hey i wanna add videos in my profile page.. how do i go about doing it?

Posted by Edutogether Help - michael dcosta | 1 comment(s)


does anyone know about RSS and Feeds?

Keywords: feeds, RSS

Posted by Edutogether Help - michael dcosta | 1 comment(s)


January 22, 2008

I want to know how to make my own community. I need to make a community but everyone should not be allowed.

Thanks

Keywords: community

Posted by Edutogether Help - hammer | 3 comment(s)


<< Back