Gestalt Shift
Wednesday, July 3, 2013
Tuesday, July 2, 2013
Pytables/Numpy: lesson learned
Today's PyTables/NumPy lesson that I learned the hard way (i.e. through time
wasted): When you use the
__getitem__
method from a PyTables
Table, and you pass an integer, you don't get back a record array. You get back
the same thing as if you pass an integer to the __getitem__
method
of a record array - namely a numpy.void
instance, which is used
presumably because NumPy doesn't know what to call whatever you have stashed
together in one record.
Labels:
Brain Sputter,
numpy,
programming,
pytables,
python,
Quantity,
Today I learned
Monday, July 1, 2013
Discussions and the power of language
Recently, I have followed the Armikrog
Kickstarter campaign. Doug TenNapel, one of the guys behind the project, and the
creator of Earthworm Jim and Neverhood, among other things, is against gay
marriage. He also did an interview where he said some things that admittedly
could have been said better.
I am going to do a defense of Doug here, because in cases like this I almost always root for the underdog. And even if I myself am a Christian, I hope that anyone who reads this will consider the merit of what I say in its own right. My whole experience with this Kickstarter campaign and the discussions that have been surrounding it have been the catalysts of this post, but the points are actually things that I have been thinking for a while, and should largely be applicable to the wider world. I will try as hard as I can not to step on any toes, but to say what I think is right.
Yet another caveat before I start: I do realize this is a tough issue for many homosexuals. I realize that there are whole lives of oppression, judgement and ostracizing involved in the issue. And perhaps the situation is too young to have stabilized, and it's too much to expect the discussion to not bound into the irrational when there are so many feelings involved. However, it seems to me there is a tendency now that those who have been oppressed for their sexual orientation now are gaining legitimacy and with it, more power. And anyone who has power has a responsibility to use that power in a good way. What I'm going to try here is to point out tendencies towards this not being the case.
The first thing that springs to mind is how abused language can get sometimes. I am in particular thinking of the term 'Homophobe' - a word packed with meaning, in a small bundle. It's not clear exactly what it's supposed to mean. First of all, I resent putting '-phobe' or '-phobia' at the end of words unless they're actually referring to a psychological disorder. Using the word in this way almost invariably is a way to discredit your opposition without rational argument, and nothing is more infuriating than getting discredited irrationally. One might even say that people who use such terms have a 'discussiophobia' - a (irrational) fear of rational discussion. But I digress. The point is, calling someone a homophobe when you know nothing about their motivations or beliefs is incredibly respectless (for more on what those motivations or beliefs could be, see below). To me, the term 'homophobe' is so full of meaning that it is meaningless. It cannot be brought into a discussion in the hopes of continuing in a rational manner.
Another meaningful but meaningless word is 'hate speech'. What in the world is that supposed to mean? If you say you hate gay people, or something that is synonymous, then yes, you're engaging in hate speech. But usually that's not when it is being used. Many of Doug's statements are being labelled as 'hate speech', although nothing of what he says condones hating gay people or promotes hating them (unless you consider being against gay marriage to be synonymous to hating gay people. But then, I think you need to look up the word 'hate' in some kind of dictionary.)
The second thing is how important context is. In the abovementioned interview, Doug and the interviewer had been chatting for a long while, in an informal style (if I remember correctly). He then said some remarks about gay marriage and he used some poor analogies to illustrate his point. I agree that he should have thought twice about using those analogies specifically. However. The way those things were taken out of context and quoted in various social media and gamer articles, etc. was pathetic. Any article that purports to write more than five sentences on the topic really should include at least the immediate context. Without it, it becomes a screamfest where those with the best quotes win.
The third thing is the comparisons of homosexuality to things like paedophilia, incest, zoophilia, etc: In some discussions about homosexuality, some of these other kinds of philias will be mentioned, and usually it results in massive chastise from everyone (at least the pro-gay people involved in the discussion), since "you cannot compare homosexuality with [insert some philia here] - they're totally different".
However. Usually the person who's bringing up this other philia isn't really comparing homosexuality to other philias. In the discussions I have seen, it's usually a matter of trying to take the statement "Homosexuality is on the same footing as heterosexuality" (or some paraphrasing of this statement) to its logical conclusion: Usually this statement is accompanied by 'because two people are in love, and that's all that matters'. And the point is then: Ok, let's try to apply this logic. Until homosexuality was accepted, used to be that 'all that mattered' was that 'two people of the opposite sex are in love'. However, there are several other implied restrictions. I'll try to exhaust the restrictions in the following sentence: "All that matters is that exactly two individuals of the species Homo Sapiens that are not closely related and whose age is no less than 16 that are alive and of the opposite sex are in love". So why are we removing the 'of the opposite sex' clause if we're not willing to remove any of the others? You could say that because the same sex clause is the only clause that wouldn't hurt someone. But this is blatantly false. You could for instance imagine allowing siblings that have undergone sterilization to get married - noone would get hurt. You could allow someone to marry someone else post-mortem as long as the person who died signed a contract saying it was his or her will. You could imagine an animal not being hurt by being married to a person. You could allow more than two persons to marry.
I really take issue with the "if you're against gay marriage, you're a homophobe" logic. It's a black and white logic that belongs in some kind of fascist state, but not in a democracy with free speech. If you're against gay marriage, you're against the concept of two people of the same sex going through the ritual we call marriage. That's it. Now, the reasons behind such a stance are varied, and some people probably are what some other people could legitimately call homophobes (or at least homo-dislikers) - as in, they don't like people who are homosexual, period. However, most other people, even those who are against gay marriage, get along fine with people who are homosexual, and don't hate those. In fact, I want to stop using the word "hate" here, because it's a really strong term and usually the feelings that are associated with this cannot be well described by this word.
So what reasons can people have for being against gay marriage that are not related to an irrational hatred towards homosexuals? Some people think it's just 'wrong'. That is, somewhere in their gut, there is a feeling of wrongness about the concept of homosexuality, and they're not particularly inclined to suffocate that feeling. And then you might say "Well, those people are the same kind of people who thought interracial marriage was a bad thing, and they were clearly wrong!"
Well, no. They weren't "clearly wrong", because there are no criteria upon which to base a verdict of correctness, unless you demand that everyone should be a consequentialist - that is, racial intermarriage has had no significant negative consequences, and lots of positive ones, so it must be the right thing to do. And being a consequentialist is totally fine, but there must be room for other types of ethics as well. Some people base their ethics system upon how they feel about some issue. And saying that only consequentialists are allowed opinions on some matter is inherently undemocratic, so such people must be allowed their say as well. Then there is another set of ethics, coming from the religious sphere. And this is more critical, in my mind. Especially when it comes to allowing in-church gay marriage, or even forcing churches to marry gay people, I can see why people would react. The point in that case is this:
And then the most cited answer is that Jesus told us to love one another, and so when two people are in love, we should sanctify it. Now, I'm not claiming to know what God wants, so I'm not going to say that people who think that God wants us to sanctify homosexuality are wrong. But I will point out that this particular line of reasoning is clearly wrong.
The main thing to say is that there are several kinds of 'love' talked about in the Bible. Usually, what Jesus and the apostles are talking about is 'agape', unconditional love, and that which is to be strived for by all Christians - as in love for your neighbor. The 'love' that we're talking about in the context of marriage is usually affectionate and erotic love, which is something else. Admittedly, the Church has done its part in confusing these terms, since we usually quote some passage by Paul in weddings which talk about the virtues of love - but this is agape, and shouldn't really be used in that context, except to say that you should also love your partner unconditionally as a Christian. Other than that, it has little to do with two people being in love. And this is why you cannot simply say that when two people are in love, God likes it, no matter who they are. Maybe He does, but that's not the point of much of the Bible, at least.
The last thing I can think of that I would like to rid these debates of is the concept that the people who are against gay marriage somehow are on a 'lower plane' of intelligence. Comments such as 'There is no point in discussing further with you, because you're obviously stuck in a prehistoric way of thinking' or the like can sometimes be called for, but more often than not when I see it in use it just serves to give the impression that you have run out of good arguments yourself and use this as a way to invalidate your opponent because of that fact. Admittedly, this is a more general problem, but in the gay marriage debate I more often than not see the proponents of gay marriage assuming that they're somehow more enlightened than their counterparts.
Clearly, I have been defending mostly one part of the debate in this post, and as I mentioned at the beginning, this is because I tend to side with the underdog. However, it is also because I really cannot stand it when a debate revolves around strawmen and misunderstandings that arise because of lack of appreciation of context. Granted, both sides are guilty of this, but as I see it, the pro-gay marriage side at this point is the more powerful part (in the arenas where I tend to be located, at least - I'm not saying that pro-gayism is the majority in the world or anything like that), and so they have more of a responsibility to do their debating properly, as I see it.
I am going to do a defense of Doug here, because in cases like this I almost always root for the underdog. And even if I myself am a Christian, I hope that anyone who reads this will consider the merit of what I say in its own right. My whole experience with this Kickstarter campaign and the discussions that have been surrounding it have been the catalysts of this post, but the points are actually things that I have been thinking for a while, and should largely be applicable to the wider world. I will try as hard as I can not to step on any toes, but to say what I think is right.
Yet another caveat before I start: I do realize this is a tough issue for many homosexuals. I realize that there are whole lives of oppression, judgement and ostracizing involved in the issue. And perhaps the situation is too young to have stabilized, and it's too much to expect the discussion to not bound into the irrational when there are so many feelings involved. However, it seems to me there is a tendency now that those who have been oppressed for their sexual orientation now are gaining legitimacy and with it, more power. And anyone who has power has a responsibility to use that power in a good way. What I'm going to try here is to point out tendencies towards this not being the case.
The first thing that springs to mind is how abused language can get sometimes. I am in particular thinking of the term 'Homophobe' - a word packed with meaning, in a small bundle. It's not clear exactly what it's supposed to mean. First of all, I resent putting '-phobe' or '-phobia' at the end of words unless they're actually referring to a psychological disorder. Using the word in this way almost invariably is a way to discredit your opposition without rational argument, and nothing is more infuriating than getting discredited irrationally. One might even say that people who use such terms have a 'discussiophobia' - a (irrational) fear of rational discussion. But I digress. The point is, calling someone a homophobe when you know nothing about their motivations or beliefs is incredibly respectless (for more on what those motivations or beliefs could be, see below). To me, the term 'homophobe' is so full of meaning that it is meaningless. It cannot be brought into a discussion in the hopes of continuing in a rational manner.
Another meaningful but meaningless word is 'hate speech'. What in the world is that supposed to mean? If you say you hate gay people, or something that is synonymous, then yes, you're engaging in hate speech. But usually that's not when it is being used. Many of Doug's statements are being labelled as 'hate speech', although nothing of what he says condones hating gay people or promotes hating them (unless you consider being against gay marriage to be synonymous to hating gay people. But then, I think you need to look up the word 'hate' in some kind of dictionary.)
The second thing is how important context is. In the abovementioned interview, Doug and the interviewer had been chatting for a long while, in an informal style (if I remember correctly). He then said some remarks about gay marriage and he used some poor analogies to illustrate his point. I agree that he should have thought twice about using those analogies specifically. However. The way those things were taken out of context and quoted in various social media and gamer articles, etc. was pathetic. Any article that purports to write more than five sentences on the topic really should include at least the immediate context. Without it, it becomes a screamfest where those with the best quotes win.
The third thing is the comparisons of homosexuality to things like paedophilia, incest, zoophilia, etc: In some discussions about homosexuality, some of these other kinds of philias will be mentioned, and usually it results in massive chastise from everyone (at least the pro-gay people involved in the discussion), since "you cannot compare homosexuality with [insert some philia here] - they're totally different".
However. Usually the person who's bringing up this other philia isn't really comparing homosexuality to other philias. In the discussions I have seen, it's usually a matter of trying to take the statement "Homosexuality is on the same footing as heterosexuality" (or some paraphrasing of this statement) to its logical conclusion: Usually this statement is accompanied by 'because two people are in love, and that's all that matters'. And the point is then: Ok, let's try to apply this logic. Until homosexuality was accepted, used to be that 'all that mattered' was that 'two people of the opposite sex are in love'. However, there are several other implied restrictions. I'll try to exhaust the restrictions in the following sentence: "All that matters is that exactly two individuals of the species Homo Sapiens that are not closely related and whose age is no less than 16 that are alive and of the opposite sex are in love". So why are we removing the 'of the opposite sex' clause if we're not willing to remove any of the others? You could say that because the same sex clause is the only clause that wouldn't hurt someone. But this is blatantly false. You could for instance imagine allowing siblings that have undergone sterilization to get married - noone would get hurt. You could allow someone to marry someone else post-mortem as long as the person who died signed a contract saying it was his or her will. You could imagine an animal not being hurt by being married to a person. You could allow more than two persons to marry.
I really take issue with the "if you're against gay marriage, you're a homophobe" logic. It's a black and white logic that belongs in some kind of fascist state, but not in a democracy with free speech. If you're against gay marriage, you're against the concept of two people of the same sex going through the ritual we call marriage. That's it. Now, the reasons behind such a stance are varied, and some people probably are what some other people could legitimately call homophobes (or at least homo-dislikers) - as in, they don't like people who are homosexual, period. However, most other people, even those who are against gay marriage, get along fine with people who are homosexual, and don't hate those. In fact, I want to stop using the word "hate" here, because it's a really strong term and usually the feelings that are associated with this cannot be well described by this word.
So what reasons can people have for being against gay marriage that are not related to an irrational hatred towards homosexuals? Some people think it's just 'wrong'. That is, somewhere in their gut, there is a feeling of wrongness about the concept of homosexuality, and they're not particularly inclined to suffocate that feeling. And then you might say "Well, those people are the same kind of people who thought interracial marriage was a bad thing, and they were clearly wrong!"
Well, no. They weren't "clearly wrong", because there are no criteria upon which to base a verdict of correctness, unless you demand that everyone should be a consequentialist - that is, racial intermarriage has had no significant negative consequences, and lots of positive ones, so it must be the right thing to do. And being a consequentialist is totally fine, but there must be room for other types of ethics as well. Some people base their ethics system upon how they feel about some issue. And saying that only consequentialists are allowed opinions on some matter is inherently undemocratic, so such people must be allowed their say as well. Then there is another set of ethics, coming from the religious sphere. And this is more critical, in my mind. Especially when it comes to allowing in-church gay marriage, or even forcing churches to marry gay people, I can see why people would react. The point in that case is this:
- A religious person could believe that the most important thing in the world is to serve God.
- Part of serving God is trying to live as He wishes us to live.
- There are parts of the Bible that indicate He doesn't wish us to live in homosexual relationships
And then the most cited answer is that Jesus told us to love one another, and so when two people are in love, we should sanctify it. Now, I'm not claiming to know what God wants, so I'm not going to say that people who think that God wants us to sanctify homosexuality are wrong. But I will point out that this particular line of reasoning is clearly wrong.
The main thing to say is that there are several kinds of 'love' talked about in the Bible. Usually, what Jesus and the apostles are talking about is 'agape', unconditional love, and that which is to be strived for by all Christians - as in love for your neighbor. The 'love' that we're talking about in the context of marriage is usually affectionate and erotic love, which is something else. Admittedly, the Church has done its part in confusing these terms, since we usually quote some passage by Paul in weddings which talk about the virtues of love - but this is agape, and shouldn't really be used in that context, except to say that you should also love your partner unconditionally as a Christian. Other than that, it has little to do with two people being in love. And this is why you cannot simply say that when two people are in love, God likes it, no matter who they are. Maybe He does, but that's not the point of much of the Bible, at least.
The last thing I can think of that I would like to rid these debates of is the concept that the people who are against gay marriage somehow are on a 'lower plane' of intelligence. Comments such as 'There is no point in discussing further with you, because you're obviously stuck in a prehistoric way of thinking' or the like can sometimes be called for, but more often than not when I see it in use it just serves to give the impression that you have run out of good arguments yourself and use this as a way to invalidate your opponent because of that fact. Admittedly, this is a more general problem, but in the gay marriage debate I more often than not see the proponents of gay marriage assuming that they're somehow more enlightened than their counterparts.
Clearly, I have been defending mostly one part of the debate in this post, and as I mentioned at the beginning, this is because I tend to side with the underdog. However, it is also because I really cannot stand it when a debate revolves around strawmen and misunderstandings that arise because of lack of appreciation of context. Granted, both sides are guilty of this, but as I see it, the pro-gay marriage side at this point is the more powerful part (in the arenas where I tend to be located, at least - I'm not saying that pro-gayism is the majority in the world or anything like that), and so they have more of a responsibility to do their debating properly, as I see it.
Labels:
Christianity,
context,
discussion,
gay marriage,
Quality,
Thoughtful
Friday, June 28, 2013
Shared library writeup: Part 4
I ended last time at saying how the dynamic linker had three main tasks:
Determine and load dependencies, relocate the application and dependencies, and
initialize the application and dependencies, and how the key to speeding up all
of these was to have fewer dependencies in the application.
Now, we're going to look at the relocation process more thorougly. First of all, what's going on? What does 'relocation' mean?
I'm by no means an expert in this, but I'm going to venture an attempt at an explanation: After an ELF object has been compiled, it has an entry point address - in other words, at which memory address the file resides, and if control is transferred to that address, the ELF object will start executing.
However, there are at least a couple of caveats here. First of all: Even if your ELF object has a fixed entry point address, it doesn't mean it will be loaded into actual physical memory at this address. Each process gets its own virtual memory space, which is a mapping from physical memory to a 'platonic' memory space. So the application might get loaded into the entry point address of the virtual memory space, but this address will correspond to another address entirely in physical space.
The second point is that if we're not talking about an executable, but rather a dynamic shared object, as we are here (or rather, we have one executable with a potentially high number of dynamic shared objects that are to be associated with it), the entry point address isn't even the entry point address it will end up with in the final executable - it will get shifted depending on what the linker determines is the best way to combine the addresses of all participating DSOs. This means that all 'internal' addresses in that object will be shifted by the same amount as well. This is what we're currently talking about when we use the term 'relocation'.
So the thing we're going to talk about is how the linker accomplishes this relocation - and especially the part where it has to synchronize all the load addresses, etc. First, it must be noted that there are two types of dependencies a given DSO can have. For one, you can have dependencies that are located within the same object - which I imagine happens when you create an object file with two functions/subroutines and one of them depends on the other - and for another, you can have dependencies that come from a different object.
The first kind of dependency is easy to handle, given that you know the 'new' entry point address of the object in question. For each such dependency, you calculate its relative offset from the entry point, and then simply add this offset to the new entry point.
The second type of dependency resolution is more involved, and I'm going to talk about that more the next time.
Now, we're going to look at the relocation process more thorougly. First of all, what's going on? What does 'relocation' mean?
I'm by no means an expert in this, but I'm going to venture an attempt at an explanation: After an ELF object has been compiled, it has an entry point address - in other words, at which memory address the file resides, and if control is transferred to that address, the ELF object will start executing.
However, there are at least a couple of caveats here. First of all: Even if your ELF object has a fixed entry point address, it doesn't mean it will be loaded into actual physical memory at this address. Each process gets its own virtual memory space, which is a mapping from physical memory to a 'platonic' memory space. So the application might get loaded into the entry point address of the virtual memory space, but this address will correspond to another address entirely in physical space.
The second point is that if we're not talking about an executable, but rather a dynamic shared object, as we are here (or rather, we have one executable with a potentially high number of dynamic shared objects that are to be associated with it), the entry point address isn't even the entry point address it will end up with in the final executable - it will get shifted depending on what the linker determines is the best way to combine the addresses of all participating DSOs. This means that all 'internal' addresses in that object will be shifted by the same amount as well. This is what we're currently talking about when we use the term 'relocation'.
So the thing we're going to talk about is how the linker accomplishes this relocation - and especially the part where it has to synchronize all the load addresses, etc. First, it must be noted that there are two types of dependencies a given DSO can have. For one, you can have dependencies that are located within the same object - which I imagine happens when you create an object file with two functions/subroutines and one of them depends on the other - and for another, you can have dependencies that come from a different object.
The first kind of dependency is easy to handle, given that you know the 'new' entry point address of the object in question. For each such dependency, you calculate its relative offset from the entry point, and then simply add this offset to the new entry point.
The second type of dependency resolution is more involved, and I'm going to talk about that more the next time.
Labels:
ELF,
libraries,
programming,
Quality,
regurgitated information,
Useful
Thursday, June 27, 2013
Multiplying lots of matrices in NumPy
The other day I found myself needing to perform matrix multiplication in Python,
using NumPy. Well, what's the big deal, you say? You do know that there
exists a
Yes, I do know that, you smart internet person you. However, my problem was that I had a number of matrices for which I wanted to perform the same type of matrix multiplication. I had on the order of a hundred thousand five by two matrices that were to be transposed and multiplied with another hundred thousand five by two matrices.
Well, duh, you say. The
So, I had to improvise:
Kind of involved, but it worked. I got the initial idea from here, but the solution given here only works for symmetrical matrices - for non-symmetrical ones you have to shift the newaxis one step to the left, or it will violate the broadcasting rules of NumPy.
dot
method, right?
Yes, I do know that, you smart internet person you. However, my problem was that I had a number of matrices for which I wanted to perform the same type of matrix multiplication. I had on the order of a hundred thousand five by two matrices that were to be transposed and multiplied with another hundred thousand five by two matrices.
Well, duh, you say. The
dot
method can handle more than two
dimensions, you know. Yeah, I know that as well. However, it doesn't handle it
the way I needed for this task. I wanted to end up with a hundred thousand two
by two matrices. Had I used dot
, I would have ended up with a
hundred thousand by two by hundred thousand by two matrix.
So, I had to improvise:
>>> A.shape
(100000, 2, 5)
>>> B.shape
(100000, 2, 5)
>>> result = np.sum(np.swapaxes(A, 1, 2)[:, np.newaxis, :, :] * B[:, :, :,
np.newaxis], 2)
Kind of involved, but it worked. I got the initial idea from here, but the solution given here only works for symmetrical matrices - for non-symmetrical ones you have to shift the newaxis one step to the left, or it will violate the broadcasting rules of NumPy.
Wednesday, June 26, 2013
Super Size Suckage
Well, here's an uncontroversial post. I saw Super Size Me the other day.
And I thought it sucked.
I'm not the first to do so, but that's what I have to say today. So I might as well detail my criticism a bit more, to make it more constructive.
The premise itself is kind of funny, and the main reason I watched it was to see how much weight this guy could gain in a month. Little did I know that this was to be the subject matter of only thirty percent of the movie, whereas the rest... sucked.
My experience based on previous such documentaries (Michael Moore, i'm looking at you) is that when the documentary maker has a very specific axe to grind, you just end up disbelieving everything that is presented, and you're actually trying to find flaws with the presentation. This is what I ended up doing. And the reason was that I very quickly got a lasting impression of the documentary film maker, which can be summed up thusly: "My vegan girlfriend hates McDonalds and I want to make a documentary. Why not kill two birds with one stone?" Seriously, that girlfriend should have been left out of the movie. I cringed everytime she said anything, because it was always about how superior organic and vegan food was. In the end, when she said she would 'cleanse' Morgan's post-experiment system with her special vegan diet, I cringed doubly.
Now, the above was mostly a gut reaction, but it is symptomatic of one of the biggest problems with this movie: It's not clear what in the world it's trying to say.
On the one hand, it seems to say that McDonalds is bad, and that's the take-home message. On the other hand, it seems to say that organic? vegan? food is the best. And then on the third hand, one premise of the movie seems to be that a guy is trying to eat as much fast food as he can for a month and see how that affects his health and well-being.
Then you might say, 'Well, all of these are tied together and they make up one coherent story'. But they don't. First of all, McDonalds being bad is not the same as vegan and organic food being the best. In fact, I think you will find a lot of people who would agree with the former (to some extent) but not to the latter statement. Second of all, you don't prove that McDonalds is bad by EATING TWICE AS MANY CALORIES PER DAY AS RECOMMENDED. That just proves you're bad at cause and effect.
A much better demonstration that eating McDonalds is bad for you would be to eat the recommended number of calories each day, but eating only McDonalds. If he had eaten five thousand calories worth of vegan food each day he would also gain weight.
As for the 'results' of this exercise, they're pretty much worthless as scientific facts towards demonstrating how McDonalds is bad for you. Very few of the changes that happened to his body can be said to be due solely to the fact that he was eating McDonalds and not to the fact that he was eating way too much. And some of them were pretty subjective. "I feel horrible". "My arms are twitching due to all the sugar". How do you know that?? "My sex life went down". Well, when you're binging on McDonalds food and have a vegan girlfriend, what do you expect?
Also, the most interesting result - how fat he got, was pretty underwhelming. He gained around ten kilograms, and I hardly noticed him getting fatter.
Another underwhelming result was how many times he had been asked whether he wanted a super-size menu, which was something he touted in the beginning of the movie. That was presented as one of the 'dramatic post-movie facts', you know - the ones that accompany some picture of whatever illustrates the fact best at the movie's end. He ate ninety times at McDonalds during this month, and was asked about a super-size menu nine times. Out of ninety. That's ten percent. I'm underwhelmed.
In addition to these things, you had the stock-standard Michael Moore-ish strawmen interviews, tying together unrelated facts to make a point, etc. that generally simply helped discredit the maker of the movie.
In short, I wish documentaries like this didn't get so much attention. I want to be on the right side of issues like this, but when the people who are supposedly on the right side use the same dirty tricks as those we claim to be fighting against, the lines get blurred. If what is presented is truly something that we should be shocked and appalled about, the facts will speak for themselves, and we don't need some dude or his vegan girlfriend to mix them together into a milkshake of dubious factual value.
I'm not the first to do so, but that's what I have to say today. So I might as well detail my criticism a bit more, to make it more constructive.
The premise itself is kind of funny, and the main reason I watched it was to see how much weight this guy could gain in a month. Little did I know that this was to be the subject matter of only thirty percent of the movie, whereas the rest... sucked.
My experience based on previous such documentaries (Michael Moore, i'm looking at you) is that when the documentary maker has a very specific axe to grind, you just end up disbelieving everything that is presented, and you're actually trying to find flaws with the presentation. This is what I ended up doing. And the reason was that I very quickly got a lasting impression of the documentary film maker, which can be summed up thusly: "My vegan girlfriend hates McDonalds and I want to make a documentary. Why not kill two birds with one stone?" Seriously, that girlfriend should have been left out of the movie. I cringed everytime she said anything, because it was always about how superior organic and vegan food was. In the end, when she said she would 'cleanse' Morgan's post-experiment system with her special vegan diet, I cringed doubly.
Now, the above was mostly a gut reaction, but it is symptomatic of one of the biggest problems with this movie: It's not clear what in the world it's trying to say.
On the one hand, it seems to say that McDonalds is bad, and that's the take-home message. On the other hand, it seems to say that organic? vegan? food is the best. And then on the third hand, one premise of the movie seems to be that a guy is trying to eat as much fast food as he can for a month and see how that affects his health and well-being.
Then you might say, 'Well, all of these are tied together and they make up one coherent story'. But they don't. First of all, McDonalds being bad is not the same as vegan and organic food being the best. In fact, I think you will find a lot of people who would agree with the former (to some extent) but not to the latter statement. Second of all, you don't prove that McDonalds is bad by EATING TWICE AS MANY CALORIES PER DAY AS RECOMMENDED. That just proves you're bad at cause and effect.
A much better demonstration that eating McDonalds is bad for you would be to eat the recommended number of calories each day, but eating only McDonalds. If he had eaten five thousand calories worth of vegan food each day he would also gain weight.
As for the 'results' of this exercise, they're pretty much worthless as scientific facts towards demonstrating how McDonalds is bad for you. Very few of the changes that happened to his body can be said to be due solely to the fact that he was eating McDonalds and not to the fact that he was eating way too much. And some of them were pretty subjective. "I feel horrible". "My arms are twitching due to all the sugar". How do you know that?? "My sex life went down". Well, when you're binging on McDonalds food and have a vegan girlfriend, what do you expect?
Also, the most interesting result - how fat he got, was pretty underwhelming. He gained around ten kilograms, and I hardly noticed him getting fatter.
Another underwhelming result was how many times he had been asked whether he wanted a super-size menu, which was something he touted in the beginning of the movie. That was presented as one of the 'dramatic post-movie facts', you know - the ones that accompany some picture of whatever illustrates the fact best at the movie's end. He ate ninety times at McDonalds during this month, and was asked about a super-size menu nine times. Out of ninety. That's ten percent. I'm underwhelmed.
In addition to these things, you had the stock-standard Michael Moore-ish strawmen interviews, tying together unrelated facts to make a point, etc. that generally simply helped discredit the maker of the movie.
In short, I wish documentaries like this didn't get so much attention. I want to be on the right side of issues like this, but when the people who are supposedly on the right side use the same dirty tricks as those we claim to be fighting against, the lines get blurred. If what is presented is truly something that we should be shocked and appalled about, the facts will speak for themselves, and we don't need some dude or his vegan girlfriend to mix them together into a milkshake of dubious factual value.
Tuesday, June 25, 2013
Shared library writeup: Part 3
I ended last time by talking about how the dynamic linker had to run before an
ELF file could run. Currently, in other words, the dynamic linker has been
loaded into the memory space of the process that we want to run, and we're going
to run the linker before we can run our actual application.
We cannot run the linker quite yet, however. The linker has to know where it should transfer control to after it has completed whatever it is supposed to do. This is accomplished by the kernel - it puts an auxiliary vector on top of the process' stack. This vector is a name-value array (or in Python terms, a dictionary), and it already contains the values I talked about last time - the
At this point the (dynamic) linker is supposed to do its magic. It has three tasks:
We cannot run the linker quite yet, however. The linker has to know where it should transfer control to after it has completed whatever it is supposed to do. This is accomplished by the kernel - it puts an auxiliary vector on top of the process' stack. This vector is a name-value array (or in Python terms, a dictionary), and it already contains the values I talked about last time - the
PT_INTERP
value which is contained in the
p_offset
field of the ELF program header. In addition to these, a
number of other values are added to the auxiliary vector. The values that can be
added like this are defined in the elf.h
header file, and have the
prefix AT_
. After this vector has been set up, control is finally
transferred to the dynamic linker. The linker's entry point is defined in the
ELF header of the linker, in the e_entry
field.
Trusting the linker
At this point the (dynamic) linker is supposed to do its magic. It has three tasks:
- Determine and load dependencies
- Relocate the application and all dependencies
- Initialize the application and dependencies in the correct order
Labels:
ELF,
libraries,
programming,
Quality,
regurgitated information,
Useful
Subscribe to:
Posts (Atom)