Skip to content

Instantly share code, notes, and snippets.

Erik Hollembeak futureperfect

Block or report user

Report or block futureperfect

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@futureperfect
futureperfect / logs.txt
Created Jun 11, 2018
PySpark Reduction
View logs.txt
py4j.protocol.Py4JJavaError: An error occurred while calling o90.save.
: java.io.IOException: Failed to open native connection to Cassandra at {<Redacted>}:<Redacted port>
at com.datastax.spark.connector.cql.CassandraConnector$.com$datastax$spark$connector$cql$CassandraConnector$$createSession(CassandraConnector.scala:168)
at com.datastax.spark.connector.cql.CassandraConnector$$anonfun$8.apply(CassandraConnector.scala:154)
at com.datastax.spark.connector.cql.CassandraConnector$$anonfun$8.apply(CassandraConnector.scala:154)
at com.datastax.spark.connector.cql.RefCountedCache.createNewValueAndKeys(RefCountedCache.scala:32)
at com.datastax.spark.connector.cql.RefCountedCache.syncAcquire(RefCountedCache.scala:69)
at com.datastax.spark.connector.cql.RefCountedCache.acquire(RefCountedCache.scala:57)
at com.datastax.spark.connector.cql.CassandraConnector.openSession(CassandraConnector.scala:79)
at com.datastax.spark.connector.cql.CassandraConnector.withSessionDo(CassandraConnector.scala:111)
@futureperfect
futureperfect / demo.p8
Created Mar 6, 2018
PICO-8 Demo of a ball moving with arrow keys
View demo.p8
pico-8 cartridge // http://www.pico-8.com
version 16
__lua__
-- move an ball on-screen
-- by erik hollembeak
SCREEN_WIDTH = 128
SCREEN_HEIGHT = 128
-- Ball definition
@futureperfect
futureperfect / fork_fd_test.c
Created Jan 13, 2018
How do concurrent writes by parent and child processes behave with a shared file descriptor?
View fork_fd_test.c
/* Write a program that opens a file (with the open() system call) and then
* calls fork() to create a new process. Can both the child and parent access
* the file descriptor returned by open()? What happens when they are writing to
* the file concurrently, i.e., at the same time? */
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@futureperfect
futureperfect / gist:066c6c320c9d0930fe648990a86ba4f4
Created Jan 9, 2018
A couple handy idioms for exploring ruby classes/objects and the methods they implement
View gist:066c6c320c9d0930fe648990a86ba4f4
# What methods does a class implement?
> Time.methods
=> [:!, :!=, :!~, :<, :<=, :<=>, :==, :===, :=~, :>, :>=, :__id__, :__send__, :allocate, :ancestors, :at, :autoload, :autoload?, :class, :class_eval, :class_exec, :class_variable_defined?, :class_variable_get, :class_variable_set, :class_variables, :clone, :const_defined?, :const_get, :const_missing, :const_set, :constants, :define_singleton_method, :deprecate_constant, :display, :dup, :enum_for, :eql?, :equal?, :extend, :freeze, :frozen?, :gm, :hash, :include, :include?, :included_modules, :inspect, :instance_eval, :instance_exec, :instance_method, :instance_methods, :instance_of?, :instance_variable_defined?, :instance_variable_get, :instance_variable_set, :instance_variables, :is_a?, :itself, :kind_of?, :local, :method, :method_defined?, :methods, :mktime, :module_eval, :module_exec, :name, :new, :nil?, :now, :object_id, :prepend, :private_class_method, :private_constant, :private_instance_methods, :private_method_defined?, :private_methods, :protected_
View infinite_a_reader.go
// https://tour.golang.org/methods/22
package main
import "golang.org/x/tour/reader"
type MyReader struct{}
func (reader MyReader) Read(b []byte) (int, error) {
count := 0
for i, _ := range b {
@futureperfect
futureperfect / stripes.asm
Created Sep 14, 2017
Atari 2600 - Draw colored stripes to screen
View stripes.asm
; stripes.asm
;
; Example Atari 2600 program - paints
; colored stripes to the screen
;
; dasm stripes.asm -f3 -ostripes.bin
;
;
processor 6502
@futureperfect
futureperfect / Gemfile
Created Aug 17, 2017
Trapping Rain Water
View Gemfile
source "https://rubygems.org"
gem "minitest"
@futureperfect
futureperfect / Gemfile
Last active Jul 18, 2017
Reverse a string, but preserve position of any "special" character
View Gemfile
source "https://rubygems.org"
gem "minitest"
View guessing-game.rkt
#lang racket
(define lower-bound 1)
(define upper-bound 100)
(define (start n m)
(set! lower-bound (min n m))
(set! upper-bound (max n m))
(guess))
You can’t perform that action at this time.