Posts | Comments

Archive for March, 2006

So, my CPU fan died on me today. Luckily I knew something was up as my computer sounded a little like a horny rhino and I’d been wondering why for quite awhile. So, I shut things down, consulted my knowledgeable buddy Brian about what could be the cause, and then went out and got a new one.

After I put the new fan in, I decided that it was about time I got a CPU temperature monitor applet set up in Gnome. I’ve always been concerned with the temperature inside my case, but I’ve never really gotten to the point where I’ve actually looked into it. I knew the sensors were there, because the BIOS has a hardware monitor page which displays all kinds of stuff. (And that is also where I noted that the CPU was reaching to and beyond 100 °F, which I considered a little high — and Bri agreed. And if Bri agrees, Truth hath been revealed.)

So I poked about a bit, and found lm-sensors. It was scary at first, and I thought I had to grok config files, but then I discovered the sensors-detect tool, which is kind of like a command-line guide that probes for various sensors and modifies the configuration file for you.

Joy and such. So I rebooted (due to modules being inserted and all that jazz) and then it all worked perfectly. The sensors-applet from apt showed my CPU temperature perfectly. It’s currently sitting at 29 °C which is miles better than the nearly 50 °C it was at before.

What?

Contributor License Agreements — or CLA’s — are a fairly new phenomenon in the Open Source world. IANAL, but I am going to make an attempt to explain what a CLA is, and why it is necessary today, where it previously was not.

The most commonly used CLA is that of the Apache Software Foundation (ASF), and the purpose appears right at the top of the agreement:

In order to clarify the intellectual property license granted with Contributions from any person or entity, the Foundation must have a Contributor License Agreement (”CLA”) on file that has been signed by each Contributor, indicating agreement to the license terms below.

The agreement continues to in great detail explain that the person signing the document must both be the author (or hold rights or permission by the author), and be the copyright owner of the contributions they are planning on making to the project in question. It is clarified that the rights to use the contributions will always and forever remain with the contributor, and that the CLA simply extends this right to the project as well.

In other words, if you submit stolen code, you are breaking the CLA, but if you refrain from such follery, nothing’s changed. You’re still the copyright owner of your submissions, but you grant the other party these rights as well. Simple enough.

In the past, this has been a presumed agreement between the involved parties. If I help you out and patch up your code to make it run better, or submit documentation that makes your code more useful, or whatever, you and I both presume that I didn’t steal the code from someplace and handed it to you in evil. This presumption is no longer enough, for good or worse.

Why?

CLA’s became necessary as a direct effect of the SCO vs. Linux court case(s), which, summarized, are about: “SCO claims a bunch of contributors to the Linux source code stole that code without permission from SCO, and that thus, SCO is now the owner of Linux and may at their whim request that all users of Linux pay a royalty fee.” Pretty scary, huh? Be that as it may, the court negotiations are as of this writing ongoing, but things are looking bad for SCO (for what it’s worth).

But regardless, SCO’s claim was a bucket of cold water in the face of the many maintainers of and contributors to various Open Source projects out there, as a legal matter was suddenly making things a tad more complicated. What if someone helps you out and gives you a bunch of really good, professional code, and what if that code is ripped out of some commercial, copyrighted very-much-not-open-sourced product somewhere? How would you know? How could you possibly know?

A quick Google search on “contributor license agreement” shows 1.6 million hits. Obviously, a great deal of Open Source maintainers and organizations do care, and CLA’s are obviously the answer to this legal matter.

In the end, I think the majority of those who’ve followed the SCO vs Linux court case agree that it is exclusively a matter of halting the progress of the rapidly evolving Open Source world. Microsoft, the father of FUD, assuredly caught onto the dick-grip SCO had on Linux in particular and Open Source in general, and decided to sponsor SCO by handing $12 million dollars to SCO, “to purchase UNIX-type licenses so Microsoft customers can run UNIX-type applications” (this was in the year of 2005, and was reported by Business Week). In the end, though, did SCO win? Have they hampered the development of Open Source software?

In my uneducated opinion, yeah. They have won. They have won a fraction of what they aimed for, but yes, I believe SCO got if not the whole cake, they got a taste of it. But I also believe that what they won, the Open Source movement will ultimately benefit from. Ultimately. Eventually.

From personal experience, I know what a CLA can do to the quantity of contributors. A lot of people feel that they want to help a project out, but when they’re handed a big, scary paper which may be interpreted as giving up the rights to something you give away for free, they hesitate. And rightly so. Everyone should hesitate when prompted to sign legally binding documents; everyone should read the fine print and ensure they know what they’re getting into. But this, naturally, proffers a wholly different stage than the good old “wanna help out? just chuck yer code at me and I’ll eyeball it and if it looks good I’ll plop it into the svn tree, m8″ type of development.

In the long run, though, Linux and Open Source have been children until now, and it’s time to grow up and face the big crowd, and the big crowd usually wields lawyers like children wield wooden swords, and the difference is that more than a few bruises and tears are at stake. That SCO will ultimately lose to Linux I have no doubts of. And in a way, I am grateful that the world will get to see Linux prevail in court over the devil, and I believe companies worldwide will see this as a trigger to examine Open Source alternatives closer, au contraire to the belief that companies will shy away from it, due to its “run-ins with the law.”

I am stuck, one might say, reading the Wheel of Time series by R. Jordan. Well, I can’t really be blamed. I’ve been reading it for 6 or so years, and I’m a junior in comparison to many others. After all, this series is over 16 years old — 16 years, and the story is not finished yet! — and after following it (however dreadful that journey has been at times), it seems Jordan manages to reach new lows in every publishment.

Since the books are released at such low intervals, I read other things in between. One of the books I read recently was “Shoogun”, by James Clavell, and upon returning to the Wheel of Time series again with “The Knife of Dreams”, I can’t help but think of how soulless it is. The content is repeating over and over, the same sentence, the same structured descriptions of how things are, how people behave, how they dress. It’s amazing how intensely repetitive it becomes to read about Sevanna wearing garments that “barely conceal her considerable bosom”, or the other hundreds — yes, hundreds — of standard phrases that permeate the thousands and thousands of pages. That any respectable author allows themself to sink to such levels, to copy-paste their way through volume after thick volume in order to tell a tale is unimaginable.

I can only conclude that R. Jordan does not care for the soul of his text, for it has none. He cares only for the overarching story, for the wholeness of the story, and as such it is in fact quite an accomplishment. But the accomplishment is like a flower ripped from its roots, crumpling and withering for each day and page spent.

I realize that I care more for the soul of a tale, than I care about the tale itself. I cannot read a good story unless it has a soul, unless the author wrote it with the passion that I know R. Jordan lost a long time ago, as he now, together with his assistant, sifts through the many plotlines of his life’s work, trying to wrap it all together before his audience abandons him completely. A person that writes with the intent of not leaving a single word unconsidered, a person that does not allow themself to ramble their way through volume after volume of dead words, that is an author. A real author.

[updated March 20th, to improve the code a bit]
In most lower-level programming languages, debugging functionality exists to allow the programmer to more easily track down bugs that appear in code. One of these functionalities is called “a stack trace” and allows a programmer to pull up the list of functions which were called which lead to some crash or exception in the code. An example of this in Java might look like:

Exception in thread "Thread-2" org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttribute(CoreDocumentImpl.java:572)
at com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttribute(ElementImpl.java:523)
at sserve.DomSynchronizedProtocol.prot_ELA(DomSynchronizedProtocol.java:297)
at sserve.DomSynchronizedProtocol.examine(DomSynchronizedProtocol.java:438)
at sserve.Waiter.handleData(Waiter.java:323)
at sserve.ServerPool.processSocket(ServerPool.java:406)
at sserve.CommService.run(CommService.java:43)
at java.lang.Thread.run(Thread.java:595)

The above may look like soup, but is immensely useful to someone who knows their way around the various classes mentioned in the code. I can for instance tell you that the processSocket function called the handleData function at line 406 in the ServerPool.java file. The handleData function called the examine function, called the prot_ELA function, which in turn called some functions inherent in the Java API used in the code where the exception happened. So I can look at these functions in turn, and hopefully figure out why the exception mentioned happened.

This functionality, the ability to refer to a series of function-calls leading up to erroneous behavior, does not exist in JavaScript, for various reasons. One reason is that JavaScript has not until very recently been considered a language in which such advanced functionality is needed.

I have written a JS class which allows a user to set a “trace_stack” boolean in the code, which semi-automatically injects code into JavaScript functions, enabling a stack trace functionality. This is not useful unless you have several .js files with several classes which interact with each other to some extent.

Personally, whenever I see some (cool) package which enhances my JavaScripts somehow, I am always concerned first and foremost about performance. No matter how immensely helpful a script is to me; if it slows my code down, I don’t want it. I choose effort and efficiency over laziness and inefficiency any day of the week (see now why I do not consider Basic a programming language, as it is built on principles opposite of mine). That said, I have ran some fairly extensive testing on this implementation of mine, and as you might have guessed, the performance (with the trace_stack flag disabled) loss is 0%. That is, your code will run at 100% of its regular speed unless you toggle on the trace_stack flag on, which you will only ever do if you run into bugs anyway. (Which is what it’s there for.)

The script is contained in a single class, called stacktrace, in a single file called stacktrace.js. Admittedly, you will need to do some modifications to your existing code to make it compatible with this class, but the changes are fairly minor. Another matter is that the word “that” has become a reserved keyword in this implementation for reasons that will be obvious if you read on.

Take a look at the class itself here [stacktrace.js].

Presuming you know a bit about how classes are created in JavaScript, let’s see about putting this to use in an example script. How about this [testClass.js]?

A few things of note, before we actually test that script.

  1. that versus this. that is an internal keyword used by the stacktrace to generate code appropriate to the situation, where the two possible situations are a) you want stack trace data, and b) you do not want stack trace data. In the latter case, the stacktrace _reg() function will remove all stacktrace functionality from the base script. In the former case, _reg() will in fact add to the script a bit, by wrapping the function in another function. Thus you can see why there is a performance loss when tracing the stack, so you shouldn’t do this unless you are hunting bugs or unless your code is unstable. Thus, in any function registered with the stacktrace, you need to use that instead of this, in all cases.
  2. Every class constructor (var class = function() { [constructor code] }) must include a line identifying itself to the stack. E.g. var KalleClass = function() { stack.id(this, “KalleClass”); } is enough. Failing to do so will cause your code to crumple and croak whenever you attempt to enable the trace stack, with a bunch of “this._sti has no properties”
  3. The property “_sti” in a class using the stacktrace is reserved. For the record, it stands for “stack trace instance”.
  4. You can choose to exclude functions from the stacktrace registry. It is generally a good idea to exclude functions which do not call other (self-written) functions, as these functions may still present a stack trace and refer the user to “themself” as the final location where an error occured, and it is generally a good idea to include functions which do call other (self-written) functions. Regardless which, there should be no difference in performance when the trace_stack flag is disabled.
  5. By default, stack tracing is enabled via the URL of the web page. For example, if your code is triggered via http://example.com/foo.html, then you would enable stack tracing by going to http://example.com/foo.html?tstack=1.

So, finally, to see this in action, go here [test.html]. View source to see what the HTML looks like if you wish, but you should have a fairly good guess already.

With the trace_flag enabled, the output should look something like this:

--- debug pane ---
debugger initialized...
constructing testClass
stacktrace now knows who we are
created test, instance of testClass
firstFunction called with This is a test!; now gonna call secondFunction.
secondFunction; this is what the stack trace output looks like:
trace:	testClass: firstFunction
trace:		testClass: secondFunction

now I'm calling thirdFunction
thirdFunction; this is the stack trace:
trace:	testClass: firstFunction
trace:		testClass: secondFunction
trace:			testClass: thirdFunction

left thirdFunction; trace =
trace:	testClass: firstFunction
trace:		testClass: secondFunction

left secondFunction; trace =
trace:	testClass: firstFunction

called test.firstFunction('This is a test!')

With the trace_flag disabled, it should look something like this:

--- debug pane ---
debugger initialized...
constructing testClass
stacktrace now knows who we are
created test, instance of testClass
firstFunction called with This is a test!; now gonna call secondFunction.
secondFunction; this is what the stack trace output looks like:
[stack trace not available]
now I'm calling thirdFunction
thirdFunction; this is the stack trace:
[stack trace not available]
left thirdFunction; trace =
[stack trace not available]
left secondFunction; trace =
[stack trace not available]
called test.firstFunction('This is a test!')

To further explain what happens behind the scenes, the source code for the function test.firstFunction will look like this when the trace_stack flag is turned off,

function (somearg) {
dbgprint("firstFunction called with " + somearg + "; now gonna call secondFunction.");
this.secondFunction();
dbgprint("left secondFunction; trace = n" + stack.trace());
}

… and it will look like this, when trace_stack is turned on,

function (a1, a2, a3, a4, a5, a6, a7) {
this._sti.push(this, name);
return this._sti.pop(func(this, a1, a2, a3, a4, a5, a6, a7));
}

As you see, there are some limitations. There can only be 7 arguments to a function registered in the stacktrace, for instance (but this is a simple matter of my own limiting). Future revisions may examine the source for the function and limit the arguments accordingly. The values of this, name, and func are all internal here. func in this case has been modified to include a new initial argument, that, which is handed to it via the this reference in this._sti.pop(func(this, …)).

The only guaranteed performance loss, when the trace_stack flag is disabled, is a slightly longer load time, as the client has to reconstruct all the functions via the stacktrace class. But this is majorily minor and nothing I consider important — I care about runtime performance way more than load time.
Feel free to use this class wherever you want. It’s released under the MPL 1.1/LGPL 2.1.

I am very careful about not posting personal stuff here, but I believe this one has sufficiently “official” value that I’ll make an exception. That said, if either of the parties involved reads it, I am prepared to answer to what is said here in private. Just contact me.

Every time I visit my not-girlfriend’s place, the same thought strikes me. She is Japanese and her room mate is Swedish. She has lived in Sweden for 3 years at this point, and has been dating a Swede for 6 years. Still, I see the subtle errors she makes in “Swedish politeness communication” and it reminds me of the time I spent at my ex girlfriend’s brothers’ place.

I notice it because I am forced to play that game myself. Not forced, really, because it’s instinct to me. I say this and I act that way, because I want to make my presence a comfortable one to the person who doesn’t know me but yet, I am there in their house. It is not a Swedish thing, I believe. It reminded me of my time spent at my ex’ bro’s, because what happened there was unexplainable to me at the time.

Basically, at first all was grand. Everyone was happy about my presence and I was happy to be present. Gradually as time went on, that changed. I may have done a few things I shouldn’t have over time but most certainly not to where it warranted that kind of dislike. Admittedly the family was not entirely normal, but they weren’t absolute freaks either. So what went wrong?

My strong belief is that what went wrong is something that cannot be helped to a person who is not a “native”. I am not American, and so I failed to play that game. I played poker on the chess board. Of course the judges’ll frown. Heck, saying I was disqualified is an understatement.

And it happens again, and it makes me very curious. Of course racism appears in such circumstances. Of course turks are idiots, because they don’t know how to behave. At least not in Sweden. Of course Swedes are idiots, because they don’t know how to behave. At least not in Turkey. Circle closed. Different appearances, unfamiliar facial expressions, unfamiliar tones and rhythms of voices, unfamiliar body expressions, and so on. With a less than great understanding for all these matters, and/or with a pre-existing animosity toward others of a particular (or of all particular) origin, it’s obvious what will happen. It’s helpless, really.

If I hadn’t watched carefully, I would probably not have caught it. In fact, I had to think about it for a long while before I figured out what was happening. It makes me curious if anyone else has experienced or feels the same way or if I’m off in my thinking.

[...] We have gone from the Information Age with uni-directional information into the Participation Age with blogging and many other ways of multi-directional information and collaboration[...]

That’s a cool way of putting it. The Participation Age.

The quote is from a summary of a speech by Simon Phipps from Sun regarding Sun and Open Source, posted on Groklaw.

“A law firm in New Zeeland advises the NZ State Services Commission that the government should be wary of using ‘infectious’ open source software. ‘While the use of open source software has many benefits, it brings with it a number of legal risks not posed by proprietary or commercial software.’”

The man behind that report works for Microsoft. [more]

(I’ve decided to add a new category to my blog, named “FUD”. FUD stands for Fear, Uncertainty, Doubt, and is a thing Microsoft is very good at.)

kallewoof.com is powered by WordPress. Design by Nofie Iman.