This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<FindBugsFilter> | |
<Match> | |
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2,NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD,UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD,URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD,SBSC_USE_STRINGBUFFER_CONCATENATION,SE_BAD_FIELD" /> | |
</Match> | |
</FindBugsFilter> |
This file contains hidden or 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
require 'date' | |
date = Date.today | |
for i in 1..20 | |
date = date.next | |
puts date.strftime("%Y/%m/%d(#{%w(日 月 火 水 木 金 土)[date.wday]}) %H:%M〜") | |
end |
This file contains hidden or 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
String url = "https://..."; | |
URIBuilder builder = null; | |
try { | |
builder = new URIBuilder(url); | |
builder.addParameter("param", "テスト"); | |
HttpClient client = new DefaultHttpClient(); | |
HttpPost post = new HttpPost(builder.build()); | |
byte[] bytes = IOUtils.toByteArray(Thread.currentThread().getContextClassLoader().getResource("1.jpg")); |
This file contains hidden or 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 getAccessToken(String code) { | |
String url = "https://secure.mixi-platform.com/2/token"; | |
HttpClient client = new DefaultHttpClient(); | |
HttpPost post = new HttpPost(url); | |
List<NameValuePair> pairs = new ArrayList<NameValuePair>(); | |
pairs.add(new BasicNameValuePair("grant_type", "authorization_code")); | |
pairs.add(new BasicNameValuePair("client_id", CONSUMER_KEY)); | |
pairs.add(new BasicNameValuePair("client_secret", CONSUMER_SECRET)); |
This file contains hidden or 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 | |
if [ ! -f /tmp/quickwar.xml ] | |
then | |
wget --no-check-certificate -O /tmp/quickwar.xml https://raw.github.com/gist/3401499/aea7940a07739ff297deeeccf7385d6d2a2f29c3/pom.xml | |
fi | |
sed -E "s?<webAppSourceDirectory>.*</webAppSourceDirectory>?<webAppSourceDirectory>`pwd`</webAppSourceDirectory>?g" /tmp/quickwar.xml >/tmp/quickwar_replaced.xml | |
mvn -f /tmp/quickwar_replaced.xml jetty:run |
This file contains hidden or 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
# マウスホイールでスクロールする | |
set-window-option -g mode-mouse on | |
# ペインをマウスクリックして選択する | |
set-option -g mouse-select-pane on | |
# ウィンドウをマウスクリックして選択する | |
set-option -g mouse-select-window on | |
# マウスでペインをリサイズする | |
set-option -g mouse-resize-pane on |
This file contains hidden or 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
cat > hoge.txt << EOF |
This file contains hidden or 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
# coding: utf-8 | |
require 'rubygems' | |
require 'net/irc' | |
class TaeClient < Net::IRC::Client | |
def on_rpl_welcome(m) | |
post JOIN, opts.channel | |
end | |
def on_privmsg(m) |
This file contains hidden or 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
object Problem1 extends App { | |
val list = List.range(1, 1000) | |
val nums = list.filter(x => { x % 3 == 0 || x % 5 == 0 }) | |
val answer = nums.sum | |
Console.print(answer) | |
} |
This file contains hidden or 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
object Problem1 extends App { | |
val answer = (1 until 1000).view.filter(x => { x % 3 == 0 || x % 5 == 0 }).sum | |
Console.println(answer) | |
} |