2009-08-01から1ヶ月間の記事一覧

Writing unit tests code

This is the tests use the unittest module. I use it for the first time. example... # -*- coding: utf-8 -*- import unittest class Mytest(unittest.TestCase): def testCom(self): self.m= 34 self.assert_(self.m == 34) def kake(self,a,b): return…

これは便利!

php

デバッグ時にまじ使えそう! $hello = "hi!php" if ($_SERVER['REMOTE_ADDR'] == '***.***.***.**'){ var_dump($hello); } 自分のIPアドレスだけを対象になんか処理するときに便利。

strcmpについて

c

#include<stdio.h> #include<string.h> int arr[][3] = { {1,1,1}, {2,4,8}, {3,6,9}, {4,16,64}, {5,25,125}, {6,36,216}, {7,49,343}, {8,64,512}, {9,81,729}, {10,100,1000} }; int num; int i; int main(void){ printf("値をいれて"); scanf("%d",&num); for(i=0;i<10;i++)</string.h></stdio.h>…

forEachのこと

js

var li = []; li.push({1:"aa",2:"rr"}); li.forEach(function(options){ console.log(options[1]); console.log(options[2]); } ); forEach関数内の関数に引数を渡せば対象オブジェクトの内容を参照できる? var li = []; li.push({1:"aa",2:"rr"}); li.for…