有一个代码:
public static void Main(string[] args)
{
Info();
Console.ReadKey();
}
您需要确保程序不断地从控制台读取输入并仅在用户命令时关闭(例如,“ exit”)。
有一个代码:
public static void Main(string[] args)
{
Info();
Console.ReadKey();
}
您需要确保程序不断地从控制台读取输入并仅在用户命令时关闭(例如,“ exit”)。
在输入 - 公式(字符串)的逆波兰表示法。您需要将其转换为正常。示例:我们得到:
2 3 + 6 2 / 5 2 * - +
处理和交付:
2+3+6/2-5*2
我有一个 Adruino Uno 板。从它,通过串行,我将数据 ( if(Serial.available()) => delay(100) => Serial.write("Hello, World!")) 传输到 Java 程序读取的 COM 端口。我附上代码。
问题:程序从端口读取错误。例如,我发送“Hello, World!” - 来了“瞧,世界!” ,“天哪!” ,“天!天!” 等等。我将不胜感激在正义的道路上的指示。阿门。
import jssc.SerialPort;
import jssc.SerialPortException;
import jssc.SerialPortList;
public class Main {
public static void main(String[] args) {
// Метод getPortNames() возвращает массив строк. Элементы массива уже отсортированы.
/* Получение имён последовательных портов*/
System.out.println("Port searching...");
System.out.println("Find ports: ");
String[] portNames = SerialPortList.getPortNames();
for(int i = 0; i < portNames.length; i++){
System.out.println(portNames[i]);
}
//В конструктор класса передаём имя порта с которым мы будем работать
SerialPort serialPort = new SerialPort("COM3");
//Открываем порт
try {
serialPort.openPort();
//Выставляем параметры. Можно использовать и такую строку serialPort.setParams(9600, 8, 1, 0);
serialPort.setParams(SerialPort.BAUDRATE_9600,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
//Записываем данные в порт
serialPort.writeString("Test");
// Лучше использовать его совместно с интерфейсом SerialPortEventListener.
System.out.println("Getting answer from device...");
String buffer = serialPort.readString();
System.out.println(buffer);
//Закрываем порт
serialPort.closePort();
} catch (SerialPortException e) {
e.printStackTrace();
}
}
}
您需要通过COM 端口与设备进行原始通信。有哪些图书馆可以做到这一点?无论我在 Google 中找到什么,都是安装了显示器的比萨斜塔和一堆批评。另外,几乎所有的手册都是旧的,就像我的电脑一样。
下面有一个例子。如何使其在按下时Tab在文本(段落)中插入缩进而不是移动到下一个页面元素?
<div class='test' contentEditable='true'>Some text</div>
有 png 图标,例如来自 VK 的蓝色图标。如何使用CSS将其更改为白色?
PS:我在谷歌上搜索过filter: hue-rotate(),但是对于白色,这不是一个选项。
<img src="https://vk.com/images/icons/head_icons.png">
是否有类似的扩展,例如在 Brackets 上(热键上会弹出一个包含所选属性文档的窗口)?我知道Сtrl+Q,但内置文档非常脆弱,很难认真对待它。
最近开始学习预处理器。遇到了一个问题:当从 编译时.jade,.html代码被缩小了。这对学习不利。如何禁用缩小?最好用手指解释。
PS:我正在使用内置的 Watcher 在 PHPStorm 中编写代码。
需要.diamond-parent用积木铺设空间.diamond。或者,您可以制作一个 png 图像并将其与背景平铺,但通过 CSS 解决方案很有趣。
.diamond-parent {
width: 300px;
height: 300px;
background: lightpink;
}
.diamond {
width: 0;
height: 0;
border: 30px solid transparent;
border-bottom-color: red;
position: relative;
top: -30px;
}
.diamond:after {
content: '';
position: absolute;
left: -30px;
top: 30px;
width: 0;
height: 0;
border: 30px solid transparent;
border-top-color: red;
}
<div class="diamond-parent">
<div class="diamond"></div>
<div class="diamond"></div>
</div>
用n * 10的CSS 代码而不是n的js 代码来实现一个功能更好吗?就浏览器的负载、代码的质量、布局设计师的水平而言,什么是更可取的?
有一个代码(下)。单击时如何更改图像?
.feature-block {
width: 270px;
height: 320px;
margin: 25px;
background: #fff;
box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.3);
display: flex;
flex-direction: column;
align-items: center;
}
.feature-block-img {
display: block;
margin: 35px auto 0;
padding-top: 35px;
}
.feature-block-line {
display: block;
width: 70px;
height: 2px;
background: #EDEDED;
margin: 20px auto 0;
}
.feature-block-title {
text-align: center;
font-family: "Roboto Regular";
font-size: 16px;
}
.feature-block p {
margin: 20px 10px 0;
text-align: center;
line-height: 22px;
font-family: "Roboto Light";
font-size: 12px;
}
#block-radio-1 {
display: none;
}
input:checked + label .feature-block {
color: #fff;
background: #00B533;
}
<input type="radio" id="block-radio-1" name="block-select">
<label for="block-radio-1">
<div class="feature-block">
<div class="feature-block-header">
<img src="https://upload.wikimedia.org/wikipedia/commons/a/ab/Simbolo_konoha.svg" class="feature-block-img" alt="">
<div class="feature-block-line"></div>
<p class="feature-block-title">Title</p>
<p>Some text</p>
</div>
</div>
</label>
<div id = "a" style = "w:100px; h:100px; bg-color:black"></div>
<input type = "radio" id = "b" name = "c"/>
当使用 radio:checked 时,#a 块的颜色必须改变。