RSSAmplifier

Blog

Free Range Bits

Recent content on Free Range Bits

freerangebits.comRSS feed ↗77 posts

Latest posts

Automatic Theme Switching in Emacs


 I’m a dark theme nerd. Partially because of the hacker aesthetic, but
mostly because I prefer to work in dark environments and light themes
turn computer screens into floodlights. 
 However, in well lit rooms (or when working outdoors) dark themes
become completely unreadable. Such is the case in my office during
the morning hours. Naturally, I figured out how to…

Patching Instead of Pinning

In a previous post I showed how to work around a deadlock
between GnuPG and Emacs. As a brief recap, GnuPG 2.4.1 introduced a
change in its output which breaks a protocol that Emacs relied on, so
I pinned GnuPG to version 2.4.0 on my system to avoid the bug. 
 Damien Cassou reached out to me and expressed a
preferred way of dealing with this issue: patch the current version…

Archiving in Org Mode

As some of you may know, I practically live inside Emacs .
And like a lot of Emacs users a good portion of that time is spend in
 org-mode , a package that is hard to describe due to its
overwhelming large number of features. 
 One of the many ways I use org-mode is to implement a Getting Things
Done (GTD) workflow. That is, managing all of the projects that…

Pinning GnuPG with nixpkgs

GnuPG 2.4.1 was released all the way back in May but I failed to
notice until I upgraded to NixOS 23.11 a few weeks ago. And I only
noticed because Emacs froze when I tried to save an encrypted file.
It didn’t take me long to realize it was due to a change in
GnuPG . 
 Emacs and Encrypted Files 
 When working with encrypted files Emacs goes to great lengths…

Why the world needs Haskell

This is a technical review of Haskell and why software developers
should care about functional programming. For a non-technical review
of why your company should be using Haskell you might want to watch
 this introduction to Haskell video by FP Complete. 
 TL;DR: Writing high-quality, bug-free software isn’t easy.
 Haskell (and similar languages) provide the programmer…

Parsing with Haskell and Attoparsec

If you’re a Haskell programmer and haven’t gotten around to using
the wonderful Attoparsec library this video will give you a much
needed kick in the pants. For those of you who haven’t taken the
plunge with Haskell it might be interesting to see how straight
forward it is to write high performance parsers with Haskell. 

 
 
 

 The video…

Learn to read and write Scheme expressions

With this article you’ll begin your journey with the Scheme 
programming language by first learning how to read and understand
expressions and then how to write them. When you reach the end of
this article you’ll be ready to group your expressions into larger
components such as functions. 
 It will be most helpful if you follow along with the article using…

Picking your first programming language

When teaching an introductory programming course an overwhelming
majority of the boot camps and instructors (including myself) have
made the mistake of starting with a popular object-oriented language
such as Ruby or JavaScript . I love these languages and
eventually they are something students should learn but they’re not a
good choice as a first language. The same can…

JavaScript as a virtual machine?

When languages that compile/translate to JavaScript first started
becoming popular I rolled my eyes and kept on using JavaScript.
Adding a layer of indirection on top of an already high-level language
seemed like adding a spork to a picnic basket already stocked with a
full set of flatware. 
 You might be able to make the same argument when comparing C to
assembly, and…

Unix cheat sheets

Peteris Krumins is at it again with two *nix cheat sheets
that should help you explore your Unix-like system: 
 
 GNU Coreutils Cheat Sheet 
 Util-Linux Cheat Sheet 
 
 Not too long ago I wrote a shell script that gives you a
brief description of every tool in your PATH : 
 #!/bin/sh
 
 whatisthere () { 
 for dir in ` echo $PATH | sed 's/:/ /g' ` ; do…

Being explicit with your code

Christian Heilmann has a well reasoned gripe for
developers omitting semicolons in JavaScript: 
 
 Why would any intelligent person want to make it harder for others
to understand what they’ve done, keep booby-traps in their code that
will cause errors or deliberately write in a way that might make
others stumble? Is this some kind of code-trolling I don’t get?…

RubyGem Version Specifiers

When writing an application in Ruby it’s likely that you’ll make use
of several open source libraries that come packaged as RubyGems .
But do you know which versions of those gems are getting loaded into
your application? Will all versions work with your application? 
 It doesn’t matter if you are loading gems into your application
directly using require…

Ruby/Rails Compatibility Matrix

I found myself needing to figure out which versions of Ruby on Rails
run under which versions of Ruby. I couldn’t find a compatibility
chart so I put this together: 
 
 
 
 Rails Version 
 Possible Ruby Versions 
 Recommended Ruby Version 
 
 
 
 
 1.0–2.1 
 1.8.6 
 1.8.6 
 
 
 2.2 
 1.8.6 or 1.8.7 
 1.8.7…

Ruby's catch/throw, goto's little brother

Last week Pat Shaughnessy discovered that there’s a pre-processor
definition in the Ruby 1.9 source code to
 enable goto and label statements in a rather ugly
way: 
 
 The __goto__ statement will cause the MRI Ruby 1.9 interpreter to
jump up to the __label__ statement on the first line, since they
both refer to the same symbol :loop . 
 
 I don’t…

Fun stuff for Friday Feb. 24

It’s Friday, and an especially good one at that. At least for me
since it marks the start of a much needed vacation. Hopefully this
weekend will be good for everyone, and what better way to kick it off
than some fun and geeky articles and videos. 
 
 
 If you’re in the market for a new keyboard and think you want to
create one yourself, look no further than…

Fun stuff for Friday Feb. 10

This is going to be fun. I haven’t written a Fun Friday article this
year and my queue of things to share is sizable. To top it off, I
haven’t been keeping my self-imposed quota of at least one article a
day, so my general queue of articles to comment on has grown out of
control. This post will contain some fun things I want to share as
well as a few backlogged…

Using Haskell to improve your C++

I find myself drawn more and more to Haskell . Any language that
helps a developer write solid code without making you feel like you’re
using training wheels is a huge plus in my book. Functional
programming has also opened my eyes to all sorts of pitfalls with
imperative programming. 
 Even if you’re put off by Haskell or functional programming there’s…

Rails 4.0 will drop support for Ruby 1.8.7

Back in 2010 when Ruby on Rails 3.0 was released the core team
 dropped support for Ruby 1.8.x except for version 1.8.7.
With 4.0 scheduled for a release sometime in the Summer of 2012 all
versions of Ruby 1.8 will officially be dropped : 
 
 There’s not a lot of details about what we’re going to include in
Rails 4.0 yet as the primary purpose for bumping the…

Why estimating is hard

Software developers are notoriously bad at estimating, to the point
where project managers and bosses regularly double or even triple our
estimates. Tools like calculating developer velocities help average
out these errors but also tend to cover them up. So why is it so hard
to estimate development work? 
 Diego Basch hits the nail on the head in his opposition to the
idea…

Fixing programming by besting current languages

Jon BeltranDeHeredia’s rant on why programming is broken has
turned into a very interesting thought experiment. First, Jon
describes why he thinks programming is broken: 
 
 Every step of the way, in every statement, line of code, function
call or sequence-point, if you want to write good code, you need to
think about all the different possible states of the…

I took some programming in school != programmer

How often does a boss/client tell you they have a good sense of how
long something should take because they “took some programming in
school”. I can’t tell you all the times I’ve picked up a train wreck
project written by someone who “knew enough to be dangerous”. Being
good with a computer or taking a Java course in college does not make
one…

2012 seems to be the year for learning to code

If your new year’s resolutions include learning how to write code, or
if that one buddy who keeps talking about learning to program is still
bugging you, this might be your lucky year. 
 Mike Gehard thinks you should start with the Ruby programming
language so he created an outline of assignments that will put
you on the right path: 
 
 Welcome to my attempt at…

Hashing algorithm vulnerable to denial of service

It’s likely that the hashing algorithm in your favorite language is
vulnerable to a denial of service attack . While Perl fixed this
forever ago, other languages have been caught with their pants down: 
 
 … the flaw affects a long list of technologies, including PHP,
ASP.NET, Java, Python, Ruby, Apache Tomcat, Apache Geronimo, Jetty,
and Glassfish, as well as…

Java is dead, long live Java

If you only caught the headline from the recent OMGUbuntu 
article about Java being removed from Ubuntu, you may want to catch
the whole story from Simon Phipps: 
 
 Java is not being removed from Ubuntu. OpenJDK is the open source
version Java, is developed primarily by Oracle, is becoming the
reference implementation and is available in Ubuntu. The Sun-Java
packages…

Fun stuff for Friday Dec. 16

The holiday season is in full swing and for a lot of people this
Friday marks the start of a long vacation. To celebrate while keeping
your mind sharp, here are a few things to check out over the weekend: 
 
 
 If you missed it, Python was voted best language for the
third year running by readers of Linux Magazine . C++ was
the runner up, which sort of makes sense. A…

PostgreSQL as a key-value store

I just read an interesting article about using PostgreSQL 
as a key-value store using the hstore module: 
 
 Yes I know you are really happy with your “persistent” Key Value
store. But did anybody notice hstore that comes along Postgresql. I
find Postgresql to be a really great RDBMS that has been ignored all
the time. 
 
 Okay, maybe the English in this…

Improving your skills by reading commits

Pat Shaughnessy has a great idea for people looking to improve their
Ruby skills, study commits to Rails: 
 
 There are plenty of examples of elegant code, cool testing
techniques and great new features in Rails if you go and look for
them, but what impressed me the most were the small things. Like the
small, in-between notes and simple harmonies in the midst of a…

VendorKit: bundler for Objective-C

Having trouble maintaining dependencies in your Objective-C
application? Love the way Bundler deals with Ruby Gem
dependencies? You may want to take a look at VendorKit : 
 
 VendorKit makes the process of using and managing libraries in iOS
easy. VendorKit is modeled after Bundler. VendorKit streamlines the
installation and update process for dependent libraries. It…

Fun stuff for Friday Dec. 2

I’m slowly getting back on track after taking an extended holiday last
week and then catching a cold this week. Needless to say, I’m pretty
happy that it’s Friday, and I have a whole bunch of fun stuff to
share, so let’s get to it. 
 
 
 Hackerbuddy has relaunched with a bunch of improvements and some
new features. Full details in this article .…

HAML users repent before it's too late

I used to have a coworker that would constantly bug me about how
awesome HAML is, but whenever I looked at HAML code all I saw was
noise. Brandon Keepers has done a much better job at
explaining why you should avoid HAML: 
 
 I agree that HAML is easier to write than HTML, simply because it
involves less typing. But I feel it is infinitely harder to
read. While the…

Seven databases in seven weeks

If you enjoyed Bruce Tate’s book Seven Languages in Seven Weeks 
you might also enjoy Seven Databases in Seven Weeks by Eric
Redmond and Jim Wilson: 
 
 Data is getting bigger and more complex by the day, and so are your
choices in handling it. From traditional RDBMS to newer NoSQL
approaches, Seven Databases in Seven Weeks takes you on a tour of
some of the…

Don't be affraid to learn vi or emacs

Over at the thoughtbot blog there’s an article about the
 myth of the vim learning curve . I think everything said
about vi/vim can equally be applied to Emacs . The path to
getting up and running isn’t as daunting as you might think: 
 
 Go to your shell and type vimtutor . The tutorial that’s presented
is excellent and you’ll be through it in no…

Git workflows and configuration

If you’re new to Git or are looking for some branching workflow
guidance Kumar McMillan has put together an article about
 topic branches and rebasing using Git: 
 
 The nice thing about working in a topic branch is it’s isolated from
master and no one else is tracking that branch so I can use git
rebase to create the best commit before merging into master.…

Simple code makes good software

Alex Obenauer has been rustling some feathers with his
 recent article entitled “Stop writing good code; start writing
good software”: 
 
 Do you really need a full objet-oriented API right now? Do you
really need to make a dozen interwoven classes, when it’s possible
just a hundred or so lines in one class will do fine? Can you do all
the same error…

Fun stuff for Friday Nov. 18

This past week has been a blur for me so I’m totally ready for the
weekend. The kids and I have been making our way through the Alien
films and tonight we’re on number 3. I don’t have fond memories of
the movie but I’m sure we’ll have fun. 
 Hopefully you have some fun planned yourself and the links below will
help you kick off the weekend. 
…

Concurrency in Ruby 1.9

Ruby 1.9 introduced an additional concurrency mechanism called Fibers.
If you haven’t played with Fibers or still haven’t discovered Ruby
continuations William Morgan has written an article that you
might want to take a look at: 
 
 Ruby 1.9 has both fibers and continuations. The two are often
mentioned in the same breath. They do vaguely…

The Objective-C object model

If you’re an Objective-C developer you can get a lot done without
understanding the C roots in Objective-C or the object model employed
by Objective-C. In fact, trying to learn the object model can be
intimidating and confusing because some peculiar complexities. 
 Even if it’s a little complex, it’s a worthy endeavor to learn the
Objective-C object model…

C++11 move semantics and rvalue references

I stopped following the C++0x standardization process a long time ago,
so when C++11 was announced I delighted in some of the developments
that I had missed. Then I saw “move semantics” and thought to myself
WTF? Then I found this stackoverflow answer and now I’m good.
There’s also this section in the C++11 FAQ . 


Remote pair programming in a terminal

Pair programming is becoming more popular due to the good old
terminal. Instead of having to sit next to your coworker who had an
onion sandwich for lunch you can use terminal sharing from across the
office or the country. And with services like Ruby Pair that
connect people who want to pair program, knowing how to use a terminal
multiplexer is worth a few minutes of your time.…

Fun stuff for Friday Nov. 11

Not only is it Friday, but here in the US it’s veterans day, which
means some of you might not even be working. That reminds me, I
better go out and take the mail out of my mailbox since the post isn’t
running today. 
 Here are some fun things to look at over the weekend: 
 
 
 ZeroMQ is an older project that I’ve just stumbled upon. It
provides an…

Those Objective-C "@" Directives

Steffen Itterheim has compiled a complete list of those
Objective-C @ compiler directives: 
 
 I haven’t been able to find a list of all Objective-C @ compiler
directives in one place. We all know the keywords like @interface
and @implementation but others like @dynamic and @encode are lesser
known, and possibly even much less understood. 
 
 You might also…

The basics of good programming style

Isaac Taylor has written an article that we’ve all probably
read before: the dos and don’ts of programming style. 
 
 Striving to write good code should be the goal of every Software
Developer. Writing code that is easily maintainable, robust, simple,
and makes sense is no easy task. It takes years of practice and
uncountable hours of time to become a good…

A closer look at Redis

If you’re not familiar with Redis it’s a key-value store that
gained popularity as a replacement for memcached due to its ability
to store and manipulate structured data (e.g. increment an integer,
get the union of two sets, etc.). Redis is worth checking out if you
need a high performance, in-memory, key-value store with persistence. 
 The fifteen minute…

Managing debt buildup while developing

Technical debt is one of those things that every developer knew
about before it had a proper name, but after Ward Cunningham 
coined the term we had a tool to drive conversation and encourage
decision makers to do the right thing. It also gave us the ability to
evaluate how much technical debt was acceptable and even sometimes
necessary. 
 In the real world, completely…

Fun stuff for Friday Nov. 4

It’s Friday again and here are some geeky things to cuddle up with as
the workday comes to an end and you start to dream of the weekend: 
 
 
 The Star Wars Alphabet . Can you figure out all the
letters? 
 
 
 With git-jump coming in the next release of Git Emacs users
might want to take advantage of it . 
 
 
 Videos to watch: a…

Self-guided Ruby on Rails 3.1 Tutorial

One of the complaints about Ruby on Rails that I hear most often
is its complexity, despite all the video tutorials showing how easy it
is to build a simple application in 5 minutes. In reality, Rails was
a huge paradigm shift for web application development and even with
its complexity it’s a great platform. 
 I’ve spent the better part of the last 6 years writing…

The longevity of OS APIs vs. web APIs

Nick Bradbury makes a good point about the longevity of
operating system APIs compared to the more brittle APIs of the web: 
 
 You might think you’re immune to this problem if you only integrate
with APIs created by large players such as Twitter, Facebook and
Google. But in recent years we’ve seen Twitter switch to a new
authentication system, Facebook…

Global Day of Coderetreat

Here in Colorado we’ve had a pretty regular helping of
 Coderetreats . And now everyone is going to
 do it on the same day : 
 
 Global Day of Coderetreat is a world-wide event celebrating passion
and software craftsmanship. We will spend the day practicing the
craft of software development using the [coderetreat format]
 coderetreats . You can find out more…

Learning the fundamentals of Scala

It seems to me that Scala has been popping up all over the place
in the last couple of years and I’m starting to see it in more and
more job descriptions. If you’re new to Scala then Craig Tataryn has
a very well written introduction to the fundamentals of Scala: 
 
 What was the biggest mistake I made when I first started learning
Scala? I jumped in without…

Giving JavaScript another chance

JavaScript has been the subject of much public ridicule, and not just
for its name. People have even written alternatives to
JavaScript that translate into JavaScript so they can run in
existing browsers. Personally, I think JavaScript has some obvious
shortcomings but for the most part is a pretty usable language. 
 Here are some recent JavaScript related articles that have…