You wanna listen to Pandora Radio outside of the US.
However, updating the proxy info manually is tiring. So I made another script that updates the config file of FoxyProxy (here is my
foxyproxy.xml). In order to force FoxyProxy to see the new settings, you’ll have to restart the browser.
The script is available here: pandora.py.
If you want to listen to Pandora Radio, there is an easier method.
I have a laptop with a small HDD. I want to use Dropbox on it too but in this case I hardly have any free space left. Could I select certain directories that I don’t want to see on my laptop?
Yes, it’s possible. Here is a detailed description how to do that. In short: go to Dropbox -> Preferences…, select the Advanced tab and click on Selective Sync… Here untick the directories that you don’t need on your current machine. When you click on Update, these directories will be removed from your local Dropbox folder but they remain on the server, so there is no need to worry. They are simply not synced with the current machine.
However, you may notice that after Dropbox has removed these directories, you still don’t have more free space :( Well, the dropbox client put the deleted files in the cache… Here is how to empty the cache. In short: stop the client, delete the content of the cache folder (but leave the cache folder itself), restart the client.
I had problems installing Ubuntu 12.04 on my Dell Latitude D410 laptop. As it turned out it was because of the b43 wifi card. But let’s see the story step by step.
First, I couldn’t install the system from the normal install CD. The boot process simply stopped. So I downloaded the alternate CD. The installation went fine but when I rebooted the machine, it froze again… WTF? I got the following error message:
[ xx.xxxx] b43-phy0 ERROR: firmware file "b43/ucode5.fw" not found [ xx.xxxx] b43-phy0 ERROR: firmware file "b43-open/ucode5.fw" not found [ xx.xxxx] b43-phy0 ERROR: You must go to http://wireless.kernel.org [snip] read all the instructions on this website.
OK, so the firmware of the wifi card is missing. Let’s disable the wifi then. The following line should be added to
Here is how I did it: start the system with a 11.10 live CD (which doesn’t freeze), mount the root partition of the laptop, then modify the
After reboot, the system didn’t freeze but, obviously, I had no wifi. Connecting a cable, I could install the following package:
sudo apt-get install firmware-b43-installer
blacklist.conf again and enable b43 (put that line in comment). After restart I had wifi.
This entry is based on Sándor Norbert’s post on Incremental average calculation.
I have a large list with very large numbers and I want to calculate their average. However, I’m afraid there would be an overflow while summing up the elements.
The traditional average computation first calculates the sum of the elements and then this sum is divided by the number of elements. However, the average can be calculated incrementally too, i.e. you take the 1st element and you calculate its average, then take the 2nd element and update the average, and so on. When you process the last element, you have the average of the whole list. Let’s see it mathematically.
The algorithm in Python:
def inc_avg(li): """Calculate the average incrementally. Input: a list. Output: average of the list.""" left = 0 right = len(li)-1 avg = li[left] left += 1 while left <= right: curr = left + 1 avg += (li[left] - avg) / float(curr) left += 1 return avg
TODO: compare the runtime of plain average with this incremental solution.