"every right implies a responsibility; every opportunity, an obligation; every possession, a duty"
Saturday, January 26, 2008
Friday, January 25, 2008
Deliver a Presentation like Steve Jobs
When Apple (AAPL) CEO Steve Jobs kicked off this year's Macworld Conference & Expo, he once again raised the bar on presentation skills. While most presenters simply convey information, Jobs also inspires. He sells the steak and the sizzle at the same time, as one reader commented a few years ago.
I analyzed his latest presentation and extracted the 10 elements that you can combine to dazzle your own audience. Bear in mind that Jobs has been refining his skills for years. I broke down his 2007 Macworld keynote in a previous column (BusinessWeek.com, 7/6/07) and in a chapter in my latest book. Still, how he actually arrives at what appear to be effortless presentations bears expanding on and explaining again.
1. Set the theme. "There is something in the air today." With those words, Jobs opened Macworld. By doing so, he set the theme for his presentation (BusinessWeek.com, 1/15/08) and hinted at the key product announcement—the ultrathin MacBook Air laptop. Every presentation needs a theme, but you don't have to deliver it at the start. Last year, Jobs delivered the theme about 20 minutes into his presentation: "Today Apple reinvents the phone." Once you identify your theme, make sure you deliver it several times throughout your presentation.
2. Demonstrate enthusiasm. Jobs shows his passion for computer design. During his presentation he used words like "extraordinary," "amazing," and "cool." When demonstrating a new location feature for the iPhone, Jobs said, "It works pretty doggone well." Most speakers have room to add some flair to their presentations. Remember, your audience wants to be wowed, not put to sleep. Next time you're crafting or delivering a presentation, think about injecting your own personality into it. If you think a particular feature of your product is "awesome," say it. Most speakers get into presentation mode and feel as though they have to strip the talk of any fun. If you are not enthusiastic about your own products or services, how do you expect your audience to be?
3. Provide an outline. Jobs outlined the presentation by saying, "There are four things I want to talk about today. So let's get started…" Jobs followed his outline by verbally opening and closing each of the four sections and making clear transitions in between. For example, after revealing several new iPhone features, he said, "The iPhone is not standing still. We keep making it better and better and better. That was the second thing I wanted to talk about today. No. 3 is about iTunes." Make lists and provide your audience with guideposts along the way.
4. Make numbers meaningful. When Jobs announced that Apple had sold 4 million iPhones to date, he didn't simply leave the number out of context. Instead, he put it in perspective by adding, "That's 20,000 iPhones every day, on average." Jobs went on to say, "What does that mean to the overall market?" Jobs detailed the breakdown of the U.S smartphone market and Apple's share of it to demonstrate just how impressive the number actually is. Jobs also pointed out that Apple's market share equals the share of its top three competitors combined. Numbers don't mean much unless they are placed in context. Connect the dots for your listeners.
5. Try for an unforgettable moment. This is the moment in your presentation that everyone will be talking about. Every Steve Jobs presentation builds up to one big scene. In this year's Macworld keynote, it was the announcement of MacBook Air. To demonstrate just how thin it is, Jobs said it would fit in an envelope. Jobs drew cheers by opening a manila interoffice envelope and holding the laptop for everyone to see. What is the one memorable moment of your presentation? Identify it ahead of time and build up to it.
6. Create visual slides. While most speakers fill their slides with data, text, and charts, Jobs does the opposite. There is very little text on a Steve Jobs slide. Most of the slides simply show one image. For example, his phrase "The first thing I want to talk to you about today…" was accompanied by a slide with the numeral 1. That's it. Just the number. When Jobs discussed a specific product like the iPhone, the audience saw a slide with an image of the product. When text was introduced, it was often revealed as short sentences (three or four words) to the right of the image. Sometimes, there were no images at all on the slide but a sentence that Jobs had delivered such as "There is something in the air." There is a trend in public speaking to paint a picture for audiences by creating more visual graphics. Inspiring presenters are short on bullet points and big on graphics.
7. Give 'em a show. A Jobs presentation has ebbs and flows, themes and transitions. Since he's giving his audience a show instead of simply delivering information, Jobs includes video clips, demonstrations, and guests he shares the stage with. In his latest keynote, the audience heard from Jim Gianopulos, CEO and chairman of Fox Filmed Entertainment, and Paul Otellini, CEO of Intel ((INTC). Enhance your presentations by incorporating multimedia, product demonstrations, or giving others the chance to say a few words.
8. Don't sweat the small stuff. Despite your best preparation, something might go wrong as it did during the keynote. Jobs was about to show some photographs from a live Web site, and the screen went black while Jobs waited for the image to appear. It never did. Jobs smiled and said, "Well, I guess Flickr isn't serving up the photos today." He then recapped the new features he had just introduced. That's it. It was no big deal. I have seen presenters get flustered over minor glitches. Don't sweat minor mishaps. Have fun. Few will remember a glitch unless you call attention to it.
9. Sell the benefit. While most presenters promote product features, Jobs sells benefits. When introducing iTunes movie rentals, Jobs said, "We think there is a better way to deliver movie content to our customers." Jobs explained the benefit by saying, "We've never offered a rental model in music because people want to own their music. You listen to your favorite song thousands of times in your life. But most of us watch movies once, maybe a few times. And renting is a great way to do it. It's less expensive, doesn't take up space on our hard drive…" Your listeners are always asking themselves, "What's in it for me?" Answer the question. Don't make them guess. Clearly state the benefit of every service, feature, or product.
10. Rehearse, rehearse, rehearse. Steve Jobs cannot pull off an intricate presentation with video clips, demonstrations, and outside speakers without hours of rehearsal. I have spoken to people within Apple who tell me that Jobs rehearses the entire presentation aloud for many hours. Nothing is taken for granted. You can see he rehearsed the Macworld presentation because his words were often perfectly synchronized with the images and text on the slides. When Jobs was showing examples of the films that are available on the new iTunes movie rental service, one poster of a particular film appeared at the exact moment he began to talk about it. The entire presentation was coordinated. A Steve Jobs presentation looks effortless because it is well-rehearsed.
[source: http://www.businessweek.com/smallbiz/content/jan2008/sb20080125_269732.htm]
Thursday, January 24, 2008
What's missing in C++?
- No automatic garbage collection (It is possible to use an external GC though, such as the Boehm_garbage_collector)
- No requirement for bounds checking of arrays (The std::vector class can be used to avoid this problem)
- No operations on whole arrays (This can be achieved with Template classes).
- No syntax for ranges, such as the A..B notation used in several languages
- No nested function definitions
- No formal closures or functions as parameters (only function and variable pointers). (C++0x will probably feature closures).
- No native support for multithreading and networking (C++0x will provide thread-local storage and threading classes in the standard library)
- No standard libraries for several other application programming needs
C++0x
Programming languages such as C++ use an evolutionary process to develop their definition. This process inevitably raises compatibility issues with existing code, which has happened occasionally during the C++ development process. However, according to the announcement made by Bjarne Stroustrup (inventor of the C++ language and member of the committee), the new standard will be almost 100% compatible with the current standard.
[source: http://en.wikipedia.org/wiki/C%2B%2B0x]
Wednesday, January 23, 2008
Defining C++
I was trying to get to the roots of information pertaining to the evolution of C++ and found an interview link on youtube. It's with Bjarne Stroustrup, founder/inventor of C++, and Herb Sutter, secretary of the ISO/ANSI C++ standards committee.
In it, Stroustrup defined C++ as a language,
- Which is close to the hardware,
- Which can deal very effectively with resources, and
- Which has the abstraction mechanism that can serve the demands of really large applications,
He also somewhat criticized that if there is something good happening about C++, one won't hear a lot about it. This is partly because a number of people working on other languages are paid to disseminate improvement bullets about their languages; on the other hand, there is no substantial marketing budget to popularize or create hype around C++.
The invention of C++
Tired of the lack of expressiveness of mainstream programming languages of the day and of the slowness of experimental languages, AT&T researcher Bjarne Stroustrup built the first version of C++ in 1983. C++ combines the expressive power of OOP (object-oriented programming) with the speed, compactness, and flexibility of C, its systems programming language predecessor, which was invented at AT&T ten years earlier. C++ matches C in efficiency and adds facilities for building larger, more easily maintained, and more reliable systems.
Stroustrup's creation, originally intended to improve the working lives of his colleagues, rapidly became one of the most influential programming languages in industry and academia worldwide. Today, upwards of a million programmers use C++ to write software for machines ranging from PCs to supercomputers. If you have used a computer, you have almost certainly used a program written in C++. Most PC and Internet users do so daily. C++ is even used for software in gadgets such as cameras and elevators, which are not usually associated with computers and programming.
At AT&T, C++ has become embedded in transmission, switching, and operations systems. C++ is also used in scientific programming, data analysis, simulation, and other mainstays of telecommunications research. Constant research and refinement have kept C++ in the front line of systems development to this day.
[source: http://www.corp.att.com/attlabs/reputation/timeline/83cplus.html]
In The Design and Evolution of C++ (1994), Bjarne Stroustrup describes some rules that he uses for the design of C++:
- C++ is designed to be a statically typed, general-purpose language that is as efficient and portable as C
- C++ is designed to directly and comprehensively support multiple programming styles (procedural programming, data abstraction, object-oriented programming, and generic programming)
- C++ is designed to give the programmer choice, even if this makes it possible for the programmer to choose incorrectly
- C++ is designed to be as compatible with C as possible, therefore providing a smooth transition from C
- C++ avoids features that are platform specific or not general purpose
- C++ does not incur overhead for features that are not used (the "zero-overhead principle")
- C++ is designed to function without a sophisticated programming environment
[source: http://en.wikipedia.org/wiki/C%2B%2B]
Java: Rounding off to 2 decimal places
Method 1:
x = (double)int((x+0.005)*100.0)/100.0;
Method 2:
x = Math.round(x*100.0) / 100.0;
Method 3:
DecimalFormat df2 = new DecimalFormat( "#,###,###,##0.00" );
double dd = 100.2397;
double dd2dec = new Double(df2.format(dd)).doubleValue();
Method 4:
f = (float) (Math.round(n*100.0f)/100.0f);
Method 5:
double r = 5.1234;
System.out.println(r); // r is 5.1234
int decimalPlaces = 2;
BigDecimal bd = new BigDecimal(r);
bd = bd.setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP); // setScale is immutable
r = bd.doubleValue();
System.out.println(r); // r is 5.12
[source: www.thescripts.com, accuracy unchecked]
How I did it:
float percentage = score.floatValue()/(qapairs.length*10)*100; //my float value
percentage = Float.valueOf((new DecimalFormat("###.00").format(percentage)));
Saturday, January 19, 2008
SPARQL Query Language for RDF
[source: www.DBPedia.org]
---------------- ---------------- ----------------
The W3C just gave SPARQL the stamp of approval. SPARQL is a query language for the Semantic Web, and differs from othe query languages in that is usable across different data sources. There are allready 14 implementations of the spec, which is a lot. Most of them are free software. There are also billions of relations out there that are queryable, thanks to the Linking Open Data project. The structured data of Wikipedia are now queryable at DBpedia. Also, have a look at Ivan Herman's presentations.
Lets have an example: You could do this on dbpedia.org (with the standard prefixes you find there) and it will return computer scientists born before 1945: SELECT ?name ?birth ?death ?person WHERE { ?person skos:subject
[source: Slashdot]
---------------- ---------------- ----------------
SPARQL Query Language for RDF
ABSTRACT
RDF is a directed, labeled graph data format for representing information in the Web. This specification defines the syntax and semantics of the SPARQL query language for RDF. SPARQL can be used to express queries across diverse data sources, whether the data is stored natively as RDF or viewed as RDF via middleware. SPARQL contains capabilities for querying required and optional graph patterns along with their conjunctions and disjunctions. SPARQL also supports extensible value testing and constraining queries by source RDF graph. The results of SPARQL queries can be results sets or RDF graphs.
Wednesday, January 09, 2008
Different Swap techniques
int a = 10, b = 20;
int temp = 0;
temp = a;
a = b;
b = temp;
Without using a temporary variable:
int a = 10, b = 20;
a = a + b; // ( a = 30 )
b = a - b; // ( b = 10 )
a = a - b; // ( a = 20 )
In one line:
int a = 10, b = 20;
a = a + b - ( b = a );
Sunday, January 06, 2008
Sum of square of each digit of an integer
int S(int x){
int sum=0, y=0;
while (x!=0){
if (x < 10) {
y = x;
} else {
y = x % 10;
}
x = (x - y) / 10;
sum += y * y;
}
return sum;
}
Returns:
DigitsSum(55)=50 [5*5 + 5*5]
DigitsSum(230)=13 [2*2 + 3*3 + 0*0]
DigitsSum(37)=58 [3*3 + 7*7]
U P D A T E
A better solution:
int ur_num;
int sum_of_sq=0;
while(ur_num!=0){
remainder=ur_num%10;
sum_of_sq += remainder*remainder;
ur_num = ur_num/10;}