问题列表 - 第37656页

$ obj = new BlahBlahName($ _ GET); 做?

我知道当我们使用GET方法跨页面或在同一页面内传递数据时,我们使用GET函数从php中的url获取变量.

然而

$obj = new BlahBlahName($_GET);
Run Code Online (Sandbox Code Playgroud)

这是做什么的?

php

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

为什么内联被认为比函数调用更快?

现在,我知道这是因为没有调用函数的开销,但是调用函数的开销真的那么重(并且值得让它内联的膨胀)?

根据我的记忆,当一个函数被调用时,比如说f(x,y),x和y被压入堆栈,堆栈指针跳转到一个空块,然后开始执行.我知道这有点过于简单了,但我错过了什么吗?一些推送和跳转来调用一个函数,真的有那么多的开销吗?

如果我忘了什么,请告诉我,谢谢!

c++ optimization compilation inline function-call

40
推荐指数
6
解决办法
4461
查看次数

在IE6中,如何将项目向右移动而不清除它?

在IE6中,HTML如下:

<div id="topmenu">
    <ul>    
        <li>num 1</li>
        <li>num 2</li>
    </ul>
    <div id="rightItem">Hello World</div>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS如下:

#rightItem {
    cursor: pointer;
    float: right;
    clear: none;
    height: 100%;
    width: 340px;
}

#topmenu {
    margin: 0 auto;
    text-align: left;
    width: 960px;
    height: 41px;
}
Run Code Online (Sandbox Code Playgroud)

它在除IE6之外的所有浏览器中将itemRight浮动到同一行(第一个UL然后是rightItem)的右侧.在IE6中,它是清除并向右浮动.我如何修复IE6?

css css-float internet-explorer-6

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

什么是3D在这个HTML中做什么?

我正在尝试通过查看代码来复制我进入我的Gmail的邮件程序.我在多个源查看器中看到了很多这样的内容:

 <td style=3D"border-bottom: 1px dotted rgb(153,157, 147); border-top: 1px solid rgb(28, 140, 78);" width=3D"90">=A0</td>
 <td style=3D"border-bottom: 1px dotted rgb(153,157, 147); border-top: 1px solid rgb(28, 140, 78);" align=3D"right" width=3D"110">
Run Code Online (Sandbox Code Playgroud)

3D是某种我不知道的邮件呈现方式吗?

html css html-email

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

scanf失败了为什么?


当我写这篇文章时,编译并运行:

int x;   
scanf ("%d", &x);  
while (x!=4) {  
    scanf ("%d", &x);  
}
Run Code Online (Sandbox Code Playgroud)

当插入char或小于4的double数时,它进入一个无限循环.
当插入大于4的double时,它会终止.
任何解释?

c scanf

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

对于Mercurial,我们可以推出一些变更集而不是推动一些变更集吗?

如果我们多次提交,例如,我们的本地仓库,修订版3000,3001,3002,3003.如果我们推送到远程仓库,它将推动3000到3003.有没有办法只推3000和3001?

mercurial

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

使用ThreadPoolExecutor提交和执行方法有什么区别

我发现有两种方法(提交和执行)将Runnable添加到线程池中,有什么区别?

java multithreading

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

关于使用命令设计模式的思考

我有一些代码可以更新电子邮件的人员列表.此列表经常更新,在调用代码的实际"发送电子邮件"部分之前添加和删除人员.目前我的代码处理这个是这样的:

if (instructorEmailType == InstructorEmailType.AddToCourse)
{
    // If instructor not already in the list, then put them in.
    if (!this.InstructorsToEmail.ContainsKey(courseInstructor))
    {
        this.InstructorsToEmail.Add(courseInstructor, InstructorEmailType.AddToCourse);
    }
    else
    {
        // If instructor already in the list, and marked for removal, then get rid
        // of that entry from the list.
        if (this.InstructorsToEmail[courseInstructor] == InstructorEmailType.RemoveFromCourse)
        {
            this.InstructorsToEmail.Remove(courseInstructor);
        }
    }
}
else
{
    if (this.InstructorsToEmail.ContainsKey(courseInstructor))
    {
        this.InstructorsToEmail.Remove(courseInstructor);
    }
    else
    {
        this.InstructorsToEmail.Add(courseInstructor, InstructorEmailType.RemoveFromCourse);
    }
}
Run Code Online (Sandbox Code Playgroud)

这很复杂,我不喜欢它.我一直在考虑实现Command设计模式.我的想法是创建两个命令:

  • SendAllocatedInstructorEmailCommand
  • SendDeallocatedInstructorEmailCommand

当教师被分配到课程时,我会新建SendAllocatedInstructorEmailCommand并添加它以CommandInvoker.SetCommand供以后使用.同样,我会SendDeallocatedInstructorEmailCommand …

command design-patterns

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

带有通配符的spring <util:properties />

我想从多个位置加载键值对.我的第一个猜测是:

<util:properties id="requestProcessorRepository"
  location="classpath*:*requestProcessors.properties"/>
Run Code Online (Sandbox Code Playgroud)

但它无效

Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [classpath*:*requestProcessors.properties] cannot be opened because it does not exist
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:546)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
    at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280)
    at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304)
    ... 24 more
Run Code Online (Sandbox Code Playgroud)

没有通配符,它​​就会起作用.

那么从通配文件创建属性对象/映射的任何其他可能性?

spring properties

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

jQuery模式对话框按钮文本

根据下面的代码显示JQuery对话框,按钮文本显示为文字"b"而不是变量b的值.

即:showWarningDialog('myBody', 'myTitle', 'go')显示一个带有标记的按钮b而不是的对话框go.

你怎么能go出现?

function showWarningDialog(theBody, theTitle, buttonText) {
    var t = "Warning";
    if (theTitle != null) {
        t = theTitle;
    }

    var b = "Ok";
    if (buttonText != null) {
        b = buttonText;
    }

    $("#div-dialog-warning div").text(theBody);

    $("#div-dialog-warning").dialog({
        title: t,
        resizable: false,
        height: 160,
        modal: true,
        buttons: {
            b : function () {
                $(this).dialog("close");
            }
        }
    });
}
Run Code Online (Sandbox Code Playgroud)

jquery jquery-ui modal-dialog jquery-ui-dialog

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