小编Adr*_*ano的帖子

在linux内核上寻找系统调用实现

我在寻找的实现open(),close(),write()unlink(),但我不能在任何地方找到他们!我觉得每一个功能是像sys_open,do_open,etc_open...但没有与我们使用的接口.你能帮助我吗?

我需要发现他们做了什么样的安全检查

c linux kernel linux-kernel

8
推荐指数
2
解决办法
5236
查看次数

为什么/ oauth/authorize应该得到保护?

根据http://projects.spring.io/spring-security-oauth/docs/oauth2.html:

注意,应使用Spring Security保护授权端点/ oauth/authorize(或其映射的替代方案),以便只有经过身份验证的用户才能访问它.

这是为什么?如果需要授权授权来交换授权代码的端点应该得到保护,这听起来是不对的.它就像登录页面的登录页面,特别是当授权授权将通过资源所有者密码凭据时.

spring-security spring-boot spring-security-oauth2

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

在javascript中分配有些破碎的元素?

http://jsfiddle.net/aRV7q/1/

function multierror(elements, messages){
    while(elements.length > 0){
        box = $(elements.pop());
        errTab = $('#error');

        errTab.fadeOut(10, function(){
            box.css('border', '1px solid red');
            errTab.html(messages.pop());
        }).fadeIn(10);

        errTab.fadeOut(5000, function(){
            box.css('border', '1px solid #cccccc');
            errTab.html('&nbsp');
        }).fadeIn(1000);
    }
} 
Run Code Online (Sandbox Code Playgroud)

这是我正在尝试运行的函数,它应该淡化$('#error')上的一些消息并突出显示我在表单中的一些输入框.消息在消息变量上,输入框的#name在元素变量上.

但是发生的事情是消息被弹出并正确显示,但是选中要突出显示的元素总是相同的,尽管当while循环迭代时总是弹出一个项目,所以我想一旦设置,变量框永远不会被重新分配,但我认为没有理由.

有什么想法吗?

javascript jquery

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

在多个.h文件中使用typedef结构

我在C中做了一个霍夫曼编码算法,并在这里遇到了问题.

我有两个不同的.h文件将使用此结构:

typedef struct no{
  int qtd;
  char c;
  struct no* esq;
  struct no* dir;
}no;
Run Code Online (Sandbox Code Playgroud)

所以,我的arv_huffman.h有那个typedef和 typedef no** arvHuffman

我的另一个.h,heap.h,包含"arv_huffman.h"并使用 typedef no* heap

这两个文件都没有其他实现.我尝试编译时得到的消息是:

arv_huffman.h:11: error: redefinition of ‘struct no’
arv_huffman.h:16: error: conflicting types for ‘no’
arv_huffman.h:16: note: previous declaration of ‘no’ was here
arv_huffman.h:18: error: conflicting types for ‘arvoreHuff’
arv_huffman.h:18: note: previous declaration of ‘arvoreHuff’ was here
Run Code Online (Sandbox Code Playgroud)

行具有以下代码

arv_huffman.h:11: "typedef struct no{"
arv_huffman.h:16: "}no;"
arv_huffman.h:18: "typedef no** arvoreHuff;"
Run Code Online (Sandbox Code Playgroud)

出了什么问题,我该如何解决它.

c struct typedef header

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

C服务器奇怪的行为

所以,我有这段代码,它只是从客户端读取消息并回复"是"

while(strcmp(buffer, "QUIT") != 0){ 
    bzero(buffer, 255); //cleans the read buffer

    /*this reads the aux (request) from the client*/
    recv(newsockfd, buffer, 255, 0);

    if(strlen(buffer))
        printf("Thread %d: %s\n", thread_no, buffer);
    fflush(stdout);

    write(newsockfd, "yup\n", 4);
}
Run Code Online (Sandbox Code Playgroud)

问题是,在第一次阅读时一切正常,但所有其他读数都搞砸了,如果我发送消息"吉他",例如,它得到'g',循环,然后它得到"uitar",发送另一个"是".

我不知道发生了什么.

c unix sockets

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