Skip to content. | Skip to navigation

Personal tools
Log in
You are here: Home - Blog

Desirable characters not (easily found) on my keyboard

Posted by admin |

Yes, I sometimes use my blog as a paste board! :)

en dash (tankstreck)

em dash (jättelångt tankstreck)




| |

Non breaking space (between the pipes)



Sep 28, 2017 05:20

The amount of work needed to listen to a Youtube video...

Posted by admin |

...on your Android phone is daunting. It doesn't work with the Youtube app since it cuts out when it is not in the foreground. I have now on my destop made an mp3 and hope I can put that back on the phone, so I can listen to the lecture! If I can find an mp3 player that plays in the background. Which did not seem to be installed on my Nexus. If it is, it's hiding.

And how do you move files to and from your Andorid phone in a sane way? The USB tether does not show all files if there are many files in a directory. Google drive back and forth across the world? Ridiculous, I'll tell ya.

And it does not play in my bluetooth headset! I'm pushing into 20 minutes of work now. To listen to one file that was already there to begin with. And Firefox also stops playing it.

It turns out that my Plantronics one-ear headset does not support the AD2P profile, so I cannot listen to it. Do I need to say ridiculous?

Now listening to the mp3 file, via Google Drive, on tethered headphones.

Sep 23, 2017 09:35

Some reflections on Pippa Malmgren's list of things caused by debt

Posted by admin |

Pippa Malmgren has written a list on LinkedIn: Through the Looking Glass: We've Reversed our Views on Every Civic Value : Why?  on what debt in society may have contributed to. Below are my answers:

Restraint was good and excess was bad. Now excess inspires – witness the Kardashians and the gold fixtures throughout Trump Tower.

Excess used to be more marketable when mass communication ruled. With mass communication everything becomes idealized: The strongest, the most beautiful, the most lavish (Kim Veltman has written on this, although I cannot find the exact paper now). Internet tempers this. For one example, note people's preference for e.g. amateur porn.

Careers were good. Job hopping was bad. Loyalty to firms is considered crazy now because they are not loyal to you (because the debt means they have to cut costs). Now job hopping is good because you get to spread the risk that you’ll be hurt by any one of your employers.

Debt actually delays a transformation of the economy. If debt would be correctly taken care of, job hopping caused by restructuring would increase tremendously as a consequence.

Truth was good. Lying was bad. Now we live in a "post truth" world where we admire crafty wordsmithing, weaponization of words, clever messaging. We know the names of the previously anonymous spin crafters these days.

This is largely a consequence of communists shifting tactics to "post modernism", basically attacking anything that is constructive, in hopes of diminishing the center and getting a stand off (street fights) with the extreme right. As to why communism remains popular, it probably has to do with the promise of IYIs being bosses in a brand new world. Many intellectuals are acutely uncomfortable with pluralism, markets. They want to feel in control and think people are taking them for a ride with free markets, freedom of speech and so on. The reason commies remain influential is due to Taleb's minority rule. Specifically they are more coherent and focused.

Traditional religion was good and alternative religions were suspect. Now alternative religions gain followers and adherence to any one established local religion is considered a mark of small mindedness. People search for truth in the self-help section of the bookstore.

Religions go through rejuvenations every now and again. Organized religion can sometime lose track of its message and will need some competition.

Savings was good. Now Spending is "good": The Financial Crisis (and its inflation invoking solutions) punished savers and encouraged us to borrow given low interest rates. Debt is so good that governments tell us you can fix the debt problem by adding more debt and by endlessly postponing its repayment.

Yeah, seems about right!

Mainstream Media was trusted. Now clickbaiting plus political bias has caused us to trust Wikileaks and alternative news sources more.     

This is caused by the Internet, not by debt.

Thoughtful, measured responses used to be good (think Bertrand Russell). Now, no one has time to listen and they cannot understand or agree on the meaning of the words. Twitter beats Editorials. Soundbites beat nuanced explanations.

Question is, how many listened to Russell back in the day? It's a bit like musing over how good music used to be, but if you actually listened to a recording of what fare was served music-wise, it is clear that most was rubbish. It can be argued that we now have the most intellectual popular culture fare in history.

Experts were good. Idiots were bad. Now Nassim Taleb calls experts “Intellectual Yet Idiots”. We now like to watch reckless idiocy from comics to reality TV to other arenas.  

This is also caused by the transparency, and confusion, of the Internet. 

Torture was bad. Now torture is good (necessary). The Red Cross has found that more and more people now support torture under certain conditions.

This is a combination I think of not having been exposed to war for some time, and being enveloped in reality distortion bubbles of the Internet, not understanding that what goes around, comes around.

Debate was good. Now debate is bad. Opposing views must be silenced, not entertained. Free Speech was good. Now, Free Speech is bad. The view that "Speech should only be free if we agree with it" gains prevalence.

This is a worrying trend and may be linked to debt insofar as it belies a world view where trying things is not safe. And, post modernism of course.

Marriage was Good. Promiscuity was Bad. We are shocked by marriages that last and admire those who succeed in the promiscuous life and who have multiple marriages. We treat people as disposable items that you simply swipe right for and counsel people to try and have sex without attachment. The media not only condones this but provides detailed explanations to under-age children (witness the outcry over the Teen Vogue Guide to Anal Sex).

This has a lot to do with the liberation of women (marriage benefits men more than women, it seems so women are progressively less keen on it), but may also be caused by debt insofar that the debt society creates an unequal society with worrying interpersonal power dynamics.

Being an individual with self-confidence was good and admirable. Now, being an individual is only good and admirable if enough others confirm it through social soring. Self-confidence is suspect. We admire those who are “liked” and who have many “followers”.

This is caused by the Internet and its ability to give more power to some, both through these people having greater abilities but also due to a network effect. The network effect was already in place and much stronger, during the age of mass communication though.

Learning was Good. Now Learning is bad. Instead, we admire clever “hacks” and shortcuts that don’t waste time because knowledge is easy/ not hard

This is caused by post modernism, and debt could actually come to think of it be a post modern phenomenon!

Scoring people was bad. Now scoring people is good. Scoring a person on attractiveness or “hotness” was bad. Now we like high scoring people and entities - the Facebook effect. China’s new Social Credit Scoring system (an Uber for people) is announced almost without comment.

Again, the network effect, but now we can do the scoring ourselves instead of e.g. the BBC saying who is "hot".

Reading was good. TV was bad. Reading is now seen as a rare, time consuming, seemingly not necessary pastime. Instead, TV now (Netflix) has the best writing and pay scale in the entertainment industry and we admire free YouTubers and Instagrammers

People read immensely on the Internet. And they write!

Spying was Bad. Now, spying is good. After 911, spying was transformed. Instead of aiming at bad individuals, state intelligence aims their efforts at everybody (good or bad) in the hope of catching somebody bad (Prism, Echelon).

It's actually gone the other way, spying is now bad due to campaigns from e.g. Wikileaks. However spying capacity has increased massively, due to a faulty application of technology. Not sure what societal forces to blame there.

Science was good. Now, science is bad. Are scientists willfully trying to make holes in the universe with quantum efforts (thinks of CERN and DWave) or in DNA with the genome? With the advent of AI and robotics, everyone worries about whether robots and AI science will help or hurt us. Note the many warnings from prominent scientists like Stephen Hawking and Elon Musk about unleashing uncontrollable forces.

Biotech is very worrying, with or without debt: Self replicating invasive species.

Technology was Good. Now, technology can be bad.Your IPhone was supposed to make life easier. Now it is your life, which is good and bad.

Improperly applied technology, again unsure of what to blame.

Multilateral was good and bilateralism was bad. Now, this has reversed.

This may be a sign of almost apocalyptic changes, the feeling that most will lose out massively and you have to save yourself. It could also be a sign that some areas of the world are economically important and others not. Not sure about this one. However debt could distort the usefulness you have of multilateralism, maybe.

Price stability was good and inflation was bad. Now we hope for moving prices and desire more inflation.

Yup, the central banks may be in the process of blurring the concept of money. It's now more like points in a computer game. Very post modern.

Sep 22, 2017 01:20

Orson Welles talks about the time he got some help from Winston Churchill

Posted by admin |

Orson Welles talks about the time he got some help from Winston Churchill (~3 minutes long)

Sep 13, 2017 10:31

How to do a diff on a word/character basis rather than on a line basis

Posted by admin |

How to do a diff on a word/character basis rather than on a line basis

Use git's diff like so:

git diff --word-diff=color --word-diff-regex=. file1 file2


From command line - Using 'diff' (or anything else) to get character-level diff between text files - Stack Overflow

Sep 13, 2017 02:28

Starting to understand React.js

Posted by admin |

I've stared at React.s js a couple of times failing to understand it, but this time I think I've got it. Info in this post may change and will be expanded.

So, let's look at one of the code examples of React.js:

class Timer extends React.Component {
  constructor(props) {
    this.state = {secondsElapsed: 0};

  tick() {
    this.setState((prevState) => ({
      secondsElapsed: prevState.secondsElapsed + 1

  componentDidMount() {
    this.interval = setInterval(() => this.tick(), 1000);

  componentWillUnmount() {

  render() {
    return (
      <div>Seconds Elapsed: {this.state.secondsElapsed}</div>

ReactDOM.render(<Timer />, mountNode);

What we're dealing with above is a class definition. It can be instantiated as an object with this HTML-like construct:

ReactDOM.render(<Timer />, mountNode);

That is not proper javascript but something called JSX: Introducing JSX - React.

This snippet  instantiates the Timer class into an object and attaches the object to a DOM. As can be seen, no quotes are needed around the angle brackets. It could have had initialization parameters, in which case it would look like this:

ReactDOM.render(<Timer foo_"baz" bar="garbl"/>, mountNode);

Looking back at the class definition, we can see that methods are just written as barewords with a trailing bracket for method arguments, followed by curly brackets for the method body. "this" refers to what would be called "self" in e.g. python. There is no "def", "function or "fun" preceding the method name. Ok, looking closer this is actually ES 6 classes: Classes - JavaScript | MDN.

  componentWillUnmount() {


A number of methods are special:

Object methods

  • render()
  • constructor(props) - initializes the object on object creation
  • componentWillMount() - event handler
  • componentDidMount() - event handler
  • componentWillReceiveProps(nextProps) - event handler
  • shouldComponentUpdate(nextProps, nextState) - status handler
  • componentWillUpdate(nextProps, nextState) - event handler
  • componentDidUpdate(prevProps, prevState) - event handler
  • componentWillUnmount() - event handler
  • setState(updater, [callback]) - mutator, the updater argument is a function, the callback will be executed after the new state has de facto been set, which may happen asynchronously
  • component.forceUpdate(callback)

Class properties

  • defaultProps
  • displayName

Instance Properties

  • props
  • state

For reference, see here: React.Component - React

If we look at the code example where setState is involved:

  tick() {
    this.setState((prevState) => ({
      secondsElapsed: prevState.secondsElapsed + 1

It may first look like prevState is an object being passed into this.setState and where would that come from? But it isn't, because that would be:


...instead what we are looking at is passing in an anonymous function to setState:

    this.setState((prevState) => ({
      secondsElapsed: prevState.secondsElapsed + 1

...where prevState is simply a placeholder for the first argument that the anonymous function will be called with. In fact you could have it as:

  tick() {
    this.setState((foo) => ({
      secondsElapsed: foo.secondsElapsed + 1



Sep 12, 2017 12:10

Timothy Snyder: Europe, its past and what is its future?

Posted by admin |

Snyder points out at the end that even if the EU is a great answer to problems of European history, it has not been that articulate about its future Timothy Snyder - Nations, Empires, Unions: European Integration and Disintegration Since 1914 - YouTube

This comes at the end, the whole talk which is from Oslo in 2014, is a great journey through the topic as defined in the talk's title.

Sep 10, 2017 01:02

Ubuntu 17.04 crashing hard - disable Chrome hardware acceleration

Posted by admin |

Today my Ubuntu 17.04 crashed hard a couple of times. Even the cursor wouldn't move. After having restarted (again) I used journalctl on the command line, to view what were the messages from the previous boot.

journalctl -b -1

(You need to have journalctl configured to save log messages from previous boots, for this to work)

The very last message was in red and said:

RIP: gen8_ppgtt_alloc_page_directories.isra.38+0x115/0x250 [i915] RSP: ffffb88ac3aab880

I'm not initimately familar with the log severity codes, but RIP sounds likes it's Rest In Peace which might be a bit late in the chain for diagnostics. But there was a message also in red a bit higher up that began with:

kernel: BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
kernel: IP: gen8_ppgtt_alloc_page_directories.isra.38+0x115/0x250 [i915]

I googled that and found some ideas, one being to disable hardware acceleration in Google Chrome, since that seemed to trigger the bug. It seems to work!

See: Bug #1680904 “zesty unable to handle kernel NULL pointer derefer...” : Bugs : linux package : Ubuntu

Aug 20, 2017 05:50

How the extreme left turned to race in order to get rid of the center of politics

Posted by admin |

The left has always had a problem demarcating to the extreme left. Although they all agree that communism was bad, they seem to have this lingering suspicion that maybe it was good, but just had a bit of bad luck. See for example the recent spate of articles in the New York Times (one example).

Sometimes the leftists' often reasonable actions and views, get hijacked by the extreme left and get tweaked into insanity, and then beamed back at the left.

But the left never, not even the extreme left, ever went for racism. Socialism and even communism is inherently anti-racist. In fact commies see all human individuals as replaceable, so race doesn't make sense. The left could argue for women, for workers, but it would not argue for race. After all the Soviet Union defeated the racist nazis, and although the Soviet killed massive amounts of their own people, it wasn't officially at least based on the principle that you were killed for your perceived race (I write "perceived" because it wasn't up to you to decide what or who you were; it was foisted upon you.).

However as time has gone by and no revolution in the West has turned up, the extreme leftists came to the conclusion that by focusing on race - the taboo subject - they could very well destabilize society in a quicker and more insidious way. Once the chaos arrives, they reason, they can take power and stamp out that pesky race thing which had then served its purpose. But in the history of communism and chaos, it seems to be a bit of a crap shoot: Sometimes the extreme right instead come out as winners, and go on to destroy civilization and society in their particular way.

By embracing race as a divider, the extreme left hopes to nurture the neo nazis and finally get rid of that pesky middle of the political field. They mimic their enemy, and the epic, final standoff should materialize. Although negative rights are important when working against racism, positive rights can be quite dangerous.

Part of the extreme left's success rests on the latent racism present in our societies. The extreme right most certainly do not need the extreme left to flourish it seems, but it does not mind being cast into a nemesis role. This is a war on the political center, coordinated between communists (turned race baiters) and neo nazis.

The solution is to be resistant to thinking in terms of race. Whenever you're tempted to think in terms of race, think in terms of marginalization and lack of opportunities for individuals, not collectives of a certain race, and watch out for discrimination, racist or otherwise. Resist racism when you see it and call it out. And focus on supplying opportunities and justice, i.e. freedom.

Race is bullshit, individuals are not.


Aug 19, 2017 04:50

Accidentally social entrepreneur

Posted by admin |

Photo from a recent party of ours, © Mikael Ståldal

To be a true entrepreneur, there should be a legacy, something that continues after you quit. It seems I made it, in the unexpected field of sobriety, joy and dancing, of all things.

Five years ago we started monthly sober Saturday night dancing parties in Stockholm. Two weeks ago, after about 60 parties averaging around 150 jolly dancers each, I called it quits.

But the Men Dansa party machine will go on without me. It's cooperative, value driven and supported by many. Here is my thank you note on Facebook:


And come to think of it. I do not own Facebook, but I do own my blog. so here comes a copy of the message in text format:

After five years of Men Dansa parties I have decided to step down and let Men Dansa continue with its current strong lineup of board members, organizers and volunteers. 

And remember, due to the sheer number of motivated people involved, the parties will continue to be just as awesome :)

I took the initiative to and then co-founded Men Dansa with Janne Pettersson and Mikael Ståldal. This is more than five years ago now. We started the Men Dansa as a non profit organisation and decided that Men Dansa should be built on voluntary work, including ourselves: The only one who gets paid is the accountant. If we get a surplus at the end of the year, we donate it. So far it has been to “Cancerfonden” each year. 

Through the years hundreds of volunteers, dozens of organizers and teachers and DJs, and a bunch of board members have helped making the Men Dansa parties the most open, cozy and welcoming Latin dance parties in Stockholm ( in my humble opinion :) ).

We wanted to get new people into the fantastic Latin dance culture where alcohol can not only be absent, but is truly irrelevant, and where drunkenness – given the complexity of the dances we offer – becomes impossible. We wanted to give a solid alcohol free Saturday night alternative to hanging out at drinking places.

Me stepping down is not due to any conflict, it’s rather that I think that we have a really strong lineup of organizers and members of the board, so I feel that I can leave and the show will go on. This will be a very managed handover. In fact I have tried to wind down my participation for some time!

There are so many people I would like to thank: The board and organizers warrant a special mention. You guys – past and present – are ultimately the guys that define the organization. In my experience the volunteers at these passionate dance parties, the organizers, dance teachers, DJs, and all the people who have handled the door & the food – in all we are talking of hundreds of people – are some of the nicest people I’ve met. I’d like to thank you all for having created such great parties together with me and all our guests!!

Aug 17, 2017 01:10