Archives 2005 - 2019    Search

Adjuvanten skurken bakom narkolepsi efter vaccinering mot svininfluensa?

published Feb 23, 2012 05:34   by admin ( last modified Feb 23, 2012 05:34 )

Ett antal människor i bl a Sverige och Finland har fått narkolepsi efter vaccinering mot svininfluensa. Om man läser mediebevakningen om detta så finns det i stort sett inte- i alla fall i det jag läst - någon analys eller spekulation om vad det är i vaccinet som kan ha medverkat till narkolepsin.

Det vore väldigt illa om folkopinionen vände sig mot vaccin i största allmänhet då de gör stor nytta med i stort sett inga biverkningar.

För de svenska doserna hade man inte nog med vaccin i form av avdödade virus. Man har då använt ett tillsatsmedel - en adjuvant - i varje dos, för att reta immunförsvaret.

Adjuvanten retar immunförsvaret i största allmänhet såvitt jag begriper dess funktion, och det tycker jag låter som en hemskt dålig idé att göra, eftersom många av våra svåraste sjukdomar just är autoimmuna. Min spekulation är att problemet finns just här.

Adjuvanten som använts tror jag är hajolja.

 


Linux editor for selecting and saving short clips

published Feb 23, 2012 01:48   by admin ( last modified Feb 23, 2012 01:48 )

I have found a new favorite for this task. It is called AviDemux. However if you just import a video file with incomplete frames with key frames in between, you cannot scrub properly, since AviDemux does not convert the film to have only key frames. Having incomplete frames that are re-created on playback is a common technique to save storage space. Scrubbing will jump between the key frames, at least for the file formats I have tried.

You can solve that by using ffmpeg to add key frames so every frame becomes a key frame, before you open the video in AviDemux.

For e.g. an flv file you can do it like this:

ffmpeg -keyint_min 0 -i video.flv video_all_keyframes.flv

 

Before finding AviDeMux. the LIVES video editor was the best one I had found for extracting short video clips from a video.


 

My use case was extracting individual moves from salsa dance performances. I have now tried four Linux based video editors for this. The other two I have tested are cinelerra and PiTiVi.

My needs were very well defined. I want to watch through a video and extract short sequences that illustrate different dance moves.

 

Scrubbing

Moving back and forth through a video by dragging the pointer sideways, turning a wheel or something similar is called scrubbing.


Link - globstar - for making "**" work a bit like find in bash

published Feb 19, 2012 06:42   by admin ( last modified Feb 19, 2012 06:42 )

 

With globstar set, bash recurses all the directories. Note that this will recurse all directory levels, not just one level. You can see if globstar is set by issuing the shopt command without any arguments:



Read more: Globstar: New Bash Globbing Option | Linux Journal


Link - using a chain of bash commands as a temporary file

published Feb 18, 2012 12:41   by admin ( last modified Feb 18, 2012 12:41 )

Might come in handy one day.

For fun, you can see the temporary file created by the process: dir <( sort A | tr [:lower:] [:upper:] ) lr-x------ 1 crash daily 64 Mar 5 23:17 /dev/fd/63 -> pipe:[21483501]



Read more: Diff two stdout streams « crashingdaily


What computer languages are the most succinct?

published Feb 18, 2012 01:29   by admin ( last modified Feb 18, 2012 01:29 )

I did not understand how the form worked at the below site (see comments below), so the static page linked to shows plots for a number of computer languages with regards to speed and compactness.

If you draw a line from left to right in it, sloping, you can make out Javascript, Pascal and Fortran as the winners in the size/speed trade off, given the criteria and scaling used.

However the language that seems to have the smallest sizes for complexity performed, is Ruby. I better take a look at that.

From concise at the left to less-concise at the right, from slower at the top to faster at the bottom.



Read more: Code-used Time-used Shapes | Computer Language Benchmarks Game

 


Länk - Aktivt ljuddämpande hörlurar

published Feb 16, 2012 11:55   by admin ( last modified Feb 16, 2012 11:55 )

Eller noise cancelling headphones som de säger på engelska. David Pogue anser att pionjären Bose fortfarande är bäst:

Even they can’t touch the Bose ($300) for noise cancellation, though. Bose’s technology is still a couple of years ahead of the competition.



Read more: Finding Headphones to Shut Out the World - State of the Art - NYTimes.com


Link - Thrift, a way to make things work across different languages

published Feb 14, 2012 04:10   by admin ( last modified Feb 14, 2012 04:10 )


Computer languages, that is.

Thrift allows you to define data types and service interfaces in a simple definition file. Taking that file as input, the compiler generates code to be used to easily build RPC clients and servers that communicate seamlessly across programming languages



Read more: Apache Thrift


Link - Well written article on Tumblr's system

published Feb 14, 2012 04:06   by admin ( last modified Feb 14, 2012 04:06 )

 

Tumblr Architecture - 15 Billion Page Views a Month and Harder to Scale than Twitter



Read more: High Scalability - High Scalability - Tumblr Architecture - 15 Billion Page Views a Month and Harder to Scale than Twitter


How to simply run a script with Windmill browser testing

published Feb 02, 2012 02:53   by admin ( last modified Feb 02, 2012 02:53 )

Summary:

windmill -m test=./tests/test_1.py http://example.com

Windmill allows you to run tests against a web site through real browsers, including using Ajax technology. For example, you can operate a browser and windmills records everything you do as python code, which can the be run again, and altered.

Windmill can be used in large testing frameworks such as niteoweb.windmill (for Plone), but how do you just run a simple script with the code that has been generated by one's browsing about? Well, you canot easily do it from inside of python, down that path lies madness. While skirting madness, I realised that the simple way of running the python code was to have windmill run it for you:

windmill -m test=./tests/test_1.py http://example.com

The "-m" switch tells it to run Firefox. If you forget that switch it will run nothing while executing the code. The test sub command (I call it a sub command since it has no preceding dash) tells windmill where the python script is that was generated by windmill, and lastly the url is given as an argument to windmill. You need to set up a prefs.py file in the ~/.windmill directory (on Linux that is), with the following content:

MOZILLA_BINARY='/usr/bin/firefox'                                                               
MOZILLA_DEFAULT_PROFILE='~/.mozilla/firefox/'

 

Before resigning to runninng windmill from the command line, I tried to run my script it from within python, and here is an excerpt of that non functioning script with some explanations in it, important stuff in bold, using windmill 1.6, python 2.6 on Ubuntu 10.10:

import windmill
from windmill.authoring import setup_module, WindmillTestClient
from windmill.conf import global_settings
import sys

global_settings.START_FIREFOX = True # This makes it use Firefox
setup_module(sys.modules[__name__])

global_settings.TEST_URL ='http://example.com' #This does not work. Instead
# use ~./.windmill/prefs.py and add the line:
# TEST_URL ='http://example.com'
# (without the # in front)
client = WindmillTestClient(__name__)
client.waits.forPageLoad(timeout=u'20000')

client.click(xpath=u"//div[@id='content']/table/tbody/tr[1]/td/a/img")
# Click does not work, according to the debugger it does not exist. MouseUp does.
# Bailing out, avoiding madness

 

 


How to make an mp3 file of a Youtube flv video with aac sound

published Jan 31, 2012 05:27   by admin ( last modified Jan 31, 2012 05:27 )

On Linux, using ffmpeg with lame installed:

ffmpeg -i video.flv -acodec libmp3lame -aq 2 audio.mp3


Rockbox on Sansa Clipp - Why I removed it

published Jan 31, 2012 03:11   by admin ( last modified Jan 31, 2012 03:11 )

 

Summary: Rockbox could not easily access and present my existing playlists. Plus it made USB not work for a while. I reflashed it with stock Sandisk firmware.

 

I decided to install Rockbox on my Sansa Clipp tonight, but after trying it out went back to the factory firmware. Reasons:

Playlists

From what I could see in the user interface in Rockbox on my Sansa Clipp, it expects all playlists to reside in a playlists folder. I have dozens of playlists, manually made in Rhythmbox and more automatically generated from a python script. None of them reside in a playlists folder, yet all are picked up by the Sansa standard firmware. While Rockbox picked up none. It seems you should be able to navigate with the file browser to each playlist, but that is too  much work.

And if I would make new playlists with Rhythmbox, Rhythmbox on my Ubuntu would probably continue to just store them in different places, so even if I converted my old playlists, the problem would remain with new ones.

Text size

The playlists problem above was the deal breaker, but I also did not care for the miniscule fonts in the user interface. Once it's playing you can get very large fonts indeed, through installable themes, but they do not cover the navigation and settings part of the ui. Update: According to "scorche" in the comments section below, there are themes that also cover the navigation and settings. The theme I selected - "FEP" - did not however.

Did not play my aac files

The main reason for installing Rockbox was to see if it could play a couple of aac files that I originally stripped out of Youtube videos. Rockbox did however not find them. This could very well be a problem with the files. Still, Rhythmbox on my Ubuntu computer plays them without problems

No support for the bpm tag

Ok, here I am really stretching when it comes to putting demands on Rockbox. According to its documentation it does not list the TBPM tag in its database. It would have been nice to sort and group on beats per minute. But I guess there is not an overwhelming demand for that feature,

Getting back to stock firmware

I could not uninstall Rockbox through the Rockbox utility, so I went to Sandisk:

http://forums.sandisk.com/t5/Clip-Clip/Sansa-Clip-Firmware-Update-01-02-16/td-p/150227

and followed the instructions.

Funky USB

After having installed Rockbox, and then uninstalled the extras: Mounting the player with USB failed despite rebooting the Clip many times, and when booting into Windows it reported the Clipp as a faulty USB device. I booted into the stock OS by holding the menu button while booting. Switching the Clipp off for a couple of minuted fixed the problem. After that it was in a state where I could reflash it with the stock firmware.


Plone training in London March 27-29, 2012

published Jan 31, 2012 02:42   by admin ( last modified Jan 31, 2012 02:42 )

We will do Plone training in London March 27-29. Same contents as usual, with the addition of Diazo skinning and Dexterity.

We will most likely be at Portman Square (depending a bit on the size of the group).


Link - Introduction to git

published Jan 30, 2012 09:51   by admin ( last modified Jan 30, 2012 09:51 )

To check out later.

Introduction to Git



Read more: Introduction to Git on Vimeo


Länk - Rockbox - nytt OS till ens mediaspelare

published Jan 30, 2012 03:52   by admin ( last modified Jan 30, 2012 03:52 )


Ska kanske prova att få in detta på min lilla mp3-spelare.

Stable ports Rockbox runs well on these players, has a complete manual and is supported by the installer: Apple: iPod 1g through 5.5g, iPod Mini, iPod Nano 1g and iPod Nano 2g Archos: Jukebox 5000, 6000, Studio, Recorder, FM Recorder, Recorder V2 and Ondio Cowon: iAudio X5, X5V, X5L, M5, M5L, M3 and M3L iriver: iHP100 series, H100 series, H300 series and H10 series Olympus: M:Robe 100 Packard Bell: Vibe 500 SanDisk: Sansa c200 (not v2), e200 and e200R series, Fuze, Clip and Clip+ Toshiba: Gigabeat X and F series



Read more: Rockbox - Free Music Player Firmware


Länk - Windmill: "No default or local profile has been set"

published Jan 30, 2012 02:03   by admin ( last modified Jan 30, 2012 02:03 )


This worked for me in  ~/.windmill/prefs.py on Ubuntu 10.10 .

MOZILLA_BINARY='/usr/bin/firefox'
MOZILLA_DEFAULT_PROFILE='~/.mozilla/firefox/'



Read more: #72: FF4 - Exception: No default or local profile has been set. - Issues - windmill/windmill - GitHub


Link - Requests: An alternative to urllib2 in python

published Jan 23, 2012 05:43   by admin ( last modified Jan 23, 2012 05:43 )

Note to self.

Python’s standard urllib2 module provides most of the HTTP capabilities you need, but the API is thoroughly broken. It was built for a different time — and a different web. It requires an enormous amount of work (even method overrides) to perform the simplest of tasks. Things shouldn’t be this way. Not in Python.



Read more: Requests: HTTP for Humans — Requests 0.10.1 documentation


Link - Git over http

published Jan 18, 2012 02:07   by admin ( last modified Jan 18, 2012 02:07 )


This looks very interesting for integrating external authentication sources. It seems to be a CGI script so it does not operate the same way as e.g. subversions's http protocol. I will probably need to install it and check the logs for what the requests will look like. My guess is a combination of path and POST parameters.

I believe this because it’s both efficient and can be run either secure and authenticated (https) or open and unauthenticated (http). It also has the huge advantage that most firewalls have those ports (80 and 443) open already and normal users don’t have to deal with ssh-keygen and the like. Once most clients have updated to at least v1.6.6, http will have a big place in the Git world.



Read more: Pro Git - Smart HTTP Transport


How to make a massive Zope/Plone undo through the web

published Jan 16, 2012 01:03   by admin ( last modified Jan 16, 2012 01:03 )

 

Summary:

http://localhost:8080/manage_UndoForm?PrincipiaUndoBatchSize:int=660

....where 660 should be replaced with the number of transactions you need to go back. Then click like crazy.

 

I had the need to back a Zope site in time several months, October 2011 to be specific.

I had deleted a page (after its due date) for a Plone course December 2011 and kept one for December 2007. I did not, repeat not, want to enter everything that has changed in the contents of that course in between those two dates again. There are backups for the entire system but they are rotated, and I caught this late.

The course page is a compound content type consisting of sub objects for dates, pricing and other things. The missing course page had resided in a folder hierarchy that had also been deleted. The easiest would therefore be to just back the entire server in time, rather than trying to find specific edits to undo.

The undo page in the ZMI batches undoable transactions in lots of 20. My plan was to revert everything back to October 2011 (working on a copy of course). So, 20 transactions is not enough. I need a mega batch! I know there are command line scripts were I can find the byte offset for the date I am interested in and then use truncate, but haven't done it for ages (ok, once in 2002), and can the effect still be achieved from the ZMI? It will be an append but that's OK.

If you look at the "Earlier transactions" and "Later transactions" links, you can see that the start and end transactions are encoded as cgi parameters. The batch size is in other words, not hard coded.  So, if the url for "Later transactions" on the second page is

http://localhost:8080/manage_UndoForm?first_transaction:int=0&last_transaction:int=20&PrincipiaUndoBatchSize:int=20

 

We can just change those numbers. So I clicked through "Earlier transactions" until I reached October, noted where I were in transaction numbers and did something like this:

 

http://localhost:8080/manage_UndoForm?first_transaction:int=0&last_transaction:int=660&PrincipiaUndoBatchSize:int=20

I got a big page and I did a lot of clicking of check boxes, and hit "Undo" - worked like a charm. I then copied over the oh so precious text to the production server.

"PrincipiaUndoBatchSize" I did not notice until now, it did not seem to overrule the other numbers; I did not change that one.

Hmmm, must go back and try something.... Yup, this works too:

http://localhost:8080/manage_UndoForm?PrincipiaUndoBatchSize:int=660

 


How to force a disk check on next restart on Ubuntu

published Jan 12, 2012 01:03   by admin ( last modified Jan 12, 2012 01:03 )

sudo shutdown -rF now

-or-

make a file in the root ("/") directory called forcefsck

Tested on Ubuntu 10.10 .

I had to forcefully shut down a laptop today, and when it came back to life it did not seem all that well. Sometimes Ubuntu starts a spontaneous disk check but it had no such intentions this time. I could not do a "live" disk check since the disk was mounted and fsck sternly warned that I *will* destroy things if I continue. Well then, how to direct it to do it on next boot?

There are at least two ways of doing this: By issuing a restart from the command line with shutdown command, where in addition to the restart flag one also issues a Force disk check. Or by creating a temporary file that Ubuntu reads as a kind of flag on boot and then deletes.


Länk - Python på Android

published Jan 09, 2012 06:17   by admin ( last modified Jan 09, 2012 06:17 )

 

Turn your python application to an Android APK - Build your own python and extension



Read more: kivy/python-for-android - GitHub