Hacking for beginners at MCN2011

Yesterday I took Mia Ridge’s workshop on Hacking and mash ups for beginners at MCN11. I’m not very confident in code. I work a lot with some very clever developers, and what they do, may as well be magic.  Because it is so far over my head it’s unbelievable.  But I find it so frustrating that I express my own ideas for digital collections clearly, or quickly make a prototype to show how I imagine something working.  I know basic HTML and I’ve done an intensive PHP course, I’ve even played with processing. But still I’m just a bit naff at code.

So Mia had her work cut out with me.  The procedural dunce, who tries hard but lacks ability.

I really enjoyed the workshop, in fact it would have been great if it was a full day workshop so I could have really got to grips with some of the tools and data sets Mia told us about. something for me to work on at home perhaps.   full of cooking analogies, breaking concepts down into their basics parts as well as making us hungry lead to an open fun workshop environment for tinkering with snippets of code.

Firstly we started with the basics: what an API actually does and how to use one, how web scripting languages work and pseudo-code. It was nice to hear computers described as being pedantic like a Grumpy 6 yr old.
Also the following key points:

  • You won’t break the computer
  • Scripting isn’t rocket science (but it is hard fun)
  • Code is a language if you can learn Spanish you can learn programming

So what is hacking anyway? Basically Building cool stuff, and building it quickly, hense hacking it together, normally with open data and tools.  I have to admit a hack day for a novice still sounds terrifying. A day, which is normally 48hours,in a shared space with lots of other hackers high on sugar, coffee, beer working on themes, challenges, data sets. Scary.  Now on to Mashups – mixing stuff together, applying tools to data, to combine data of one or more sources and then adding extra data and visualisation tools such as maps or timelines.

Before we were let loose on some code Mia explained how to start thinking like a programmer. One thing I never really appreciated is how much patience developers must have.  I’m inpatient, if something isn’t working, I want to press one button and for it to be fixed.  I can’t cope with hours of unbugging. I would throw the computer out of the window.  I don’t know if patience is something I can learn I order to be procedurally literate, perhaps if I can find a Tibetan monk who can teach me the skillz.

  • Learning by tinkering – thinking algorithmically – like writing a recipe for an 8 year old to follow
  • Nice. Disney gets a mention computers are like Fantasia, where the brooms keep splitting, a computer will continue to repeat unless told differently.
  • Thinking like a programmer- half the battle is being able to describe clearly what you want to do
  • Coding is about putting the right instruction in the right place.
  • Logic and branching
  • Cooking In your own browser
  • HTML page provides a basic structure
  •  function is like asking someone to make pastry for you and then give you the pastry to make the pie, a pre set instructions
  • Event handler -triggered when something they’re listening for happens
  • ID is a specific label – labels in HTML that act as hooks for JavaScript
  •  variables- containers that store things
  • Comments – leave messages for other programmers the computer can’t see them
  •  variable – assigning a variable
  • Document.write
  • String is like a sentence – single quotes – gets the computer to write exactly what is in the string. Without completing a function
  •  Plus sign + has lots of different uses
  • + Addition
  • – Subtraction
  • * Multiplication
  • / Division
  • % Modulus (division of remainder)
  • ++ Increment
  • — Decrement
  • Document.write(yourName) is a  variable
  • Document.write(‘yourName’)is a  string – literal thing
  • Debugging tips:
  • The art of being a programmer is making lots of mistakes
  • Make a copy of the exercise file first so you can always compare with one that works
  • If it breaks or doesn’t work:
  • Check the quotes are matched
  • Check that any named thing is spelt consistently
  • Check upper/lower case
  • Use document.write() to show the values you’re working with if you get stuck
  • Google the error message
  • Concatenator ???
 We then went on to undestand how to use visualisation tools and the shape of a dataset.  Working with real data was fun.  NMSI datasets and google fusion tables! Clocks and maps, all by a bit of tinkering. Excellent.  Some of my notes are below:
  • Planning a mashup is like planning to cook.  Do you have all the ingredients? How do they need to be prepared? Who are you serving it to, and what do they like?
  • Decide what you’re making (maps,timelines, images, etc) and where the data is coming from – downloadable or online data sets, google etc provide APIs and data visualisations tools.
  • Start designing, programming,testing – start small and build incrementally
  • The art of the join
  • What other data can you join to you’re dataset? Think about Info from general sites like Wikipedia and freebase, Information from other GLAMs, Other info about the same event, place, person, object.
  • Museum data is messy! manual cleaning to remove rows where vital info is missing, Nasty characters, dates +-, changing between numbers and text will need to be converted and tidying inconsistencies in term lists or spelling.
  • Enhancing data is a good way to check what needs cleaning.
  • Geo coding- making words/addresses into spatial coordinates
  • Entity extraction- recognising names of people, places,events etc within text.
  •  Learning to deal with mess is an important part of working with GLAM data.
  • Re-using existing work-
  • So far all code in the workshop has been on the page but that gets impractical – import scripts or data.
  • Lots of solutions already exist and then you can experiment with different values in existing codes, so you don’t have to start from scratch.
  • Code Libraries as packet mix -useful shortcut if want something common; you can choose the flavour but you can’t choose how it’s made.

I made still be a bit of a procedural illiterate fool, but I think I’m ok with that. I’m happy playing, making a mess, and making

something simple. There are amazing patient developers who make brilliant,gorgeous things.  I wanted to learn code in order to make perfect things, but that isn’t realistic.  Playing with datasets,sounds much more fun.