Skip to content

Instantly share code, notes, and snippets.

@indare
indare / gist:1703188
Created January 30, 2012 07:59
非破壊代入の記事
Spinner spinner;
spinner = (Spinner) findViewById(R.id.hogeA);
spinner.setNextFocusDownId(R.id.hogeB);
spinner = (Spinner) findViewById(R.id.hogeB);
spinner.setNextFocusDownId(R.id.hogeC);
@indare
indare / 継承
Created January 31, 2012 03:02
継承・・・?
class 印刷
public void 印刷動作
class 納品書印刷 extends 印刷
@Override
public void 印刷動作
class 請求書印刷 extends 印刷
@Override
@indare
indare / HogeHoge.vb
Created March 8, 2012 05:41
VB2008でプロパティと遊ぶ
Public Class HogeHoge
Public Property Hoge() as integer
Get
Return Hoge
End Get
Set(ByVal value as integer)
Hoge = value
End Set
End Property
@indare
indare / hoge.cs
Created March 8, 2012 06:05
C#のプロパティ自動実装について
public class hoge {
public string fuge { get; set; }
}
@indare
indare / TryCatch.vb
Created March 8, 2012 12:23
i wan't kill returnCode
Public Class TryCatch
Public Function YesError() as hogeEnum
Dim i as integer
Dim returnCode as integer
Dim MessageReturn as Integer = MessageBox.Show("キャンセル?","問い合わせ",MessageBoxButton.YesNo)
If MessageReturn = DialogResult.No Then
Rerun hogeEnum.Cancel
@indare
indare / linqtest.cs
Created March 9, 2012 04:01
Linqの理解用
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace linqtest
{
public class hoge{
public string id;
public int value;
<?php
require_once 'PHPUnit/Autoload.php';
class testBoolCheck extends PHPUnit_Framework_TestCase {
public function testBoolCheck_1(){
$this->assertEquals(is_bool(-1),false);
}
public function testBoolCheck_2(){
@indare
indare / gist:2699484
Created May 15, 2012 06:06
Closure<php>
<?php
function newCounter(){
$i = 0;
return function() use ($i){
return ++$i;
};
}
//$c = newCounter();
@indare
indare / nagoya.groovy
Created May 18, 2012 02:29
nagoya.groovy
/**
* Created with IntelliJ IDEA.
* User: m_arino
* Date: 12/05/18
* Time: 11:10
* To change this template use File | Settings | File Templates.
*/
(0..100).toArray().each {
@indare
indare / phpUnitRunner.groovy
Created June 14, 2012 04:12
phpUnitRunner
def phpUnitPath = '/opt/local/bin/'
def targetTestClass = '/workspace/cron/test/TestCheckMembers.php'
def cmd = phpUnitPath + 'phpunit ' + targetTestClass
def p = Runtime.getRuntime().exec(cmd)
def r = p.getInputStream().newReader('UTF-8')
r.eachLine{
if((~/OK \(/).matcher(it).find()){
Runtime.getRuntime().exec('/usr/local/bin/growlnotify -t phpUnit -m Green --image /Green.png')
}