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

A brief foray into determinism

A deterministic system is one where some piece of information determines another. This is most commonly the case in Math and input-less programming:


def f(x):
return x * x

or
[math]y = f(x) = x^2[/math]

In this example, the result of the function, y, is determined by x. If you know the value of x, you immediately know the value of y. Is the reverse true, however? If you know y, you only know the absolute value of x. x itself could be positive or negative. However, x is still determined from y: x can't be anything. y is determined by x: if you stick in the same x, over and over again, the same y will still pop out. Two possible values of x are determined by y: if you stick in the same y, over and over again, the same two possibilities will pop out.

See Full Post and Comments

Dumb Hack: cycle desktop background in gnome

Cool little feature I wanted but didn't immediately find a solution to (it took a little googling), my Linux desktop background wallpaper now changes and cycles over random images in a specified directory. I also made a few-lines Python script to replicate the functionality of the show desktop button in Gnome's gnome-panel.

It's not very feature-complete, but it does what I wanted. For the code and further instructions, check out my repo for it.

And why all the boldness? Stupid SEO that might help someone find this.

See Full Post and Comments

Some problems with C and C++

First off, let me list the two things I love about both C and C++.
  1. They're freaking fast
  2. You can muck with logical memory directly

If it weren't for these two features, I'm certain the languages would have died long ago.

To get my bias out of the way, I'm a Pythonista at heart, though I have experienced Lisp in all its glory and love it (closures for the win), as well as seen the Perl side and mostly enjoyed it.

Anyway, I think most of my problems in C and C++ can be generalized to their obsession with imperative style programming and static types (and can be generalized further with their lack of abstraction). If you're a die-hard C/C++ fan, you're probably already hating me for spitting on your language, and a typical reply I've heard when I say language X can do something C can't, is that "Wrong, C can do anything."

See Full Post and Comments

mod_security can kiss my ass

So there's been a problem with this blog, both on the comment side and this admin side where I make my posts. Namely, mod_security, an apache module, seems to be installed on my server and I can't disable it.

What does mod_security do? It scans all data sent to the server, and rejects any that fit a regex indicating it could be a potential SQL Injection.

Now, this sounds like an okay feature, except the regex it uses is completely retarded. And because of this, I'm leaving my server hosting when it's time to pay again. HostGator here I come.

See Full Post and Comments

Mathematical Induction

I haven't done a math post in a while, so let's talk about mathematical induction. This isn't related to inductive reasoning; it's more akin to deductive reasoning with recursion.

Suppose I came to a programmer and asked him to write a function that returns the sum of numbers cubed up to a given number. That is,

[math]sum\_cubes(n) = 1 + 2^3 + 3^3 + ... + n^3[/math]

See Full Post and Comments