Or: “Everybody likes being given a glass of water.”
By Merlin Mann.
It's only advice for you because it had to be advice for me.
| #include <SDL2/SDL.h> | |
| #include <stdio.h> | |
| #include <cstdlib> | |
| #include <ctime> | |
| const int WINDOW_WIDTH = 640; | |
| const int WINDOW_HEIGHT = 480; | |
| int main(int argc, char *argv[]) { | |
| srand(static_cast<unsigned>(time(0))); |
Or: “Everybody likes being given a glass of water.”
By Merlin Mann.
It's only advice for you because it had to be advice for me.
| ** This is from a modified fork of Fastbit 1.3.8, so the line numbers will be off by a little. | |
| Description | |
| ----------- | |
| Deadlock is caused by `ibis::fileManager::getFile` (#7 below) locking the fileManager's mutex, and then the constructor | |
| at `ibis::fileManager::storage::storage` (#4 below) locking it in the same thread, when it realizes it needs to make | |
| some room in the cache first. There seem to be many similar code paths where this sort of deadlock will arise, all when | |
| the cache size is near or over `maxBytes`. |
This Bash script exposes a few functions to create a Grafana data source, and setup the InfluxDB database behind that. It has some configuration functions in the top. It is a continuation of the Python script offered in this Grafana issue comment.
$ ./grafana-influxdb-wiring.sh name_of_database
| " | |
| " Jesse Nelson <[email protected]> | |
| " ab | |
| "------------------------------------------------------------------------------- | |
| " | |
| " | |
| set nocompatible " be iMproved | |
| scriptencoding utf-8 | |
| set encoding=utf-8 |
| # | |
| # Pulse an LED bar like a Cylon | |
| # | |
| # This is my Raspberry Pi "Hello World". | |
| # | |
| import RPi.GPIO as GPIO | |
| import time | |
| **** whoa, interesting | |
| goroutine 23885395 [syscall, 228 minutes, locked to thread]: | |
| net._C2func_getaddrinfo(0x1924010, 0x0, 0xc2087a9278, 0xc2087a91c8, 0x301befcd00000000, 0x0, 0x0) | |
| /usr/src/go/src/net/:26 +0x55 | |
| net.cgoLookupIPCNAME(0xc208bd45c0, 0x15, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) | |
| /usr/src/go/src/net/cgo_unix.go:96 +0x1c5 | |
| net.cgoLookupIP(0xc208bd45c0, 0x15, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc2080da240) | |
| /usr/src/go/src/net/cgo_unix.go:148 +0x65 | |
| net.lookupIP(0xc208bd45c0, 0x15, 0x0, 0x0, 0x0, 0x0, 0x0) | |
| /usr/src/go/src/net/lookup_unix.go:64 +0x5f |
| // | |
| // Golang example: Handling sensitive struct fields when JSON encoding. | |
| // | |
| // Blog Post: http://blakecaldwell.net/blog/2015/1/20/json-encoding-in-go-dealing-with-sensitive-fields.html | |
| // | |
| // Try this in the Go Playground: https://play.golang.org/p/Du5ztx6zjC | |
| // | |
| // Author | |
| // ------ | |
| // |
| # | |
| # Google I/O 2014 secret invite code finder | |
| # | |
| # Blake Caldwell, 2014 | |
| # | |
| # Blog Post: http://blakecaldwell.net/blog/2014/4/23/solving-a-2014-google-io-secret-invite-puzzle.html | |
| # | |
| # Repeatedly hit https://developers.google.com looking two-colored "I/O" on the page, | |
| # with a secret code in comments below it. Using the color codes of the "I" and "O", | |
| # calculate the 6-character Google URL-shortened link code, and print the code out. |
| package net.blakecaldwell.safehibernate; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| /** | |
| * Factory for log messages, picking the enclosing class as the | |
| * logger. This is safe from copypasta. | |
| * | |
| * Use: private static Logger logger = ClassLoggerFactory.make(); |