CDADDR.com!
avatar

Lisp Game Jam 2018

This week is the Lisp Game Jam 2018 - write a game in a Lisp! I've never done a game jam before, but this is right up my alley.

I'm going to be using Fennel with LÖVE. I've nver used Fennel before, but it looks Clojurey enough that I'll feel very comfortable with it. I have used Lua a bunch, so there isn't much learning curve there. I know one of the things I dislike the most about Lua is the syntax, but really once you go Lisp everything feels a little bit wrong.

I've dabbled with LÖVE but never finished anything. I suppose one of the points of game jams is to work against a deadline, to limit your scope and actually finish something, so this seems like a perfect opportunity to finish my first game.

So far my idea for a game is some kind of infinite runner, and the main character will be a frog. What obstacles will Frog face? We'll see!

I'll be blogging a little bit of my progress as I go. This seems like an awesome jam and I'm excited to be coding for fun again.

Read more...

Go Go Hugo

In 2015 I decided to give Wordpress another try. "Surely it's good now. Surely I won't be hacked", I thought to myself. Well, it was hacked, repeatedly. My fault? Wordpress's fault? Let's go with a yes on both counts. I ignored my blog for a couple months and paid the price. In any case, I wiped Wordpress and decided to go anti-Wordpress, aka static HTML.

Static HTML? What is this, 1997? No, we're still living in The Future. But static HTML is still cool and unexpectedly, there are a lot of modern, powerful static HTML templating engines. After checking out a bunch of them, spending the most time on Jekyll, I finally landed on Hugo. Below, I explain why.

Read more...

New blog, taste it

Hello, world! I've spent the past couple weeks dusting this old blog off. It's running on Hugo. I spent a lot of time researching static blog generators, and landed on Hugo in the end. I have a long blog post coming up about that.

Rather than try to write book-length blog posts which I never manage to actually finish, I'm going to try a more stream-of-consciousness approach, with small posts about whatever I'm thinking/doing at the moment. We'll see if that's useful to anyone out there or not.

Read more...

I need a good mouse.

Allow me to share a picture of my favorite child:

Keyboard

He's 7 years old. Like most children, he's loud and filthy, but he's still my favorite. This thing is built like a battleship. It will probably outlive me. Assuming there's a USB-to-FuturoWhizPort adapter (or whatever replaces USB), future generations will still be able to drive their officemates insane with the sounds of its clicking.1

Meanwhile I manage to break a computer mouse every 12 months like clockwork. What's the deal?

Read more...

Let's try to learn Japanese for the 87th time. Plus a WaniKani review.

I've been trying to learn Japanese for a looong time, with varying degrees of success. It's hard in ways that might be surprising. The main problem is motivation. This is a tale of my minor successes and major failures, and then a review of my latest flavor-of-the-week, WaniKani.

Read more...

Burning out. Or not.

Hello, world! It's been a few years since I've blogged regularly. What's up with that?! This post is about burning out. And then un-burning out.

Blog → Book

I started my old blog fresh out of college, back when I knew nothing about anything1. I liked to use it to explore topics I was interested in. "Explore" here means dumping an idea onto the internet and seeing what happens. Sometimes I'd write something useful for people at the same stage of exploration as myself, which was a great feeling. Just as often, I'd write something super-wrong and hordes of people would show up to tell me so.

I consider both outcomes positive. My goal is learning and self-improvement. Being wrong is OK, it's how you learn. And I feel like I did learn a lot by blogging. Sometimes just the act of writing something down and explaining it to others has a miraculous way of making it clear in your own mind.

I've always tried to make the tone of my blog a bit silly, so that people don't show up thinking they're getting good solid info out of this. Rather, they're getting some guy wandering around in public who occasionally bumps into something useful.

My blog brought all kinds of positive things into my life. For example, people would read it and email me and say "Hey, wanna write a book?". So yeah, I helped2 write a book. And then things went a bit downhill.

Read more...

Puffin

Puffin

Painted for my friend Lizzy, summer 2015. Created in Krita.

Reference.

Read more...

Vim: Find lines longer than current line

Vim isn't just for editing source code. It's also a pretty good data editor.

Sometimes I'm editing dirty fixed-width data files, and some lines are incorrectly a bit too long because one or two fields overflowed. It's easy to search for lines that are too long, once you know how long lines should be. Say your lines should be 1000 characters; search like this:

/^.\{1001}

Now all the longer lines are highlighted (assuming :set hls).

That's tedious to type though. Put your cursor on a non-overflowing line and call this function, and Vim will find all the lines that are too long, and move you to the first one:

function! FindLongerLines()
    let @/ = '^.\{' . col('$') . '}'
    silent! norm n$
endfunction

That mess about manually setting @/ is because of this somewhat unfortunate fact (from :help :function):

        The last used search pattern and the redo command "."
        will not be changed by the function.  This also
        implies that the effect of |:nohlsearch| is undone
        when the function returns.

That is, using something like norm / inside functions doesn't affect the last-remembered search once the function returns, but that's exactly what we want to happen.

Read more...

Happy Day Against DRM

Books are 50% off at O'Reilly today, using code DRMFREE. (This includes my book, Clojure Programming, by the way...) I'm a bit late with this, given the offer expires in 9 hours, but there's still time.

Whether you want to buy books today or not, it's worth pointing out that today is International Day Against DRM!

Day Against DRM

Read more...

cursorcolumn / cursorline slowdown

The cursorcol and cursorline options in Vim are great. Enabling them, and setting up your syntax highlighting correctly, will highlight the line and column that contains the cursor, drawing a sort of "crosshairs", to let you find the cursor easily.

This is especially useful when editing non-sourcecode files, like giant fixed-with data files. Or when you need to keep switching your attention back and forth from Vim to something else; the visual cue to draw your eyes back to the cursor can be useful to prevent a mental page fault.

Cursor crosshairs

Great. However, the help info for cursorcolumn says this, in part:

    Highlight the screen column of the cursor with CursorColumn
    |hl-CursorColumn|.  Useful to align text.  Will make screen redrawing
    slower.

"Will make screen redrawing slower" is an understatement, unfortunately. Over the past who-knows-how-long, I've noticed Vim slowing to a crawl when editing certain files, mostly big Ruby files. Moving the cursor around or scrolling the window became pretty painful. I could never quite figure out why, but today I got sick of it, and eventually found an old message on the Vim mailing list explaining the problem.

Apparently when you have cursorcolumn or cursorline enabled, the whole screen is redrawn every time you move the cursor. That explains a lot. When I disabled these options, editing complex Ruby files once again achieved notepad.exe-level speed.

I guess there's this:

function! CursorPing()
    set cursorline cursorcolumn
    redraw
    sleep 50m
    set nocursorline nocursorcolumn
endfunction

nmap <C-Space> :call CursorPing()<CR>

This will flash the cursor crosshairs for 50 milliseconds when I hit CTRL+Space in normal mode. Better than nothing.

Read more...
Page:
1
2
3
56
>