Skip to content

Instantly share code, notes, and snippets.

@jtacoma
jtacoma / conventions.md
Last active December 27, 2015 23:19
Conventions

Lately, I've been trying to get started on porting Hula Hoop (an Android app based on the GDX game programming library and the Box2D physics library) to C/C++. Of course, it's of utmost importance to shave a few yaks before getting started.

First Steps

GNU/Linux is a software development environment in much the same way that git is a source code management tool: they're both of the "choose your own convention" variety so common in the Unix culture (linfo.org, joelonsoftware.com). Some things I've figured out so far:

  • If the app is going to be built for a variety of platforms, I'm going to need to build the dependecies for those platforms too. That means I don't want to depend on system-wide library installations, and
@jtacoma
jtacoma / Dockerfile
Created January 25, 2014 21:14
Dockerfile for ZeroMQ 4.x development
FROM ubuntu
MAINTAINER Joshua Tacoma <[email protected]>
RUN apt-get install -y build-essential git libtool
RUN git clone https://github.com/jedisct1/libsodium && cd libsodium && ./autogen.sh && ./configure && make check install && ldconfig && cd ..
RUN git clone https://github.com/zeromq/zeromq4-x && cd zeromq4-x && ./autogen.sh && ./configure && make check install && ldconfig && cd ..
RUN git clone https://github.com/zeromq/czmq && cd czmq && ./autogen.sh && ./configure && make check install && ldconfig && cd ..
@jtacoma
jtacoma / net35.diff
Created February 7, 2014 15:40
Apply this diff to bfc0349506fc8d2ea80e80eb36cbd838092313a6 of zeromq/netmq to make it compatible with .Net 3.5, thanks to https://gist.github.com/tobi-tobsen/6389448 for an earlier version of this patch.
diff --git a/src/NetMQ.Tests/NetMQ.Tests.csproj b/src/NetMQ.Tests/NetMQ.Tests.csproj
index bb7590e..5d4f9f8 100644
--- a/src/NetMQ.Tests/NetMQ.Tests.csproj
+++ b/src/NetMQ.Tests/NetMQ.Tests.csproj
@@ -12,6 +12,8 @@
<AssemblyName>NetMQ.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
@jtacoma
jtacoma / index.html
Last active August 29, 2015 14:01
libswe demo
<html>
<head>
<script src="https://github.com/jtacoma/libswe/releases/download/v2.00.00-1alpha0/libswe.js"></script>
</head>
<body>
<p>
The current time, as a Julian Day Number in Universal Time, as
calculated by the Swiss Ephemeris is:
</p>
<p>
@jtacoma
jtacoma / index.md
Last active August 29, 2015 14:08
UTF is not a character encoding

[Unicode transformation formats (UTF)][utf] is not a character encoding. It is a family of mutually incompatible character encodings that are each capable of expressing the full range of possible Unicode characters.

Microsoft desktop applications that deal with plain text files, e.g. Notepad and Excel, use [UTF-16LE][utf16] under the name Unicode. Newer versions also offer UTF-16BE under the name Unicode big endian. An idiosyncrasy of Microsoft applications is that the character encoding of a plain text file is declared in a [byte order mark (BOM)][bom] at the beginning of the file. This works like magic in many cases, but results in a few garbled characters at the beginning of the file when the BOM is not respected as such.

While the preferred encoding for web applications these days is [UTF-8][utf8], not all platforms allow custom content to declare its character encoding. Even Microsoft's own IIS doesn't respect the [BOM][bom]. Plain text file formats like CSS and JavaScript that, unlike XML an

@jtacoma
jtacoma / index.md
Created October 23, 2014 16:39
Dialogues don't have menu bars

A dialogue box doesn't have menu bars, tool bars, tool strips, ribbons, or status bars. A dialogue box has one or more buttons near the bottom. Clicking on a button that is labelled Ok, Cancel, Yes, or No normally closes the dialogue but this can sometimes be circumvented e.g. by an error about missing or malformed data, or by saying No in response to a subsequent dialogue that asks, "Are you sure?" Some authorities distinguish dialogue boxes from message boxes by the latter's inability to receive any user input beyond which button was pressed, but they are otherwise the same.

  • A dialogue box cannot be maximized or minimized.
  • Closing a dialogue box has the same effect as clicking its Cancel button if the dialogue box has a Cancel button, otherwise the No button. If a dialogue box has no such button, it should not be possible to close the dialogue box without clicking a button.
  • When the keyboard focus is on a dialogue box that has a Cancel button, pressing the Esc key is equivale
@jtacoma
jtacoma / README.md
Last active August 29, 2015 14:13
pushenv

pushenv

pushenv helps update your Bash or Zsh environment for compilation and linking with dependencies that are built and installed to different paths.

Installation

source pushenv.sh

@jtacoma
jtacoma / openpgp.txt
Created September 4, 2017 17:05
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:079a07c864f3d51cde5830a00e0f131e6ff70348]
@jtacoma
jtacoma / openpgp.txt
Created September 4, 2017 17:05
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:079a07c864f3d51cde5830a00e0f131e6ff70348]
@jtacoma
jtacoma / openpgp.txt
Created September 4, 2017 17:06
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:079a07c864f3d51cde5830a00e0f131e6ff70348]