Permalink
Browse files

Various changes, use google font api.

  • Loading branch information...
jaspervdj committed May 20, 2010
1 parent 2e80ad2 commit d8757710cde1b49834b854dfd9dfb6c163fbb46a
View
@@ -1,7 +1,7 @@
html {
color: black;
- font-family: sans-serif;
- font-size: 14px;
+ font-family: 'Droid Sans', sans-serif;
+ font-size: 15px;
text-align: left;
background-color: rgb(102, 102, 102);
line-height: 160%;
@@ -19,7 +19,7 @@ div#header {
div#header a {
color: white;
- font-size: 25px;
+ font-size: 30px;
text-decoration: none;
display: block;
width: 700px;
@@ -123,6 +123,10 @@ ul {
margin-left: 1em;
}
+code {
+ font-size: 14px;
+}
+
pre code {
display: block;
padding: 8px;
@@ -139,10 +143,10 @@ blockquote {
font-style: italic;
}
-/* A caption is the alt text of an image, produced by pandoc. We want to
- * disable it for now. */
p.caption {
- display: none;
+ font-size: 14px;
+ text-align: center;
+ color: rgb(100, 100, 100);
}
div.footnotes {
Binary file not shown.
@@ -86,7 +86,7 @@ This post, for example, starts with
Well, that's all for now, folks. Maybe I will elaborate on hakyll again later,
for some reasons I cannot do that yet (I haven't tested it enough, and the code
is not the best you've ever seen). All comments and suggestions are of course
-welcome at jaspervdj _at_ gmail _dot_ com.
+welcome!
Your most humble and obedient servant,
Jasper Van der Jeugt
@@ -14,9 +14,9 @@ reading a lot about
I became interested and tried to find a good concept to base a game on.
I am a regular reader of [XKCD](http://xkcd.com) and I like the drawing style a
-lot. A _sketched_ is pretty cool for a game, so I started fooling around with
-[noise](http://en.wikipedia.org/wiki/Perlin_noise). I first wrote an initial
-test in Java using swing.
+lot. A "sketched" look is pretty cool for a game, so I started fooling around
+with [noise](http://en.wikipedia.org/wiki/Perlin_noise). I first wrote an
+initial test in Java using swing.
![Screenshot of the Java test]($root/images/2009-12-09-jvgs-part-i-swing.png)
@@ -24,18 +24,18 @@ items I'd certainly like to see.
know anything at all about NoSQL, and this seems like a good chance to learn.
- Something about [RSI](http://en.wikipedia.org/wiki/Repetitive_strain_injury)
by [Michaël Rosseel](http://www.retaggr.com/Card/michlr). Relevant for
- someone like me who spends _a lot_ of time behind his computer.
+ someone like me who spends a lot of time behind his computer.
- How to commit a crime and get away with it by
[Koen Delvaux](http://delvauxkoen.blogspot.com/). Because the title sounds
awesome.
## What I will be presenting
-I'm going to do a presentation called _learn you a haskell in 20 minutes_. It
+I'm going to do a presentation called "learn you a haskell in 20 minutes". It
will be a basic introduction to the functional programming language
-[Haskell](http://haskell.org/). It won't be a _classic_ basic introduction, I'm
+[Haskell](http://haskell.org/). It won't be a classic basic introduction, I'm
going to explain some none-trivial things. That's because all so called
-_"simple introductions"_ I've seen were pretty boring. So I'm going to try
+"simple introductions" I've seen were pretty boring. So I'm going to try
something different: I'll introduce some more advanced concepts instead using a
simple application I wrote.
@@ -73,13 +73,13 @@ shapes. In `ghci`:
Oh yes, we should've thought of that: all elements in a list must be of the same
type[^1]. We're doing it wrong[^2].
-[^1]: Liam O'Connor pointed me to the fact that you _could_ use classes here by
- using the
- [Existential Quantification GHC extension](http://hackage.haskell.org/trac/haskell-prime/wiki/ExistentialQuantification).
+[^1]: Liam O'Connor pointed me to the fact that you __could__ use classes here
+ by using the
+ [Existential Quantification GHC extension](http://hackage.haskell.org/trac/haskell-prime/wiki/ExistentialQuantification).
[^2]: Another solution could be to use different data constructors for one data
- type called `Shape`, but then there wouldn't be the Haskell class -- Java
- interface connection.
+ type called `Shape`, but then there wouldn't be the Haskell class -- Java
+ interface connection.
## A more functional approach
@@ -36,15 +36,15 @@ Although I am not a big fan of Java, I have come to appreciate the language, and
I think it is, in fact, a very good "first language". It is, however, not easy
to go from Java to something like C. It is always harder to go more low-level,
and many students were confused by pointers, the fact that pointers can be
-arrays, and all those _typical C_ things.
+arrays, and all those typical C things.
![Pointers cartoon]($root/images/2010-01-20-xkcd-pointers.png)
I had already had a little bit of experience with C/C++ before starting the
course (I wrote [jvgs](http://jvgs.sf.net/) this summer) -- which, once again,
makes this post a little biased. But I thought the C part was pretty interesting
(the exercises at least, the theory was rather boring, but well, you can't have
-everything, I suppose). I mean, C _is_ still used today, and to quote our Data
+everything, I suppose). I mean, C __is__ still used today, and to quote our Data
Structures & Algorithms professor:
> If you want, or need, something really fast -- when all the constant factors
@@ -58,16 +58,16 @@ C when we started on the C++ part of the course.
I know there is a lot of [C++ bashing](http://yosefk.com/c++fqa/) on the
internet, and when I read these things I sometimes think I must be one of the 5
people on the world who appreciate C++. So my problem here is not with C++ -- I
-just fail to see _why_ it is taught.
+just fail to see why it is taught.
Let me explain: I see C++ as an object-oriented superset of C. Students know the
concept of object-orientation from Java, and they know about pointers and those
-things from the C lessons: I do not think C++ adds any more _ideas_.
+things from the C lessons: I do not think C++ adds any more ideas.
As far as I can see, the only new thing we saw with C++ was templates, but we
only used templates to write abstract data types -- the primary use for Java
generics. Admittedly, we did not see generics in our Java courses, but we
-_could have_.
+could have.
## The Project
@@ -86,7 +86,7 @@ with a project that is not "boring" -- hey, it even included robots.
Summary, I think C++ should not be taught, and more attention should be spent
on C, because:
-- C++ does not add any _general_ programming knowledge -- ideas we can use when
+- C++ does not add any general programming knowledge -- ideas we can use when
learning other languages.
- A lot of students didn't know C well enough after the C part.
- It would be interesting to see a larger C project (now, we only had some
@@ -20,20 +20,20 @@ from scratch (so after a `./hakyll clean`).
I am far from an expert at Haskell profiling, and this graph is a heap profile
and not really a benchmark, but I think you can nonetheless see that the
-functions from [Pandoc](http://johnmacfarlane.net/pandoc/) (seen here as the
-top yellow and pink blocks) are the "more heavy" ones. This makes sense,
+functions from [Pandoc](http://johnmacfarlane.net/pandoc/) (seen here as the
+top yellow and pink blocks) are the "more heavy" ones. This makes sense,
because rendering Pandoc markdown[^1] to html is not easy. The total time is
under 2 seconds, but there are only a few blogposts on this site now. I've taken
-it to the test, copying a blogpost a hundred times, and the result was that the
+it to the test, copying a blogpost a hundred times, and the result was that the
time taken rose linearly with the number of posts (hey, who would've expected
that).
[^1]: I mostly talk about Pandoc markdown in this post, but it really applies
to all formats supported by Pandoc.
The thing is that we can't simply "make pandoc faster". Pandoc is a marvelous
-piece of software, and probably quite optimized. What we _can do_ is try to
-call Pandoc less.
+piece of software, and probably quite optimized. What we can do is try to call
+Pandoc less.
## Simple timestamp checking
@@ -133,7 +133,7 @@ great [Data.Binary](http://code.haskell.org/binary/) library, so I thought I'd
give it a try.
[^3]: 60 seconds after a `./hakyll clean`. This seemed the most fair benchmark,
- and caching _would_ play a role here, since many `Page`s were accessed
+ and caching would play a role here, since many `Page`s were accessed
multiple times: for the tags, for the post list, for the posts
themselves...
@@ -46,11 +46,11 @@ provided as a starter package, they stored the information about the map in a
an empty tile, the player...
The problem with this is that Haskell's default lists are linked lists. Imagine
-we have a _m * n_ map -- so _m_ tiles wide and _n_ tiles high. In most other
+we have a `m * n` map -- so `m` tiles wide and `n` tiles high. In most other
languages, you would expect you can access the elements in constant time --
-so _O(1)_. But because we're using linked lists, this is not the case. Worst
+so `O(1)`. But because we're using linked lists, this is not the case. Worst
case scenario, you would access the bottom right element. This would take
-_O(m + n)_ time -- and that is not acceptable.
+`O(m + n)` time -- and that is not acceptable.
So I'll abuse this blogpost to ramble about Haskell arrays.
@@ -62,7 +62,7 @@ So I'll abuse this blogpost to ramble about Haskell arrays.
> , boardEnemyPosition :: (Int, Int)
> }
-We use an _Unboxed Immutable Array_ to store or walls. A bit of context:
+We use an "Unboxed Immutable Array" to store or walls. A bit of context:
- __Unboxed__: this is basically a counter-measure against Haskell's laziness.
While that can be very useful in certain situations, it is not here. By using
@@ -80,7 +80,7 @@ certain `Tile` in the `Board`:
> || y < 0 || y >= boardHeight board
> || boardWalls board ! (x, y)
-Yep, we now have a function that runs in _O(1)_ and that is quite efficient (of
+Yep, we now have a function that runs in `O(1)` and that is quite efficient (of
course we have to do some basic boundary checks). The code to read the `Board`
is a little more complicated (but also more interesting):
@@ -105,7 +105,7 @@ The real code happens in the `where` block:
What might not be obvious to see, is why we use `transpose` here. `transpose`
transposes a matrix -- why would we want that?
-The answer is that I find it easier (if you will, more _natural_) to use
+The answer is that I find it easier (if you will, more "natural") to use
`(x, y)` notation instead of `(row, column)` notation. You can safely remove
the `transpose` function and switch to `(row, column)` if you want, but I
think the `(x, y)` notation is a little easier.
@@ -83,7 +83,7 @@ There's a simple formula for calculating the Pythagorean distance between
tiles. We use this in combination with the "real" distance (the distance when
taking walls etc. into account). We can leave this distance squared, not taking
the `sqrt` is a little faster, and we only have to compare distances, and
-_x^2 < y^2_ implies _x < y_, because distances are always non-negative.
+`x^2 < y^2` implies `x < y`, because distances are always non-negative.
> distanceSquared :: Tile -> Tile -> Int
> distanceSquared (x1, y1) (x2, y2) = (x1 - x2) ^ 2 + (y1 - y2) ^ 2
@@ -290,8 +290,8 @@ assign a `Score` to a game - and we then make these `Score`s comparable.
> | Draw
In theory, these are the only possible outcomes. In reality, these values are
-often situated at the bottom of our game tree - and we can't look down all the
-way. Therefore, we also have a `Game` score - describing a game in progress.
+often situated at the bottom of our game tree -- and we can't look down all the
+way. Therefore, we also have a `Game` score -- describing a game in progress.
The `Game` constructor simply holds some fields so we can determine it's value:
@@ -469,7 +469,7 @@ simply returns the possible `Board` with the best `Score`.
> else if value < u then enemySearch xs (l, value) board
> else enemySearch xs (l, u) current
-First, we want to make a quick (but stupid) decision, in case we're on a _very_
+First, we want to make a quick (but stupid) decision, in case we're on a very
slow processor or if we don't get a lot of CPU ticks. The following function
does that, providing a simple "Chaser" approach.
@@ -39,7 +39,7 @@ In Hakyll, the rendering algorithm is more or less like this:
[pandoc]: http://johnmacfarlane.net/pandoc/
The catch is, say `_site/contact.html` is "newer" than `contact.markdown` and
-the HTML templates. In this case, we do not want to do _anything_. Haskell
+the HTML templates. In this case, we do not want to do anything. Haskell
lazyness will not help us a lot here, since we're dealing with a lot of `IO`
code.
View
@@ -8,6 +8,7 @@
<title> jaspervdj - $title </title>
<!-- Stylesheets. -->
+ <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans">
<link rel="stylesheet" type="text/css" href="$root/css/default.css" />
<link rel="stylesheet" type="text/css" href="$root/css/syntax.css" />

0 comments on commit d875771

Please sign in to comment.