Sunday, December 21, 2008

dvipdf dvips: Problems with file writing; probably disk full

Another attempt to save others time.

I was getting this error when trying to generate PDF from LaTeX source using dvipdf.

dvipdf> Note that an absolute path or a relative path with .. are denied in -R2 mode.
dvips: Could not find figure file pdf:dest; continuing.
Note that an absolute path or a relative path with .. are denied in -R2 mode.
Error: /syntaxerror in (binary token, type=137)
Operand stack:

Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1905 1 3 %oparray_pop 1904 1 3 %oparray_pop 1888 1 3 %oparray_pop 1771 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:1146/1684(ro)(G)-- --dict:0/20(G)-- --dict:71/200(L)-- --dict:206/300(L)-- --dict:43/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.62: Unrecoverable error, exit code 1

and finally this apparently meaningless error:
dvipdf> dvips: Problems with file writing; probably disk full.
The solution in my case? Using dvipdfm instead of dvipdf. As far as I know dvipdfm is just a better implementation of dvipdf.

Some reasons for similar problems when rendering LaTeX into PDF:
  • too many embedded images
  • runaway commands (unclosed/unbalanced command braces)
  • buggy libraries/dependencies

Saturday, November 29, 2008

Finally got my MSc degree in Computer Science!

I've done the final presentation this morning and everything went well.
What to do with the degree? Not sure. Actually, this question doesn't make much sense.
Am I relieved? You bet so.
Did I get tired of giving the same reply (i.e. I guess soon) when asked when I would be done with it? Oh yeah.

Here's the abstract for the MSc dissertation:

This dissertation offers two major contributions: (1) to evaluate the suitability of recommender algorithms for social networks. Such recommender algorithms may receive as input not only the social graph of these networks but also content-based data from recommended items.

For such, the relevant characteristics of social networks and the most important recommender techniques for these tasks will be surveyed. Special attention is given to the web-based system for social photo-sharing called Flickr and to the employment of visual metrics for image similarity.

The second contribution (2) is the construction of a framework for the modeling and analysis of social networks, as well as aiding the empirical study of recommender algorithms on these contexts. Also part of this framework are the best practices adopted throughout the work done on this dissertation, such as: techniques for the gathering, analysis and visualization of data; social networks classification; identification and modeling of recommending tasks within these contexts; implementation of algorithms and their architecture.

The relevance of such contributions lies on the enormous amount of information available online and on the ever-growing complexity of the relationships between this data. In this context, recommender systems may provide a great aid for end-users.

On related news, I've submitted a paper to the Social Networks track at WWW2009 with the following abstract:

In this paper, we present a framework for specifying recommenders within the context of Social Media sites such as Flickr or Based on the standard SIOC ontology, we show how the various recommendation problems can be defined. We also present a general software framework for implementing recommenders based on this model framework, and show some results obtained by one recommender built using it.

Thursday, November 20, 2008

Why publishers treat book footnotes as endnotes?

From my experience this seems to happen with virtually all books: most of the time the important remarks made by the author about a passage are referenced and placed at the end of the book. The whole process of getting to the actual text of the footnote is really annoying: memorize the page and section you're at, find the page at the end of the book where the notes are, realize that you've just forgotten what reference number you were looking for, switch back to the page you were currently reading etc etc. The effect of this cumbersomeness on me is that I seldom read any footnotes. Why not simply placing the footnotes at the end of the current page? It makes a lot more sense to me. Well, I'm definitely missing something about why it's not the other way.

Wednesday, November 19, 2008

Visual image search code from imgSeek ported to digiKam

Glad to know that the fast multiresolution image querying techniques implemented at my imgSeek project have been ported into digiKam:

During my digiKam presentation at LGM2008 i have introduced the concept to be able to search duplicates items around the whole collection of photos. But the concept is not just limited to find the similars photos by using copy, it even allows user to drawn a sketch of photo what user memories and shows photos what has similar shapes and colors as on sketch.

This is not a new concept in fact. An old program for Linux named imgSeek provide already this feature. By my opinion, it's time to update old interface of ImgSeek and make it more suitable for end users by implementing the technology into digiKam.

The old PyQT-based user interface for imgSeek certainly needs a rewrite, and integrating the image processing code into a more stable photo management tool like digiKam makes perfect sense. I haven't tried it yet but congratulations Gilles Caulier and Marcel!

Tuesday, November 18, 2008

Quick thought of the day: Depressing and challenging facts of life

First the depressing one: All the people around you either looking or acting strange (in a bad way) are actually trying to do their best. Now imagine who they really are when no one is around looking.

Challenging one: most of the important things in life are non-linear and hence the beauty of life lies on its unpredictability. The amount of effort you put into something is not proportional to your success. Split-second decisions may have an impact on your entire life (think about that quick moment when you decided to accept a job offer or decided to get married).

Sunday, October 05, 2008

iTunes script for opening the web page for the track or album of the song currently playing

I've created two simple iTunes AppleScripts for opening the Last.FM web page for the track or album of the song currently playing.

To install, just drag the files to your /[username]/Library/iTunes/Scripts/ folder. If there is no folder named "Scripts" there, create one and copy the files into it. AppleScripts placed in this folder will be listed in the iTunes Script menu.

Wednesday, September 10, 2008

Language most spoken on Twitter

I got curious so here's some stats I've been gathering.

Twitts are culled from the public timeline every minute and language (see code definitions) is detected by Google.

The most spoken language will always have a ceiling value of 100, so a language with a value of 20 is 5 times less common than the most spoken.

Graph is updated every 30 minutes with the stats for the current day.

Friday, September 05, 2008

Web apps user experience: not exactly improving

Take a quick look at this. First impression: "oh yes, these admin interfaces look really sleek". Second thought: each of them presents different UI concepts for doing the same tasks, UI elements (menu bars, status bars, sliders, buttons) are inconsistent across (and sometimes inside) them etc etc.

Poor users...

Wednesday, September 03, 2008

I've removed daily posts from the blog RSS feed

Why? Well, I guess they may be too annoying for people only interested on the other lengthier ramblings which I occasionally write here on this blog.

So from now on if you're interested on my usage habits, try subscribing to or even better: subscribe to my FriendFeed at which includes more online activity (twitter, amazon, etc etc)

Thursday, August 28, 2008

Ubiquity commands

Expect a lot of cool stuff coming out of the Mozilla Ubiquity project. Think of it as SIMILE meets Quicksilver right at Firefox's heart.

I've created so far a few commands:

Sunday, July 06, 2008

Zoomii books: interesting but makes me dizzy

Zoomii books, the "real" online bookstore is quite interesting and extremely well implemented. But still, I sort of miss it's point. Amazon's own shopping experience is still unbeatable. To some extent, Zoomii just transposed to the web the same old bookstore browsing experience which makes most people dizzy: OMG! so many books! How do I compare them? How are they related? There are too many shelves and aisles on this floor and there are still two floors on this bookstore to visit!

Greasemonkey DZone link redirector

Here's a simple Greasemonkey script I did to automatically redirect the browser to the article itself when browsing DZone, skipping the annoying summary/comments preview page.

Useful when opening articles from the DZone RSS feed.


Saturday, May 31, 2008

Basic and digest HTTP authentication when using Google App Engine URL fetch API

When using Google AppEngine's URL fetch API it's not obvious how to do a basic digest HTTP/S authentication, so here's a self-explainable code snippet for doing so:

import base64

username = "johnsmith"
pw = "cookie1234"

encoded = base64.b64encode(username + ':' + pw)
authstr = "Basic "+encoded

url = ""

mheaders = {'Authorization':authstr,}

result = urlfetch.fetch(url,headers = mheaders)

Other useful HTTP request headers you could add to the mheaders dict above are:

"User-Agent" : "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv: Gecko/20080404 Firefox/",
"Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7",
"Keep-Alive": "300",
"Connection": "keep-alive",
"Accept": "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
"Cache-Control": "max-age=0",
both of these were very handy when implementing the tag cleaner.

Thursday, May 29, 2008

Reference list of interview questions for a software engineer position

These are all non-technical and have been collected from several websites. They're also ordered by what I would try first.
  • So, tell me a little about yourself.
  • What are you passionate about?
  • What relevant experience do you have?
  • Do you have any questions to ask me?
  • Questions on the projects listed on the Resume.
  • Tell me what you know about this company.
  • Have you done anything to further your experience?
  • How do you keep yourself updated on the latest tools, techniques, technologies etc?
  • What steps would you go through when given a though problem to solve involving a completely new technology?
  • What motivates you to do a good job?
  • Talk about the last 2 technical books you read.
  • If given a new programming problem, what is your first step in producing code?
  • Tell me a suggestion you have made that was implemented.
  • What are the really important aspects of software development?
  • Is there anyone you just could not work with?
  • If your previous co-workers were here, what would they say about you?
  • Has anything ever irritated you about people you’ve worked with?
  • What is your ideal team size?
  • How would you deal with changes being made a week or so before the ship date?
  • Why do you want to work at X Company?
  • How would you deal with a bug that no one wants to fix?
  • So, explain why I should hire you.
  • If you had enough money to retire right now, would you?
  • What’s your greatest strength?
  • What’s your biggest weakness?
  • What have you learned from mistakes on the job?
  • What do you like about your current job? What don't you like?
  • How would you rate your current management?
  • How are you when you’re working under pressure?
  • Are you willing to put the interests of X Company ahead of your own?
  • Let’s talk about salary. What are you looking for?
  • Why are you looking (or why did you leave you last job)?
Some additional tips.

mdworker process 100% CPU usage on Apple OS X

I've noticed more than once a very high cpu usage on OSX and it turns out that the culprit was the mdworker process from Spotlight (text indexing service).

There seems to be several causes to this. In my case the reason was that it was trying to index the contents of a zipped file currently being downloaded by Transmission (bittorrent client). The same could probably happen for any other zip file or directory full of files being downloaded by another tool.

The solution was to add my download directory to Spotlight's ignore list: System Preferences -> Spotlight -> Privacy tab -> Drag your typical download location to the list.

Restarting Finder and Spotlight after that is a good idea.

Monday, May 12, 2008

Trânsito do Rio de Janeiro e São Paulo no celular em tempo real

Aponte o browser de seu celular para e acompanhe o trânsito em tempo real nos principais corredores do RJ e SP.

Atualizado a cada 3 minutos com informações do MapLink e CET-RIO.

Friday, May 09, 2008

Tuesday, May 06, 2008

Amazon Kindle e-book reader return over investment

I've fallen in love with the Amazon Kindle e-book reader the first time I heard of it, several months ago. I believe it hadn't even been available for ordering yet. But alas, I live in Brazil so I wouldn't enjoy one of its best features: downloading books wirelessly and instantly without paying for bandwidth or messing with wireless providers. All of that at any time of day or night and at any place in the country (no WiFi required).

Today I just came across a great Kindle review and noticed that the author did mention how cheap Kindle e-books can be compared to dead-tree versions of it, but he didn't do a back-of-the-envelope return over investment calculation for it:

A brand new Kindle costs you around $410. Hardcover book releases cost on average $27 (shipping included), which you can get on Kindle for $10. So for each new book release you buy on Kindle you save $17. But wait, you're not going to buy only new releases. Let's say you buy a few backcatalog items, which sell at Kindle for $6. So let's mix those two together and say you save on average $19 for every book you buy.

That means Kindle pays itself after 22 books. Which for many book lovers means 2 years or less of usage. If you consider all the added value of not carrying heavy books around and keeping many books on its internal memory available for you to reference or skim at your convenience, then that return comes even earlier!

Side-note 1: Actually, maybe this is exactly the math Mr Bezos wants us to do: he doesn't really want us to buy Kindles, but to buy these 22 e-books to make Kindle pay itself. Profit margins for paper books are probably ridiculously low (compared to e-books) so he wants to get away from it as soon as possible.

Side-note 2: If, like me, you're outside the USA, here are some reasons why it may take some time for it to become more widely available:

It uses Sprint to download books, which is only available in the US. This is one of the main features of the Kindle over all other ebook readers, and it is truly a wonderful feature.

Another answer is that many of the publishers whose works they are offering do not permit Kindle to sell them abroad, as they often have contracts with vendors in those other countries who do not want to see competition coming from the US.

A third answer is payment. It is true that you can use a credit card issued in another country for payment of a US bill, but it imposes some overhead on their operations, which being brand new most likely doesn't have full support for such things yet, including the problems of currency conversions.

Sunday, May 04, 2008

Histórico dos fundos de investimento do Unibanco

Compilei em uma única página web um histórico em forma de scatter plots dos principais fundos de investimento do Unibanco. Ajuda a saber o que os outros clientes andam fazendo em relação a esses fundos.

Segue o link:
Histórico dos fundos de investimento do Unibanco
(atualizado diariamente)

A maioria dos indicadores é obvio, mas apenas para detalhar: Captação = Captação geral de recursos - Resgates

Os dados são obtidos das paginas disponibilizadas publicamente pelo próprio Unibanco.

Sempre quis parar para aprender a investir direito (day-trading, mercado de opções, etc) mas nunca priorizei. Principal motivo é que não tenho paciência de acompanhar minuto a minuto e nem seria viável fazer isso no meu trabalho.

Alguns dos fundos historiados:


Saturday, May 03, 2008

Money saving tip for book lovers

Try this quick estimate on the number of days needed for you to finish all your unread books: Multiply the number of books left by 300 (average number of pages in a book) and divide by the average number of pages you read daily (figure that out by dividing your weekly reading capacity by 7). Normally you'd need to divide by 365 again to get the years-till-next-buy estimate. You'll find out that you'll take a lot longer to hit the "Proceed to checkout" button again.

Sunday, March 30, 2008

I like to read text backwards. Don't really know exactly why. Am I alone?

I catch myself time and time again reading a text backwards. Be it a short email, an article, or even a book. Most of the time I start from the end, read the last paragraph or page, and start jumping pages and paragraphs randomly backwards up to the start.

It may have been influenced by the fact that most magazines leave the best content to the end (so they can place a lot of ads in the middle).

Another explanation is the fact that less than 10% of everything I've ever read is fiction, where linear and progressive reading is the only way that makes sense.

Could it have any relation with the fact that I'm left-handed (I'd say 75% left-handed)? I looked around and couldn't find any scientific article or study about it.

Another theory I have is that it may be a habit that evolved from a known speed reading technique: doing a very fast skim on the text, basically trying to figure out how lengthy it is, how it is structured, what it talks about, where is the main point, how long is the conclusion and so on. So your eyes eventually get to the end of the text and then I get lazy to find where it actually started, so I just go on backwards from where I'm at.

Regardless of the reason behind it, I have found that it gives me better comprehension and helps me 'skim' the material objectively. Try it later and tell me how it went!

Thursday, March 27, 2008

On business developers and sales managers

Something really wrong is going on with ISVs and the commercial software market in general: clueless business developers and sales managers alike. I mean, it has become acceptable for a "business development executive" or someone with a similar pompous title to be simply unable to demo the flagship product for the company he works for or to have no idea of which modules the product he's desperately trying to sell is made of. "On top of what technology our super great product runs? Gee, wait a sec. while I schedule a meeting next week with you and one of our tech guys".

Monday, March 10, 2008

Gone, Without a Trace

The lengths a reporter will go to get away with having to pay back for a lost review MacBook Air borrowed from Apple.

I mean, the guy used 1008 words for saying "Sorry Apple, I lost it. Can I get another one? I promise to write a short essay on how thin it really is, to the point of accidentally throwing it out with yesterday's newspaper".

Sunday, March 09, 2008

Quick guideline for using experimentation as an aid for decision making

This is a short guideline inspired by an article from J.B. Rainsberger on the Nov/Dev issue of IEEE Software.

The motivation is that whenever your team is on a meeting and taking more than 20 minutes to come up with a decision on a design issue, you should be better by simply doing experiments and just trying the altenatives.

Identify and state a clear question the experiment should answer. Most of the times this is half the work, as people love arguing about 10 things at once and confusing matters, causes and effects etc.

Fail fast. Identify and state clearly how you'll know if the experiment has failed early. The whole point of an experiment is to answer a question quickly.

Choose a reasonable amount of time to spend on the experiment and stop when this limit is over. The "cone of uncertainty" tells us that it takes up to 20% of a project's timeline to have a good estimate of the work remaining (i.e. it takes a day's experimentation to evaluate an idea for a week-long task). Running out of time on an experiment is probably a sign that you've asked the wrong question. Go back to your team, discuss the issue, come up with another question, set a new time limit and start a new experiment.

Throw the experimental code away when the question is answered. The goal is gathering information rapidly so you might write code with less care as you focus only on the question and its answer. Most people is tempted into using the experimental code as a foundation for production code. Resist doing that!

Monday, February 11, 2008

MacBook review: first impressions

For the really impatient folks out there (I'm one of you!): yes, MacBook and OS X rocks.

For the rest: After pondering for some time on whether buying a MacBook, a MacBook Pro or a Lenovo Thinkpad (T-Series), I decided to buy a white MacBook.

Why not a MB Pro? The added price (almost 2X) for a dedicated GPU, LED backlit display and illuminated keyboard didn't seem right to me.

Why not a Lenovo T61p? Basically because I'd get nauseated just thinking about booting it up for the first time and be greeted by the dreaded WIndows Vista, knowing that I had actually paid for that. I know there are now versions shipping with SuSE Linux, but I couldn't find any reseller nearby with such models.

So here are the specs and my impressions so far:

Model Identifier: MacBook3,1 White
Processor Name: Intel Core 2 Duo
Processor Speed: 2.2 GHz
Number Of Processors: 1
Total Number Of Cores: 2
L2 Cache: 4 MB
Memory: 4 GB
Bus Speed: 800 MHz
HDD Capacity: 111,79 GB

  • Lightning fast recovery from sleep;
  • Sub 20 seconds boot time;
  • Initially I thought that not having air vents at the bottom of the notebook (the only air vent is neatly hidden under the display hinge, together with the built-in speaker) would make it really hot but so far it hasn't been the case. It's been running surprisingly cooler than my previous and much less powerful FJ270 Sony VAIO and other Toshiba notebooks I've owned;
  • iSight, the built-in web cam has a pretty decent quality;
  • Battery life is great: when correctly calibrated and fully charged, I can get almost 4 hours out of it with heavy WiFi/bittorrent usage;
  • Bluetooth and iSync Just Works(TM) with the many devices tried;
  • Spotlight and Quicksilver rocks;
  • Price: if you compare just the hardware inside, a PC vanilla Dell/Lenovo laptop would be a bit cheaper, but factoring in the value provided by Leopard and all the little well-thought things on an Apple machine, you get a lot more value overall. And yes, of course, you won't need to be stuck with the despisable brand new Windows Vista.

  • No PageDown key (with the default keyboard mapping, you need Fn-Down);
  • In the name of design Apple placed some really sharp edges near the palm rest to the point of becoming uncomfortable;
  • Lousy built-in speakers;
  • Support for dead-keys (for entering extended characters in weird languages like Portuguese) is not that good. Does not work like a Linux or Windows user with a US Intl keyboard would expect. For example, in order to produce "ção" (pretty common in portuguese) I need option-c, option-n-a, then "o"; Update: solved with a 3rd party keybord layout file.
  • No quick option on Finder for showing/hiding Unix files starting with a dot. There's a global command line setting for that but this behavior can't be quickly enabled or disabled;
  • I wasn't expecting much from the keyboard but it is indeed worse than those from IBM/Lenovo or from some Vaios. I'm starting to get used to mine but I feel like I have to press keys harder than necessary;
  • I wanted the black model, but that costs more (even if you get an identical spec!). That doesn't make much sense business-wise.
  • The display hinge is not strong enough. If you pull the notebook upwards fast enough the display opens.