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; | |
namespace StatePattern | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
IState state = new StateA(); //Start state | |
string target = "D"; //Target state |
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
#include <iostream> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
vector<unsigned int> runs; | |
static void InitRuns() | |
{ |
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
" Vimの改行コード表示がちと変わっているので、 | |
" 一般的な改行コードに変換してステータスバーに表示するようにカスタマイズ | |
" 改行コード対応表 | |
" CRLF: dos | |
" CR: unix | |
" LF: mac | |
set statusline = 2 "ステータスバーの表示行数を設定 | |
let dic_line = { 'dos': 'CRLF', 'unix': 'CR', 'mac': 'LF'} | |
let f = &fileformat " 改行コード取得 |
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
#!/bin/bash | |
# インストールしたいパッケージを列挙 | |
packages=("ibus-mozc" "sqlite3" "monodevelop") | |
for p in ${packages[@]} | |
do | |
#順番にインストール | |
sudo apt-get install $p | |
done |
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
#-*- coding utf-8 -*- | |
import pyodbc | |
def test(): | |
connectString = "DRIVER={SQL SERVER}; SERVER=(local)\SQLEXPRESS;DATABASE=;TrustedConnction=yes;" | |
sql = "select sysdb.name from sysdatabases sysdb" | |
#connect server | |
with pyodbc.connect(connectString) as conn: | |
cursor = conn.cursor() |
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
//------------------------------------------------------------------- | |
//10進数→2進数 & 16進数変換プログラム(C言語版) | |
//エミュレータで通信信号送る時に計算めんどくさいから作ってみた。 | |
//ナンセンスな部分があるのはご愛嬌 | |
//------------------------------------------------------------------- | |
#include <stdio.h> | |
void to_binary(int decimal) | |
{ | |
int buf[32] = {0}; |
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.Configuration; | |
using System.Data; | |
using System.Data.Entity; | |
using System.Data.SqlClient; | |
using System.Linq; | |
namespace Koubou.SQLServer.EF | |
{ |
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.Net; | |
using System.Net.Mail; | |
using System.Diagnostics; | |
using System.Text; | |
public static class SendErrorLog | |
{ | |
public static void Send(Exception ex) | |
{ |
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.Data; | |
using System.Linq; | |
using System.Text; | |
using System.Reflection; | |
namespace ListToDataTable | |
{ | |
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
/* | |
* ブラウザ判別 | |
*/ | |
function getBrowserKind() { | |
return navigator.userAgent.toLowerCase(); | |
} | |
/* | |
* 通信 |