Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home

jorgenmodin.net - Blog

When screen info is missing in Ubuntu, install lxrandr

Posted by admin |

At least it is worth trying.

gnome-control-center refused to show any info on connected monitors.

Selection 245
Click to view full-size image…
Size: 3.2 kB

 

So I installed lxrandr, the monitor configuration utility from the LXDE project. It worked like a charm.

Selection 244
Click to view full-size image…
Size: 15.2 kB

It also worked for multiple monitors.

Oct 16, 2017 09:15

3 reasons for independence/insulation/secession & how to handle them

Posted by admin |

Catalonia wants independence, the UK has voted for Brexit and the United States under Trump wants to break up free trade agreements and "bring jobs back home". I believe one can see three different reasons for wanting to have independence, or wanting to secede or insulate oneself.

1) Being oppressed - if you cannot speak your language or cannot conduct business and other societal functions in line with your old traditions and customs, or if your religion is suppressed, then you may qualify for being oppressed.

The solution here is to liberalise society so that people can speak and worship what they want. If EU regulations lack in this respect, they must be revisited and improved, so that freedom prevails. A trickier take on this is if you are a minority within an oppressed area. Gaining independence may not necessarily be good for you. There are also demographic trends over time, such as in Singapore and Kosovo.

2) A large part of the population feel they are losing out to free trade and freedom of movement. This is what fueled Brexit and got Trump elected. The solution here is to keep the majority of the population happy.

If the discontent is due to immigration, you may eventually need to dial back on it. Free trade is so important that we do not want that jeopardized in the process! You will need to bring people into a structure that gives them leadership and hope. The best way to do that is to deregulate and make entrepreneurship do its work, and lots of training. If that is not an option, you may need to make a left turn and get people into jobs that way. But it cannot be ignored when it tips 50% discontent, for obvious democratic reasons.

3) A rich region does not want to pay for the poorer parts. This has been discussed in connection with Catalonia and also in Northern Italy.

The solution is to allow regions to "divorce", but they will have to pay alimony. In the EU the EU could set that sum. We do not want too many regions to gain independence, since it would risk a crumbling of the EU into nation states, which would then be somewhat of vassal states of the U.S., Russia and China. We do not want the development since it may be unstable, and wars may erupt depending on the power dynamics of the great powers. Russia is also not strong enough to play this in the long run, so the nation state scenario is inherently unstable.

Oct 04, 2017 10:50

Desirable characters not (easily found) on my keyboard

Posted by admin |

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

 

arrow

ellipsis

 

| |

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 | Comments (1)

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)

https://www.youtube.com/watch?v=TpqwY7QL7r8

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) {
    super(props);
    this.state = {secondsElapsed: 0};
  }

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

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

  componentWillUnmount() {
    clearInterval(this.interval);
  }

  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() {
    clearInterval(this.interval);
  }

 

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:

this.setState(prevState)

...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