Skip to content

Instantly share code, notes, and snippets.

@abcsharp
abcsharp / Program.cs
Created June 9, 2013 16:59
C#でping(要管理者権限)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace PingSample
{
@abcsharp
abcsharp / gist:5208342
Last active December 15, 2015 05:19
Cubieboard+Linaro Ubuntu Server 13.02の環境にGitLabを導入しようとするとlibv8入れる所で躓く件

はじめに

GitLabの導入手順自体はここを参照してください。 ちなみに、他のARM CPUを載せたボードでも同様のエラーが出るらしいので、同じ手順で修正を加えれば問題が解決するかかもしれません。(未検証)

問題

installation.mdのInstall Gemsに従ってbundle installするとこのようなエラーが出て成功しません。

git@localhost:~/gitlab$ bundle install --deployment --without development test postgres

...

@abcsharp
abcsharp / gist:3847287
Created October 7, 2012 06:17
CustomOperationでくだらない事をしてみた
type Calc() =
[<CustomOperation("clear")>]
member it.Clear _ = 0
[<CustomOperation("invert")>]
member it.Invert a = -a
[<CustomOperation("assign")>]
member it.Assign (_, a) = a
[<CustomOperation("add")>]
member it.Add (a, b) = a + b
[<CustomOperation("sub")>]
@abcsharp
abcsharp / gist:3743075
Created September 18, 2012 13:24
Kinect開発をして思った事・気を付けた方が良い事
1.それなりのPCのスペックがないと動作が重くなる事があるので覚悟する事。
実際モバイルCore i5&GT230Mという構成でもそれなりには動く事が分かっているが、それでも割と重いのでそれ以上のCPU&GPUを積んだマシンを推奨
2.Kinectを使った物の製作をする時には成果物の数は少なめに、その分1つ1つに力を入れた方が良い。
Kinectが使えるまで作業が出来ないという事態が発生するのを避ける為と、軽いコンテンツが沢山あってもウケがあまり良くないと思うので
3.数人で開発する場合は、Kinectを使用してデバッグする部分はなるべく1人が担当出来るような形を取る方が良い。
そうする事でその人がKinectを持って帰って作業出来る
4.開発に使用するSDKはOpenNI or Kinect for Windows SDKのどちらかに統一する事。
@abcsharp
abcsharp / Program.fs
Created July 14, 2012 09:25
Observableモジュールを使ってみた
open System
open System.Drawing
open System.Windows.Forms
type Form1 =
inherit Form
val private btn1 : Button
val private btn2 : Button
@abcsharp
abcsharp / simpleOpenNIStudy2.pde
Created June 21, 2012 12:45
https://gist.github.com/2965183 の骨格表示を点から棒人間に変更したバージョン
import processing.opengl.*;
import SimpleOpenNI.*;
SimpleOpenNI context;
void setup(){
//初期化
context=new SimpleOpenNI(this);
context.setMirror(true);
if(!context.enableDepth()){
@abcsharp
abcsharp / simpleOpenNIStudy.pde
Created June 21, 2012 11:16
simpleOpenNIをつかった骨格検出
import processing.opengl.*;
import SimpleOpenNI.*;
SimpleOpenNI context;
void setup(){
//初期化
context=new SimpleOpenNI(this);
context.setMirror(true);
if(!context.enableDepth()){
@abcsharp
abcsharp / gist:2862697
Created June 3, 2012 09:13
インラインアセンブラを使って書いた何か(VC++2010)
#include <iostream>
void swap(int& _a,int& _b)
{
__asm{
mov eax,dword ptr[_a]
mov ecx,[eax]
mov ebx,dword ptr[_b]
mov edx,[ebx]
mov [eax],edx
@abcsharp
abcsharp / gist:2240829
Created March 29, 2012 17:53
渡されたテキストファイルから重複している行を削除し別のファイルに出力する
module Script
open System.IO
[<EntryPoint>]
let main (args : string[]) =
if args.Length = 2 then
let keys =
File.ReadAllLines(args.[0])
|> Array.sort
|> Array.fold
@abcsharp
abcsharp / gist:1560244
Created January 4, 2012 14:22
brainfuckインタプリタ(短くなった)
#include <iostream>
#include <map>
#include <functional>
#include <array>
int main(void)
{
std::map<const char,std::function<void(void)>> Ops;
std::array<unsigned char,30000> Source,Memory;
auto Position=Source.cbegin();
auto Ptr=Memory.begin();