我正在使用scons实用程序生成共享库.当我写下面的规则时:
SharedLibrary('hello','hello.c')
我会得到``libhello.so''文件.
有没有办法自动获取像``libhello.so.version'这样的文件?
更新:MongoDB的后续操作获取集合中所有键的名称.
正如Kristina所指出的,可以使用Mongodb的map/reduce来列出集合中的键:
db.things.insert( { type : ['dog', 'cat'] } );
db.things.insert( { egg : ['cat'] } );
db.things.insert( { type : [] });
db.things.insert( { hello : [] } );
mr = db.runCommand({"mapreduce" : "things",
"map" : function() {
for (var key in this) { emit(key, null); }
},
"reduce" : function(key, stuff) {
return null;
}})
db[mr.result].distinct("_id")
//output: [ "_id", "egg", "hello", "type" ]
Run Code Online (Sandbox Code Playgroud)
只要我们想要只获得位于第一级深度的键,这就可以了.但是,它将无法检索位于更深层次的密钥.如果我们添加一条新记录:
db.things.insert({foo: {bar: {baaar: true}}})
Run Code Online (Sandbox Code Playgroud)
我们再次运行上面的map-reduce + distinct片段,我们将得到:
[ …Run Code Online (Sandbox Code Playgroud) 我有查询,我正在运行solr索引,有时有很长的查询参数,我运行这些查询时出错,我认为这是对GET查询参数的限制.
这是我用来查询的方法(JSON),这是为了表明我正在使用Http Extensions(我使用的客户端是HttpClient的瘦包装器)而不是端到端解决方案.90%的查询运行正常,只是当参数很大时我从solr得到500错误.我在某处读过你在执行select命令时可以使用POSt的但是没有找到如何做的例子.任何帮助都会很棒!
public string GetJson(HttpQueryString qs)
{
using (var client = new DAC.US.Web.XmlHttpServiceClient(this.Uri))
{
client.Client.DefaultHeaders.Authorization = new Microsoft.Http.Headers.Credential("Basic", DAC.US.Encryption.Hash.WebServiceCredintials);
qs.Add("wt", "json");
if (!String.IsNullOrEmpty(this.Version))
qs.Add("version", this.Version);
using (var response = client.Get(new Uri(@"select/", UriKind.Relative), qs))
{
return response.Content.ReadAsString();
}
}
}
Run Code Online (Sandbox Code Playgroud) 我正在从gmail导入联系人到我的页面.....
由于此错误,该过程不起作用
'curl_init'没有定义
我得到的建议是
ssleay32.dll和libeay32.dll在尝试了所有这些之后,我刷新了我的xampp,但即使这样也会发生错误.
这是我尝试导入gmail联系人的页面:
<?php
resource curl_init ([ string $url = NULL ] )
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
?>
<?php
echo "hi";
if($_POST['submit'] != '') {
echo "hi";
$clientlogin_url = "https://www.google.com/accounts/ClientLogin";
$clientlogin_post = array(
"accountType" => "HOSTED_OR_GOOGLE",
"Email" => $_POST['Email'],
echo "Passwd" => $_POST['Passwd'],
"service" => "cp",
"source" => "tutsmore/1.2"
);
$curl = curl_init($clientlogin_url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $clientlogin_post);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($curl, …Run Code Online (Sandbox Code Playgroud) 我目前正在尝试以编程方式创建一个简单的cocoa NSWindow,而不是使用Interface builder(我有理由这样做).这是一个快速测试:
int main(int argc, char** argv){
NSWindow *mainwin;
CocoaGLView *mainview;
NSRect scr_frame;
unsigned int style_mask;
NSAutoreleasePool *pool =[[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
scr_frame= NSMakeRect(100, 100, 400, 400);
style_mask=NSClosableWindowMask|NSMiniaturizableWindowMask|
NSResizableWindowMask|NSTitledWindowMask;
scr_frame=[NSWindow contentRectForFrameRect:scr_frame
styleMask:style_mask];
mainwin=[[NSWindow alloc]
initWithContentRect:scr_frame
styleMask:style_mask
backing:NSBackingStoreBuffered
defer:NO];
[mainwin makeKeyAndOrderFront:nil];
[mainwin setTitle:@"Visible screen window"];
mainview=[[CocoaGLView alloc] initWithFrame:scr_frame];
[mainwin setContentView:mainview];
[mainview display];
[mainwin setReleasedWhenClosed:YES];
[pool drain];
[NSApp run];
return 0;
}
Run Code Online (Sandbox Code Playgroud)
CocoaGLView派生自NSOpenGLView,如下所示:
@interface CocoaGLView : NSOpenGLView {
//some stuff
}
- (id) initWithFrame: (NSRect) frameRect;
- (void)setFrameSize:(NSSize) aSize;
- …Run Code Online (Sandbox Code Playgroud) 如何将转换NSDate为Unix时间戳?我读了很多相反的帖子.但我找不到任何与我的问题相关的内容.
我用Elmah.XmlFileErrorLog 尝试了这个解决方案但是我遇到了异常
System.ArgumentNullException was unhandled by user code
Message="Value cannot be null.\r\nParameter name: context"
Source="Elmah"
ParamName="context"
StackTrace:
at Elmah.ErrorSignal.FromContext(HttpContext context) in c:\builds\ELMAH\src\Elmah\ErrorSignal.cs:line 67
at Elmah.ErrorSignal.FromCurrentContext() in c:\builds\ELMAH\src\Elmah\ErrorSignal.cs:line 61
at ElmahHttpErrorHandler.ProvideFault(Exception error, MessageVersion version, Message& fault) in c:\Myapplication\App_Code\Util\ElmahHttpErrorHandler.cs:line 19
at System.ServiceModel.Dispatcher.ErrorBehavior.ProvideFault(Exception e, FaultConverter faultConverter, ErrorHandlerFaultInfo& faultInfo)
at System.ServiceModel.Dispatcher.ErrorBehavior.ProvideMessageFaultCore(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessageCleanup(MessageRpc& rpc)
InnerException:
Run Code Online (Sandbox Code Playgroud)
Web.Config文件
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, …Run Code Online (Sandbox Code Playgroud) 很多时候,在Windows 98时代之后,我们经历过一些对话框丢失了Z-Order并返回到之前的形式.
例如:
Dialog1.ShowModal;
Dialog1.OnClickButton() : ShowMessage('anything');
Run Code Online (Sandbox Code Playgroud)
当MessageBox出现时,它有时没有焦点,并在Dialog1下移动.用户对此感到困惑,他们说:我的申请冻结了!但是如果他们使用Alt + Tab移动到另一个应用程序并返回,焦点将返回到MessageBox,它将成为前景窗口.
我们通过ShowMessage,MessageBox,普通表单以及QuickReport表单体验过这一点.
有谁知道这个?这是一个Windows bug吗?你怎么能阻止它?怎么抓住这个?
谢谢你的帮助:dd
我真的说过,在Win98之后,所有操作系统(Win7也)都会受到这个问题的影响.我们使用Delphi 6 Prof,因此属性不能使用Default表单.
有人说使用MessageBox + MB_APPLMODAL可以控制消息对话框.这是个好消息,但我们有许多旧的表单和组件,第三方工具.
因此,通过替换表单来创建一个全新的应用程序是一项艰苦的工作.
但我们会尝试这样做.
我认为答案是这是半个应用程序问题和半个Windows问题.如果Windows有时会处理此问题,有时则不会 - 这似乎是一个Windows错误.但是,如果我们可以强制制作良好的模态窗口,那么它就是编程错误.
有人可以向我解释一下WS_POPUP标志的含义是什么?它有副作用吗?
谢谢:dd