Wednesday, December 04, 2013

Why are manhole covers round?

They aren't round. There are plenty of square manhole covers. Generally, round manhole covers go on round manholes and square covers go on square holes. To do otherwise would be silly. So why are some holes round and others square?

Monday, December 02, 2013

public service announcement about redirecting stdin, stdout

I'm making an announcement about this because it caused me several hours of debugging problems and there were few google results that contained this answer.

Problem: I wrote a big long C program that printed output to stdout and also wrote some stuff directly to a log file, but the verbose output was also helpful sometimes. Naturally, I wanted to save that for later, so I did the usual thing to run the program:

./program > log.txt &

When I made my toy examples, included tons of diagnostic output, and ran it on smaller data sets, of course, things worked as expected. However, when I removed diagnostic output and ran it on larger images (ie, so it would take hours to run instead of minutes), suddenly, my logs were turning up empty even when I checked them hours later. I was worried! So I'd kill the job, tweak the file, recompile, and start doing more obscure things:

./program &> log.txt 
./program 2>&1 | tee -a some_file

And even some options involving screen. The above two are probably your best options. Oddly, none of these worked. However, when I would run in the terminal, things would show up.

Solution: stdout, when it is not running to a terminal or terminal emulator, will buffer the output and release it in chunks. The buffer can be up to 4K. So, if your program is ouputing perhaps 10 lines over the course of 12 hours before closing, you might not get any output in your log if you do it this way until the program finishes. Therefore, either have the program write directly to a log file (if you want to glance at output along the way), have your program write a lot of output, or, in your program, use the following after printf commands where you really want to be able to view your results immediately-ish:

fflush(stdout);

Or whatever the equivalent command is outside of C. HTH. HAND.

In case you're wondering what I was up to, I was finishing up an incremental semi-supervised k-means algorithm. Exciting!

Now back to your regularly scheduled theological content.

Tuesday, November 26, 2013

Doctor Who Speculation - minor note about the recent special

They're trying to wind the series down and end it. The Doctor now has, in three different sense, a destination: "all" of his regenerations are enumerated, his final burial place is shown, and he has a new mission to "go home". The first two were already known, but the last bit was like the last piece to the Key to Time falling in place.

Sunday, November 24, 2013

Another reminder of how odious Murray Rothbard is.

The Oppressed Gender (from the 70s)(it's men, of course) This should of course also serve as a reminder of how odious the Von Mises Institute, Lew Rockwell, and most of Austrian economics is.

I would provide citations, but every single paragraph is odious and I really don't want any of those things coming in google results tied in any way to my name. Search for the "n" word, for instance!

Friday, November 22, 2013

Why I don't like states' rights

And why I am a filthy statist:

Freeing the slaves at the point of a gun was the right choice after the Southern traitors seceded. States' rights here are just a code for "the right of a state to decide to enslave black people".

Desegregation in the states at the point of a gun is the right choice. Keep in mind that the federal government had to call in the National Guard to desegregate schools in the South. This, to my mind, is a perfectly excellent use of force and a strong argument for government contra the libertarians and federal government contra the racists, er, states' rights crowd. States' rights or individual rights or the rights of businesses here are just code for "the right to segregate or discriminate against black people". Again, no two ways about it.

Without the Civil Rights Act, there would be worse discrimination by businesses than there is today. There is still rampant discrimination.

EDIT: For instance, an illustration from a conversation on reddit somebody had with, let me be blunt, a fool and libertarian. This is why I believe in a federal government that enforces desegregation at the point of a gun. Because it won't happen otherwise and segregation is a worse evil than parading around with a gun (don't these people like the idea of parading around with a gun, anyway?).

ANOTHER EDIT: the reasoning in that link reminds me of the recent Supreme Court ruling on the Voting Rights Act. And after their ruling, the states went on to enact a series of measures whose obvious intent was to curtail minority voting. If anybody needs me, I'll be in the Angry Dome.

Wednesday, November 20, 2013

A more serious post on libertarianism.

I give libertarians a hard time, but, really, it's only the Rothbard/von Mises/Paul crowd that gets me going. The other types of libertarians are, generally, decent folks with ideas I disagree with but would read and engage with. However, Austrian economics of von Mises' brand is a joke and Rothbard and the Von Mises Institute associate too freely with (or are themselves) racists, neo-Confederates, and anti-semites - see previous posts for the record on that. So does Ron Paul, by the way. Rand Paul seems to associate gleefully with neo-Confederates, but I don't have any record of anti-semitism or racism (except insofar as neo-Confederates are probably racists).

EDIT: an example of all three together at once: http://www.economist.com/blogs/democracyinamerica/2008/01/the_rockwell_files