Skip to content

Instantly share code, notes, and snippets.

@uucidl
uucidl / 16ms.org
Last active May 7, 2016 08:01
16ms

period not frequency

how many?

  • simple integer arithmetic (add/sub/shift)
  • complex integer arithmetic (mul/div/mod)
  • float arithmetic (add/mul/div)
  • file open/write/close
  • memory location visited (contiguous, pointer chasing)
  • pixels drawn

One is young or old depending on how one confronts change.

The old feels frustration. The young accepts change and takes profit of it.

Young is one who find home in the foreign. Those who grasp their old sweet routine for comfort, those who can’t accept disorientation are from another era.

@uucidl
uucidl / authorship.org
Created April 17, 2016 16:03
Some notes about art and creation

Some notes about art and creation.

  1. It is helpful to distinguish between the author-creator, the author-public-figure and the author-critic.
  2. One commonly made mistake is to consider the author-creator knows what kind of statement their creations make.
  3. There isn’t one and only one value to a creation.
  4. It is fallacious to factor out the technological and social context of a creation, both for the author and the spectator.
  5. It is interesting to find out who makes and enforces the rules that make an author’s recognition possible.
  6. A creation is a window into human nature.
  7. One helpful axis to analyze discipline is how abstracted they are from the pure gesture of creation.
  8. One purpose of craft is to impose on us the illusion that the artificial is real.
@uucidl
uucidl / 000-eop
Last active December 7, 2022 11:15
Elements Of Programming (Stepanov, Mc Jones) In Rust
Elements Of Programming (A.Stepanov, P.McJones) implemented in Rust
Generic programming Rust using traits and generic functions
@uucidl
uucidl / insane.py
Created March 15, 2016 08:45
Something insane I did not know about python
H:\temp>python
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 'hello'
>>> print a
hello
>>> words = [a for a in ['one', 'two', 'three']]
>>> print words
['one', 'two', 'three']
>>> print a
@uucidl
uucidl / fastbuild-generator.patch
Last active July 18, 2016 08:17
(WIP) FASTbuild generator for gyp
From 2c2a5e747a601ec655e5a94d935cca09599580d1 Mon Sep 17 00:00:00 2001
From: nil <[email protected]>
Date: Mon, 9 May 2016 12:51:23 +0200
Subject: [PATCH 01/19] Import fastbuild generator
---
pylib/gyp/generator/fastbuild.py | 1095 ++++++++++++++++++++++++++++++++++++++
1 file changed, 1095 insertions(+)
create mode 100644 pylib/gyp/generator/fastbuild.py
@uucidl
uucidl / 00-notes-about-APIs.org
Last active October 18, 2022 09:14
Notes about APIs

On the emergence of interfaces

Interfaces naturally emerge as software gets broken down into parts communicating with one another. The larger and more deliberate structures emerge from a deliberate attempt to organize the development process itself. [fn:Liskov2008] Structure often emerge directly from division of labor: as teams take on independent tasks, interfaces are established betweeen domains they become responsible for. (Conway’s Law)

Software developers are responsible for systems built out of very small atoms while ultimately performing tasks for their users of a much greater magnitude. Dijkstra showed this by computing the ratio between grains of time at the lowest and largest atoms of the system (from say, CPU instructions to a human interaction with the system) The span was already quite large by Dijkstra’s time, of about 10^9. Today this ratio would be at least above 10^12 (see grain ratios)

This large span has to be manage

@uucidl
uucidl / cocoa.mm
Created January 31, 2016 14:27
Minimal Cocoa App
#define BUILD(__os,...)
#define DOC(...)
#define TAG(...)
BUILD(osx,"clang++ -std=c++11 cocoa.mm -o cocoa -framework AppKit")
#import "AppKit/AppKit.h"
int main(int argc, char **argv)
{
[NSApplication sharedApplication];
[NSApp setActivationPolicy: NSApplicationActivationPolicyRegular];
auto const app_name = [[NSProcessInfo processInfo] processName];
@uucidl
uucidl / skeleton.cpp
Created December 24, 2015 09:58
skeleton in the closet
/*
OSX: "clang++ -DOS_OSX -g -std=c++11 -nostdinc++ -nostdlib -framework System
-Wall -Wextra skeleton.cpp -o skeleton"
*/
// Meta
#define DOC(...) // to document a symbol
#define URL(...) // reference to a resource
// Compiler
#define CLANG_ATTRIBUTE(x) __attribute__((x))
#define debugger_break() DOC("invoke debugger") asm("int3")
@uucidl
uucidl / dfw-on-the-freedom-to-be-crummy.org
Last active December 5, 2015 16:38
David Foster Wallace on the freedom to be crummy (his editing routine)

The Freedom To Be Crummy

https://youtu.be/mfjjSj9coA0?t=2582 43:00

So I write the first draft long hand, The second draft I rewrite long-hand on a clipboard, then I type it once, then I retype it then it sits for at least a week or two and I redo it, I type it again. And not “computer” re-typing, but starting all the way at the beginning as a hard copy. Why you ask? Good question.