By Leo Rudberg, for the UPL Video Lecture Series
First, let's make sure that you have ghc and ghci installed:
$ ghc --version && ghci
# ghci should boot up...| .syntax unified | |
| .cpu cortex-m4 | |
| .thumb | |
| // configuration values for STM32F4x | |
| // see: http://www.st.com/web/en/resource/technical/document/reference_manual/DM00031020.pdf | |
| #define AHB1PERIPH_BASE 0x40020000 | |
| #define RCC_BASE AHB1PERIPH_BASE + 0x3800 | |
| #define RCC_AHB1_ENR RCC_BASE + 0x30 |
| #define _GNU_SOURCE 1 | |
| #include <sched.h> // sched_setaffinity | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <limits.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <pthread.h> | |
| #include <assert.h> | |
| #include <sys/time.h> |
First, let's make sure that you have ghc and ghci installed:
$ ghc --version && ghci
# ghci should boot up...| ;; Simple TCP echo server in x86_64 assembly, using Linux syscalls | |
| ;; | |
| ;; nasm -felf64 -o server.o server.asm | |
| ;; ld server.o -o server | |
| ;; ./server | |
| ;; | |
| global _start | |
| ;; Data definitions |
| defmodule Expng do | |
| defstruct [:width, :height, :bit_depth, :color_type, :compression, :filter, :interlace, :chunks] | |
| def png_parse(<< | |
| 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, | |
| _length :: size(32), | |
| "IHDR", | |
| width :: size(32), | |
| height :: size(32), |
| # You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
| # This is how I upload my new Sol Trader builds (http://soltrader.net) | |
| # Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
| S3KEY="my aws key" | |
| S3SECRET="my aws secret" # pass these in | |
| function putS3 | |
| { | |
| path=$1 |
| def draw_path(self,x,y): | |
| top_right = 999999999999999999999999999999999999 | |
| top_left = 999999999999999999999999999999999999 | |
| top = 999999999999999999999999999999999999 | |
| if y == 0: | |
| return | |
| self.writablePixels[y,x] = (255,0,0) | |
| # print str((x,y)) |
| /** | |
| * K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex") | |
| * | |
| * More language ports, as well as legacy 2014 OpenSimplex, can be found here: | |
| * https://github.com/KdotJPG/OpenSimplex2 | |
| */ | |
| public class OpenSimplex2S { | |
| private static final long PRIME_X = 0x5205402B9270C86FL; |