Sunday, January 25, 2015

Pakistan power blackout

After terrorists destroyed a transmission tower in Baluchistan, Pakistan, nearly 80% of Pakistan's population - or more than  140 million people - were left without power for hours. (see Bloomberg article)

Just like India, which I mentioned in a post related to a power outage in 2012, Pakistan would hugely benefit from a distributed, resilient grid.

Sunday, August 17, 2014

FPGA bitstream documentation

This article contains a growing collection of resources on FPGA bitstream formats and toolchain details as I find out more about the various vendor's implementations.

Over the past couple of years, many projects have developed open source alternatives for proprietary solutions in the IT industry. One of the last areas of proprietary domination includes reconfigurable computing chips. This technology is becoming more and more important as the advantages of FPGAs over conventional processors in speed and energy efficiency become evident.
Even Microsoft is now testing FPGAs to accelerate their Bing search engine.

While there is a wide range of tools available to program the many flavors of microcontrollers like AVR, PIC and Parallella (which happens to be a completely open design), and to flash BIOS chips, similar capabilities are missing in the open source world for field-programmable gate arrays, or FPGAs.

Tools to develop and compile the necessary VHDL or Verilog code to be run on FPGAs are already available, such as Icarus or GHDL.
In order to use the compiled code with an actual FPGA, each vendor has their own tools:
Xilinx offers the free XSE Webpack, Altera seems to have at least a partly open source tool called STAPL (Standard Test and Programming Language), yet to flash the resulting binary code, further proprietary tools are needed.
Lattice Semiconductor, which offers a board to use with the Raspberry Pi computer, is doing the community a huge favor by providing access to affordable hardware. made an early attempt at bitstream analysis, however, the site is not online anymore. supports various bitstream formats as well as JTAG adapters, and is under active development. STAPL, however, is not yet supported by urjtag. For now, binaries and source code for a STAPL compiler and player available from Altera. references information on building a bitstream for Microsemi FPGAs. 

Routing of components on the FPGA chip is a complex task that is performed within the proprietary toolchains.
There currently are two open source projects that aim to implement route-and-place routines for FPGAs: RapidSmith and VTR (Verilog-to-Routing).

Rather comprehensive information on older Xilinx FPGAs can be found on the Internet Archive, though not on the manufacturer's site anymore:

Thursday, August 14, 2014

A year with the VAUDE Luke messenger bag

About a year ago, I was looking for a suitable replacement for my assortment of backpacks I had used until then to transport my laptop, folders, documents and other utensils I needed to have with me every day.
While browsing for an ergonomical solution that would allow me to carry my stuff when riding my bike in the city, I became aware of the disadvantage of backpacks I had been using for much of my high school years: heavy rain would soak them to the point where the content would sometimes get wet. This was something I wanted to avoid this time.
Soon I remembered that a friend had bought a messenger bag for uni, so I dug up some more information on them.
Of the various messenger bags I checked out, the VAUDE Luke L clearly stood out. It is made from very durable, water-proof tarpaulin, and comes with an adjustable should strap and removable pad.
The bag delivers a remarkable volume of 19 liters, which is more than enough for my daily needs.
One thing the VAUDE Luke makes superior when compared to other messenger bags, is the belt that stops the bag from moving around too much when you are riding a bike.
A padded compartment allows you to transport a laptop without having to worry about damaging it. On campus, I usually keep a laptop, a large, heavy folder, books and a Nalgene bottle all in the messenger bag.
Another unique feature is the handle that allows you to carry the Luke L instead of using the shoulder strap.
The bag can also be used for travel, can be attached to the handle bar of a trolley and, at 37 x 48 x 14 centimeters, is compact enough to be used as cabin baggage.
On occasion, I have used the VAUDE Luke L on a city trip, packing some clothes and little more than a toothbrush along with my laptop.

So far, I could not be happier with my choice of the messenger bag over a conventional backpack.

Wednesday, August 13, 2014

The only way to stop climate change: bring down the amount of fuel to transport

Cars running on natural gas are thought to be a clean, climate-friendly alternative to conventional cars running on gas or diesel. But a closer look at how this natural gas fuel is transported raises some serious concerns on the effects natural gas-powered cars have on climate change. A Stanford study found that the pipelines transporting natural gas are leaking so much methane, those cars cannot offset the global warming potential added by the much more potent methane.

Whether it is because pipelines, tankers and railcars are used to transport only conventional fuel or because a certain amount of the fuel is lost in transit, it must be clear that the future in energy lies in local production of electricity, and that electric cars must be favored over all other solutions.
Even if hydrogen gas for use in fuel cells was to be produced using only clean energy sources such as wind or solar power, the hydrogen gas would still need to be compressed and transported, which both affect its overall energy efficiency.
Using solar panels installed on their own homes, owners can not only charge their car, power their home and generate income by selling the excess electricity they generate to the local utility company; the cars can serve as storage in a distributed electricity grid that is more efficient and less prone to large-scale failure.

Monday, August 4, 2014

Document processing with Ghostscript

Quite often, printing a document in full color mode is not only unnecessary, but also a waste of ressources.
In order to save ink, time and money, you can simply use the draft mode available in your printer menu. The downside of this method is that you cannot preview your document in draft mode. The preview will always give you a full-color version, regardless of printer settings. At least for Linux systems you have the option of creating a grayscale version of the document and saving it to a PDF file; however, it will again only be a full-color version. This makes it necessary to process the PDF file using additional tools so you can get a proper grayscale version of your document.

In this post, you will learn about the tools to help you customize your document so it uses minimal ink, yet is clearly readable and can be checked before you waste paper and ink on a botched print.
To begin with, we will use Ghostscript. Binaries for Linux, Windows and Mac can be downloaded here

Using any shell on Linux, use the following to command to process your file (let's call it input.pdf for now) and turn it into a new file named result.pdf.

 gs -sOutputFile=result.pdf -sDEVICE=pdfwrite -sColorConversionStrategy=Gray
 -dProcessColorModel=/DeviceGray -dNOPAUSE -dBATCH input.pdf

These series of GhostScript commands take your PDF file, convert it to grayscale using a predefined strategy and generate a new PDF file that can be printed as-is. Note that not all command line options I am using here are fully documented by Ghostscript. This initally was what made me write this article: to help others learn about advanced options that are available but hard to find in the Ghostscript tool.

When generating a PDF from a Word document that was created using a version of Microsoft Office 2010 or later, please be aware that some features can cause GhostScript to fail at converting certain or even all document sections.

Tuesday, April 2, 2013

Need to make a tough decision? Don't think in your native language!

This is something that many of you probably had noticed subconsciously before, but only now a  new study published in the Psychological Science magazine shed some more light onto it. (Sorry if I'm not linking directly to it, the paper is not openly available)
Thinking in a language other than your native language improves decisions,
Wired sums up the ongoing research. In part, it is because thinking in a foreign language breaks up your habitual thought process that has manifested itself through cultural influence etc. over the years.

The method of using another language for thought can also be used when writing, even if you are just jotting down a list of groceries you need to shop for. Using the foreign language requires you to think more thoroughly about whatever you are going to do, which results in a better decision, according to the experiments done by the researchers.
Even more profound effects are evident when it comes to personality: immersing oneself in another language has the power to change certain personality traits while using the foreign language.

Sunday, August 5, 2012

Environmental impact of meat consumption

For the majority of the world's population, insects are an important part of their diet. Countless varieties of beetles, their larvae, crickets, ants or locusts are consumed in Asia, Africa and the Americas.
People of the western hemisphere however have been reluctant to add these creatures to their meals, though casu marzu can serve as a noteable exception for entomophagy in Europe.

In the face of a changing climate and a world population that has surpassed 7 billion, it seems a necessity to consider insects as protein sources in addition to meat.
In fact, there are already some companies that sell snacks made from insects. What is now needed is an increase of production and marketing of these foods.

The point is, cattle and pigs, our sources of red meat, all emit methane when they digest what they are fed. Methane acts as a greenhouse gas and is about 20 times as potent as carbon dioxide.
These emissions can in part be mitigated by choosing the right food for the livestock in order to influence digestion processes in their guts; however, farmers still need to feed a significant multiple of what they will end up with as actual meat.

An often-quoted number is the ratio of 54:1 in energy input required to produce a particular output of protein for cattle, whereas for insects, the number is as low as 4:1.
What this means is, you need fifty times less energy to produce protein from cattle than you need for the same amount of meat from cattle.
Costs associated with insect meat are therefore significantly lower, as resources needed to breed the tiny creatures like water, food crops and energy for lighting can be used more economically.

Another more recent report linking food production and energy consumption can be found here.
Including insects as sources of animal protein has implications for land use, too. Meal worms for example can be kept in boxes that allow for higher density in usable protein per cubic meter than conventional livestock. This results in more efficient transport, lowering greenhouse gas emissions even further, as production can be optimized for smaller-scale, localized shops.

To give you an idea, see this site with pictures and a very comprehensive list of edible insects at this page.

Of course, we should be aware that reducing our overall meat consumption is a viable option. Some alternatives based on soy sound pretty interesting.