Skip to content

Instantly share code, notes, and snippets.

View prodigeni's full-sized avatar

N/A prodigeni

  • Connexion Foundation
  • N/A
View GitHub Profile
@prodigeni
prodigeni / snowden-ietf93.md
Last active August 29, 2015 14:27 — forked from mnot/snowden-ietf93.md
Transcript of Edward Snowden's comments at IETF93.
@prodigeni
prodigeni / add.c
Last active August 29, 2015 14:25 — forked from barosl/add.c
Function overloading in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int addi(int a, int b) {
return a + b;
}
char *adds(char *a, char *b) {
char *res = malloc(strlen(a) + strlen(b) + 1);
main(argc, argv)
int argc;
char *argv[];
{
int i;
argc--;
for(i=1; i<=argc; i++)
printf("%s%c", argv[i], i==argc? '\n': ' ');
}

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google

Conspiracy and an off-by-one error

Here, I will discuss one of the conspiracy theories regarding the attack on Malaysia Airline flight MH17. This will not be about formulating yet another theory - or blaming anyone for what happened. I will focus purely on independently verifyable technical matters.

If you want to follow along, you will need these tools:

Claims

Okay, first off, I'm not talking about VR in the abstract here, as some
scary vague futuristic concept that I decided to be scared about after
reading too much cyberpunk books. :)
I'm a programmer, and I spent January 2012 through September 2012 (9 months)
and February 2014 through April 2014 (3 months) working for Valve's VR team as
a contractor. In 2012 I designed and implemented most of the optical tracking
system used in Valve's VR rooms, this year I implemented basic head-tracked
binaural 3D audio, updated some of the scenes in their VR demo reel, as well
as adding a new scene to it. All of the aforementioned code is in active use.

Colors in terminal

It's a common confusion about terminal colors... Actually we have this:

  • plain ascii
  • ansi escape codes (16 color codes with bold/italic and background)
  • 256 color palette (216 colors+16gray + ansi) (colors are 24bit)
  • 24bit true color (888 colors (aka 16 milion))

The 256 color palete is configured at start, and it's a 666 cube of colors, each of them defined as a 24bit (888 rgb) color.

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000