小编phe*_*mix的帖子

枚举警告

我想用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)

java eclipse enumeration rxtx

1
推荐指数
1
解决办法
3361
查看次数

为什么表示数字的String的Integer.parseInt会在J2ME中抛出java.lang.NumberFormatException?

我想总结一下四列的值recordstore.在这四个列中的值与数字decimal point,例如30.00; 该recordstore行是一个csv-like数据,我用它来使用用户定义的函数来获取特定列的值:例如,我获得了String四列的a "30.00".现在我想要sum这四个值; 所以我必须convert进去int!但是当我尝试使用时,Integer.parseInt就会java.lang.NumberFormatException被提升!那么如何在这种情况下做出总和呢?

java string numbers

1
推荐指数
1
解决办法
1214
查看次数

如何获取字符串中带点的数字数据?

有一个字符串变量,其中包含带点的数字数据,例如$x = "OP/1.1.2/DIR";。数字数据的位置可以在任何情况下由用户通过在应用程序内部修改来改变,斜杠可以由任何其他字符改变;但虚线数字数据是强制性的。那么这里如何1.1.2从字符串中提取点数数据呢?

php

1
推荐指数
1
解决办法
1288
查看次数

是否可以将值传递给PHP中函数的参数?

有一个function返回值:

function f($criteria, $extra_return)
{
   return $criteria['activity_code'];
}
Run Code Online (Sandbox Code Playgroud)

我想为$ extra_return设置一个值parameter.这有可能PHP吗?

php

0
推荐指数
1
解决办法
43
查看次数

如何清除阵列?

在循环中,我想在循环的每次迭代结束时清除一个数组:

$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数组呢?

php

0
推荐指数
1
解决办法
206
查看次数

如何写出版权符号?

我想在我的表格上加上版权.我试着写&copy;

private Label copyrightL = new Label("&copy;");
Run Code Online (Sandbox Code Playgroud)

但它不起作用.那么如何编写©符号?

java lwuit java-me

0
推荐指数
1
解决办法
7889
查看次数

如何知道类路径?

我想读取properties文件密钥,我发现注释中有classpath要设置的属性@PropertySource

@Configuration
@PropertySources({
    @PropertySource("classpath:config.properties"),
    @PropertySource("classpath:db.properties")
})
public class AppConfig {
    //...
}
Run Code Online (Sandbox Code Playgroud)

属性文件应该放在哪里以及如何知道注释中的类路径?

spring spring-mvc spring-4

0
推荐指数
1
解决办法
1万
查看次数

oracle 数据类型 raw 的 java 类型等价物是什么?

在我的 oracle 数据库表中有一个columndatatype raw。现在在我的springbean 类中,我想映射这个表。那么什么 javadatatype相当于 oracleraw数据类型?

java spring spring-mvc spring-4

0
推荐指数
1
解决办法
1313
查看次数

如何在javascript中获取Java布尔值?

我想从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)

javascript java spring

0
推荐指数
1
解决办法
293
查看次数

修剪后不删除尾部空间

我运行此查询:

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)

结果如下:

在此处输入图片说明

那么如何删除尾随空间呢?

oracle oracle11g oracle11gr2

0
推荐指数
1
解决办法
405
查看次数