TheJach.com

Jach's personal blog

(Largely containing a mind-dump to myselves: past, present, and future)
Current favorite quote: "Supposedly smart people are weirdly ignorant of Bayes' Rule." William B Vogt, 2010

Furcadia is Dead

Furcadia is dead. And it's been dead for a long time, at least 4 years. Look at their statistics on the front page. This game has been around since the start of 1997. I spent at least 3 years in it. It helped improve my writing and imagination, it helped me meet my best friend and others I still talk to frequently, it was a nice, creative form of entertainment that ascended beyond mere point-and-click first-person-shooters.

And yet:
135162 characters connected this month
Max players ever: 4640

I'm going to make a lot of assumptions and guesses, based on things I've heard, read, and experienced. I wouldn't put 95% certainty on any of them but I'd be surprised if I was really far off the mark. This is why I classified this post as a rant and blog fodder.

See Full Post and Comments

Notes from Probability Theory Chapter 1

Probability Theory: The Logic of Science, by the great E.T. Jaynes, has been in my reading queue for quite some time now. Unfortunately for me it's a dense book after the first few chapters, so I've kind of plateaued around chapter 3 while reading from a bunch of other sources.

I've found that my brain is like boiling soup, in a sense, with different things coming up to my attention almost randomly but the important ones usually coming up just-in-time. So now a Jaynes bubble has reappeared and I'm going to review what I've read! If you're interested I highly recommend the actual book, since I'm here going to be sometimes more verbose, sometimes less, sometimes tangential, and always less organized than Jaynes; leave your email in the comment form and I'll send you a PDF copy if you want.

Chapter one begins with this thought-provoking quote:
The actual science of logic is conversant at present only with things either certain, impossible, or entirely doubtful, none of which (fortunately) we have to reason on. Therefore the true logic for this world is the calculus of Probabilities, which takes account of the magnitude of the probability which is, or ought to be, in a reasonable man’s mind.
James Clerk Maxwell (1850)

1.1 - Deductive and Plausible (Inductive) Reasoning (Inference)



See Full Post and Comments

Forms of atheism and death tolls

A common debate amongst atheists and theists: who is responsible for more deaths? Related: was Hitler an atheist or a Christian? It doesn't matter since Stalin killed more and atheists suck! A common response to that last bit: Stalin also believed the Earth rotated around the Sun; Sun-centric people are evil!

There are two major mistakes in that short characterization. (Click while viewing the full post for the singular points.) The first is a relevance error, the second is a category error. First: does it matter who is responsible for more deaths? 1.8 people still die every single second. (http://www.census.gov/population/international/data/idb/worldvitalevents.php) The better question, to me, seems: are atheists or theists more likely to reduce this atrocious death rate? The fact is, about every 2.75 years or so, we lose an equivalent to all those lost directly due to the major conflicts of the 20th century. (http://necrometrics.com/20c5m.htm) Most of those deaths in the 2.75 years are due to disease, and the "old age"-specific disease is largely the family of cardiovascular ones. This indicates that whoever can cure or stop these diseases (and old age) can do a lot for reducing the death rate.

That question's answer isn't so clear-cut, because the simpler form is more of the typical science vs. religion issue and I think most people can agree how that's gone (in science's favor if you're wondering). The confounding variable there is that doing science that is beneficial to humanity doesn't require one be an atheist. One may work incredibly hard on some HIV drug, motivated by religious concerns while using techniques that, if applied to one's own belief system, may destroy it.

See Full Post and Comments

Playing with Morton Numbers

Dimensionality is a lie... okay, it's more of an interpretation.

If you have a set of integers such that you can construct coordinate pairs (x,y) (such as the locations of the pixels on your screen), this set of pairs is said to have two dimensions. But there's no reason it can't have three: the third dimension is just always 0! (x, y, 0). And so on for any upper dimension.

What about scaling it down to 1 dimension though? Is that even possible? Turns out, yes, and it's pretty easy. Just convert each x and y to base 2, and interleave the bits such that all of x's bits are in even positions and y's bits are in odd positions. We call the resulting binary number a Morton Number.

See Full Post and Comments

I wish Python had macros, but it's okay

I love Python, I just wish it had macros so I didn't always have to use eval/exec and friends. I'm not even asking for Lisp macros! C macros would be enough. (Though I guess it's not too hard to wire Python up to use the C preprocessor or something similar.) Yet as I'll show, Python's nice enough that for most cases it can get by just fine. Look at this:


#define Q(x) ((#x)[0])
#define CH(N) if (ch == Q(N)) GPIO_WriteBit(GPIO7, GPIO_Pin_##N , GPIO_ReadBit(GPIO7, GPIO_Pin_##N ) == Bit_RESET ? Bit_SET : Bit_RESET)
CH(0);CH(1);CH(2);CH(3);CH(4);CH(5);CH(6);CH(7);


expands to (pretty printed):

See Full Post and Comments

Featured on reddit!

Cool, my FFP Machine paper got a reddit link: http://www.reddit.com/r/ECE/comments/k5yld/ffp_machine/

I didn't get that many hits from it, but still cool anyway. I didn't even notice until I looked at my analytics tonight, I guess that's a good thing. (I don't think my site would last in a real reddit crisis.) Eventually I'll get around to optimizing the site... Right now every page hits the DB, which is the main cause of downtime.

See Full Post and Comments

Clojure Tip: defstruct, deftype, defrecord

I'm currently learning Clojure, so I intend to document a few findings here that required at least a couple minutes of Googling around for me. The Clojure docs will tell you in the nitty-gritty the differences between defstruct, deftype, and defrecord, but I think an example of each is more beneficial. Also, some older examples of deftype are out of date! Trying to do things the obvious way, at least to me, resulted in a runtime error: "Expecting var, but Point is mapped to class user.Point". Anyway, enough babble, here's a working example of all three.


kevin@jachoonster ~/clojure-1.2.1 $ java -jar clojure.jar
Clojure 1.2.1
user=> (defstruct Point1 :x :y)
#'user/Point1
user=> (def p1 (struct-map Point1 :x 3 :y 4))
#'user/p1
user=> (println p1)
{:x 3, :y 4}
nil
user=> (println (:x p1))
3
nil
user=> (println (struct-map Point1 3 5))
{:x nil, :y nil, 3 5}
nil
user=>
user=> (deftype Point2 [x y]) ; actually creates a java class
user.Point2
user=> (def p2 (Point2. 8 9)) ; notice the '.'!
#'user/p2
user=> (println p2)
#<Point2 user.Point2@54083e1e>
nil
user=> (println (:x p2)) ; won't work
nil
nil
user=> (println (.x p2))
8
nil
user=>
user=> (defrecord Point3 [x y])
user.Point3
user=> (def p3 (Point3. 11 12))
#'user/p3
user=> (println p3)
#:user.Point3{:x 11, :y 12}
nil
user=> (println (:x p3)) ; works
11
nil
user=> (println (.y p3)) ; also works!
12
nil


For a handy flowchart for telling you which you should prefer (especially if you are wondering about proxy, gen-class, and reify), check out this page: http://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/. (The author wrote a book on Clojure.)

See Full Post and Comments