Java
Java
_Focus_
ACL/NAACL/EMNLP/COLING审稿人,
金庸群侠传MOD大侠梦/曹操传MOD禾下霸业作者
展开
-
单次请求服务 和 并发请求服务,对同一个case结果不一致
的问题,看超时之后有没有 cancel 请求,等等。如果在并发下的 并发相关代码没有问题的话,原创 2024-11-21 11:59:15 · 345 阅读 · 0 评论 -
IDEA 右键的maven消失
可能是macOS升级了,IDEA版本低了,升级一下IDEA版本即可。原创 2024-11-20 19:28:30 · 119 阅读 · 0 评论 -
多国语言的词根提取
下载libstemmer-java(https://download.csdn.net/download/guotong1988/89574039)解压,把整个目录放到IDE里。原创 2024-07-24 11:36:23 · 59 阅读 · 0 评论 -
【java/scala】regex/正则,保留英文/空格/中文/数字
【代码】【java/scala】regex/正则,保留英文和空格。原创 2024-06-20 11:37:12 · 211 阅读 · 0 评论 -
Java, Comparator, 报错 Comparison method violates its general contract!
用这段java代码可以复现这个报错。原创 2024-03-29 17:54:07 · 194 阅读 · 0 评论 -
Spark, import java in scala, 报错 NoClassDefFoundError: Could not initialize class
在scala文件里import一个java文件,报错。很可能是import的这个java文件里的。里的代码的初始化问题。原创 2024-02-28 14:03:48 · 203 阅读 · 0 评论 -
报错 lambda expressions are not supported in -source (use -source to enable lambda expressions)
【代码】lambda expressions are not supported in -source 1.5 (use -source 8 to enable lambda expressions)原创 2024-02-28 11:19:59 · 111 阅读 · 0 评论 -
【java performance】避免在循环条件中使用复杂表达式
在不做编译优化的情况下,在循环中,循环条件会被反复计算,如果不使用复杂表达式,而使循环条件值不变的话,程序将会运行的更快。例子:import java.util.Vector;class CEL {void method (Vector vector) {for (int i = 0; i ; // ... }}原创 2014-02-21 15:36:46 · 3416 阅读 · 1 评论 -
IDEA的maven配置不生效,还是很多不能import,刷新pom使生效
重新让pom文件刷新生效原创 2023-01-01 17:49:09 · 631 阅读 · 0 评论 -
javacc 6 生成 C++
cmd> java -cp C:\javacc-6.0\bin\lib\javacc.jar jjtree _.jjt cmd> java -cp C:\javacc-6.0\bin\lib\javacc.jar javacc _.jjoptions {JAVA_UNICODE_ESCAPE = true;OUTPUT_LANGUAGE = "c++";NAMESPACE = "adde翻译 2015-03-20 11:06:14 · 1629 阅读 · 0 评论 -
javacc笔记5
void TypeDecl() : {Token t;}{|t= { jjtThis.name = t.image; } ("[]")?}}refer to current token as "t" and current AST node as "jjtThis"the text of the current token (t.原创 2013-05-24 09:27:39 · 944 阅读 · 2 评论 -
javacc 生成的文件 解析
jj_la变量:lookahead的计数器,检查下jj_la个token是否匹配原创 2013-11-18 16:43:33 · 1325 阅读 · 1 评论 -
javacc笔记4
SKIPSimply throw away the matched string (after executing any lexical action).MOREContinue (to whatever the next state is) taking the matched string along. T his string will be a prefix of the new mat原创 2013-05-22 08:50:52 · 1049 阅读 · 2 评论 -
javacc笔记
WHAT IS LOOKAHEAD?The job of a parser is to read an input stream and determine whether or not the input stream conforms to the grammar.原创 2013-05-20 08:00:31 · 1143 阅读 · 7 评论 -
javacc ()? ()* ()+
()? 一个或没有 ()* 一个或多个 ()+没有或多个原创 2015-03-27 11:35:03 · 762 阅读 · 0 评论 -
javaparser, Java 1.5 Parser and AST
https://code.google.com/p/javaparser/原创 2013-12-03 15:23:07 · 3084 阅读 · 0 评论 -
javacc笔记2
void basic_expr() : {} { "(" expr() ")" // Choice 1 | "(" expr() ")" // Choice 2 | "new" // Choice 3 }The choice determination algorithm works as follows: if (next token is ) {原创 2013-05-20 08:30:26 · 928 阅读 · 3 评论 -
javacc使用
http://download.csdn.net/detail/guotong1988/5267165Path加上D:\javacc-5.0\binjjtree *.jjtjavacc *.jj原创 2013-04-17 11:22:46 · 1369 阅读 · 0 评论 -
javacc 两张图
Figure 1.1 The token manager converts a sequence of characters to a sequence of Token objects.Figure 1.2 The parser analyzes the sequence of tokens.翻译 2013-06-08 14:28:01 · 876 阅读 · 0 评论 -
javacc 计算器 实例
options { STATIC=false;}PARSER_BEGIN(calculator)import java.io.PrintStream ;public class calculator { double previousValue = 0.0 ; public static void main(String args[]) throws ParseExce转载 2013-05-07 18:15:51 · 1413 阅读 · 0 评论 -
javacc笔记3
void Input() : {} { "a" BC() "c" } void BC() : {} { "b" [ "c" ] }有两种输出可能,如果: void BC() : {} { "b" [ LOOKAHEAD( { getToken(1).kind == C && getToken(2).kind != C } )原创 2013-05-22 08:24:08 · 870 阅读 · 0 评论 -
JJTree笔记
JJTree defines a Java interface Node that all parse tree nodes must implement. The interface provides methods for operations such as setting the parent of the node, and for adding children and retriev原创 2013-06-08 12:09:05 · 1022 阅读 · 3 评论 -
GWT, HTTP ERROR: 503
servlet删掉web.xml没用的servlet原创 2014-08-01 14:56:34 · 1302 阅读 · 0 评论 -
GWT com.google.gwt.user.client.rpc.StatusCodeException: 404 <html>
修改web.xml的servlet配置原创 2014-07-18 15:31:32 · 2376 阅读 · 1 评论 -
GWT 设置TextBox输入时的字体大小
css文件里.searchFormInputBox {font-size:26px;height: 35px;border: 2px groove white}原创 2014-07-16 16:25:12 · 1666 阅读 · 0 评论 -
GWT 把FileUpload控件替换为一个按钮实现
外面加上 native void jsClickUpload(Element pElement) /*-{pElement.click(); }-*/;原创 2014-07-17 15:19:36 · 1492 阅读 · 0 评论 -
GWT添加媒体显示
http://code.google.com/p/bst-player/downloads/list下载bst-player-api-2.0.3.jar下载core-player-provider-2.0.jar SimplePanel panel = new SimplePanel(); AbstractMediaPlayer playe原创 2013-07-11 14:36:45 · 1237 阅读 · 1 评论 -
GWT工程添加横向的Progressbar
使用smartgwt.jar原创 2013-07-10 13:57:51 · 1110 阅读 · 0 评论 -
GWT 批量上传
import gwtupload.server.UploadAction;import gwtupload.server.exceptions.UploadActionException;import gwtupload.shared.UConsts;import java.io.File;import java.io.FileInputStream;import ja原创 2014-07-30 20:40:27 · 1749 阅读 · 1 评论 -
*.gwt.xml
--> --> --> -->原创 2013-05-23 10:30:55 · 1709 阅读 · 0 评论 -
GWT 使用HTML纯代码
HTMLPanel原创 2014-07-21 17:23:22 · 1485 阅读 · 0 评论 -
GWT,AbsolutePanel
要设置 setWidth("300px"); setHeight("300px");原创 2014-07-11 16:14:10 · 1245 阅读 · 0 评论 -
GWT 图表 GChart 实例
First download the jar from the project home page http://code.google.com/p/gchart/Put it under war/WEB-INF/lib and add the gchart.jar to your classpathCreate a Web Application project called it G原创 2013-05-21 11:02:40 · 1860 阅读 · 0 评论 -
报错:package javax.mail does not exist
package javax.mail does not existpackage javax.mail.internet does not existcannot find symbolsymbol: class PasswordAuthenticationsymbol: class Authenticator原创 2022-09-30 11:22:10 · 1428 阅读 · 0 评论 -
ClassNotFoundException: fastjson.TypeReference 以及 NoClassDefFoundError: fastjson/TypeReference
pom.xml配了,不是一个常规的ClassNotFoundException / NoClassDefFoundError可以绕过:JSON.parseObject(inputString, new TypeReference<List<SomeClass>>() { });改为(List<SomeClass>) JSON.parseObject(inputString);...原创 2022-05-19 17:48:36 · 506 阅读 · 0 评论 -
spark,scala调用java代码,报错 NoClassDefFoundError + ClassNotFoundException
在pom.xml文件的<build>里要加上<sourceDirectory>src/main/scala</sourceDirectory><testSourceDirectory>src/test/scala</testSourceDirectory>原创 2022-05-18 09:09:47 · 588 阅读 · 0 评论 -
KL divergence 的 Java 实现
public static final double log2 = Math.log(2); /** * *Note*: If any value in <tt>p2</tt> is <tt>0.0</tt> then the KL-divergence * is <tt>infinite</tt>. Limin changes it to zero instead of infinite. */原创 2022-02-19 09:10:12 · 240 阅读 · 0 评论 -
Java-Python的完全对齐的tokenizer(字级别)
python侧:def tokenize(textString): split_tokens = [] for i in range(len(textString)): split_tokens.append(textString[i]) return split_tokensdef convert_by_vocab(char2id, split_tokens): output = [] for token in split_tokens: if原创 2021-08-03 11:37:13 · 240 阅读 · 0 评论 -
maven报错 Could not find artifact jdk.tools
export JAVA_HOME=/your/java/home/再执行maven的指令原创 2021-05-28 22:02:26 · 846 阅读 · 0 评论 -
maven报错 Perhaps you are running on a JRE rather than a JDK?
export JAVA_HOME=/your/java/home/原创 2021-05-28 21:39:43 · 198 阅读 · 0 评论
分享