小编Twi*_*Twi的帖子

Is there any shortcut for CodeBlocks to format the code?

Is there any shortcut for CodeBlocks to format the code?

I haven't find any tip in google.

I found only "format use AStyle", but it come up with right mouse button only...

hotkeys codeblocks

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

Jedis 扫描找不到任何密钥

我想使用 Jedis 和以下代码片段从 Redis 集群中获取所有密钥:

 public void testRedis() {
        String key = "*";
        ScanParams scanParams = new ScanParams().count(1000).match("{*}");
        String cur = SCAN_POINTER_START;
        do {
            ScanResult<String> scanResult = getRedisCluster().scan(cur, scanParams);
            scanResult.getResult().stream().forEach(System.out::println);
            cur = scanResult.getStringCursor();
        } while (!cur.equals(SCAN_POINTER_START));
    }
Run Code Online (Sandbox Code Playgroud)

我的问题是此解决方案不会返回任何结果。即使我为现有密钥指定了匹配模式,它仍然无法正常工作。我尝试使用 get 命令获取特定键,它返回值而没有任何错误,因此连接看起来不错。

有什么建议吗?(我的线索之一是匹配参数等待“大括号”,所以我不得不在那里添加,但我还没有在互联网上的任何地方看到过这样的使用。)

java redis jedis

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

使用Java 8流API将列表列表展平到列表

我有以下代码,使用Java 8流API可以更简单:

List<List<String>> listOfListValues;
public List<String> getAsFlattenedList() {
        List<String> listOfValues= new ArrayList<>();
        for (List<String> value: listOfListValues) {
            listOfValues.add(String.valueOf(value));
        }
        return listOfValues;
    }
Run Code Online (Sandbox Code Playgroud)

我搜索了SO的解决方案,发现了这个:

listOfListValues.stream()
        .flatMap(List::stream)
        .collect(Collectors.toList());
Run Code Online (Sandbox Code Playgroud)

但这并不是我想要的.

java java-8 java-stream

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

VBA Excel单元格值"不"为NULL

我在for循环中获取单元格值,如下所示:

cellValue = rng.Cells(i, j).Value
Run Code Online (Sandbox Code Playgroud)

然后我检查单元格的值,如果它是空的我需要skipp,就像那样:

    If (Not IsEmpty(cellValue)) 
       /doThings/
Run Code Online (Sandbox Code Playgroud)

即使单元格值为空,IsEmpty(cellValue)条件也会变为空.我加了一块手表,看看这些牢房里面是什么,但我什么都没得到:

空单元格

在这些单元格中,我有一个公式,如果某些条件不为真,则返回"",这就是为什么单元格变空.

excel vba excel-vba

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

用给定字符替换字符串字符

我有一个包含字符和整数的长字符串。我想将x,y,z ...索引上的字符替换为给定字符,例如:'

示例:将索引为3,9和14的字符替换为'

input:  c9e49869a1483v4d9b4ab7d394a328d7d8a3
output: c9e'9869a'483v'd9b4ab7d394a328d7d8a3 
Run Code Online (Sandbox Code Playgroud)

我正在寻找C#中的一些通用解决方案

c# string

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

标签 统计

java ×2

c# ×1

codeblocks ×1

excel ×1

excel-vba ×1

hotkeys ×1

java-8 ×1

java-stream ×1

jedis ×1

redis ×1

string ×1

vba ×1