我想用Eclipse执行此RxTx网站提供的示例代码 :
import gnu.io.*;
public class SerialPortLister {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
listPorts();
}
private static void listPorts()
{
java.util.Enumeration<CommPortIdentifier> portEnum = CommPortIdentifier.getPortIdentifiers(); // this line has the warning
while ( portEnum.hasMoreElements() )
{
CommPortIdentifier portIdentifier = portEnum.nextElement();
System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) );
}
}
private static String getPortTypeName ( int portType )
{
switch ( portType )
{
case CommPortIdentifier.PORT_I2C:
return "I2C"; …Run Code Online (Sandbox Code Playgroud) 我想总结一下四列的值recordstore.在这四个列中的值与数字decimal point,例如30.00; 该recordstore行是一个csv-like数据,我用它来使用用户定义的函数来获取特定列的值:例如,我获得了String四列的a "30.00".现在我想要sum这四个值; 所以我必须convert进去int!但是当我尝试使用时,Integer.parseInt就会java.lang.NumberFormatException被提升!那么如何在这种情况下做出总和呢?
有一个字符串变量,其中包含带点的数字数据,例如$x = "OP/1.1.2/DIR";。数字数据的位置可以在任何情况下由用户通过在应用程序内部修改来改变,斜杠可以由任何其他字符改变;但虚线数字数据是强制性的。那么这里如何1.1.2从字符串中提取点数数据呢?
有一个function返回值:
function f($criteria, $extra_return)
{
return $criteria['activity_code'];
}
Run Code Online (Sandbox Code Playgroud)
我想为$ extra_return设置一个值parameter.这有可能PHP吗?
在循环中,我想在循环的每次迭代结束时清除一个数组:
$tab = array();
...
for($i=1; $i<=5; $i++)
{
if ($regle_delegation_oper[$i] != "" && $regle_delegation_cond[$i] != "")
{
$tab['lien_id'] = $lien_id;
$tab['regle_deleg_oper'] = $regle_delegation_oper[$i];
$tab['regle_deleg_cond'] = $regle_delegation_cond[$i];
$rd->ajouter($tab);
// here I want to clear the $tab array
}
}
Run Code Online (Sandbox Code Playgroud)
那么如何清除$ tab数组呢?
我想在我的表格上加上版权.我试着写©
private Label copyrightL = new Label("©");
Run Code Online (Sandbox Code Playgroud)
但它不起作用.那么如何编写©符号?
我想读取properties文件密钥,我发现注释中有classpath要设置的属性@PropertySource:
@Configuration
@PropertySources({
@PropertySource("classpath:config.properties"),
@PropertySource("classpath:db.properties")
})
public class AppConfig {
//...
}
Run Code Online (Sandbox Code Playgroud)
属性文件应该放在哪里以及如何知道注释中的类路径?
在我的 oracle 数据库表中有一个columndatatype raw。现在在我的springbean 类中,我想映射这个表。那么什么 javadatatype相当于 oracleraw数据类型?
我想从jsp进行ajax调用:
<script type="text/javascript">
function isTablePkUsedInFk(table_, pkVal) {
var url_ = "<c:url value='/ajaxIsTablePkUsedInFk' />";
var ret = $.ajax({
data : {"table" : table_ , "pkVal" : pkVal},
type : "POST",
url : url_,
async: false
}).responseText;
ret = $.trim(ret);
return ret;
}
</script>
Run Code Online (Sandbox Code Playgroud)
在控制器中:
@Controller
@RequestMapping("/")
public class Home {
@Autowired
private Environment env;
@Autowired
private UtilisateurDAO utilisateurDao;
@Autowired
private MenuDAO menuDao;
@Autowired
private DbDAO dbDao;
@RequestMapping(value = "/ajaxIsTablePkUsedInFk", method = RequestMethod.POST)
@ResponseBody
public boolean ajaxIsTablePkUsedInFk(HttpServletRequest request) {
String table = …Run Code Online (Sandbox Code Playgroud) 我运行此查询:
select trim(utl_raw.cast_to_varchar2((nlssort(d.det_entete, 'nls_sort=binary_ai')))) entete,
length(trim(utl_raw.cast_to_varchar2((nlssort(d.det_entete, 'nls_sort=binary_ai'))))) nb
from details_param_import d join param_import_table p on d.param_code = p.param_code;
Run Code Online (Sandbox Code Playgroud)
结果如下:
那么如何删除尾随空间呢?
java ×5
php ×3
spring ×3
spring-4 ×2
spring-mvc ×2
eclipse ×1
enumeration ×1
java-me ×1
javascript ×1
lwuit ×1
numbers ×1
oracle ×1
oracle11g ×1
oracle11gr2 ×1
rxtx ×1
string ×1