Two Million Meters

About 95k biked this week, which brings the grand total for 2011 up to 2000 km, or two million meters. Yay!

Here's a graph:

This shows that I have been riding about 85k per week from week 13 until now (week 37). The three >100k rides to/from Tammisaari show up as peaks, as well as the 2-day Luumäki trip. Week 29 is the only one with zero km's, because of the 24h rogaining trip/event. Extrapolating until the end of the year a 85k/week rate will bring the total over 3000 km, but we'll see how tough it gets with ice, snow, and winter-tires...

On the running side of things it would be nice to get up to 1000 km again, but I'm now about 50-70k behind last years schedule.

Critical Mass, 2011 September

Some 260 riders and a route along länsiväylä, the main motorway in to Helsinki from the west. Bikes on the motorway has prompted a number of news-stories:

Yle: http://www.yle.fi/alueet/helsinki/2011/09/lansivayla_halutaan_muuttaa_kaupunkibulevardiksi_2866429.html and http://yle.fi/uutiset/kotimaa/2011/09/pyorailijat_valtasivat_moottoritien_helsingissa_2869090.html

HS: http://sange.fi/~otso/stuff/hs110913-kriittinen-l%C3%A4n%C3%A4ri.jpg or http://omakaupunki.hs.fi/paakaupunkiseutu/uutiset/pyorailykulkue_tukkii_moottoritien_kaistoja_illalla/

Some history and views: http://vesirajassa.blogspot.com/2011/09/lansimuuri.html

See also June11 and Aug11.

Fireworks

More on picasa: https://picasaweb.google.com/106188605401091280402/Fireworks201109  (shot using old 20D, which has written EXIF-data dating the pics to 2005...)

See also 2010 and 2009.

Unfortunately moving my blog by exporting an XML-file from the old site and importing it to the new site has not worked too well 🙁 I have all 800 posts, and about 2000 pictures/attachments, but the pictures aren't bound correctly to the posts, so posts with image-galleries don't work too well. Hope to fix this at some point. The wordpress-importer is also somewhat naive in that when importing attachments it simply re-names files (by appending "1") that are already on disk. I have now tried importing three times, which means I have three copies of all files, like so: "file.jpg", "file1.jpg", and "file11.jpg".

vd benchmark

Tuesday update: A few optimizations has shaved about half off the constant, to . This was mainly (a) choosing boost::vecS as the out-edge container for the BGL-graph, and (b) choosing std::vector instead of std::set for a temporary variable in the grid-search for the closest facet. I suspect the runtime is dominated by that grid-search. Profiling would tell.

I did some benchmarking of my vd-code. It is supposed to run in time. Benchmarking turns out to be not so simple. I normally compile without any optimizations, and with a lot of sanity-checks and assert():s all over the code. These checks have worse time-complexity and result in long runtimes with big inputs. Then there are compiler optimization flags like -O or -O3.

I was first running the algorithm by inserting each point from python-code:

    t_before = time.time()
    for p in plist:
        vd.addVertexSite( p )
    t_after = time.time()
    return (t_after - t_before)

which I thought could add some overhead. I also made a version ("batch mode") where we first push all points to c++, and then call a run() method:

    for p in plist:
        vd.pushVertexSite( p )
    t_before = time.time()
    vd.run()
    t_after = time.time()
    return (t_after - t_before)

but this seems to improve runtime only marginally. Here are the results. Runtimes are divided by , so ideally all points should fall on a horizontal line. At best the code now runs in about 10-16 microseconds times .

With 4096 input points the runtime improves from 12s down to 1.3s by turning off sanity-checks and assert():s. It further improves to 0.18s with -O3 and to 0.165s in batch-mode.

As an example, the voronoi diagram for 1000 random points looks like this:

New webhost - installing wordpress

After leaving my bill unpaid at my old webhost, changing DNS-servers for my domain, and setting up a new webhosting account, the site is back up again on the new webhost, kapsi.fi. It went down sometime in the afternoon on Friday, and it started working again at noon on Sunday.

I will install the plugins, upload pictures/attachments, and restore the database from the old site over the next few days...

WordPress install:

  • Downloaded latest wordpress as a zip-file, unzipped on laptop and uploaded with FileZilla/FTP to webhost.
  • Edited wp-config.php by adding MySQL server name, database name, username, and password.
  • completed wordpress install by going  /wp-admin/install.php  and entering some info
  • Trying the Black-LetterHead 1.5 theme.

Plugins:

  • Akismet ships with wordpress, just have to activate it, and dig up my old API-key. akismet.com now seems a bit more aggressive in wanting money than it did a few years back..
  • Latex for wordpress allows writing mathematical stuff like this:

  • WP-Syntax should make any C/C++ or python code I blog about more readable.
import this # try this in your python shell!
  • Google Analytics allows tracking roughly how many visitors the site has. I have used google-analytics since about 2007, and the graph of visitors looks like this. I should sometime analyse if those traffic-peaks coincide with interesting posts, or being linked to on some popular page.

File+Database restore:

  • I backed up the whole of /public_html from the old site. Have now restored most of the /wp-content directory which holds all pictures and attached files (PDF, movies, etc). This is about 1.5 Gb in total.
  • On the old wodpress-install I exported all posts, pages, and comments into an XML file which is about 7.5 Mb in size. This is now imported into the new site. This is 848 Posts, 8 Pages, 27 Categories, 384 Tags, and 750 Comments.
  • I'm not sure if everything went smoothly. In some cases it appears that images show up correctly in posts, in other cases the images/gallery is missing. This appears to be related to the wordpress Media Library being completely empty on the new site! Even though I uploaded all files to the same directories, and then did the XML-file import it seems that the Media Library is not imported correctly.
  • Update: it appears that the Import function chokes and I get "Internal server error" if the XML file is too large. I have now manually split the XML file into chunks of 1 Mb or less, and now the import function works better. I now have 2113 images and 2 videos in the Media Library. However they are all "Unattached", i.e. it appears wordpress doesn't know what images belong to what posts.