• Home
  • Personal
  • Tech
  • Politics
  • Photography
  • Advertising and ad blocking

    March 7th, 2010

    I’ve thought about advertising and ad-blockers a lot over the years, and the debate is getting some attention right now starting with a recent Ars Technica article, so I thought I’d put down some of my own thoughts on it.

    Funding your content through advertising is hugely inefficient. Of the people who visit your site, usually only a tiny proportion click on (or notice) an advert, and only a tiny proportion of those then spends any money.  So a tiny, tiny proportion of your visitors give any money to your advertisers. So money filters down this system in tiny margins.  Then, at the bottom of the system, a tiny amount of the profits from the income covers the cost of advertising.  Then this money moves back up the system to you, usually via your advertising agent who takes a nice cut (I’ve heard Google pass as little as one twelfth onto the publisher in some cases).

    And this doesn’t consider the costs of the advertiser choosing and designing the ad or the tonnes of bandwidth and gatrillions of CPU cycles used to serve the actual adverts.

    It also does not consider externalities, such as pollution. Advertising is mind pollution. Advertising is designed to affect the behaviour of people for the benefit of the advertiser.  Why would anyone willingly expose themselves to something designed to steal their attention?

    You might argue that advertising creates value – some viewers choose to buy when otherwise they wouldn’t have. But what of the huge proportion of people who just had their attention stolen? No value was created there.

    Because not everyone is suckered in by it, advertising squanders billions of hours of attention every day to produce nothing.
    Read the rest of this entry »

    Tags: ad-blocking, adblock, adblocking, advertising, externalities, money, pollution

    Posted in Tech | 17 Comments »

  • Xapian Fu: Full Text Indexing in Ruby

    January 31st, 2010

    Xapian is an Open Source Search Engine Library written in C++. It has Ruby bindings, but they’re generated with SWIG, so they basically just mirror the C++ bindings – not very Ruby-like (and pretty ugly).

    Being a self-confessed full text indexing nerd and a Ruby-lover, I wrote Xapian Fu: a library to provide access to Xapian that is more in line with “The Ruby Way”.

    I started writing Xapian Fu exactly a year ago today but left it for a couple of months, then restarted work on it on the train on the way back from the 2009 Scotland on Rails conference.  Development was test driven, so it’s got an extensive test suite (using rspec).  Documentation is in rdoc and is quite detailed.  As of the latest version, it supports Ruby 1.9 too.

    Xapian Fu basically gives you a Hash interface to Xapian – so you get a persistent Hash with full text indexing built in (and ACID transactions!).

    Example

    For example, create a database called example.db, put three documents into it and search them and print the results:

      require 'xapian-fu'
      include XapianFu
      db = XapianDb.new(:dir => 'example.db', :create => true,
                        :store => [:title, :year])
      db << { :title => 'Brokeback Mountain', :year => 2005 }
      db << { :title => 'Cold Mountain', :year => 2004 }
      db << { :title => 'Yes Man', :year => 2008 }
      db.flush
      db.search("mountain").each do |match|
        puts match.values[:title]
      end

    There are of course a whole bunch more examples in the documentation.
    Read the rest of this entry »

    Tags: active record, database, full text indexing, indexing, ruby, search, stemming, stopping, the ruby way, xapian, xapian-fu

    Posted in Ruby, Tech | 1 Comment »

  • Ruby’s case statement uses ===

    August 30th, 2009

    I’ve not found this stated clearly enough elsewhere so I’m doing so myself.

    Ruby’s case statement calls the === method on the argument to each of the when statements

    So, this example:

    case my_number
      when 6883
        :prime
    end
    

    Will execute 6883 === my_number

    This is all fine and dandy, because the === method on a Fixnum instance does what you’d expect in this scenario.

    However, the === method on the Fixnum class does something different. It’s an alias of is_a?

    That is cute, because it allows you to do this:

    case my_number
      when Fixnum
        "Easy to memorize"
      when Bignum
        "Hard to memorize"
      end
    

    But it won’t work as you might expect in this scenario:

    my_type = Fixnum
    case my_type
      when Fixnum
        "Fixed number"
    end
    

    This won’t work because Fixnum === Fixnum returns false because the Fixnum class is not an instance of Fixnum.

    My workaround for this is to convert it to a string first. Not sure if that’s the best solution, but it works for me(tm).

    my_type = Fixnum
    case my_type.to_s
      when "Fixnum"
        "Fixed number"
    end
    
    Tags: case, coding, condiitonal, programming, ruby, switch, when

    Posted in Ruby, Tech | 5 Comments »

  • Song In Code: Ramones, I wanna be sedated

    August 21st, 2009

    Just the first verse:

    go = Proc.new { sleep 24.hours }
    self.wants :sedatation
    begin ; nil ; end
    case go ; where "no" ; nil ; end
    self.wants :sedatation
    self.get '/airport'
    self.put '/airport/plane'
    before self.insane? do
    3.times { hurry! }
    end
    return if self.can_control? :fingers
    return if self.can_control? :brain
    5.times { "no" }

    I recorded me singing it, which is kinda stupid tbh.

    I used mencoder to convert this to something Youtube found tasty. Like this:

    mencoder -ss 15 -endpos 1:18 -vf pp=al:f,scale=480:360 -oac mp3lame -ovc lavc -lavcopts vcodec=libx264:mbd=1:vbitrate=2000 MOV01362.MPG -o MOV01362.x264

    Also, pimp for another Geek/Ukelele project: Ukepedia, all 3 million Wikipedia articles one song at a time

    Tags: code, Music, ramones, ruby, sing, song, songsincode, ukelele

    Posted in Music, Tech | 5 Comments »

  • Netfilter Conntrack Memory Usage

    June 17th, 2009

    On a busy Linux Netfilter-based firewall, you usually need to up the maximum number of allowed tracked connections (or new connections will be denied and you’ll see log messages from the kernel link this: nf_conntrack: table full, dropping packet.

    More connections will use more RAM, but how much?  We don’t want to overcommit, as the connection tracker uses unswappable memory and things will blow up. If we set aside 512MB for connection tracking, how many concurrent connections can we track?

    There is some Netfilter documentation on wallfire.org, but it’s quite old. How can we be sure it’s still correct without completely understanding the Netfilter code? Does it account for real life constraints such as page size, or is it just derived from looking at the code? A running Linux kernel gives us all the info we need through it’s slabinfo proc file.
    Read the rest of this entry »

    Tags: conntrack, firewall, iptables, kernel, limit, linux, max, netfilter, performance, ram, slab

    Posted in Tech | 1 Comment »

  • My NWRUG Ferret Talk

    March 24th, 2009

    I did a short talk on Ferret, the Ruby “Information Retreival Library”, at the North West Ruby Users Group last Thursday.  We had a bit of a theme too, with Will Jessop speaking about Sphinx and Asa Calow speaking about Solr.

    I got to have a bit of a nosey around the Manchester BBC building too – though I was worried I’d open the wrong door and end up on TV. Didn’t fancy having to apologise to Jeremy Paxman.

    Brightbox also sponsored some pizza, and gave away t-shirts and stickers like candy (there was no candy though).

    My slides are available here, and contain a little example file system indexer. I made my slides with webby and S6 if you’re interested.

    Tags: ferret, indexing, inverse index, rails, ruby, search, solr, sphinx, talk

    Posted in Ruby on Rails, Tech | 2 Comments »

  • Women in Technology

    March 16th, 2009

    Dom kicked up a women in technology debate again recently.  I’ve seen a few responses, from one chap who thinks women have achieved equality already to a woman who doesn’t think girl’s brains are generally good for “programming” – and someone else who thinks there isn’t a problem as long as you’re thick skinned enough to put up with a sexually hostile workplace.

    The main gripe appears to be with “women only” conferences, such as the Women on the Web conference, organised by a group called Forward Ladies, or the Geek Girl dinners.

    I think a fair summary of his, and some other commenters, opinion is that these “women-only” events don’t help the effort to get more women involved in technology. Comparing it to positive discrimination in many ways.

    Read the rest of this entry »

    Tags: conference, event, forward-ladies, geek-girl, geeks, geekup, leeds, social, Tech, women, women on the web

    Posted in Personal, Tech | 13 Comments »

  • Techietubbies live video podcast

    February 16th, 2009

    I’m joining Dom and Rahoul tonight on a live video broadcast of their Techietubbies podcast thing.

    From the site:

    “Techietubbies is a weekly podcast covering a multitude of subjects, from a round up of the week’s tech news, live callers, competitions, questions and answers… and beer :)”

    Though I’m driving, so no tech news for me. I think it’s recorded if you can’t see the live thing.  It’ll be broadcast live here via ustream.tv

    Tags:

    Posted in Personal, Tech | 2 Comments »

  • My native language

    February 16th, 2009

    Severed head I’m currently reading Nudge, by Richard H. Thaler and Cass R. Sunstein. It says many psychologists and neuroscientists agree that we humans have two general types of thinking, intuitive and rational. Also known as automatic and reflective.  When dodging a ball thrown at you, getting nervous when your aeroplane hits turbulence or smiling when you see a cute cat the automatic system is working.  When doing some mathematics, or writing a blog post, you (mostly) use reflective.  Speaking native, or “first” languages uses the automatic.  Speaking a second language usually uses reflective.

    I realised that having tinkered with computers heavily almost my entire life, a lot of my “computer skills” have shifted into the intuitive, automatic systems.  I obviously (hopefully) use the rational systems a great deal, but underlying it is definitly intuition – the gut feeling of where to go next to solve the problem.  I regularly come up seemingly random avenues of investigation that lead to gold and I couldn’t say with any certainty why I thought of it.  I’m assuming this is the same for most computer geeks (and chess geeks, cooking geeks, music geeks etc. :).  It’s become a native language for us.

    I don’t think the average rational system can easily deal with very complex problems.  It’s great for some more-linear concentrated work or planning, but for big stuff with lots of parts – hard work.  I think I usually research and “pre-process” a bunch of material around a problem using my rational system, then my automatic system gets to work mulling over the bigger picture.  Then when I’m making rational decisions about it, I’m heavily informed by the intuition. Or sometimes just when I’m showering.

    Anyway, not sure where I was going with this other than a “aren’t I great” blog post. The summary would be, don’t rely on your rational systems so much. Give the intuitive some good mulling time. And shower regularly.

    Tags: brains, concious, geek, intuition, neuroscience, programming, psychology, subconcious., thinking

    Posted in Personal, Tech | No Comments »

  • Virtualized Storage Talk at WYLUG

    November 10th, 2008

    I’m doing a talk tonight about virtualizing your storage with LVM on Linux at the West Yorkshire Linux User Group. Sorry about the short notice here (it was announced earlier in the week elsewhere though).

    My mate Paul Brook is talking about RAID on Linux too.

    Come along for the talk, or the beer, or the socialising – or all three.

    Tags: linux, lvm, raid, storage, talks, virtualization, wylug

    Posted in Tech | No Comments »

  • Git submodules in N easy steps

    October 12th, 2008

    Git has something called submodule support. This allows you to specify one or more other git repositories within another – a bit like svn:externals (except trickier, but more powerful of course :).

    The git user manual describes submodules but it took me a while to figure it out, so I’m hoping these examples will help others (and me again when I forget and find my own page when googling about it :)

    These examples deal with your_project and the project you’ll be adding as a submodule, other_project

    Read the rest of this entry »

    Tags: git, submodules, version control

    Posted in Tech | 1 Comment »

  • UK Spam laws largely useless

    September 25th, 2008

    I’m getting some spam from some UK companies to a personal email address. I called and spoke to one of them and they said it won’t happen again but it continues to do so. I looked into complaining officially, under the new regulations that make the EC’s Directive on Privacy and Electronic Communications law in the UK.

    Under the new law, spammers can be fined £5,000 in a magistrates court or an unlimited penalty from a jury.

    Yet it appears it is really up to me to pursue charges through the courts. The Information Commissioners Office, who enforce the new regulations, appear largely neutered (as predicted):

    If my complaint is upheld, will the organisation be punished?

    If we think the organisation has breached the regulations, we can ask them to put things right, but we cannot punish them for breaking the law.

    If my complaint is upheld, will I be entitled to compensation?

    We have no powers to award compensation . If you have suffered a loss because an organisation or individual has broken the law, you may be entitled to compensation, but you must claim this through the courts.

    The right to compensation applies even if you don’t report the problem to us. You can make a claim to the court whether or not we have agreed that the law has been broken.

    No doubt this will cost a lot of my time and money. We should build a simple kit, with some form letters and instructions on pursuing compensation.

    Or just take enforcement into our own hands and report them to something like Spamhaus.

    Tags: law, spam, spammers, uk

    Posted in Tech | 1 Comment »

« Previous Entries
  • John Leach

    • John Leach is a human being living in Leeds, UK.
  • Twitter

    • John doggie did not like being left alone for 15mins when I went to the shop (listened in over the phone - much barking) 14 hrs ago
    • More twitter updates →
  • Author Stuff

    • Brightbox Rails Hosting
    • Compost This
    • ELER Web Comic
    • New World Odour
    • News Sniffer
    • Photography
    • Profile and History
    • Recycle This
    • The Gillroyd Parade
    • Things to do today
    • Website
  • Friends

    • Caius Durling
    • Deb Bassett
    • Gianni Tedesco
    • Ian Higgins
    • Louisa Parry
    • Rahoul Baruah
    • Sleepy Kev
    • Tim Waters
    • Tom Hall
  • Stuff

    • ifup
    • Media Lens
    • Mia Bambina
    • News from nowhere
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
  • Search

Creative Commons License The text of this blog is licensed under the Creative Commons BY-ND license