Tag: Programming

  • The Accidental Programmer

    So far this is the best new name I have for my blog. I’m still brainstorming, but this is a story I want to tell and now is as good a time as any.

    I wrote, a while ago, about how I don’t have Imposter Syndrome any more. Perhaps it would have been better to say, I mostly don’t have impostor syndrome. Sometimes I don’t feel geeky enough. I don’t subscribe to xkcd (although I do appreciate the ones that I see), and I’ve never watched Star Wars or Star Trek, don’t understand the distinction, and I’m not particularly interested to either. I don’t drink Red Bull and stay up all night coding.

    The nerdiest thing I ever did was get fed up with Windows when I was 16 and wiped it off my hard-drive, replacing it with RedHat. Only I was at boarding school, with no internet connection, and couldn’t download all the necessary drivers. So my dad took it in to PC World, they fixed it, and I put up with Windows until I eventually got my first Mac nearly 3 years later.

    I learned HTML at 13 or 14, but didn’t learn to code until I was 16 (when I learned C in school). Then I went to University to study Chemistry, I wasn’t sure exactly what I wanted to do but I liked making stuff go fizz and occasionally burst into flames. My DOS (director of studies) put me in Computer Science as an elective, and I took the mandatory math course.

    Part way through my first semester, I went to him and said “I hate Computer Science”. I was frustrated by being taught programming through slides, not doing (I still don’t think this works well, especially not for beginners), and weirded out by all the boys who didn’t seem to wash regularly. I was also completely mystified by “Object Orientated Programming”, having learned procedurally. I could explain it beautifully, but the concept just made no sense to me. I remember a professor commenting in my third year that Computer Science had changed because you couldn’t expect everyone coming in to have taught themselves a good chunk of what they needed to know anymore – because there were non-geeks. Non-geeks like me.

    My DOS bribed me to stay in CS for another semester, promising he’d get me into Economics the following year. Anyway, it turned out Chemistry didn’t have enough explosions for me and I ended up still in CS, and Economic History rather than Economics (another story altogether, and not such a happy one… Economic History is all the boring bits of History and all the non-math-sy bits of Economics. It’s very dull). I guess at some point I started to like it, and then to love it. I wrapped my head around OO, discovered Recursion and Functional Programming (which I really liked) and met people who, if rather more nerdy than me, were at least clean. I interned at a wonderful company which gave me so much more confidence in terms of my ability, and I graduated with a good 2:1.

    I wanted to be a programmer, but I wasn’t sure where, or what kind, and I wasn’t yet ready to settle down, wasn’t sure if I wanted to go to grad school or not, so I took off. I worked in the US, trained in martial arts in China, hung out in Europe for a while, qualified as a ski instructor in Canada, worked for a bit in the UK and then went back to the US to work, ended up here in Canada at uOttawa. I’d realized I wanted to know more stuff and as only banks seemed to be hiring (oh, the irony!) it was a good time to go back to school.

    In the US I worked as a programming instructor, and after the second summer they recruited me to develop the programming curriculum. It also lead to the opportunity to work in China, last summer. In the UK, I worked to transform the zillions of spreadsheets a department was using to organize themselves into a database, that was easier to update and maintain and easier to extract information out of.

    The job in the UK really hit it home to me how we as programmers often don’t really understand how “normal people” use computers, which ultimately means that we don’t always know who our users are. People who don’t realize what a little know-how can do, and how if you represent your data the right way it can be a goldmine of information, with little effort. It’s now something that I try to consider, and it influences my research and general attitude to users.

    I read this article the other day – don’t let your strengths become weaknesses. It’s fascinating, because it explores this idea of how your weaknesses have corresponding strengths. So if my weaknesses that I’ve been talking about here are:

    • Lack of confidence
    • Not feeling enough of a geek

    My corresponding strength are:

    • Lack of confidence -> Patience as an instructor: I remember what it’s like to be confused so it’s easier for me to be patient when my students get confused. When they make an endless loop, I find it funny rather than frustrating.
    • Not feeling enough of a geek -> empathy with end users, and a better understanding of people for whom computers are a facilitator, not the be-all-and-end-all, or even the most important thing. An interest in how computers can be useful to regular users, rather than just technologically or programmatically more advanced.

    So an accident? Yes! A happy one? Yes! And if I don’t always quite feel like I belong, that’s not necessarily a bad thing – it can lead to other opportunities.

  • Java: Building Blocks and an Introduction to Processing

    Update: This will take place on Wednesday 18th and Friday 20th November, 7-9pm. Let me know if you’re interested.

    I’m thinking to run a session on this tomorrow, with discussion going on via Wave. Will start at 10 or 11am EST and run for 2 hours, with another 2 hours in the afternoon.

    Let me know if you’re interested. I know it’s short notice, so I may push back depending on when people want to do it, but this will happen in the next week or so.

    What you’ll need:

    • a Google Wave account
    • Java SDK
    • Eclipse
    • Processing, free download – we won’t be using the IDE that comes with it, but try and locate core.jar

    I’ll assume your computer savvy enough to install Java and Eclipse by yourself as this could take up a lot of time in the session.

    What we’ll cover:

    • Your first program – “Hello World”
    • Simple types (building blocks)
    • What Object Oriented programming means
    • Getting started with processing, displaying stuff
    • Conditions
    • Loops
    • Global vs. Local variables

    This is loosely based on the teaching I’ve done and I have a lot of resources that I’ve created that I’ll share. I have enough to do a whole series of these online workshops, if there’s demand. As it gets cold and nasty outside this could be a good opportunity to learn to code if you’re interested in doing so.

  • Thinking Like a Programmer

    CA assignment 3 is now out, and in class today we were looking at the stuff we needed for question 2 (which is ex. 7.1 in the textbook). It’s to manually solve the isomorphism for the two graphs below:

    Petersen Graph
    Petersen Graph

    So I start sketching this out, and then it occurs to me that – ooh, I could easily write some code to validate it for me after I’ve worked it out.

    And then it occurs to me that all I’m doing is trying permutations of “abcdefghij” (where the position in the string is the number they’re trying to replace). And if I used Haskell and the handy “permutations” method I could just code it in a brute force manner, and it would solve it for me.

    So of course that’s what I did. This is a programmer thing, I think. We work out how to automate things and then we automate them. Yes, it probably took me longer to write the code than it would have to solve the thing manually. I was quite shocked that it ended up being over 60 lines (including white-space, but still… this is Haskell) although I did include my data (the edges) and methods to validate them. I think it could be done with less code, my Haskell is a little rusty.

    I find programming much more satisfying than drawing the graph countless times until you get the right answer. Also, my code is purring away now generating all the valid permutations.

    In case you’re interested… here are the first 20:

    (‘c’,0),(‘d’,1),(‘e’,2),(‘f’,3),(‘g’,4),(‘b’,5),(‘i’,6),(‘h’,7),(‘a’,8),(‘j’,9)

    (‘e’,0),(‘d’,1),(‘c’,2),(‘b’,3),(‘h’,4),(‘f’,5),(‘i’,6),(‘g’,7),(‘a’,8),(‘j’,9)

    (‘d’,0),(‘e’,1),(‘f’,2),(‘a’,3),(‘i’,4),(‘c’,5),(‘h’,6),(‘g’,7),(‘b’,8),(‘j’,9)

    (‘f’,0),(‘e’,1),(‘d’,2),(‘c’,3),(‘g’,4),(‘a’,5),(‘h’,6),(‘i’,7),(‘b’,8),(‘j’,9)

    (‘a’,0),(‘f’,1),(‘e’,2),(‘d’,3),(‘i’,4),(‘b’,5),(‘g’,6),(‘h’,7),(‘c’,8),(‘j’,9)

    (‘e’,0),(‘f’,1),(‘a’,2),(‘b’,3),(‘h’,4),(‘d’,5),(‘g’,6),(‘i’,7),(‘c’,8),(‘j’,9)

    (‘b’,0),(‘c’,1),(‘d’,2),(‘e’,3),(‘h’,4),(‘a’,5),(‘g’,6),(‘i’,7),(‘f’,8),(‘j’,9)

    (‘d’,0),(‘c’,1),(‘b’,2),(‘a’,3),(‘i’,4),(‘e’,5),(‘g’,6),(‘h’,7),(‘f’,8),(‘j’,9)

    (‘f’,0),(‘a’,1),(‘b’,2),(‘c’,3),(‘g’,4),(‘e’,5),(‘i’,6),(‘h’,7),(‘d’,8),(‘j’,9)

    (‘b’,0),(‘a’,1),(‘f’,2),(‘e’,3),(‘h’,4),(‘c’,5),(‘i’,6),(‘g’,7),(‘d’,8),(‘j’,9)

    (‘c’,0),(‘b’,1),(‘a’,2),(‘f’,3),(‘g’,4),(‘d’,5),(‘h’,6),(‘i’,7),(‘e’,8),(‘j’,9)

    (‘a’,0),(‘b’,1),(‘c’,2),(‘d’,3),(‘i’,4),(‘f’,5),(‘h’,6),(‘g’,7),(‘e’,8),(‘j’,9)

    (‘e’,0),(‘d’,1),(‘c’,2),(‘g’,3),(‘f’,4),(‘h’,5),(‘i’,6),(‘b’,7),(‘j’,8),(‘a’,9)

    (‘e’,0),(‘h’,1),(‘j’,2),(‘g’,3),(‘f’,4),(‘d’,5),(‘b’,6),(‘i’,7),(‘c’,8),(‘a’,9)

    (‘j’,0),(‘h’,1),(‘e’,2),(‘d’,3),(‘i’,4),(‘g’,5),(‘b’,6),(‘f’,7),(‘c’,8),(‘a’,9)

    (‘g’,0),(‘c’,1),(‘d’,2),(‘e’,3),(‘f’,4),(‘j’,5),(‘b’,6),(‘i’,7),(‘h’,8),(‘a’,9)

    (‘d’,0),(‘c’,1),(‘g’,2),(‘j’,3),(‘i’,4),(‘e’,5),(‘b’,6),(‘f’,7),(‘h’,8),(‘a’,9)

    (‘h’,0),(‘j’,1),(‘g’,2),(‘c’,3),(‘b’,4),(‘e’,5),(‘i’,6),(‘f’,7),(‘d’,8),(‘a’,9)

    (‘g’,0),(‘j’,1),(‘h’,2),(‘e’,3),(‘f’,4),(‘c’,5),(‘i’,6),(‘b’,7),(‘d’,8),(‘a’,9)

    (‘d’,0),(‘e’,1),(‘h’,2),(‘j’,3),(‘i’,4),(‘c’,5),(‘f’,6),(‘b’,7),(‘g’,8),(‘a’,9)

  • 10 Tips for Beginner Programmers

    This week I’ve spent a lot of time debugging other people’s code, and we had some fun bugs in class too. This was my favorite bug (I refused to fix it, but she worked out how). I’ve helped people in C, VB, and Maple – none of which are my favorite languages (I didn’t know Maple at all), and don’t have the great debugging capabilities of Java in Eclipse. As a result, I’ve come up with some tips for beginner programmers as a result of the common errors I’ve seen.

    1. Don’t take your code not running personally. Your code (or your instructor) is not out to get you! Debugging requires calm and rational thinking, the more you get upset that your code isn’t working, the less able you’ll be to fix it.
    2. Google is your friend. Lots of people learning to code have had the exact same problems you’ve had, if you can search you’ll often find potential solutions (just be careful – they may not be good, or exactly what you’re looking for). Online is also where you may be able to find that function you need.
    3. Read error messages. I’m losing track of the number of times that someone calls me over to look at a program, shows me how a compilation error pops up and then hits enter before I can read it. Read the error messages! Even if you can’t fix them yet, once you’ve learned what they mean you’ll know what to look for and be better able to fix them in the future.
    4. What are you declaring and why? Think about your variables – what to you need? What do they do? The type of the variable (String/Integer/Boolean etc) is important.
    5. Frame your problem in terms of behavior. If someone frames their problem well, I know exactly what kind of bug I’m looking for. Explain it briefly, then let me look at the code.
    6. Print statements! So useful to see what’s going on inside in the code. Don’t be afraid to use them – you can always delete them later.
    7. Small things can cause big problems. My friend spent hours trying to fix something in her code yesterday – the problem? She was using assignment equals (=) rather than logical equals (==) in an if statement (you can do this in C). Small distinctions can be really important – pay attention to them.
    8. Turn the monitor off. A blank text-editor filling your screen can distract you from the problem itself. Writing code should be the last step in solving the problem – not the first. Turn off the monitor, think about the problem, and break it down into it’s component parts. Then code it in the parts (but don’t be afraid to break them down again if necessary).
    9. The computer will do exactly what you tell it to do, in exactly the order you tell it. A lot of people forget this, but it’s so important. When the computer is not behaving the way you want it to, reflect on this. It’s important to be clear on what you want to happen first, or what you want to repeat (or don’t want to repeat) in a loop, for example.
    10. If you’re lucky enough to have a TA or friend willing to help you – take advantage of that!

    Anything I’ve missed? Let me know!

  • Democamp 12

    Monday was Democamp 12, I heard about it in the morning and managed to get a ticket (someone dropped out). It was really a great evening; I met some really cool people and won a model plane.

    Events: Betidings and Twegather

    First up presenting was Betidings. The concept is that you have a calendar of events that you’re interested in, and you can follow other people and events they add to their calendar will show up for you as well. So with very little effort I now have a schedule of events in Ottawa and I can see what days I’m free and what interest me. The downside – I was living in contented ignorance about the Girl Geek Dinner on Monday, and now I’m gutted that I’m missing it! I think it’s worth checking out, you can see what I’m interested in here.

    This is still in the very early stages and is more of a proof of concept than a fully fledged application but I think it’s worth a go – the more data there the more useful it will be. And it’s a nice way to share stuff you’re interested in without forcing it on people. I guess it could potentially be for events what Twitter is for ideas and content. Not sure everyone got this though – one jerk said the user interface sucked. Not quite in the spirit of democamp! The UI isn’t fully there yet and I’m not a big fan of the colorscheme but they’re actively looking for feedback and welcome any comments to @betidings.

    Twegather (not yet public) was created through TeamCamp – read about it here. It’s an event system using Twitter, you’ll be able to create an event using @WhoWantsToGo.

    Crazy Planes

    The planes were what I was talking about in this tweet. A full article on it is this one, by the lovely @loudandskittish. I thought these were awesome because to me they illustrate the programmer mindset applied to something not-programming. I’m definitely going to be taking mine (and hopefully a few more) to my Holiday Science Lecture in December!

    Twitter Procrastination Tool: BattleTwip

    This is kinda cute! Battleship on Twitter, played against everyone. Created by 76Design, you can follow @battletwip and play via Twitter when the next game starts. They also have a really awesome looking web interface which we saw a preview of, but as far as I can find it’s not up yet.

    Advertising: Shiny Ads

    Shiny ads is an alternative to Google Adsense. It allows you to attract your own advertisers, gives them the tools to make their ad or upload it and then you can approve it (or not) and earn a much better rate for click-through. Wasn’t so relevant to democamp – although most people had websites, they seem to use them to either promote their (non ad-based-web-) business or personal brand.

    Overall

    Great experience, great people, great opportunity to interact with the Ottawa tech community and it’s nice to see what’s up and coming. I love the vibrant tech scene here! Can’t wait for democamp 13 – wonder if I could present my graphs…?

  • I ♥ Haskell

    I knew there was a tighter way to write the derangement code for my assignment, but my Haskell was really rusty and what I had was fast, so I gave up. This morning it came to me – now I have 5 lines instead of 8. I do not have any idea how one would express this in pseudo code, though and it’s probably really quite difficult to read if you’re not familiar with Haskell.

    derange1 :: Int -> [[Int]]
    derange1 x = perm 0 (makeList x)
    
    makeList :: Int -> [Int]
    makeList 0 = []
    makeList n = makeList (n-1) ++ [n]
    
    perm :: Int -> [Int] -> [[Int]]            
    perm _ [] = [[]]
    perm x list = concat [map (e:) (perm (x+1) (delete e list)) |
                                           e <- list, e /= (x+1)]

    It’s sometimes surprising how having less can 1) be more work and 2) feel like such an achievement.

  • Efficiency

    At the moment, I’m taking a class in Combinatorial Algorithms. You can probably gather from the things that I write about here that this is not my passion… however so far it’s better than expected. We’re moving onto backtracking. If you know a functional language such as Haskell or ML (I know there are others, these are just the two I know) backtracking is fairly easy, so of course I ask if we can use such a functional language for our assignment. So then this exchange happens (of course I Twittered it):

    Student: Why are you talking about functional programming?

    Professor: Oh… she’s European.

    Ah yes, we Europeans like to sit in cafe’s drinking espresso and talking about politics, philosophy, functional programming…

    For our current assignment, one of the questions was to write a program that would produce all the “derangements” for a given number: a derangement is like a permutation except none of the elements are in the original position (see the table at the end of the post). There are fewer than 6 students in the class and two of them mentioned to me that they found this question difficult. However I wrote it in Haskell, and it took me 8 lines of code and 2 hours (the first chunk of which was spent getting to grips with the syntax again – it’s been a while) and runs really fast. See below:

    Note – I’m not concerned about putting this up before I’ve handed it in, as there are very few students in the class and I’m confident none of the others know Haskell

    -- Cate Huston - Question 3
    
    import Data.List
    
    derange :: Int -> [[Int]]
    derange n = iter (n-1) (permutations (makeList n))
    
    makeList :: Int -> [Int]
    makeList 0 = []
    makeList n = makeList (n-1) ++ [n]
    
    iter :: Int -> [[Int]] -> [[Int]]
    iter 0 ls = remove 0 ls
    iter a ls = iter (a-1) (remove a ls)
    
    remove :: Int -> [[Int]] -> [[Int]]
    remove _ [] = []
    remove a (l:ls) = if (l!!(a) == (a+1)) then remove a ls
                      else l : (remove a ls)

    This code is efficient, in the sense that it didn’t take me very long, but it’s also very efficient to run because of the way Haskell uses lazy evaluation, so things are not created (or computed) until it’s necessary. So even though it looks, for instance, that creating a list of permutations is one of the first things I’m doing, in practice it’s something that happens very shortly before the relevant permutation does (or doesn’t) appear on my screen.

    Computer Science (or Informatics) at the University of Edinburgh wasn’t always the most fun experience but here’s what I’m grateful for: I’ve programmed in 9 languages. And whilst I’m not particularly confident in all of them, I know enough about each of them to have an appreciation for when it’s appropriate. I think Haskell is most appropriate in this instance, for example, but I’m using Java for my visualizations. If I need to script something, I’ll probably use Python and I understand why C is still used a lot, but also why it’s difficult to code in (and so very, very difficult to teach a beginner). The only thing I still don’t get is Tcl (everything’s a String! Everything! Why?).

    This makes me more efficient as a programmer, in that I have more choice to fine the best language for what I’m doing, and also in that I’m not afraid to learn another language and I don’t get fazed by the syntax being different. Yesterday, for example, I debugged someone’s Visual Basic code. I’ve not really done any VB before (since 2004 I’ve only used Windows when someone’s paid me to), but type errors are type errors so it didn’t take long to fix.

    Programmers – we need to stop clinging to the one language we know (primarily Java, I’ve found) and thinking we can do everything in it. It’s probably possible, but there might be a better way. And in 10 years time, will Java still be this popular or will something have surpassed it? We need to have the skills to move on, if the need arises.

    Derangements – all of these (and 7 – not shown) ran in well under 1s

    1 []
    2 [2,1]
    3 [2,3,1],[3,1,2]
    4 [4,3,2,1],[3,4,2,1],[2,3,4,1],[4,1,2,3],[2,4,1,3],[2,1,4,3],[4,3,1,2],[3,4,1,2],[3,1,4,2]
    5 [4,3,5,2,1],[4,3,2,5,1],[5,3,4,2,1],[3,5,4,2,1],[3,4,5,2,1],[3,4,2,5,1],[2,3,4,5,1],[2,5,4,3,1],[2,4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4],[3,5,6,2,1,4],[3,5,2,6,1,4],[3,5,2,1,6,4],[3,1,2,5,6,4],[6,3,2,5,1,4],[3,6,2,5,1,4],[6,1,5,2,4,3],[6,5,1,2,4,3],[5,6,1,2,4,3],[5,1,6,2,4,3],[5,1,2,6,4,3],[6,5,2,1,4,3],[5,6,2,1,4,3],[6,1,2,5,4,3],[2,6,1,5,4,3],[2,1,6,5,4,3],[2,1,5,6,4,3],[2,6,5,1,4,3],[2,5,6,1,4,3],[2,5,1,6,4,3],[2,5,4,6,1,3],[2,5,4,1,6,3],[2,1,4,5,6,3],[2,4,1,5,6,3],[2,6,4,5,1,3],[2,4,6,5,1,3],[2,4,5,6,1,3],[2,4,5,1,6,3],[5,1,4,6,2,3],[5,1,4,2,6,3],[6,5,4,1,2,3],[5,6,4,1,2,3],[5,4,6,1,2,3],[5,4,1,6,2,3],[5,4,1,2,6,3],[6,5,4,2,1,3],[5,6,4,2,1,3],[5,4,6,2,1,3],[5,4,2,6,1,3],[5,4,2,1,6,3],[6,1,4,5,2,3],[6,4,1,5,2,3],[4,6,1,5,2,3],[4,1,6,5,2,3],[4,1,5,6,2,3],[4,1,5,2,6,3],[6,4,5,1,2,3],[4,6,5,1,2,3],[4,5,6,1,2,3],[4,5,1,6,2,3],[4,5,1,2,6,3],[6,4,5,2,1,3],[4,6,5,2,1,3],[4,5,6,2,1,3],[4,5,2,6,1,3],[4,5,2,1,6,3],[4,1,2,5,6,3],[6,4,2,5,1,3],[4,6,2,5,1,3]
  • Art, Life, and Programming

    This December, the University of Ottawa is holding some events to get children (7-10) interested in Engineering and Computer Science. I got the email and was inspired, because this is something I do.

    My full CV is on my LinkedIn, but suffice to say the past 3 summers I’ve been teaching programming to kids. 2007 in St Paul (Minnesota), 2008 in St Paul and Seattle, and this past summer in Shanghai. I’ve also worked on the Java curriculum that was taught across the US (and that I taught in Shanghai). I’ve done this rather than take better paid jobs, or internships, and I’m not 100% sure why. But here’s why I think I do it…

    Programming is seen as boring, 1’s and 0’s. It’s not as exciting as making a website, or a video game. But – talented programmers are how the applications we use to make websites and video games are made in the first place. When we use an application, we’re limited by what the application designer thought we would want. But when we code, we’re limited by the speed of our computer, the size of the memory… and our own imagination. Bear in mind, the first two limitations get less limiting by the 18 months (says Moore’s law).

    I find that really inspiring. And, if I take that mindset and look at the things I do, day to day, hardware designers and programmers have changed everything. Here’s some of what I’m interested in: usability, search engines, social networking, programming as art… OK, computers have been about for a while, but if I were 10 years older? I never would have made it in Computer Science. It would have been too much about the hardware, for me. There’s a long story as to how I wound up in CS, but the short story is – it was kind of an accident. But there was enough there that I liked to keep me at it, and I doubt that would have been the case 10 years earlier. And now – I love it. I love to code, I love what I do. Seriously, I’ll talk about it to anyone who’ll listen. I’m excited to explain it to people who aren’t techies, because I’m excited that we’re finally getting there – where the stuff programmers create in their darkened basements is something real people use, and could even understand if we would just take the time to explain it to them without using obscure acronyms and unexplained concepts. I’m excited by the fact we don’t need to live in darkened basements anymore, too.

    So, my theory in teaching is – learning to code, the constructs, thinking logically… can be pretty dull. But what we can create is really exciting. So I focus less on constructs, more on possibility. I talk about Open Source, and the browser wars, extreme programming, and I create stuff. And I make sure that every child I teach has the option to go home with something graphical. This year, we used processing and it was awesome. We made fractals, block breaker, snake (like the game on the Nokia phones), tetris, and a game the student called “dodgeball” (I’ll put these all up when I get my website done). And this was on top of the “frameworks” I’d created in the curriculum – hangman, noughts and crosses, blackjack, and Pacman, which were done using Swing. Frameworks mean the GUI was done for the student, and they fill in the Logic.

    So, back to the presentation. I’ve uploaded the slides here, so please take a look (and let me know what you think – first draft). It’s supposed to last an hour to an hour and a half.

    My Presentation centers around 3 Themes: Art, Life, and Programming.

    Theme 1: ART

    Art is no longer just paintings, or sculptures, or even photographs. Technology has given us new mediums to create with, and new means to distribute. Code is like a paintbrush, and the internet is the worlds biggest art gallery.

    Examples

    • The Twitter “Fail Whale” – an example of how a popular web service can make an image iconic. The “Fail Whale” now has it’s own range of memorabilia – have a look here.
    • We Tell Stories – a digital literature project. 6 authors, 6 stories, each given a new form using the internet. You can follow the story of 21 steps through Google Maps, but my personal favorite is Fairy Tales where you can control how the story goes.
    • One and Other – an installation, or “living monument”. For 100 days, one person every hour spends their time at the top of the plinth doing whatever they want. Broadcast over the internet, it’s attracted millions of page views and hits from around the world.
    • New Yorker cover in May drawn using the iPhone application Brushes.
    • PostSecret – a community mail art project. People send in post cards of their secrets, which are then posted on a blog each week. A mix of old and new technology. Running since 2005, the 5th book is shortly to be released and thousands of secrets have been posted online.
    • Pixel City – a YouTube video of the creation of an entirely computer generated city.
    • I Want You To Want Me – an interactive installation at the Museum of Modern Art, New York created by Sep Kamvar and Jonathan Harris. It pulls data from dating sites, and displays it in different ways. Visually stunning, and profound it “explores the search for love and self in the world of online dating”.

    These tools are recent.

    Fractal – Art, or Math? Or both?

    Theme 2: LIFE

    Inventions that have changed humanity: the printing press, electricity, the combustion engine, fire…

    Computers and the Internet are another such invention, and we’re living through the period of change. Who knows what 2010 was like? Parents upbringing would be unrecognizable to the way we live now.

    In the West, people aged 30 and under are the first generation to grow up with the internet being “normal”, and everywhere. This gives us a significant advantage in the 21st century. However, less than 24 people in every 100 worldwide have access to the internet, which was only invented in 1989. Much information – medical records are a good example, is not yet digital.

    Blogging is a new medium, the Blogger service was launched in 1999, and bought by Google in 2003. Services like this made it possible for not techies to “blog” (previously, blogs were just websites which required more knowledge to create). The concept of sharing your every day life in public, as it happened was new. Now, Blogging is also used as a way to communicate with your customers – important announcements are made on the company blog (Google is a great example of this).

    Blogging may have been the start of the concept of “ambient intimacy”, where people stay connected by following each others lives on the internet, rather than through active communication. It’s also something that newspapers see as a threat to their business model.

    Newspapers: Prediction, the paper version will be obsolete, and soon. Why? Because the way we live is changing, because their business model has been undermined by services like CraigsList. Because the world will be different in 5 years than it is now, and a lot different from how it was 10 years ago.

    What’s Next? Google Wave, the Apple tablet computer, table computing, house-cleaning robots… and other things we haven’t imagined yet.

    Theme 3: PROGRAMMING

    People used to program using 1’s and 0’s. A card with holes punched into it, that you’d insert into a computer (when it was your turn) and wait for the result to come out the other end. We’ve come a long way since then, and can code visually using things like Alice (upcoming 3.0 release uses The Sims) and the Warcraft World editor. Often, though, we use something in between such as C#, Haskell, or Java.

    Remember the fractal? It’s Java – created using Processing.

    Conclusions

    • Technology has changed our lives considerably relatively recently
    • New and impressive “hardware”
    • Creative and innovating programming
    • More to come!
    • Technologists – hardware designers, programmers – are at the center of what we will achieve next

    Final Thoughts

    • Look around – changes are happening rapidly
    • In 15 years, you could be talking about what’s happened in your lifetime
    • Be inspired! Human innovation is INCREDIBLE!
    • Push boundaries! Be limited only by your imagination.
    • Experiment!