Skip to content

Instantly share code, notes, and snippets.

@bschwind
bschwind / Server.cs
Created April 14, 2012 01:44
Implements a simple TCP server with one thread per client
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Collections.Concurrent;
namespace GraphicsToolkit.Networking
@bschwind
bschwind / TCPServerExample.cs
Created April 14, 2012 01:42
TCP Server Example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GraphicsToolkit.Networking;
namespace TestServer
{
public class Program
{
@bschwind
bschwind / Client.cs
Created April 14, 2012 01:43
Implements a simple TCP client
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace GraphicsToolkit.Networking
{
@bschwind
bschwind / NetworkBuffer.cs
Created April 14, 2012 01:46
Network Buffer for organizing network stream data
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GraphicsToolkit.Networking
{
/// <summary>
/// This class helps organize the data required for
/// reading and writing to a network stream
@bschwind
bschwind / TCPClientExample.cs
Created April 14, 2012 01:40
TCP Client Example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GraphicsToolkit.Networking;
namespace TestClient
{
public class Program
{
151.859507ms audio 121
161.878684ms audio 121
171.838729ms audio 121
181.788916ms audio 121
191.833415ms audio 121
201.781046ms audio 121
211.774527ms audio 121
221.781544ms audio 121
231.819408ms audio 121
241.818812ms audio 121
# Lifted from https://news.ycombinator.com/item?id=14305084
% cat test.rs
fn main() {
println!("Hello, world!");
}
% rustc --emit llvm-bc -C lto test.rs
% LIB=$HOME/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib
% xcrun --toolchain XcodeDefault clang -o test test.bc ~/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-ea49ffd3fee5264c.rlib
warning: overriding the module target triple with x86_64-apple-macosx10.12.0 [-Woverride-module]
package com.bschwind.bottombarnativetest;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
gfdagadf
@bschwind
bschwind / gist:8495883
Created January 18, 2014 20:32
Building a stroke tree for a particular character
package com.skritter.utils;
import com.skritter.models.Param;
import com.skritter.models.Stroke;
import com.skritter.models.StrokeData;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;