小编use*_*195的帖子

如何在Windows中为SBT启用远程调试?

我想完成运行相当于此的操作

sbt -jvm-debug 5005
Run Code Online (Sandbox Code Playgroud)

但是我似乎无法在Windows中传递args.这就是我所看到的

>sbt -jvm-debug 5005
[info] Loading project definition from [myProject]
[info] Set current project to [myProject] (in build file myProject)
[error] Expected letter
[error] Expected symbol
[error] Expected '!'
[error] Expected '+'
[error] Expected '++'
[error] Expected ';'
[error] Expected end of input.
[error] Expected 'show'
[error] Expected '*'
[error] Expected '{'
[error] Expected project ID
[error] Expected configuration
[error] Expected key
[error] 5005
[error] ^
[error] Not a valid command: jvm-debug
[error] Not a valid …
Run Code Online (Sandbox Code Playgroud)

scala remote-debugging intellij-idea sbt

17
推荐指数
2
解决办法
9140
查看次数

在C#中拆分字符串

我试图通过以下方式在C#中拆分字符串:

传入的字符串在表单中

string str = "[message details in here][another message here]/n/n[anothermessage here]"
Run Code Online (Sandbox Code Playgroud)

我试图将其拆分为表单中的字符串数组

string[0] = "[message details in here]"
string[1] = "[another message here]"
string[2] = "[anothermessage here]"
Run Code Online (Sandbox Code Playgroud)

我试图以这样的方式做到这一点

string[] split =  Regex.Split(str, @"\[[^[]+\]");
Run Code Online (Sandbox Code Playgroud)

但它不能正常工作,我只是得到一个空数组或字符串

任何帮助,将不胜感激!

c# regex string split

11
推荐指数
2
解决办法
4万
查看次数

棘手的SQL加入查询

我有两个表,一个名为StudentCerts,包含一个电子邮件(主键)和一个证书,另一个名为CertReqs,包含证书和课程.表的一部分可能如下:

     StudentCerts:                                 CertReqs:    
Email           Certificate             Certificate          Course
This@that.com      Programmer            Programmer           CS 101
This@that.com      English               Programmer           CS 202
A@B.com            Econ                  Programmer           CS 303
john@smith.com     Programmer            English              ENG 101
                                         English              ENG 102
                                         Econ                 ECON 102
                                         Econ                 ECON 304
                                         Art                  Art 101
                                         Art                  Art 102
                                         Journalism           J 101
                                         Journalism           J 202
Run Code Online (Sandbox Code Playgroud)

我想要做的是获得特定学生不属于的所有证书.例如,This@that.com注册了程序员和英语证书.我想得到一个SQL语句,它将返回CertReqs中特定学生未注册的所有证书.所以对于这个例子它应该归还经济,艺术和新闻.我一直在努力争取这个,所以任何帮助将不胜感激!

mysql sql join

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

从Python中的类中的函数获取返回值

我试图通过一个带有返回值的简单函数简单地从我的类中获取值,我确定它是一个微不足道的错误,但我对python来说很新

我有一个简单的类设置如下:

class score():
#initialize the score info 
    def __init__(self):
        self.score = 0
        self.num_enemies = 5
        self.num_lives = 3

    # Score Info
    def setScore(num):
        self.score = num

    # Enemy Info
    def getEnemies():
        return self.num_enemies

    # Lives Info
    def getLives():
        return self.getLives

etc.....
Run Code Online (Sandbox Code Playgroud)

比我创建类的实例:

scoreObj = score()

for enemies in range(0, scoreObj.getEnemies):
    enemy_sprite.add(enemy())  
Run Code Online (Sandbox Code Playgroud)

我得到的错误是预期整数,但它有一个实例方法

获取此信息的正确方法是什么?

谢谢!

python

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

java中嵌套的foreach语句

是否可以在java中嵌套foreach语句并在外部foreach循环所在的当前索引处启动嵌套语句?

所以,如果我有

List<myObj> myObjList = new ArrayList<myObj>();

for (myObj o : myObjList){
    // how do I start the nested for loop at the current spot in the list?
    for(

}
Run Code Online (Sandbox Code Playgroud)

谢谢!

java foreach for-loop

3
推荐指数
2
解决办法
6939
查看次数

使用套接字的简单C#客户端出错

我试图在C#中创建一个非常简单的客户端/服务器,基本上我现在要做的就是让客户端连接到服务器,这是我得到错误的地方.我的服务器启动正常,但当我尝试启动我的客户端时,我收到此错误:

The requested address is not valid in this context
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
  at Client.Client.Main (System.String[] args) [0x00000] in <filename unknown>:0
Run Code Online (Sandbox Code Playgroud)

我现在的基本客户端如下

        try
        {
            IPAddress ipAddress = IPAddress.Parse("0.0.0.0");
            IPEndPoint remoteEP = new IPEndPoint(ipAddress, 8001);

            Socket sender = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

            try
            {
                sender.Connect(remoteEP);                    

                Console.WriteLine("Connected to: " + remoteEP);

                byte[] msg = Encoding.ASCII.GetBytes("Testing");

                sender.Send(msg);


                sender.Shutdown(SocketShutdown.Both);
                sender.Close();

            }

            catch (Exception e)
            {
                Console.WriteLine(e.Message + "\n" + e.StackTrace);
            }
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message + "\n" …
Run Code Online (Sandbox Code Playgroud)

c# sockets networking

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