2013-01-14 Javascript

I just rewrote my Tag Cloud to use the Google Treemap.

What it does is the following:

  1. The cloud action runs the old code (text representation).
  2. The tagcloud action runs the new code.
  3. The new code basically takes the example Google Treemap and replaces the data with my tags. These tags are not nested.
  4. On click, we call the tag action which shows the last blog pages with that tag.

Try it! → Tag Cloud. (I realize that the tag cloud isn’t very interesting in and of itself. I just enjoyed using the Google tools and learning a little bit of Javascript on the way.)

$Action{cloud} = $Action{tagcloud};
$Action{tagcloud} = \&MyTagCloud;

sub MyTagCloud {
  print GetHeader('', T('Tag Cloud'), '');
  # open the DB file
  require DB_File;
  tie %h, "DB_File", $TagFile;
  my $max = 0;
  my $min = 0;
  my %count = ();
  foreach my $tag (grep !/^_/, keys %h) {
    $count{$tag} = split(/$FS/, $h{$tag});
    $max = $count{$tag} if $count{$tag} > $max;
    $min = $count{$tag} if not $min or $count{$tag} < $min;
  untie %h;
  # ignore 90% of all tags
  my @values = sort values %count;
  $min = GetParam('min', $values[int($#values * 0.9)]);
  print <<EOT;
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["treemap"]});
      function drawChart() {
        // Create and populate the data table.
        var data = google.visualization.arrayToDataTable([
          ['Location', 'Parent', 'Mentions', ''],
          ['Tags', null, 0, 0],
  foreach my $tag (sort keys %count) {
    my $n = $count{$tag};
    next unless $n > $min;
    print "          ['$tag', 'Tags', $n, 0],\n";
  print <<EOT;
        // Create and draw the visualization.
        var tree = new google.visualization.TreeMap(document.getElementById('treemap'));
        tree.draw(data);, 'select', selectHandler);
        function selectHandler() {
          var selection = tree.getSelection();
          var item = selection[0];
          window.location = "/alex?action=tag;id=" + data.getValue(item.row,0);
  print $q->start_div({-class=>'content cloud'});
  print $q->p(ScriptLink('action=tagcloud;min=0', T('Include all tags')),
              Ts('(currently showing tags with more than %s occurences)', $min));
  print $q->p(Ts('Or switch to a %s.', ScriptLink('action=cloud', T('text format'))));
  print $q->start_div({-id=>'treemap', -style=>'height: 1000px;'});
  print $q->end_div();
  print $q->end_div();


Add Comment

2012-12-23 Social Media this Year

I’m looking back at my blog and trying to remember the things that happened.

Google+ replaced Twitter, for all my talk about role-playing needs. For a while, my tweets were all about gaming. These days I use Twitter as an alternative to RSS for the kind of news that I might want to look into every now and then without wanting to read everything.

  1. EFF
  2. BoingBoing
  3. Techdirt
  4. Anonymous

(Although I’m following Ars Technica on Google+, so perhaps everything will end up on Google+, eventually.)

I also have a few friends on Twitter that aren’t very active elsewhere.

I’m not sure how long I’ll be hanging out on Twitter and Facebook. I heard somebody say that Facebook is for the important people you know and Google+ is for the interesting people you don’t know. 2012 was also the year I stopped using (a free, federated Twitter alternative).

I think that in general this blog has had few readers to begin with and has lost some. There are less comments because I write less about Emacs and tech issues. I guess I get a few comments on Google+ every now and then. I have never been one to try and maximize comments, however. I’m getting what I’m aiming for, I guess. :)

In general, therefore, the blog has also lost a bit of urgency. I no longer post little one-paragraph posts talking about the movies I saw. (Before yesterday it was Cloud Atlas which was nice, but not mind-blowing; yesterday it was The Hobbit part one, which was very beautiful; I could spend hours in Peter Jackson’s Middle Earth. Today I saw Beasts of the Southern Wild which reminded me of one of the best movies in recent years, Winter’s Bone. But then it started to stretch and had some surreal elements I didn’t like, so in the end I wasn’t as happy with it as I was at the beginning.)
No longer true, apparently?

At the same time, with the ads and the privacy issues of Facebook and Instagram, operating my own blog has become more important. I still host my pictures on Flickr and I’m happy I never stopped doing that. I pay their hosting fees and hope this means I don’t need to suffer ads and privacy violations.

My blog still uses Oddmuse. It’s a Perl script that I’ve been maintaining for over a decade, now. It still works! I use the same software for Emacs Wiki. Since many people are used to the many editors of Wikipedia and the features of MediaWiki, they criticize my choice every now and then. 2012 was no different. This time, however, I wrote a longer reply: How Emacs Wiki Works. (In fact, a separate wiki called WikEmacs was created using Mediawiki. I’m not sure how well it does.)

One of the benefits of the services I no longer like that much was that they allowed me to keep in touch with my family. My sister, my cousin and my mother in law are on Facebook. My mother, my half-sister and my half-brother are on Twitter where we all have private accounts linked to each other such that it occasionally feels like a family chat. I’ve started using Instagram as a way to tell people that I’m alive and invite the occasional comment by automatically uploading the pictures to this family chat on Twitter and to Facebook. I think it worked really well and now I’m not quite sure what I should be using instead. Rely on IFTTT?

The use of Instagram and all the ironic hipster hate online has revealed that I had already been a hipster long before it was cool!

There was also a tiny flash of activity on Community Wiki. A Facebook group for the wiki got created. Fierce editing did not resume. Wikis as a discussion medium seem to have gone the way of the Dodo. When I look at MeatballWiki, I don’t understand what’s going on. The wikis I was interested in as a discussion of social media are no longer active. Perhaps social media must be discussed using itself. I wonder where Instagram gets discused. Using screenshots?


Comments on 2012-12-23 Social Media this Year

Ugh, Meatball Wiki is full of spam.

AlexSchroeder 2012-12-26 13:30 UTC

Well, you already know but I still think wiki has a future, as pointed to by Smallest Federated Wiki. There are some flaws / issues with SFW, mainly I think because not enough people are working on it, but it’s still the signpost for how wiki could evolve.

Would still love to see you and other UseMod / OddMuse people look at ways to engage, even if you don’t switch over.

2012 is the year when it just became more and more clear that we need our own space and shouldn’t be dependent on Fb / Tw / G+ etc.

Fb / Tw / G+ offer two compelling things : 1) an aggregate river of stuff from people we care about, 2) really easy transclusion from various rich media sites.

We could have a distributed river architecture if we took RSS and some kind of pubsub architecture (eg. RssCloud) seriously. SFW has made transclusion protocols central to its philosophy. If we pick up on both, figure out how to get the most important things we get from the mainstream working smoothly, we can create a compelling alternative on our terms. And one of the interesting, overlooked, facts about G+ is that it showed that significant numbers of people are still willing to experiment with alternatives. As long as you can get a critical mass of around 20 people you care about to use it, G+ is as valuable as anything else. You don’t need 1 billion users. You aren’t trying to take over the world at this point, just to have a syndication / discussion architecture which isn’t owned by THEM.

PhilJones 2012-12-26 14:03 UTC

take it serious :)

MattisManzel 2012-12-26 20:52 UTC

The state of MeatBall is indeed sad. Since it seems inevitable that groups disperse, I am inclined to agree with Phil’s statements favoring SFW. At least that way, ones’ content persists. DaveWiner seems to be doing some interesting stuff with what he calls Rivers. I haven’t decided to try to set that up yet because I personally just don’t have the need and so I would rather allocate my time to the Tiddly* way.

– HansWobbe 2012-12-26 22:37 UTC

I started a new wiki this year: :) With some help there from the people behind and offering advice on starting local wiki.

SamRose 2012-12-27 01:23 UTC

Social media is indeed the place where people are discussing social media. Maybe a small subset using some version of etherpad. Google docs (drive) have taken over where wiki once was strong. People have heard the siren song of services hosted and payed for by someone other than themselves.

I’ve gotten more into RDF/SPARQL myself, and thinking about how to incorporate that into online activity.

SamRose 2012-12-27 01:27 UTC

I did not know LocalWiki, with interesting minimalist look and interesting features (special about maps?).

Lately, people made good wikis with python (HattaWiki)

JuanmaMP 2012-12-28 14:46 UTC

Some of the discussion happened on the Facebook group, and I copied extracts to Community:SocialMedia and related pages.

AlexSchroeder 2012-12-29 23:04 UTC

Add Comment

2010-12-22 Delicious to Google Bookmarks

I used the online service Delicious to Google Bookmarks to migrate all my bookmarks over to Google. I switched from the Delicious bookmark add-on to GMarks to use Google Bookmarks within Firefox.


Add Comment

2010-12-18 Flickr to Picasa

I just read Yahoo Just Killed… Consumer Confidence In Them and I have to agree. I am a Delicious user, and the first thing I thought upon reading the news was “I should bite the bullet and migrate all my Flickr pictures to Picasa!” I have not done that yet because I didn’t want to keep everything I do online in Google’s multitentacular embrace. Oh well…

I started looking for a non-Windows Flickr backup tool. Right now I’m using FlickrEdit which is a Java Webstart application, so if you have a decent Java installation, you should be able to start it from its webpage. It is currently downloading 1800+ images “in sets” from Flickr. Strangely enough it can only backup “selected” images, so you need to preview all your images before you back them up. That’s a lot of images… I’ll keep you posted. I’m not sure this is quite working as expected. :(

I also installed GoogleCL, a command line tool for Google applications. Unfortunately it doesn’t allow me to add bookmarks to Google Bookmarks. That requires the Google Toolbar. :sucks:

Now I’m waiting for the Flickr backup to finish. Let’s see whether I can use the Gooogle command line tool to recreate my Flickr sets as Google Picasa albums using the command line… Or just use the Picasa application? We’ll see when we get there. ;)

Update: I had to restart the FlickrEdit backup process a few times, but currently have 1850 images in my folder taking up about 4,6G of space.

I also tried FlickrGettr which didn’t quite work. I contacted the author and he confirmed that no longer maintained it.

I also installed Migratr on a Windows machine via remote desktop. It seemed like the ideal solution. I started downloading all my Flickr images. After a while it stopped importing images and I found a file called errors.log which said:

The remote server returned an error: (504) Gateway Timeout.
   at System.Net.WebClient.DownloadFile(Uri address, String fileName)
   at System.Net.WebClient.DownloadFile(String address, String fileName)
   at Migratr.PhotoServices.FlickrBasedPhotoService.importFromSource(String filePath)

Hm. I guess I’d have to try downloading the images a few times. This is no good, since it will try to upload the images it got before letting you quit. And it crashed while uploading the images to Picasa Web.

In the mean time, I tried PhotoGrabbr… It took forever to down the pictures. Perhaps that’s why it’s not getting a timeout error? In the end PhotoGrabbr downloaded 2104 images but took only 3,7G of space. I wonder what that means. When I look at the images downloaded by !FlickrEdit I notice that some pictures have been downloaded up to three times And I still get less files than using !PhotoGrabbr.

Thus, PhotoGrabbr did the job of getting all the images. It also built an XML file containing an entry for ever picture, its title, its description, its tags, and its location (which is always empty for my images). :)

I currently have two problems, however:

  1. The XML file doesn’t provide a unique identifier for the Photos. I now have two files called 02030_Weisstannental.jpg and 02031_Weisstannental.jpg, and two entries for a Photo with title “Weisstannental”, and no way to match them up. This makes no sense.
  2. There appears to be no information concerning the sets and albums the image belonged to.

I restarted the entire process, picked a different download directory, and instead of clicking the “Download All Photos” button I marked all the sets and clicked on the “Download” button. That should help be reconstruct the sets. I also deselected the following options:

  1. Use the photo’s title as the filename
  2. Skip downloading photos with duplicate filenames
  3. Prepend sequential number to filename

Maybe I messed things up the first time around!

I downloaded all the photos with the settings I mentioned above, got the original Flickr filenames such as 333137065_9520df0f41_o.jpg, and a XML file containing the Photosets – but once again the Photo element itself contained no link to the filename, or the URL. It just contains title, description, tags, and location. It appears to be impossible to link the metadata with a file!

There are only two situations in which this will work:

  1. you never gave a custom title to your Flickr uploads such that the title tag is the unique filename the photo got from your camera in which case you should check the option “Use the photo’s title as the filename”
  2. by sheer luck all your titles are unique in which case you should check the option “Use the photo’s title as the filename”

Otherwise you’re toast.

I’m thinking about writing my own script using Perl’s Flickr::API and Net::Google::PicasaWeb.

Whoa, installing these two modules via CPAN pulled in a shit-load of modules!

Spending a few hours trying to get a Flickr login, I think I’m ready to put this to rest until Flickr does in fact shut down. :(

I call flickr.auth.getFrob and use the frob to call flickr.auth.getToken. This fails with the message Invalid frob. Maybe it’s time to authorize my application? I visit the URL given by $api->request_auth_url('read') and am redirected to a web page that says Oops! Flickr can’t find a valid callback URL. If I face it by appending &callback= I get the message Oops! The API key or signature is invalid. which makes sense, I guess. The problem is that the first URL doesn’t have a callback URL (and I don’t need one).


Apparently !GoogleCL has similar problems accessing Picasa. I keep getting errors and requests for tokens and other crap. This sucks. :sucks:


Comments on 2010-12-18 Flickr to Picasa

Keep me apprised. I am still on Flickr, but fortunately I have most, if not all, of my pictures on my hard drive. I, too, am afraid of submitting completely to our Google overlords. But at this point it seems inevitable…

Adrian 2010-12-18 23:40 UTC

Right now it seems that PhotoGrabbr was the only one to actually download all the images and the metadata belonging to them. The information regarding the sets was lost in the process, however. That’s not good.

AlexSchroeder 2010-12-19 08:59 UTC

Ehe, that doesn’t sound like a rational decision. Do you really think google will never close any service it provides?

– PierreGaston 2010-12-20 08:43 UTC

Hehe, of course not. I dislike services that lock you and your data in. But even if they do not – like Flickr and Google – it takes tools and technology to actually move them around. This lack of tools has been nagging at the back of my mind for a while, now. I just needed an excuse to spend a nerdy day investigating my options.

As far as rational decisions go, it was certainly a very bad decision to spend a Sunday in front of the monitor instead of going out! :)

AlexSchroeder 2010-12-20 09:15 UTC

Add Comment

2009-09-24 Loosing Data With Google iPhone Contact Sync

Here’s what I did:

  1. backed up my Google contacts by exporting google.csv
  2. backed up my Address Book using the menu creating Address Book - 24.09.09.abbu
  3. exported my Address Book by exporting vCards.vcf
  4. uploaded the vCards.vcf file to Gmail; 700+ contacts were uploaded, 400+ were merged
  5. I had already set up syncronization for email and calendars on my iPhone; I switched on syncronization for contacts
  6. I said it should delete existing contacts on the iPhone
  7. I said I was sure
  8. I waited for a while
  9. I looked at the Mail app on my iPhone
  10. I looked at the Contacts app on my iPhone; it looked ok
  11. I looked at the Contacts on Gmail; it looked ok

Problems I am noticing right now:

  1. any notes I had for my contacts were not part of the vCards.vcf file, were not uploaded to Gmail, and are therefore lost on the iPhone #fail
  2. some records were marked as companies in my address book; this information is also lost in Gmail (but not too important); bummer
  3. some records were not merged correctly (I now have two records for my wife, for example); I assume that’s because they did not share an email address, so I can understand it
  4. I wanted to try a three way sync so I switched on “Sync Address Book contacts” in my iPhone again – I did not quite understand what “Your contacts are being synced with Microsoft Exchange over the air. Your contacts will also sync directly with this computer.” – does that mean that the three way sync is the default?
  5. strangely enough, syncing my iPhone now claims that the photos on the phone are linked to a different folder and syncing them now would delete all images and replace them with new photos; is this a side effect or unrelated? – I verified the settings (“Sync photos from: iPhoto) and said that this is what I wanted – and it promptly started to sync the 4.5G of photos, again; #fail
  6. once the 4.5G of photos are synced (needlessly), I discover that all my contacts on the iPhone have been duplicated; apprently a three way sync between iPhone, Address Book, and Gmail is impossible (I’m using Mac OS 10.4)
  7. I decided to not sync with my Address Book, removed the “Sync Address Book contacts” check in iTunes and will keep Gmail and the iPhone in sync – email addresses and phone numbers are important; Address Book is only necessary when I use on the desktop, which I practically never do
  8. I went back to the Settings app on the iPhone, switched off Contacts sync (deleting some of the contacts), switched it on again (deleting the rest of the contacts) (and confirming it)
  9. I found some entries had “lost” their phone numbers: it turns out that numbers in the format +41786125175 are not (or no longer?) shown on the iPhone. Number in the format 078 612 51 75 are shown as expected. #fail
  10. When I added the missing info from my wife’s mobile phone to my contacts on the iPhone all contacts disappeared. The phone then reloaded them from the server. Since I have 700+ contacts it takes quite some time. For every record edited. With wifi. I fear the next edit.

I feel weird using the Microsoft Exchange Server protocol.


Add Comment

2009-08-26 Google Reader Recommendations

I’ve switched from BlogLines to GoogleReader some time ago. I’m happy with it. Recently it added some sort of recommendation mechanism. I don’t get it. Some people are recommended to me. Some people seem to be regular readers. What’s going on? I have no idea.


Add Comment

2007-11-19 Oddmuse and Google Custom Search Engines

I recently replaced the search box for EmacsWiki with a Google Custom Search Engine. This is better than adding the term because and are two different sites. It is possible two create two different search engines and supply the appropriate URL patterns, and it seems to work.

Here’s a possible setup for your config file. Note how I removed the submit button and the fancy Javascript, and I deleted the id attribute for the form (because this form will appear at the top and at the bottom of every page). Also note the ugly hack of closing the span, printing a form, and opening a new span to have this all fit into a normal goto bar. Uuuugly. But it works. :)

$UserGotoBar = qq{</span>
<!-- Google CSE Search Box Begins  -->
<form class="tiny" action=""><p>
  <input type="hidden" name="cx" value="004774160799092323420:s9wlu0va1v0" />
  <input type="text" name="q" size="25" />
<!-- Google CSE Search Box Ends -->


Add Comment