This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
multi_compile A B C | |
multi_compile D E | |
A B C D E | |
+ . . + . | |
. + . + . | |
. . + + . | |
+ . . . + | |
. + . . + | |
. . + . + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DataBuffer { | |
var internalData: NSData; | |
init(fromData: NSData) { | |
self.internalData = NSData.dataWithData(fromData) as NSData; | |
} | |
init(fromFilePath: String) { | |
self.internalData = NSData.dataWithContentsOfFile(fromFilePath, options: .DataReadingMappedIfSafe, error: nil) as NSData; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
/* Google Analytics integration. Web page must be configured for GA with Google's javascript snippet. | |
* | |
* Based on a comment from 2010 found here: | |
* http://blog.mostlytigerproof.com/2009/10/06/gathering-statistics-using-google-analytics-and-unity-3d/ | |
* | |
* Analytics category/action/label/value descriptions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class Host | |
{ | |
private readonly string _zmqEndpoint; | |
private readonly Action<Action> _dispatcher; | |
private static ZmqSocket _server; | |
private static readonly ConcurrentQueue<Action> WaitToSend = new ConcurrentQueue<Action>(); | |
public Host(string zmqEndpoint, Action<Action> dispatcher) | |
{ | |
_zmqEndpoint = zmqEndpoint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"cmd": ["gcc", "${file}", "-o", "${file_path}/${file_base_name}", "-Wall"], | |
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", | |
"working_dir": "${file_path}", | |
"selector": "source.c", | |
"variants": | |
[ | |
{ | |
"name": "Run", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* When developing the UI system we came across a bunch of things we were not happy | |
* with with regards to how certain events and calls could be sent in a loosely coupled | |
* way. We had this requirement because with a UI you tend to implement widgets that receive | |
* certain events, but you don't really want to have lots of glue code to manage them | |
* and keep track of them. The eventing interfaces we developed helped with this. One of | |
* the interesting things, is that they are not justfor the UI system! You can use this as | |
* a type-safe, fast, and simple alternative to SendMessage (never use SendMessage!). | |
* So how does it all work? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor.Graphing; | |
namespace UnityEditor.ShaderGraph | |
{ | |
[Title("Input", "Lighting", "Main Light")] | |
public class MainLightNode : AbstractMaterialNode, IGeneratesBodyCode | |
{ | |
public MainLightNode() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
# Close ports if they were already open under another configuration | |
try: | |
cmds.commandPort(name=":7001", close=True) | |
except: | |
cmds.warning('Could not close port 7001 (maybe it is not opened yet...)') | |
try: | |
cmds.commandPort(name=":7002", close=True) | |
except: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in our case, | |
const float kRGBMMaxRange = 8.0f; | |
const float kOneOverRGBMMaxRange = 1.0f / kRGBMMaxRange; | |
// encode to RGBM, c = ARGB colors in 0..1 floats | |
float r = c[1] * kOneOverRGBMMaxRange; | |
float g = c[2] * kOneOverRGBMMaxRange; | |
float b = c[3] * kOneOverRGBMMaxRange; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class ShuffleBag<T> : ICollection<T>, IList<T> | |
{ | |
private List<T> data = new List<T> (); | |
private int cursor = 0; | |
private T last; | |
OlderNewer