Sending GMail with Go (Golang)

Jim Lawless
I needed a command-line e-mail sender utility that would send e-mail via my GMail account. I wanted the solution to work on Windows and OS/X for the time being. My solution is a utility named GSend. GitHub repo: https://github.com/jimlawless/gsend/ The Go source is as follows: // Copyright 2013 - by Jim Lawless // License: MIT / X11 // See: http://www.mailsend-online.com/license2013.php // // Bear with me ... I'm a Go noob. package main import ( "log" "flag" "net/smtp" "fmt" ) func main() { to := flag.

Variant Types in Go (Golang)

Jim Lawless
Here we Go again… I had corresponded with some seasoned Go programmers about variant types some time ago. I was searching for a way to keep a slice of data where each element might be a different data-type. The approach I had been taking was in trying to define a data-structure that could act as a wrapper for some of the basic data types. I then learned through the wisdom of these developers that Go could already accommodate my needs in a much simpler fashion.

Ancient Devtools

Jim Lawless
When I first began using microcomputers in the late 1970’s, development tools for 8-bit machines were precious and mysterious commodities. Most of these sorts of tools that looked to be useful were very expensive. My usage of most of these tools was driven by budgetary constraints. The Gateway Drug : BASIC All it really took to pique someone’s interest in microcomputers was to show them a simple program such as:

My First Android App

Jim Lawless
Several months ago, as the “year of learning to code” was getting underway, I wondered what it would be like to have a JavaScript REPL available for my mobile device. I figured that I could build my own mobile app using the PhoneGap framework that would simply expose a large textarea that could be eval()‘ed at the tap of a button. I bought an older Android tablet to prove the concept.

Building a World War II Foxhole Radio

Jim Lawless
When I was a kid, I was fascinated by crystal radios. The first one I had was in the form of a backpack for the Six Million Dollar Man action figure ( Mom picked up the crystal set at some kind of sale before I ever had the action figure ). The thing that fascinated me about crystal radios was that they required no external power-source; the radio signals themselves were strong enough to power a small earpiece at an acceptable volume.

BBS Fun in the Eighties

Jim Lawless
My introduction to the world of electronic bulletin-board systems ( BBS’s ) began in the mid-1980’s. One evening, my friend John called to say that he’d gotten a modem for his Commodore 64. On a whim, I went to Sears and spent over $60 for the same 300 baud “dumb” VIC-1600 modem. This modem was marketed for the VIC-20, but it worked with the C64 as well. It lacked the auto-answer/auto-dial features that were present in the 1650 modem.

Flirtin' with Forth

Jim Lawless
I was a senior in high-school in the mid-1980’s when I first encountered a dialect of the Forth programming language. I was quite familiar with BASIC and Z-80 assembly-language and was just beginning to hand-assemble some 6502 code. One of my instructors brought in King Microware Tiny Forth for the Commodore 64 computer in her lab. I was intrigued, at first, and tried to tinker with Forth. The booklet that came with Tiny Forth described the following line of code that I was supposed to enter at the OK prompt:

FIF Isn't Forth

Jim Lawless
Several years ago, I created a Forth-like programming language interpreter called FIF ( FIF Isn’t Forth ). I put FIF aside for a while as other events began to consume my time. I ultimately ended up losing all of the source code that I had built to that point. I had pondered trying to recreate it, but the work I had done in making FIF opened my eyes to things that I’d want to do differently.

Embedding Javascript in a Batch File

Jim Lawless
The program below is both a batch file and a JavaScript WSH console file. The dual nature of the file is achieved via JavaScript block comments and the strategy by which the command interpreter searches for target labels in a batch file. Save the file below as hybrid.bat … rem ( /* @echo off cscript /nologo /e:javascript hybrid.bat goto end */ ) // by Jim Lawless // This program sample is in the public domain function rem() { WScript.

Obfuscated C

Jim Lawless
I had written a little C program a while back for the 19th annual International Obfuscated C Coding contest. Not only did my code not win … it didn’t even warrant an entry in the honorable mentions or anything like that. If you look at the winners and look back at my code, you’ll immediately see why; the winners and the runners-up were much more creative than my effort. Rather than get lost in obscurity, I felt that my entry needed to be published, so it has been given the honor of appearing in my first public blog post.