走过海棠暮

文章 0 评论 0 浏览 24

走过海棠暮 2024-11-24 14:52:12

http://research.microsoft.com/en-us/um/ cambridge/projects/infernet/

这并不完全是您所要求的,但您可以为贝叶斯分层模型生成推理模型。这样您就可以设置许多机器学习任务。

http://research.microsoft.com/en-us/um/cambridge/projects/infernet/

This is Not completely what you have asked for but you can generate inference models for baysian hierarchical models. With this you can setup many machine learning task.

Apache Mahout 的 .net 模拟机器学习库

走过海棠暮 2024-11-24 08:36:58

确保用户帐户(网络服务器运行的帐户)有权读取该目录。

Make sure that the user-account -- that the webserver runs as -- has permission to read that directory.

通过apache的文件列表问题

走过海棠暮 2024-11-24 06:33:43

我非常不同意,完全一致性是无数 CSS 和 Javascript hack 的立场。

我希望有一种方法可以让人们和企业了解 Internet Explorer 是什么样的垃圾。

仅仅因为很容易在 IE 中添加生成圆角的 hack 并不意味着它是一个好主意。如果没有降级的体验,人们有什么动力去升级他们的浏览器呢?

I disagree very strongly, complete consistency is a stance of myriad CSS and Javascript hacks.

I wish there was a way to make people and businesses see what kind of trash Internet Explorer is.

Just because it is easy to throw in a hack that generates rounded corners in IE doesn't make it a good idea. Without a degraded experience, what sort of incentive is there for people to upgrade their browser, like they should?

网站在不同浏览器中看起来不同?为什么人们不关心?

走过海棠暮 2024-11-24 04:48:27
# f is a file object
# n1 is how many lines to read
lines = [f.readline() for i in range(n1)]
# f is a file object
# n1 is how many lines to read
lines = [f.readline() for i in range(n1)]

Python如何在匹配后抓取一定数量的行

走过海棠暮 2024-11-24 02:10:23

(?<=,)(\d+),(\d{5})

$matches[1] 具有值,而 $matches[ 2] 有你的钥匙。

(?<=,)(\d+),(\d{5})

The $matches[1] has the value and the $matches[2] has your key.

CSV 解析 +多维数组

走过海棠暮 2024-11-24 02:03:50

当我想在那里设置断点时,我有时会这样做(暂时在开发过程中)。

I sometimes do this (temporarily, during development) when I want to set a break-point there.

Java - 扩展类并重用方法?

走过海棠暮 2024-11-23 23:43:40

第一:使用 spl_autoload_register() 而不是 __autoload()

当您尝试访问不存在的类时,会调用自动加载器。使用 include() 您只需包含一个类。主要区别在于,使用自动加载器仅在确实需要/使用该类时才包含该类。

通常,您在一个文件中定义一个自动加载器,并在每个请求中包含该自动加载器。如果您使用引导(意思是:单个文件,捕获每个请求并将其重定向到适当的目标),则只需要在那里定义自动加载器。所以不需要在每个文件中定义它。

First: Use spl_autoload_register() instead of __autoload().

The autoloader is called, when you try to access a class, that doesn't exists. With include() you just include a class. The main difference is, that using an autoloader the class is only included, if its really required/used.

Usually you define an autoloader in one file and include this one on every request. If you use bootstrapping (meaning: a single file, that catches every request and redirects it to the appropriate target) its only required to define the autoloader there. So its its not required to define it in every file.

__autoload 与 include 系列

走过海棠暮 2024-11-23 21:16:41

Joschua Bloch 引入了一种异构集合,可以用 Java 编写。我曾经稍微采用过它。它现在用作值寄存器。它基本上是两个地图的包装。这是代码,这是如何使用它。但这仅供参考,因为您对 Scala 解决方案感兴趣。

在 Scala 中,我会从使用元组开始。元组是一种异构集合。结果可以但不一定通过 _1、_2、_3 等字段访问。但你不想要那个,你想要名字。这就是为它们分配名称的方法:

scala> val tuple = (1, "word")
tuple: ([Int], [String]) = (1, word)

scala> val (a, b) = tuple
a: Int = 1
b: String = word

因此,正如前面提到的,我将尝试围绕元组构建一个 ResultSetWrapper

Joschua Bloch has introduced a heterogeneous collection, which can be written in Java. I once adopted it a little. It now works as a value register. It is basically a wrapper around two maps. Here is the code and this is how you can use it. But this is just FYI, since you are interested in a Scala solution.

In Scala I would start by playing with Tuples. Tuples are kinda heterogeneous collections. The results can be, but not have to be accessed through fields like _1, _2, _3 and so on. But you don't want that, you want names. This is how you can assign names to those:

scala> val tuple = (1, "word")
tuple: ([Int], [String]) = (1, word)

scala> val (a, b) = tuple
a: Int = 1
b: String = word

So as mentioned before I would try to build a ResultSetWrapper around tuples.

scala:类似地图的结构,在获取值时不需要转换?

走过海棠暮 2024-11-23 18:29:27

您在 RowStyle 中进行绑定有什么特殊原因吗?我总是将 SelectedItem 直接绑定到 ViewModel 中的 SelectedEntity 属性。

Is there a particular reason you're binding in the RowStyle? I've always bound my SelectedItem directly to my SelectedEntity property in my ViewModel.

Datagrid.IsSelected 绑定和滚动

走过海棠暮 2024-11-23 15:43:56

或者您可能想要组合 headtail 来从中间获取条目:

示例数据:

banana
cherry
apple
orange
plum
strawberry
redcurrant

现在让我们跳过 2 个条目并获取以下 2 个条目:

cat fruit.txt | head -n 4 | tail -n 2

这将为您提供:

apple
orange

因此 head -n 4 将返回前 4 个条目(bananaorange)和后面的 tail -n 2 将得到最后 2 个之前的结果苹果橙色)并且不在原始文件中。

Or you might want to combine head and tail to fetch entries out of the middle:

Example data:

banana
cherry
apple
orange
plum
strawberry
redcurrant

Now let's skip 2 entries and fetch the following 2 ones:

cat fruit.txt | head -n 4 | tail -n 2

That will give you:

apple
orange

So head -n 4 will return the first 4 entries (banana to orange) and the following tail -n 2 will get the last 2 ones out of that previous result (apple to orange) and not out of the original file.

ls 或 dir - 限制文件名返回的数量

走过海棠暮 2024-11-23 15:34:21

看来您需要设置 MIDLet 权限。

请注意,您可能可以在模拟器上使用此功能,但至少需要签名代码才能在真实设备上使用。

Looks like you need to set the MIDLet Permissions.

Note you might get this working on the simulator but you will need signed code at least to get working on a real device.

j2me fileconnection java.io.IOException:根无法访问

走过海棠暮 2024-11-23 12:23:09

您可以通过两种方式执行此操作:在服务器端(在您的情况下使用 PHP)或使用 JavaScript SDK 在客户端。

两者都假设您拥有所需的访问凭据。您需要注册一个应用程序帐户才能在 Facebook 开发者网站

服务器端

获取这些内容第一步是让您的应用程序参与 OAuth 身份验证过程。 Facebook 指南 中有关于 PHP 的详细记录(请参阅服务器端流程部分) 。

完成此操作后,您将获得一个访问令牌,您可以使用它调用 Graph API。获取用户照片的端点是https://graph.facebook.com/me/photos?access_token=。在这种情况下,me 始终是登录并为您的应用程序提供令牌的用户。

在 PHP 中,假设您已将访问令牌存储在 $SESSION['token'] 中,您可以使用以下方式发出照片负载请求:

$url = "https://graph.facebook.com/me/photos?access_token=" . $SESSION['token'];
$photos = json_decode(file_get_contents($url));

$photos 对象将是Facebook 文档<中描述的Photo实体列表/a>.

客户端

您需要在网页上设置 JavaScript SDK,如此处。

客户端的身份验证由 JavaScript SDK 处理,再次记录在身份验证指南中。

使用 SDK,您可以对 Graph API 进行客户端 JavaScript 调用以获取相同的照片结构:

FB.api('/me/photos', function(response) {
    if(!response || response.error) {
        // render error
    } else {
        // render photos
    }
});

You can do this two ways: on the server-side (in PHP in your case) or on the client-side with the JavaScript SDK.

Both assume you have the required access credentials. You need to sign up for an application account to get these at the Facebook Developer site

Server-Side

First-step is to get your application to participate in the OAuth authentication process. This is well-documented for PHP in the Facebook guide (see the Server-Side Flow section).

Once you've done that, you'll have an access token that you can call into the Graph API with. The endpoint to get the user's photos is https://graph.facebook.com/me/photos?access_token=<token>. In this case the me, is always the user who signed in to give your application the token.

In PHP, assuming you've stored the access token in $SESSION['token'] you can make a request for the photos payload with:

$url = "https://graph.facebook.com/me/photos?access_token=" . $SESSION['token'];
$photos = json_decode(file_get_contents($url));

The $photos object will be a list of Photo entities that are described in the Facebook docs.

Client-Side

You'll need to setup the JavaScript SDK on your web pages as documented here.

Authentication on the client-side is handled by JavaScript SDK, again documented in the authentication guide.

Using the SDK, you can make a client-side JavaScript call to the Graph API for the same photos structure:

FB.api('/me/photos', function(response) {
    if(!response || response.error) {
        // render error
    } else {
        // render photos
    }
});

如何使用 php 将照片从 facebook 导入到网站中?

走过海棠暮 2024-11-23 06:57:27

也许这不是最好的答案,但这就是我要做的:

  • 尝试安装该插件(即使它适用于 Rails 2.0.x)

  • 测试并修复代码直到得到结果

查看代码,结果发现核心文件是:

https://github.com/penso/actionmailer_x509/blob/master/lib/actionmailer_x509 .rb

公开了邮件程序 DSL 的一堆方法:

  • x509_sign true # 或 false
  • x509_cert “path/to/cert”
  • x509_key “path/to/key”
  • x509_passphrase “passphrase”

这样您就可以获取该文件,并将其放在 $APP/lib 下,然后编写一些测试来检查它是否正常工作。

一个。

perhaps it's not the best answer, however here's what I'd do:

  • try to install that plugin (even if it's for rails 2.0.x)

  • tests and fix code until I get the result

looking at the code, turns out that the core file is:

https://github.com/penso/actionmailer_x509/blob/master/lib/actionmailer_x509.rb

which exposes a bunch of methods for mailer DSL:

  • x509_sign true # or false
  • x509_cert "path/to/cert"
  • x509_key "path/to/key"
  • x509_passphrase "passphrase"

so you could grab that file, and put it under $APP/lib, then write some test to check it's working.

A.

如何在 Rails 3 中从 ActionMailer 发送签名电子邮件?

走过海棠暮 2024-11-23 04:28:57

阿诺是对的。
为此,您必须使用 ajax。你不能简单地在 php 中使用 javascript 变量。
在 JavaScript 验证中使用 ajax,如果数据库中已存在用户名,则会抛出警告消息。

作为参考,请查看此链接
http://www.9lessons.info/2008/12 /twitter-used-jquery-plug-in.html

http://web.enavu.com/tutorials/检查用户名可用性与 ajax-using-jquery/

Anon is right.
You have to use ajax for this purpose. You can't simply use your javascript variable in php.
Use ajax in your javascript validation and throw warning message if username already exist in your database.

For reference check out this link
http://www.9lessons.info/2008/12/twitter-used-jquery-plug-in.html
and
http://web.enavu.com/tutorials/checking-username-availability-with-ajax-using-jquery/

如何在提交之前根据 SQL 数据库检查输入值?

走过海棠暮 2024-11-23 03:19:41

我不知道黑莓 API,但你可以采取其他方法来解决你的问题。您可以进行离屏渲染。创建一个 BufferedImage,获取对其 Graphics 对象的引用,进行渲染,然后将 BufferedImage 保存为 png 格式。

例如:通过

int width = 200, height = 200;

// TYPE_INT_ARGB specifies the image format: 8-bit RGBA packed
// into integer pixels
BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);

Graphics2D ig2 = bi.createGraphics();

// Draw your chart

ImageIO.write(bi, "PNG", new File("yourImageName.PNG"));

这种方式,您可以一次完成所有绘图,将其保存为文件或仅保存在内存中(取决于您的需要),然后您只需要从文件加载图像或在中执行 g.drawImage()你的屏幕。

但正如我之前所说,我不知道这是否适用于 Blackberry API,它肯定适用于桌面中的 JDK/JRE。

I don't know the blackberry API but you could take other aproach to your problem. You could do offscreen rendering. Create a BufferedImage, get a reference to its Graphics object, do the rendering and then save the BufferedImage as a png for example.

For example:

int width = 200, height = 200;

// TYPE_INT_ARGB specifies the image format: 8-bit RGBA packed
// into integer pixels
BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);

Graphics2D ig2 = bi.createGraphics();

// Draw your chart

ImageIO.write(bi, "PNG", new File("yourImageName.PNG"));

This way you can do all your drawing once, saving it as a file or just in memory (depends on what you need) and then you just need either to load the image from the file or do g.drawImage() in your screen.

But as i said before i don't know if this applies to the Blackberry API it works for sure with the JDK/JRE in a desktop.

将图形保存为图像?

更多

推荐作者

浪漫人生路

文章 0 评论 0

620vip

文章 0 评论 0

羞稚

文章 0 评论 0

走过海棠暮

文章 0 评论 0

你好刘可爱

文章 0 评论 0

陌若浮生

文章 0 评论 0

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