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
#!/bin/sh | |
# install PHPUnit to $HOME/pear on Snow Leopard | |
cd $HOME | |
pear config-create $HOME .pearrc | |
pear install -o PEAR | |
./pear/pear channel-update pear.php.net | |
./pear/pear list | |
./pear/pear list-upgrades | |
./pear/pear channel-discover pear.phpunit.de | |
./pear/pear channel-discover pear.symfony-project.com |
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
package hello | |
import ( | |
"fmt" | |
"http" | |
"time" | |
) | |
func init() { | |
http.HandleFunc("/", handler) |
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
package controllers; | |
import play.Logger; | |
import play.jobs.Job; | |
import play.mvc.Controller; | |
public class Test extends Controller { | |
public static void test() { | |
subFunction(); | |
renderText("OK"); |
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
package controllers; | |
import java.util.HashMap; | |
import play.mvc.Controller; | |
public class Application extends Controller { | |
static String problematicMethod() { | |
final HashMap<String, String[]> map; | |
map = new HashMap<String, String[]>(); | |
map.put("key", new String[] { "v1", "v2" }); |
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
#!/usr/bin/env bash | |
set -u | |
set -e | |
GROUP="$1" | |
PARAMS="character_set_client character_set_connection character_set_database character_set_results character_set_server" | |
for param in $PARAMS; do | |
echo Set $param to utf8 | |
rds-modify-db-parameter-group "$GROUP" -p "name=$param, value=utf8, method=immediate" | |
done |
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
sudo port install mysql5 | |
sudo -u mysql mysql_install_db5 | |
(cd /opt/local ; sudo /opt/local/lib/mysql5/bin/mysqld_safe &) | |
/opt/local/lib/mysql5/bin/mysqladmin -u root password 'YOUR_PASSWORD' | |
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist |
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
#!/usr/bin/env ruby | |
# require safariwatir gem. | |
require 'safariwatir' | |
browser = Watir::Safari.new | |
browser.goto 'http://tr.twipple.jp/hotword/' | |
# browser.goto 'http://tr.twipple.jp/talent/' # required another regexes | |
html = browser.html | |
chunk_regex = / START : (.+?) END : (.*)/m | |
rank_regex = /<div class="rankTtl"><a href="[^"]+\?q=([^"]+)" target="_blank">([^<]+)<\/a>(.*)/m |
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
if(this.infoLabel.size.height > 28) | |
{ | |
this.infoLabel.height = 28; | |
} | |
else | |
{ | |
this.infoLabel.height = 'auto'; | |
} |
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
var tmp = tmp2 = Ti.App.tmp = {}; | |
Ti.API.debug('eq1: ' + (Ti.App.tmp === tmp)); | |
Ti.API.debug('eq2: ' + (tmp2 === tmp)); |
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
printf <- function(fmt, ...) { | |
cat(sprintf(fmt, ...)) | |
} | |
VNTTRK <- function(csv_file) { | |
abet <- read.csv(csv_file, header=T, row.names=1) | |
abe <- data.frame(rank=1:nrow(abet), freq=abet) | |
par(mfrow=c(1,2)) | |
plot(abe, type="l") | |
plot(log(abe), type="l") |
OlderNewer