Skip to content

Instantly share code, notes, and snippets.

@ichiroku11
ichiroku11 / gist:7973427
Created December 15, 2013 14:04
over句を使って累計
if object_id(N'tempdb..#Sale') is not null
drop table #Sale;
select *
into #Sale
from (values
('2013/12/09', N'ねぎま', 100),
('2013/12/10', N'ねぎま', 200),
('2013/12/11', N'純けい', 100),
('2013/12/12', N'純けい', 300),
@ichiroku11
ichiroku11 / gist:8319173
Last active January 2, 2016 14:49
dapper dot netでジェネリック型にマッピング
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;
namespace ConsoleApp {
class Sample<TValue> {
@ichiroku11
ichiroku11 / app.ts
Last active August 29, 2015 13:55
TypeScript でライフゲーム
/// <reference path="gameoflife.ts" />
document.addEventListener("DOMContentLoaded", () => {
console.log(document.getElementById("content").innerHTML);
var width = 40;
var height = 30;
var defaults: { x: number; y: number }[] = [];
for (var x = 0; x < width; x++) {
for (var y = 0; y < height; y++) {
@ichiroku11
ichiroku11 / Program.cs
Last active August 29, 2015 14:02
Entity Frameworkでパラメータを渡してSQLを実行する
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;
@ichiroku11
ichiroku11 / BinaryReaderExtensions.cs
Last active January 25, 2022 05:22
.NETで名前付きパイプを試す
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NamedPipe.ConsoleApp {
// BinaryReaderの拡張メソッドを定義
public static class BinaryReaderExtensions {
@ichiroku11
ichiroku11 / Client.cs
Last active March 2, 2021 05:24
.NETでTCP(TcpClientとTcpListener)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace Tcp.ConsoleApp {
// クライアント
@ichiroku11
ichiroku11 / Program.cs
Last active February 1, 2017 08:44
Observable.Startを試した
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reactive.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp {
class Program {
@ichiroku11
ichiroku11 / Program.cs
Last active February 12, 2017 13:51
.NETでUDP(UdpClient)
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Threading.Tasks;
@ichiroku11
ichiroku11 / Program.cs
Created February 2, 2017 03:19
Observable.ToAsyncとObservable.Deferを試した
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reactive.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApp {
@ichiroku11
ichiroku11 / HtmlHelperExtensions.cs
Created February 22, 2017 05:16
部分ビューのname属性にプレフィックスを付けたいからRenderPartialForを作る
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;
namespace WebApp.Html {
public static class HtmlHelperExtensions {