Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home

jorgenmodin.net - Blog

Blocka Granzyme B och få ung hy

Forskarna letade egentligen efter något som håller blodkärl unga men de hittade något som verkar hålla huden ung: Att blockera ett enzym som kallas Gramzyme B på engelska. Labbråttor behöll en ungdomlig hud även efter simulering av solljusbelastning.

 

“We have generated natural and synthetic inhibitors of this enzyme, and one can easily see the application for this after excessive sun exposure ... or in other cosmetics as well,” he said. “That’s obviously the first thing that comes to mind.”


Read more: Link - 'One of those moments that we live for in science': UBC researchers may have stumbled upon the secret to youthful skin

Dec 17, 2014 03:25

Why people seem risk aversive when gaining, and risk seeking when losing

I listened to a very good Security Keynote by Bruce Schneier where he mentions an experiment where people prefer getting $1000 with certainty before having a 50% chance of getting $2000, while at the same time they prefer to lose $2000 at a 50% chance before losing $1000 with certainty.

The strange thing, it is said, is that people seem to be risk averse for gains, and risk seeking for losses.

However, if you simply see people's valuation of money as non-linear, the paradox goes away: It does not hurt twice as much to lose $2000, and it doesn't make you twice as happy to gain $2000. Hence the behavior of most humans is rational.

One can see it as humans valuing the status quo, since they have built a cognitive framework around it, and any deviations from it will mean a re-planning. Getting extra resources will only force you to re-plan if the amount is significant, hence higher rewards have less value. Even a small loss will trigger re-planning and a big loss will do the same.
There might be more to the Kahneman and Tversky work, but as presented by Schneier, non linearity is enough to explain the behavior.

One very important result of Kahneman and Tversky work is demonstrating that people's attitudes toward risks concerning gains may be quite different from their attitudes toward risks concerning losses. For example, when given a choice between getting $1000 with certainty or having a 50% chance of getting $2500 they may well choose the certain $1000 in preference to the uncertain chance of getting $2500 even though the mathematical expectation of the uncertain option is $1250. This is a perfectly reasonable attitude that is described as risk-aversion. But Kahneman and Tversky found that the same people when confronted with a certain loss of $1000 versus a 50% chance of no loss or a $2500 loss do often choose the risky alternative. This is called risk-seeking behavior. This is not necessarily irrational but it is important for analysts to recognize the asymmetry of human choices.


Read more: Link - Kahneman and Tversky's Prospect Theory

Dec 15, 2014 11:15

Getting Android Studio to work on Ubuntu 14.04

This pertains to Android Studio build AI-135.1538390 (at least).

The SDK Manager | Android Developers  was not included in the install, but gets downloaded and installed when you create a new project.

If you simply start by importing a project, as I did, the SDK Manager does not get installed, and there will be no Android menu item under the Tools menu. So start with a new project, even if you do not intend to create one.

Dec 13, 2014 10:14

Mouse integration with terminal multiplexers

Untested by me. Supposed to work with byobu, an alternative to screen and tmux (and is in fact based on them).

 

Yes, this is very much possible. You simply need to turn on mouse support in your ~/.byobu/.tmux.conf configuration
set -g mouse-select-pane on
set -g mouse-select-window on
set -g mouse-resize-pane on
set -g mouse-utf8 on


 

Read more: Link - Can I use mouse click to focus on Byobu splits? - Ask Ubuntu

 

tmux and mouse mode - Dan Lowe

Tools I use: Tmux

 

 

Dec 13, 2014 12:05

Det där om vad Löfven egentligen sa om nyval

Sveriges journalister tycks eniga om att Stefan Löfven har lovat dyrt och heligt att utlysa nyval. Men Löfven avslutade sitt tal den 3 december om nyval med att säga ungefär:

"Skulle det mot förmodan vara så att något eller några partier vill diskutera den uppkomna situationen så vet de var jag finns"

 

(07:43 i videon här: http://www.expressen.se/nyheter/stefan-lofven-utlyser-nyval-i-mars-2015/)

Han öppnar alltså upp för en förhandlingslösning. Men den lösningen finns nu inte, därför att alla journalister (vad jag kan se) har bestämt att Löfven dyrt och heligt lovat att utlysa nyval. Och eftersom fler människor läser vad journalisterna skrivit än lyssnat på vad ha egentligen sagt, så skulle Löfven nu framstå som att han bryter sitt ord om nu tar en förhandlingslösning.

Det innebär att journalisterna i någon mening driver politik. Varför gör de det? Jag tror bara att de bara bestämt sig för en story och sedan synkar så att alla skriver likadant. Och det känns lite kymigt.

Dec 04, 2014 03:55

SvD har också problem med sanningen i rubrikerna

På SvD:s framsida på webben kan man läsa:

"Högutbildade flyr från USA och Europa "

När man sedan klickar igenom till artikeln står det följande:
 

Enligt studien valde fyra av tio ur denna grupp Europa när de år 2000 skulle flytta mellan länder. Den andelen har sjunkit till 37 procent.

(min fetstil). För det första: Att några procent färre väljer Europa som destination att åka till för att jobba innebär inte att högutbildade flyr från Europa. För det andra: Från "fyra av tio" till 37% är inte signifikant på något sätt. Faktum är att om man ska uttrycka 37% som något heltal av tio så blir det ju "fyra av tio".

Det har alltid funnits tidningar vars rubriker mest påminner om den där arbetskamraten vid fikabordet som är mytoman, och som bara påstår saker rakt ut utan någon känsla för om det är sant eller inte. Nu se rman mer och mer av dessa rubriker även i morgontidningar, och det innebär väl att det s k medielandskapet ändras. Jag undrar var man ska få vederhäftig information från i framtiden.
 

Read more: Link - USA och Europa förlorarna när högutbildade väljer land | SvD

Nov 30, 2014 07:11

Livestrong.com on microwaving frozen spinach

If you google "microwave frozen spinach" the two top results are currently from Livestrong.com. The top result says:

"When it comes time to eat, the easiest way to cook frozen spinach, and the best way to preserve its nutritional value, is in your microwave oven."

(my boldface)

However, the second result from Livestrong.com says:

"Don't microwave frozen spinach; the microwave can blanch the nutrients out of the vegetable."

Well someone is wrong on the Internet! The question is who...

Nov 23, 2014 04:46

A websockets to websockets gateway in 20 lines of javascript

I needed to connect a python websockets client to a password protected websockets server written in the go language and running over SSL.

However I couldn't get the python libraries (ws4py, autobahn, twisted) connections to be accepted by the server, so I wrote a websockets to websockets gateway in javascript, or rather I just cobbled it together from example scripts. It connects and authenticates to the go server, tellls that server what kind of channel it is interested in, and broadcasts that to any clients connected to the javascript process. It runs under node.js. The server is called "wss" below and the client "ws":

var WebSocketServer = require('ws').Server;
var fs = require('fs');
var WebSocket = require('ws');

wss = new WebSocketServer({
    port: 8080
});

wss.broadcast = function(data) {
    for (var i in this.clients)
        this.clients[i].send(data);
};
// Load the certificate for the TLS connection
var cert = fs.readFileSync('rpc.cert');
var user = "user";
var password = "a password";

// Initiate the websocket connection.  The certificate is self signed
var ws = new WebSocket('wss://localhost:18344/ws', {
    headers: {
        'Authorization': 'Basic ' + new Buffer(user + ':' + password).toString('base64')
    },
    cert: cert,
    ca: [cert]
});
ws.on('open', function() {
    console.log('CONNECTED');
    ws.send('{"jsonrpc":"1.0","id":"0","method":"notifynewtransactions","params":[true]}');
});
ws.on('message', function(data, flags) {
    wss.broadcast(data);

});
ws.on('error', function(derp) {
    console.log('ERROR:' + derp);
})
ws.on('close', function(data) {
    console.log('DISCONNECTED');
})

Maybe some more tweaking could have got the python code to talk directly to the go server, but sometimes you just have to do the solution for which you can estimate the time it will take for it to be in working order.

Nov 11, 2014 09:55

The state of writing asynchronous code in python

Python is a language with the ambition that there should be one and only one obvious way of doing things. With regards to asynchronous programming that ambition is not fulfilled currently. As an example, the reactive ReactiveX/RxPY library for python lists no fewer than 6 different ways of doing asynchronous programming in python (from the ReactiveX/RxPY documentation):

RxPY also comes with batteries included, and has a number of Python specific mainloop schedulers to make it easier for you to use RxPY with your favorite Python framework.

  • AsyncIOScheduler for use with AsyncIO. (Python 3.4 only).
  • IOLoopScheduler for use with Tornado IOLoop. See the autocomplete and konamicode examples for howto use RxPY with your Tonado application.
  • GEventScheduler for use with GEvent. (Python 2.7 only).
  • TwistedScheduler for use with Twisted.
  • TkinterScheduler for use with Tkinter. See the timeflies example for howto use RxPY with your Tkinter application.
  • PyGameScheduler for use with PyGame. See the chess example for howto use RxPY with your PyGame application.

You could probably list more of them, e.g. Gtk.

Javascript on the other hand has asynchronous operation built right in. Currently 1-0 for javascript versus python in this regard.

Nov 11, 2014 09:43

Make absolute symlinks for sites-enabled in Nginx

When symlinking virtual host files from sites-available to sites-enabled, it seems you need to be careful of how that symlink actually points to its target.

When I used relative paths nginx did not seem to be able to pick up on the target file. The default file in sites-enabled is a symlink with a full path.

Nov 11, 2014 09:40