我有一些测试代码没有按照我的预期工作,在审查了各种网站和规范后,我仍然无法弄清楚发生了什么.
这是我的测试代码:
byte[] b = new byte[8];
b[0] = (byte)0x72;
b[1] = (byte)0x3A;
b[2] = (byte)0x60;
b[3] = (byte)0x01;
b[4] = (byte)0x0E;
b[5] = (byte)0x10;
b[6] = (byte)0x8A;
b[7] = (byte)0x11;
String bitmapStr = new String(b);
try {
b = bitmapStr.getBytes("US-ASCII");
} catch (Exception ex) {
ex.printStackTrace();
}
System.out.println("DEBUG: bitmapStr = \"" +bitmapStr + "\"");
for (int i=0; i<=7; i++) {
int byte1 = b[i];
System.out.println("byte"+i + ": " + Integer.toHexString(byte1));
}
Run Code Online (Sandbox Code Playgroud)
当我运行程序时,我在控制台输出中得到以下内容:
DEBUG: bitmapStr = "r:`?"
byte0: 72
byte1: …Run Code Online (Sandbox Code Playgroud) 我有一个表,其中包含ID列表,以及各种其他列,如IDName.
表的主键是ID本身,但它不是auto_increment.所以,我希望能够生成/计算下一个主键,但是有一个转折点:
主键应采用特定格式,即8位ID由三部分组成:
<the level><a code><a sequence #>例如<2><777><0123> = 27770123
因此,当我为表创建新ID时,我想要特定级别和代码的下一个序列号.例如,按照上面的例子,我可能想知道代码为777的2级的下一个序列号,结果应该是ID 27770124(0124是序列中的下一个).
任何帮助将非常感激.
我有一长串六位数字(例如 123456)
在我的 postgresql 数据库中,我有一个包含两列 start_value 和 end_value 的表。该表具有起始值和结束值的行,它们的长度为 9 位数字,表示一个数字范围,即 start_value 可能是 123450000,end_value 可能是 123459999。
我需要将六位数字中的每一个与数据库表中落在其范围内的行进行匹配。
对于我列表中的许多数字,我可以简单地运行以下命令
SELECT * FROM table WHERE start_value=(number + 000)
Run Code Online (Sandbox Code Playgroud)
但是,这不包括落入范围内但与此模式不匹配的数字。
我一直在尝试以下语句:
SELECT * FROM table WHERE start_value > (number + 000) AND end_value < (number + 999)
Run Code Online (Sandbox Code Playgroud)
但这不起作用,因为某些行覆盖的范围比 xxxxx0000 到 xxxxx9999 更大,因此上面的语句可能返回 20 行或没有。
任何点都将是最受欢迎的!
编辑:列的数据类型是数字(25)
我有以下asm代码(x86).
.input:
mov ah, 00h ; get key from keyboard buffer
int 16h ; interrupt 16h
mov dl, al ; move ASCII code into dl
mov ah, 02h ; function 02
int 21h ; interrupt 21h
mov ah, 0Eh ; tell the BIOS to print the character in the AL register
mov al, dl ; copy dl into al
int 10h ; print al
sub al,0Dh ; check if it's carriage return
jz 01h ; jump relative 1 (to skip …Run Code Online (Sandbox Code Playgroud) postgresql ×2
ascii ×1
assembly ×1
bytearray ×1
java ×1
primary-key ×1
range ×1
string ×1
x86 ×1