Archive for category Uncategorized

Convert a DataArray subset taken from a DataFrame to an multidimensional Array in Julia

julia> using RDatasets

julia> iris = dataset(“datasets”,”iris”)
julia> X = array(iris[:,1:4])
150×4 Array{Float64,2}:
5.1 3.5 1.4 0.2
4.9 3.0 1.4 0.2
4.7 3.2 1.3 0.2
4.6 3.1 1.5 0.2
5.0 3.6 1.4 0.2
5.4 3.9 1.7 0.4
4.6 3.4 1.4 0.3
5.0 3.4 1.5 0.2
4.4 2.9 1.4 0.2
4.9 3.1 1.5 0.1
5.4 3.7 1.5 0.2
4.8 3.4 1.6 0.2
4.8 3.0 1.4 0.1
4.3 3.0 1.1 0.1
?
6.3 3.4 5.6 2.4
6.4 3.1 5.5 1.8
6.0 3.0 4.8 1.8
6.9 3.1 5.4 2.1
6.7 3.1 5.6 2.4
6.9 3.1 5.1 2.3
5.8 2.7 5.1 1.9
6.8 3.2 5.9 2.3
6.7 3.3 5.7 2.5
6.7 3.0 5.2 2.3
6.3 2.5 5.0 1.9
6.5 3.0 5.2 2.0
6.2 3.4 5.4 2.3
5.9 3.0 5.1 1.8

Released Tellstick OpenHAB hacks on Github

I have done some small hacks to get tellstick events that are not picked up by the openHAB tellstick binding into openHAB. This is done by a python script that sends REST requests to openHAB to notify of changes in these devices. It can be any device that is not picked up by the tellstick binding but are picked up by the Tellstick Duo. It’s a ugly hack, but it does the job for me at the moment, hopefully one day it will not be needed. Anyway it is here:

Tellstick Openhab hack on Github

Enjoy!

Mac OS X X11 continously keeps craching

If some program requests to start X11 and X11 does not work you can end up in the situation that X11 keeps crashing even though you press “Quit”. This is due to X11 (and friends) are launched from “lunchctl”. To stop this use:


launchctl list

This gives you a set of jobs under “launchctl’s” command. You want to remove the “org.x.startx” job. This is done with:


launchctl remove org.x.startx

X11 should now stop keep crashing… :)

Bank ID på Mac OX Mavericks

Detta funkade 2014-01-14 (Mac OS X Mavericks 10.9.1, BankId 4.19.4, Safari 7.0.1)

Med Safari, ladda ner BankId från Skandiabanken
Passordet som man ska mata in i BankId applikationen för Certifikatet (BankID) på fil måste ha minst 12 tecken, varav minst en siffra och minst fyra bokstäver.
Dubbelkolla att det blir ett giltigt “Valid to”.

Nu kan man logga in på Förskräpningskassan.

Puckat nog kan den skapa en BankId token UTAN ett giligt “Valid To” som ligger i Bank ID appen (och ser ok ut om man inte kollar på ValidTo), men den går inte att använda. När man försöker logga in på t.ex. Förskräpningskassan eller Skandiabanken med BankId som bara har ett Certifikat utan giltigt “Valid To” så är Drop Down rutan för “Certificate” ut-gråad och man kan inte skriva in passord.

Screen Shot 2014-01-14 at 11.22.56

Mörkläggning med Hemtex Öljettlängd

Vi har äntligen hittat en mörkläggningskompromiss som både jag och sambon kan enas om. Med våra gamla fönster samt kraven att det skall stå blommor i dom och åverkan på utsidan var utesluten så var det inte så lätt att hitta någon lösning för vårt “filmtittarrum” (“biorum” är en lite för generös beskrivning av rummet).

Vi bestämde oss för att prova Hemtext mörkläggningsgardin “Öljettlängd”. Här är resultatet före mörkläggning.

Observera att mörkläggningsgardinerna döljs bakom dom vanliga gardinerna när dom inte används.

Efter mörkläggning.

Bilden har underexponerats för att visa den upplevda ljusmängden i rummet. Vi har fortfarande ett fönster med persienner, nedan kan man se en jämförelse mellan ljusinsläppet på persiennerna och mörkläggningsgardinerna.

Det är inte en perfekt lösning för ett biorum men vi är väldigt nöjda med resultatet.

Tags: , ,

David Barber releases Bayesian Reasoning and Machine Learning

http://web4.cs.ucl.ac.uk/staff/D.Barber/pmwiki/pmwiki.php?n=Brml.HomePage

Emacsibilia

From the (X)Emacs Manual:

There are commands for placing point and the mark around a textual object such as a word, list, paragraph or page.

M-@
Set mark after end of next word (mark-word). This command and the following one do not move point.
C-M-@
Set mark after end of next Lisp expression (mark-sexp).
M-h
Put region around current paragraph (mark-paragraph).
C-M-h
Put region around current Lisp defun (mark-defun).
C-x h
Put region around entire buffer (mark-whole-buffer).
C-x C-p
Put region around current page (mark-page).

M-@ (mark-word) puts the mark at the end of the next word, while C-M-@ (mark-sexp) puts it at the end of the next Lisp expression. These characters sometimes save you some typing.

My comments:

Repeated M-@ extends the region forwards.

M-x describe-bindings
Lists all keybindings

Tags:

Creating PDF vector graphics on Windows using almost only free tools

When writing papers you want your graphics to be in vector format to maintain a high quality of the images. Unfortunately there are not too many good tools within a resonable budget to create vector graphics on Windows so this is how I do it…

It is a bit roundabout, but here goes…

Download and install PDFCreator.

Download Briss: Briss. Place it wherever. Briss is used for cropping PDF’s if you don’t need to crop, you don’t need Briss.

Both are excellent free tools.

Create your graphics in Microsoft Powerpoint, which is actually pretty good a that as these things goes.
Print your slide using PDFCreator as your printer. PDFCreator is polite enough to embedd the fonts in the PDF, this is a good thing.

Update: Microsoft Powerpoint 2011 (and above I assume) now has “Save as..” PDF, this may also work, in this case PDFCreator is not nessecary any more.

Often I need to crop away white edges. Start Briss and load the file, mark the region you want to keep and Crop.

Now the pdf is ready to be imported in Latex for your authoring pleasure!

Mining of Massive Datasets

Found a little gem called “Mining of Massive Datasets” from Jeffrey D. Ullman of “Dragon Book” fame.
The PDF version of the book is downloadable from.

http://infolab.stanford.edu/~ullman/mmds.html

I find it to be a very good read!

Some Comments on the Turtle Beach PX5 wireless headphones

Background:

I wanted a set of wireless headphones for work which where Bluetooth capable (to connect to my iPhone) to listen to music when working in an open landscape, which I find distracting when people are talking all around.

The Good:

The mic. allows for handling calls without having to switch headsets.

Quite light with a nice build feel to them eventhough they are a bit “plastic”.

Good Bluetooth performance, no problems connecting/reconnecting to the iPhone.

The not soo good:

The builtin equalizer presets does not apply when listening to music over Bluetooth.

No Audio/Video Remote Control Profile (AVRCP), which means you have to fiddle with the phone to change tracks, pause/play and not through controls on the headset.

Audio leakage, I find that they leak fairly much risking to disturb your landscape neighbours.

Sometimes there are some initial audio drop-outs which seem to be Bluetooth connection “stabilizing”, but after a few seconds it is up and running and there are no further problems.

No re-chargable batteries.

Summary:

The PX5 is clearly marketed as “Gamer Headsets”, for which I think alot of my issues are non-issues. In retrospect the PX5 was not perfectly suited for my use-case.

Tags: