Skip to content

Instantly share code, notes, and snippets.

View hostilefork's full-sized avatar
🌴
I'm Always Somewhere...but I'll Try And Respond

Hostile Fork hostilefork

🌴
I'm Always Somewhere...but I'll Try And Respond
View GitHub Profile
@hostilefork
hostilefork / listener.c
Last active April 16, 2024 15:32
Simple listener and sender for UDP multicast
//
// Simple listener.c program for UDP multicast
//
// Adapted from:
// http://ntrg.cs.tcd.ie/undergrad/4ba2/multicast/antony/example.html
//
// Changes:
// * Compiles for Windows as well as Linux
// * Takes the port and group on the command line
//
@hostilefork
hostilefork / gist:8dc9ae2f2dead34e3a76219a34b4f836
Created April 21, 2018 08:52
Building with Mingw32-make fails for Windows #564 (moved to gist)
C:\Users\kealist\Documents\git\kealist\ren-c\make>mingw32-make -f makefile.boot
./r3-make.exe -qs ../src/tools/make-make.r OS_ID=""_"" DEBUG="asserts" \
GIT_COMMIT="{unknown}" STANDARD="c" \
RIGOROUS="no" WITH_FFI="no" \
WITH_TCC="no" STATIC="no" \
OPTIMIZE="auto" TARGET=makefile CONFIG="default-config.r"
/C/Users/kealist/Documents/git/kealist/ren-c/src/tools/
user-config: => make object! [
os-id blank! _
target word! makefile
@hostilefork
hostilefork / whitespace-output.txt
Created January 26, 2014 05:26
Output from Whitespace test program run by Rebol interpreter
WHITESPACE INTERPRETER FOR PROGRAM:
---
@hostilefork
hostilefork / facade.cpp
Last active December 27, 2015 06:19
Conceptual example for Proxy/Facade pattern to submit to http://codereview.stackexchange.com/questions/33713/
//
// Proxy/facade pattern idea.
// See http://codereview.stackexchange.com/questions/33713/
//
#include <iostream>
#include <vector>
#include <memory>
#include <cstdlib>
@hostilefork
hostilefork / gist:6325151
Created August 24, 2013 00:08
Explicit license of a StackOverflow answer to make FontBakery happy. :-)
/*
Copyright 2012 Brian Dickens <hostilefork@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@hostilefork
hostilefork / single-byte-parse-bitset.txt
Created January 13, 2013 23:30
Single byte bitset parsing anomalies vs. find for binary!, circa commit a6077e8
Checking: [#{00}]
Checking: [#{01}]
Checking: [#{02}]
Checking: [#{03}]
Checking: [#{04}]
Checking: [#{05}]
Checking: [#{06}]
Checking: [#{07}]
Checking: [#{08}]
Checking: [#{09}]
@hostilefork
hostilefork / parse-find-bitset-bug.txt
Created January 13, 2013 21:17
Demonstration of problem in R3 with PARSE vs. FIND on varied bitsets, circa commit a6077e8
;-- Test the low range...
>> low: charset [#"^(00)" - #"^(80)"]
== make bitset! #{FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80}
>> find low #{40}
== true
>> find low #{A0}
== none
@hostilefork
hostilefork / impure-indents.txt
Created December 31, 2012 10:39
initial findings of the make-commit.r script of "impure" indents
./r3-make -qs ../src/tools/make-commit.r
Performing Pre-Commit Tests
%../boot/boot-code.r - REBOL
2: Indentation of line not done with pure tabs.
3: Indentation of line not done with pure tabs.
4: Indentation of line not done with pure tabs.
5: Indentation of line not done with pure tabs.
6: Indentation of line not done with pure tabs.
7: Indentation of line not done with pure tabs.
@hostilefork
hostilefork / r3-cppwarnings-initial
Last active December 9, 2015 23:08
New state after removing literal to non-const char* value assignments, after patching Rebol 3 Open Source to build with bleeding edge G++...with -fpermissive and -fshort-wchar
../src/core/b-boot.c:2917:1: warning: initializer-string for array of chars is too long [-fpermissive]
../src/core/b-init.c: In function ‘void Load_Boot()’:
../src/core/b-init.c:159:33: warning: invalid conversion from ‘void*’ to ‘REBYTE* {aka unsigned char*}’ [-fpermissive]
../src/core/b-init.c: In function ‘void Register_Codec(const REBYTE*, codo)’:
../src/core/b-init.c:704:2: warning: invalid conversion from ‘void*’ to ‘ANYFUNC {aka void (*)(void*)}’ [-fpermissive]
../src/core/b-init.c: In function ‘void Set_Option_String(REBCHR*, REBCNT)’:
../src/core/b-init.c:728:36: warning: invalid conversion from ‘REBCHR* {aka unsigned char*}’ to ‘const char*’ [-fpermissive]
../src/core/b-init.c: In function ‘REBCNT Set_Option_Word(REBCHR*, REBCNT)’:
../src/core/b-init.c:740:7: warning: invalid conversion from ‘REBCHR* {aka unsigned char*}’ to ‘const char*’ [-fpermissive]
../src/core/b-init.c: In function ‘void Init_Main_Args(REBARGS*)’:
@hostilefork
hostilefork / genetic.cpp
Created November 25, 2012 16:01
"Genetic Algorithm" from someone's StackOverflow question
// http://stackoverflow.com/questions/13552057/c-vector-access-violation-when-trying-to-write
#include <iostream>
#include <vector>
using namespace std;
class gen {
public:
int basa_biner;