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
<?php | |
$sunt = mktime(0, 0, 0, date("m"), date("d")-date("w"), date("Y")); // 今週の日曜日0時の時刻 | |
for ($i = 0; $i < 7; $i++) { | |
$t = $sunt + $i * 60 * 60 * 24; //ワンステップで一日 | |
$day = date("j", $t); | |
if ($day == date("j")) { //今日の場合 | |
$day = "<b>{$day}</b>"; | |
} | |
echo " <td>{$day}</td>\n"; | |
} |
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 string | |
from random import randrange | |
LENGTH = 10 | |
alphabets = string.digits + string.letters | |
def randstr(n): | |
return ''.join(alphabets[randrange(len(alphabets))] for i in xrange(n)) | |
if __name__ == '__main__': |
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 org.dom4j.Document; | |
import org.dom4j.DocumentException; | |
import org.dom4j.DocumentHelper; | |
public class Dom4jTest { | |
public static void main(String[] args) { | |
System.out.println("start"); | |
String xml = "<root><element name='toshi'>text1</element><element2>text2</element2></root>"; | |
try { | |
Document doc = DocumentHelper.parseText(xml); |
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
<?php | |
/** | |
* via: http://d.hatena.ne.jp/fbis/20070713/1184309659 | |
*/ | |
function camelize ($str) { | |
return str_replace(' ','',ucwords(str_replace('_',' ',$str))); | |
} | |
function decamelize ($str) { |
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
<?php | |
/** | |
* via: http://nanoca.me/relaxtyle/blog/2011/07/php-1.html | |
*/ | |
// 現在表示されているファイル名取得 | |
$path=$_SERVER["PHP_SELF"]; | |
// パスつきのファイル名取得 | |
$filename=basename($_SERVER["PHP_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
<?php | |
print "1 hour later:" . date("Y/m/d H:i:s",strtotime("1 hour" ,strtotime(now))) . "<br>"; |
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
// via: http://docs.jquery.com/How_jQuery_Works | |
$(document).ready(function(){ | |
$("a").click(function(event){ | |
alert("As you can see, the link no longer took you to jquery.com"); | |
event.preventDefault(); | |
}); | |
}); |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int n = 10; | |
Action<int> act = (int i) => | |
{ | |
Console.WriteLine("num is : {0}", n * i); | |
}; |
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
<?php | |
/** | |
* masking string | |
* | |
* @param string @secretStr | |
* @return string | |
*/ | |
function masking($secretStr) { | |
return str_repeat('*', strlen($secretStr)); | |
} |
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
.circle { | |
background-color: #cc3; | |
height: 150px; | |
width: 150px; | |
border-radius:75px; | |
-moz-border-radius:75px; | |
-webkit-border-radius: 75px; | |
} |
OlderNewer