有人可以推荐这个ironpython bug的解决方法吗?
我有一个包含在外部类库中的类.我在嵌入式ironpython实例中使用了这个类.当我的c#app从范围中检索到类时,这些类似乎不匹配!
我的python脚本:
import sys
import clr
from ExternalAssembly import *
from IronPythonBug import *
internalClass = InternalClass("internal")
externalClass = ExternalClass("external")
Run Code Online (Sandbox Code Playgroud)
我的c#app:
internalClass = scope.GetVariable("internalClass");
externalClass = scope.GetVariable("externalClass");
if (internalClass is InternalClass)
Console.WriteLine("IternalClass matches");
else
Console.WriteLine("Error: InternalClass does not match");
if (externalClass is ExternalClass)
Console.WriteLine("ExternalClass matches");
else
Console.WriteLine("Error: ExternalClass does not match");
Run Code Online (Sandbox Code Playgroud)
控制台输出:
IternalClass matches
Error: ExternalClass does not match
Run Code Online (Sandbox Code Playgroud)
随意下载一个说明此错误的项目:http: //www.virtual-chaos.net/zip/IronPythonBug.zip
我想我在这里缺少一些简单的东西.我正在使用Boost的shared_ptr.
shared_ptr<Foo> pA(new Foo());
shared_ptr<Foo> pB(new Foo());
Run Code Online (Sandbox Code Playgroud)
现在,我想切换pB所以它包含的内容pA,减少引用的计数pB.我怎样才能做到这一点?
我遇到一个特定查询的问题.它需要在事务中运行,并且确实如此,但每当app引擎执行我的查询时,我都会收到以下错误:
在事务内只允许祖先查询
你会看到我的查询有一个祖先.那么app引擎真正抱怨的是什么?
q = db.Query(EventBase)
q.ancestor = db.Key.from_path(aggrRootKind, aggrRootKeyName)
q.filter('undone =','False')
q.order('-version')
qResult = q.fetch(1, 0)
Run Code Online (Sandbox Code Playgroud) 好的我是数据库设计的新手,请给我建议.
我不知道索引做了什么,但我知道我们应该把它放在像WHERE Verified = 1那样重载,并在搜索中像company.name = something.我对吗 ?
它够了吗?
3 数据库规范化
它恰到好处吗?
alt text http://i28.tinypic.com/awp2cz.png
谢谢.
编辑*
规则.
- 每个用户(公司成员或所有者)可以是公司的成员
- 每个公司都有一些用户.
- 有公司管理员(首席执行官,管理员),有公司成员(插入产品)
- 每个公司都可以有产品.
对于数字3,我将在users_company中添加一点 - 1表示admin - 0表示成员
我是java的新手.我试图从数据库中获取一些数据,结果集显示在excel中.我能够与数据库合作.但是我应该如何继续将数据插入excel表.它是简单的Java程序,将来我想生成其他格式的文件,例如PDF,doc等.我正在寻找一种CPU负载较小的方法,速度更快.
在此先感谢您的帮助.
该死的,我总是对CSS感到沮丧.我一直在阅读书籍和文章/ tuturials,但CSS是一个PITA!
我有以下代码:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Testing CSS</title>
<style type="text/css">
<!--
body {
background: #dddddd;
font: 12px "Trebuchet MS", Helvetica, sans-serif;
color: #000;
}
.box {
background: #FFF;
width: 500px;
border: 1px solid #999999;
-moz-border-radius: 5px;
}
.box .content {
background: #FFF;
padding: 15px;
-moz-border-radius: 5px;
}
.message {
border: 1px solid #bbbbbb;
padding: 10px;
margin: 0px 0px 15px;
background-color: #DDDDDD;
color: #333333;
-moz-border-radius: 5px;
}
.message.info {
border-color: #9FD1F5;
background-color: #C3E6FF;
color: #005898; …Run Code Online (Sandbox Code Playgroud) 我正试图从相机实时显示UIImage,看来我的UIImageView没有正确显示图像.这是AVCaptureVideoDataOutputSampleBufferDelegate必须实现的方法
- (void)captureOutput:(AVCaptureOutput *)captureOutput
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection
{
// Create a UIImage from the sample buffer data
UIImage *theImage = [self imageFromSampleBuffer:sampleBuffer];
// NSLog(@"Got an image! %f %f", theImage.size.width, theImage.size.height);
// NSLog(@"The image view is %@", imageView);
// UIImage *theImage = [[UIImage alloc] initWithData:[NSData
// dataWithContentsOfURL:[NSURL
// URLWithString:@"http://farm4.static.flickr.com/3092/2915896504_a88b69c9de.jpg"]]];
[self.session stopRunning];
[imageView setImage: theImage];
}
Run Code Online (Sandbox Code Playgroud)
为了解决容易出错的问题:
setImage:theImage到imageView,则图像被正确加载(并且第二次调用NSLog报告非零对象).imageFromSampleBuffer:很好,因为NSLog报告的大小为360x480,这是我预期的大小.我正在使用的代码是最近发布的AVFoundation苹果公司提供片段在这里.
特别是,这是我用来设置AVCaptureSession对象和朋友的代码(我很少理解),并从Core Video缓冲区创建UIImage对象(这就是imageFromSampleBuffer方法).
最后,我可以让应用程序崩溃,如果我尝试发送drawInRect:到一个普通的UIView子类与UIImage …
在matplotlib中,我可以使用pyplot.xscale()或设置轴缩放Axes.set_xscale().这两个函数都接受三种不同的尺度:'linear'| 'log'| 'symlog'.
'log'和之间有什么区别'symlog'?在我做过的简单测试中,它们看起来完全相同.
我知道文档说它们接受不同的参数,但我仍然不明白它们之间的区别.有人可以解释一下吗?如果它有一些示例代码和图形,答案将是最好的!(另外:'symlog'这个名字来自哪里?)
在服务器上区分来自iPhone的请求是通过网络浏览器与通过iphone与用目标c编写的应用程序之间的最佳方法是什么?我在用户代理字符串中寻找什么差异?
如何发现最终用户的系统性能设置(视觉效果等)?我想让我的WPF应用程序与这些设置兼容.
是否有任何标准例程可以执行此操作,还是只需读取sysinfo?
c# ×2
iphone ×2
python ×2
avfoundation ×1
boost ×1
c++ ×1
css ×1
excel ×1
frameworks ×1
http ×1
ios4 ×1
ironpython ×1
java ×1
logarithm ×1
matplotlib ×1
mysql ×1
overflow ×1
performance ×1
pointers ×1
pydev ×1
scale ×1
shared-ptr ×1
sysinfo ×1
uiimage ×1
uiimageview ×1
user-agent ×1
wpf ×1