Skip to content

Instantly share code, notes, and snippets.

View Wilfred's full-sized avatar

Wilfred Hughes Wilfred

View GitHub Profile
@Wilfred
Wilfred / error.txt
Created February 7, 2014 22:21
Inspecting whether a file handle is open in RPython
[translation:info] Error:
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/goal/translate.py", line 318, in main
[translation:info] drv.proceed(goals)
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 534, in proceed
[translation:info] return self._execute(goals, task_skip = self._maybe_skip())
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/tool/taskengine.py", line 114, in _execute
[translation:info] res = self._do(goal, taskcallable, *args, **kwds)
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 283, in _do
[translation:info] res = func()
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 320, in task_annotate
@Wilfred
Wilfred / main2.py
Created February 9, 2014 23:14
RPython error on iterating over a bytestring.
from __future__ import unicode_literals
import sys
def entry_point(argv):
bytes_seq = b"abcdef1234!"
for byte in bytes_seq:
print byte.decode('utf-8')
@Wilfred
Wilfred / gist:8907799
Created February 9, 2014 23:34
RPython error without obvious soruce
./rpython main.py
[translation:info] 2.7.6 (default, Nov 26 2013, 12:52:49)
[translation:info] [GCC 4.8.2]
[platform:msg] Set platform with 'host' cc=None, using cc='gcc'
[translation:info] Translating target as defined by main
[platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused /tmp/usession-release-2.2.x-88/gcctest.c -o /tmp/usession-release-2.2.x-88/gcctest.o
[platform:execute] gcc /tmp/usession-release-2.2.x-88/gcctest.o -pthread -lrt -o /tmp/usession-release-2.2.x-88/gcctest
[platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused /tmp/usession-release-2.2.x-88/gcctest.c -o /tmp/usession-release-2.2.x-88/gcctest.o
[platform:execute] gcc /tmp/usession-release-2.2.x-88/gcctest.o -pthread -lrt -o /tmp/usession-release-2.2.x-88/gcctest
[platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused /tmp/usession-release-2.2.x-88/platcheck_0.c -o /tmp/usession-release-2.2.x-88/platcheck_0.o
@Wilfred
Wilfred / error.txt
Created February 10, 2014 22:57
RPython just gives an assertion error here
[translation:info] Error:
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/goal/translate.py", line 318, in main
[translation:info] drv.proceed(goals)
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 534, in proceed
[translation:info] return self._execute(goals, task_skip = self._maybe_skip())
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/tool/taskengine.py", line 114, in _execute
[translation:info] res = self._do(goal, taskcallable, *args, **kwds)
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 283, in _do
[translation:info] res = func()
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 350, in task_rtype_lltype
import Data.Array
data Piece =
Pawn | Rook | Knight | Bishop | Queen | King | Empty
deriving Show
type Board = [[Piece]]
emptyRow = [Empty | x <- [0..7]]
emptyBoard = [emptyRow | x <- [0..7]]
@Wilfred
Wilfred / travis.sh
Created March 26, 2014 20:12 — forked from rejeep/travis.sh
#!/bin/sh
# This script will setup Evm and Cask on Travis to use for Emacs Lisp testing.
#
# In .travis.yml, add Evm and Cask to PATH.
#
# - export PATH="/home/travis/.cask/bin:$PATH"
# - export PATH="/home/travis/.evm/bin:$PATH"
sudo mkdir /usr/local/evm
@Wilfred
Wilfred / emulator.rs
Created May 9, 2014 21:12
Passing immutable data to a function expecting mutable
// The Z80 is an 8-bit chip.
type Register = u8;
type ProgramCounter = u16;
type StackPointer = u16;
#[deriving(Show)]
struct CPU {
// Generic registers.
a: Register,
b: Register,
'From Pharo3.0 of 18 March 2013 [Latest update: #30848] on 7 June 2014 at 6:57:07.57647 pm'!
Object subclass: #Fizzbuzz
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Fizzbuzz'!
!Fizzbuzz commentStamp: '<historical>' prior: 0!
!
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
@Wilfred
Wilfred / syslog
Created September 3, 2014 22:20
/var/log/syslog on droplet
Sep 3 22:36:47 localhost kernel: [18275188.609070] ata2: lost interrupt (Status 0x58)
Sep 3 22:36:47 localhost kernel: [18275188.612581] ata2: drained 65536 bytes to clear DRQ
Sep 3 22:36:47 localhost kernel: [18275191.787792] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
Sep 3 22:36:47 localhost kernel: [18275191.788836] sr 1:0:0:0: CDB:
Sep 3 22:36:47 localhost kernel: [18275191.788844] Get event status notification: 4a 01 00 00 10 00 00 00 08 00
Sep 3 22:36:47 localhost kernel: [18275191.788865] ata2.00: cmd a0/00:00:00:08:00/00:00:00:00:00/a0 tag 0 pio 16392 in
Sep 3 22:36:47 localhost kernel: [18275191.788865] res 40/00:02:00:08:00/00:00:00:00:00/a0 Emask 0x4 (timeout)
Sep 3 22:36:47 localhost kernel: [18275191.790746] ata2.00: status: { DRDY }
Sep 3 22:36:47 localhost kernel: [18275191.791426] ata2: soft resetting link
Sep 3 22:36:47 localhost kernel: [18275191.946953] ata2.00: configured for MWDMA2
@Wilfred
Wilfred / output
Created September 7, 2014 00:06
A simple swap macro
ERROR: b not defined
in include at boot.jl:245
in include_from_node1 at loading.jl:128
in process_options at client.jl:285
in _start at client.jl:354
while loading /home/wilfred/projects/comparative_macrology/swap.jl, in expression starting on line 3