Convert character encoding of a CSV file for InDesign Data Merge

InDesign’s Data Merge feature is great. This is a video I return to, when I need to use it.

There is a catch, though: the data must be in the right format for this to work with Swedish text, which has å, ä and ö.

  1. Use a spreadsheet app to make a dataset (columns and rows)
  2. Use column names without spaces, and only lower-case characters. Do not use any “special characters”. So: only between a-z.
  3. Export it to CSV format
  4. Open the Terminal app in your Mac
  5. Change to your directory where the file is by dragging its folder into the Terminal window and hit ENTER.
  6. Type the following text command and press ENTER to change the file filen.csv to the target format (which is called utf-16):
    iconv -f utf-8 -t utf-16 < filen.csv > filen2.csv
  7. A new file filen2.csv is created in the same directory.
  8. Use this new file in your InDesign data merge!

Nerd notes:

  • Typing man iconv will bring up a text manual for the iconv command. Try it! (Quit the manual by typing q.)
  • the < and > are “output redirection” symbols, used in two directions in this so-called pipeline

The manual taught us that the command can be expressed as:

iconv --from-code utf-8 --to-code utf-16 < filen.csv > filen2.csv

This may be easier to read.

  • Changing directory can be done using the text command cd (“change directory”), followed by the path you want to navigate to.
  • pwd is a text command that reads “print working directory”. Try it!

Ruby: Rubocop-friendly Hash pretty-printer

You’re desperate. Your legacy code-generation code outputs a Hash using hash#to_s. You’ve flouted many Rubocop rules to get to where you are. Suddenly, it gets too much. You search the Web for a pretty-print function that you want: a Rubocop-friendly Hash pretty-printer.

Empty-handed, you cough up blood, while a police car’s red-blue lights flicker in through the blinds of your run-down office.

sethw-cop-car-lights

With tired fingers, you type out something like:

Then, you faint, blessed sleep converges on you and envelopes you in a colorless void.

Photo credit: sethw

Finished 2666

I finished reading a novel. Been a long slog. Five years to read a novel? Some blogger said they immediately began re-reading it, to see and experience the rich intertextuality etc. Thanks, Evan, for the reminder that it’s been so long. PS: the book was grand.

IndieWeb clubbery

Tonight, I made it to Homebrew Website Club hosted at inUse in Malmö. I was greeted by three kind souls, among them a proprietor of a Lego fan website with a 176 contributors – and Pelle and Emil.

The club format is the same every time: first an hour of social or at-your-computer time. Then an hour of show-and-tell explanations, demoing and showing stuff.

Emil showed us CSS and SVG techniques, some of them brilliant. SVG is a deep well to drink from. Read more at Sara Soueidan’s website.

Pelle made a very nice hands-on demo of a system of services he’s built, which involved commenting on any page using his telephone.

We had talked about Node.js a fair bit, and I showed what the private caching npm server sinopia looks like when installed. Its claim to fame is its file-based caching – don’t fetch packages from the central repository more than you need.

When I had showed that, we had used up our time, and it was time to put the crisps down and go home. How kind, to have time limit, so that people on tight schedules won’t miss stuff.

On the way out, I asked: “Pelle, do you have a exercise for me to take home?” He responded immediately: “Make your site receive or send WebMentions.”

I look forward to next time.

Aiga forward and left arrow, an example of a random SVG

Git Pre-commit hooks!

Not even once!

Run relevant code-checking tools on your code, before it is even checked in locally. Using the Ruby project Overcommit, you can set this up on your own machine in a jiffy. Or, read more about git hooks.

I took these steps:

  1. Install the overcommit gem in your active Ruby. gem i overcommit
  2. Install overcommit in your system Ruby, using this neat trick:PATH=/usr/bin:/bin:/usr/sbin:/sbin sudo gem install overcommit – This makes it available to tools like SourceTree! (On committing, it opens a bare shell, without your cool settings.)
  3. In your project directory, where you wish to begin using Overcommit to run Git hooks: overcommit --init
  4. Configure the resulting .overcommit.yml to enable/disable the checks you want run.
  5. Try committing a file which would fail a check.
  6. Profit!

PS: Here is an example .overcommit.yml:

PreCommit:
  ALL:
    problem_on_unmodified_line: warn
  CoffeeLint:
    enabled: true
  RuboCop:
    enabled: true

Visited a gamefest: Nordic Game Jam 2007

Copy-party (or less aggressively, and perhaps more descriptively “demo-party”), that was the name of a weekend of mildly Dionysian digital festival here in Northern Europe during the late 80s and the 90s.

*Update:* Danish radio DR1’s show Harddisken has Frederik Berg Olsen’s radio programme about NGJ07. FBO had a tape recorder with him, and made a Gonzo radio reportage from the event, which’ll be broadcast (in Danish) tonight at 20:00. You can also download it, and hear it at your leisure.

Yesterday, I experienced the same kind of group exhilaration at Nordic Game Jam, a meetup of kindred souls from the Nordic area in Copenhagen’s IT university building. A whole weekend! 36 hours to design and make a computer game. No holds barred.

(I think the constraints of this Jam was about game design, not about technology.)

Fellow Copenhagener Frederik Berg Olsen was there, participating with the Snowscape team, as a game designer. I met his team-mates, and even though the rigors of completing a computer game in a limited time-span take their toll, they were a cheerful and kind lot. The puns at mid-afternoon on Sunday were quite… ripe. “RoboSnow! SnoboCop!”

My thoughts about what tools to bring to the next year’s Jam was:

* exotic hardware (dance mats, game joysticks with “force feedback”, light pistols, NES handcontrols — hm, should one make a NES game? Thorbiörn, whaddya say?)
* super-productive software kit to run said hardware (Pygame, some Ruby wrappers for SDL, perhaps, some Windows package — maybe HGE — to make games). Having tried the software before could be good. Does it run on my laptop? Does it do sound input? You know, trying to moderate the effects of Murphy’s Law.
* or, taking the “prevalent” route: Flash, with all bells and whistles. Or, even Javascript? In-browser, or not?
* or, tying in the Web in some way
* good ideas, games that you want to make

Yes, I say next year, ’cause I’m coming then. It looked like tons of fun.

Practical details that might be useful:

* Integration/build machine for Java projects. Run the Buildix live-CD Linux distribution.
* A wiki-wall of Post-its and so on, where Help Wanted, Stuff We Brought, Have You Seen My Blue Cable, etc, could be put up
* Pre-event setup Subversion repositories for everything — maybe Google Code? But, you need to be able to set the stuff up lightning-fast
* Perhaps having your own team’s tech-support/auxiliary guru to solve any crises. (But, hey, no crises, please.)

Update: I got Gosu with Ruby to work! It’s a delightful 2D-game framework. Cute!

[tags]programming,gamedev,nordicgamejam,gosu,ruby[/tags]

Rubygems now features ‘Skip this gem’ in installation

Ruby’s code-distribution mechanism Rubygems is being released in a new version real soon, and some small useful features are already in the RCs. Like “Skip this gem”, which makes it possible to skip a single update, but continue with the rest of the set of updates for your gems. Here is a demonstration of just that:

$ sudo gem up -y
Password:
Updating installed gems...
Need to update 25 gems from http://gems.rubyforge.org
.........................
complete
Attempting remote update of sqlite3-ruby
Select which gem to install for your platform (powerpc-darwin8.8.0)
 1. sqlite3-ruby 1.2.0 (mswin32)
 2. sqlite3-ruby 1.2.0 (ruby)
 3. sqlite3-ruby 1.1.0.1 (ruby)
 4. sqlite3-ruby 1.1.0.1 (mswin32)
 5. sqlite3-ruby 1.1.0.1 (ruby)
 6. sqlite3-ruby 1.1.0.1 (mswin32)
 7. Skip this gem
 8. Cancel installation
> 2
Building native extensions.  This could take a while...
Successfully installed sqlite3-ruby-1.2.0
Installing ri documentation for sqlite3-ruby-1.2.0...
Installing RDoc documentation for sqlite3-ruby-1.2.0...
Gems: [sqlite3-ruby] updated

Pretty damn necessary.

[tags]ruby,rubygems[/tags]

Intro to J language

Via Dave, my favorite Dutch-speaking Australian Computer Scientist, I got wind of this fine J programming language introduction, written by our common acquaintance Cratylus.

A short text, it goes directly into parsing how J looks, and then a bit about its operators. No speculation, just explanation. Thanks, C!

And, Dave: I love the new handle-bars.

[tags]jlanguage,programming[/tags]

Upcoming game developer conference – Nordic Game Jam

My dear L is now working at Diginet Øresund. This event might be of interest to you, dear reader, should you live in the Nordic countries:

…Nordic Game Jam ’07, which is hosted by Diginet Øresund (my new job – I’ll be managing the event). Thought you might be interested. Or maybe you know someone else who might be.

  • What: make a game on a weekend and meet other developers
  • When: 2-4 February 2007 (last sign-up January 22)
  • Where: IT University, Copenhagen
  • Price: 250 DKK

Signup page for GameJam and more details about GameJam

Hope I’ll be seeing you there – if you need it, you can crash in our kitchen.