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 biz.k11i.util; | |
import java.util.Calendar; | |
import java.util.Date; | |
import java.util.Iterator; | |
import java.util.NoSuchElementException; | |
/** | |
* Date オブジェクトの任意のフィールドをインクリメントしながら繰り返す Iterator の実装です。 | |
* <p> |
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 helpers; | |
import play.db.jpa.JPA; | |
import play.db.jpa.JPAPlugin; | |
/** | |
* トランザクションを一時的に切り替える機能を提供します。 | |
* <p> | |
* トランザクションの切り替え・切り戻しは内部で自動的に行われます。 | |
* </p> |
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
require 'open3' | |
API_URL = 'https://stream.twitter.com/1/statuses/sample.json' | |
USER = 'Twitter_account' | |
PW = 'password' | |
INTERVAL_SECONDS = 10 | |
stdin, stdout, stderr = *Open3.popen3("curl #{API_URL} -u#{USER}:#{PW}") | |
line_count = 0 |
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/bash | |
ORIGINAL_SOURCE=http://rubygems.org/ | |
MIRROR_SOURCE=http://production.cf.rubygems.org/ | |
gem sources -r $ORIGINAL_SOURCE | |
gem sources -a $MIRROR_SOURCE | |
gem $* |
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 java.io.BufferedInputStream; | |
import java.io.BufferedOutputStream; | |
import java.io.DataInputStream; | |
import java.io.DataOutputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Collection; |
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 twitter4j.internal.http; | |
public class HttpResponseHelper { | |
public static HttpClientConfiguration getHttpClientConfiguration( | |
HttpResponse res) { | |
return res.CONF; | |
} | |
} |
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
// Copyright 2005 and onwards Google Inc. | |
// | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions are | |
// met: | |
// | |
// * Redistributions of source code must retain the above copyright | |
// notice, this list of conditions and the following disclaimer. | |
// * Redistributions in binary form must reproduce the above | |
// copyright notice, this list of conditions and the following disclaimer |
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 twitter4j.RateLimitStatus; | |
import twitter4j.Twitter; | |
import twitter4j.TwitterException; | |
import twitter4j.TwitterFactory; | |
public class GetSecondsUntilResetDemo { | |
public static void main(String[] args) throws TwitterException { | |
Twitter twitter = TwitterFactory.getSingleton(); | |
System.out |
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 twitter4j.RateLimitStatus; | |
import twitter4j.Twitter; | |
import twitter4j.TwitterException; | |
import twitter4j.TwitterFactory; | |
public class GetResetTimeInSecondsDemo { | |
public static void main(String[] args) throws TwitterException { | |
Twitter twitter = TwitterFactory.getSingleton(); | |
System.out.println("RateLimitStatus#getResetTimeInSeconds() returns unnecessarily divided value.\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
JSONObject["display_url"] not found. | |
Relevant discussions can be found on the Internet at: | |
http://www.google.co.jp/search?q=531a610a or | |
http://www.google.co.jp/search?q=02749ab7 | |
TwitterException{exceptionCode=[531a610a-02749ab7 592f0a99-37b91020], statusCode=-1, message=null, code=-1, retryAfter=-1, rateLimitStatus=null, version=3.0.0-SNAPSHOT(build: 92708a174b7c103d12f911d331e7e9c23596ecad)} | |
at twitter4j.internal.json.URLEntityJSONImpl.init(URLEntityJSONImpl.java:70) | |
at twitter4j.internal.json.URLEntityJSONImpl.<init>(URLEntityJSONImpl.java:43) | |
at twitter4j.internal.json.StatusJSONImpl.init(StatusJSONImpl.java:164) | |
at twitter4j.internal.json.StatusJSONImpl.<init>(StatusJSONImpl.java:85) | |
at twitter4j.internal.json.z_T4JInternalJSONImplFactory.createStatus(z_T4JInternalJSONImplFactory.java:44) |