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
// [scala]update status via dispatch.twitter | |
/* | |
* Download | |
* http://databinder.net/dispatch/Download | |
* | |
* Getting started | |
* http://databinder.net/dispatch/Stdout_Walkthrough | |
* | |
* API Reference |
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
HttpTester.parse causes an error when given a non-ISO8859 string... | |
http://markmail.org/message/tw2q4wmk5foiov7f#query:httptester%20utf-8+page:1+mid:tw2q4wmk5foiov7f+state:results | |
I ran into an interesting situation using the HttpTester class. The | |
basic problem is that the response from my servlet is encoded in UTF-8, | |
and the HttpTester.parse(String rawHTTP) uses ISO-8859 and platform | |
encoding for the string character encoding, which may not contain all | |
the needed code points. Also, HttpTester.getContent() uses platform | |
encoding to interpret the raw bytes of the parsed content, which may not | |
be right at all. |
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 jp.mumoshu.http; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.HttpURLConnection; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import android.util.Log; |
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
# プロセスのメモリ使用量を調べる | |
# RSSという項目がメモリ使用量(単位:KB) | |
$ ps alx | head -1 && ps alx | grep sawfish | |
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
1. HTMLのHEADタグ内に下記を記述(静的ページでも対応可能) | |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> | |
2. CSSを画面サイズによって切り替える | |
<!--[if !IE]> | |
<link rel="stylesheet" href="style_print.css" media="print" type="text/css" /> | |
<link rel="stylesheet" href="style.css" media="screen and (min-device-width: 481px)" type="text/css" /> | |
<link type="text/css" rel="stylesheet" media="only screen and (max-device-width: 480px)" href="style_mobile.css" /> | |
<link rel="stylesheet" href="style_mobile.css" media="handheld" type="text/css" /> | |
![endif]--> |
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
1. Eclipse + PHP Development Toolsをインストール | |
http://www.eclipse.org/pdt/downloads/ | |
"All-In-One Windows 32-bit"をダウンロード。 | |
適当なフォルダに展開して、eclipse.exeが起動できれば完了。 | |
2. XAMPPのインストール | |
http://www.apachefriends.org/jp/xampp-windows.html#2671 |
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/ruby -Ku | |
require "rubygems" | |
require "json" | |
require "net/http" | |
require "uri" | |
require "delegate" | |
Net::HTTP.version_1_2 |
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/ruby -Ku | |
require "test/unit" | |
require "src/reverse_geocoder.rb" | |
require "pp" | |
require "json" | |
module TestData | |
@@http_geocoder_response = <<JSON | |
{ |
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
/* | |
* 参考: http://blog.livedoor.jp/sawamur/archives/50450768.html | |
*/ | |
var CIRCLE_IN_METERS = 40000000 | |
/** | |
* 引数に渡した緯度における経度1秒の長さをメートル単位で返す | |
* @param {number} latitude -180~+180の緯度 | |
*/ |
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
private String getAttributeValueThenInjectResources(AttributeSet attrs, | |
String name) { | |
String value = attrs.getAttributeValue(null, name); | |
if (value == null) | |
return ""; | |
String[] tokens = value.split("/"); | |
if (tokens.length == 2 && tokens[0].equals("@string")) { | |
Field field; | |
try { | |
field = R.string.class.getField(tokens[1]); |