This file contains hidden or 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 System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
using Microsoft.CSharp; | |
using System.CodeDom.Compiler; | |
namespace ClassLibrary1 |
This file contains hidden or 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
struct AnonymousUser { | |
private static Random ADirtyRandoPleb = new Random(); | |
public const double ModPrime = 17; | |
public const double Generator = 3; | |
public double Number { get; private set; } | |
public double Power { get; private set; } | |
public double Score { get; private set; } |
This file contains hidden or 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
from collections import OrderedDict | |
# Compiler Tokens | |
FLOAT_CONSTANT = 'FLOAT_CONSTANT' | |
INTEGER_CONSTANT = 'INTEGER_CONSTANT' | |
HEX_CONSTANT = 'HEX_CONSTANT' | |
STRING_CONSTANT = 'STRING_CONSTANT' | |
CHAR_CONSTANT = 'CHAR_CONSTANT' | |
BOOLEAN_CONSTANT = 'BOOLEAN_CONSTANT' |
This file contains hidden or 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
#include "stdafx.h" | |
using namespace std; | |
enum Compiler_Token { | |
T_EOF = 0x0, // don't wanna use 'EOF' since some headers have a #define for 'EOF' | |
IDENTIFIER = 0x1, | |
FLOAT_CONSTANT = 0x2, |
This file contains hidden or 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 Hexagon { | |
float x = 0; | |
float y = 0; | |
float size = 30; | |
HexTriangle[] triangles; | |
Hexagon(float x, float y, float size) | |
{ | |
this.x = x; |
This file contains hidden or 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 System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
using System.Diagnostics; | |
namespace Benchmarker { | |
public class Program { | |
static Dictionary<int, float> ContainsKey_Hits, ContainsKey_Misses; |
This file contains hidden or 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
// The solution I've been using up until now | |
if (Items.ContainsKey(Key)) { | |
var item = Items[Key]; | |
} | |
// Using a single function call to get the value | |
if (Items.TryGetValue(Key, out var item)) { | |
// do something with item | |
} |
This file contains hidden or 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
pub fn sub(str: &String, a: usize, b: usize) -> String { | |
str[a .. str.char_indices().nth(b).unwrap().0].to_owned() | |
} |
This file contains hidden or 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
// Add these to your autoexec.cfg | |
bind "KP_END" "join_class scout" | |
bind "KP_DOWNARROW" "join_class soldier" | |
bind "KP_PGDN" "join_class pyro" | |
bind "KP_LEFTARROW" "join_class demoman" | |
bind "KP_5" "join_class heavyweapons" | |
bind "KP_RIGHTARROW" "join_class engineer" | |
bind "KP_HOME" "join_class medic" | |
bind "KP_UPARROW" "join_class sniper" |
This file contains hidden or 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
{ | |
"ScreenName": "some screen name", | |
// directory of the assets used | |
// this directory is appended to ./assets/ | |
// so this path would become ./assets/tiles/ | |
"AssetFolder": "tiles/", | |
"Layers": [ | |
{ // layer 0 | |
"Name": "Layer 0", | |
"Rows": [ |
OlderNewer