Blog 2020/5/7
<- previous | index | next ->
Here are some notes on how I set up an installation of OS X Tiger (10.4)
#!/bin/bash | |
EVENT=flow.AccountContractAdded | |
START=32795233 | |
END=$(flow blocks get latest -n mainnet -o json | jq '.height') | |
echo "Start: ${START}" | |
echo "End: ${END}" | |
echo "Event: ${EVENT}" | |
for (( i=${START}; i<=${END}; i += 251 )); do |
cross_compiling=yes | |
ac_cv_file__dev_ptmx=no | |
ac_cv_file__dev_ptc=no |
Blog 2020/5/7
<- previous | index | next ->
Here are some notes on how I set up an installation of OS X Tiger (10.4)
Code from PyCon India 2019 Keynote Talk | |
David Beazley (https://www.dabeaz.com) | |
====================================== | |
This code is presented "as is" and represents what was live-coded | |
during my closing keynote presentation at PyCon India, Chennai, | |
October 13, 2009. I have made no changes to the files. | |
Requires: Python 3.6+, numpy, pygame |
#include <assert.h> | |
#include <math.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#define GL_GLEXT_PROTOTYPES |
#!/usr/bin/env python | |
"""Utility to extract .debug_info section and print that in JSON format. | |
""" | |
import argparse | |
from collections import OrderedDict | |
import json | |
import logging | |
from math import ceil, log | |
import os |
What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.
In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.
Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th
import os.path | |
import re | |
import sys | |
# LZ-ish decompression scheme borrowed from picolove: | |
# https://github.com/gamax92/picolove/blob/master/cart.lua | |
compression_map = b"\n 0123456789abcdefghijklmnopqrstuvwxyz!#%(){}[]<>+=/*:;.,~_" | |
def decompress(code): | |
lua = bytearray() |
This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere… I hope to present the information you need without assuming anything.
Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!
One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.
#!/usr/bin/env sh | |
# | |
# Script to clone gitx from github and build it using | |
# the scripts provided by the project. | |
# | |
# Sven-S. Porst @ssp <ssp-web@earthlingsoft.net> | |
# | |
git clone https://github.com/ssp/gitx.git | |
cd gitx |