Registered for Vancouver Python Workshop

I just officially registered for the Vancouver Python Conference. I am really looking forward to it even though it will take up my entire Saturday and Sunday. It is too bad I don't have a laptop that isn't ancient, otherwise I might give a lightning talk on numpy since it is completely absent from the talk schedule. Had I thought about it earlier I would have prepared and offered to give a talk on how to use NumPy for the beginner's track of the schedule. Maybe next year. Besides with Numpy having a 1.0 release by next year, maybe they will be able to get Travis Oliphant to visit. :-) or at least someone more knowledgeable in numpy than me.

Interesting svn Recovery Problem

I was just trying to recover some files from a subversion repository at work that were deleted a few revisions ago. Here's what happened:

update to old revision where directory jlamothe still exists:

$ svn -r 2444 up -q

directory jlamothe is there in revision 2444:

$ ls
cjm  david  jlamothe  pix  wgm

updated to HEAD, jlamothe got deleted in HEAD:

$ svn up
D    jlamothe
Updated to revision 2477.

see, it is gone:

$ ls
cjm  david  pix  wgm

trying to recover:

$ svn cp -r 2444 svn+ssh://david@weatherwax/svn/repos/Docs/jlamothe . -q
svn: The URL 'svn+ssh://david@weatherwax/svn/repos/Docs/jlamothe' has a different repository root than its parent

it's there:

$ ls
Bryght  D-Wave  acheron  cjm  david  jlamothe  pix  wgm

but it wasn't scheduled for addition? although the files beneath it were.

$ svn st
?      jlamothe
M      david/decomposition.tex

This had me stumped for a long time. It turns out it was the "svn: The URL 'svn+ssh://david@weatherwax/svn/repos/Docs/jlamothe' has a different repository root than its parent" that was the problem. For some reason because I used a slightly different URL (although equivalent, thanks to my /etc/hosts file) it didn't schedule it, as if it wasn't even part of this working directory...as if I had created a new working directory within another working directory.

Tags:

Blogtk

Just found the program I was looking for, a blog client for Linux called Blogtk. I found it by doing eix blog in Gentoo and it was the only "stable" one listed that sounded like it would do what I want. Hopefully this will allow me to post quickly to my blog without having to use the browser (which I find slow and clumsy at least in Drupal).

Gaim-Blogger Doesn't Post to Body

How annoying. When I try to make a blog entry on my drupal site it posts the entire thing into the title of the post. That makes it pretty much unusable. I'll have to look for another blogger-api xml-rpc clients that I can use,

Fix Capitalization in Latex Bibliographies

To make words in Bibliographic titles appear in the capilization that you specify, enclose the word in curly braces, {}. So to ensure the word, VLSI is capitalized, put {VLSI}.

Creating Pretty PDF Files From Latex

To create good PDF files which look good in Adobe Acrobat even at maximum zoom levels:

  1. First run latex as many times as you need to resolve all references. This will produce your final *.dvi file. Let's assume it's called myfile.dvi.
    latex myfile.tex
  2. Now that we have our myfile.dvi file, we need to convert it to postscript. This is the safest step for most applications. For example some Latex features will not appear in the document unless the *.dvi file is first converter to a Postscript (*.ps) file. One example is shading, by using the Latex shading package (available on CTAN). The "other" method I am elluding to is by converting directly to PDF by using dvipdfm or pdflatex. This usually works fine, however, I recommend going to Postscript first using dvips. You need to provide two key arguments: a) the paper size, and b) a PDF option. The paper size option is usually necessary because dvips is set up for A4 paper by default. Note, even if your postscript file looks like it fits on the page properly, it may not once you convert it to a PDF! The PDF option is necessary so that dvips includes outline fonts instead of bitmap fonts in the Postscript document. This is what will make our fonts look pretty in the final PDF document, and will allow the fonts to scale themselves when we zoom in. So the command we need to run is:
    dvips -t letter -Ppdf myfile.dvi

    This should produce some output similar to that shown below:

    This is dvips(k) 5.86e Copyright 2001 Radical Eye Software (www.radicaleye.com) TeX output 2003.03.04:0123' -> myfile.ps
          <tex.pro><alt-rule.pro><texc.pro><texps.pro><special.pro>. <cmr8.pfb>
          <cmti10.pfb><cmbx10.pfb><cmbx12.pfb><cmsy10.pfb><cmr10.pfb>[1] [2] [3]

    If we had of just run:

    dvips -t letter myfile.dvi

    we would have gotten the following output:

    This is dvips(k) 5.86e Copyright 2001 Radical Eye Software (www.radicaleye.com)
          ' TeX output 2003.03.04:0123' -> resume.ps
          <texc.pro><special.pro>. [1] [2] [3]
     
          The *.pfb files are font files, and they are now being included
  3. After running the above command, a myfile.ps file will have been created. It will appear larger than it did before because it will have some fonts embedded inside the document itself. Now the last step is easy. We need to run ps2pdf:
    ps2pdf myfile.ps

    This should produce a myfile.pdf file. Opening the file up with Adobe Acrobat should show that the fonts are now *pretty* and will appear very nice at 400% zoom and upwards.

Tags:

Digg, 43things, and Drupal via XML-RPC

I can't seem to get Digg.com's "blog this" feature to work with my Drupal blog. I was able to get it to work at one point but it is really inconsistent and unrepeatable. One of the main issues I have been having is with my username having a space in it (it was "David Grant" before). Now I have changed it to "David Grant" to remove any possibility of that being a problem. I keep getting this stupid error: "You either tried to edit somebody else's blog or you don't have permission to edit your own blog." But I did have it working with these same settings before.

The same problem applies with 43things.com blog integration feature... I tried setting my blog-type to Wordpress but no dice...

Update (2006-07-29): Almost got it working. The key was enabling the blog module and enabling the "edit own stories" permission under "blog" under "access control." It turns out that there is no problem with having a space in my username. There is one small rinkle, however, and that is that with digg.com it always wants to create a "blog" content-type, not a "story." By putting a watchdog statement in the blogapi.module I was able to see that digg.com is sending "1" as the "type" argument to the blogapi_blogger_new_post function whereas the gaim-blogger plugin is sending "story". The numeric type causes drupal to create a blog entry, even though I have explictly told the blogapi to only create story nodes, at the blogapi settings page (admin/settings/blogapi). I haven't figured out exactly why this is happening yet.

Update (2006-07-29): Got it working to my satisfaction but it's an ugly hard-coded hack. I hard coded $blogid='story'; to force all new nodes created with the blogapi to be of type "story". This will obviously fail miserably for any user that doesn't have access to create stories although that doesn't matter for me since I have just a single-user blog. Well all this has made me wonder if I should use the "blog" content type as my main content type. Here's the patch anyways:

--- blogapi.module.orig 2006-07-30 00:43:52.000000000 -0400
+++ blogapi.module      2006-07-30 02:41:20.000000000 -0400
@@ -191,6 +191,7 @@
   }
 
   $edit = array();
+  $blogid = 'story';
   $edit['type'] = _blogapi_blogid($blogid);
   // get the node type defaults
   $node_type_default = variable_get('node_options_'. $edit['type'], array('status', 'promote'));

site5 Hosting

This website is hosted at Site5 as well as 4 other sites on mine, among them are: www.davidandnasha.ca and www.maureenlazzari.ca. I have owned this web hosting account since last October and I have found the speed to be satisfactory although not amazing, which is what you would expect from shared hosting.

Recently, however, the service got worse and worse and finally there were a couple of occasions where I could not connect to my site for 30 seconds, and running time svn status at the command line could take anywhere between 0.2s to 2 min. I have always had good experiences with site5's customer service. I started bugging them, mainly complaining about the slow svn status command because that seemed more repeatable and not dependant on network slowdowns at all (it is strictly a local command). Eventually after a lot of nagging, the people at site5 said they found a spammer operating on my server, then after I complained that there was still a problem, they found another spammer. Apparently there were a lot of exim processes running on the box. Anyways, the service has been great lately and I hope it continues.

Site5 has taken some flack lately but I still think that they are one of the best shared hosting sites around.

Tags:

First Book Sent Through whatsonmybookshelf.com

I just shipped my first book using What's On My Bookshelf. Unfortunately I had to ship it internationally, to Denmark. On the bright side, Canada Post has a service called "small packets" and shipping small packets by surface mail internationally is really cheap. The book weighted 700g and it cost about $12 including taxes to ship it to Denmark. It will take at least a month to get there though!

That book was worth two points on What's On My Bookshelf, so that means I can get two one-point books in exchange. My first two books will thus cost me about $6 each. That could work out alright.

I still think it is probably more affordable to just give your old books away locally (either to a Salvation Army or a used book store) and then buy books at a used book store. The disadvantage to this is that a used book store may not have a book you want. But this is going to be much cheaper than What's On My Bookshelf, in my opinion. There are several used book stores nearby. We have gone to Tanglewood bookstore before and it was a bit annoying because lots of their book were new or almost new, but the salesman was really helpful.

Stephen Colbert Better Know a District - D.C.

This was one of the funniest Better Know a District segments that I have seen. Youtube removed it but it's available for Canadians here: http://watch.thecomedynetwork.ca/the-colbert-report/best-of/better-know-a-district/#clip16539.

Google - Behind the Scenes Talk in Vancouver

I went to a presentation by a Google engineer, Narayanan "Shiva" Shivakumar, tonight at the BC Cancer Agency in Vancouver. It was organized by HPC Vancouver. He talked about some of the backend things that power Google, such as the hardware itself, GFS (Google File System), MapReduce (an abstract parallelization interface for running algorithms on large data sets) (see also MapReduce at Wikipedia), and BigTable (a massive hash table, their own custom database).

He showed some pictures illustrating the growth in Google's computing power GFS form its days in a Stanford lab to the present in massive data centres. The GFS is amazing, accessing redundant 64MB chunks on file servers with everything automatically redundant-ized and load-balanced automatically (and the amount of redundancy is variable depending on what the data is). I thought MapReduce was pretty cool. Reminded me of the map and reduce functions in Python.

Near the beginning of his talk he mentioned that they needed a lot of computing power to compute page rank and mentioned something about constructing a large graph where each node is a URL or HTTP page and each edge represents a link (I assume the graph is directed?). He did not say anything more about that problem though...

Update (2006-07-29): I think I may have gotten food poisoning from the refreshments at this event. If anyone else good food poisoning please let me know. I am trying to figure out if I got infected at this event or at lunch that day.

Tags:

MySQL Backup Script

Great, simple little MySQL backup script here at B&T's Tips & Scripts. I just got it set up and so dumps of my database are now being made every night at midnight or whenever I call the script (as I did right now before installed the gsitemap drupal module).

Numpy 1.0b1 released

My favourite numerics package, Numpy is close to a 1.0 release. 1.0 (beta1) was just released last Friday and a branch for 1.1 has been created. Things are really getting interesting and it is nice to finally have an almost-standard numerics package for Python (compared to before when there was numarray and numeric which both didn't have heavy development activity).

Still Figuring Out Drupal Taxonomy

I'm still trying to figure out how exactly to structure the taxonomy/categories of this site. I have the tagadelic and taxonomy_dhtml modules and I am playing around with them a bit. Drupal is fairly robust when it comes to categorization and I'd like to just go with something and get it right the first time. Right now I'm leaning towards flat-hierarchy free-tagging for the "stories" (blog articles) with a tag cloud or alphabetized list on the right hand side, along with archival listings. And static pages using multi-level categories with a collapsable menu. Drupal is just so damn configurable, that's the trouble and there are so many modules and different ways of doing things.

What's On My Bookshelf Book-Swapping Service

Stumbled upon a great website called What's On My Bookshelf. I think I found it through Digg.com. It's an amazing concept and very similar to the kind of thing that goes on in RoIO (Recording of Illegitimate Origins) groups. You offer up books that you have and want to get rid of and others do the same. You pay when you ship a book, not when you receive, but you have to ship books in order to receive more books. The more you ship (or the more expensive the books you ship) the more you can receive. Everyone starts off with 1 point. I already added three books to my bookshelf (all of which were duplicates after I got married and my wife and I merged out book collections). Each book counted for 1 point so I had 4 points. I then requested 3 books from other people and I am waiting patiently to receive them. No one has requested my books yet although I am sure someone will eventually and I will have to ship them.

Tags:

Pages

Subscribe to David Grant RSS