Links for 2016-06-20

Links for 2016-06-01

Links for 2014-07-26

A case study in internet celebrity.”

But I think the general premise holds, and that the article itself is full of logic fallacies.

E.g. the “Lump of labor fallacy” does not apply to necessary work, which supplies elementary necessities for living, e.g. water, food and accommodation, for which most people have to work nonetheless.

Also there is no need for explicit coordination of a “ruling class”. Acting on their own interest of people with financial and political means creates a “ruling class” by itself, and a filter that mainly allows people with similar ideas to raise to that position.

Disgusting practices in the music industry.

more ...

Links for 2014-07-19

Very good explanation why we don’t live in a post-industrial utopia, but productivity is wasted on uninteresting and unimportant jobs.

At the point of writing, people have pledged over 61000$. WTF? I guess publicity (and kickstarter success) is correlated more with being exotic than with quality. On the other hand it is a great comment on the crowdfunding culture. :p

I wouldn’t have thought that there actually is a great difference. Interesting.

Ich werde dazu noch eventuell einen laengeren Beitrag schreiben.

more ...

Links for 2014-07-04

Links for 2014-06-15

Posts are now signed

My posts on this site are now signed. You can find a gpg-block in the source code of the page. Pass it to gpg, and you get the markdown used for generating the site and check the signiture, if you have my GPG key installed.

Thanks to Merovius for the neat jekyll plugin achieving this!

more ...

How to open a Asus N750JV laptop and change the hard disk

WARNING: You will void your guarantee. I had to send in the laptop because the keyboard stopped working. Asus declined the guarantee request, because the harddrive was changed and the laptop was opened.

This tutorial describes how to open your Asus N750JV and replace the hard disks. If you need to replace another part, at least the opening part should apply.

As the Asus N550JV is quite similar, judging from the specs, to the N750JV it might work for it too, but I haven’t checked it. Please leave a comment, if you have one.

You need a size 5 Torx and a medium sized Phillips screw driver.

On the backside remove all 14(!) Torx screws. You then can remove the cover carefully.

The notebook contains two drive bays, one on the left and one on the right. Depending on the type of your laptop one or both have already a drive inside. You should already have made a backup of the drive you want to change; if not, you should do it now. :p

If you only have one drive, the bay on the left is empty. We will use that as an example below, the other one can be removed the same way.

Remove the four silver Philips screws holding the bay in place and pull it out using the black strap.

If the bay already contains a drive, carefully remove the connector by pulling on it.

If the bay is empty, there is a rubber placeholder on one side. Remove it.

Place the new 2.5” drive in the bay, so that screw holes on the sides line up with the holes in the drive. the connector should face to the side, where two holes are present in the screw latch.

In the packaging of the laptop four screws are taped inside. Take them out and screw them into the side of the bay, fixating the hard disk.

Connect the hard disk connector to the hard disk and but the bay back in. Align the screw holes at the bottom of laptop and put the Phillips screws back in.

Make sure you haven’t left anything in the laptop that doesn’t belong there and all cables line up correctly. Esp. the speaker cable can easily be pinched in.

Put the bottom lid of the laptop back and make sure everythink fits. Than put the torx screws back in. (You might want to wait until you’ve checked that the laptop recognizes the drive, so you don’t have to unscrew them again; or screw in only a few first. Just be careful while rotating the laptop without screws holding the lid)

If everything was done correctly, your laptop should boot, recognizing the new drive.

more ...

How to re-add the Twitter sidebar in Octopress

The octopress developers removed the twitter sidebar in march, as I just discovered, as I was upgrading my opctopress installation.

To restore it you basically have to create a custom aside file and include a widget created on the Twitter website.

This blogpost describes how to do it.

I’m not sure yet if I’ll restore it, as it loads javascript and content from Twitter without the visitors consent.

more ...

Disqus enabled

Although I despise external webservices (e.g. because of privacy and reliability problems) I’ll activate octopress’s disqus feature for now.

more ...

Python pitfall with mutable default parameters

We stumbled upon an unexpected way default parameters work while writing python code for our current game project.

In Python you can specify a default value for a function parameter, which is used when the function is called with less parameters than the function needs.

>>> def printHello(text="Hello World!"):
...  print text
>>> printHello()
Hello World!

In python strings are immutable, that means you can’t change it after creation. When you for example concatenate two strings a new one is created, so there is no way to change the default parameter string.

But what happens if you use an empty list as the default parameter? I expected to always get an empty list.

So the following function should always print the same.

>>> def append_one(values=[]):
...   values.append("One")
...   print values
>>> append_one()
>>> append_one()
['One', 'One']

What happens here?

A list is mutable, that means you can add or change elements in the list. And you get passed the same list instance each time on a call to append_one, as variables are passed by reference in python. So this behaviour is actually not that surprising. The same is the case for each other mutable class you pass as a default argument.

But how can you use a mutable object?

There are several ways, but I like the following.

Instead of passing the object directly, we pass None and check for it in the function.

>>> def append_one(values=None):
...     values = values or []
...     values.append("One")
...     print values
>>> append_one()
>>> append_one()
>>> append_one(['Zero'])
['Zero', 'One']

We also used the compact or notation, see the Python documentation for how that works.

Edit: There is also a good post on stackoverflow answering why it was done this way.

more ...