Sunday, March 28, 2010

Wikipedia green thread article

Wikipedia's green thread article states that most Smalltalk dialects implement green threads. Why is the term most used for the assertion? Don't all Smalltalk dialects implement green threads?

Upper bound problem

Consider a loop that sums the first p - 1 odd integers modulo p (thus enumerating the quadratic residues modulo p). For each odd integer, an internal counter is incremented, and then the modulo p operation is applied. For example, for p = 19, the first five internal counter values will be 1, 4, 9, and 16. The next value will be 25, which will be mapped into 6 when seen modulo 19 (hence 6 is a quadratic residue modulo 19).

What is the maximum value the internal counter can reach before the modulo operation?

Speaking of section 6.2

Sometimes the most humble of problems turns out to be a rich field for exploration. How about this one? Find the fastest way to implement atAllPut:, for large array receivers. Surely this cannot be that hard, right? But no, it really is tricky.

Curious? Don't take my word for it: run the experiments and see what happens!

Sunday, March 21, 2010

Fundamentals section 6.2 done

I just finished section 6.2 of Fundamentals' second volume. The draft page count is 82. Next up, section 6.3 on thread safety.

You know, when I began writing this chapter, I was concerned I wouldn't have enough material to write something interesting. I wasn't really excited about it, and I just wanted to get through it as quickly as possible so I'd get to chapter 7 (which is about recursion). And yet, here I am, having a lot of fun, not even half done with chapter 6, and it's 50 pages long already.

If this pattern continues, I may have to split off chapter 9 (about optimization) into a third volume...

Assessments 1.36

I just fixed a bug where some check repository instances could be dropped if they failed to perform their setup actions before running the tests. The result of this bug was a spurious error in the results. Enjoy!

Friday, March 19, 2010

Fundamentals update

The draft is now 72 pages long. I am about to finish a small section on how to fill a sequenceable collection efficiently. After that, still in chapter 6, comes interprocess collaboration schemes and more enumeration material. Moving along...

Friday, March 05, 2010

Assessments 1.35

SUnit test cases can assume resources will be shut down in the reverse order in which they were started. Fix Assessments to mimick this behavior.

Wednesday, March 03, 2010

Assessments 1.34

This version fixes a subtle problem. Assessments would stop SUnit resources before starting them for bulletproofing purposes. However, I just found a resource written to stop only after tests run, because the #reset method does not worry about whether instances of the resource exist. This causes a problem because the reset action damages other resources that are necessary for tests to run. Consequently, do not stop resources before starting them.

fMRI discoveries much less than sometimes hyped to be

Every so often, I find articles along the lines of "fMRI proves that area of the brain X is involved in activity Y". But, is that the case? How do we know that area X is processing activity Y directly? Couldn't it be the case that area X is processing something else triggered by activity Y, while merely 3 neurons process activity Y? We are not aware of all our brain is doing, how can we claim there is nothing else going on other than activity Y?

The main issue here is that all we see is activity. We do not know what the activity represents because we do not know how the brain encodes what is going on. Essentially, what we can perceive is ciphered conversations between neurons. From the traffic, we would like to infer the meaning of the traffic. But we can't do that with full confidence without breaking the code.

I actually verified this point of view with a neuroscience expert. And yes indeed, all we really have is correlations illustrated by nice fMRI graphics. Maybe not all experts think the same. And yet, although correlation is better than guessing, it's most likely still far away from proving (and supporting the hyped) causality.