Skip to content

Instantly share code, notes, and snippets.

View EsProgram's full-sized avatar
😇

EsProgram EsProgram

😇
View GitHub Profile
/*
* 以下のコードは
* アラン・シャロウェイ,ジェームズ・R・トロット:著 / 村上 雅章:訳 / (2005) / 『デザインパターンとともに学ぶ オブジェクト指向のこころ』 / 株式会社ピアソン・エデュケーション
* より、自分なりにC#用に改変させていただいたコードです
*/
using System;
using System.Collections.Generic;
#include<stdio.h>
//#define DEBUG
#ifdef DEBUG
unsigned long long int count = 0;
#endif
struct Node
{
@EsProgram
EsProgram / TSP.c
Last active August 29, 2015 14:00
//「あるセールスマンが幾つかの都市を一度ずつ訪問して出発点に戻ってくるときに、移動距離が最短になる経路」を求める(全探索)。
//このプログラムでは、セールスマンが巡回しなければならない街の数nを入力した場合に、自動的に街に'A'から始まるASCIIコード
//に対応した名前が街名として順次割り当てられます。セールスマンは'A'からスタートし、最終的に'A'に戻ってくるものとしています。
//また、経路A->Bと、経路B->Aは同じものとみなしますので入力は必要最低限の項目を1回ずつ行うことになります。
//(A->Bを入力したらB->Aを入力する必要はないものとする)。
//通れないルートが有る場合、例えばA->C(またはC->A)には交通手段がないときには、経路入力の時に0を入力して下さい。
//その道を通るルートの計算を除外します。
using System;
using System.Text;
using System.Web;
using System.Diagnostics;
namespace CSharpConsole
{
class ブラウザ開いてYahoo検索する
using System;
using System.Net;
using System.IO;
using System.Windows.Forms;
using System.Drawing;
class ストリームからイメージを作成する
{
[STAThread]
static void Main(string[] args)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web;
namespace CSharpConsole
#include "Input.h"
char* GetStrLineRec(int *size){
static int endFlag = 0;
static int index;
static char* str;
char ret;
if (endFlag == 0){
using System;
using System.Text;
using System.Web;
namespace Es.Web
{
class BrowserSeaech
{
/// <summary>
@EsProgram
EsProgram / GetMaterials
Last active August 29, 2015 14:05
Unity:親を含めた子オブジェクトの全てのマテリアルの取得
private List<Material> materials = new List<Material>();
foreach(Transform child in transform)
{
if(child != null && child.renderer != null && child.renderer.material != null)
foreach(Material mat in child.renderer.materials)
materials.Add(mat);
}
@EsProgram
EsProgram / DestroyMine.cs
Created August 31, 2014 16:07
Unity:allowAttachedObjectの条件を満たさないオブジェクトにはアタッチできないスクリプト
using System.Collections;
using UnityEngine;
public class DestroyMine : MonoBehaviour
{
private static GameObject allowAttachedObject;
private DestroyMine()
{
}