Java
æè¿ã¾ãJavaãåå¼·ãå§ããããã¡ããã©ããã¿ã¤ãã³ã°ã§éå¬ããã¦ããã®ã§ãåå ããã¦ããã ãã¾ãããJava Day Tokyo 2015èªåãè´ãã«è¡ã£ãã»ãã·ã§ã³ã¯ä»¥ä¸ã Java SE 8: Lambdas and Streams API Date and Time API and other technologies of Javaâ¦
Javaã®å ´å import java.util.ArrayList; import java.util.List; class Hoge { public static void main(String []args) { List<Integer> samples = new ArrayList<Integer>(); samples.add(0); samples.add(1); samples.add(2); samples.add(3); samples.add(4); samples.add</integer></integer>â¦
ããã°ã©ãã³ã°ãåå¼·ããã é¢ç½ãã®ã§èªãã§ããã©ãã©ãå¦ç¿ãã¦ãã£ã¦ãã®ãåããã®ã§æ¥½ããã èªåããããããããããã¢ã¦ããããåºããããã«ãªããããªã¼ã ã½ã¼ã¹ã³ã¼ãã®ã¤ã³ãã³ããã¹ãã¼ã¹ï¼æåã«ãã¦ãããã¨ããèªã¿ããããªã£ã¦ãããã â¦
Google App Engine ã§ã«ã¦ã³ã¿ã¼ãä½ã£ã¦ã¿ã(å) - ãããã¼ãã¡ã¢ã®ç¶ããã¨ãããå¤æ´ã 以åã«Pythonçã§ä½ã£ãGoogle App Engineä¸ã§åãã¢ã¯ã»ã¹ã«ã¦ã³ã¿ã¼ããJavaã§ä½ãç´ãã¦ã¿ãã http://gae-counter.appspot.com/ åºæ¬çãªä½ãã¯åãã§ã Googleâ¦
ããã 第äºåããããæ¥æ¬ãã¢ããã°ã©ãã³ã°ã®åjava-jaæ¯é¨ä¼ @dwangoä¼å ´æä¾ã®ãã¯ã³ã´æ§ã«æè¬ã1. id:t-wadaããã«ããè¬æ¼ 第ä¸åã®ã¾ã¨ã ãã®ããã£ãã§ãã ååã®KPT æ®å½±ãå ¥ã£ã¦ããã£ã èªç±ã«çºè¨ãã¦ã©ãã©ãè¨ããé°å²æ°ãè¯ãã£ã ä»åãâ¦
PythonçGAEãªããéçºãµã¼ãã¼ä¸ã§ã http://localhost:8080/_ah/admin/ ã§ãã¼ã«ã«ç°å¢ç¨ã®Dashboardãè¦ããã¨ãã§ãã¦ä¾¿å©ãªãã ãã©ãã©ãããJavaçã«ã¯ããããªãããã(ãããããã®ãªãæãã¦ä¸ãã)ã ããã¦Data Viewerçãªãã®ã¯ãã¼ã«ã«ç°å¢ã«â¦
GAE/Jã®Datastore Low-level APIã使ã£ã¦ã¿ã - ãããã¼ãã¡ã¢ã®ç¶ãã ãã£ãã親åé¢ä¿ã®æ±ããã§ããã®ã§Transactionã使ç¨ãã¦ã¿ãããã¨Entityãçã§ä½¿ãã®ãã¡ãã£ã¨ã¢ã¬ã ã¨æã£ãã®ã§ç°¡åãªã©ããã¯ã©ã¹ãä½ã£ã¦ã¿ããâ¦ãã©ãå¾®å¦ã LowLevelAPISerâ¦
ããã¥ã¡ã³ããèªã¿ã¤ã¤ããããç°¡åãªãµã³ãã«ãæ¸ãã¦ã¿ãã http://code.google.com/intl/en/appengine/docs/java/javadoc/com/google/appengine/api/datastore/package-summary.html web.xml
Javaç GAE/J ã§ãã¡ã¤ã«ãã¢ãããã¼ãããæ¹æ³ãå¦ã¶ - ãããã¼ãã¡ã¢ ã®ç¶ãã ã©ãããJavaçã§commons-fileuploadã使ã£ã¦ãã¡ã¤ã«ã¢ãããã¼ããããå ´åã¯getItemIteratorããåãåºãã®ãè¯ãããã ãããããã°FileItemFactoryã¯å¿ è¦ãªãã importâ¦
Google App Engine(Javaç)ã§ãã¡ã¤ã«ãã¢ãããã¼ãããããã«ã¯ã©ãããã°ããã®ãï¼ãè²ã 試ããªããåå¼·ãã¦ã¿ãã ã¾ããæãã·ã³ãã«ã«ãããªHTMLã¨ãµã¼ãã¬ãããæ¸ãã¦ã¿ãã <html> <head></head> <body> <form action="upload" method="post" enctype="multipart/form-data"> <input type="file" name="data"></td> <input type="submit"></td> </form> </body> </html> package hoge.fugaâ¦
ä»ä½ã£ã¦ããGAE Counterã§ã¯ãCounterã¨AccessRecordã§è¦ªåé¢ä¿ãä½ã£ã¦ãã¦*1ãããCounterã®åã¨ãã¦ä½ãããAccessRecordãåå¾ããã®ã«ãancestorã«ãããã£ã«ã¿ãªã³ã°ã使ã£ãQueryãç¨ãã¦ããã AccessRecord.all().ancestor(counter) ã§ãåããã¨â¦
encodeããStringããã¼ã«ãããã¼ã¿ã¢ãã«ãä½ã£ã¦ããã®ãã¼ã§å¼ãå½ã¦ã¦åå¾ãããã¼ã¿ãåç §ãããã¨ãããUserãä½æ ãnullã«ãªã£ã¦ããã @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Hoge { @PrimaryKey @Persistentâ¦
Google App Engine ã®DataStoreããUserã§ãã£ã«ã¿ãªã³ã°ãã¦ãã¼ã¿ãåå¾ããæ¹æ³
com.google.appengin.api.users.Userãããããã£ã«æã¤ãã¼ã¿ã¢ãã«ãããããããã°ã¤ã³ä¸ã®ã¦ã¼ã¶ã¼ã¨ä¸è´ãããã®ã ããåå¾ãããã¨ããå ´åã Pythonçã§ã¯ã from google.appengine.api import users results = Hoge.all().filter('user = ', users.gâ¦
Eclipseã®æ©è½ã§Javadocãçæããå ´åã@authorã«ã¯èªåçã«ã·ã¹ãã ã®ãã°ã¤ã³ã¦ã¼ã¶ã¼ã使ããããããã ãããå¤æ´ããå ´åã¯eclipse.iniã«ä»¥ä¸ã®è¡ã追å ããã -Duser.name=<å¤æ´ãããåå>JavaDocã®@authorã§è£å®ãããååãå¤æ´ãããï¼ãã¼ããâ¦
第åäºå 第1åãããã ãããã Swing ã®å®åããã¾ããã«ã¿ãã¦ãããï¼ä»®ï¼ã«è¡ã£ã¦ããã®ã§ãã¡ã¢ã ééã£ã¦ãããã¨ãªãããå¤ã ãããããããªããã©ã¡ã¢æ¸ããæ¢ãã¦ãã®ã¾ã¾è¼ããã 2008/11/21 第12åjava-ja Swingã¨Windows Formã¨SWT 太ä¸(id:tâ¦
StringBuilderã®åæå - ãããã¼ãã¡ã¢ã«ã¤ãã¦ãid:todogzmããã³ã¡ã³ããããã¨ããããã¾ããã AbstractStringã¯ã©ã¹ã¨ããã®ã¯ã°ã°ã£ã¦ãè¦å½ãããªãã§ãããã¨ã«ããchar[]ãå é¨ã§æã£ã¦ãããã®ã ã¨è§£éãã¦ãããã§ãããï¼ æ°ããã¤ã³ã¹ã¿ã³ã¹â¦
StringBuilderã使ãã¾ããããã«ä¸åº¦ä¸èº«ã空æååã«å¤ããããã¨ããã¨ã StringBuilder sb = new StringBuilder(); ã¨ããæ¯åæ°ããã¤ã³ã¹ã¿ã³ã¹ãä½æããæ¹æ³ã sb.delete(0, sb.length() - 1); ã¨ããåãã¤ã³ã¹ã¿ã³ã¹ã®ä¸ã§ä¸èº«ãå ¨åé¤ããæ¹æ³ã â¦
import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Iterator; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.comâ¦
org.apache.commons.codec.binary.Base64 Base64ã®ã¨ã³ã³ã¼ãã£ã³ã°ãããã¨ãã«ä½¿ãã org.apache.commons.lang.time.DateFormatUtils ISO-8601ã®å½¢å¼ã§æ¥ä»ã»æå»ã表ãããã¨ãã«ä½¿ãã eclipseã§ã©ã¤ãã©ãªã追å ããå ´åã¯ããã¸ã§ã¯ãã®ããããã£ããâ¦
ãããªãã®ããããã¨ãåãã¦ç¥ã£ãã http://www.itarchitect.jp/technology_and_programming/-/27074-5.html ãªãã»ã©ã確ãã«staticã¡ã³ãå¤æ°ã®åæåãããã¨ãã¯ãããããã®ãã ããããããå®è¡ãããã¿ã¤ãã³ã°ã£ã¦ã®ã¯ãã¯ã©ã¹ãã¯ã©ã¹ã»ãã¼ãâ¦
ã¯ã¦ãªã¦ã§ããµã¼ãã¹ ã¨ã«ããã³ã¬ã使ã£ã¦ã¿ããã¦ã ãããåãããªããã¨ã ããã WSSEèªè¨¼ã¨ããè¨èããåãã¦èããã ã¨ããããåè㯠yohei-y:weblog: Java ããã¯ã¦ãªãã©ãã©ã¤ãAtomAPIã使ã Black Duck Open Hub Code Search ããã¯ï½¥ï½¥ï½¥id:Yosâ¦
ååã¾ã§ã¯ãè©è ãã«å¯¾ããã¢ã¤ãã ãã¨ããã®ãè©ä¾¡ç¹ããå ã«ãè©è å士ã®é¡ä¼¼åº¦ãã®è¨ç®ã¨ããããç¨ãããæªè©ä¾¡ã®ã¢ã¤ãã ã®æ¨è¦ãããã£ã¦ããã ããã«å¯¾ããè©è ã¨ã¢ã¤ãã ãéã«ãããã¨ã§éãè¦ç¹ããã®è¨ç®ãã§ããã ã¤ã¾ãããã¢ã¤ãã ãã«å¯¾â¦
ãã¾ãã«ãå¤æ°åãã¤ã±ã¦ãªããããæ°ãããã®ã§ãå¤æ´ãæ¤è¨ãã¦ã¿ãã Iteratorã¨ãã£ã¦ã©ãããååãä»ãããããªãã ãããã ããããã¨ããããªã¼ãã³ã½ã¼ã¹ã®ä¸çãè¦ãã¹ãã ãªã
è©ä¾¡ã®é¡ä¼¼åº¦ã¨ãã尺度ãã§ããã°ããããå ã«è©è ãç¸å¯¾çã«ã©ã³ãã³ã°ããããèªåãæªè©ä¾¡ãªãã®ãæ¨è¦ãã¦ããããã¨ãã§ããã ã©ã³ãã³ã°ã¯ãã å ¨å¡ã¨ã®é¡ä¼¼åº¦ã調ã¹ã¦ã½ã¼ãããã ããªã®ã§çç¥ã æ¨è¦ã¯ãããããã®è©è ã®ãã¢ã¤ãã ã®è©ä¾¡ãÃããã®â¦
ã¦ã¼ã¯ãªããè·é¢ã®ä»ã«é¡ä¼¼åº¦ã決å®ããææ³ã¨ãã¦ãã¢ã½ã³ç¸é¢ä¿æ°ãç´¹ä»ããã¦ããã ããã¯ãã¼ã¿ãæ£è¦åããã¦ããªãå ´åã«ãã®åããããç¨åº¦è£æ£ãã¦ããããã¨ã«ãªãããã ã ãã¢ã½ã³ç¸é¢ä¿æ°ã¯ä»¥ä¸ã®å¼ããæ±ããããã PearsonCalculator.java pâ¦
JDKã®ãã¼ã¸ã§ã³ã«ãã£ã¦ä½¿ãåãããããã http://jdbc.postgresql.org/download.html JDK 1.1 - JDBC 1. Note that with the 8.0 release JDBC 1 support has been removed, so look to update your JDK when you update your server. JDK 1.2, 1.3 - JDBâ¦
ç¶æ¿ãåç §ãåãã£ã¦ããªãèªåã«ããã£ããã ã¤ã¡ã¼ã¸ãä½ã£ã¦ãé ã®ä¸ã«æããã ã
ã³ã³ã¹ãã©ã¯ã¿ã®å¼æ°æå® - ãããã¼ãã¡ã¢ ã¨ãããããå¼æ°ãªãã³ã³ã¹ãã©ã¯ã¿ã¯privateã§ã¯ãªããä¾å¤ã«ãã¦ã¿ãã public class Hoge { private String str; public Hoge() { throw new IllegalArgumentException(); } public Hoge(String str) { this.â¦
ã¯ã©ã¹å ã ãã§ä½¿ãå®æ°ã£ã¦ã©ããããã ããï¼ ããããå®æ°å®ç¾©ã£ã¦ã public final static String HOGE="hoge"; ã¨ãããã®ã ã¨æããã©ãèªãã®ã¯ã©ã¹å ã§ãã使ããªããã®ãªã private final static String HOGE="hoge"; ã§ããã®ããªã ï¼ãããã"staâ¦
ã³ã³ã¹ãã©ã¯ã¿ã«å¿ ãããå¼æ°ãå ¥ããããã«ããããã¨ãããã©ã«ãã®ã³ã³ã¹ãã©ã¯ã¿ãprivateã«ãã¦ãå¼æ°ã¤ãã®ã³ã³ã¹ãã©ã¯ã¿ãå®ç¾©ã ããããã¨ãSingletonã¨ã¯éã£ã¦privateã«ãããããã©ã«ãã³ã³ã¹ãã©ã¯ã¿ã¯å¼ã³åºããããã¨ã¯ãªãã®ã§eclipseãè¦â¦