path_to_programfiles/Cytoscape_v2.8.3/Cytoscape.vmoptionsを変更すれば良い. たとえば,最大メモリ4G使いたいのであれば,
-Xms10m -Xmx4G -Xss10m -Dswing.aatext=true -Dawt.useSystemAAFontSettings=lcdと直して起動すれば,最大で4Gほどのメモリを確保して起動してくれる. 便利.
ソーシャルメディアとか人狼とか計算社会科学を研究している研究者による適当なブログ.
path_to_programfiles/Cytoscape_v2.8.3/Cytoscape.vmoptionsを変更すれば良い. たとえば,最大メモリ4G使いたいのであれば,
-Xms10m -Xmx4G -Xss10m -Dswing.aatext=true -Dawt.useSystemAAFontSettings=lcdと直して起動すれば,最大で4Gほどのメモリを確保して起動してくれる. 便利.
RubyGems 1.8.24 installed == 1.8.24 / 2012-04-27 * 1 bug fix: * Install the .pem files properly. Fixes #320 * Remove OpenSSL dependency from the http code path ------------------------------------------------------------------------------ RubyGems installed the following executables: /home/name/local/bin/gem18$ cd
... set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/\ bin $HOME/local/bin) setenv RUBYLIB $HOME/local/lib setenv GEM_HOME $HOME/local/lib/ruby/gem$ sources .cshrc
chown/chgrp: Operation not permittedエラーだ.
... set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin $HOME/local/bin $HOME/local/lib/ruby/gem/bin)$ source .cshrc
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby18 extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby18
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--enable-local
--disable-local
Gem files will remain installed in /home/name/local/lib/ruby/gem/gems/sqlite3-1.3.6 for inspection.
Results logged to /home/name/local/lib/ruby/gem/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out
An error occured while installing sqlite3 (1.3.6), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
おや?Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.だけど,さくらに入っているのはsqlite3 ver 3.7.9 20
...
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby18 extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby18
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--enable-local
--disable-local
Gem files will remain installed in /home/name/local/lib/ruby/gem/gems/sqlite3-1.3.6 for inspection.
Results logged to /home/name/local/lib/ruby/gem/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out
An error occured while installing sqlite3 (1.3.6), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
調べてみると,結構インストールのやり方が出てくるけど,皆情報が古い.Warning: $HADOOP_HOME is deprecatedと表示されうまく起動しない. そこで,
hadoop-env.shに,
export HADOOP_HOME_WARN_SUPPRESS="TRUE"を追加.
| 東日本大震災時のTweetデータ | |
|---|---|
| データ範囲 | 2011-03-05 00:00:00~2011-03-24 22:23:58 |
| 総Tweet数 | 407562159 |
| 言語 | 主に日本語 |
All our Streaming API products are now supporting SSL and we've just updated the Streaming API Methods, User Streams and Site Streams documentation pages accordingly. As we're planning to sunset HTTP support in about a month, we strongly encourage you to switch to SSL (HTTPS) as soon as possible, especially if you're still authenticating your Streaming API requests with Basic Auth.ということで,SSLを使ってね,ということらしいです.
package twitter;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.Authenticator;
import java.net.HttpURLConnection;
import java.net.PasswordAuthentication;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* StreamAPIから送られてくるStreamデータをひたすら取得し続けるクラス
* @author tori
*
*/
public class TwitterStreamReader {
/**
* 使い方の例
* @param args
* @throws UnsupportedEncodingException
*/
public static void main(String[] args) throws UnsupportedEncodingException {
TwitterStreamReader tsr = new TwitterStreamReader("Twitter-UserName", "Password");
tsr.start();
while(true){
List<String> tweetList = tsr.readStoredList();
List<String> errList = tsr.readErrLogList();
for(String text:tweetList){
System.out.println(text);
}
for(String err:errList){
System.err.println(err);
}
}
}
/**
* sampleのタイムライン取得のためのURL
*/
private static final String DEFAULT_API_URL = "https://stream.twitter.com/1/statuses/sample.json";
String userName;
String password;
/**
* 強制終了させられたかどうか
*/
boolean isForceStop;
/**
* 取得しているかどうか
*/
boolean isRunning;
/**
* Synchlonizedされたリスト
*/
List<String> dataList;
/**
* Synchlonizedされたリスト
*/
List<String> errLogList;
/**
* apiのURL
*/
String apiUrl = DEFAULT_API_URL;
/**
* ストリームを読み続けるためのスレッド
*/
private Thread streamReadThread;
public TwitterStreamReader(String userName, String password) {
super();
this.userName = userName;
this.password = password;
dataList = Collections.synchronizedList(new ArrayList<String>());
errLogList = Collections.synchronizedList(new ArrayList<String>());
}
/**
* 読み込みを開始する
*/
public void start(){
StreamReader streamReader = new StreamReader();
streamReadThread = new Thread(streamReader);
streamReadThread.start();
}
/**
* 取得を停止する
*/
public void stop() {
this.isForceStop = true;
}
/**
* データ取得中かどうかを返す
* @return
*/
public boolean isRunning(){
return streamReadThread.isAlive();
}
/**
* 取得済みのTweetデータのリストを取得する
* これまでに読み込んだデータは削除される
* @return 是までに読み込んだデータ
*/
public List<String> readStoredList(){
List<String> storedList;
synchronized (dataList) {
storedList = new ArrayList<String>(dataList);
dataList.clear();
}
return storedList;
}
/**
* エラーログのリストを取得する
* これまでに読み込んだデータは削除される
* @return 是までに読み込んだデータ
*/
public List<String> readErrLogList(){
List<String> storedList;
synchronized (errLogList) {
storedList = new ArrayList<String>(errLogList);
errLogList.clear();
}
return storedList;
}
/**
* 強制停止信号を送ったかどうか
* @return the isForceStop
*/
public boolean isForceStop() {
return isForceStop;
}
/**
* データ読み込み用クラス
* @author tori
*
*/
class StreamReader implements Runnable{
@Override
public void run() {
isForceStop = false;
while(!isForceStop){
InputStreamReader isr = null;
BufferedReader br = null;
try{
URL connectUrl = new URL(apiUrl);
HttpURLConnection con = (HttpURLConnection)connectUrl.openConnection();
con.setRequestMethod("GET");
con.setDoOutput(true);
con.setInstanceFollowRedirects(true);
Authenticator auth = new Authenticator(){
public PasswordAuthentication getPasswordAuthentication(){
return new PasswordAuthentication(userName, password.toCharArray());
}
};
Authenticator.setDefault(auth);
isr = new InputStreamReader(con.getInputStream(), "UTF8");
br = new BufferedReader(isr);
while(!isForceStop){
String tweet = br.readLine();
synchronized (dataList) {
dataList.add(tweet);
}
}
}catch(Exception e){
StringBuffer buf = new StringBuffer();
buf.append(e.getClass().getName()+"\n");
for(StackTraceElement ste:e.getStackTrace()){
buf.append(String.format("\tat %s.%s(%s:%d)\n", ste.getClassName(), ste.getMethodName(), ste.getFileName(), ste.getLineNumber()));
}
synchronized (errLogList) {
errLogList.add(buf.toString());
}
}finally{
try{
br.close();
}catch(Exception e){
}
try{
isr.close();
}catch(Exception e){
}
}
}
}
}
}