半城柳色半声笛

文章 评论 浏览 26

半城柳色半声笛 2024-11-04 09:05:43

您无法从外部使用 css 修改 iframe 内容。如果 iframe 内容位于同一域中,您可以编写一个 javascript 来输入 iframe 并删除不需要的内容。如果 iframe 是跨域的,那你就不走运了。

You can't modify iframe content with css from the outside. If the iframe content is on the same domain, you could write a javascript that enters the iframe and removed the unwanted content. If the iframe is crossdomain you're out of luck.

如何裁剪 IFrame 的内容(从 IFrame 容器,不使用滚动)

半城柳色半声笛 2024-11-04 04:55:19

您需要在键盘上方添加一个 UIToolbar - 这个是一个好的开始

You need to add a UIToolbar above the keyboard - this is a good start.

实现像短信应用程序那样的键盘吗?

半城柳色半声笛 2024-11-04 03:32:35

您可以将需要访问的每个属性或方法声明为静态,在 VB 中为“共享”

Shared Sub GetSomething()


MySharedClass.GetSomething()

You can declare every property or method that you need to access as static, in VB, "Shared"

Shared Sub GetSomething()


MySharedClass.GetSomething()

如何在不声明对象的情况下使用类

半城柳色半声笛 2024-11-04 00:48:15

您可以将所有信息保存在一张表中,只要它们在逻辑上属于在一起即可。尽管乐观锁定在大多数情况下应该有效,但您会冒着以这种方式锁定用户行的风险。

但是,您应该只更新确实更新的字段。如果您对表中的不同数据项有这样的单独需求,您应该为这些数据项编写专门的数据访问和更新例程。

好处是您只需将所需的数据从数据库传输到数据库,这将减少网络、客户端和数据库上的延迟和负载。

You can keep all information in one table, so long as it logically belongs together. You are risking locking on user rows this way, though optimistic locking should work most of the time.

However, you should only update the fields that do update. If you have such separate needs for the different data items on the table you should write specialized data access an update routines for those.

The benefit is that you are only transferring required data from/to the database, which will reduce latency and load on the network, clients and database.

在 SQL Server 中不断更新同一行有什么不好吗?

半城柳色半声笛 2024-11-03 19:09:25

http://doc.trolltech.com/latest/dnd.html 应该引导您几乎任何你想做的事情都可以重新拖放。

至于您的具体目标,您需要实现 QWidget::dragMoveEvent(QDragMoveEvent* event),每次鼠标在拖动项目时在目标树中移动时都会调用该事件。然后使用 QDragMoveEvent::pos() 获取光标的位置。之后,在dragMoveEvent中,使用QTreeView::indexAt(pos())来获取鼠标下的项目。现在,我不知道如何让项目以平滑的动画方式分离,这将是理想的。但您可以做的是(暂时)向列表中添加一个空白项目,这将具有几乎相同的效果。然后实现 QWidget::dropEvent() 来处理放置事件,当发生这种情况时,删除空白项并将拖动的项插入到原来的位置。

http://doc.trolltech.com/latest/dnd.html should lead you to pretty much anything you want to do re drag and drop.

As for your specific goal, you need to implement QWidget::dragMoveEvent(QDragMoveEvent* event), which will get called every time the mouse moves within the destination tree while dragging an item. Then get the position of the cursor with QDragMoveEvent::pos(). After that, while in dragMoveEvent, use QTreeView::indexAt(pos()) to get the item under the mouse. Now, I don't know how to get the items to separate in a smooth animated way, which would be ideal. But what you can do is (temporarily) add a blank item to the list, which will have the almost identical effect. Then implement QWidget::dropEvent() to handle the drop event, and when this happens delete the blank item and insert the dragged item in the location where it was.

Qt 拖放动画

半城柳色半声笛 2024-11-03 16:16:35

你检查过你的ccnet的dashboard.config文件吗?
其中包含以下行:

<server name="local" url="tcp://localhost:21234/CruiseManager.rem" ... />

尝试将端口更改为 82,然后重新启动网站(您应该能够在 web.config 文件中添加一个空格并保存,IIS 将重新启动网站)。

Have you checked your ccnet's dashboard.config file?
It has the following line in it:

<server name="local" url="tcp://localhost:21234/CruiseManager.rem" ... />

Try changing the port on that to 82 and then restarting the website (you should be just able to add a space to the web.config file and save and IIS will restart the website).

CruiseControl.NET无法连接?

半城柳色半声笛 2024-11-03 15:07:49

JSBin 中的示例
-(请参阅下面的更新版本,这是有问题的,固定列是粘性的)

  • 绿色不是必需的,它就在那里
    显示包装实际上是
    使整个区域
  • 绝对 居中
    定位左右包裹
    首先是 position:fixed
    列不会转到视口的一侧

现在在 JSBin

无错误版本>

嗯,这比我想象的要困难;这个适用于 IE7、8、Safari、FF3.6、Opera、Chrome

查看注释的源代码,特别有趣的是指针事件,没有它们,较新的浏览器将无法单击(选择文本或单击链接) “overlaid”div,这就是这个布局正在做的事情,它覆盖一个绝对位置 div 并使用绝对定位和相对位置来绕过滚动、垂直和水平、消失的内容和粘性固定 div 的问题

更新为使用 jQuery 作为每个评论

示例:此处

example in JSBin
- (see updated version below, this is buggy, fixed columns are sticky)

  • the green is not required it's there
    to show the wrapper is actually
    centering the whole lot
  • absolutely
    position the left and right wraps
    first so the the position:fixed
    columns don't go to side of viewport

Update

non-buggy version now in JSBin

hmm that was more difficult than I thought it would be; this one works in IE7, 8, Safari, FF3.6, Opera, Chrome

view the source code for the notes, especially interesting is pointer-events, without them the newer browsers will not click through (select text or click a link) an "overlaid" div, which is what this layout is doing it's overlaying an Absolutely Position div and using absolute positioning and relative position to get around the scrolling, vertical and horizontal, issues there was with disappearing content and sticky fixed divs

Updated to use jQuery as per comments

Example: here

如何创建 css 列,包括。可滚动的中间列和浮动的左右列

半城柳色半声笛 2024-11-03 11:11:13

我不知道这是否是您问题的原因,但您正在 getBaseContext() 上使用 bindService() 。您不在服务实例上调用bindService() 是否有原因?这就是示例服务的作用。

基本上下文似乎基本上是不需要的,一般建议似乎不使用它。
请参阅另一个问题:有什么区别 。

除此之外,您需要在设备上安装最新(或至少是最近)版本的 Android Market 应用程序,尽管我假设它会自行更新

有一种方法可以测试市场应用程序是否支持应用程序内结算,在应用程序内结算参考中的某处进行了描述。我认为做这项检查是值得的。

I don't know if this is the cause for your problem, but you are using bindService() on getBaseContext(). Is there a reason that you don't call bindService() on the service instance? That's what the example service does.

The base context seems to be mostly unneeded and the general advice seems to not use it.
See the other question: What's the difference between the various methods to get a Context?

Besides that, you need to have the newest (or at least a recent) version of the Android Market App on your device, although I assume that it updates itself.

There is a way to test if the market app supports In-App Billing, somewhere described in the In-App-Billing reference. I assume that it is worth to do that check.

Android 中的应用程序计费

半城柳色半声笛 2024-11-03 06:32:19

如果您是数据库的单个用户,请保持连接。如果没有,您确实可以依靠连接池来为您做到这一点。

我个人每次都会选择打开连接。在 .NET 2.0 中,实现了一项新功能,因此,如果您与 sql server 有一个开放的连接,并且 sql server 重新启动等...您的连接将变得无效,并且这不是我可以拿我的服务冒险的事情。 请参阅我几年前的帖子

If you are the single user of the database, hold onto the connection. If not you can really rely on connection pooling to do that for you.

I personally would go for opening the connection everytime. In .NET 2.0 a new feature was implemented so that if you have an open connection to a sql server and sql server gets restarted, etc... your connection becomes invalid and that is not something I can risk my service with. See my post from some years ago.

Windows 服务中的 SQL 连接

半城柳色半声笛 2024-11-03 05:30:40

如果您违反 dict 的要求并更改其哈希值,则可能会发生这种情况。

当一个对象在dict中使用时,它的哈希值不能改变,并且它与其他对象的相等性也不能改变。其他属性可能发生变化,只要它们不影响字典中的显示方式即可。

(这并不意味着哈希值永远不允许更改。这是一个常见的误解。哈希值本身可能会更改。只有 dict 要求密钥哈希值不可变,而不是 __hash__ 本身。)

以下代码将一个对象添加到字典中,然后从字典下更改其哈希值。 q[a] = 2 然后将 a 添加为字典中的新键,即使它已经存在;由于哈希值发生了变化,字典找不到旧值。这再现了您所看到的奇特之处。

class Test(object):
    def __init__(self, h):
        self.h = h
    def __hash__(self):
        return self.h

a = Test(1)
q = {}
q[a] = 1
a.h = 2
q[a] = 2

print q

# True:
print len(set(q.keys())) != len(q.keys())

This can happen if you violate a requirement of dict, and change its hash.

When an object is used in a dict, its hash value must not change, and its equality to other objects must not change. Other properties may change, as long as they don't affect how it appears to the dict.

(This does not mean that a hash value is never allowed to change. That's a common misconception. Hash values themselves may change. It's only dict which requires that key hashes be immutable, not __hash__ itself.)

The following code adds an object to a dict, then changes its hash out from under the dict. q[a] = 2 then adds a as a new key in the dict, even though it's already present; since the hash value changed, the dict doesn't find the old value. This reproduces the peculiarity you saw.

class Test(object):
    def __init__(self, h):
        self.h = h
    def __hash__(self):
        return self.h

a = Test(1)
q = {}
q[a] = 1
a.h = 2
q[a] = 2

print q

# True:
print len(set(q.keys())) != len(q.keys())

对于 Python 字典来说,键并不是唯一的!

半城柳色半声笛 2024-11-03 04:58:23

你不能。

相反,您可以制作一本字典:

Averages = table.Columns.Cast<DataColumn>().ToDictionary(
    c => c.ColumnName, 
    c => grp.Average(dr => Convert.ToDouble(dr[c]))
)

需要 Convert.ToDouble ,因为我不知道可能是什么类型,而 Average 需要特定的数字类型。
如果所有列都是相同的数字类型,您可以将其替换为强制转换。

You can't.

Instead, you can make a dictionary:

Averages = table.Columns.Cast<DataColumn>().ToDictionary(
    c => c.ColumnName, 
    c => grp.Average(dr => Convert.ToDouble(dr[c]))
)

The Convert.ToDouble is needed since I don't know what tyhpe the coulmn is, and Average needs a specific numeric type.
If all of the columns are the same numeric type, you can replace that with a cast.

C# LINQ 从运行时信息创建匿名类型

半城柳色半声笛 2024-11-03 03:37:35
$html = file_get_html('http://www.google.com/');

$eles = $html->find('*');
foreach($eles as $e) {
    if(strpos($e->innertext, 'theString') !== false) {
        echo $e->id;
    }
}

http://simplehtmldom.sourceforge.net/manual.htm

$html = file_get_html('http://www.google.com/');

$eles = $html->find('*');
foreach($eles as $e) {
    if(strpos($e->innertext, 'theString') !== false) {
        echo $e->id;
    }
}

http://simplehtmldom.sourceforge.net/manual.htm

PHP 简单 HTML DOM 解析器查找字符串

半城柳色半声笛 2024-11-03 03:27:05

我的第一个猜测是您安装的程序没有正确检测.NET 2.0。正如您正确提到的,.NET 2.0 已预装在 Windows 7 上。请参阅 本文 了解完整图片。

My first guess is the program you install doesn't detect .NET 2.0 correctly. As you correctly mentioned, .NET 2.0 is pre-installed on Windows 7. See this article for complete picture.

在 w7 上安装程序,需要 .NET 版本 2.0

半城柳色半声笛 2024-11-02 20:50:39

我知道这是一个很老的问题,但我正在回答。因为我认为我的回答可以帮助其他人。我对模型进行了一些更改,如下所示。我使用过 Django 1.8。

class Make(models.Model):
    name = models.CharField(max_length=200)

class MakeContent(models.Model):
    make = models.ForeignKey(Make, related_name='makecontent')
    published = models.BooleanField()

我使用了以下查询集。

Make.objects.filter(makecontent__published=True)

您应该使用 distinct() 来避免重复的结果。

Make.objects.filter(makecontent__published=True).distinct()

我希望它会有所帮助。

I know this is very old question, but I am answering. As I think my answer can help others. I have changed the model a bit as follows. I have used Django 1.8.

class Make(models.Model):
    name = models.CharField(max_length=200)

class MakeContent(models.Model):
    make = models.ForeignKey(Make, related_name='makecontent')
    published = models.BooleanField()

I have used the following queryset.

Make.objects.filter(makecontent__published=True)

You should use distinct() to avoid the duplicate result.

Make.objects.filter(makecontent__published=True).distinct()

I hope it will help.

具有反向外键过滤功能的 Django 查询集

半城柳色半声笛 2024-11-02 20:20:45

在下面,您将设置局部变量而不是类变量:

button2.setOnClickListener(new View.OnClickListener() { 
       public void onClick(View v) {
      MyCount counter= new MyCount(countcur,1000); // countcur is the current counter value when last cancelled

将其更改为引用现有的类变量:

button2.setOnClickListener(new View.OnClickListener() { 
       public void onClick(View v) {
     counter= new MyCount(countcur,1000); // countcur is the current counter value when last cancelled

In the following, you are setting a local variable instead of the class variable:

button2.setOnClickListener(new View.OnClickListener() { 
       public void onClick(View v) {
      MyCount counter= new MyCount(countcur,1000); // countcur is the current counter value when last cancelled

Change it to reference the existing class variable instead:

button2.setOnClickListener(new View.OnClickListener() { 
       public void onClick(View v) {
     counter= new MyCount(countcur,1000); // countcur is the current counter value when last cancelled

取消并重新启动 CountDownTimer 问题

我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文