问题列表 - 第34483页

如何防止带有溢出-y 的框:滚动窃取 Firefox 上选项卡的焦点?

考虑一个包含以下代码的页面:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <style type="text/css">
            .steal-focus { overflow-y: scroll }
        </style>
    </head>
    <body>
        <form action="/">
            <input type="text" value="First">
            <div class="steal-focus">Content</div>
            <input type="text" value="Second">
        </form>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)
  1. 在 Firefox 上加载此页面。
  2. 第一次点击标签:焦点转到第一个文本字段。
  3. 再次点击选项卡:焦点转到<div>而不是第二个文本字段,因为overflow-y: scroll.

这种行为是 Firefox 独有的:IE、Safari 或 Chrome 不会发生这种情况。我怎样才能解决这个对我来说听起来像是 Firefox 错误的行为?我希望选项卡跳过 ,<div>即使它有一个overflow-y: scroll.

css firefox accessibility tabbing

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

Emacs中的游标类型

我在.emacs文件中放入什么来将所有帧的光标类型更改为box

emacs customization cursor preferences

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

App Engine批量装载机性能

我正在使用App Engine批量加载器(Python运行时)将实体批量上传到数据存储.我上传的数据以专有格式存储,所以我已经通过自己的连接器(注册它bulkload_config.py)实现,将其转换为中间python字典.

import google.appengine.ext.bulkload import connector_interface
class MyCustomConnector(connector_interface.ConnectorInterface):
   ....
   #Overridden method
   def generate_import_record(self, filename, bulkload_state=None):
      ....
      yeild my_custom_dict
Run Code Online (Sandbox Code Playgroud)

要将此中性python字典转换为数据存储区实体,我使用我在YAML中定义的自定义帖子导入功能.

def feature_post_import(input_dict, entity_instance, bulkload_state):
    ....
    return [all_entities_to_put]
Run Code Online (Sandbox Code Playgroud)

注意:我没有entity_instance, bulkload_state在我的feature_post_import功能中使用.我只是创建新的数据存储实体(基于我input_dict),并返回它们.

现在,一切都很好.但是,批量加载数据的过程似乎需要花费太多时间.例如,GB(~1,000,000个实体)的数据需要大约20个小时.如何提高批量加载过程的性能.我错过了什么吗?

我与appcfg.py一起使用的一些参数是(每个线程批量大小为10个实体的10个线程).

链接了Google App Engine Python小组帖子:http://groups.google.com/group/google-appengine-python/browse_thread/thread/4c8def071a86c840

更新:为了测试批量加载过程的性能,我加载entities了"测试" Kind.虽然这entity很简单FloatProperty,但仍然需要花费相同的时间来批量加载它们entities.

我仍然会尝试改变批量加载器参数rps_limit,bandwidth_limit并且http_limit,看看我是否可以获得更多的吞吐量.

python performance google-app-engine bulk-load bulkloader

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

将数据添加到XHTML标记

我的网站是XHTML 1.1,我在页面上的<li><div>标签上添加了"rel"属性,以便在页面上存储jQuery脚本的数据.验证我的页面时,我收到错误:"没有属性'rel'".那么,在HTML标签中存储任意数据的最佳方法是什么?

我正在为我的网站撰写评论页面.输入注释后,将通过AJAX进行POST,后者返回所有注释的JSON.然后我查看'rel'值以查看页面上已有哪些注释,并仅添加新注释.

jQuery代码工作正常,它只是'rel'属性不验证.

html xhtml

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

如何使用python在sql中选择一个很长的id列表

我有一个非常大的数据库,我正在使用,我需要知道如何选择一组没有任何实际模式的id.这是我到目前为止的代码段:

longIdList = [1, 3, 5 ,8 ....................................]
for id in longIdList
    sql = "select * from Table where id = %s" %id
    result = cursor.execute(sql)
    print result.fetchone()
Run Code Online (Sandbox Code Playgroud)

我在想,必须有一个更快的方法来做到这一点......我的意思是我的脚本需要搜索一个拥有超过400万id的数据库.有没有办法可以使用select命令一次性抓取它们.我可以使用带有id列表的where语句吗?谢谢

python sql

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

如何移出C中的位?

我试图在C中编写一个函数,它将根据时钟信号移出一个字节的各个位.到目前为止,我已经想到了......

void ShiftOutByte (char Data)
{
    int Mask = 1;
    int Bit = 0;
    while(Bit < 8)
    {
        while(ClkPin == LOW);
        DataPin = Data && Mask;
        Mask = Mask * 2;
        Bit++;
    }
}
Run Code Online (Sandbox Code Playgroud)

其中DataPin表示我要将数据移出的端口引脚,而ClkPin是时钟端口引脚.

我希望器件从字节的LSB开始移出8位.出于某种原因,我的输出引脚始终保持高电平.我确信端口引脚配置正确,因此这纯粹是一个逻辑问题.

c bit-shift

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

调整大小后调整UIPopoverController位置

我有一个UIPopoverController包含UITableView.弹出窗口在其视图控制器的-viewDidAppear功能中调整大小以适合表的内容.当弹出窗口正确调整大小时,它的箭头通常不再指向原始箭头CGRect.有没有办法强制弹出窗口在调整大小后重新定位自身,使其箭头指向其预定目标?

编辑:我无法设置弹出窗口的大小,-viewDidLoad因为表视图在-viewDidAppear调用之前不会加载其数据,因此我不知道弹出窗口的大小应该是什么.另外,当单击其中一个表格视图单元格以显示另一个视图时,我会调整popover的大小,这也会导致箭头不再指向其预期目标.

cocoa-touch ipad uipopovercontroller ios

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

GetTokenInformation()首先调用.做什么的?

查看GetTokenInformation()的 MSDN文档和获取登录SID示例,需要调用GetTokenInformation()两次.第一个调用是获取缓冲区大小.

那么,缓冲区大小是什么?只是说我使用TokenUser作为它的第二个参数,我看到第一次调用返回的dwReturnLength不是TOKEN_USER结构的大小.

提前致谢

c c++ windows delphi winapi

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

UpdatePanel似乎重新编码页面标题中的字符?

我的标题中有特殊字符的页面用于正确的排版,例如它表示Exchange '07 Groups"具有正确的撇号,而不是单引号.撇号的HTML实体是 &#8216;

所以,我发现如果我从VB设置页面标题,标题显示就好了,但是一旦更新面板更新该HTML实体被重新编码并错误地显示为"Exchange‘ 07 Groups"

所以这是我的代码,我只需设置页面标题,然后是更新面板,以及更新它的按钮......

<script runat="server">
    Protected Sub Page_Load(...) Handles Me.Load
       Page.Title = "Exchange &#8216;07 Groups"
    End Sub

    Protected Sub uxLnkDoClick(ByVal sender As Object, ByVal e As System.EventArgs)
        uxLitLoaded.Text = "Loaded!"
    End Sub
</script>

<!DOCTYPE html>
<html>
<head runat="server"></head>
<body>
<form id="form1" runat="server">
    <asp:ScriptManager runat="server"></asp:ScriptManager>    
    <asp:UpdatePanel runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:LinkButton runat="server" ID="uxLnkDo" OnClick="uxLnkDoClick" Text="Do Something" />
            <asp:Literal runat="server" ID="uxLitLoaded" />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="uxLnkDo" />
        </Triggers>
    </asp:UpdatePanel>
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

关于这个还能做什么?

asp.net updatepanel character-encoding page-title

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

Spring Security,表单登录和并发会话

我试图限制用户多次签名(强制前一个会话到期).

我检查了这个专题的文件在这里.我将其设置为非常类似于文档,但用户一次不限于一个会话.我可以使用同一个用户多次登录(在不同的浏览器中)并且有多个并发会话.

以下是我认为是我的安全设置的相关内容.我正在使用自定义UserDetailsS​​ervice,UserDetails和AuthenticationFilter实现.


    <http entry-point-ref="authenticationEntryPoint">
        <!-- Make sure everyone can access the login page -->
        <intercept-url pattern="/login.do*" filters="none" />

        [...]

        <custom-filter position="CONCURRENT_SESSION_FILTER" ref="concurrencyFilter" />
        <custom-filter position="FORM_LOGIN_FILTER" ref="authenticationFilter" />

        <logout logout-url="/logout" logout-success-url="/login.do" />
    </http>

    <authentication-manager alias="authenticationManager">
        <authentication-provider user-service-ref="userDetailsService">
            <password-encoder hash="sha" />
        </authentication-provider>
    </authentication-manager>

    <beans:bean id="userDetailsService" class="[...]">
        <beans:property name="userManager" ref="userManager" />
    </beans:bean>

    <beans:bean id="authenticationFilter" class="[...]">
        <beans:property name="authenticationManager" ref="authenticationManager" />
        <beans:property name="eventPublisher">
            <beans:bean
                class="org.springframework.security.authentication.DefaultAuthenticationEventPublisher" />
        </beans:property>
        <beans:property name="filterProcessesUrl" value="/security_check" />
        <beans:property name="authenticationFailureHandler">
            <beans:bean
                class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
                <beans:property name="defaultFailureUrl" value="/login.do?login_error=true" />
            </beans:bean>
        </beans:property>
        <beans:property …
Run Code Online (Sandbox Code Playgroud)

java authentication spring spring-security

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