小编Mic*_*tta的帖子

什么是'?' 角色在这个操作中做什么?

我只是通过阅读一些朋友代码并为它编写测试工具,而且我遇到了一些困扰我的事情:

Console.WriteLine(inputString + (isPalindrome(inputString) ? displayConditions(" some text 1", 
ConsoleColor.Black) : displayConditions("some text 2", ConsoleColor.White)));
Run Code Online (Sandbox Code Playgroud)

什么是'?' 符号做这个操作?

将非常感谢对所调用内容的一般描述.我似乎无法在网上或我拥有的任何书籍中找到答案.

c# operators

-3
推荐指数
1
解决办法
161
查看次数

为什么我的div不出现?

HTML:

<!DOCTYPE html>
<html>
    <head>
    <link type="text/css" rel="stylesheet" href="stylesheet.css"/>
        <title>Some Title</title>
    </head>
    <body>
        <div id="header"></div>
        <div class="left"></div>
        <div class="right"></div>
        <div id="footer"></div>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

CSS:

div {
    border-radius: 5px;
}

.header {
    height: 100px;
    width: 75%;
    background-color: black;
}

#left {
    height: 600px;
    width: 30%;
    background-color: gray;
}

#right {
    height: 600px;
    width: 50px;
    background-color: blue;
}

.footer {
    height: 100px;
    width: 75%;
    background-color: black;
}
Run Code Online (Sandbox Code Playgroud)

http://cssdesk.com/aVCZc

如果有些东西对代码一无所知并且完全错误,有人可以指出我吗?div不会出现给我.

html css

-3
推荐指数
1
解决办法
442
查看次数

Python中类似字符串的百分比?

我不知道如何做一个程序,它给出了相同长度的两个字符串的相似程度.

例如,对于abcdabce它应该给75%.

订单很重要,我不希望它给我这个abcd并且dcab有100%.

我知道Levenshtein模块可以做到这一点,但我想要一个能够实现它的程序.

python string fuzzy-comparison

-3
推荐指数
1
解决办法
2223
查看次数

我如何将Java中单词的第一个字母大写?

如何将一段时间(.)之后的下一个词大写?例如.

太阳升起了.植物开始生长.

我需要做的,以大写什么p植物

java string java-7

-4
推荐指数
1
解决办法
1624
查看次数

如何使Java应用程序更快?

我有一个计费守护程序,必须以非常快的方式处理数十万个数据.我实现ExecutorSerivce了并行处理.它确实提高了速度,但不是很多.处理1,00,000条记录大约需要2.5到3个小时.如何在半小时内处理这些数据更快?

我已经为执行设置编写了以下内容:

-Xms2048M -Xmx2048M -XX:MaxPermSize=256m
Run Code Online (Sandbox Code Playgroud)

我试图用1个生产者和4个消费者实现Producer Consumer模型.每个列表可以包含10,000条记录.

ArrayBlockingQueue<BillableList> list =new ArrayBlockingQueue<BillableList>(10);

ExecutorService threadPool = Executors.newFixedThreadPool(5);
threadPool.execute(new Consumer("pool1", list)); 
threadPool.execute(new Consumer("pool2", list));
threadPool.execute(new Consumer("pool3", list));
threadPool.execute(new Consumer("pool4", list));
Future producerStatus = threadPool.submit(new Producer("Producer", list)); 
producerStatus.get(); 
threadPool.shutdown(); 
Run Code Online (Sandbox Code Playgroud)

在将记录更新到数据库时,我也收到了很多"超出数据库锁等待超时"的异常.这是因为不同的消费者同时尝试同一个用户吗?如何让不同的消费者从ArrayBlockingQueue列表中获取不同的数据?

java multithreading

-4
推荐指数
1
解决办法
255
查看次数

MySQL重复输入错误

在非唯一的字段上插入行时出现重复输入错误.但这是主要关键.可能是什么原因?

mysql

-7
推荐指数
1
解决办法
1987
查看次数

如何在C#中更改表单的颜色和大小?

如何在C#中更改表单的颜色和大小?

  // something like
  Form1.BackColor = Color.Red;  
  From1.size = 1600,900;
Run Code Online (Sandbox Code Playgroud)

c# winforms

-7
推荐指数
1
解决办法
301
查看次数

为什么我会收到"错误:'其他'没有'if'"?

我在找到错误时遇到问题:

import java.util.Scanner;

public class StringExample {
  public static void main(String[] args) {
    Scanner myScanner = new Scanner(System.in);

    System.out.println("What's your favorite type of food?");
    System.out.println("1. Pizza?");
    System.out.println("2. Steak?");
    System.out.println("3. Cake?");

    String answer = myScanner.next();
    if (answer.equals ("Pizza")) {
      System.out.println("It's pretty nice, isn't it?");
    }else if (answer.equals ("Steak")); {
      System.out.println("Yummy :)");
    }else if (answer.equals ("Cake")); {
      System.out.println("THE CAKE IS A LIE!");
    }
    }
  }
Run Code Online (Sandbox Code Playgroud)

错误:'else'没有'if'

我在第17行收到此错误:

}else if (answer.equals ("Cake")); {
Run Code Online (Sandbox Code Playgroud)

java if-statement

-7
推荐指数
1
解决办法
876
查看次数

Java无法找到"相等"的方法

我试图检查属性是否等于字符串,但我一直收到此错误

码:

if (prop.getProperty("quit").equal("true")) {

}
Run Code Online (Sandbox Code Playgroud)

错误:

cannot find symbol
  symbol:   method equal(java.lang.String)
  location: class java.lang.String
Run Code Online (Sandbox Code Playgroud)

java

-8
推荐指数
1
解决办法
1279
查看次数