HNHacker News
TopNewBestAskShowJobs

vasi

198 karma · joined March 30, 2009

submissionscomments
vasi··on Mac Apps With Beautiful Interfaces
Filelight has also been doing this in KDE since about 2003. I still think it's slightly easier to use than DaisyDisk, since the labels actually point to the sunburst chart. But DaisyDisk does look much spiffier.
vasi··on Objective-C Memory Management For Lazy People
I think the article vastly overstates its case. Nobody disputes that it's possible to have more-or-less working memory management in ref-counted Objective-C. But it's clearly harder than in a GC language, else it wouldn't need seven pages worth of "simple rules" to explain.

Moreover, the author glosses over many of subtleties of reference-counting. For example, accessors in Java are dead-simple, practically boilerplate. But in Cocoa, what looks like a perfectly reasonable implementation to a newcomer is in fact buggy:

  - setFoo: (id)aFoo {
    [foo release];
    foo = [aFoo retain];
  }
Look closely, and you'll realize that if foo and aFoo are in fact the same object, it will be freed, and foo will have an invalid pointer assigned to it. Pretty much every Cocoa programmer knows about this, but we shouldn't ahve to.

One of the better Cocoa blogs is written by Mike Ash, and he has quite a few posts that illustrate some of these issues. For example, the first half of http://www.mikeash.com/pyblog/friday-qa-2010-12-03-accessors... talks about whether or not accessors should autorelease their return values, with pros and cons for each option. Later on, the money quote: "If you're using garbage collection, this whole question becomes vastly simpler."

Our author here says that "Cyclic object graphs in Objective-C are not a problem. At all." But another post by Mike Ash illustrates that it can be harder to deal with: http://www.mikeash.com/pyblog/friday-qa-2010-04-30-dealing-w... . A great example:

  _myInstanceVar = [[SomeClass alloc] initWithBlock: ^{
    [self doSomething];
  }];
Using 'self' within the block captures it in the closure as a reference, and then the closure itself is referred to by the instance variable of 'self'. This cycle is hard for the coder to notice, and will leak.
vasi··on Great Tower Defense Game on Canvas
Right-clicking seems to unselect a build order.
vasi··on Evilgrade is like Firesheep for Software Updates
It says it supports Adium (Sparkle) updates, but Adium definitely uses digital signatures, see /Applications/Adium.app/Contents/Resources/dsa_pub.pem . So...is there something I'm missing? Has anybody tested this?
vasi··on Eliminating Political Parties (Scott Adams)
In the spirit of evidence-based reasoning, why don't we look at what happens where political parties are absent or weak? This includes the new Afghanistan parliament, Colombia before 2005, Liberia, the Philippines, the Thai senate, and numerous municipal councils. Some of these forbid parties entirely, some discourage them by using electoral systems such as the single non-transferable vote, others simply have a political culture that frowns upon them. A few of the resulting characteristics may indeed be positive: debate is often vigorous, attention is paid to local concerns, and populist movements can rapidly reach power (though some may see that last one as a negative!) Generally, however, there are a number of problems:

What are elections like? First of all, proportional representation is difficult-to-impossible without parties, which eliminates one potentially fruitful type of political reform. Second, without party organizations to provide guidance as to a candidate's political stance, the "personal vote" predominates. This means a candidate needs extremely strong name recognition and personal financial resources: elected members are much more likely to be former entertainment celebrities, business magnates, leaders of ethnic or religious groups, local crime-lords or warlords, or of course incumbents. Another way to get personal recognition is to take credit for local spending, so candidates' campaigns tend to focus on the pork they'll bring if elected.

What about after the elections? Without a strong parliamentary whip, elected members can vote however they want, which sounds great—but it means that every single vote becomes an exercise in pulling teeth. Each member has an interest in acting recalcitrant in order to receive compensation in exchange for their vote. Governing coalitions end up ideologically incoherent, based mostly on which members are most in need of money for local projects. Since there's no ideological basis for government, changes of prime minister/president can happen either extremely often or extremely rarely, depending mostly on whether or not there are enough goodies to be passed around.

All this talk of weakening parties may show a lack of knowledge about the rest of the world. If you look around, you'll see that other nations, and most scholars, consider American political parties to be quite weak. Most countries with healthier political systems have parties that are perhaps smaller than the Democrats and Republicans, but are much stronger in the sense of having control over their elected members and candidates.

I'd argue that in the USA, we should be strengthening parties. Allow party whips to demand discipline from members, expelling those who will not vote with the rest of the party. Once a party wins Congress, they'll have to actually implement their agenda—no more making promises that are impractical or that they know they can't keep, and then blaming recalcitrant party members for preventing the passage of laws. Now, each party contains multiple opposing factions that proclaim incompatible visions. Instead, parties could decide internally what policies to support, and then the dissidents could just deal with it. Or dissidents could go start their own party, and you'd finally have some real diversity of views. Corporate influence could even fall. After all, it's a lot harder to bribe (I mean, uh, "contribute to the campaign of") an entire party to change their votes than to bribe one or two members.

One of the great recent successes of electoral design was in fact a party-strengthening exercise. In the unrecognized pseudo-country of Somaliland, political organization was nearly absent, and the nascent leaders worried that the new democratic system would become corrupt, based on local warlords and ethnic leaders. So first they held municipal elections across the country, and only the three parties with the highest nationwide total vote in these elections would be allowed to run in the subsequent national elections. Voilà! A new, fragile country developed three ideological, non-ethnic political parties; and while there are still serious problems there, the political system is pretty good for that region of the world.

The one issue I haven't really addressed is "what about the Interwebs!?" True, most of my information is from third world countries, where the Internet is not a serious factor. Non-partisan municipal governments in the West also have the problems I listed though, and have not typically been revolutionized by the Internet. But who knows, perhaps Naheed Nenshi's election in Calgary is the vanguard of a wave of social-network-inspired non-partisan renewal, I guess we'll see!

vasi··on Apple to announce OS 10.7 (probably) on October 20
The reason package management works better on Linux is not because there's a better package manager program. Rather, it's because there are hundreds of developers for Debian, Fedora, et al who put serious time into making sure the packages themselves work well. Few OS X users really care about Unixy packages, and even fewer actually work on one of the package managers, so bugs just don't get ironed out enough.

I don't see much Apple is likely to do to help. They could bless a package manager as official, include it in OS X, and pay for build-boxen and for people to work on it; but you'd still need a lot of community involvement, and that's not Apple's cup o' tea.

Apple could also just make a few things easier about building nix packages: Currently the OS X linker will automagically look for libraries in /usr/lib and /usr/local/lib by default, this should become easier to turn off so that packages don't end up with hidden dependencies on stuff the user threw in /usr/local. * A lot of libraries that are extremely common on other nix aren't included in OS X, eg: readline, iconv, gettext. But many of these are GPL3, so don't count on Apple being helpful. Universal, backwards-compatible binaries are currently a PITA to build from the command-line. You need to specify the SDK, DEPLOYMENT_TARGET, and compiler separately; and then if you ended up using different SDKs for different architectures, you need to use lipo to combine the results. Some way to specify all this stuff at once, and use sensible defaults would be great: 'gcc --sdk=ppc/gcc-4.0/10.4 --sdk=x86_64/clang/10.6 ...'

vasi··on Apple to announce OS 10.7 (probably) on October 20
Not faceBOOK, faceTIME.
vasi··on IE 8 is the new IE 6
How about half the population of China? http://gs.statcounter.com/#browser_version-CN-monthly-200909... Plus folks at many organizations with conservative IT policies.
vasi··on Testing, the Chinese Way
Sounds interesting, do you happen to know if any Kahl is in translation? A quick google picks up nothing.

I'm curious how he would explain the success of schools in places such as Eastern Europe and China. More testing, regimented learning, little focus on individual needs...these seems like the opposite of what he's recommending, but it still works somehow.

PS: I think everyone on HN is a bit of a dreamer, no? :)

vasi··on Testing, the Chinese Way
It may be instructive to note that Finland is another country with a school system that seems to do particularly well, and that is held in high regard by other countries. In contrast with China, their system discourages standardized testing, especially for young children—iirc, they don't even receive grades until fifth grade. See, eg: http://www.pbs.org/wnet/wherewestand/reports/globalization/f... and http://online.wsj.com/article/SB120425355065601997.html

So what does this mean? Clearly there's more to it than just "more testing is necessary!" or the reverse. Is the Anglosphere in some "unhappy middle", where moving towards either more OR less testing would help? Is the amount of testing in fact orthogonal to school performance? I know both Finland and China are said to have high levels of societal respect for education, perhaps that's the crucial factor—but I'm not aware of any good measurements of this, maybe it's anecdotal.

Another hypothesis is that there's a fairly hard limit to how well children can be educated at this point in time, and that the best schools in Finland, China and the U.S. all near this limit. In China we only look at the best schools and students, and with so many people in China the best will look pretty good. Finland has very high equality and homogeneity, so the worst schools aren't so far off from the best, and the whole country comes out looking good. The U.S., however, has many badly funded schools and marginalized populations, so that could make the difference. Then the question becomes whether we can approach Finland's success, or if the Anglo countries are too inherently different. Again, this entire paragraph is truly rampant speculation, and my mind and gut are both skeptical.

Thoughts, anyone?

vasi··on Don’t let jQuery’s $(document).ready() slow you down
Seems to me that AJAX before document-ready could get complicated once you want to actually do something with the response. Normally one would do something like this:

  $(document).ready(function(){
    $.getJSON(my_url, function(data) {
      $('<p>').text(data.some_text).appendTo('#some_container);
    });
  });
But if we call getJSON before document-ready, the node $('#some_container') may not yet exist! Now we need some way to wait until both the AJAX request is complete and the document is ready…recommendations?

EDIT: Thanks for the responses, glad to know it's safer than I thought!

vasi··on John Carmack demos Rage on iPhone
He also did the first port of X11 to Mac OS X, see Xquartz(1).
vasi··on Xz
I wrote a tool, pixz, that does xz compression in parallel to take advantage of multiple cores. It also indexes xz-compressed tarballs, so you can extract an individual file very quickly instead of needing to decompress the entire tarball. The parallel-compressed, self-contained tarball+index is fully compatible with regular tar/xz, you don't need any special tools to extract it.

http://github.com/vasi/pixz

The interface is still very rough, but it works. The xz utility comes with a very nice library and API, which made this a lot easier--thanks, Lasse!

vasi··on How to Back Up Gmail In Linux
Some other nice things:

• Offlineimap uses maildir format, used by some IMAP servers like Dovecot. So if Google ever goes evil and locks you out, you can just use your own server instead.

• Theoretically you can use Offlineimap to reproduce exactly all your mail and folders/labels onto another IMAP server. This would be pretty useful for migration, but I've never actually tried it.

vasi··on Android versus iPhone Development: A Comparison
XCode and it’s associated tools (debugger) like to open lots of windows. Want to open a file? How about a new window for you!

Er...Preferences -> General -> Layout -> All-in-one?

vasi··on Unicode is tricky in Java and might be impossible in C++ (2006)
Err...this works fine for me if I use UTF-8 rather than wide strings, eg:

std::string s("foo\u203D"); std::cout << s << std::endl;

Also, he's completely wrong about the program terminating on output of a wide string, it's just that wcout is broken. If he had tried causing output afterwards with, say, printf(), he'd notice the program is still alive. Or running it in GDB would show this just as well. It's generally speaking a bad idea to test whether your program is alive, using the same mechanism that you suspect of killing it!

vasi··on Fibers & Cooperative Scheduling in Ruby
AFAIK, Ruby marks I/O blocked threads and does not schedule them. However, if you have a native extension that's blocked on I/O, it may be scheduled--so there is a potential problem.
← PreviousPage 2 of 2