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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
subscription = Observable.just(fetchDataHttpCall()) | |
.map(new Func1<String, List<GRO_VO>>() { | |
@Override | |
public List<GRO_VO> call(String jsonIn) { | |
Gson gson = new Gson(); | |
Type listType = new TypeToken<List<GRO_VO>>() { | |
}.getType(); | |
return gson.fromJson(jsonIn, listType); | |
} |
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
subscription = Observable | |
.defer(new Func0<Observable<String>>() { | |
@Override | |
public Observable<String> call() { | |
Log.d("RX",".just( ) then .defer( )"); | |
return Observable.just(withOutAsyncTask()); | |
} | |
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
(function(global) { | |
global.$ = function(initNum) { | |
var aggregate = initNum; | |
return { | |
add: function(plusNum) { | |
aggregate += plusNum; |
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
function a(num) { | |
var result = ''; | |
result += num; | |
var run = function() { | |
return parseInt(result, 10); | |
} |
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.sql.Connection; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.apache.commons.dbutils.DbUtils; | |
import org.apache.commons.dbutils.QueryRunner; | |
import org.apache.commons.dbutils.ResultSetHandler; |
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
const Awake = function () { | |
function Awake(){ | |
} | |
Awake.prototype.command = { | |
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
public boolean getFileFromFTP_ServerToThePath(Properties ftpProp){ | |
FTPClient ftpClient = null; | |
OutputStream fos = null; | |
boolean isGetFileFromFTP_ServerToThePathSuccess = false; | |
try{ | |
ftpClient = new FTPClient(); | |
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
// SWT裡不知道哪裡來 invoke了這裡,但這就像填空題, 你只要確保這個method out.flush出去的是正確的 byte array 後面的步驟就應該也是對的 | |
public boolean createpdf(String filename) { | |
PostMethod post = null; | |
boolean result; | |
OutputStream os = null; | |
try { | |
/* |
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
@Override | |
public void doPost(HttpServletRequest request, HttpServletResponse response) | |
throws IOException { | |
OutputStream os = null; | |
try { | |
URL url = new URL(urlStr); | |
URLConnection urlConnection = url.opervlet.nConnection(); |
OlderNewer