This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <wiringPi.h> | |
int main(void) { | |
int errorno = wiringPiSetupGpio(); | |
// No newline, so I missed this a few times | |
// debugging when it was the line above and this line only | |
// it gets instered before the prompt when the program finishes. | |
printf("Plpo"); |
This file contains 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
#include "FIFO.h" | |
#include "common.h" | |
#define AccessBuffer(buffer, index, index_width) ((char *)(buffer))+((index) * (index_width)) | |
int FIFO_Init(FIFOBuffer_TypeDef *buf, uint32_t maxSize, uint32_t bufferWidth, void *buffer) { | |
if (!buffer) { | |
return -1; | |
} | |
This file contains 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
defmodule Yggdrasil.Fixtures do | |
@moduledoc """ | |
A module for fixtures for various tests | |
""" | |
def user do | |
quote do | |
@min_len 4 | |
@password "password" | |
@short_password String.slice(@password, 1..(@min_len - 1)) |
This file contains 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
using System; | |
namespace Maybe | |
{ | |
abstract class Maybe<T> { | |
public static Maybe<T> Return(T val) | |
{ | |
return new Just<T> (val); | |
} |
This file contains 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
open System | |
type Maybe<'a> = | |
| Just of 'a | |
| Nothing | |
let Unit (x: 'a) : Maybe<'a> = | |
Just x | |
let Bind (f: 'a -> Maybe<'b>) (mx: Maybe<'a>) = |
This file contains 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
using System; | |
namespace Maybe | |
{ | |
interface Maybe<T> | |
{ | |
T Value(); | |
bool HasValue(); | |
Maybe<T> Bind(Func<T, Maybe<T>> f); | |
} |
This file contains 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
speed = 500 | |
angle = -200 | |
# being very explicit here, I believe the default | |
# unit is 8, and the endianess is big | |
# | |
# So I do need to pack this message in particular way according to the | |
# specs for the roomba serial interface, which is the like this | |
# | |
# command [optional bytes] |
This file contains 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
define("app/templates/application", ["exports"], function(__exports__){ __exports__["default"] = function anonymous(Handlebars,depth0,helpers,partials,data) { | |
this.compilerInfo = [4,'>= 1.0.0']; | |
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {}; | |
var buffer = '', stack1, helper, options, self=this, helperMissing=helpers.helperMissing; | |
function program1(depth0,data) { | |
data.buffer.push("Builder"); | |
} |
This file contains 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
// these two are taken from the docs | |
struct Point { | |
x: f64, | |
y: f64 | |
} | |
// They use shape later in the docs to show pattern matching | |
// but I'm going to attempt to explain it |
This file contains 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
use std::fmt; | |
struct Name { | |
first: ~str, | |
last: ~str | |
} | |
// I'm printing a string here, but | |
// in reality this could be binary output | |
impl fmt::Binary for Name { |
NewerOlder