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
(dlv) breakpoints | |
Breakpoint unrecovered-panic at 0x1025cd0 for runtime.startpanic() /usr/local/Cellar/go/1.8/libexec/src/runtime/panic.go:568 (0) | |
(dlv) break main.UnsetBit | |
Breakpoint 1 set at 0x1088cf0 for main.(*BitVector).UnsetBit() ./bitvector.go:23 | |
(dlv) continue | |
Bit 0 is set!> main.(*BitVector).UnsetBit() ./bitvector.go:23 (hits goroutine(1):1 total:1) (PC: 0x1088cf0) | |
18: } | |
19: bv.bytes[word] |= 1 << bit | |
20: } |
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
package main | |
import ( | |
"fmt" | |
) | |
// BitVector is a simple bit vector | |
// It's zero value represents the empty set | |
type BitVector struct { | |
bytes []uint64 |
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
package main | |
import "fmt" | |
// Increment Natural number y | |
func Increment(y uint) uint { | |
if y == 0 { | |
return 1 | |
} | |
if y%2 == 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
package main | |
import ( | |
"github.com/aws/aws-lambda-go/lambda" | |
"github.com/aws/aws-lambda-go/events" | |
"errors" | |
"log" | |
) | |
var ( |
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
Push-Location | |
Remove-Item "public" -Recurse | |
hugo | |
set-location "public\" | |
Write-S3Object -BucketName tylerrhodes.net -Folder . -Recurse -KeyPrefix \ -CannedACLName public-read -ProfileName HugoProfile |
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 (p) (p)) | |
(define (test x y) | |
(if (= x 0) | |
0 | |
y)) | |
(test 0 (p)) |
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
#lang sicp | |
;; Applicative order evaluation | |
(define (new-if predicate then-clause else-clause) | |
(cond (predicate then-clause) | |
(else else-clause))) | |
(define (sqrt-iter guess x) | |
(display guess) |
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; | |
using System.Collections.Generic; | |
namespace HigherOrderProceduresDemo | |
{ | |
class Program | |
{ | |
static void Map(IEnumerable<int> list, Action<int> fn) | |
{ | |
foreach (var item in list) |
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> | |
void print_array(int* array, size_t size) | |
{ | |
for (unsigned i = 0; i < size; ++i) | |
{ | |
printf("%d\n", *array++); | |
} |
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
package main | |
import "fmt" | |
func adder() func(int) int { | |
sum := 0 | |
return func(x int) int { | |
sum += x | |
return sum | |
} |
OlderNewer