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
import scala.util.Random | |
import scala.language.implicitConversions | |
object Digging { | |
implicit class ExtendMap[T1,T2](val self:Map[T1,T2]) { | |
def intersect[T1,T2](m:Map[T1,T2]) = { | |
(self.toList intersect m.toList).toMap | |
} | |
implicit def mapToExtendMap[T1,T2](self: Map[T1,T2]) : ExtendMap[T1,T2] = new ExtendMap[T1,T2](self) |
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
import scala.language.implicitConversions | |
import java.awt.image.{BufferedImage,Kernel,ConvolveOp} | |
import javax.imageio.ImageIO | |
import java.io.File | |
object ImageProc { | |
implicit class RichString(self:String) { | |
def getExt() = self drop(self.lastIndexOf(".") + 1) | |
} |
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
<Window x:Class="KinectTest.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="MainWindow" Height="350" Width="525" Initialized="Window_Initialized" Closed="Window_Closed"> | |
<Grid> | |
<Image x:Name="XImageRGB" HorizontalAlignment="Left" Height="299" Margin="10,10,0,0" VerticalAlignment="Top" Width="497"/> | |
</Grid> | |
</Window> |
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 OpenCvSharp; | |
using System; | |
using System.Collections.Generic; | |
namespace kamiya.util | |
{ | |
/// <summary> | |
/// 簡単に画像プレビューする仕組みを提供します | |
/// ex) | |
/// var prev = new CvPreview(); |
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.Kinect; | |
using OpenCvSharp; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace kamiya.util | |
{ | |
public static class ImageUtil |
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
import scala.language.postfixOps | |
import scala.util.Random | |
import scala.reflect._ | |
object SimpleGenetic { | |
abstract class Cell[T] { | |
var self:T | |
val seed:Random | |
def show() |
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
import scala.language.postfixOps | |
import scala.util.Random | |
object Lifegame { | |
implicit class RichList[T](self:List[T]){ | |
def shuffle() = (new Random).shuffle(self) | |
} | |
implicit class Field(self:Map[(Int,Int),Boolean]) { | |
def around(p:(Int,Int), d:Int = 1) = self filter(x => Tools.aroundPoint(p,d).contains(x._1)) | |
def isLive(p:(Int,Int)) = { |
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
#include<stdio.h> | |
#include<time.h> | |
#include "linear_rand.h" | |
#define WORLD_W 128 | |
#define WORLD_H 64 | |
#define TRUE 1 | |
#define FALSE 0 |
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
echo off | |
cls | |
avrsp -RF -pb10:312500 -d6 | |
echo "20MHz XTAL 1/1 FL(01100010 -> 11100111)" | |
pause | |
avrsp -FL11100111 -pb10:312500 -d6 | |
avrsp -RF -pb10:312500 -d6 | |
pause |
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
import scala.language.postfixOps | |
import scala.util.Random | |
import scala.reflect._ | |
object LifegameGenetic { | |
abstract class Cell[T] { | |
var self:T | |
def show() | |
def make() |