Bitcoin donations are welcome:14snQXeLcnJtWUduKZ6rC2MHdPYrYar1Tw

Wednesday, December 30, 2009

Java error after Debian Update (December 09)

Typical error messages:
Caused by: java.net.ConnectException: Network is unreachable
INFO: I/O exception (java.net.ConnectException) caught when processing request: Network is unreachable

Fix:
nano ~/.java/deployment/deployment.properties

Fix the following line like this:
deployment.javaws.jre.0.args=-Djava.net.preferIPv4Stack\=true

Wednesday, December 9, 2009

Multimedia shortcut keys in fluxbox

After having lot's of problems with multimedia key handling applets segfaulting, not reacting to keys and what-so-ever, I decided to go basic! And d*mn I'm glad I did so!

It took me 3 lines of work to get my Volume+, Volume- and Mute button to work like never before in fluxbox.

The short how-to:
1.) Open your ~.fluxbox/keys
2.) Add the following lines:

XF86AudioMute :Exec amixer set PCM toggle > /dev/null
XF86AudioLowerVolume :Exec amixer set PCM 1%- > /dev/null
XF86AudioRaiseVolume :Exec amixer set PCM 1%+ > /dev/null
3.) Save the file, reload fluxbox and it should work.

If you get no reaction, do this:
1.) Open an xterm
2.) run xev
3.) Push, let's say your Volume+ button, and see if you get a response containing the word "XF86AudioRaiseVolume". If it doesn't, you've found your problem. Find you X config files with all your keybindings and relocate it to the default settings.
4.) Try again :)

Lot's of more information and inspiration here! :)

Saturday, December 5, 2009

What geometric average shows

How do you calculate a geometric average? I reccomend you to simply check wikipedias page about it, geometric mean.

But what is the use or simply just what's the deal about having a geometric average? In economy it is very useful when looking at the progress of the stock market for example.

I'll give you a quick example to understand the use:
Let's say you have a stock index which goes like this:
Y1: 100
Y2: 90
Y3: 105
Y4: 110

which is a developement of:
Y2: -10%
Y3: 16,66%
Y4: 4,76%

Now, if you invest 100 at year 1, your stocks will at the end of Y3 be worth 105.

If you simply take the average of those numbers the regular way: (-0,1+0,1666+0,0476)/3=0,038 ==> 3,8%

If you take the geometric average you get:
(0,9*1,167*1,048)^(1/3)=1,0325 - 1= 3,25%

Which one would you rely on to give you a rate on return on your investment?

100 * 1,038³= 111,8
100 * 1,0325³ = 110

As you can see, the geometric average gives you the correct return on your investment!

Difference between spot interest and forward rate

The easy way to understand the difference:

Let's say you take a trip to your local bank to get a loan for a house. When establishing such a loan you get the choice between
A) Having a floating interest, or
B) Having a fixed interest

The floating interest rate will now change each year, and each years interest can be understood as a forward rate, example:
Year 1: 5,3%
Year 2: 4,88%

The fixed interest is based on what the bank think will happen in the future. So let's say the bank offers you a fixed rate for two years at 5,09%.

Now, is there a relation between these numbers? Yes there is!

It's pretty easy, the relation is:
(1+spotrate)² = (1 + FW1) * (1 + FW2)
where:
spotrate = 2 year fixed interest, or 2 year spot rate.
FW1 = Year 1s interest rate, or forward rate for year 1.
FW2 = Year 2s interest rate, or forward rate for year 2.

Example:
1,0509² = 1,053 * 1,0488
!!! I rounded off the secon years interest to 4,88%. It's supposed to be: 4,8804188%


To sum up:
A spot rate can be a rate for 1 or more years set at the CURRENT time.
A forward rate can be looked as the floating interest.

What you need for lens cleaning

If you need to clean your lens it is important that you use the right equipment so you don't ruin it. Some weeks ago I ordered myself a lens pen (brilliant tool for on the go cleaning) as well as a quality micro fibre clothing for doing this. And the best part? The price! I paid a total of 11.64$ for this! And that's shipping included!

The lenspen is the same as the one presented at http://www.lenspen.com and there are some great instructions on how to use it right here.

Where to order? I'll make it easy for you. Simply put these two items in your shopping cart, just click here and here and you're done! The shopping is done from dealextreme, which is a GREAT site for ordering lots of cheap tools which your local store probably imported from china as well and sold for triple the amount of money :) Only con is that it takes 1-3weeks before the items arrives.

Happy shopping!