小编cel*_*llo的帖子

在Jar文件中运行类

如果你有一个名为jar文件myJar.jar位于/ MyFolder中,你要使用称为类myClass的话,你怎么去了解通过命令行做什么呢?

我以为会进入目录然后说java -cp myJar.jar.myClass但是没有用.任何帮助,将不胜感激.

java command-line jar

163
推荐指数
4
解决办法
28万
查看次数

React 是否像 Vue js 一样具有 keep-alive 功能?

我用 React js 做了一个 Todo 列表。该网站有列表和详细信息页面。有一个列表,1 个列表有 10 个项目。当用户滚动底部时,将加载下一页数据。

用户点击第 40 项 -> 观看详情页面(react-router) -> 点击返回按钮

主页滚动页面顶部并再次获取第一页数据。

如何在没有 Ajax 调用的情况下恢复滚动位置和数据

当我使用 Vue js 时,我使用了 'keep-alive' 元素。帮我。谢谢 :)

infinite-scroll reactjs vue.js react-router-v4

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

".RestoreDirectory"不起作用

在下面的代码我设置ofd1.RestoreDirectoryfalse不过,该对话框打开inital目录每次.有什么东西我不知道吗?

private void btnMeshFile_Click(object sender, EventArgs e)
{
    OpenFileDialog ofd1 = new OpenFileDialog();
    ofd1.Title = "Open";
    ofd1.InitialDirectory = @"c:\";
    ofd1.Filter = "All files (*.*)|*.*|All files (*.*)|*.*";
    ofd1.FilterIndex = 2;
    ofd1.RestoreDirectory = false;
    if (ofd1.ShowDialog() == DialogResult.OK)
    {
        string fileName = Path.GetFileName(ofd1.FileName);
        MeshDirectoryPath = Path.GetFullPath(ofd1.FileName).Replace(@"\", @"\\");
        txtMeshFile.Text = fileName;
    }
}
Run Code Online (Sandbox Code Playgroud)

c# fileopendialog

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

如何在Java中从一个字符串复制到另一个字符串?

我有两个字符串str1和str2。我正在尝试使用charAt将某些字母从一个字符串复制到另一个字符串。我知道我可以使用字符串复制,但是我想要一些字符而不是全部。

如何将subString从一个字符串复制到Java中的另一个字符串?

public class MyServerSide {

    public static void main(String[] args) {
        String str1 = "Hello World!;
        String str2;
        for (int 1=0; i < str1.length(); i++){
            if (i>=3){
                str2.charAt(i) = str1.charAt(i);//Here is the problem. It gives me an error
                                                //Saying that the left argument must be a 
                                                //variable

            }//End of if statement
        }//End of for loop
    }//End of main method
}//End of class
Run Code Online (Sandbox Code Playgroud)

java string substring charat

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

什么是比特流中的高水位线和低水位线

我正在学习CS,当我研究缓冲区时,我对高水位线和低水位线感到困惑。有人可以解释他们是什么。

img

computer-science

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

如何在vue中找到对象长度

我正在尝试使用 VueJS 编写表单验证。

我一直在测试错误对象的长度。当我在控制台登录时,我一直未定义。我用 this.errors.length 来引用它。它似乎将 .length 视为错误的关键。

data(){
    return {
        name: null,
        price: null,
        description: null,
        roomTypes: {},
        errors: {},
    }
},
methods: {
    addRoomType: function(){

        if(this.name && this.description && this.price && this.this.description>10){
            axios.post('/admin/room-types',{
                name: this.name,
                price: this.price,
                description: this.description
            }).then((response)=>{
                this.errors = {};
                this.roomTypes.push(response.data);
            }).catch((error)=>{
                this.errors = error.response.data;
                console.error(error.response.data);
            });
        }
        //this.errors = {};
        if(!this.name){
            this.errors.name = "Please enter a name.";
            console.log(this.errors.name);
        }

        if(!this.description){
            this.errors.description = "Please enter a description.";
            console.log(this.errors.description);
        }

        if(!this.price){
            this.errors.price = "Please enter a …
Run Code Online (Sandbox Code Playgroud)

vue.js

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