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
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
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
<StyleCopSettings Version="105"> | |
<Parsers> | |
<Parser ParserId="StyleCop.CSharp.CsParser"> | |
<ParserSettings> | |
<BooleanProperty Name="AnalyzeDesignerFiles">False</BooleanProperty> | |
<CollectionProperty Name="GeneratedFileFilters"> | |
<Value>\.g\.cs$</Value> | |
<Value>TemporaryGeneratedFile.*\.cs$</Value> | |
<Value>\.g\.i\.cs$</Value> | |
</CollectionProperty> |
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.Linq; | |
using System.Text; | |
using System.Runtime.InteropServices; | |
namespace ConsoleApplication8 | |
{ | |
class Program | |
{ |
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
Method: | |
private Task<TextMessage> SendMessageToServiceAsync(TextMessage message) | |
{ | |
var tcs = new TaskCompletionSource<TextMessage>(); | |
SendMessageToService(message, (msg) => tcs.SetResult(msg)); | |
return tcs.Task; | |
} |
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 Test<PageType> : DbContext | |
where PageType : class | |
{ | |
private Dictionary<Type, PageType> callbacks = new Dictionary<Type, PageType>(); | |
protected override void OnModelCreating(DbModelBuilder modelBuilder) | |
{ | |
base.OnModelCreating(modelBuilder); | |
foreach (var type in callbacks.Keys) |
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
public class MeterTestDataContext : DbContext, IMeterTestDataContext | |
{ | |
public MeterTestDataContext(string fileOrServerOrConnection) | |
: base(fileOrServerOrConnection) | |
{ | |
} | |
protected override void OnModelCreating(DbModelBuilder modelBuilder) | |
{ | |
base.OnModelCreating(modelBuilder); |
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
#pragma warning disable 0809 | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplication1 | |
{ | |
public class Base | |
{ |
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
public static class GeoLocationHelper | |
{ | |
public static GeoCoordinate ToWGS84(double x, double y) | |
{ | |
var axis = 6378137.0; | |
var flattening = 1.0 / 298.257222101; | |
var centralMeridian = 15.0 + 48.0 / 60.0 + 22.624306 / 3600.0; | |
var scale = 1.00000561024; | |
var falseNorthing = -667.711; | |
var falseEasting = 1500064.274; |
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
int offset = 0; | |
var socket = tcpClient.Client; | |
while (offset != data.Length) | |
{ | |
if (socket.Poll(30, SelectMode.SelectWrite)) | |
{ | |
offset += tcpClient.Client.Send(data, offset, data.Length - offset, SocketFlags.None); | |
} | |
} |
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
int startTickCount = Environment.TickCount; | |
int timeout = 10000; | |
var dataSent = false; | |
var socket = tcpClient.Client; | |
while (dataSent == false) | |
{ | |
if (Environment.TickCount > startTickCount + timeout) | |
{ | |
throw new Exception("Timeout."); |
NewerOlder