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 System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using NSwag; | |
using NSwag.CodeGeneration.CSharp; | |
namespace GatewayGenerator | |
{ | |
class Program |
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 class MessageBox | |
{ | |
private Stack<string> messages = new Stack<string>(); | |
public int MessageCount { get { return messages.Count; } } | |
public void AddMessage(string message) | |
{ | |
messages.Push(message); | |
} | |
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 MessageBox | |
{ | |
private List<string> messages = new List<string>(); | |
public int MessageCount { get { return messages.Count; } } | |
public string this [int i] | |
{ | |
get { return messages [i]; } | |
set { messages[i] = value; } | |
} | |
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
$ csharp |
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
var LEGO_VENDOR_ID = 0x0694; | |
var EV3_PRODUCT_ID = 0x0005; | |
var DIRECT_COMMAND = 0x80; | |
var usb = require('usb'); | |
var device = usb.findByIds(LEGO_VENDOR_ID, EV3_PRODUCT_ID); |
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
e Json::Value $root1 = Json::Value((Json::ValueType)Json::ValueType::objectValue) |
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
e std::string $str | |
e $str = "Some string" | |
e (SomeType*) some_func($str) |
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
var csb = new DbConnectionStringBuilder(); | |
csb.ConnectionString = "data source=(local);"; | |
Console.WriteLine(csb.ContainsKey("Data Source")); |
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
void Main() | |
{ | |
List<Days> weekend = new List<Days>(); | |
Enum.GetValues(typeof(Days)).Cast<Days>().ToList() | |
.ForEach(d => { | |
var fi = d.GetType().GetField(d.ToString()); | |
if (fi.GetCustomAttributes(typeof(WeekendAttribute), false).Length > 0) | |
{ |
NewerOlder