Skip to content

Instantly share code, notes, and snippets.

std::vector<unsigned> Skeleton::jointsToRoot(unsigned index){
std::vector<unsigned> result;
while (index = joints_[index].parent != -1){
result.push_back(index);
}
return result;
import pygame
def main():
pygame.init()
window = pygame.display.set_mode((500, 500))
clock = pygame.time.Clock()
y = 100
module Child exposing (init, update, Message)
init = 0
type Message
= InterestingMessage
| InternalMessage
update message model = model
module Child exposing (init, update, Message)
init = 0
type Message
= InterestingMessage
| InternalMessage
update message model = model
module Child exposing (init, update, Message(..))
init = 0
type Message
= InterestingMessage
| InternalMessage
update message model = model
module Child exposing (init, update, Message(InterestingMessage))
init = 0
type Message
= InterestingMessage
| InternalMessage
update message model = model
module Child exposing (init, update, Message(InterestingMessage))
init = 0
type Message
= InterestingMessage
| InternalMessage
update message model = model
#include <iostream>
#include <list>
#include <algorithm>
using namespace std;
int n;
int *aita;
void print_solution(int tertiary){
@joonazan
joonazan / ParseLibrary.elm
Created April 15, 2017 17:56
Invalid recursion in Elm 0.18 still causes runtime error
module ParseLibrary exposing (typeSignature)
import Combine exposing (..)
import Dict exposing (Dict)
type Type
= TArrow Type Type
| TName String
| TRecord (Dict String Type)
@joonazan
joonazan / gist:bb52254a63f774600b49ca4d14527bf6
Created April 17, 2017 13:20
buggy recursion in parser
typeSignature =
lazy <| \() ->
sepBy (whitespace *> string "->" *> whitespace) nonFunctionType
|> andThen (
reducer TArrow
>> Maybe.map succeed
>> Maybe.withDefault (fail "expected type, got nothing")
)
reducer : (a -> a -> a) -> List a -> Maybe a