[DataContract]
public class Hoge
{
[DataMember(Order = 0)]
public int MyProperty1 { get; set; }
}
[DataContract]
public class HogeHoge : Hoge
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
namespace MvcApplication4.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
public ActionResult Index() | |
{ | |
// 後ろから30件、末尾から読んでるわけじゃないので割と手抜き | |
var initialData = System.IO.File.ReadLines(GlobalConfig.LogPath).Reverse().Take(30); | |
return View(initialData); |
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 ChatWorkAuthenticationHandler : DelegatingHandler | |
{ | |
readonly string apiToken; | |
public ChatWorkAuthenticationHandler(string apiToken) | |
: this(apiToken, new System.Net.Http.HttpClientHandler()) | |
{ | |
} | |
public ChatWorkAuthenticationHandler(string apiToken, HttpMessageHandler innerHandler) |
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 Microsoft.Owin.Hosting; | |
using Owin; | |
using System; | |
namespace ConsoleApplication43 | |
{ | |
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
public class Startup | |
{ | |
static Task emptyTask = Task.FromResult<object>(null); | |
public void Configuration(IAppBuilder app) | |
{ | |
app.Run(context => | |
{ | |
var name = context.Request.Query.Get("name"); | |
var x = int.Parse(context.Request.Query.Get("x")); |
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 Gumbo.Wrappers; | |
using Sgml; | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Xml.Linq; |
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 enum RespType : byte | |
{ | |
SimpleStrings = (byte)'+', | |
Erorrs = (byte)'-', | |
Integers = (byte)':', | |
BulkStrings = (byte)'$', | |
Arrays = (byte)'*' | |
} | |
public class RespClient : IDisposable |
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 UniRx; | |
public class MyBehaviour : MonoBehaviour | |
{ | |
void Start() | |
{ | |
// https://github.com/jbevain/cecil/issues/241 | |
// https://github.com/saynomoo/unetweaver_error | |
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 DictionaryPerfomanceExtensions | |
{ | |
public static void ToDictionaryBatching<T, TKey1>(this T[] array, | |
Func<T, TKey1> keySelector1, out Dictionary<TKey1, T> dictionary1 | |
) | |
{ | |
dictionary1 = new Dictionary<TKey1, T>(array.Length); | |
for (int i = 0; i < array.Length; i++) | |
{ |
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
async Task UseUniRxInBackground() | |
{ | |
Debug.Log($"Start ThreadId:{ Thread.CurrentThread.ManagedThreadId}"); | |
await Task.Delay(TimeSpan.FromMilliseconds(300)); | |
Debug.Log($"From same thread, because UniRx installs UniRxSynchronizationContext.ThreadId:{ Thread.CurrentThread.ManagedThreadId}"); | |
Debug.Log(this.transform.position); // show transform | |
} |