NetworkedBlogs.com (beta) is an extension of the Facebook app NetworkedBlogs.

The Tech Curmudgeon

 

Information

Blog Name: The Tech Curmudgeon
Url: http://www.techcurmudgeon.com
Language: English
Topics:
Description:
Popularity: 1 Followers

Blog Feed

Dumb Design
Want to hear dumb? My cordless phone has caller ID. It displays the number and other information about the caller when the phone rings.But only when it's actually ringing! Between rings, the screen goes blank. So when you pick up the phone, you have to wait until the next ring to see who's calling. What? It doesn't remember someone's calling when it's not making the ringing sound?Dumb or what?
How do you end an email exchange?
One unexpected (by me, at least) byproduct of our technological age is the never-ending email conversation. I'm not sure if it's the desire to have the last word, or simply the feeling that leaving someone hanging is rude, but some email conversations go on for days, weeks, even months after their actual content has ended. (Some, of course, never had any actual content to begin with.)When your on the phone, you're talking in real time, which requires some amount of concentration. You can end a phone conversation because talking on the phone is a physical committment. Sure, you may have enough attention left over to cook, grimace to show others in the room your i
Bit Counting (The end, I hope)
So the original question was, "How do you write a function to count the number of bits set in an arbitrary byte?" I figured that if you're going to do this repeatedly, it might be worth just building a lookup table. The question then becomes "How do you populate a table of set bit counts for each possible byte?" This can be solved with a simple iteration:int exp = 1;table[0] = 0;for (int i = 1; i < 256; i++){ if (i == exp*2) exp *= 2; table[i] = table[i-exp] + 1;} Now if I had thought of that during the interview ...
Things to hate
People who insist on adding milk and sugar to their coffee while it's sitting under the coffee maker, so that my mug gets covered with the milk and sugar they've spilled.Coffee makers in general, for that matter.
Bit Counting (Continued)
So here's the pattern. You're trying to populate a table so that each entry in the table contains the number of bits set in a one byte binary representation of that entry's index:0 = 00000000 = 0 bits set1 = 00000001 = 1 bit set2 = 00000010 = 1 bit set3 = 00000011 = 2 bits set4 = 00000100 = 1 bit set5 = 00000101 = 2 bits set6 = 00000110 = 2 bits set7 = 00000111 = 3 bits set8 = 00001000 = 1 bit setand so on.So the first two are obviously 0 and 1. The next two are the same, but with the 00000010 bit set. Then the next four follow the same pattern but with the 00000100 bit set. The next eight follow the pattern o

Followers

This blog has 1 followers. Visit the blog page on Facebook to see who's following this blog.
Follow

Popular in:

Not enough data.
Calculated for blogs with 20+ followers.

Related Blogs

This site uses BitPixels previews
Questions? contact: networkedblogs@ninua.com
Copyright (C) 2008, Ninua, Inc.