weblog.jamisbuck.org Archives - 24 October 2016, Monday

  • Buckblog: Weekly Programming Challenge #13

    weblog.jamisbuck.org 22 Oct '16, 7pm

    Once upon a time, I wrote a fantasy trading simulator. You played a humble merchant, buying goods in one town and selling them in another. The goal was to make a profit, eventually upgrading your donkey to a caravan of wagons, with guards and magic wards to protect from brigands and d...

  • Programming challenge #12 ends tomorrow! There's still time to try building a pedigree chart

    Buckblog: Weekly Programming Challenge #12

    weblog.jamisbuck.org 15 Oct '16, 4pm

    I’ve been a genealogy nut for years–perhaps back as far as nearly 20 years, when I discovered that I was descended from many of royal houses of medieval Europe. (Of course, at the time, I took that information at face value…I now know better, but it was still fun to contemplate!) One ...

  • Buckblog: Weekly Programming Challenge #11

    weblog.jamisbuck.org 08 Oct '16, 10pm

    Back in week #4 (“Drawing Lines”), we applied ourselves to implementing the Bresenham algorithm. One of the “hard mode” options was to implement the “midpoint circle algorithm”, which is kind of “Bresenham for circles”. Sadly, no one gave it a try in week #4. It’s time to revisit it, ...

  • Buckblog: Weekly Programming Challenge #10

    weblog.jamisbuck.org 01 Oct '16, 6pm

    When I was first learning Ruby–going on 15 years ago, now!–I cast about for a project to cut my teeth on, and decided to write a simple HTTP server. It was a great project, with a surprising capacity for exploration and discovery. Network programming can be an exciting area to play ar...

  • Buckblog: Weekly Programming Challenge #9

    weblog.jamisbuck.org 24 Sep '16, 6pm

    Years ago, I toyed with getting a master’s degree in computer science, and while that little experiment didn’t last long, I was able to take some fascinating classes. One of them was CS 557, “Computer Aided Geometric Design”, taught by Professor Tom Sederberg. It introduced me to the ...

  • Buckblog: Weekly Programming Challenge #8

    weblog.jamisbuck.org 17 Sep '16, 7pm

    The scanner . The scanner will take as input some string of characters, and convert them into an array of tokens . That is, if I give it the string “3 + 4”, the scanner will convert that into three tokens. The first token would have type “number” and value “3”, the second would have t...

  • Buckblog: Weekly Programming Challenge #5

    weblog.jamisbuck.org 27 Aug '16, 8pm

    Home | RSS | Archives | Basil & Fabian Announcements | Essays and Rants | Life | Metablog | Odds & Ends | Projects | Redirect | Reviews | Spotlight | Tips & Tricks | Under the Hood | Mazes for Programmers! Weekly Programming Challenge #5 27 August 2016 — The fifth weekly programming c...

    1. The Buckblog weblog.jamisbuck.org 27 Aug '16, 6pm
  • The Buckblog

    weblog.jamisbuck.org 27 Aug '16, 6pm

    The last four weekly challenges have gone really well, and I’ve learned a lot from each of them. I’m looking forward to this week’s: Priority Queues and Binary Heaps . I think I’m going to give it a stab in Go . I look forward to seeing what everyone else comes up with!

  • Buckblog: Think You’re Failing? Look Around.

    weblog.jamisbuck.org 14 May '16, 11pm

    Think You’re Failing? Look Around. 14 May 2016 — A recent article by the author about seeing past our "failure filters" — 1-minute read It’s not tech-related , but I think it might just be career-related . I posted an article on Medium today about finding perspective when it feels lik...

  • Buckblog: Tapping ActiveRecord Relations

    weblog.jamisbuck.org 23 Apr '16, 9pm

    (Yes, I know I said I was probably not going to write here anymore, but while I like Medium for long-form articles, it didn’t quite fit the bill for posts that wanted syntax highlighting. Thus, I’ll probably continue to use the Buckblog for technical articles, and Medium for long-form.)

  • Buckblog: Introducing the Query Composer

    weblog.jamisbuck.org 26 Mar '16, 4pm

    Despite that, I’ve put together an example, using a hypothetical library administration system: Libraries have Books and Patrons, Books have Topics, and Patrons may borrow Books. The example, then, builds and runs a report that asks how many books each patron borrowed during some peri...

  • Buckblog: The Poverty of Constraints

    weblog.jamisbuck.org 19 Mar '16, 5pm

    Let’s reinterpret some Korean proverbs as software advice. (Two previous posts in this vein are “Software Proverbs ” and “The Weakly-Flowing Stream ”.) The two I’ve selected today share a theme, that of “poverty”, which can be viewed in terms of constraints . First: “가난한 집에서 효자 난다.” A...

  • A church billboard inspired me to write a Ruby script.

    Buckblog: Variations on a Theme: "I Becomes We..."

    weblog.jamisbuck.org 12 Mar '16, 4pm

    I was in Oregon last week, staying with my aunt and uncle, and on the way to their place I passed a church with a sign that read: When I becomes we, illness becomes wellness Now, normally I really like pithy little sayings like that. I love playing with language, and discovering insig...

  • Buckblog: Being a Good Neighbor...

    weblog.jamisbuck.org 05 Mar '16, 3pm

    Disclaimer: this post is a departure from my usual fare. No computers, no code, no programming. It’s intended primarily to help me process a rather painful, frustrating, and complicated episode in my life, and may or may not have any particular relevance to you. Years ago, when I live...

  • Implementing a "bloom" effect in Swift+Metal:

    Buckblog: Implementing a Bloom Effect with Swift+Metal

    weblog.jamisbuck.org 27 Feb '16, 7pm

    I’ve been learning a lot about Apple’s Metal framework recently, as I’ve been working through building a game based on navigating mazes on non-planar surfaces (cylinders, mobius strips, etc.). It’s been a lot of fun, but it’s also been pretty frustrating. Metal is still pretty new, so...

  • Buckblog: Don't Feed the Hamster the Whole Stalk

    weblog.jamisbuck.org 20 Feb '16, 9pm

    The bellow was answered–from across the house–with a sigh, as Fabian stopped scrubbing the floor and sat back on his ankles. It never failed. Right in the middle of the fall cleaning. He rubbed his eyes and wiped suds from his goatee, counting. six…seven…eight… “Fabian!” Fabian nodded...

  • Buckblog: The weakly-flowing stream

    weblog.jamisbuck.org 13 Feb '16, 9pm

    There’s a (possibly obscure) saying in Korean: “가늘게 흐르는 개울물도 바다로 간다.” Literally, it means “even the waters of a weakly-flowing stream go to the ocean.” From about the 5th grade until I graduated high school I lived in a small town on the Oregon coast. That was almost 25 years ago now,...

  • "Living With Your Eyes Open"

    Buckblog: Living with Your Eyes Open

    weblog.jamisbuck.org 06 Feb '16, 11pm

    6 February 2016 — The author shares some experiences in which learning came completely by surprise — 6-minute read A couple of years ago, I was struck by how much there was to learn. I tweeted this: The more I learn, the more I'm convinced that there's nothing that can't be learned. —...

  • Buckblog: Software Proverbs

    weblog.jamisbuck.org 30 Jan '16, 7pm

    When I was in Korea (20+ years ago), I picked up a little book called “속담백과”, which could maybe be translated as “The Proverb Encyclopedia”. It was a fun exploration of hundreds (thousands?) of Korean proverbs, all in Korean. I worked through a few pages of the book when I was in Kore...

  • Buckblog: Mazes in Swift

    weblog.jamisbuck.org 24 Jan '16, 2am

    I did it a bit differently this time. Instead of looking at existing code, I went a bit meta and instead read through The Official raywenderlich.com Swift Style Guide . I knew, going in, that a style guide was going to be a pretty opinionated document. For instance, if I were to read ...

  • Buckblog: A Pretty-Printer for SQL

    weblog.jamisbuck.org 16 Jan '16, 10pm

    Lately, I’ve been up to my elbows in enormous SQL queries. I can’t share the details, but suffice to say that it’s for a reporting app, and the SQL for these queries frequently run as much as 50,000 characters each. This happens because the queries are built up modularly, with each mo...

  • Don't Assume It's Difficult Until It Is

    Buckblog: Don't Assume It's Difficult until It Is

    weblog.jamisbuck.org 09 Jan '16, 9pm

    Does a task look like it might have some difficult or challenging bits? Don’t be too hasty in drawing that map. Your assumptions almost certainly have some gaping holes in them. About twenty years ago I returned home from a two-year stay in South Korea, where I had served as a mission...

  • This side-project has been so much fun to work on:

    Buckblog: Game Demonstration: Recover the Widgets

    weblog.jamisbuck.org 02 Jan '16, 8pm

    The THREE.js sample code I used to start experimenting (yay! a rotating cube!) used a field of view of 75 degrees. I continued using that for a while, but eventually found the slight fish-eye effect a bit disorienting. I went down to 45 degrees for a few iterations, but that turned ou...

  • Buckblog: Avoiding "Call Super" with Callbacks

    weblog.jamisbuck.org 19 Dec '15, 4pm

    is situation in which a superclass requires that subclasses invoke super when overriding a method. Martin Fowler is, I believe, among the first to have labelled this an anti-pattern (“minor code smell”, in his words), and he’s careful to point out the problem is not with the super cal...

  • Buckblog: Little Things: Introspecting Block Parameters

    weblog.jamisbuck.org 12 Dec '15, 9pm

    Since I don’t yet have permission from my client to share the actual code I wrote, I’ll demonstrate this esoteric little feature by monkeypatching Hash and adding a using method. The end result will let us access Hash keys that match the names of the parameters we pass to the block, l...

  • Buckblog: Integration API vs. Internal API

    weblog.jamisbuck.org 05 Dec '15, 5pm

    These typically manifest as callbacks. Webhooks are one form of this. GitHub, for instance, lets you specify a URL which will be sent information when some event occurs (like a commit). Parsers also use this technique, allowing you to supply a set of callbacks to be invoked at various...

  • Upsilon Mazes

    Buckblog: Upsilon Mazes

    weblog.jamisbuck.org 28 Nov '15, 9pm

    This article is adapted from material that I had originally written for my book, Mazes for Programmers @amazon | @b&n . It was intended to be the last section in chapter 8, “Exploring Other Grids”, following a discussion of hex and triangle grids. In order to trim the length of the bo...

  • Buckblog: Little Things: Refactoring with Hashes

    weblog.jamisbuck.org 22 Nov '15, 1am

    Right? And when I see a case statement being used simply to select between different values given some input, I find myself itching to rewrite it using a hash. Because, really, what is a hash, except a mapping that selects between different values, given some input?

  • Representing toroidal grids and mazes

    Buckblog: Representing a Toroidal Grid

    weblog.jamisbuck.org 22 Nov '15, 12am

    Toroidal grids share a lot with spherical grids (pg. 238 of my book), so some of this may sound very familiar if you’ve been through that. A spherical grid is basically a soup-can wrapper rolled so the east and west edges touch (and then with a bit of magic applied to the north and so...

  • Buckblog: The Dynamic Def

    weblog.jamisbuck.org 17 Oct '15, 8pm

    If you need justification for this, try a simple benchmark script. It turns out that using a nested def for memoization results in a memoized method that is about 30% faster…but honestly, that’s not saying much. Both techniques are pretty blazing fast. On my computer, 500k iterations ...