- There are some situations that are difficult to distinguish mechanically, so I now consider all of those cases problematic, even when they are not obviously wrong.
- You should be coding for readability and error resistance.
- The place to express yourself in programming is in the quality of your ideas, and the efficiency of execution. The role of style is the same as in literature. A great writer doesn't express himself by putting the spaces before his commas instead of after, or by putting extra spaces inside his parentheses.
- Many people think they have good reasons for doing things badly.
- [The purpose of JSLint is not to make you feel good about inadequate coding standards.](http://tech.groups.y
set keymap vi-insert | |
Control-a: beginning-of-line | |
Control-b: backward-char | |
Control-d: delete-char | |
Control-e: end-of-line | |
Control-f: forward-char | |
Control-k: kill-line | |
Control-n: next-history | |
Control-p: previous-history | |
set keymap emacs-ctlx |
using System; | |
using System.Text; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.IO; | |
namespace Algorithms | |
{ | |
/// <summary> | |
/// The type of <see cref="ListDiffAction{S,D}"/>. |
static readonly string[] videoCardBlacklist = {"8086:0116"}; | |
static void DisableHwRenderingForCrapVideoCards() | |
{ | |
if (!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("MY_VIDEO_CARD_REALLY_WORKS"))) | |
{ | |
return; | |
} | |
int osVersion = Environment.OSVersion.Version.Major * 100 + Environment.OSVersion.Version.Minor; | |
if (osVersion < 601) |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
module RedBlackTree where | |
data Zero | |
data Succ n | |
type One = Succ Zero | |
data Black |
require 'net/http' | |
# WARNING do not use this; it works but is very limited | |
def resolve url | |
res = Net::HTTP.get_response URI(url) | |
if res.code == '301' then res['location'] | |
else url.to_s | |
end | |
end |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reactive.Concurrency; | |
using System.Reactive.Disposables; | |
using System.Reactive.Linq; | |
using System.Reactive.Subjects; | |
using System.Reactive.Threading.Tasks; | |
using System.Text; | |
using System.Threading; |
It is generally desirable to group all the hosts for a specific service into a single dashboard view. For example, all the web servers are in single view while all the database servers are in another view.
This is usually not an issue when you are sending custom metrics using Riemann client. However, there are cases where you are using something that you do not control how the metrics are being sent. i.e., Riemann-tools.
Since Riemann-tools scripts are application agnostic, in order for the dashboard view to group hosts, we must inject some application specific information into the tags field. Tags is a collection of arbitrary strings. In the case of Riemann-tools scripts you can pass in arbitrary strings on the command line.
riemann-health --host 127.0.0.1 --tag "prod" --tag "webserver"
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using MonoTouch.UIKit; | |
namespace Async.iOS | |
{ | |
public static class Layout | |
{ |
In no particular order, some fiction I've loved:
- The Last Samurai by Helen DeWitt
- Vox and The Fermata by Nicholson Baker
- The Forgotten Beasts of Eld by Patricia McKillip
- The Cyberiad by Stanislaw Lem
- Winter's Tale by Mark Helprin
- Invisible Cities and Cosmicomics by Italo Calvino
- The Scar by China Mieville (And Perdido Street Station, natch. I also liked his The City and the City and Embassytown, but more as metaphorical tools than as stories)
- Rosencrantz and Guildenstern are Dead and Arcadia by Tom Stoppard