灯角

文章 0 评论 0 浏览 23

灯角 2024-11-13 22:26:57
-(void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode

对我有用。

-(void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode

works for me.

使用iphone sdk中的socket连接并下载内容

灯角 2024-11-13 19:45:14

这篇博文描述了一些工作进入Lucene这方面。他们能够使用有限状态转换器(自动机)非常有效地实现 Levenshtein 距离模糊匹配,编辑距离可达 2。代码全部采用 Java 编写,虽然是开源的,但有点复杂。

但基本思想很简单:将你的字典想象成一棵巨大的字母状态树。在 state0,你没有字母。在 state1,您承认任何可能是单词第一个字母的字母。 State2 以 state1 为条件;如果第一个字母是“x”,则下一个状态只接受 x 后面的字母(位置 2)。现在

,对于 Levenshtein 匹配,您遍历字母树,同时允许一些错误:删除、插入(一个字母通配符)和可能的转置(Levenshtein 的一个很好的扩展是将转置视为单个编辑而不是 2)。您必须维护状态才能跟踪允许的编辑次数。这可以非常有效地完成 - 对于交互式“当您键入时”拼写建议器来说当然足够快。

This blog post describes some work that went into Lucene in this area. They were able to implement Levenshtein distance fuzzy matching using a Finite State Transducer (automaton) quite efficiently for up to an edit distance of 2. The code is all in Java though, and a little complex, although it is open source.

But the basic idea is simple enough: think of your dictionary as a giant tree of letter-states. At state0, you have no letters. At state1, you admit any letter that could be the first letter of a word. State2 is conditioned by state1; if the first letter was 'x', the next state admits only letters that could follow x (in position 2). etc.

Now for Levenshtein matching, you traverse the letter-tree while allowing some errors: deletions, insertions (one letter wildcard), and possibly transposal (a nice extension of Levenshtein is to consider a transposal as a single edit rather than 2). You have to maintain state in order to keep track of how many edits have been allowed. This can be done very efficiently - certainly fast enough for an interactive "while you type" spelling suggester.

超过 100k+ 的快速动态模糊搜索C# 中的字符串

灯角 2024-11-13 17:14:54

我认为您可以使用带有一两个模板列的网格,并在 RowDataBound 事件或 RowCreated 上添加必要的控件。我正在使用下面的代码来激活 rowdatabound 中的一个控件,

  ((TextBox)e.Row.FindControl("txtAutoEvaluare")).ReadOnly = false;

我认为您可以使用它在 rowcreated 事件中添加控件

            TextBox t1 = new TextBox();
        e.Row.Cells[2].Controls.Add(t1); 

I think you can use a grid with one or two templates columns, and add the necessary control on RowDataBound event or RowCreated. I'm using the code below to activate one control in rowdatabound

  ((TextBox)e.Row.FindControl("txtAutoEvaluare")).ReadOnly = false;

I think you can use to add controls in rowcreated event

            TextBox t1 = new TextBox();
        e.Row.Cells[2].Controls.Add(t1); 

排列动态生成的标签和 aspx 控件,使其看起来像字典,而不使用表格

灯角 2024-11-13 12:37:31

是的,在 XCode 常规首选项中选择“All in one”布局。

Yes, select the "All in one" layout in XCode General Preferences.

是否可以阻止 Xcode 在单独的窗口中列出构建错误?

灯角 2024-11-13 06:06:34

好吧,这个问题已经存在很长一段时间了,但我还是想添加这个。
关于浏览器支持的问题,caniuse.com 网站始终是一个很好的来源。

在这种情况下,您可以在此处找到对范围输入的当前、过去和预期的未来支持:
http://caniuse.com/#feat=input-range

Ok, this question has been here quite a while, but I wanted to add this anyway.
Regarding a question about browser support, a good source is always the caniuse.com website.

In this case, you can find the current, past and expected future support for the range input here:
http://caniuse.com/#feat=input-range

目前哪些浏览器支持“范围”?输入?

灯角 2024-11-13 05:17:44

嗯,INeed 界面可能表明设计很尴尬。在我看来,您真正寻找的是依赖注入,这相当于声明一个对象需要另一个对象才能运行的代码。因此

class Car:INeed<Engine> {
    public Set(Engine engine)
}

,也许您真正想要的是

class Car {
    public Car(Engine engine)
}

如果我是您,我会尝试看看上述内容是否适用于您的情况,这是声明需求/依赖项的更标准的方式

Well, the INeed interface is probably an indication of an awkward design. It seems to me that what you are really looking for is dependency injection, which is the code equivalent of stating that an object requires another object to function. So instead of having

class Car:INeed<Engine> {
    public Set(Engine engine)
}

, maybe what you really want is

class Car {
    public Car(Engine engine)
}

If I were you I would try to see if the above is applicable in your case, which is a more standard way of declaring needs/dependencies

INeedSomething 的更好名字...?

灯角 2024-11-13 04:31:29

值得在此处添加,因为这是搜索“ai_socktype not support”时的最佳结果
另一个原因可能是堆栈上的提示未归零;
为此你需要

memset(&hints, 0, sizeof hints);

日产的代码当然已经有了

It's worth just adding here, as this is the top result when searching for "ai_socktype not supported"
an alternative reason for it could be that hints is not zeroed on the stack;
for that you need

memset(&hints, 0, sizeof hints);

Nissan's code of course did have that already

getaddrinfo 错误:不支持 ai_socktype

灯角 2024-11-12 18:15:20

所以你描述的方法是一个好的开始。然而,要完成数据库部分,最好考虑使用 Servlet。因此,您创建一个实现 doGet() 方法的 Servlet 类。

您必须在 web.xml 文件中为 servlet 创建映射,因此假设您将 url: /profile 映射到您创建的 servlet,则链接将是:

  <a href="<c:url value="/profile" />" >Profile</a>

在该方法中,您与数据库交互,填充您的 bean并将其保存在请求范围中。接下来,您将转到将显示 bean 数据的 jsp 页面。

在jsp页面上,bean将可供您显示数据。

So the method you describe is a good start. However, to do the database part it might be better to look at using a Servlet. So you create a Servlet class that implements the doGet() method.

You have to create a mapping for your servlet in the web.xml file, so assume that you map the url: /profile to the servlet that you create then the link will be:

  <a href="<c:url value="/profile" />" >Profile</a>

In that method you interact with your database, populate your bean and save it in the request scope. Next, you forward to the jsp page that will display the bean data.

On the jsp page the bean will be available for you to display the data.

当我在 c:url 的帮助下按下锚标记时,如何调用填充 bean 的方法

灯角 2024-11-12 14:43:05

这取决于 ContentPanel 中的其他内容 - 我假设是默认模板中的网格。

如果其中没有其他内容,那么它将占用网格占用的整个空间,减去分配给边距的空间。

请提供一个完整的示例来演示您所看到的行为,并告诉我们您想要实现的目标。 (您希望按钮如何显示?)

This depends on what else is also in ContentPanel - which I assume is the grid from the default template.

If there is nothing else in it then it will take up the whole space occupied by the grid, minus the space you have allocated to the margin.

Please provide a complete example which demonstrates the behaviour you are seeing and tell us what you are trying to achieve. (How do you want the button to be displayed?)

使用 Visual studio 2010 在 WP7 中以编程方式添加控件时显示问题

灯角 2024-11-12 13:52:55

我认为您无法在 Android 应用程序中使用 Windows 本机库 (.dll)。要在 Android 上加载,需要将代码构建到 .so 中。

I don't think you're going to be able to use a Windows native library (.dll) in an Android application. To load on Android, the code would need to be built into a .so.

如何将.dll导入Android java项目(使用eclipse)

灯角 2024-11-12 12:15:24

我相信您发布的 URL 是 Eclipse 3.5 旧版 (v1.1) 插件的更新站点。

如果您想使用 Eclipse 3.6 的较新 (v1.3) 插件,更新站点为:
http://www.blackberry.com/go/eclipseUpdate/3.6/java

有关当前 Eclipse 插件的详细信息,请参见此处:
http://us.blackberry.com/developers/javaappdev/javaplugin.jsp

对于旧版 JDE(可能不是您想要的),请转到此处:
http://us.blackberry.com/developers/javaappdev/javadevenv.jsp

我个人仍在使用旧的(v1.1)插件,因为新插件中的错误影响了我自己的项目,但我不确定现在旧插件的公共下载站点在哪里。

I believe the URL you posted is the update site for the old (v1.1) plugin for Eclipse 3.5.

If you want to use the newer (v1.3) plugin for Eclipse 3.6, the update site is:
http://www.blackberry.com/go/eclipseUpdate/3.6/java

Details on the current Eclipse plugin are available here:
http://us.blackberry.com/developers/javaappdev/javaplugin.jsp

And for the legacy JDE (probably not what you want), go here:
http://us.blackberry.com/developers/javaappdev/javadevenv.jsp

I'm personally still using the older (v1.1) plugin due to bugs in the new plugin that affect my own project, but I'm not sure where the public download site for the old plugin is these days.

如何下载已弃用的 Blackberry SDK?

灯角 2024-11-11 22:28:26

假设

我假设您已经安装了 Eclipse 的 Maven 插件。

安装

在项目资源管理器中选择项目时选择
运行-->运行方式 --> Maven 安装

运行 Jboss

  1. 转到运行 -->运行配置..

  2. 添加新的 Maven 构建

  3. 命名进程,选择将部署为 war 的基目录

  4. 设定目标 --> jboss:start

按照以下步骤,您可以通过 Eclipse 部署所有内容。

玩得开心。 :)

Assumption

I am assuming that you have already installed the plugins for Maven for eclipse.

Installation

While selecting the project in project explorer select
Run --> Run As --> Maven Install

Running Jboss

  1. Go to Run --> Run Configurations..

  2. Add new Maven Build

  3. Name the Process, Select the Base directory that will be deployed as war

  4. set the Goal --> jboss:start

By following the steps you can deploy every thing via Eclipse.

Have fun. :)

如何从Eclipse将Maven项目的WAR部署到JBoss服务器?

灯角 2024-11-11 17:04:56

更好的方法是用 Node 对象封装树结构,该对象可以保存一个值和一个子节点列表:

class Node(object):
    def __init__(self, children=[], value=None):
        self.children = children
        self.value = value
    def isLeaf(self):
        return len(self.children) == 0

现在,节点明确是具有值的叶节点或具有子节点的元素(从技术上讲,非叶节点也可以具有值,但您的应用程序代码可以选择强制非叶节点永远不具有值)。 parseTree 可以写成:

def parseTree(node):
    if node.isLeaf():
        treatLeafNode(node)
    else:
        for child in node.children:
            parseTree(child)

请注意,这是对树的深度优先搜索。

可能有更好的方法来包装它,使 parseTree 成为 Node 的方法,但这应该给您一个想法。当然,您仍然遇到一个问题,您要求用户编写Python代码,该代码是列表的列表作为输入,并将其解析为上面的树结构,您需要使用isinstance 。也许 yaml 是描述语言的更好选择,因为用户无法将任意 Python 代码注入到您的输入中?

What might work better is encapsulating your tree structure with a Node object which can hold a value and a list of children:

class Node(object):
    def __init__(self, children=[], value=None):
        self.children = children
        self.value = value
    def isLeaf(self):
        return len(self.children) == 0

Now a node is explicitly either a leaf with a value or an element with children (technically, non-leaf nodes can also have values in this example, but your application code can choose to enforce that non-leaf nodes never have values). parseTree can be written as:

def parseTree(node):
    if node.isLeaf():
        treatLeafNode(node)
    else:
        for child in node.children:
            parseTree(child)

Note that this is a depth-first search on the tree.

There may be nicer ways to wrap this up so that parseTree is a method of Node, but this should give you an idea. Of course you still have the problem that you're asking the user to write Python code which is lists of lists as the input, and to parse that into the above tree structure you'd need to use isinstance. Perhaps yaml would be a better choice of description language, as the users cannot then inject arbitrary Python code into your input?

不使用 isinstance() 的列表列表的递归

灯角 2024-11-11 15:57:51

现在是这样的:

Resque.remove_queue("...")

This is what works now:

Resque.remove_queue("...")

如何销毁由 resque 工作人员排队的工作?

灯角 2024-11-11 15:35:24

您需要的答案是 AJAX。我建议花一些时间在此处了解其工作原理。

AJAX 将允许您调用服务器上的远程页面并从中获取响应。该远程页面可以执行任何普通 php 脚本可以执行的任何操作,包括根据需要将信息保存到数据库。

The answer you need is AJAX. I recommend spending some time learning how it works here.

AJAX will allow you to call a remote page on the server and get responses from it. That remote page can do anything that any normal php script could do, including as you need, save info to the database.

javascript在后端调用php

更多

推荐作者

娇女薄笑

文章 0 评论 0

biaggi

文章 0 评论 0

xiaolangfanhua

文章 0 评论 0

rivulet

文章 0 评论 0

我三岁

文章 0 评论 0

薆情海

文章 0 评论 0

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