JAW Speak

Jonathan Andrew Wolter

Archive for the ‘Uncategorized’ Category

Wrestling the Untestable Into Testable Code: Example with Test Driven SimpleTagSupport for custom JSP Tag

with one comment

Reading time: 3 – 5 minutes

Let’s say app servers must be stateless. There is no affinity for a user pinned to a particular app server, so two requests will likely be handled by different Tomcats, Jetty’s, etc. This means nothing can go in HttpSession (we also can’t use clustering). And when it’s ecommerce, we can’t require cookies or that might cost millions in lost revenue. Given these constraints, you have one valid option left: custom url rewriting over all our links (GET’s) and with hidden form fields (POST’s).

You can edit every link and every form to pass some unique id around. But what if you have two or three id’s that need to pass around for legacy reasons? Sounds like a custom tag would be nice. Something you can put in your jsp’s (oh yeah, let’s say we’re using jsp’s too).

This introduces me to the testability challenge. Write your own tag extending SimpleTagSupport that would ensure parameters were always in a link, and write another tag to write out the three hidden input fields inside every form.

But, SimpleTagSupport is part of the good old servlet and jsp API, so it’s very bloated with context objects, deep inheritance, callbacks, and cruft that makes for difficult unit testing. Just look at the public interface, one method: public void doTag() throws JspException, IOException.

Here’s my test driven test case (with 100% coverage, through the public API), which takes advantage of Spring MVC’s MockHttpServletRequest and MockHttpServletResponse objects (which are really fakes). I’m also using Mockito, which I prefer over EasyMock and JMock.

package com.jawspeak.dotcom.tag;
 
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import static org.mockito.Mockito.*;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockPageContext;
 
import javax.servlet.jsp.tagext.JspFragment;
import java.io.StringWriter;
import java.io.Writer;
 
public class StatefulLinkTagTest_SettingSessionId {
	private StatefulLinkTag statefulLinkTag = new StatefulLinkTag();
	private MockHttpServletRequest request = new MockHttpServletRequest();
	private MockHttpServletResponse response = new MockHttpServletResponse();
	private static final String SESSION_ID = "ADFHE13";
 
	@Before
	public void given() throws Exception {
		request.setAttribute("sid", SESSION_ID);
		statefulLinkTag.setJspContext(new MockPageContext(null, request, response));
		JspFragment jspBodyFragment = mock(JspFragment.class);
		doAnswer(new FakeJspBodyAnswerer()).when(jspBodyFragment)
                        .invoke((Writer) anyObject());
		statefulLinkTag.setJspBody(jspBodyFragment);
	}
 
	@Test
	public void shouldRenderLinkWhenThereIsNoParameter() throws Exception {
		statefulLinkTag.setHref("/myPage.html");
		statefulLinkTag.doTag();
		String contentAsString = response.getContentAsString();
		assertEquals("<a href=\"/myPage.html?sid=" + 
                     SESSION_ID + "\">link text body</a>", contentAsString);
	}
 
	@Test
	public void shouldRenderLinkWhenThereIsAlreadyAParameter() throws Exception {
		statefulLinkTag.setHref("/myPage.html?my_param=foo");
		statefulLinkTag.doTag();
		String contentAsString = response.getContentAsString();
		assertEquals("<a href=\"/myPage.html?my_param=foo&sid=" + 
                    SESSION_ID + "\">link text body</a>", contentAsString);
	}
 
	/** Mockito Answer implementation to manipulate the parameters we pass 
	 * into JspFragment.invoke() due to the ugly servlet API. */
	private static class FakeJspBodyAnswerer implements Answer {
		public Object answer(InvocationOnMock invocationOnMock) throws Throwable {
			StringWriter writer = (StringWriter) invocationOnMock.getArguments()[0];
			writer.write("link text body");
			return null;
		}
	}
}

As for the implementation, it’s pretty straightforward after writing the tests. It doesn’t show covering multiple ID’s appended to the link, but it is now easy to test drive implementing them.

package com.jawspeak.dotcom.tag;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.io.IOException;
import java.io.StringWriter;
 
public class StatefulLinkTag extends SimpleTagSupport {
	private String href;
 
	public void setHref(String href) {
		this.href = href;
	}
 
	@Override
	public void doTag() throws JspException, IOException {
		PageContext pageContext = (PageContext) getJspContext();
		getJspContext().getOut().print(createTagText(
                      (HttpServletRequest) pageContext.getRequest()));
	}
 
	private String createTagText(HttpServletRequest request)
                       throws IOException, JspException {
		StringWriter stringWriter = new StringWriter();
		stringWriter.append("<a href=\"");
		stringWriter.append(href);
		if (href.indexOf("?") > 0) {
			stringWriter.append("&sid=");
		} else {
			stringWriter.append("?sid=");
		}
		stringWriter.append((String)request.getAttribute("sid"));
		stringWriter.append("\">");
		getJspBody().invoke(stringWriter);
		stringWriter.append("</a>");
		return stringWriter.toString();
	}
}

Questions, comments? Want to bash Java and tell me why I should be using Ruby, Erlang or Scala? For more about the SimpleTagSupport interface check here.

Written by Jonathan

March 24th, 2009 at 9:06 pm

Using (These) Anonymous Inner Classes is Probably Too Clever for Your Own Good

with 3 comments

Reading time: 3 – 5 minutes

Sometimes it is tempting to have less verbose Java code and be clever. Say you have an object you need to build and set several properties on it, then use it. This way looks clever, but is a bad idea – especially in production code. Read on for why.

  	TripChoice myTrip = new TripChoice() {{
                        // look at these clever initialization blocks!
			setDestination("San Francisco");
			setAvailableRoutes(new HashSet() {{
				add("LAX-SFO");
				add("BUR-SFO");
				add("ONT-SFO");
			});
	   }};

This is a huge problem because it can cause a NotSerializableException or create a memory leak. How? Because with that clever anonymous class and initialization block, there is an implicit reference to the outer class’ instance. That outer class will not be garbage collected so long as there is one reference to the anonymous class. Worse, if we ever

Here’s the typical way to do it.

                // blah blah, this is typical, and a rather boring looking great big block of text.
		// (That's also probably scattered over several places in your code when you build these objects).
		TripChoice myTrip = new TripChoice();
		myTrip.setDestination("San Francisco");
		Set availableRoutes = new HashSet();
		availableRoutes.add("LAX-SFO");
		availableRoutes.add("BUR-SFO");
		availableRoutes.add("ONT-SFO");
		myTrip.setAvailableRoutes(availabileRoutes);

Here’s why this improved version is even not the best:

  • It uses setters. Setters allow your object to be constructed in an inconsistent state. There are some situations setters are fine (i.e. form backing objects) but often your code is more clear without setters. In this particular case the setters aren’t egregious, but I still consider them a smell and much more verbose way that constructor injection. Read more about the problem with setter injection here
  • It is verbose.
  • It is also mutable (often a negative), again a problem due to the use of setters.

So what’s the best way to do it? I have found constructor injection and in our particular example use of Google Collections. As for seeing an implementation of the best solution – just leave a comment.

Below is a full example you can run that illustrates the hard to catch serialization bug.

package com.jawspeak;
 
import com.google.common.collect.Lists;
import static org.junit.Assert.*;
import org.junit.Test;
 
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.NotSerializableException;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.List;
 
/**
 * Understands the danger of anonymous subclasses for lists.
 */
public class TooCleverForOurOwnGoodTest {
 
        @Test(expected = NotSerializableException.class)  // UPDATE: Thanks for the reminder from Dennis, below
	public void serializableDangerBugFromPatricksCleverness() throws IOException {
		// you think a List would be serializable, which it is. And so are Strings.
		final String myString = "3";
		List strings = new ArrayList() {
			add("one");
			add("two");
			// However, because there is an anonymous subclass of ArrayList created,
			// there is an implicit reference to the outer class, which is **not serializable**.
			// This is a nice feature, which lets us have closure-ish syntax in java, such as
			// the following reference to the outer myString.
			add(myString); // It will throw the exception even without this reference.
		}};
 
		// call your method that requires args to be serializable
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		ObjectOutputStream oos = new ObjectOutputStream(baos);
		oos.writeObject(strings);
		// The particular bug I had was even worse, because we were creating leaking a reference
		// through that List's implicit reference to the outer object.
	}
 
	@Test
	public void serializableDangerBugSafeButNotClever() throws IOException {
		// A List is serialiazable. And so are Strings.
		List strings = new ArrayList();
		strings.add("one");
		strings.add("two");
		// No longer is there a reference to the outer class.
 
		// call your method that requires args to be serializable
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		ObjectOutputStream oos = new ObjectOutputStream(baos);
		oos.writeObject(strings);
	}
 
	@Test
	public void serializableDangerBugSafeAndNiceLooking() throws IOException {
		// A List is serialiazable. And so are Strings.
		List strings = Lists.newArrayList("one", "two");
 
		// call your method that requires args to be serializable
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		ObjectOutputStream oos = new ObjectOutputStream(baos);
		oos.writeObject(strings);
	}
}

Written by Jonathan

March 10th, 2009 at 11:33 pm

Posted in Uncategorized, code, java, testability

Tagged with , ,

How to Send Picture Mail via SMS / MMS on the iPhone

with 6 comments

Reading time: 2 – 3 minutes

If you have an iPhone but have trouble figuring out how to send people text messages with pictures, or MMS messages, here’s a fix.

Go to the camera app and view the picture you want to send, click the send button and email it to one of the special email addresses below, based on their phone number and carrier. These are the SMS gateways from the carriers so the picture will be converted into a picture mail message and you’ll make somebody’s day (-;

Carrier Email to SMS gateway
Alltel full_phone_number@message.alltel.com
AT&T (Cingular) full_phone_number@txt.att.net
Boost Mobile full_phone_number@myboostmobile.com
Einstein PCS full_phone_number@einsteinmms.com
Sprint full_phone_number@messaging.sprintpcs.com
T-Mobile full_phone_number@tmomail.net
US Cellular full_phone_number@mms.uscc.net
Verizon Wireless full_phone_number@vzwpix.com
(@vztext is another, but it strips out pictures)
Virgin Mobile full_phone_number@vmobl.com

I hope this helps you.

Written by Jonathan

November 8th, 2008 at 4:11 pm

Posted in Uncategorized

Arguing for software testing in difficult environments

with 3 comments

Reading time: 4 – 6 minutes

I’m a ThoughtWorker. ThoughtWorks is changing the way that enterprise software is delivered. And with that we take firm stances on heavily debated topics. In previous jobs I’ve tried to push test driven development, unit testing, code coverage metrics, continuous integration… all controversial ‘best practices’. Results were mixed.

A few weeks ago I was at a large web 2.0 social networking site working with selenium grid automation. They were great clients, fully receptive to automated testing. Next week I’ll be heading to another leading internet company to work triage:

  1. Work on troubled teams whose code is poorly tested
  2. Enable groups to test legacy code
  3. Attempt to spread a pervasive test driven mindset.

I’m joining a senior team of ThoughtWorkers and in preparation I’ve thought of various arguments I’ve heard (or used myself) against testing code. I’ll be challenged working with these very experienced people, but I am eagerly looking forward to the experience.

Argument #1

Adding all these tests only makes more code to maintain, debug, and write. This can’t be good – I want less work, not more!

Rebuttal: Would you agree code and requirements often change? Would it be valuable if something could automatically and accurately catch bugs introduced with changes? How about if the original developers are no longer on the project? Testing can enable less work — in a dynamically changing environment. Immediately the work is greater, but over time it is less.

Argument #2

Ok, fair enough, there are some good reasons to do this. BUT, when I want to change something later, I now have two points of failure – the code I’m changing, and all the tests that depend on that code. I haven’t really bought myself all that much security, because if my tests don’t catch the problem well, I’m just as hosed as if I had no tests. Source: first comment from here
Rebuttal:

  1. You get better and faster with tests the more you write them.
  2. By writing tests you further understand the business domain and craft a better thought out solution.
  3. Whenever making changes in the future you actually have 1 + n points of failure. That which you are changing plus the other interacting systems within the code. By writing tests you will automatically catch the interactions, as well as the initial point of failure. Sure the tests need maintaining, but now with two things to maintain, you catch (almost all) these failure points.

Argument #3

I generally think testing is a good idea. But I’m stressed out, I’ll get to it later… tomorrow I’ll add tests… as soon as I get this working
Rebuttal: Take a page from Agile Software Development: Principles, Patterns, and Practices by Robert C. Martin.. He argues for refactoring but since the two concepts are so tightly entwined, I think the argument applies here:

“Refactoring is like cleaning up the kitchen after dinner. The first time you skip it, you are done with dinner more quickly. But that lack of clean dishes and clear working space makes dinner take longer to prepare the next day. This makes you want to skip cleaning again. Indeed, you can always finish dinner faster today if you skip cleaning, but the mess builds and builds. Eventually you are spending an inordinate amount of time hunting for the right cooking utensils, chiseling the encrusted dried food off of the dishes, and scrubbing them down so that they are suitable to cook with. Dinner takes forever. Skipping the cleanup does not really make dinner go faster.”

Skipping testing does not really make software development faster, because changes are guaranteed. (You’ll have to cook another dinner eventually). Without an easy way to baseline and build upon existing code, time is spent bugfixing that could instead be adding features or writing new tests.

Argument #4

I’m awesome. I don’t write bugs. So I don’t need tests.
Rebuttal: Great. I’m excited to be working with you. I’m sure I’ll be able to learn a great deal. I imagine you like fresh challenges. And in six months or a year this current project won’t be as interesting to you as it is today. In fact, you’ll be on to something more challenging and worthy of your awesomeness.

So that means someone else — possibly a junior developer — will be maintaining and working on this code. Without tests, they will be frequently seeking your assistance and guidance to prevent bugs. This is not what you want, is it? You want new challenges, not constantly being hassled by old code. So write the tests now to ensure your ego and intellect can move forward to bigger and better things.

Elaborating and paraphrasing, Neal Ford argued at eRubycon 2007:

Now I look at not testing as professionally irresponsible. I’m paid to create software, to deliver on a client’s business needs. If I don’t rigorously and automatically ensure I have accomplished this with the minimum amount of bugs — I am committing malpractice.

What arguments have you encountered, and how have you responded?

Written by Jonathan

October 17th, 2007 at 3:02 am

Posted in Uncategorized

Tagged with

Chicago to San Francisco, by way of India

without comments

Reading time: 2 – 2 minutes

I’ve really, really missed the really smart people I used to work with.

I believe working full time, with great people, and doing my own projects on the side will be vastly more productive than having full time for my own projects.

After leaving FeedBurner with the Google acquisition, I gave myself 2 months of running my own business full time. After that period, I would either be hiring folks, giving myself a few more months, or getting more experience at a startup or consulting.

Second Valley’s revenues are up a healthy 25-40% compared to May. I’ve been spending time in Ruby on Rails, and have started rebuilding the full ecommerce and delivery platform for one of Second Valley’s sites. But I missed the smart coworkers.

My decision Wednesday was to email ThoughtWorks and continue my interview process I started prior to joining FeedBurner. Well, thanks to the amazing Carrie McComb, I interviewed Thursday and had an informal offer that night. Friday morning I signed and it’s official.


In 10 days I’ll be off to India for ThoughtWorks Immersion training, and then I’m relocating to San Francisco.

Photo credits: meaux, and artview (my previous trip to India)

Written by Jonathan

August 10th, 2007 at 3:04 am

Learning Experiences! TSG to FeedBurner (until Google) to my startup, Second Valley, Inc

without comments

Reading time: 2 – 4 minutes

jaw
Yes, I am well.

  1. I left the botique enterprise content management software consulting company, Technology Services Group. [1]
  2. I joined FeedBurner, as an engineer in February.
  3. I did some really cool ad serving optimization code. My IE degree let me do some fun multivariate linear regressions to prioritize ad serving into their feed ad network. The code base was great to work in. Plus the team was great and I’ll really miss them. This leads to #4.
  4. Thanks to the Chicago PHP users’ group, as well as my Chicago tech event calendar site Techsocial, I was able to attend php|tek. The presentations are now available. [2]
  5. Google acquired FeedBurner in July. I don’t have much to say here, other than I learned a ton living through the acquisition process.
  6. Meanwhile, I incorporated a side business that I’ve been working on since 2003. It’s been profitable since the launch in September ‘06. The entity is Second Valley, Inc, but I”m operating under another name. [3]
  7. I pretty much had the perfect opportunity to ramp up my business by working on it full time. I’ll spend a few months at marketing, product development, (more) SEO, statistical analysis enhancements, and rebuilding the PHP app in Ruby on Rails.

Notes:

  1. This is where I started my career and if any of you reading this are college students interviewing with TSG, feel free to contact me. Because of the small size, and management style, if you’re aggressive you can get 3 years of experience in 18 months. I went from zero to supervising another developer and working directly with clients on $200K and $300K+ projects. Plus the people are really fun!
  2. I’ve spent most of my time in Java, but up until now all my side projects were in php. The Facebook APC presentation was killer!
  3. Last year at Bar Camp Chicago a bunch of us tried to get Chicago Coworking up and running. That never took off, but one of the name ideas was Second Valley (You know, create an entrepreneur friendly community like Silicon Valley. Call it… Second Valley. Which is even a bigger pun when you think of Chicago’s Second City.) My business is unrelated to coworking, but I had the domain, and it can hold multiple doing-business-as projects, so I figured it’s good enough.

Written by Jonathan

July 7th, 2007 at 3:12 am

Posted in Uncategorized

Tagged with

First Steps in Rails, RESTful by Example, Part 1: Beast

without comments

Reading time: 2 – 4 minutes

I’m migrating one of my main e-commerce sites from php to Rails. Coming from a few years of Java and php makes me really appreciate this framework’s rapid development cycles, as well as strict MVC approach.

Note: this is a technical post, it assumes you’re interested in, and familiar with Rails.

Rails wants to be RESTful. Many sites and books go into depth explaining REST. Last year’s Railsconf keynote by DHH can give you the big picture of CRUD and RESTful applications. (Be sure to follow along with the pdf slides, while you watch the video).

Look at an existing mature project (Beast) to learn how to make RESTful models

Nitty gritty RESTful implementation details have been hard to find. So I started searching out open source projects that are known for good design. And I read the code.

Beast is a forum program written in Rails by Rick Olson and Josh Goebel. Best of all, it’s a great example of a REST application.

I’m a visual person, so I created the chart below to help me get the hang of what the Models and relationships look like in Beast. Big bold squares are actual database backed objects. Dotted squares are just regular models.

Beast Restful Model Diagrams
Please contact me if you catch an error or omission.

Here’s how you use the diagram

Right now, browse here: http://svn.techno-weenie.net/projects/beast/trunk/app/models to the Subversion source of Beast. Back already? My you’re fast. Read over the different model objects. See how they relate. Think about what’s been abstracted into additional Resources, rather than creating actions willy nilly in the controllers.

Then check it out and run it in your local environment. Even if you couldn’t care less about the (quite nice) forum software that it is, it’s good to learn by taking it for a spin.

But I think I need more actions than CRUD gives me!

As DHH said in the 2006 Railsconf keynote, sometimes you think you need another non-CRUD verb to your controller. Say you have a Forum that has Users and Topics. Some users want to monitor topics. At first blush, you may want to add an action to Topic. You’d then post to /topic/monitor/123 to start monitoring topic 123.

There is another way.

Relationships, events and states can all be models. When a new topic is to be monitored, you’ll GET to /monitorships/new to get the new Monitorship object form. Then POST to /monitorships to actually create it.

Models are more than things.

Written by Jonathan

July 4th, 2007 at 3:00 am

Posted in Uncategorized

Tagged with

Broadband as a driver in social progress and economic development

without comments

Reading time: 3 – 5 minutes

There is an interesting videoconference on Broadband as an economic development driver by Steve Rosenbush, senior Writer at BusinessWeek Online engine.

http://www.iian.ibeam.com/events/mcgr004/14273/index.jsp?autoLogin=false lets you log in. It should be free, although you may need to create an account.

Some interesting tidbits:

  • The US has 94 telephone lines per 100 people.
  • Developing countries may only have 5 lines per 100 people.
  • A 1% increase in phone lines leads to a 3% increase in GDP
  • Nov 2003: 35% of US internet users had high speed access, May 2004: 42%, Dec 2004: 50%, 2005: 53%+

Dr. John Rudledge of Rudlege Capital, LLC (Economic Advisor to Reagan and Bush) talks about what is broadband. He suggests it is a verb, not a noun. It means you’re faster than everyone else. Once the “Pony Express” was broadband, now it is wireless and cable internet, for some it is optical fiber to the desktop. He continues,

“I think of broadband as the Central Nervous System of the economy…. America is not competing for jobs, but capital. Capital makes you productive and allows you to earn a paycheck. We need to learn to compete for capital with other countries in the world who know the importance of telecom capital. … China’s current energy use 20 years in the future (with no conservation) uses more than total world production today. … Because of that impending clash, they are shifting resources from oil and gas industries to IT growth [and efficiency.] … The US is in 16th place in the world telecom speed tables.

Christina Heakart (?) is the Gen. Mgr. of Marketing for Microsoft TV. She points out that the entire broadband revolution is limited to people using PC’s. It’s helped businesses and homes (with PC’s) into the digital age. In 5-10 years broadband will bring it to the TV. We will see the ignition of enormous new amounts of new commerce, new ways to communicate, unite community, and new content. … Bring the TV in as a full citizen to the digital age. TV will become 2-way and no longer 1-way.

Leo Hinderly, Jr (Managing Partner of InterMedia) claims broadband is not available to all and is in fact discriminatory–favoring urban and wealthy areas; rare in rural and poor areas.

Once again, John Rudledge says there is not (or only recently) a broadband policy in the administration. Most pressure for reform has come out of congress.

“5 years ago 40% of telecom equipment was made in the US, now it is down to 20%. R & D is going as well. Because the manufacturing factor is going, the intellectual aspect is getting more and more important. This year [2005], China will make more engineers than America + Germany + Japan.”

Christine advocates the free market to “wave it’s invisible hand” that will allow economic models to emerge for the digital divide to reunite. Most people that are poor don’t have PC’s. They have TV’s but not PC’s. It doesn’t matter if they have broadband in the home if they can’t use it.

About Christine’s point with poor not having PC’s — the open source community in Chicago has been working on creating free machines in exchange for volunteer hours building refurbished PC’s out of donated hardware. I’ve been volunteering there, and I encourage you check out their website at www.freegeekchicago.org With some digging, you can even find some pictures of me, I suspect.

Then they go into a lengthy Q & A where I stopped watching. I’m tired and can use my sleep to arrive at work early and get my laptop to then meet with Chris Perry, CEO and Frank Gruber, blogger extraordinaire (and tech event planner) two fascinating entrepreneurial types.

Written by Jonathan

June 6th, 2007 at 2:46 am

Posted in Uncategorized

Tagged with

Thoughts from Thomas Friedman’s talk

without comments

Reading time: 8 – 12 minutes

I just watched this webcast from Information Week and CollabNet. They assembled an impressive panel of thought leaders from technology, media, and the press for the distinct purpose of discussing what it really means for the world to be flat. What has changed in the two years since the publishing of The World is Flat?

InnovationAndGrowthPanel-webinar1.gif

Friedman’s take on how the world is even flatter now

Friedman recently gave a talk to the US Naval Academy. Upon returning home he had an email waiting for him from his daughter. She knew where he was giving his talk, because she just responded to a midshipman’s facebook friend request. After Thomas’ talk – in which he mentioned his daughter was at school in New Haven, CT – one of the men looked her up on facebook and befriended her.

“When the world is flat, whatever can be done will be done. The only question is will it be done by you or to you” – Thomas Friedman

Thomas and his wife were on an eco-tour in Peru with Conservation International. The guide was sharing with Friedman a story of how a Peruvian merchant was selling his dish ware on the internet. Yet, that was not the startling part.

“The Peruvian dish maker recently discovered he could manufacture his Peruvian dish ware in China cheaper than in Peru. He now sells Peruvian dish ware on the internet, that is manufactured in China.”

He was recently in Budapest, Hungary at a conference. His cab driver was returning him to the airport and asked “Mr. Tom” to give him any referrals he may know that could use a cab driver in Hungary. The cab driver proceeded to share with Friedman that he had a website in Magyar, German and English – with music – and it features services for diplomats, tourists, and more.

Brian Behlendorf says Open Source is fundamental to the flattening

Brian is CTO and co-founder of CollabNet, a software company with products including the source code collaboration tool, Subversion. He has also been involved in the Apache web server project from the very beginning.

Open source is a natural continuation of the trend that started 20 years ago in open systems, open standards, and now open source… [It] is a reaction of dissatisfied customers rebelling against poor software in the 90’s… People are working with each other, building off each other’s code, and adding real value.

One of the very prolific contributors of Subversion, Peter Lundblad from Sweden, has worked on the open source project for half a decade, yet is blind.

Tim O’Reilly on web 2.0 flattening

Web 2.0 is enabling more and more flattening of the world.

Web 2.0 is building systems that harness network effects so the systems get better as more people use them.

Other non-web places where businesses can look for web 2.0 innovation are vast databases, ripe for harvesting:

  • How could a company use what their customers type in a piece of software to help automatically fill that similar information in for subsequent users?
  • For mobile phone companies, how could they use your call logs and turn that inside out to a network address book that would help retain customers?
  • How could credit card companies share with you your purchase information (which they already monitor) back to you in a useful way?lan
  • Intut’s QuickBooks is doing this via a partnership with Google AdWords. They look at your inventory and list them using Google’s marketing tools. In TurboTax when you donate items, they look up the tax write off value based on eBay prices.

“What are we monitoring?”

“How can we get collective value out of that?”

What we saw in the open source communities (people submitting bugs, fixing bugs, contributing code) is also happening in other marketplaces. O’Reilly Media just hired a contractor who was a prolific commenter on Tim’s blog. That communication relationship transformed into a monetary relationship. Only a few years ago this never would have happened.

Devin Wenig on flattening 2.0

Devin is COO of Reuters.

Flattener 1.0 was companies moving from the US and western Europe to industrializing nations for simple wage arbitrage advantages. It was a clear cost cutting play. The Flattener 2.0 is a radical shift in the traditional roles of producers and consumers. Traditionally someone goes and produces [software, news, products] and then throws it over the wall and hopes people consume it. Now we are getting real time on the fly communication with customers… The roles of publishers are now as moderators. Co-innovation is 2.0.

He continues with the second wave of flattening, which is more about revenue growth, collaboration, and tight feedback loops. Real time feedback from customers and prospects.

Only two years ago “the story” was what a journalist wrote in the paper or on the web. Now with user contributed content, interactivity, and collaboration, the story is a discussion from all across the world.

InnovationAndGrowthPanel-Friedman.gif

Three things Friedman thinks enabled the world to be flat

  1. The PC. It allowed individuals to become the authors of their own content, in digital form.
  2. The Internet, browsers in the Dot Com boom. The world was over-wired with fiber optic cables. Now such a large number of people could electronically connect.
  3. Software and transmission protocols. People could collaborate with others in their content.

In a provocative statement, Friedman sees the flat world as “net worried.” When Infosys is competing in a flat marketplace, so is Al-Qaeda. He later recants this and declares everything a very exciting and promising future.

Tim O’Reilly asks Friedman if corporations will become more important than nations in a flat world

Clearly, we are still very early in this flattening, says Friedman. Yet he does not thing sovereignty of nations will diminish in the importance of people. In his book The Lexus and the Olive Tree, he writes how the Olive Tree instincts: religion, society, cultural norms are still very strong, and won’t be overthrown by the Lexus… not just quite yet.

He then continues sharing his stance on free trade:

I used to be a free trade advocate. I am not any more.

Now I am a radical free trader.

No surprise here, Mr. Friedman.

Every employee is a volunteer

Today people do not stay at the same company for a lifetime. Many do not even stay for five years. Peter Drucker has said this before, and the panel takes off and highlights how in a flatter world employers must recognize this. When employers know those they hire are really volunteering, they will more aggressively seek to captivate, challenge, and retain employees.

Truly profound productivity only occurs when people are passionate about what they do. If you are an employer, how can you help your volunteers stay passionate? (Discussed more in The Mythical Man Month.)

The world is flat and education

So how does education change when the world is flat?

What is the new middle class? And what jobs will people be doing in a flat-world middle class?

How will learning environments need to change for children?

These questions and more are asked and some answers are touched upon. The conversation was very interesting to listen to and ruminate upon.

InnovationAndGrowthPanel-webinar2.gif

If you enjoyed this post, consider:

The following video between Bill Gates and Tim O’Reilly at MIX 06 conference.

John Seely Brown is the Chief of Confusion at Xerox Parc and he has quite a few interesting papers and videos related to transforming Education in a flat, highly digital, world. Here’s one of his talks he gave at MIT on education in a long tail, flat world. Kathy Sierra also has a post about how awesome John Seely Brown is. Jim McGee covers one of Brown’s more interesting education papers.

FundRace.org – a mashup of political campaign spending and contributions with your locality. TheyWorkForYou is in the UK and it shows how every parliamentary member voted (and if they voted), so now more are needing to show up because people are monitoring their activity through this website.

And other ideas: how can you use government data and mash it up with say google maps and create a participatory democracy where voters can see and drill down through how their tax dollars are spent and how bills influence their communities.

How can India -in a flat world- export not natural resources, but intelligence and innovation?

What would a world look like where our best friends were in other countries?

Another book that may intrigue you is Democratizing Innovation by Eric Von Hippel.

What if a device existed in your phone that could scan products at a store and it would show where it has been. How would information of the manufacturing facilities, worker conditions, or carbon permits involved in this product change buying habits? That idea was explored are discussed in the How The World Works column on Salon (I didn’t find that exact post).

The flat world, Thomas Friedman says, will be a right brain world. Everything left brained will be done by a computer faster, or an Indian cheaper. (No offense intended for my Indian friends, I just share this from Friedman). Interested? You might like this book: A Whole New Mind: Why Right-Brainers Will Rule the Future.

Written by Jonathan

February 18th, 2007 at 2:59 am

Posted in Uncategorized

Tagged with

I Fly Vomit Comet video

with 3 comments

Reading time: 1 – 2 minutes

In college I was fortunate enough to fly – and float – on NASA’s “Reduced Gravity Student Flight Opportunity Program” (R.G.S.F.O.P. for …short). Basically you get in an airplane and climb and dive from 24,000 to 34,000 feet. The peaks of this roller coaster ride create weightlessness… watch the video for an explanation and more.

Yes, this is a little off topic from my usual investing podcast. But isn’t this NASA program awesome? We showed this video to several hundred students in elementary and high schools. I think inspiring students to study hard, technical topics is a wonderful thing for any country’s educational system.

-JAW
I’ve been wanting to upload this for a year now, and I finally got to it. If you like what you see.. leave me a comment. I’ll post more videos. (-; And thanks to NASA, our many, many, many, sponsors, as well as Professor Tan!

Written by Jonathan

January 26th, 2007 at 1:59 am

Posted in Uncategorized

Tagged with