Saturday, February 04, 2012

Teaching Computer Science Through WoW Scripts


The following paper is a curriculum for learning basic computer science concepts using World of Warcraft and the scripting language Lua. I wrote the paper with two other MIT students while taking Eric Klopfer's course "Computer Games and Simulations for Education and Exploration" (11.127/CMS.590) in March, 2011. It was originally published on my MIT site. I am archiving it here for anyone who is interested in learning how video games can be used for education. See "A curriculum for learning computer programming in WoW" for background on this project.


Curriculum: Teaching Computer Science through WoW Scripts

Andrew Hsiao, Ian Lamont, Michele Pratusevich

CMS.590: Professor Klopfer

1 March 2011

Introduction


For decades, games have introduced young people to computer programming. Early exposure to programming games has been a stepping stone to careers in computer science and technology-related entrepreneurship. There are many well-known examples. Long before he built Facebook, Mark Zuckerberg reveled in creating computer games with his friends, and Salesforce.com cofounder Marc Benioff got his start in the computer industry as a teenage designer of games for Atari home computers.

But even among young people who don't become programmers or found startups, there is a widespread awareness of the role in programming in creating games. There comes a point in the life of a typical primary school student that he or she will wonder how handheld, console, or web-based games are made, and the answer will come back that someone - or a group of people - entered a series of instructions into a computer to make it display images, play sounds, and perform functions that make up the gameplay. Some of the more dedicated gamers or curious tinkerers may be compelled to take things a step further by designing their own games, or modifying existing games ("modding") to extend the gameplay in some fashion. In doing so, these youths learn many elementary programming concepts, including computer languages, software tools, and fundamental computer science building blocks such as variables and functions.

Many others, however, will never take that next step. They will be aware of the role of programming in creating games and other software, but will never learn specific concepts or the practical aspects of computer programming.

Teaching Computer Science through WoW Scripts is designed to help non-programmers bridge the gap. The following series of four exercises is designed to be the beginning of a course in teaching high-school students basic computer science concepts, as well as critical thinking skills, using the online role-playing game World of Warcraft and the scripting language Lua. The curriculum is aimed at teenagers who have never been exposed to computer programming or played the game, although those with some experience may be able to develop more advanced scripts to use in the game. Students will learn how computer languages work, including core concepts such as if statements, loops, and variables.

With these foundations, students can then learn more complicated programming concepts such as functions to develop their own complex customizations of WoW. In a more comprehensive computer science curriculum, the concept of saving scripts that can be run much more easily using macros would be explained. For an advanced curriculum, the creation of add-ons would provide a practical purpose to programming and scripting. However, because add-on creation is involved and complicated, it is not one of the exercises described here.

Definitions


World of Warcraft (WoW) is a sword-and-sorcery fantasy world that lets anyone with a PC or laptop and an Internet connection battle monsters, find virtual treasure, and play with other people who are online at the same time. The world is not unlike J.R.R. Tolkien's Lord of the Rings, or the fantasy game Dungeons & Dragons. It was launched by Blizzard in 2004, and is one of the top online role-playing games, with millions of users in the United States, China, and elsewhere.

Lua is a powerful, lightweight programming language that is known as a "scripting language." Scripting languages enable control of an application (in this case, World of Warcraft) but Lua has also been used for other games, industrial applications, and consumer hardware platforms.

"Scripts" are small computer programs that perform a very specific function. Typically, they are a very precise set of instructions that the software environment (i.e., WoW or some other program) can understand. Sometimes they are as short as a few sentences of text. In a game like WoW, a script might display extra information about a monster that is attacking a player, or help a player find a new route to a certain destination. Many first curricula in computer science use scripting languages to teach fundamental computer science concepts because they have more gradual learning curves than other kinds of programming languages. Scripts do not require installing compilers and interpreters that come with more complex programming languages. After learning basic programming concepts in a scripting language, more complicated programs can be written using multiple scripts.

Specific computer science topics, exercises, and outcomes in the WoW programming curriculum are listed below.

Why WoW?


Instructors may wonder why a gaming environment is being used to learn programming concepts, as opposed to textbooks and traditional classroom lectures. Besides the obvious interest that games hold for young people (according to a recent survey, 80% of American teens aged 12-17 own a game console ), the practice of experimenting in a game world reinforces what James Paul Gee refers to as the Probe, Hypothesis, Reprobe, Rethink Cycle. As noted by Gee in What Video Games Have To Teach Us About Learning And Literacy, this cycle is required to learn complex and fast-moving video games in immersive 3D environments, like the one found in WoW. The four-stage cycle works as follows:

  1. The player must probe the virtual world, which involves looking around the current environment, clocking on something, or engaging in a certain action.
  2. Based on reflection during and after probing, the player must form a hypothesis about what something (a text, object, artifact, event, or action) might mean in a usefully situated way.
  3. The player reprobes the world with that hypothesis in mind, seeing what effect he or she gets.
  4. The player treats this effect as feedback from the world and accepts or rethinks his or her own original hypothesis.

But the process is not limited to learning how to survive an attack by a monster or find a certain treasure in a video game. The Probe, Hypothesis, Reprobe, Rethink Cycle can be applied to a variety of extracurricular learning situations. It is part of humans' innate ability to recognize patterns, self-reflect on outcomes based on success/failure feedback cycles, and derive powerful learning experiences. "It's how children learn," Gee writes, "when they are not learning in school."

For the WoW programming curriculum, the Probe, Hypothesis, Reprobe, Rethink Cycle will take place on two levels. Learning to program requires cycles of experimentation and testing on the code, in order to make sure it works and improve the functionality. There is also the effect of the scripts on the gameplay itself, which students can also probe and test in a shared environment with their classmates. Some students may want to share their "mods" with each other, or cooperatively work on more complex tasks (for instance, dividing up coding and testing responsibilities). Such behavior adds to the learning experience and encourages critical thinking and teamwork in a shared environment of peers.

Tools you will need


Students will need to have World of Warcraft installed on the laptop or PC they are using for class. They should register their game, create a player, and experiment with the world before starting the exercises. We recommend that each player spend at least three hours in WoW and reach at least level 3 before starting the first exercise. Before attempting an exercise, students' characters should be in a town or other place where they will not be attacked or disturbed.

The basic tool needed to create scripts in Lua is the WoW game itself. Very simple yet powerful scripts can be created right in the chat box of WoW. The first exercise describes in some detail how this is done. For creating more complex scripts, a basic text editor like Notepad (that comes standard with every PC) or TextEdit (included with every Mac) can be used to edit the scripts before pasting them into the WoW chat box. Students will not need to use external text editors (outside of the WoW chat box) to create scripts until they are at a level where they are using macros to hold their scripts.

Before starting on the exercises, students should be aware that there are a plethora of resources available online about writing Lua scripts, macros, and add-ons. World of Warcraft has built-in functions that are available through an "application programming interface" (shorted to API) that can be used in any script. An API is just a collection of functions and properties of the language that can be used by the programmer. Information about the WoW API can be found here.

Summary of class exercises


1. Beginning programming concepts and Hello World

Creating a simple program that displays the text "Hello World" is a long tradition in teaching new computing languages to students. In this exercise, students will use the Lua scripting language to display "Hello World" in the WoW chatbox.

In the first activity the student will learn how to accomplish one of the simplest tasks in programming: outputting a message. With this program, the student will be able to "print" statements. Explain to the student the meaning of "print" in programming jargon: being able to "print" refers to being able to output text to some sort of interface the programmer can see. When programming in Lua in World of Warcraft, that interface is the chat box. An important thing to note when printing to the chat box is that whatever is printed will not be broadcast to the world. Rather, it is only printed in the chat box of the user who is running the script. The student should be shown this script to print a message to the chat box:

/script print("Hello World!");

Take a look at the components of this program. First the statement "/script" is typed into the chat box to denote the start of a Lua script. All scripts you type into the chat box will start with this statement.

Next there is the statement "print". This function is provided by the World of Warcraft API to give the programmer the opportunity to print statements to the chat box. Built-in functions can be used in any program to accomplish tasks the programmer does not want to hard-code himself. Many of the built-in functions in any environment or programming language accomplish tasks that would be very difficult to code by the programmer.

When a function such as "print" is used by the programmer, it is referred to as a function call. The function calls using the built-in functions in WoW are straightforward - the function call "print("Hello World!")" takes the chat frame at the bottom left of the screen and adds the message "Hello World!" to it.

The ""Hello World!"" between parentheses immediately after the function is what is called the argument of the function. Arguments are parameters that are used by the function to accomplish a specific task and usually vary between function calls. In this particular case, the text can be changed to anything that the programmer wants to be output to the chat box.

The semicolon at the end of the statement denotes the end of a logical statement in the script. A semicolon is required at the end of every logical statement. This is a confusing concept to first-time programmers, but hopefully the examples provided in the exercises will give more insight about this. It is up to the discretion of the teacher how much they want to enforce and encourage the use of semicolons.

Note that the text must be put between quotation marks to be recognized as a valid text input. Each function requires its own special formatting for the arguments, but for outputting text to a chat box, the text must be enclosed in quotation marks. Notice how the text is printed on one line in the chat box. To print something that spans multiple lines, use the sequence of characters "\n" (it means "new line", back from the days of the first programming languages). When this sequence is inserted into a block of text, the text that comes after it will be on a new line. So the code:

/script print("Hello \n World!");

will print "Hello" and "World!" on different lines. Finally, the statement is closed with a semicolon. In Lua, a semicolon denotes the end of a line of code. When typing scripts into the chat box, the semicolon is necessary for the chat box to understand that it is finished running the script and can begin taking normal chat box input again.

Text is not the only thing that can be printed to the chat box. Text in the context of programming is referred to as a string. The reason that the text must be put between quotation marks in the print statement is that the script only recognizes strings when they are put between quotation marks.

Strings are only one type of input that the script recognizes. If a script sees a number, it treats it differently than a string. A whole number in the context of programming is referred to as an int (short for integer). Ints can be used in arguments of function calls, but they do not need to be surrounded by quotation marks. This idea of strings and ints brings up a more advanced concept in computer science that would be revisited in a more advanced exercise: the idea of types of input that the script sees. The students learning computer science through WoW Scripts do not need to understand the idea of types, but they should know that the script treats numbers and text differently.

Using print statements are useful in programming for a variety of reasons. When needing to test outputs of programs that are more complicated or wanting the user to see a certain message, print statements are a simple way of achieving this goal.

As an additional exercise, a student should modify the above code to print his or her name into the chat box. Modify the code to print numbers as well - keep in mind that numbers do not need to be surrounded by quotation marks.

2. Conditional statements

This section is intended to introduce students to basic control flow using if statements. Explain to students what control statements do: if statements take a conditional statement, and then execute a specific section of code depending on if the conditional statement is true or false. Present the following script to the students:

if (IsPartyLeader()) then
print("I am the leader of my party!");
else
print("I am not the leader of my party.");
end

In one line for in-game use the script would look like:

/script if (IsPartyLeader()) then print("I am the leader of my party!"); else print("I am not the leader of my party."); end;

"IsPartyLeader()" is a function like "print", except this function does not take any arguments because it does not need information from the user to perform its task. All the information it needs is automatically gathered from the game. In this case, it will be true if the player calling the function is the leader of a party, and false otherwise. The reason for the "()" at the end of the function call is that all function calls must contain these parentheses. However, not all function calls require arguments between the parentheses.

Have the students log on to WoW and pair up. Have one student in each pair create a party and invite the student they are paired with. Then have both students run the script and verify that the one that is the leader has the message "I am the leader of my party!" in their chat window and the other student has the message "I am not the leader of my party." Then have the second student invite the first student to a party and have them both run the script again, and verify that both students have the other message printed out to their chat window. After the students have had a chance to try it out themselves, walk them through the execution of this script, pointing out how the control flow differs for each case, and how the game decides which message to print.

Now have the students modify the script so that if they are outdoors, the script prints out "I am outdoors!" otherwise the script prints out "I am indoors." The relevant function you should have them use is the IsOutdoors() function. The end result should look similar to the following code:

if (IsOutdoors()) then
print("I am outdoors.");
else
print("I am indoors.");
end

To run the script in-game the following should be typed into the chat window:

/script if (IsOutdoors()) then print("I am outdoors."); else print("I am indoors."); end;

To have students test out their scripts, have them use their hearthstones to get to a town or city, and then stand outside the doorway to a building. Run the script while outside, then walk into the building and run the script again. The two messages should print out into their chat windows.

At the end of this module students should understand how if statements work.

3. Variables

This section details how to introduce students to variables, both in terms of what kinds of variables there are (types) and how to use them in scripts. The concepts of ints and strings were introduced in the first exercise but are given a more thorough (but not complete) examination here. Explain the concept of variables to students: variables are placeholders for other values, and are usually used to allow for easier manipulation of whatever data you are working with. Show the following code snippet to the students:

local a=3;
local b=4;
print(a*b);

When showing how to translate the expanded code into the one liner for in-game usage, make sure to point out that since we are putting all of the code into one line, we have to include a semicolon between the statements as a delimiter for where one statement ends and the next begins. The in-game code would be the following:

/script local a=3; local b=4; print(a*b);

Have the students run the script on their own machines. Next explain the difference between local variables and global variables. Local variables only exist for the one single run of the script, while global variables persist even after the script has finished running. Local variables must be specifically declared as such; if there is no "local" keyword before the variable is defined, the game will assume you want the variable to be a global variable. To demonstrate, have the students enter the following:

/script print(a); print(b);

They should get "nil" as a result both times. "nil" means that there is nothing there, that the game thinks the variable is undefined. Now have them run the first script with the local keywords taken out:

/script a=3; b=4; print(a*b);

And then run:

/script print(a); print(b);

This time they should get "3" and "4" printed to their chat boxes instead of "nil".

Finally we want to teach the students that there are different types of variables. This is explaining with an example the difference between an int and string that was introduced in the first exercise. Show them the following script and ask them what they think will happen:

local c=2;
local d="Hello, World!";
print(c*d);

After having them guess, have them run it in-game:

/script local c=2; local d="Hello, World!"; print(c*d);

They should have nothing print out at all. This is because "c" is representing a number while "d" is representing a string, and the game has no idea how to multiply a number to a word; it only knows how to multiply if it has two numbers. When something goes wrong in a "/script" command, the game will simply stop running the script, which is why nothing is being printed out.

At the end of this exercise students should understand that variables are placeholders for other concrete values, and that there are both local and global variables as well as different kinds of variables. As an exercise, have the students do some basic calculations with print statements based on the experience points and money awarded by a quest. An example of such an exercise would be printing the name of a quest and then the ratio of the number experience points to the number of money awarded by the quest.

4. Loops

Loop statements repeat a specific computing task. By the end of this activity, students will be able to create a loop that goes through their players' extensive inventories of weapons, armor, treasure, and other objects, and displays them in the chat box.

The outcome for this second activity is to teach students the basic programming control flow of for loops. A for loop is a control flow used in computer science to complete a repeated action. Automating this process instead of typing out the same line of code or executing the same action multiple times saves time and effort. A simple version of a for loop can be used to for example print 10 messages to the chat box:

/script for i = 1, 10 do print("Again!") end;

What is happening in this script is simple: the for loop syntax counts from 1 to 10 inside the loop, executing whatever statements are between the "do" and "end" tags. There can be more than one statement between the "do" and "end" tags, since any action can be executed inside of a loop.

The use of "i" in the for loop is called a counter. It is a variable (taught in the previous activity) that keeps track of the number of times the for loop has been executed. To change the number of times the for loop is executed, simply change the numbers after the variable "i". This variable can be used inside the statements of the for loop (between the "do" and "end" tags) to do any number of things - for example, you can print the variable itself inside the for loop:

/script for i = 5, 8 do print(i); print("\n"); end;

And the script will print the numbers 5, 6, 7, 8 in the chat box on separate lines. There are many things you can do with for loops in the context of the game. For example, try the following exercises:
  1. 6 times, if the player is the party leader, print "I am the party leader!"
  2. Challenge: using online resources and the World of Warcraft API to write a script that loops through all the items in your bags and prints out their names in the chat box.

Timescale


Students should be level 3 or higher in World of Warcraft and have active accounts prior to starting the lessons. Explaining some of the basic definitions (Lua, script, chat box, etc.) and discussing the test environment (i.e., WoW) should take no more than 45 minutes. Each exercise should take one 45-minute class session to complete, although instructors may want to devote more time to certain lessons if students need more time to experiment with the scripts.

An important thing to note about learning programming is the self-help portion. To become proficient programmers knowledgeable about programming concepts and execution, students should spend time experimenting with writing their own scripts. The more time students spend on the exercises, the better of an understanding of computer science concepts they will have.

Once the lessons are complete, some students may be interested in progressing beyond the curriculum exercises. A good place to start is the WoW API, which will provide many interesting built-in functions to experiment with. To get started with macros, please visit http://www.wowwiki.com/Making_a_macro .

Assessment


The simple exercises that follow will reinforce some of the basic concepts described above. Any subset of these exercises can be used as an assessment of concepts learned. The teacher can decide which exercises to use as an assessment and which can be used as additional practice assignments. Exercises are grouped by concepts. In all exercises, students should be encouraged to test the scripts they have written. For example, for the first conditional statement exercise below, students should be encouraged to run the script first when they are targeting another character and then later when they are not targeting another character.

Built-in functions:

  • Ask the students to use print to display the first names of three of their classmates on three separate lines in the chat box

    Example solution:

    /script print("Andrew"); print("Ian"); print("Michele");
  • Ask the students to use print as a calculator to calculate the amount of copper they have in their possession. The conversion rate is 1 silver piece equals 100 copper pieces. They should just manually open their bag to see how much silver and copper they have, converting and adding the numbers to calculate the total amount of copper they have.

    Example solution:

    /script print("I have ");print(3*100+52);print(" copper.");

Conditional statements:

  • Using the WoW API, find the relevant functions to accomplish the following task: check to see whether you have a character targeted. If you do, print a statement saying so. If you don't print an alternate statement.

    Example solution:

    /script if(UnitHealth("playertarget")~=0) then print("TARGET ACQUIRED!!"); else print("I don't have a target..."); end;
  • Using the WoW API, find the relevant functions to accomplish the following task: if you are swimming or not swimming, print a relevant statement.

    Example solution:

    /script if(IsSwimming()) then print("I am swimming."); else print("I am not swimming."); end;

Variables:

  • Design a simple script using variables and the built-in function GetMoney() to print the number of silver pieces in your possession. This is building on one of the additional exercises from the built-in functions - automating finding the amount of money you have in your possession instead of having to look in the bag yourself. Use print() to give context to the number displayed. GetMoney() returns the number of copper pieces in the player's possession. The conversion rate is 1 silver piece equals 100 copper pieces.

    Example Solution:

    /script a=GetMoney(); b=100; print("You have "); print(a/b); print(" silver pieces");

For loops:

  • Design a script that prints out how much money you would make if you sold every item in your backpack. Use the following code snippet to get the sell price of an item:

    local itemSellPrice=select(11, GetItemInfo(itemID));

Every time the previous line of code is run, the variable itemSellPrice will contain the sell price in copper of the item with the ID of itemID. The function GetContainerItemID will be useful here; read its documentation in the WoW API.
  • Example solution:
    /script local total=0; for i=1,9 do local itemSellPrice=select(11,GetItemInfo(GetContainerItemID(0,i))); total=total+itemSellPrice; end; print("My items are worth"); print(total); print("copper.");

Note that the ending index of the for loop must equal the number of items in the student's backpack, and that all the items must be packed as tightly towards the top of the backpack as possible (i.e. there can be no gaps).



This document was co-authored by MIT students Andrew Hsiao, Ian Lamont, and Michele Pratusevich for 11.127/252/CMS.590, Computer Games and Simulations for Education and Exploration in March, 2011.

Friday, February 03, 2012

Mobile app competition and App Store SEO

Over on the Invantory blog, I have a review of Craigslist Mobile. It's one of many apps that let mobile phone users browse Craigslist and submit new listings. I describe how it works and explain some of the shortcomings (particularly around UX).

But one of the most interesting things I discovered as I was researching the tool was the hyper-competitive landscape in both the iPhone App Store and Android Market. Craigslist doesn't make its own app, so dozens of developers have hacked together mobile apps that piggyback on top of Craigslist's Web-based service. It's led to an oversupply of similarly named apps, all doing the same thing. Take a look at the screenshot below, from the iPhone App Store:

Craigslist apps in iTunes

How can all of the apps have the same name? They don't -- if you look closely, you'll notice that different punctuation has been added:
  • Craigs-list
  • Craigslist
  • Craigslist.
  • Craigslist!
  • Craigslist`
The reason why the developers used this name is because A) they know end-users will search for Craigslist in the App Store and B) they want to rank higher in the results than the competition. It's extreme SEO, except it's using the iPhone App Store search engine instead of Google. Note, however,  that unlike Google results, Apple App Store rankings depend on human inputs. Every app in the Apple App Store has been reviewed by human beings before being accepted, which means that Apple isn't paying attention, or doesn't really care what shows up in the search results.

The Android Market is similarly crowded with apps having similar names and functionality. To further confuse things, Craigslist Mobile on Android is made by a completely different company than Craigslist Mobile for the iPhone.

I don't know who is copying who, but it makes a mess for users.

Monday, January 30, 2012

Up and down days in the life of a startup

After writing a post about the Startup Roller Coaster on the Invantory blog, many friends asked me questions like this:

"So did you write that on an up day, or a down day?"

Truth of the matter is that post was prompted by a really "down" day coming right after a really "up" day. A few days later, after my co-founder and I had talked over the situation, and got some great advice and support from our mentors, the feeling changed. The boat started to right itself, and the sails once again started to fill with wind.

As you can imagine, life gets very stressful in a startup. The ups and downs are only part of the picture -- we also have to deal with crazy work schedules, shifting priorities, and a lack of startup capital, among other problems. It's hard, but also invigorating. As I tell many friends, I look forward to getting started every day, even if I've only had a few hours of sleep and I know there are a lot of tough obstacles to overcome. It's a good feeling to be able to move fast, and making progress can help turn a bad day on the startup roller coaster into a good day.

Monday, January 09, 2012

What's with the CIC references?

People following my @ilamont and @invantory Twitter feeds may have noticed frequent references and updates relating to the CIC. It stands for "Cambridge Innovation Center," an office building in Kendall Square that is hugely important to the local startup scene and to our startup as well.

More than 200 companies and individuals (including my business partner) rent office space in the CIC. Even for the cheapest co-working space (currently $250/month), wi-fi, coffee, and access to conference rooms and printers are included in the no-lease rental price. Most of the companies are tech startups that are developing businesses around software, hardware, and devices, although there are also investors and supporting firms (such as lawyers) in the building. We are in the CIC on a regular basis for meetings and events.

Besides being large, the community at the CIC is also very supportive. I've contacted numerous startup founders in the CIC to ask questions, and have never been turned down for a meeting. Some founders even make a point of helping others, either through free events or "entrepreneur's office hours". One example that stands out is a CEO of a small digital marketing firm who held such a session for me at 7 o'clock in the evening, which meant that she wouldn't be getting home until quite late. Such is the life of startup people, but I was touched nonetheless -- she didn't have to do this, but she did anyway, because she wanted to help other founders.

If you're interesting in learning more, I've written about the Cambridge Innovation Center and can share my opinion about the environment there. However, for specifics or more in-depth reviews of the CIC, it's necessary to contact old hands or the CIC operating company itself.

Tuesday, January 03, 2012

Roomba vs. vacuum cleaners: The robot wins!


Every once in a while an invention comes along that changes the way people live their lives. Computers, mobile phones, television, washing machines and cars are but a few examples. I'd like to add to the list robot vacuum cleaners ... specifically, the iRobot Roomba Model 530 that we got last month. It has changed the way we do housework, and has really freed up a lot of time for us to do other things.

A lack of time was the reason we got the robot. I have been cranking away on starting a new company producing a classifieds app and simply don't have the bandwidth to vacuum the house every week, and neither do other family members. I had heard about the Roomba for years but never considered buying one, owing to the expense and the fact that one of us usually had enough time to vacuum every week using a 15-year-old Sharp upright model. But when we both began new careers, the problem suddenly presented itself. Around the same time, I saw a brief side-by-side review of three robotic vacuum cleaners by America's Test Kitchen, and noted that the prices were coming down. I did some additional online research, and decided on the Roomba 530

iRobot Roomba 530
We put it to work right away. The results were impressive -- it cleaned up our bedroom, even getting underneath dressers and night tables, in less than 30 minutes. It got into corners and redid each spot multiple times, resulting in lots of debris in the dirt and dust traps. Next was the bathroom and hallway, and then the kids' rooms, and finally the downstairs area, including the kitchen. We have mostly hardwood floors throughout the house, which really suits the Roomba, although we've noticed it takes care of medium-sized rugs as well.

The greatest thing about the Roomba is it's pretty much fire-and-forget. You spend a minute or two prepping the rooms to be cleaned (moving toys out of the way, putting up loose electrical cords, shutting doors where you don't want the robot to go) press the button on the top, and let the robot do its thing. It seems to be moving randomly, but there is a method to its cleaning path, driven by trigonometry and some sophisticated algorithms. It's actually a great feeling being able to work in one part of the house while hearing the Roomba whirring away. Yesterday we even went out shopping and left the Roomba to clean the whole downstairs. When we came back the floor was clean and the robot had automatically returned to its charging station.

Are there drawbacks? Sure. One thing that some people will hate is having to clean the robot. Unlike a standard vacuum, which only requires changing bags or shaking out a dirt trap every now and then, the Roomba requires regular maintenance that contains about a half-dozen distinct tasks. You have to manually empty the dirt and dust traps (typically after a large room or the entire floor) and periodically unscrew the brush and rollers to remove tangled hair and dust. It doesn't take long, but it's dirty (with pets it would be even worse). It is also absolutely necessary to keep all of the parts moving.

There are some other minor irritants as well. It can get stuck on high barriers or under furniture that has hanging springs or rods, like our sofa bed. Cords and strings can mess it up. One time it brought down a heavy plug that I had placed on a table. It landed on top of the robot and shut it down, but there was no permanent damage (the robot is actually pretty sturdy). Another time I had to shut it down just before the end of a long string of yarn got swiped into its brushes. You can buy electronic barriers to keep it out of certain areas, but I've found the range on those are only about 10 feet, which means it can get around them if you're trying to block off part of a big room. As an alternative, I sometimes lay chairs on their sides to stop the robot from passing certain areas.

But overall, the Roomba is a remarkable invention. It's a huge timesaver. I estimate it saves us about 5-10 hours of labor per month. The cost is comparable with many upright models -- less than $300 when we bought ours. And while the maintenance is a minor pain, it's worth it.

Monday, December 12, 2011

What people are selling on Craigslist

I've started a new series of posts on the Invantory blog about what people are selling on Craigslist. The first post, "Craigslist Boston: What are people selling?" lists the top 20 categories for Craigslist Boston and generally give a good summary of what people are selling elsewhere in the state.

Not surprisingly, cars make it to the top of the list, and furniture, too, as well as computers, electronics, and cell phones. With the exception of phones, I've been using Craigslist (and before that, newspaper classifieds and the Want Ads) to buy and sell items in the other categories for many years.

What people are selling on Craigslist. A frustrating example I personally dealt with was selling an old Mac miniIn fact, one of the triggers for Invantory was my frustrating Craigslist experience selling an old Mac mini my parents gave me earlier this year. I wasn't the only one who had experienced similar hassles -- my partner, Sam Chow, was also familiar with Craigslist problems, after moving overseas and needing to sell all the stuff in his apartment.

Anyway, check out the blog post. I will be sharing more information in the months to come about how people use online classifieds, and then we plan to launch our own mobile classifieds service and build a solid Mass Craigslist alternative. Stay tuned!

Monday, December 05, 2011

Outer Limits, Moody Street: A 20th-century shop thrives in the digital age



Comic book stores are one of those 20th century retail holdouts that will continue to hold on to their tight little niche. I realized this as I was browsing the aisles of Outer Limits, located on the bustling old-school shopping district along Moody Street in Waltham, Massachusetts.

Economists and e-commerce experts may be skeptical. How is it possible, they might ask, that a store that specializes in analog media and obscure toys, carries tens of thousands of dollars worth of inventory, and is generally regarded as a lifestyle business has any hope in the plugged-in, digital age?

My answer: It's not just that Outer Limits has an amazing collection of sci-fi toys, pop-culture memorabilia, Mad books, Dungeons & Dragons manuals, 45 RPM records, and (of course) several thousand comic books.

It's also because the collection is browsable and tactile in a way that eBay and Amazon are not.

It's because Outer Limits leverages these online channels to support customers outside of eastern Massachusetts -- and does so with near-perfect customer satisfaction rates.

It's because the owner, Steve, can answer questions about practically any obscure comic book author/artist, and has samples or collections of many of them.

It's because the store has a wide range of customers, mostly males from about age 5 to 50, but some women, and many foreign visitors.

And it's because customers can find things that they probably wouldn't even know to look for on most e-commerce sites. To wit:

Angry Birds stuffed toy? Check!

Darth Vader bobblehead? Check!

Model Clone Wars troop carrier? Check!

Newly published collection of Spy vs. Spy escapades? Check!

Die-cast Aston-Martin car from an old 007 movie? Check!

Collections of seemingly every well-known American comic book character, from Archie to the X-Men? Check!

Complete Neal Adams collection, from the 1960s to the 1990s? Check!

Large plastic Godzilla action figure? Check!

Large plastic Mecha-Godzilla action figure? Check!

I am not the only fan. I was in the shop recently and it was packed with kids, teens, and adults. Everyone was finding something that interested them. And as long as there is a supply of unique items that tug at people's sense of nostalgia, pop culture, and fun, Outer Limits will continue to hold on to its special niche.

The shop is located on 437 Moody Street in Waltham, Massachusetts (two doors down from the popular Patel Brothers Indian supermarket).

Thursday, November 24, 2011

Startup blog mistakes no entrepreneur should make


I am the author of a startup blog -- the Invantory blog, which we launched last month. But I've also been looking at a lot of other companies' startup blogs as we researched startup accelerator programs like Y Combinator and TechStars. One thing I noticed during my review of some of the companies that had participated in the programs in the past was a moderate number of company blogs that have been neglected or outright abandoned.

Company blogs are a very well-known and important channel for informing users, recruiting customers, and sharing expertise, so I was surprised to see this trend. Blogs that haven't been updated in months or even years without any explanation prompt some users (and customers) to wonder if something's wrong, and outdated information that hasn't been corrected with newer posts can be a source of misunderstandings. These issues can have a negative effect on the business.

As I looked into why this was happening, it was clear that there were several causes. One unsurprising reason was many startups are too busy to regularly update the blog. Others had folded, but for whatever reason left the blog up and running. A few decided that blogging wasn't a good fit for them, or didn't deliver much value.

Whatever the reason, the fact that startup blogs are not updated is a major mistake for the companies that operate them. Fortunately, there are a number of solutions, and many of them are relatively easy to implement. I've outlined a list on the Invantory blog -- be sure to read and share it.

Wednesday, October 19, 2011

Choosing customers: What our startup learned

I'm in the process of starting a software company. My co-founder and I are targeting the online classifieds marketplace, but for a few months were considering how our technology might serve the struggling newspaper industry. Yesterday, I posted a very long account on the official Invantory blog that discusses why we changed our minds. It's located here:


One reader emailed me after seeing the post and asked what was the biggest lesson I had learned from this experience. My response:

"The biggest lesson in terms of targeting the newspaper industry was how bad the technology picture really is. When we hear about the problems that are bringing down these great companies, there's a lot of talk about demographics, advertising, consolidation, business models, staffing levels, alternate information channels, etc. But I think technology infrastructure is one of the most misunderstood and underappreciated elements that have contributed to the slide. The blog post I sent you talks a little bit about this (lack of standards, integration woes, technology vendors), but there is a great business case or Wired article waiting to be written ..."

If you want to follow the progress of Invantory as we attempt to provide an alternative to Boston Craigslist, please regularly check the company blog (links above) or follow us on Twitter at @invantory.

Sunday, October 09, 2011

Prospect Hill, Waltham: Before the leaves turn ...


Scenes from a mid-autumn walk in Waltham, Massachusetts. It's been a strange fall, with lots of moisture in September and temperatures in the 80s in mid-October. Usually by this time, the leaves are turning but not this year. Still, it's quite beautiful ...













Tuesday, October 04, 2011

Overcoming the technical cofounder problem

An acquaintance recently contacted me about an idea for a Web startup, using social media to bringing together people interested in humanitarian causes, art, positive change, etc. She knew I have been heavily involved in digital media/online communities and asked for my advice. The problem she had, and it's a problem that I think is quite widespread, is she doesn't have the required coding skills. I responded with the following message:
Regarding your idea for a social media site (or network?) it sounds pretty interesting, and there are definitely niches out there that are not being well served by Facebook, Linkedin Groups, or existing Web forums. 
That being said, I would be very careful about what area you target, as there are many existing services that address some of the areas that you named below -- Jumo, http://www.humanitarianforum.org/, some specific art-oriented communities, etc. Convincing users to join your site when there are already compelling services out there with large user communities is more difficult than targeting an unserved or underserved population. 
In addition, in my experience creating user communities and blogs in the past, I have found that very tight niches ("South Florida Artists for Peace") are much easier to gain traction than broad communities ("Worldwide Artists for Positive Change and Humanitarian Causes"). 
As for the nuts and bolts of creating the community, the good news is that there are many existing software platforms out there that make it much easier to get started, and good coders will know how to use them. 
The bad news is that good coders can be hard to find -- there is definitely a shortage of engineering talent, and you will be competing against larger companies and funded startups for them. 
But there is a silver lining: There are many software developers who are currently working as employees who are interested in co-founding a company. The question then arises of how to find one who likes your idea, recognizes the skills/connections you are bringing to the table, can brainstorm/collaborate on how to move the project forward, and finds the opportunity worth pursuing. 
In my opinion, the co-founder has to be someone you can meet in person on a regular basis -- that's how trust gets built, and ideas can move forward much more quickly than by sending emails or relying on Skype. You can work your local networks, or start attending local entrepreneurial meetups (preferably technology-oriented events). If there are none in your area, try organizing one and bring in one or two speakers that startup founders would want to hear from (for instance, a local lawyer talking about LLC vs S-Corp formation, or someone who has founded a successful startup in the past). 
Plan B would involve outsourcing all of the coding using Guru.com, Elance, or remote developers recommended to you by someone else. The problem with this approach, besides the cost, is working out the software specifications and deliverables can be very frustrating if you've never done it before. It's possible to find developers who can help walk you through the process, but even still the chance for misunderstandings and "scope creep" is very high -- another reason to find a technical co-founder.
I didn't get into the details of some of the software components that could be used to make such a site, but when I heard the idea I immediately thought of open-source content-management systems such as Joomla and Drupal, and authentication tools such as Facebook Connect and Twitter's xAuth/OAuth that would let people use their existing social media identities to authenticate/register and easily distribute the site's content and discussions elsewhere.

Thursday, September 22, 2011

Rules for photography in public: The ACLU view

The ACLU has a great page that explains what's allowed and what's not when it comes to taking photos and video in public places. It's an issue that's very important to anyone living in a free and open society, but is especially important now, considering nearly every mobile phone sold today has a digital camera buit in, and most of them can also take video (even my low-tech Nokia handset that came for free with my AT&T prepaid plan can shoot video, albeit at 128x96). The result is anyone with such a phone can photography anything or video any event that they happen to witness, whether it's mundane or extraordinary. Not everyone appreciates being photographed/videoed, however, and there is always a worry about getting in some sort of trouble for taking photographs. What are our rights?

The ACLU page lays it out very clearly. In terms of photography:
  • When in public spaces where you are lawfully present you have the right to photograph anything that is in plain view. That includes pictures of federal buildings, transportation facilities, and police. Such photography is a form of public oversight over the government and is important in a free society.
  • When you are on private property, the property owner may set rules about the taking of photographs. If you disobey the property owner's rules, they can order you off their property (and have you arrested for trespassing if you do not comply).
  • Police officers may not generally confiscate or demand to view your photographs or video without a warrant. If you are arrested, the contents of your phone may be scrutinized by the police, although their constitutional power to do so remains unsettled. In addition, it is possible that courts may approve the seizure of a camera in some circumstances if police have a reasonable, good-faith belief that it contains evidence of a crime by someone other than the police themselves (it is unsettled whether they still need a warrant to view them).
  • Police may not delete your photographs or video under any circumstances.
And:
If you are stopped or detained for taking photographs:
  • Always remain polite and never physically resist a police officer.
  • If stopped for photography, the right question to ask is, "am I free to go?"
  • If the officer says no, then you are being detained, something that under the law an officer cannot do without reasonable suspicion that you have or are about to commit a crime or are in the process of doing so. Until you ask to leave, your being stopped is considered voluntary under the law and is legal.
  • If you are detained, politely ask what crime you are suspected of committing, and remind the officer that taking photographs is your right under the First Amendment and does not constitute reasonable suspicion of criminal activity.
The underlined emphasis is mine. I was not aware of these issues until I read this page, and the phrase "Am I free to go?" is one worth remembering. Note also that not all officials (including police) understand the law when it comes to taking pictures in public places.

It's also worth remembering that public spaces include streets, parks, and many other exterior spaces. Further, these rights don't only apply to photographing police, but also anyone who happens to be in them. While someone may demand that you "put that camera down" or "stop taking pictures of me" and you are in a public space, you are legally within your rights to keep shooting -- although the polite thing to do may be different.

When it comes to shooting video, however, wiretapping laws have clouded the picture, and have been abused by police in Massachusetts and other states. Stories of people videoing an arrest on the street or even from their own property only to be arrested themselves have become disturbingly commonplace, and has a chilling effect on public behavior. There are signs the courts are coming around, but in the meantime reading the ACLU's take is helpful for understanding what's at stake:

With regards to videotaping, there is an important legal distinction between a visual photographic record (fully protected) and the audio portion of a videotape, which some states have tried to regulate under state wiretapping laws.
  • Such laws are generally intended to accomplish the important privacy-protecting goal of prohibiting audio "bugging" of private conversations. However, in nearly all cases audio recording the police is legal.
  • In states that allow recording with the consent of just one party to the conversation, you can tape your own interactions with officers without violating wiretap statutes (since you are one of the parties).
  • In situations where you are an observer but not a part of the conversation, or in states where all parties to a conversation must consent to taping, the legality of taping will depend on whether the state's prohibition on taping applies only when there is a reasonable expectation of privacy. But that is the case in nearly all states, and no state court has held that police officers performing their job in public have a reasonable expectation. The state of Illinois makes the recording illegal regardless of whether there is an expectation of privacy, but the ACLU of Illinois is challenging that statute in court as a violation of the First Amendment.
As for the question of whether it's OK to photograph or video the TSA, the answer is yes you can, as long as you are not interfering with the screening process or taking photos of their baggage scanner screens. Read the ACLU page for more information.

You may also be interested in some other blogging I've done, including:
Image: Protests in San Francisco, August 2011. Photo by flickr user tedeytan, posting here under the terms of the creative commons license used: Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0). 

Wednesday, August 31, 2011

North Country: St. Lawrence County

"North Country" is the upper tier of counties in New York state bordering Canada and including the northern part of the Adirondack Park. It's a very rural place, and very special. All the pictures below were taken in St. Lawrence County, ranging from abandoned farms in the town of Hammond to a Civil War re-enactment in Massena. Most of the water pictures were taken around Morristown, looking over to Brockville, Ontario, on the Canadian side of the river. I hope you can appreciate the great beauty here, and not just in the sunsets. I have a few additional notes at the bottom of the post, after the photos:


I've been coming here on a regular basis for most of my life, and have many relatives who live or summer in St. Lawrence county. Change is slow. Sometimes it mirrors what is happening elsewhere in America -- seemingly everyone has gotten a mobile phone, "for sale" signs are commonplace, and Wal-mart and national franchises dominate the retail landscape on the outskirts of Ogdensburg, Massena, and a few other small cities. But sometimes the change is unpredictable. In the 1990s, Amish started buying cheap farms in the North Country, and now they are ubiquitous. The influx has somewhat offset the downward trend in the locally born population, and have helped to reinvigorate the farming economy in St. Lawrence county.

Images: I am licensing the photos of St. Lawrence County under Creative Commons 3.0 CC-BY, which basically means you are free to copy them, place them on your own website, use them for commercial purposes, and adapt them, as long as you attribute them to Ian Lamont and link back to this post on ilamont.com.

The graphic of the North Country counties was uploaded to Wikipedia by Jondude11. I am reproducing it here under the terms of the Creative Commons Attribution-ShareAlike license, as described here.