Thus Spake Zarathustra

23-Aug-2016 01:17PM

StumbleUpon is a fantastic website, and probably the best knowledge aggregation on the web. Let explain why - first by defining virtuous knowledge aggregation, and then via a comparison of StumbleUpon with other sites.

Here are the sites I compare StumbleUpon to:

  1. StumbleUpon
  2. Reddit
  3. YCombinator
  4. Wikipedia

These sites allow the community to index web pages and articles, so users can be both entertained and informed.

These sites are all virtuous or unvirtuous regarding several categories. These categories are:

  • Entertainment - What is the most fun that can be had reading the website?
  • Currentness - How recent are links?
  • Bias - How biased are links, on average.
  • Shitness - How much time do you spend parsing poo?
  • Positive Vibes - What is the general tone of links?

StumbleUpon

Entertainment 5/5

Because

Isn't "spake" a fun word?


Snarky Cairo Etc.

07-Apr-2016 03:30PM

I'm tipsy, and listening to Snarky Puppy. And it is good. Speaking of Good, using 3D graphics API's for Common Lisp sure is a pain in the arse. Yes. Yes it is. Sure Common Lisp is an amazing language. I have spent most of this week trying to get things to build though, and that is not time well spent.

So what ought to be good? Sketch is a pretty cool idea. Or it would be if any of the examples would actually run. There is something to be said for having things work out of the box. Clinch also looks extremely cool. But the tutorial code does not work as described with the current version in QuickLisp. (The SDL window appears and the background turns blue, but no white triangle. I ought to raise a bug report, but I am sure the developers secretly know what they are doing.)

You know what does work though? The CL-SDL2 examples. That's pretty good right? I've been playing with these. Fun. What more could you want? How about a goal? The goal is to draw pretty pictures using only Common Lisp. Why Common Lisp? Because it doesn't hurt my hands. (Only my brain). And the debugger is pretty great too, unlike my limited experience debugging Clojure, which was not so good. -> This is because of stack-trace from hell see?

It is a shame that no programming language is perfect. There is something to be said for immutable by default data structures. I am dying for them with the work I am currently doing. There is also something to be said for being being able to hack using mutable structures. There is something to be said for macros, but also something to be said for having a stronger type system. Where is the balance though?

So I am listening to Snarky Puppy, and they are good. It is time to sleep.


Have you ever heard of a Q-Sort?

21-Mar-2016 02:39PM

See an explanation of Q-Sort

It is a fun experiment to try. Fun enough that it is worth writing software to make it easier to do.


On an unrelated note

This evening I fixed this website along with shadowwall.org which is hosted on the same server. I had three problems:

  1. Hyperlinks on shadowwall.org were directing to this domain.
  2. I was running a Postgres 9.3 and didn't upgrade or backup my cluster before upgrading my binaries. (So this website went down.)
  3. This domain was not exposed in any way.

How to fix?

Firstly, the database problem. It turns out I had to downgrade from 9.5 to 9.3. Luckily this was pretty easy on my Arch box because the AUR repository still has 9.3 available. Because I am super lazy and my database is tiny, I was able to just run /opt/pgsql-9.3/bin/pg_dumpall >> old_backup.sql as my backup. After re-installing the new version of postgres and setting up a fresh database psql -f old_backup.sql postgres put me back in the swing of things.

Secondly, the hyperlink problem. It turns out this is a configuration option in wordpress, so this was trivial to fix us using this guide here.

Finally, because I had to use wordpress and the backend of this site is in clojure, I needed to proxy through requests to danielkeogh.com to a service on a different port. This was again, another incantation. It was tricky to find. Documentation on Apache is good so long as you know how to correctly word your questions. I found the solution to my problem here.


Hackagong

23-Sep-2015 01:07PM

Last weekend was Hackagong.

https://github.com/DanielKeogh/ShoutSpec


Neglect

18-Aug-2015 02:29PM

Neglect is not looking at my webpage for six months. A lot has changed. I am not reading as much lately as I used to. This is because reading has become an egoic thing for me, rather than just something to enjoy.

Robert Persig:

To the untrained eye ego-climbing and selfless climbing may appear identical. Both kinds of climbers place one foot in front of the other. Both breathe in and out at the same rate. Both stop when tired. Both go forward when rested. But what a difference! The ego-climber is like an instrument that’s out of adjustment. He puts his foot down an instant too soon or too late. He’s likely to miss a beautiful passage of sunlight through the trees. He goes on when the sloppiness of his step shows he’s tired. He rests at odd times. He looks up the trail trying to see what’s ahead even when he knows what’s ahead because he just looked a second before. He goes too fast or too slow for the conditions and when he talks his talk is forever about somewhere else, something else. He’s here but he’s not here. He rejects the here, he’s unhappy with it, wants to be farther up the trail but when he gets there will be just as unhappy because then it will be “here”. What he’s looking for, what he wants, is all around him, but he doesn’t want that because it is all around him. Every step’s an effort, both physically and spiritually, because he imagines his goal to be external and distant.

This is nice, because it fits in well with what I have been learning from Ekhart Tolle about Ego. My model of what inner processes cause what behaviour is so far from complete though! I most definitely feel like a novice these days, but maybe if I begin writing down some of my thoughts I can erase this feeling. I would not want to accidentaly egoise it away though.

Let us start with this thought: There are multiple relationships between language and egoising. These relationships include:

  • We measure ego through language.
  • We often express ego through language.
  • Hypothesis: Ego is expressed when an identification would cause suffering if it were not expressed?
Maybe if Persig had focused on trying to define identity rather than quality, he would not have gone mad.


Things I want to learn this year

04-Jan-2015 11:19AM

  • Who shares the same values as me
  • What useful categories can I internalise for problem solving (other than Who What When Where Why)
  • What tools are good
  • What ideas will waste time
  • What do I think feels good, but isn't correct
  • What leverage do I have
  • When should I rest
  • When should I use discipline
  • When is hypocrisy not at the expense of others
  • When being passionate is good impression management
  • Where I can meet interesting people
  • Where I can sing
  • Why spontaneous behaviour is funny
  • How to cook
  • How to write better macro's
  • How to code without losing my train of thought
  • How to meta-program in C#
  • How to write essays that are valuable
  • How to think faster
  • How to reflect
  • How to align other people to my values
  • How to align myself to other peoples values

Commit Checklist

11-Mar-2014 10:58AM

  • Are all the features in the specification implemented?
  • If things are different to the specification, are the reasons good enough?
  • Is there enough test coverage?
  • Do the unit-test's I wrote pass?
  • Are there any regressive failures?
  • Does it build?
  • It's OK to check in now.

Church Encoded Numbers with Lambda Calculus

05-Jan-2014 06:55AM

So the saga of Programming with Patterns continues, this time with Lambda calculus. Here are the things worth knowing about Lambda Calculus for laymen like myself.

Lambda Calculus is an equivalent of Turing Machines in its computational ability. Unlike Turing Machines, rather than dealing with operations on state, Lambda Calculus is composed purely of functions, specifically lambda functions. These are pure functions with no side affects, and as you can observe, the universe seems composed purely of the side affects of phenomena. Despite this, just like in typical mathematics, we can create abstractions that simulate the universe and ideas to perform the computation of our desires!

In our lesson with Barry Jay on Lambda Calculus, we were exposed to Church Encoding, an equivalent of Natural Numbers. Wikipedia will do a better job of explaining the theory than I ever could, but below I give an example of these implemented in the Pattern Calculus language bondi, using different variable names to our lecturer for clear and intuitive understanding.

( Remember that things in these parens are comments)

(* The aim here is to create numbers that can be used as:
 ~~three increment 0;;
> 3
~~ (add four five) increment 0;;
> 9
*)

let zero = fun f -> fun x -> x;;
(*Zero is equivalent to:
Number zero (Function increment, Number startingNum) {
     return startingNum;
}
*)

let successor = fun n -> fun f -> fun x -> n f (f x);;
(*
Let successor = (lambda (Function zeroOrSuccessor) { 
                               lambda (Function increment) { 
                                         Number (Function startingNum) {
                                                   return zeroOrSuccessor(increment, increment( startingNum ) );
}}}

So what happens is that every layer of successor increments "startingNum" until it reaches the zero function and startingNum is returned.
*)

let one = successor zero;;
let two = successor one;;
let three = successor two;;
let four = successor three;;
let five = successor four;;
let six = successor five;;
(*These numbers can be seen as:
 three ~= (successor (successor (successor zero)))
and can be evaluated with (three inc 0) 
*)



(* Typical increment function. *)
let increment = fun x -> x + 1;;


let plus = fun x -> fun y -> ((x successor) y);;
let expt = fun x -> fun y -> (y x)
let mul = fun x -> fun y -> (x (y successor) zero);;

But why does this matter?

The following is conjecture, and should only be taken with a grain of salt. Obviously, a computer that implements Church Encoding is slower than the typical bit manipulation, but what it does show is that Lambda Calculus can produce an abstraction that is functionally identical to Natural Numbers represented with bits. As with anything equivalent, they can be swapped out without impact to their universe, so long as Types are used to enforce that the swapped out abstractions aren't used invalidly. Because of that, we can enjoy both the power and expressiveness of completely functional language without sacrificing the speed advantages of our modern computer chips.


Compound Calculus

05-Jan-2014 06:54AM

So Compound Calculus is an extension to lambda calculus meant to look a bit like Lisp, though not quite, because we don't have types yet. I'll add more on this later, but for now, here is a definition of "select" using compound calculus-ish data structures within bondi.

let rec select1 =
  fun f x -> if isPair x 
    then (append (select1 f (car x)) (select1 f (cdr x))) 
    else (if (f x) 
      then [x] 
      else []);;

let rec update1 =
  fun f u x -> if isPair x 
    then (append (update1 f u (car x)) (update1 f u (cdr x))) 
    else (if (f x) 
      then [(u x)] 
      else []);;