问题列表 - 第30458页

ListAdapter和SectionIndexer的快速滚动显示问题

我列出了按月和年分开的事件列表(2010年6月,2010年7月等).我启用了快速滚动,因为列表很长.我还实现了SectionIndexer,这样当人们快速向下滚动事件列表时,人们可以看到他们当前正在查看的月份和年份.

我对实现没有任何问题,只是如何显示信息.使用SectionIndexer进行快速滚动似乎只能支持带有单个字母的标签.如果列表是字母表,这将是完美的,但我希望它显示更多的文本.

如果你看下面的截图,你会看到我遇到的问题.

http://blog.matto1990.com/wp-content/uploads/2010/07/dispay_problem.png描述问题的屏幕截图

我想知道的是:是否可以更改屏幕中心文本的显示方式.我可以以某种方式更改它以使其看起来正确(背景覆盖所有文本).

提前致谢.如果您需要任何澄清,或代码只是问.

android listview

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

CSS溢出隐藏在绝对位置

我一直在敲打这个.我想绝对定位一个我将在div中移动的图像,并希望任何延伸到div之外的东西都被剪裁.以下是问题的示例:

<html>
<body>
  <div style="width: 500px; height: 200px; border: 1px solid black; overflow: hidden;">
    <div style="width: 200px; height: 50px; margin: auto; border: 1px solid black; background: gray;">On top of image.</div>
    <div style="position: absolute; top: 10px; left: 250px; z-index: -1;"><img src="http://www.google.com/logos/worldcupfinale10-hp.gif" /></div>
  </div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

所以,我希望徽标的右边缘不显示.想法?

html css

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

在Interface Builder中创建菜单时,菜单项不显示

在界面构建器中,我向主菜单添加了一个菜单项.我可以单击菜单并访问其内容,但是在运行程序时,菜单项的标题不会显示.

图像显示应用程序及其顶部和底部的菜单是IB中显示的应用程序.请注意,IB中的菜单具有"计算"菜单选项,正在运行的应用程序在其菜单中具有空格.

cocoa interface-builder

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

是否可以使函数从堆栈中的字符串执行代码?

#include <stdio.h>

int main(int argc, char** argv)
{
    void (*p) (void);
    /* this obviously won't work, but what string could I put in 
       here (if anything) to make this execute something meaningful?
       Does any OS allow instructions to be read from
       the stack rather than text area of the process image? */
    char *c = "void f() { printf(\"Hello, world!\"); }";
    p = ( void (*)() )c;
    p();
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c shellcode

9
推荐指数
3
解决办法
4843
查看次数

Java用递归问题解决迷宫

我有一个任务,我应该能够显示从入口到出口的迷宫的路径,我已经让它工作到一定程度,但当迷宫变得更加复杂的死胡同,这样的程序进入无限递归.如果你能给我任何帮助,指出我正确的方向,我将不胜感激.

Mu当前的理论可以在Room类中找到.

这里是Room类,其中存储了连接迷宫的每个房间的引用,有点像链接列表,链接在6个方向,北,南,东,西,上和下.

import java.util.ArrayList;

public class OurRoom
{
    private OurRoom exits[];
    private String name;
    private static ArrayList<OurRoom> list;

    public OurRoom()
    {
        this(null);
    }

    public OurRoom(String name)
    {
        this.name = name;
        this.list = new ArrayList<OurRoom>();
        exits = new OurRoom[Direction.values().length];
        for(OurRoom exit : exits)
        {
            exit = null;
        }
    }       


    public void connectTo(OurRoom theOtherRoom, Direction direction)
    {
        exits[direction.ordinal()] = theOtherRoom;
        theOtherRoom.exits[direction.getOpposite().ordinal()] = this;
    }

    public OurRoom getExit(Direction direction)
    {
        return exits[direction.ordinal()];
    }

    public boolean lookExit(Direction direction)
    {
        return exits[direction.ordinal()] != null; …
Run Code Online (Sandbox Code Playgroud)

java algorithm recursion

5
推荐指数
2
解决办法
6843
查看次数

C++基本转换

您好我正在尝试将一些代码从Windows移植到Linux.我有这个:

itoa(word,aux,2);
Run Code Online (Sandbox Code Playgroud)

但GCC不承认itoa.如何在C++方式上转换为base 2?

谢谢 ;)

c++ base

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

HTTP:"gzip,deflate"的首选Accept-Encoding是什么?

这个问题是关于HTTP标题"Accept-Encoding"的媒体类型的优先顺序,当它们具有相同的权重并且在我的博客上已被此评论提示时.

背景:

Accept-Encoding标头采用逗号分隔的媒体类型列表,浏览器可以接受例如gzip,deflate

品质因数也可以被指定为优先考虑例如在的情况下,其他的媒体类型"的gzip; Q = 0.8,放气",放气是优选的-但是不相关的这个问题.注意:"q = 0"的类型表示"不可接受".

RFC2616还指出应首先对媒体类型定义的"最具体的引用"进行加权.即"text/html; level = 1"应该用于"text/html" - 这也与问题无关.

题:

在以下情况中,哪种媒体类型优先?

Accept-Encoding: gzip,deflate
Run Code Online (Sandbox Code Playgroud)

两种类型都具有1的等效品质因数,并且这两种类型对浏览器都是"可接受的" - 因此可以使用任何一种类型.我总是假设输入的第一个类型应该是"首选",但在RFC中似乎没有特定的例子或偏好.

compression header http interpretation rfc2616

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

Matplotlib:使用相同的图形绘制多个图形,没有它们重叠

我有一个类用于绘制事物然后将它们保存到文件中.这是它的简化版本:

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

class Test():
    def __init__(self, x, y, filename):

        fig = plt.figure(1)
        ax = fig.add_subplot(111)

        ax.plot(x, y, 'D', color='red')

        ax.set_xbound(-5,5)
        ax.set_ybound(-5,5)

        plt.savefig('%s.png' % filename)


test1 = Test(1,2, 'test1')
test2 = Test(2,4, 'test2')
Run Code Online (Sandbox Code Playgroud)

结果如下:

TEST1

TEST2

问题是test2图像也有来自test1的点.图表是在循环中动态生成的,因此我无法对图号进行硬编码.

我可以创建一个计数器并将其传递给类构造函数,但我想知道是否有更优雅的方法来执行此操作.我尝试删除test1对象,但没有做任何事情.

python matplotlib

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

使宽度与另一个html元素的大小相同

嗨,我有一个下拉按钮,当你将它悬停时,它会删除一些指向页面的链接.我希望这些链接的大小与按钮的宽度相同.

按钮大小是内容宽度的100%,因此它会有所不同.如何使下拉项目的大小与CSS按钮的大小相同?

    <style type="text/css">
      #button {  /* Box in the button */
        display: block;
        width: 190px;
      }

      #button a {
        text-decoration: none;  /* Remove the underline from the links. */
      }
ul
{
list-style-type:none;
margin:0;
padding:0;
overflow:hidden;
}
li{
float:left;
list-style-type: none;
}
      #button ul {
        list-style-type: none;  /* Remove the bullets from the list */
      }

      #button .top {
display:block;
width:100%;
font-weight:bold;
color:#FFFFFF;
background-color:#98bf21;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase;  /* The button background */
      }

      #button ul li.item {
        display: …
Run Code Online (Sandbox Code Playgroud)

html css hover

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

如何测试AD密码是否符合配置的复杂性要求?

在net 3.5 csharp应用程序中,我需要提前知道AD密码是否满足配置的复杂性要求.
你怎么能这样做?

c# passwords active-directory

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