小编And*_*pin的帖子

隐藏文本字段闪烁光标

我有一个文本字段有没有办法隐藏闪烁的文本光标?我这样说是因为我正在做一个恐怖/神秘的网站,其中一条线索就是开始在任何地方打字.

也许我可以用javascript做到这一点?

html textfield

54
推荐指数
5
解决办法
9万
查看次数

Java PKCS#11配置-'slot'和'slotListIndex'

这些参数有什么区别?我已经阅读了文档,但我仍然对此表示怀疑。仅仅是索引规则(1..N对0..N-1)还是其他?如果可能,我希望对这些参数有更好的解释。

java cryptography pkcs#11

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

在Qt中滚动滚动区域

我只有一个包含几个Qlabels的Scroll Area小部件.

看看情况:

滚动区域内的小部件

我试图做以下但它没有成功,它不滚动...

#include "form1.h"
#include "form.h"
#include "ui_form.h"
#include "ui_form1.h"
#include<QScrollArea>
#include<QScrollBar>


Form::Form(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form)
{
    ui->setupUi(this);
    ui->scrollAreaWidgetContents->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
    ui->scrollAreaWidgetContents->resize(ui->scrollArea->size().width() ,ui->scrollArea->size().height());
    ui->scrollArea->setWidgetResizable(true);
    ui->scrollArea->setWidget(ui->scrollAreaWidgetContents);
    ui->scrollAreaWidgetContents->adjustSize();

}
Run Code Online (Sandbox Code Playgroud)

请问你能说出我做错了什么或者什么不理解?请具体,我将不胜感激......

c++ qt scroll

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

将unsigned char*buf = NULL转换为Pascal?

我在Borland Delphi工作,我在Borland C++ Builder中有几行代码.我想将这些行转换为Delphi源代码.

unsigned char *buf=NULL;
buf=new unsigned char[SPS*2];
for (i=0; i<SPS*2; i++)
   buf[i]=2;
Run Code Online (Sandbox Code Playgroud)

......

answers=buf[2];
Run Code Online (Sandbox Code Playgroud)

我想用这个buf分配一个PCHar值;

a:PCHar;
a:=buf.
Run Code Online (Sandbox Code Playgroud)

c++ delphi char translate pchar

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

C中的奇怪宏声明

可能重复:
为什么在C/C++宏中有时会出现无意义的do/while和if/else语句?
做{...}而(0)有什么好处?

探索libusb-1.0.9源代码,我找到了这样的line(./os/poll_windows.c:78):

#define CHECK_INIT_POLLING do {if(!is_polling_set) init_polling();} while(0)
Run Code Online (Sandbox Code Playgroud)

至于我,这是一样的:

#define CHECK_INIT_POLLING if(!is_polling_set) init_polling();
Run Code Online (Sandbox Code Playgroud)

是否有理由循环该表达式?

更新:

在答案之后,我仍然无法意识到会出现什么问题,以下示例有助于:

#include <stdio.h>

#define TEST if(test) foo();
#define TEST_DO do { if(test) foo(); } while(0)

int test = 1;
void foo() {
    printf("%s", "Foo called");
}

int main(int argc, char** argv) {
    if(argc > 1) TEST_DO; /* LINE 12 */
    else printf("%s", "skipping...");

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

如果放在TEST第12行,编译器将给出错误"error: ‘else’ without a previous ‘if’".
希望,这会有所帮助.

c libusb libusb-1.0

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

我的HashMap <String,ArrayList>的Key获取了错误的值

我基本上采用了一大块字符并使用每个后缀作为键,每个键指向一个ArrayList,其中包含可以找到每个后缀的索引.

当我做一个HashMap.get(后缀)时,它给我最后添加的键的索引,而不是我想要拉的那个(这在重复上发生...

这里是,

protected HashMap<String, ArrayList<Integer>> makeMap(char[] textStored)  
{
    HashMap<String, ArrayList<Integer>> phraseMap =
            new HashMap<String,  ArrayList<Integer>>();
    ArrayList<Integer> indexList = new ArrayList<Integer>();
    Boolean word = true;
    String suffix;
    int wordEndIndex = 0;
    for (int i = 0; i < textStored.length; i++) {
        word &= Character.isLetter(textStored[i]);
        if (word) {
            for (int h = i + 1;h < textStored.length;h++) {
                if (!Character.isLetter(textStored[h])) {
                    wordEndIndex = h; 
                    break;
                }
            }//PULLING THE NEXT SUFFIX vvv
            //This finds the next word/suffix:
            suffix = new String(textStored).substring(i,wordEndIndex + …
Run Code Online (Sandbox Code Playgroud)

java key hashmap

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

标签 统计

c++ ×2

java ×2

c ×1

char ×1

cryptography ×1

delphi ×1

hashmap ×1

html ×1

key ×1

libusb ×1

libusb-1.0 ×1

pchar ×1

pkcs#11 ×1

qt ×1

scroll ×1

textfield ×1

translate ×1