Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Reflection;
public class ReflectionTest: MonoBehaviour {
// Use this for initialization
void Start () {
Something = 3.1415926f;
}
delegate int AnyFunctionThatTakesTwoFloatsAndReturnsAnInt (float a, float z);
AnyFunctionThatTakesTwoFloatsAndReturnsAnInt myFunction;
// myFunction is null
myFunction (1.1, 2.1); // => NullReferenceException
int AddAndTruncate (float first, float second){ return (int)(first + second); }
myFunction = AddAndTruncate;
levi@levi-XPS-8300:/tmp$ hg init blah
levi@levi-XPS-8300:/tmp$ cd blah
levi@levi-XPS-8300:/tmp/blah$ echo "a" > a
levi@levi-XPS-8300:/tmp/blah$ hg add a
levi@levi-XPS-8300:/tmp/blah$ hg commit -ma
levi@levi-XPS-8300:/tmp/blah$ echo "b" > a
levi@levi-XPS-8300:/tmp/blah$ hg commit -mb
levi@levi-XPS-8300:/tmp/blah$ hg strip --keep .
saved backup bundle to /tmp/blah/.hg/strip-backup/c5d889c88f42-backup.hg
levi@levi-XPS-8300:/tmp/blah$ hg diff
diff --git a/libgc/allchblk.c b/libgc/allchblk.c
index 1a1efc6..8f9b895 100644
--- a/libgc/allchblk.c
+++ b/libgc/allchblk.c
@@ -579,8 +579,8 @@ int n;
register hdr * hhdr; /* Header corr. to hbp */
register struct hblk *thishbp;
register hdr * thishdr; /* Header corr. to hbp */
- signed_word size_needed; /* number of bytes in requested objects */
- signed_word size_avail; /* bytes available in this block */
Linux:
linux-vdso.so.1 => (0x00007fff1ffff000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f68b8647000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f68b7d0e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f68b794f000)
/lib64/ld-linux-x86-64.so.2 (0x00007f68b9359000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f68b8429000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f68b8221000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f68b7f25000)
import UnityEngine
class Notebook (MonoBehaviour):
selectedTab = 0
tabs = ("First", "Second");
panels = (DrawFirst, DrawSecond)
def OnGUI ():
selectedTab = GUILayout.Toolbar (selectedTab, tabs)
panels[selectedTab]()
using System;
using UnityEngine;
public class ScopedHorizontalLayout: IDisposable
{
public ScopedHorizontalLayout (params GUILayoutOption[] options)
{
GUILayout.BeginHorizontal (options);
}
static function TestFunction(context : String)
{
Debug.Log("static function TestFunction I " + context);
yield 0;
Debug.Log("static function TestFunction II " + context);
}
#!/bin/sh
arch=`uname -i`
case $arch in
x86_64)
echo '64bit!'
;;
i*86)
echo '32bit!'
@Tak
Tak / stl_tree.h
Created September 18, 2012 07:47
// RB tree implementation -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.