Mar 212017
 

Apple to Ubuntu

For almost the last 20 years, an Apple laptop of one variety or another has been my main computing device. Imagine my surprise when I finally learned today that Apple keyboards don’t have an Insert key. In almost two decades I have never needed it, but that changed this morning.

While working in my favorite Python editor, Wing IDE by Wingware, some sloppy touch typing resulted in the cursor changing from the blinking vertical line I am used to a blinking underline. That change was subtle enough that I missed it, but as soon as I began typing and the text I was entering started overwriting the existing code, I knew something was up. WTF!

Continue reading »

Feb 152017
 

SWI-Prolog Logo

I know that this post will probably be of interest to about a dozen people worldwide, and even those few may be disappointed by it. Since the official SWI-Prolog packages aren’t often kept up to date and because compiling and installing SWI-Prolog from source should be both quick and straightforward, that is the recommended way to do it on Linux and other *nix systems.

If you are looking for tips, tricks or assistance with an installation problem, you likely won’t find it here. The instructions provided on the SWI-Prolog site for building and installing SWI-Prolog from source code “just worked” for me. Nevertheless, I want to document what I did, and if you are looking for the Cliff Notes version, then by all means, read on.

Continue reading »

Feb 092017
 

Inkscape Logo

GIMP has done such a good job filling the Photoshop-shaped hole in my software arsenal left during my transition from OS X to Ubuntu, that until today I forgot that I sometimes work with vector-based images, and for that I had been using Adobe Illustrator.  The best free, as in both beer and speech, Illustrator alternative is Inkscape, a professional vector graphics editor available for Windows, OS X, and Linux.

The problem: 
I want to import an Adobe color palette (.aco file) into Inkscape.

The solution: 
This is not as straightforward as I expected. Without using a third party plugin, the solution is a multi-step process. Read on to learn how I did it.

Continue reading »

Jan 292017
 

Binary NumbersAbraham Lincoln once famously said, “Everybody loves a compliment.”  I suspect that if he had been a mathematician he would have loved complements, too. We’ve already seen what complements are and talked about the two most prolific: the radix complement and the diminished radix complement. Now it’s time to explore how we can leverage complements to do some really interesting integer arithmetic. Using complements we can subtract one positive integer from another or add a negative integer to a positive one by simply performing addition with two positive integers. The algorithm behind this black magic is called the Method of Complements.

Continue reading »

Jan 212017
 

Python Logo

I am excited this evening. Why? Because I am finally getting back to some real Python development. While I have recently coded up some GIMP plug-ins, I haven’t really taken the time to properly set up my Python environment since making the switch from OS X to Ubuntu in December.  Now I’ve got some Django programming to do, but before I can start installing any third party packages, I’ll need to install pip, the de facto package management system for installing and managing Python packages. Think of pip being to Python as apt is to Ubuntu. The main repository for Python software is PyPi, the Python Package Index.

Continue reading »

Jan 102017
 

Binary NumbersIn my last post about binary signed integers, I introduced the ones complement representation. At the time, I said that the ones complement was found by taking the bitwise complement of the number. My explanation about how to do this was simple: invert each bit, flipping 1 to 0 and vice versa. While it’s true that this is all you need to know in order to determine the ones complement of a binary number, if you want to understand how computers do arithmetic with signed integers and why they represent them the way they do, then you need to understand what complements are and how the method of complements allows computers to subtract one integer from another, or add a positive and negative integer, by doing addition with only positive integers.

Continue reading »

Jan 042017
 

GIMP logo

In my last post, I briefly explained GIMP‘s scripting and plug-in system and the two most common ways to program custom extensions and scripts: Script-Fu and Python-Fu. Script-Fu, being the older of the two options, is well documented and the more widely used of the two. Not because I love the road less traveled, but because I love Python, I have chosen Python-Fu, a set of Python modules that serve as a wrapper for libgimp, as my platform for extending GIMP.

This post (and any I hopefully follow up with) are meant to track my progress as I learn my way around Python-Fu. Even while writing relatively simple scripts I have encountered gotchas and conflicting information about how to do things. Hopefully some of what I’ve discovered scouring both the web and Python source code will save other developers the time and frustration I’ve already paid.

Continue reading »

Dec 092016
 

GIMP logo

For several years now, Adobe Photoshop has been the sole reason that I have continued to run Mac OS X. During that time, I have done the majority of my work in an Ubuntu instance running in a Parallels virtual machine. I’ve finally bitten the bullet and installed Ubuntu as the primary operating system on my MacBook Pro. I couldn’t be more pleased with how the transition has gone, and I regret not doing it earlier.

Continue reading »

Nov 012016
 

Internet Protocol version 6 (IPv6)

In the course of troubleshooting a pseudo-distributed mode installation of Apache Hadoop on my Ubuntu 16.04 vm, one of the tips I stumbled across suggested disabling IPv6.

For any networking neophytes, Internet Protocol version 6, aka IPv6, is the most recent version of the Internet Protocol (IP), the system governing the assignment of addresses to networks and computers on the Internet. IPv6 was created to replace IPv4 which, why still predominantly used by most systems, is quickly running out available addresses. Unlike IPv4, which is a 32 bit addressing scheme offering 2^{32} or roughly 4.3 billion addresses, IPv6 addresses are 128 bits, meaning that there are theoretically 2^{128} or roughly 3.4 \times 10^{38} addresses.

Continue reading »

Jul 262016
 

Binary NumbersIn the last post, we saw that one of the major failings of the signed magnitude representation was that addition and subtraction could not be performed on the same hardware as for unsigned integers. As I pointed out, the reason for this is because negating a number in signed magnitude does not yield the additive inverse of that number. The ones complement representation eliminates this issue, although it does introduce new, subtle issues, and [spoiler] doesn’t address the problem of having two representations for zero.

Continue reading »