小编Jac*_*Sun的帖子

Git警告:push.default未设置; 它的隐含价值在变化

当我在Git中推送到远程时,我收到此警告:

warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if …
Run Code Online (Sandbox Code Playgroud)

git push

56
推荐指数
2
解决办法
5万
查看次数

java.lang.ClassCastException:[Ljava.lang.Object; 无法转换为[Ljava.lang.String;

我需要将HashMap转换为String数组,以下是我的java代码

import java.util.HashMap;
import java.util.Map;

public class demo {

    public static void main(String[] args) {

        Map<String, String> map1 = new HashMap<String, String>();

        map1.put("1", "1");
        map1.put("2", "2");
        map1.put("3", "3");

        String[] str = (String[]) map1.keySet().toArray();

        for(int i=0; i<str.length;i++) {
            System.out.println(str[i]);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

当我运行代码时,我得到以下内容ClassCastException.

Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
at demo.main(demo.java:17)
Run Code Online (Sandbox Code Playgroud)

java arrays dictionary

20
推荐指数
2
解决办法
8万
查看次数

mysqli bind_param中的NULL类型是什么?

我试图将params绑定到INSERT INTO MySQLi预处理语句,如果该变量存在,否则插入null.然后我知道

type    variable
i   corresponding variable has type integer
d   corresponding variable has type double
s   corresponding variable has type string
b   corresponding variable is a blob and will be sent in packets

但是当我插入一个变量= null时,我如何定义变量的类型?或者我应该定义类型''?

php mysqli sqlbindparameter

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

[_ |\_ | \.]的含义是什么?在Javascript regexps?

我有一个js代码:

/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/
Run Code Online (Sandbox Code Playgroud)

但是什么意思[_|\_|\.]?(js regexp)

javascript regex

4
推荐指数
3
解决办法
1158
查看次数

如何更改mysql用户名和密码

我在我的mac v10.8.5上安装了MySQL,默认为username=''password=''.

我如何更改这些username='root'password='root'

mysql passwords username

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

如何在html中使用js获取下一个节点?

我有一个这样的 html

<table>
    <tr>
        <td>
            <img src="logo.png" onclick="getNextTableNode(this)">
        </td>
    </tr>
</table>
<table></table>
Run Code Online (Sandbox Code Playgroud)

我可以用js代码得到第一个tableNode

  function getNextTableNode(imgNode)
 { 
    tableNode1 = imgNode.parentNode.parentNode.parentNode;
 }
Run Code Online (Sandbox Code Playgroud)

但是我怎样才能得到下一个 tableNode?我不想使用 id 或 name。我试过了:

tableNode2 = tableNode1.nextSibling;
Run Code Online (Sandbox Code Playgroud)

但它没有用。有人可以帮忙吗?提前致谢

html javascript

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