<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Personal weblog of  Jakub Hampl who is an AI &amp; Psychology student at Edinburgh University.</description><title>Da Gampa's Code</title><generator>Tumblr (3.0; @gampleman)</generator><link>http://gampleman.eu/</link><item><title>Writing your own Canvas Scene Graph</title><description>&lt;p&gt;Writing a scene-&lt;em&gt;what&lt;/em&gt;? The HTML5 Canvas api provides primitive methods to express shapes, strokes and fills, which is all fine and dandy, but in a lot of situations we tend to think of drawing as composed of objects. E.g. to draw what I see from my window I need to draw a tree, a house and some grass, not a sequence of paths.&lt;/p&gt;

&lt;p&gt;This is true even more when we start animating, typically objects that are part of another object move when the parent object moves.&lt;/p&gt;

&lt;p&gt;One way to abstract this is to have a graph of objects where some objects are contained in other objects and each object takes care of drawing itself. This is called scene graph rendering.&lt;/p&gt;

&lt;p&gt;In this article I will show how to build your very own scene graph renderer for the HTML5 canvas. If you are simply looking for a full-featured, pre-built solution, I recommend checking out &lt;a href="http://labs.hyperandroid.com/static/caat/"&gt;CAAT&lt;/a&gt;. But sometimes you need something easily customizable/lightweight. We will build a single CoffeeScript class that implements everything necessary.&lt;/p&gt;

&lt;h2&gt;The basics&lt;/h2&gt;

&lt;p&gt;The first thing that any computer graphics program has to deal with are coordinate systems. We want each object to have it&amp;#8217;s own independent coordinate system and itself be defined in terms of it&amp;#8217;s parents. In general this indepence is one of the best reasons for using a scene-graph solution, since canvas tends to have a lot of global state, and you might often face the situation that changing one part of your composition affects a very different part. We wish to avoid that.&lt;/p&gt;

&lt;p&gt;The simplest way to solve this is to have each object be it&amp;#8217;s own canvas.  So let&amp;#8217;s start coding:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class Entity
  width: 0
  height: 0

  constructor: (@width, @height) -&amp;gt;
    # Create the canvas we will be rendering the object to
    @canvas = document.createElement('canvas')
    @canvas.width = @width
    @canvas.height = @height

  # Call this function to render out the object, returns a Canvas instance
  render: -&amp;gt;
    ctx = @canvas.getContext('2d')
    # Clear the canvas, important for animation
    ctx.clearRect(0, 0, @width, @height)
    @draw(ctx)
    @canvas # return the canvas

  # This function should be overriden in subclasses  
  draw: (ctx) -&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now each subclass has to only implement the &lt;code&gt;draw&lt;/code&gt; method with it&amp;#8217;s own set of drawing primitives.&lt;/p&gt;

&lt;h2&gt;Composition&lt;/h2&gt;

&lt;p&gt;We hover are still not a graph, there is no way in which objects can have no children. First we need to add a few more properties to our class:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;x: 0
y: 0
children: []
parent: null
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; are numbers that determine where will the object be drawn in the &lt;code&gt;parent&lt;/code&gt;&amp;#8217;s coordinate system. Let&amp;#8217;s implement a default &lt;code&gt;draw&lt;/code&gt; method, that will render the children:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;draw: (ctx) -&amp;gt;
  for child in @children
    ctx.drawImage(child.render(), child.x, child.y)
  false # return some value, otherwise CoffeeScript will return an array
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;drawImage&lt;/code&gt; method takes an Image, Canvas or Video object and draws it at specified coordinates. Since &lt;code&gt;render&lt;/code&gt; returns a canvas instance with the object drawn in it, we can now render it in the parent canvas. A simple demo of this class:&lt;/p&gt;

&lt;iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/CfPMw/embedded/result,js" allowfullscreen="allowfullscreen" frameborder="0"&gt;&lt;/iframe&gt;

&lt;h2&gt;Rotations&lt;/h2&gt;

&lt;p&gt;To make this even more worth it, we would like to support rotating any object and having all it&amp;#8217;s children be rotated as well. Again we need to add a rotation attribute:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rotation: 0
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and tweak our &lt;code&gt;draw&lt;/code&gt; function:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;draw: (ctx) -&amp;gt;
  for child in @children
    if child.rotation isnt 0
      ctx.save()
      ctx.translate(child.x, child.y)
      ctx.rotate(child.rotation)
      ctx.drawImage(child.render(), 0, 0)
      ctx.restore()
    else
      ctx.drawImage(child.render(), child.x, child.y)
  false
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Canvas provides us with all the magic we need. We &lt;code&gt;save&lt;/code&gt; the current context, then shift our origin point to the child&amp;#8217;s coordinates (NB: we are going to be rotating children around their origin point, perhaps you would like to implement rotation around center point). Then we do the rotation and drawing and then we simply restore our context to it&amp;#8217;s original point of origin.&lt;/p&gt;

&lt;h2&gt;Shaping up the API&lt;/h2&gt;

&lt;p&gt;First of all since most entity objects will want to override draw in one way or another we might simply use a &lt;a href="https://github.com/raganwald/homoiconic/blob/master/2008-10-29/kestrel.markdown"&gt;Kestrel&lt;/a&gt; in the constructor and allow the user to optionally provide it when initiating the class:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;constructor: (@width, @height, @draw = @draw) -&amp;gt;
    @canvas = document.createElement('canvas')
    @canvas.width = @width
    @canvas.height = @height
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;@draw = @draw&lt;/code&gt; might look a bit awkward at first glance, but it assigns as a default our own implementation of &lt;code&gt;draw&lt;/code&gt; if the user hasn&amp;#8217;t provided one. The js looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function(draw) {
  this.draw = (draw != null ? draw : this.draw);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next let&amp;#8217;s have a single function for instantiating new Entities and simultaneously adding them as children:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;add_child: (width, height, draw) -&amp;gt;
  child = new Entity width, height, draw
  @children.push child
  child.parent = @
  child # return `child` so that we can do stuff like `collection = scene.add_child 30, 30`
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You might want to create another class that wraps up some common functionality as creating the top level &lt;code&gt;Entity&lt;/code&gt; (typically called &lt;code&gt;Scene&lt;/code&gt;) and setting its canvas as the one actually displayed in the document and setting up animation loops and so on. I&amp;#8217;ll leave that as an exercise for the reader (hint: look at the fiddles, there you have the basics).&lt;/p&gt;

&lt;h2&gt;Caching&lt;/h2&gt;

&lt;p&gt;If you draw expensive things in your objects (and some things in canvas are pretty expensive like shapes with multiple gradients/shadows), you might not want to redraw them 60 times per second. Our architecture allows us to prevent that rather easily.&lt;/p&gt;

&lt;p&gt;Again we add two more attributes:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# This is what the user sets
perform_caching: no
# This tracks whether or not we should render
is_cached: no
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now let&amp;#8217;s modify our &lt;code&gt;render&lt;/code&gt; function:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;render: -&amp;gt;
  return @canvas if @perform_caching and @is_cached
  ctx = @canvas.getContext('2d')
  ctx.clearRect(0,0,@width, @height)
  @draw(ctx)
  @is_cached = true
  @canvas
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We skip all the work when caching is enabled, since the canvas still contains all that was drawn into it.&lt;/p&gt;

&lt;h2&gt;Wrapping up&lt;/h2&gt;

&lt;p&gt;And that&amp;#8217;s basically all there is to it. There are a myriad of features you can add like more transformations apart from rotations, primitive entity subclasses (think something like &lt;code&gt;Sprite&lt;/code&gt; entity), etc. The complete class is here:&lt;/p&gt;

&lt;script src="https://gist.github.com/2705182.js?file=entity.coffee"&gt;&lt;/script&gt;</description><link>http://gampleman.eu/post/23109338640</link><guid>http://gampleman.eu/post/23109338640</guid><pubDate>Tue, 15 May 2012 18:02:00 +0100</pubDate><category>canvas</category><category>coffee-script</category><category>html5</category></item><item><title>What bothers me about ACTA, SOPA, etc.</title><description>&lt;p&gt;There is a significant problem with these laws (acts, agreements, whatever) even if you don&amp;#8217;t care about &lt;abbr title="Intellectual Property"&gt;IP&lt;/abbr&gt; legislation at all.&lt;/p&gt;

&lt;p&gt;The current entertainment industry arose under a certain set of conditions. These condition have changed and the industry is failing to keep pace&lt;sup&gt;1&lt;/sup&gt;. So instead of transforming into something modern they attempt to change the conditions back to their outdated state via the law.&lt;/p&gt;

&lt;p&gt;Let me make an analogy: imagine that Catholic priests started lobbying for the state to ban atheism because they were losing their jobs. The current legislation is the same thing for the entertainment industry.&lt;/p&gt;

&lt;p&gt;Many people view the current protests as some sort of hippie free-lunch&lt;sup&gt;2&lt;/sup&gt; absurdity. What is in fact at stake is however a core value of capitalism: if you can&amp;#8217;t make a profit with your product, you don&amp;#8217;t make the government protect your market, you make your &lt;em&gt;product better&lt;/em&gt; or you shrivel up and &lt;em&gt;die&lt;/em&gt;.&lt;/p&gt;

&lt;hr&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;Actually it&amp;#8217;s &lt;a href="http://torrentfreak.com/what-piracy-the-entertainment-industry-is-booming-120130/"&gt;not even doing so bad&lt;/a&gt;, but that&amp;#8217;s a separate issue.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Pirate culture tends to elicit such views with slogans such as &amp;#8220;Sharing is caring&amp;#8221; .&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;</description><link>http://gampleman.eu/post/17209351755</link><guid>http://gampleman.eu/post/17209351755</guid><pubDate>Tue, 07 Feb 2012 14:19:52 +0000</pubDate><category>politics</category><category>intellectual property</category></item><item><title>I don’t believe that 2012 will be the end of the world,...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_lx4q3hbFXd1qa4ptoo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;I don’t believe that 2012 will be the end of the world, but it’s a fun topic.&lt;/p&gt;

&lt;p&gt;So: Good luck with surviving the apocalypse and any other similarly worthwhile endeavors in which you may partake! Happy 2012!&lt;/p&gt;</description><link>http://gampleman.eu/post/15130041778</link><guid>http://gampleman.eu/post/15130041778</guid><pubDate>Sun, 01 Jan 2012 17:04:28 +0000</pubDate><category>pf</category><category>end of world</category></item><item><title>

Zdeněk Miler1921-2011</title><description>&lt;p&gt;&lt;figure style="text-align: center"&gt;&lt;a href="http://en.wikipedia.org/wiki/Zden%C4%9Bk_Miler" style="text-align: center"&gt;&lt;img alt="Krtek" src="http://dl.dropbox.com/u/608150/Krtek.svg" width="300px" height="402px"/&gt;&lt;/a&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p style="text-align: center"&gt;Zdeněk Miler&lt;br/&gt;1921-2011&lt;/p&gt;</description><link>http://gampleman.eu/post/13559009184</link><guid>http://gampleman.eu/post/13559009184</guid><pubDate>Wed, 30 Nov 2011 21:34:00 +0000</pubDate><category>death</category><category>art</category><category>krtek</category></item><item><title>Last words</title><description>&lt;a href="http://penmachine-bu.appspot.com/2011/05/the-last-post"&gt;Last words&lt;/a&gt;: &lt;blockquote&gt;
  &lt;p&gt;Airdrie, you were my best friend and my closest connection. I don’t know what we’d have been like without each other, but I think the world would be a poorer place. I loved you deeply, I loved you, I loved you, I loved you.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Those are one of the most beautiful and haunting words of a dead man.&lt;/p&gt;</description><link>http://gampleman.eu/post/5201612302</link><guid>http://gampleman.eu/post/5201612302</guid><pubDate>Thu, 05 May 2011 00:14:00 +0100</pubDate><category>death</category></item><item><title>Jesus' Game</title><description>&lt;p&gt;A question I&amp;#8217;ve often thought about is why is it that people that don&amp;#8217;t believe in God are often not dramatically evil or immoral. I&amp;#8217;ll take a look at one of the famous parts of the New Testament, Jesus&amp;#8217; Sermon on the Mountain. Many smart people have written much about it. However, some aspects of it are still very hard to understand and even harder to implement in your own life.&lt;/p&gt;

&lt;p&gt;The passage I would like to discuss is &lt;a href="http://quod.lib.umich.edu/cgi/r/rsv/rsv-idx?type=DIV1&amp;amp;byte=4563978"&gt;Mathew 6, 38-48&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&amp;#8220;You have heard that it was said, &amp;#8216;An eye for an eye and a tooth for a tooth.&amp;#8217;&lt;/p&gt;
  
  &lt;p&gt;But I say to you, Do not resist one who is evil. But if any one strikes you on the right cheek, turn to him the other also; 
  and if any one would sue you and take your coat, let him have your cloak as well; 
  and if any one forces you to go one mile, go with him two miles. 
  Give to him who begs from you, and do not refuse him who would borrow from you.&lt;/p&gt;
  
  &lt;p&gt;&amp;#8220;You have heard that it was said, &amp;#8216;You shall love your neighbor and hate your enemy.&amp;#8217;&lt;/p&gt;
  
  &lt;p&gt;But I say to you, Love your enemies and pray for those who persecute you, 
  so that you may be sons of your Father who is in heaven; for he makes his sun rise on the evil and on the good, and sends rain on the just and on the unjust. 
  For if you love those who love you, what reward have you? Do not even the tax collectors do the same? 
  And if you salute only your brethren, what more are you doing than others? Do not even the Gentiles do the same?&lt;/p&gt;
  
  &lt;p&gt;You, therefore, must be perfect, as your heavenly Father is perfect.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Before I get to the text itself allow me to take a bit of an excursion to another famous and well discussed problem: the &lt;a href="http://en.wikipedia.org/wiki/Prisoner's_dilemma"&gt;Prisoner&amp;#8217;s Dilemma&lt;/a&gt;. This is one of the fundamental problems of Game Theory. Here is Wikipedia&amp;#8217;s take:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Two suspects are arrested by the police. The police have insufficient evidence for a conviction, and, having separated the prisoners, visit each of them to offer the same deal. If one testifies for the prosecution against the other (defects) and the other remains silent (cooperates), the defector goes free and the silent accomplice receives the full 10-year sentence. If both remain silent, both prisoners are sentenced to only six months in jail for a minor charge. If each betrays the other, each receives a five-year sentence. Each prisoner must choose to betray the other or to remain silent. Each one is assured that the other would not know about the betrayal before the end of the investigation. How should the prisoners act?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Imagine you were one of these suspects. I presume you would be facing a tough moral decision. Ten years spent in prison is a big chunk of your life, and you can&amp;#8217;t be sure how your accomplice will react?&lt;/p&gt;

&lt;p&gt;It is well established that the rational&lt;sup&gt;1&lt;/sup&gt; thing to do in a Prisoner&amp;#8217;s Dilemma situation is to defect. In fact it is a &lt;a href="http://en.wikipedia.org/wiki/Dominance_(game_theory)"&gt;strictly dominant strategy&lt;/a&gt;. For some time, this result turned out to be quite a wrench in the wheels of theories on why and how people cooperate with each other. It seems inconsistent with the notion that people are (mostly&lt;sup&gt;2&lt;/sup&gt;) rational beings.&lt;/p&gt;

&lt;p&gt;Take a moment to consider how you feel about the fact that human cooperation is irrational - that in fact, by helping others you are making your own life worse. Not exactly cool, is it?&lt;/p&gt;

&lt;p&gt;Thankfully, &lt;a href="http://en.wikipedia.org/wiki/Kenneth_Binmore"&gt;Keneth Binmore&lt;/a&gt; comes to our rescue:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;A whole generation of scholars swallowed the line that the Prisoner&amp;#8217;s Dilemma embodies the essence of human cooperation&amp;#8230; Rational players don&amp;#8217;t cooperate in the Prisoner&amp;#8217;s Dilemma because the conditions necessary for rational cooperation are absent&lt;sup&gt;3&lt;/sup&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Doesn&amp;#8217;t look that bad for the human race after all. But it answers the question I&amp;#8217;ve started this essay with: Why don&amp;#8217;t atheists sin a lot more? Why do we know pretty decent people who don&amp;#8217;t believe in God? Why aren&amp;#8217;t even satanists epically evil?  If you are absolutely convinced that there is nothing greater than us, there seems to be no reason to adhere to basic morality, is there?&lt;/p&gt;

&lt;p&gt;In a lot of situations behaving morally is rational. Or in other words, being good to others is in fact good for us (in a very materialistic sense). Jesus refers to this when he says: &amp;#8220;For if you love those who love you, what reward have you? Do not even the tax collectors&lt;sup&gt;4&lt;/sup&gt; do the same?&amp;#8221;&lt;/p&gt;

&lt;p&gt;What I&amp;#8217;m trying to get at with this digression into Game Theory is that Jesus tries to tell us that as Christians we need not be always rational - or specifically, not always rational in game-theoretic terms.&lt;/p&gt;

&lt;p&gt;If you look at how this would turn out in the Prisoner&amp;#8217;s dilemma then yes, at first you would get the sucker&amp;#8217;s payoff. But now imagine a world where most people would try their best to turn the other cheek and when in a prisoner&amp;#8217;s dilemma you would know that the other person will cooperate with say a 60% probability. Then defecting loses its strict dominance and you would be more likely to choose the option that maximizes &lt;a href="http://en.wikipedia.org/wiki/Social_welfare_function"&gt;social welfare&lt;/a&gt;, that is an option that&amp;#8217;s better for every player taken together. Hence I believe that not only does choosing this &amp;#8220;irrational&amp;#8221; lifestyle make sense morally but also it in fact may affect other people&amp;#8217;s lives and actually contribute to make the world a better place.&lt;/p&gt;

&lt;p&gt;Also:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://image.spreadshirt.com/image-server/image/composition/3723767/view/1/producttypecolor/2/type/png/width/378/height/378/rationality-is-overrated_design.png" alt="Rationality is overrated"/&gt;&lt;/p&gt;

&lt;p&gt;&lt;small&gt;My thanks to &lt;a href="http://twitter.com/phelement"&gt;Joachim Veselý&lt;/a&gt; for proofreading this essay.&lt;/small&gt;&lt;/p&gt;

&lt;hr&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;What exactly constitutes rational behavior is of course debatable; in Game Theory it generally means to maximize one&amp;#8217;s payoff.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Whether or not you consider humans as rational depends on which psychological theory you subscribe to and what notions of rationality you hold, but I would argue that humans are more or less rational in decisions that matter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Imagine that in the prisoner&amp;#8217;s situation if they both cooperate then they will be set free for lack of evidence and if only one defects he will get minor jail-time, then cooperation is the dominant strategy. Binmore argues that this type of situation is far more common in real life then Prisoner&amp;#8217;s Dilemmas and this fact is why we cooperate in most situations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tax collectors were considered the scumbags of Jesus&amp;#8217; time.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;</description><link>http://gampleman.eu/post/4169385238</link><guid>http://gampleman.eu/post/4169385238</guid><pubDate>Mon, 28 Mar 2011 23:51:00 +0100</pubDate><category>jesus</category><category>game-theory</category><category>morals</category></item><item><title>All the best in 2011!

A few technical details: I wrote a nice...</title><description>&lt;iframe src="http://player.vimeo.com/video/18303912" width="400" height="250" frameborder="0"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;All the best in 2011!&lt;/p&gt;

&lt;p&gt;A few technical details: I wrote a nice piece of js/canvas code to make the rendering (available &lt;a href="http://labs.gampleman.eu/emergence.html"&gt;here&lt;/a&gt;). I originally planed to do an ant colony intelligence inspired animation (so the source code still contains a function to draw an ant).&lt;/p&gt;</description><link>http://gampleman.eu/post/2532031504</link><guid>http://gampleman.eu/post/2532031504</guid><pubDate>Thu, 30 Dec 2010 21:38:18 +0000</pubDate><category>art</category><category>tech</category><category>canvas</category><category>javascript</category></item><item><title>Popular passwords in 2010</title><description>&lt;p&gt;A long story short: I got my hands on a data-dump of 184&amp;#160;550 hacked usernames and passwords from Gawker. With a bit of &lt;a href="http://code.google.com/p/google-refine"&gt;data-analysis magick&lt;/a&gt; I did a bit of research.&lt;/p&gt;

&lt;h2&gt;20 most popular passwords&lt;/h2&gt;

&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Password&lt;/th&gt;
                &lt;th&gt;Count&lt;/th&gt;
            &lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;password&lt;/th&gt;&lt;td&gt;1914&lt;/td&gt;
         &lt;/tr&gt;&lt;tr&gt;&lt;th&gt;lifehack&lt;/th&gt;&lt;td&gt;648&lt;/td&gt;
         &lt;/tr&gt;&lt;tr&gt;&lt;th class="short"&gt;qwerty&lt;/th&gt;&lt;td&gt;412&lt;/td&gt;
         &lt;/tr&gt;&lt;tr&gt;&lt;th class="short"&gt;abc123&lt;/th&gt;&lt;td&gt;328&lt;/td&gt;
         &lt;/tr&gt;&lt;tr&gt;&lt;th class="short"&gt;monkey&lt;/th&gt;&lt;td&gt;294&lt;/td&gt;
         &lt;/tr&gt;&lt;tr&gt;&lt;th&gt;consumer&lt;/th&gt;&lt;td&gt;267&lt;/td&gt;
         &lt;/tr&gt;&lt;tr&gt;&lt;th class="short"&gt;letmein&lt;/th&gt;&lt;td&gt;241&lt;/td&gt;
         &lt;/tr&gt;&lt;tr&gt;&lt;th class="short"&gt;trustno1&lt;/th&gt;&lt;td&gt;240&lt;/td&gt;
         &lt;/tr&gt;&lt;tr&gt;&lt;th class="short"&gt;dragon&lt;/th&gt;&lt;td&gt;229&lt;/td&gt;
         &lt;/tr&gt;&lt;tr&gt;&lt;th&gt;baseball&lt;/th&gt;&lt;td&gt;211&lt;/td&gt;
         &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;
        &lt;td&gt;
            &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Password&lt;/th&gt;
                    &lt;th&gt;Count&lt;/th&gt;
                &lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;superman&lt;/th&gt;&lt;td&gt;203&lt;/td&gt;
             &lt;/tr&gt;&lt;tr&gt;&lt;th&gt;iloveyou&lt;/th&gt;&lt;td&gt;201&lt;/td&gt;
             &lt;/tr&gt;&lt;tr&gt;&lt;th&gt;gizmodo&lt;/th&gt;&lt;td&gt;194&lt;/td&gt;
             &lt;/tr&gt;&lt;tr&gt;&lt;th&gt;sunshine&lt;/th&gt;&lt;td&gt;192&lt;/td&gt;
             &lt;/tr&gt;&lt;tr&gt;&lt;th&gt;princess&lt;/th&gt;&lt;td&gt;182&lt;/td&gt;
             &lt;/tr&gt;&lt;tr&gt;&lt;th&gt;starwars&lt;/th&gt;&lt;td&gt;180&lt;/td&gt;
             &lt;/tr&gt;&lt;tr&gt;&lt;th&gt;whatever&lt;/th&gt;&lt;td&gt;179&lt;/td&gt;
             &lt;/tr&gt;&lt;tr&gt;&lt;th class="short"&gt;shadow&lt;/th&gt;&lt;td&gt;172&lt;/td&gt;
             &lt;/tr&gt;&lt;tr&gt;&lt;th class="short"&gt;cheese&lt;/th&gt;&lt;td&gt;153&lt;/td&gt;
             &lt;/tr&gt;&lt;tr&gt;&lt;th&gt;nintendo&lt;/th&gt;&lt;td&gt;148&lt;/td&gt;
             &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;
    &lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;Now the first entry is rather shocking: the most used password is also the most obvious password possible. A full 1% (and 0.11% of the full DB; see bellow) used this password! What didn&amp;#8217;t exactly fit on the list was that another 111 people used &amp;#8216;Password&amp;#8217; and 129 people used the slightly better &amp;#8216;passw0rd&amp;#8217;.&lt;/p&gt;

&lt;p&gt;&amp;#8220;lifehack&amp;#8221; and &amp;#8220;gizmodo&amp;#8221; are both names of the sites these passwords were retrieved from. Not very secure. &amp;#8216;qwerty&amp;#8217; and &amp;#8216;abc123&amp;#8217; are also extremely obvious passwords. 15 of the remaining passwords are single words contained in any dictionary.&lt;/p&gt;

&lt;h2&gt;Password Strength&lt;/h2&gt;

&lt;p&gt;Next I marked the passwords with these simple rules:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;+1 point for each of: uppercase characters, lowercase characters, numerals, punctuation&lt;/li&gt;
&lt;li&gt;+1 point for passwords longer then 7 letters&lt;/li&gt;
&lt;li&gt;0 points if they were part of the username&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The following table shows the distribution of these strengths.&lt;/p&gt;

&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Score&lt;/th&gt;
        &lt;th&gt;Count&lt;/th&gt;
        &lt;th&gt;Percentage&lt;/th&gt;
    &lt;/tr&gt;&lt;/thead&gt;&lt;tr&gt;&lt;th&gt;0&lt;/th&gt;&lt;td&gt;8567&lt;/td&gt; &lt;td&gt;4.6%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;th&gt;1&lt;/th&gt;&lt;td&gt;96738&lt;/td&gt;&lt;td&gt;52.5%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;th&gt;2&lt;/th&gt;&lt;td&gt;65876&lt;/td&gt;&lt;td&gt;35.6%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;th&gt;3&lt;/th&gt;&lt;td&gt;12781&lt;/td&gt;&lt;td&gt;6.9%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;th&gt;4&lt;/th&gt;&lt;td&gt;586&lt;/td&gt;   &lt;td&gt;0.3%&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;Now a score of 1 is very bad - it is the default unless you use the same password as your name. However a staggering amount of people use these very unsafe passwords.&lt;/p&gt;

&lt;p&gt;A new year&amp;#8217;s (a bit early, but well) promise should be a bit more online safety for all of us.&lt;/p&gt;

&lt;h2&gt;A few notes&lt;/h2&gt;

&lt;ol&gt;&lt;li&gt;&lt;p&gt;The dataset is &lt;a href="http://thepiratebay.org/torrent/6036819/Gawker_Sites_Hacked_Databases__amp__More"&gt;available here&lt;/a&gt; and the details of how it was obtained are &lt;a href="http://blogs.forbes.com/firewall/2010/12/13/the-lessons-of-gawkers-security-mess/"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The full db contained ~1.5M records out of which the attackers obtained ~1.2M (presumably randomly). They proceeded to crack the week encryption algorithm of ~200K accounts. This I do not assume was completely random. Out of this I got a total number of 184&amp;#160;550 records.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The site apparently stored only the first 8 characters (&lt;i&gt;sic!&lt;/i&gt;) of the password. This suggests caution with passwords of length 8 because these were possibly truncated. I set those shorter then 8 characters in an italicized font. However apart from &amp;#8220;lifehack&amp;#8221; which would be probably &amp;#8220;lifehacker&amp;#8221; all other passwords in the top 20 seem as complete words or phrases. As an aside a strong password is &lt;a href="http://agilewebsolutions.com/onepassword" title="I don't have a reference on that but at least I and this software consider it so"&gt;generally considered&lt;/a&gt; to be at least 16 characters long.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I would like to perform more research into password sharing with this dataset but I don&amp;#8217;t have the time for that right now. I&amp;#8217;d be interested if someone will investigate.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;</description><link>http://gampleman.eu/post/2318782873</link><guid>http://gampleman.eu/post/2318782873</guid><pubDate>Wed, 15 Dec 2010 01:26:00 +0000</pubDate><category>tech</category><category>password</category><category>security</category></item><item><title>Designing a departures board with CSS3</title><description>&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Technical article ahead. Beware.&lt;/p&gt;

&lt;p&gt;As I’ve written before, CSS3 is very good for designing things. Today we’re going to use it to do some fun pixel pushing. &lt;a href="http://culturedcode.com/status"&gt;Behold our inspiration&lt;/a&gt;.&lt;/p&gt;

&lt;p class="non-dashboard"&gt;This article contains features and examples that do no work properly in the dashboard. Please follow to the version on my site.&lt;/p&gt;

&lt;style&gt;

.gist {
  text-shadow: none;
}

.preview {
    padding: 20px 15px; 
    text-align: center; position: relative;
    margin: 10px;
}
.board {
    padding:  5px 10px;
    font-size: 14px;
    display: inline-block;
    background: rgb(30, 30, 30);
    -webkit-border-radius: 3px;
    font-weight: normal;
    text-transform: uppercase;
    color: white;-webkit-box-shadow: inset 0 -2px 0 rgba(0,0,0,0.7), 
      inset 2px 0px 4px rgba(0,0,0,0.9), 
      inset -2px 0px 4px rgba(0,0,0,0.9);
}
.board:before {
    border-top: 1px solid rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    height: 0px;
    width: 130%;
    position: relative;
    left: -9px;
    top: 10px;
    content: attr(title);
    display: block;
}

&lt;/style&gt;&lt;h1 id="markup"&gt;Markup&lt;/h1&gt;

&lt;p&gt;Simple. Use any thing you like. We will be using a div called &lt;code&gt;.board&lt;/code&gt;.&lt;/p&gt;

&lt;h1 id="the_basics"&gt;The basics&lt;/h1&gt;

&lt;p&gt;We’ll start with designing for Webkit for now. First the basic shape and color.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;.board {
    padding:  5px 10px;
    display: inline-block;
    background: rgb(30, 30, 30);
    -webkit-border-radius: 3px;
    text-transform: uppercase;
    color: white;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;yields:&lt;/p&gt;

&lt;div class="preview description"&gt;
&lt;div style="padding:  5px 10px;
font-size: 14px;
display: inline-block;
background: rgb(30, 30, 30);
-webkit-border-radius: 3px;
font-weight: normal;
text-transform: uppercase;
color: white;"&gt;London&lt;/div&gt;
&lt;/div&gt;

&lt;h1 id="shadows"&gt;Shadows&lt;/h1&gt;

&lt;p&gt;Now let’s make the dark shadow effects from the top and sides of the box. For this we’ll use multiple inset box shadow declarations:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;-webkit-box-shadow:  
  inset 2px 0px 4px rgba(0,0,0,0.9), 
  inset -2px 0px 4px rgba(0,0,0,0.9);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Gives:&lt;/p&gt;

&lt;div class="preview"&gt;
&lt;div style="padding:  5px 10px;
font-size: 14px;
display: inline-block;
background: rgb(30, 30, 30);
-webkit-border-radius: 3px;
font-weight: normal;
text-transform: uppercase;
color: white;-webkit-box-shadow:
  inset 2px 0px 4px rgba(0,0,0,0.9), 
  inset -2px 0px 4px rgba(0,0,0,0.9);"&gt;London&lt;/div&gt;
&lt;/div&gt;

&lt;h1 id="spinner"&gt;Spinner&lt;/h1&gt;

&lt;p&gt;These sort’s of displays use a spinner and thin boards to display different strings. When you go to a train station or airport (that still use this magnificently old tech) you can see the dividing line between the two halves. We’ll recreate that here.&lt;/p&gt;

&lt;p&gt;How? Using a pseudo element with thin boarders.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;.board:before {
    border-top: 1px solid rgba(0,0,0,0.4);
    /* this line will be barely visible, but that's how we want it */
    border-bottom: 1px solid rgba(255,255,255,0.08);
    height: 0px;
    position: relative;
    /* you might need to ajust these positions to your layout */
    width: 110%;
    left: -9px;
    top: 11px;
    content: " "; /* we have to set this, otherwise it won't be visible */
    display: block;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is how it looks:&lt;/p&gt;

&lt;div class="preview"&gt;
    &lt;div class="board" title=" "&gt;London&lt;/div&gt;
&lt;/div&gt;

&lt;h1 id="border"&gt;Border&lt;/h1&gt;

&lt;p&gt;To make the spinner look realistic we have to also pay attention to the bottom border. It has to have a 3D effect an look plastic enough. We’d also like to see the board bellow it. So we modify our shadows definition and add a border.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;border-bottom: 1px solid rgba(0,0,0,0.7);
-webkit-box-shadow: 
  inset 0 -1px 0 rgba(50,50,50,0.7), 
  inset 0 -2px 0 rgba(0,0,0,0.7), 
  inset 2px 0px 4px rgba(0,0,0,0.9), 
  inset -2px 0px 4px rgba(0,0,0,0.9);
&lt;/code&gt;&lt;/pre&gt;

&lt;div class="preview"&gt;
    &lt;div class="board" title=" " style="border-bottom: 1px solid rgba(0,0,0,0.7); margin: 0px 5px 2px 0; -webkit-box-shadow: 
      inset 0 -1px 0 rgba(50,50,50,0.7), 
      inset 0 -2px 0 rgba(0,0,0,0.7), 
      inset 2px 0px 4px rgba(0,0,0,0.9), 
      inset -2px 0px 4px rgba(0,0,0,0.9);"&gt;London&lt;/div&gt;
&lt;/div&gt;

&lt;h1 id="lighting"&gt;Lighting&lt;/h1&gt;

&lt;p&gt;Light’s and shadows are a crucial part of any visualization. So as a finishing touch we add a few light effects (with a subtle gradient and a few more shadows):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;-webkit-box-shadow: 
  inset 0 -1px 0 rgba(50,50,50,0.7), 
  inset 0 -2px 0 rgba(0,0,0,0.7), 
  inset 2px 0px 4px rgba(0,0,0,0.9), 
  inset -2px 0px 4px rgba(0,0,0,0.9), 
  /* This one is new and adds a light edge on the bottom*/
  0 1px 0px rgba(255,255,255,0.2); 
background: -webkit-gradient(linear, center top, center bottom, 
  color-stop(0.0, rgba(0,0,0, 1)), 
  color-stop(0.05, rgba(30,30,30, 1)),  
  color-stop(1.0, rgba(50, 50, 60, 1)));
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Which yields:&lt;/p&gt;

&lt;div class="preview"&gt;
    &lt;div class="board" title=" " style="border-bottom: 1px solid rgba(0,0,0,0.7); margin: 0px 5px 2px 0; -webkit-box-shadow: 
         inset 0 -1px 0 rgba(50,50,50,0.7), 
         inset 0 -2px 0 rgba(0,0,0,0.7), 
         inset 2px 0px 4px rgba(0,0,0,0.9), 
         inset -2px 0px 4px rgba(0,0,0,0.9), 
         0 1px 0px rgba(255,255,255,0.2); 
       background: -webkit-gradient(linear, center top, center bottom, 
         color-stop(0.0, rgba(0,0,0, 1)), 
         color-stop(0.05, rgba(30,30,30, 1)),  
         color-stop(1.0, rgba(50, 50, 60, 1)));"&gt;London&lt;/div&gt;
&lt;/div&gt;

&lt;h1 id="conclusion"&gt;Conclusion&lt;/h1&gt;

&lt;p&gt;As you can see, CSS3 enables us to do with a few lines of code some incredible pixel-pushing. So here’s the complete code with syntax for other browsers and fallbacks for graceful degradation:&lt;/p&gt;


&lt;script src="https://gist.github.com/664296.js?file=board.css"&gt;&lt;/script&gt;&lt;p&gt;Let me know if you’d like more articles like this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; For an animated version see &lt;a href="https://github.com/paulcuth/departure-board"&gt;this project by Paul Cuthbertson&lt;/a&gt;.&lt;/p&gt;</description><link>http://gampleman.eu/post/1488470623</link><guid>http://gampleman.eu/post/1488470623</guid><pubDate>Fri, 05 Nov 2010 15:54:00 +0000</pubDate><category>tech</category><category>css3</category><category>design</category></item><item><title>If you liked Inception and aren’t a huge fan of Escher...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_lawfe2rTl81qa4ptoo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;If you liked Inception and aren’t a huge fan of &lt;a href="http://en.wikipedia.org/wiki/M._C._Escher"&gt;Escher&lt;/a&gt; yet, now’s the time to start.&lt;/p&gt;

&lt;p&gt;More pics:&lt;/p&gt;


&lt;p&gt; 
&lt;a href="http://upload.wikimedia.org/wikipedia/en/a/a3/Escher%27s_Relativity.jpg"&gt;&lt;img src="http://upload.wikimedia.org/wikipedia/en/a/a3/Escher%27s_Relativity.jpg" width="100%"/&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.artchive.com/artchive/e/escher/escher_day_night.jpg"&gt;&lt;img src="http://www.artchive.com/artchive/e/escher/escher_day_night.jpg" width="100%"/&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.jokesnjokes.net/optical.illusions/allposters/escher.ascending.and.descending.jpg"&gt;&lt;img src="http://www.jokesnjokes.net/optical.illusions/allposters/escher.ascending.and.descending.jpg" width="100%"/&gt;&lt;/a&gt;
&lt;/p&gt;</description><link>http://gampleman.eu/post/1406569782</link><guid>http://gampleman.eu/post/1406569782</guid><pubDate>Tue, 26 Oct 2010 14:13:13 +0100</pubDate><category>art</category><category>escher</category><category>recursion</category><category>strange-loop</category></item><item><title>Ethics on the net</title><description>&lt;p&gt;The internet is an interesting place. It&amp;#8217;s also a very new place and as such forces us to pass moral judgments on our actions and on actions of others in situations that don&amp;#8217;t necessarily have equivalents in the real world.&lt;/p&gt;

&lt;p&gt;Let me give you a few examples:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;em&gt;torrents, p2p, file-sharing, intelectual property and piracy&lt;/em&gt;: an incredibly complex issue with many shades of grey. There are types of piracy that are undeniably wrong and types that are undeniably right. The whole issue is complicated by the huge complexity of the whole media economy, no credible numbers or statistics and a dependency on obsolete law with very little correlation with any natural ethics.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;(grey-hat) hacking&lt;/em&gt;: the act of showing the easiness of compromising someone&amp;#8217;s system (especially army or energetics&amp;#8217; systems) goes a long way of making these systems more secure. Another fact is that most people have no idea how much they rely on systems that are spoofed extremely easily (like email - you knew that it takes like a minute to send a fake email from your address, right?). On the other hand the law is clear on this - a breach of another&amp;#8217;s system is clearly illegal in most legislations. Obviously walking the line of morality can be difficult in this area.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;privacy&lt;/em&gt;: The internet is turning out to be a valuable tool in sharing information. Yet there are many individuals that seek to control the internet and use this information for commercial purposes, or worse, for purposes of oppression of your freedom. What are the ethical borders for sites on privacy for their users? How should we treat the net - everything we post should be considered public?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;responsibility for your word, netiquette&lt;/em&gt;: the net grants a certain type of anonymity that doesn&amp;#8217;t enforce people to be responsible for what they say in the same way as in the real world (that is through shame and law). My view is that the general and most noticeable abuse of this reality (eg. youtube comments) does not enrich us in any way - but is probably the price we pay for having a medium where free speech can be more free than ever before.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;It is very important to think critically about our actions online and how it impacts the world around us. Thanks to amazing technologies the world is becoming an ever more holistic system were every action we take can influence the whole - that in turn makes ethics incredibly important in this environment. It is also crucial to try to see more angles about issues before deciding whether they are right or wrong.&lt;/p&gt;</description><link>http://gampleman.eu/post/698366071</link><guid>http://gampleman.eu/post/698366071</guid><pubDate>Mon, 14 Jun 2010 20:43:00 +0100</pubDate><category>ethics</category><category>internet-culture</category></item><item><title>UX considerations of using Flash</title><description>&lt;p&gt;There has been a lot of discusion around the web surrounding the use of Flash on websites. The discusion was geared mainly about the availability of Flash on some platforms and it&amp;#8217;s general slowness on others.&lt;/p&gt;

&lt;p&gt;That is not my point today.&lt;/p&gt;

&lt;p&gt;What I do want to talk about is the value of Flash to the most regular user - the one who can run it reasonably fast and has it installed on his computer.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ll start with the benefits. Less work for the developer in bringing rich capabilities to inferior browsers. If you still use Internet Explorer I think you probably wish Flash was used a lot more. Especially today when developers are getting these dangerous ideas about things like graceful degradation and &amp;#8220;your experience is only as good as is your browser&amp;#8221;. Also if the developer can spend less time optimizing and testing on every browser he will have more time to polish other aspects of the app. Next I&amp;#8217;ll mention the obvious: there are things that cannot be done without a plugin - you might as well use flash for them (full screen video and progress with uploading being the most prominent examples at time of writing).&lt;/p&gt;

&lt;p&gt;Now the negatives: although Flash is improving in this area, I argue that it has small and hard to spot usability issues. These can be often circumvented with using a combination of html and Flash (but thus loosing some of the benefits). First imagine a &lt;a href="https://browserlab.adobe.com/"&gt;login form in Flash&lt;/a&gt;. Now  if you try to use 1Password or any other password manager to store and remember that password for you you will be disappointed. They can&amp;#8217;t detect the form to be a login form. Neither does the browser&amp;#8217;s native password manager kick in. This forces you to set a password that is easy to remember and thus making it much less safe.&lt;/p&gt;

&lt;p&gt;Also, almost shamefully so, somehow Flash does not support undo when editing text. Again this is not a huge problem in most cases (since Flash is usually not used as a text-editing environment) but it is another dent in the UX facade that can irk your user.&lt;/p&gt;

&lt;p&gt;However for me the most irking thing about a lot of Flash apps is scrolling. I&amp;#8217;m using a MacBook and I&amp;#8217;ve grown so used to the comforting double finger scroll that I almost forget how to use a scrollbar. That is until I use a Flash app. Somehow Flash scroll views don&amp;#8217;t seem to support mouse wheels out of the box. This issue is somehow overridable  but rarely does this happen.&lt;/p&gt;

&lt;p&gt;There are other issues that I might have missed; the point is however when deciding what technology to use don&amp;#8217;t forget to consider these smaller however important points, especially when designing software that people will need to use on a frequent basis (if you&amp;#8217;re doing a casual game then Flash is quite probably perfect for you).&lt;/p&gt;</description><link>http://gampleman.eu/post/452042961</link><guid>http://gampleman.eu/post/452042961</guid><pubDate>Tue, 16 Mar 2010 11:07:20 +0000</pubDate><category>ux</category><category>flash</category></item><item><title>Designing with CSS3</title><description>&lt;h2&gt;Designing in an image editor&lt;/h2&gt;

&lt;p&gt;Designing compelling web pages can be a daunting task. Traditionally the method would start in an image editing application (although quite a lot of people have a pen &amp;amp; paper phase before that). The problem with this approach is the general lack of a proper tool for designing websites. Most designers today use Photoshop; either because they are used to it before they started with web design or because of it&amp;#8217;s status as a industry standard. However the problem with Photoshop is that it was never designed as a tool for this kind of job. The tool that was designed for this type of job - Fireworks - seems somehow out of Adobe&amp;#8217;s focus while feature creep slowly comes in to choke the program to a slow death (meaning that it&amp;#8217;s been unusable since CS3 and frankly what we expect UI-wise has evolved since). There are many other tools out there, but few seem specifically designed for this type of job (with the notable exception of &lt;a href="http://likethought.com/opacity/"&gt;Opacity&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The reason this is important is that the web defines it&amp;#8217;s own visual language by which designers either must or at least very often should abide to - things like links being different from other text or headers being of a larger type. However we also have to deal with flexibility - we typically need our design to be usable in various conditions like varying screen sizes, resolutions, quirks of CMSs etc. Another important aspect is the interactive part of web pages - unlike an image the web page changes when the user interacts with it (if only setting hover states for links). Some designers (typically beginners in web design) believe that the job is done at the moment they send the coder the finished PSD file. However that&amp;#8217;s when the real design challenge begins.&lt;/p&gt;

&lt;h2&gt;Designing in the browser&lt;/h2&gt;

&lt;p&gt;So if not design in an image editor then where? How about the web browser? It supports a simple visual language out of the box, it can simulate perfectly effects such as flexible window sizes and it can be extremely interactive. Now a few years ago this proposition would seem quite insane. The browser didn&amp;#8217;t support many of the visual elements and effects that form essential parts of almost any UI design out there - elements such as subtle shadows and lightning effects to give UI elements the appearance of real objects, gradients to blend colors smoothly and naturally and powerful transparency settings for objects to make the site appear appealing.&lt;/p&gt;

&lt;p&gt;Browsers however evolve incredibly fast and with good ones (to make this clear: I&amp;#8217;m speaking of Webkit browsers here) you can do this stuff a lot simpler then you can in Photoshop. Of course there is still a myriad of things you still can&amp;#8217;t do with a web browser (my favorite being applying a simple Noise filter for a textured background), but it does cover the most needed visual elements uses in todays designs.&lt;/p&gt;

&lt;p&gt;Plus of course the added benefit of having a reasonable stylesheet prepared that should require much less time to repare for production (the main job being preparing to work in not so good browsers).&lt;/p&gt;

&lt;p&gt;I hope you consider this argument and maybe try this approach out at your next project (also check out &lt;a href="http://24ways.org/2009/make-your-mockup-in-markup"&gt;this article for more info and an example&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;A few tips&lt;/h2&gt;

&lt;p&gt;What I want to touch on however is that it might not be the best idea just to jump into TextEdit and hack away at your CSS. Since you are now going to spend much more time working with the language you might as well make it a bit easier. One of the things that has been around for some time are CSS abstraction languages which aim to provide a higher level language that then compiles into CSS (the best known is probably SASS). You may have heard about them or even tried one. However for me none of them really sticked when I was working the traditional way. However their better structuring and more extensive commenting facilities come in very handy when the CSS is not only an implementation of a design, but the design itself. The one I would generally recommend is named &lt;a href="http://lesscss.org/"&gt;LESS&lt;/a&gt; and it&amp;#8217;s main benefits include pretty much the same syntax as normal CSS. That means you don&amp;#8217;t need to learn almost anything new. With that comes the very handy TextMate bundle that compiles LESS files on save. This works very nicely. I also would recommend using the &lt;a href="http://github.com/gampleman/LESS3"&gt;LESS3 toolset&lt;/a&gt; (by yours truly) which abstracts a lot of the cutting edge quirks and makes your stylesheet automagically a lot more old browser friendly.&lt;/p&gt;

&lt;p&gt;Next you should definitely make friends with the Webkit&amp;#8217;s Web inspector. &lt;del&gt;Just right-click anywhere on your page and select &amp;#8220;Inspect element&amp;#8221;.&lt;/del&gt; &lt;a href="http://trac.webkit.org/wiki/WebInspector"&gt;This is how to enable it in your browser.&lt;/a&gt; Explore and hack away.&lt;/p&gt;

&lt;p&gt;I hope that this was inspiring to you and please if you indeed use some of these techniques, let me know about your experience.&lt;/p&gt;</description><link>http://gampleman.eu/post/441001548</link><guid>http://gampleman.eu/post/441001548</guid><pubDate>Thu, 11 Mar 2010 10:57:00 +0000</pubDate><category>css3</category><category>design</category></item><item><title>"The iPad attempts to simplify computing not by some stroke of magic, but by doing less. You can’t..."</title><description>“The iPad attempts to simplify computing not by some stroke of magic, but by doing less. You can’t have full multitasking and multiple apps oncscreen at the same time and apps installable from everywhere and compatibility with Mac OS X and a physical keyboard AND simplicity.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;p&gt;&lt;a href="http://mrgan.tumblr.com"&gt;Neven Mrgan&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is one of the nicer summaries of the Tablet.&lt;/p&gt;&lt;/em&gt;</description><link>http://gampleman.eu/post/422069178</link><guid>http://gampleman.eu/post/422069178</guid><pubDate>Tue, 02 Mar 2010 14:21:34 +0000</pubDate></item><item><title>Facebook login</title><description>&lt;p&gt;The internet was &lt;a href="http://mrgan.tumblr.com/post/384061532/i-liked-the-old-facebook-login-better"&gt;stormed yesterday&lt;/a&gt; by the occurrence of a &lt;a href="http://www.readwriteweb.com/archives/facebook_wants_to_be_your_one_true_login.php"&gt;ReadWriteWeb article&lt;/a&gt; that is &lt;em&gt;about&lt;/em&gt; the Facebook login process and quickly hundreds of completely confused users posted comments about their hate of this redesign of the Facebook login page.&lt;/p&gt;

&lt;p&gt;As &lt;a href="http://mrgan.tumblr.com/post/384860519/things-people-try-to-log-into"&gt;Neven Mrgan correctly says&lt;/a&gt;, the amount of information people were required to ignore is staggering:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;ol&gt;&lt;li&gt;People google for “facebook login” to log in to Facebook. I understand that they don’t use bookmarks and don’t type in facebook.com, but note that they don’t google “facebook”; they google “facebook login”. Clearly users don’t even see logging in as a function of the site itself; those are separate in the users’ mental maps. This is perhaps partly explained by the excess of websites which use Facebook as their authentication system, but it’s not the whole story.&lt;/li&gt;
  &lt;li&gt;They then click the small google result which says “News results: ReadWriteWeb” expecting they’ll be taken to Facebook.&lt;/li&gt;
  &lt;li&gt;They land on a page with an absolutely enormous heading saying ReadWriteWeb, below which is a headline, a byline, and endless paragraphs of what is even at the quickest glance obviously a news story.&lt;/li&gt;
  &lt;li&gt;They scroll all the way to the bottom of this completely un-Facebook-like page, with not a single thing in the way that would indicate this is a Facebook redesign.&lt;/li&gt;
  &lt;li&gt;They then go past the big heading saying Leave a comment and instead focus on the small link which says Optional: Sign in with Facebook. And don’t tell me these folks searched for “facebook” or “login” on the page itself.&lt;/li&gt;
  &lt;/ol&gt;&lt;/blockquote&gt;

&lt;p&gt;The implications for the design and UX community are staggering. How are you supposed to design for this? It seems that the whole webapp metaphor is fundamentally flawed for a lot of users.&lt;/p&gt;

&lt;p&gt;However there is a &lt;a href="http://www.flickr.com/photos/jimwhimpey/294080383/"&gt;flickr screenshot&lt;/a&gt; of the facebook login page with similar comments. When I was quickly reading through these I recognized one of the commenters. I don&amp;#8217;t know him personally but he clearly is an advanced computer user (probably dependent on it for his living). Yet he is confused with not being able to login into the tiny screenshot. This made me think of two possible explanations:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Statistics&lt;/strong&gt; - Facebook has about 80 million users (I believe). So a few hundred comments on a few websites make for about 0.0001% users confused. There are probably more who didn&amp;#8217;t post anything, but still a very small number. These people could be high for all we know or just this is a quantum level error of the transmission :)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Joke&lt;/strong&gt; - somebody&amp;#8217;s malware idea of a joke. It wouldn&amp;#8217;t surprise me if somebody created a virus that would take peoples Facebook accounts and post helpless comments on top Google results for &amp;#8220;facebook login&amp;#8221;. The internet saw weirder things happen.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Anyway if it turns out to be a case of real honest user confusion, UX may as well change quite radically.&lt;/p&gt;</description><link>http://gampleman.eu/post/385515185</link><guid>http://gampleman.eu/post/385515185</guid><pubDate>Fri, 12 Feb 2010 14:15:00 +0000</pubDate><category>security</category></item><item><title>I wonder how many people notice the difference between these two...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_kxpbnlrKBS1qa4ptoo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;I wonder how many people notice the difference between these two in normal life (&lt;a href="http://mrgan.tumblr.com/post/384061532/i-liked-the-old-facebook-login-better"&gt;especially considering what people are able to miss&lt;/a&gt;). Would you normally notice the difference between two different types?&lt;/p&gt;</description><link>http://gampleman.eu/post/384515752</link><guid>http://gampleman.eu/post/384515752</guid><pubDate>Thu, 11 Feb 2010 23:52:33 +0000</pubDate></item><item><title>Sticking a “that just works” on an error page can...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_kwcppnMX6X1qa4ptoo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Sticking a “that just works” on an error page can make people that would normally love your product extremely angry at it.&lt;/p&gt;

&lt;p&gt;Try avoiding that.&lt;/p&gt;</description><link>http://gampleman.eu/post/337692065</link><guid>http://gampleman.eu/post/337692065</guid><pubDate>Sat, 16 Jan 2010 17:53:47 +0000</pubDate><category>lol</category></item><item><title>The age problem</title><description>&lt;a href="http://www.scripting.com/stories/2010/01/11/ageismIsBecomingAnIssueFor.html"&gt;The age problem&lt;/a&gt;: &lt;p&gt;A quick post about age discrimination by Dave Winer. I recommend reading the discussion below the blog post - it reveals a lot about a problem I believe will become much more serious in the years to come.&lt;/p&gt;

&lt;p&gt;This comment by jawbaw is interesting:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;In general I have noticed there is also a trend for people of the same age to stick together and reject other age brackets. Kids only hang out with kids of the same age, not older or younger.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;He notes this as a particular disturbing trait of western culture. The general disrespect for people of other ages is astounding and also a lot more irrational then for example hatred of people of other cultures. The comparison is also interesting because most society (often hypocritically) scoffs at cultural racism but age based insults are taken as norm.&lt;/p&gt;</description><link>http://gampleman.eu/post/335926164</link><guid>http://gampleman.eu/post/335926164</guid><pubDate>Fri, 15 Jan 2010 15:43:00 +0000</pubDate><category>society</category></item><item><title>Google's dispute with China</title><description>&lt;a href="http://googleblog.blogspot.com/2010/01/new-approach-to-china.html"&gt;Google's dispute with China&lt;/a&gt;: &lt;p&gt;Google just reported several extremely interesting things:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;China launched a &lt;strong&gt;targeted and sophisticated&lt;/strong&gt; attack against Google’s infrastructure (emphasis mine). I dare to speculate that China is following &lt;a href="http://www.wired.com/politics/security/magazine/15-09/ff_estonia"&gt;Russia’s lead&lt;/a&gt; in creating a highly qualified cyber-warfare unit and is not shy in using it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Google (apart from posting it to the public) claims to have reported this to US authorities. These have traditionally ignored cyberterrorism. However this seems to be the clearest case of government endorsed attack to date. Lets hope that the US chooses to do something.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Google decided to revert it’s &lt;a href="http://googleblog.blogspot.com/2006/02/testimony-internet-in-china.html"&gt;controversial decision to censor it’s Chinese results&lt;/a&gt;. This is clearly a retribution of some sort. Google also writes that it is prepared to leave China  for good - clearly a statement of not being threatened. It is also quite a powerful threat.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Imagine if Google suddenly stopped working. I presume since you are reading this blog you would be fine. But there are millions of users for whom Google is the internet. Plus a lot of Chinese users (probably including government officials) would loose their Gmail data and their calendars.&lt;/p&gt;

&lt;p&gt;I imagine China is facing a tough decision with this.&lt;/p&gt;</description><link>http://gampleman.eu/post/331630477</link><guid>http://gampleman.eu/post/331630477</guid><pubDate>Wed, 13 Jan 2010 03:07:02 +0000</pubDate><category>tech</category><category>politics</category><category>business</category></item><item><title>Merry Christmas and a happy new year!</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_kv3x9sHDQc1qa4ptoo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Merry Christmas and a happy new year!&lt;/p&gt;</description><link>http://gampleman.eu/post/296774554</link><guid>http://gampleman.eu/post/296774554</guid><pubDate>Wed, 23 Dec 2009 13:25:04 +0000</pubDate><category>art</category></item></channel></rss>

