There was an interesting problem this week again which I didn't immediately have a solution for. I was facing a multi-gigabyte csv file which had some broken lines:
ID|foo|bar|baz|freeinputfield 1|awef|hbsrt|25.2|1235~6343~2345 2|awef|hbsrt|25.2|856~12546~9867 3|awef|hbsrt|25.2|7136~1111~9672 4|anad|sthjnk|13|7777~23 523~364 5|cbvx|srtbd|99.9|12345~12346~11111 Of course someone put newlines into the freeinputfield and noone cleaned that up so far... How do you fix that while on a tight time budget and suffering from data gravity?
Vi(m) to the rescue!
Right now there's a discussion on Hacker News going on reiterating over Rob Pike's comments on commit messages. There's one particular comment by the user 'mumblemumble' I want to quote for future reference:
Some information is a pre-requisite for understanding a specific block of code. This information is a great fit for comments, because everyone who's looking at the code will need to know it, and having it in a comment ensures that it's discoverable.
After succeeding in crosscompiling Gitea I wanted to setup a test installation of Gitea with support for sqlite so I didn't have to setup a database before being able to fiddle around with the installation's settings. As mentioned in the source install instructions for Gitea you can specify an environment variable to include sqlite support in the Gitea build:
$ TAGS="bindata sqlite sqlite_unlock_notify" make generate build Trying to crosscompile this results in the Gitea installation wizard to complain about being built without CGO_ENABLED=1: Issue #384 and its discussion at the go-sqlite3 repo sheds some light on what's supposed to happen.
Using a RaspberryPi is fun and easy! Just like with any adventure heroes and heroines follow their paths to glory and fight minor beasts with foreign names like Nginx and Hugo. However sometimes they come across beasts that make up nightmares. One of those bears the name 'Crosscompile'.
Storytelling aside, crosscompiling always filled me with fear because it seemed to be so complicated and error prone. Introduce Go! Go seems to make crosscompiling really really easy.
Hello, world!
This is my first post in a newly started blog powered by Hugo.