This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Read this file first. | |
Then read the comments at the top of parity_test.c | |
Then read the comments above each algorithm implementation in parity.c | |
So there I was talking about efficient implemetation of fundamental functions | |
with Palmer over at SiFive. Back in the day, I used to participate in informal | |
contests on rec.games.programmer to see who could craft the most efficient | |
implementations for population count or bit reversal or bit-blitting. For | |
programmer types, it's great fun. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I'm a fan of old-school VT220 & VT340 terminals. A | |
// while back I noticed Viacheslav Slavinsky created a | |
// TrueType typeface you could use with x/windows to | |
// make xterm look like a VT-whatever. You can download | |
// the original typeface from: | |
// | |
// https://github.com/svofski/glasstty | |
// | |
// And there's a web page describing its creation at: | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This *should* print out lower case latin characters along with various | |
# unicode combining characters. It's somewhat interesting to see how different | |
# terminals and typefaces handle this. | |
# Combining Diacritical Marks 0300-036F | |
for k in 0 1 2 3 4 5 6 | |
do | |
for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f | |
do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a simple utility that prints a bar on a | |
terminal screen. It's no different than a thousand | |
other such utilities except it's output doesn't look | |
like crap. It uses SIXEL mode, so you'll have to | |
have a terminal (or terminal emulator) that supports | |
it. (if you start xterm with `xterm -ti vt340` it | |
should work.) | |
This is useful if, like me, you SSH into remote *nix | |
systems (like on AWS) and you want to get a graphical |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright (c) 2003-2013, Meadhbh S. Hamrick. All Rights Reserved. | |
# Released under a BSD License. See http://opensource.org/licenses/BSD-2-Clause | |
# | |
# This script uses openssl to generate a self-signed certificate. Usage is | |
# like this: | |
# gssc <host name> [-p password] [-s subject] [-b bitlength] | |
# The host name parameter is the subject name of the certificate; i.e. - the | |
# FQDN of the host you're generating a certificate for. This is also the base | |
# name for the key, certificate signing request and certificate files. If you |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112c112 | |
< main(argc,argv) | |
--- | |
> main(argc,argv,envp) | |
114a115 | |
> char **envp; | |
128,129c129,130 | |
< | |
< loadrom(mem); | |
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2J | |
[03;05H┌────────────────────────────────────────────┐ | |
[04;05H│ Through the Looking Glass (TTY Edition) │ | |
[05;05H├────────────────────────────────────────────┤ | |
[06;05H│ Alice did not feel encouraged to │ | |
[07;05H│ ask questions about it so she │ | |
[08;05H│ turned to the mock turtle and │ | |
[09;05H│ said "what else had you to learn │ | |
[10;05H│ when you were in school?" │ | |
[11;05H└────────────────────────────────────────────┘ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* interval.c | |
** | |
** From a coding interview I (OhMeadhbh@gmail.com) | |
** recently participated in: | |
** | |
** Write a function that finds the intersection of two | |
** intervals. So if you had the intervals 2 - 8 and 5 - | |
** 12, the intersection would be 5 - 8. */ | |
/* Let's start by defining the function that will |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hosting a Remote FileSystem that can do Links over CIFS | |
I’m in the process of migrating from one machine to another and it turns out that my home directory has exploded past the size of my largest external drive. | |
But I have a commercial NAS box that I rather like. But it’s setup to export a CIFS / SMB file system. I sort of like this since Linux, Mac and Windows all have decent support for SMB. But… it has one problem: links. CIFS *does not* like symbolic links. | |
So the solution I came up with was to create an image file on the NAS and mount it with losetup. Believe it or not, you can actually do this. Losetup will mount an image that’s hosted on a remote filesystem. | |
First, create an image file on the remote filesystem. You’ll need to know how big you want it. In this example, I’m making it about 370G, and the remote filesystem is mounted on /mnt/remote: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In Defense of Two Spaces After a Period | |
I spend more time than is healthy worrying about software documentation. Don't get me wrong, I enjoy coding. I enjoy the process of investigating problems, possibly breaking them down into sub-problems and then searching my toolbox of conceptual solutions to find the one that's *just right*. But communicating a developer's intent clearly is an important part of constructing a solution. If you work in a team with other software developers, communicating intent is of vital importance. Even if you work in isolation, documenting your intent is important so that when you eventually come back to your code several years later, you have a chance of understanding what you were trying to do. | |
And it was while I was in deep thought about documenting software that I thought that maybe, just maybe, there's justification for two spaces after a period in the modern world. | |
I frequently use EMACS to edit files; sometimes I use VI, I'm not a zealot. So I like to see text files as |
NewerOlder