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 static void ThrowArgNullException(params object[] args) | |
{ | |
for (int i = 0; i < args.Count(); i++) | |
{ | |
if (args[i] == null) throw new ArgumentNullException("Argument Number " + i); | |
} | |
} | |
public static void ThrowArgNullException(string[] ArgNames, params object[] args) | |
{ |
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
#pragma config(Hubs, S1, HTMotor, HTMotor, none, none) | |
#pragma config(Sensor, S1, , sensorI2CMuxController) | |
#pragma config(Motor, mtr_S1_C1_1, m1, tmotorTetrix, openLoop) | |
#pragma config(Motor, mtr_S1_C1_2, m2, tmotorTetrix, openLoop) | |
#pragma config(Motor, mtr_S1_C2_1, m3, tmotorTetrix, openLoop) | |
#pragma config(Motor, mtr_S1_C2_2, m4, tmotorTetrix, openLoop) | |
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// | |
#include "JoystickDriver.c"; |
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
#pragma config(Hubs, S1, HTMotor, HTMotor, none, none) | |
#pragma config(Sensor, S1, , sensorI2CMuxController) | |
#pragma config(Motor, mtr_S1_C1_1, m1, tmotorTetrix, openLoop) | |
#pragma config(Motor, mtr_S1_C1_2, m2, tmotorTetrix, openLoop) | |
#pragma config(Motor, mtr_S1_C2_1, m3, tmotorTetrix, openLoop) | |
#pragma config(Motor, mtr_S1_C2_2, m4, tmotorTetrix, openLoop) | |
#pragma config(Motor, mtr_S1_C3_1, m5, tmotorTetrix, openLoop) | |
#pragma config(Motor, mtr_S1_C3_2, m6, tmotorTetrix, openLoop) | |
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// |
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
#pragma config(Hubs, S1, HTMotor, none, none, none) | |
#pragma config(Sensor, S1, , sensorI2CMuxController) | |
#pragma config(Motor, mtr_S1_C1_1, m1, tmotorTetrix, openLoop) | |
#pragma config(Motor, mtr_S1_C1_2, m2, tmotorTetrix, openLoop) | |
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// | |
#include "JoystickDriver.c"; | |
task main() { | |
while (true) { |
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
static T GetRandomValue<T>(this T[] array) | |
{ | |
return array[new Random().Next(0, array.Length)]; | |
} |
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 System; | |
using C = System.Console; | |
namespace MontyHall | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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 Parse.cs | |
public static Parser<U> EnumerateInput<T, U>(IEnumerable<T> input, Func<T, Parser<U>> parser) | |
{ | |
if (input == null) throw new ArgumentNullException("input"); | |
if (parser == null) throw new ArgumentNullException("parser"); | |
return EnumerateInput(input.ToArray(), parser); | |
} | |
public static Parser<U> EnumerateInput<T, U>(T[] input, Func<T, Parser<U>> parser) |
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
<html> | |
<body> | |
<table cellpadding="0" cellspacing="0" width="100%" height="100%"> | |
<tr> | |
<td width="100%" height="100%" valign="center"> | |
<center> | |
<img src="image.png"/> | |
</center> | |
</td> | |
</tr> |
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 static class ClaimsExtensions | |
{ | |
public static string GetClaimValue(this HttpContext context, string type) | |
{ | |
if (context.User.Claims.FirstOrDefault(c => c.Type == type) is Claim claim) | |
{ | |
return claim.Value; | |
} | |
else throw new ArgumentException(type + " is not found in claims."); | |
} |
OlderNewer