Archive

I just read an article about some free MMORPGs that you can play in your browser. I haven’t played much in the recent years but maybe I will try one of them. I like the idea that they run in the browser, so no installation is required, they can be played on any platform, and they are free. What’s more, they are developed by Hungarians :)

You want to open .djvu files. Maybe you’d like to convert them in PDF format too.

“DjVu (pronounced like déjà vu) is a computer file format designed primarily to store scanned documents, especially those containing a combination of text, line drawings, and photographs. It uses technologies such as image layer separation of text and background/images, progressive loading, arithmetic coding, and lossy compression for bitonal (monochrome) images. This allows for high-quality, readable images to be stored in a minimum of space, so that they can be made available on the web.” (source)

Solution

The default document viewer of Gnome (evince) can open these files, but it’s quite slow. There is a better program for this format called djview4.

sudo apt-get install djview4

This program can also export .djvu files in PDF format (however, it’ll take some while, the conversion is quite slow).

To open .djvu files with Midnight Commander, add these lines to ~/.mc/bindings:

Use Case

In this post I explain how I managed to download the stock list of Yahoo.

Problem: I wanted to have a list of Yahoo stocks. More precisely, I only needed the stock IDs and the corresponding company names, e.g. “MSFT => Microsoft Corporation”. I was looking for such a list, but I didn’t find anything useful. So after a few hours I said to myself: “I will have to solve this problem by myself :(“.

Solution

Fortunately, Yahoo has a page that lists the industries. So the problem is actually extracting data from a bunch of HTML pages. Let’s see the steps that lead to the solution.Read more…

Using Yahoo! Finance, we can ask info about a given stock, e.g. MSFT. The current price is, for instance, 27.98. But it is given in what currency? USD, EUR, CAD? Unfortunately it’s not indicated…

Solution

As I figured it out, these values are given in local currencies. Thus, we need to know in which country the exchange is located. Using Yahoo! Finance, the exchanges are indicated with a suffix. See http://finance.yahoo.com/exchanges for a list of all suffixes.

Example: let’s take the stock name “UG.PA” with value 30.04. “.PA” stands for “Paris Stock Exchange”, thus 30.04 is given in euro (EUR).

To facilitate life, using the page http://finance.yahoo.com/exchanges, I collected all the necessary information in an array structure. I also added the currencies. So, using this structure, you can easily figure out the currency, once you have the suffix of the exchange. If there is no suffix, we can suppose it’s in USD.

If you want to consult financial information, Yahoo! Finance is a good site for that. For instance, to get info about Microsoft’s shares, just visit http://finance.yahoo.com/q?s=msft&ql=1. There, in the bottom right corner in the Toolbox section, you can find a link “Download Data”.

But is there another way to get financial data? Is there a Yahoo API for this?

Here we ask stock information about the shares of Microsoft. Their stock code is “MSFT”. We pass four parameters: n – stock name, l1 – current price, p – price at the previous close, x – stock exchange. The data is returned as a text file in .csv format: