草庐IT

yaml-cpp

全部标签

ruby-on-rails - 为什么 yaml 在生产中不可用?

在我的OSX开发系统上:$ruby--versionruby1.8.6(2007-03-13patchlevel0)[universal-darwin8.0]$script/consoleLoadingdevelopmentenvironment(Rails2.3.4)>>require'yaml'=>[]在CentOS5.3生产系统上:$script/consoleproductionLoadingproductionenvironment(Rails2.3.4)/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/act

ruby-on-rails - 如何防止 yaml 中的字符串转换为时间

我有一个包含一些时间的yaml文件:hours:-00:00:00-00:30:00-01:00:00但是,一旦我阅读它们,它们就会转换为时间(以秒为单位),但我希望它们暂时保留为字符串,以便我可以进行转换。以下是我阅读它们的方式:defdaily_hoursDefaultsConfig.hours.collect{|hour|logger.info{hour.to_s}}end它正在输出:018003600但我希望字符串保持不变,以便我可以将它们转换为时间,例如:12:00am12:30am1:00am为什么它们会自动转换,我该如何停止?这是DefaultConfig类:classD

ruby-on-rails - 如何在 YAML 文件中使用变量?

我有一个YAML文件需要一个变量作为输入:outputters:-type:DateFileOutputtername:logfilelevel:DEBUGdate_pattern:'%Y%m%d'trunc:'false'dirname:"/home/sameera/workspace/project/log"filename:"message.log"formatter:date_pattern:'%m/%d/%Y%H:%M:%S'pattern:'%d%l-%m'type:PatternFormatter我想将dirname作为参数传递,例如:dirname:""我的LOGFIL

ruby - Psych YAML 解析包括注释

根据http://yaml.org/spec/current.html#id2509980YAML文件中的注释是表示细节,不得出现在序列化/表示图中(http://yaml.org/spec/current.html#representation/)。看起来Psych正在根据规范进行解析并丢失注释,这意味着当文件包含注释时,不可能解析YAML文件并以完全相同的方式再次序列化它。在我看来这很奇怪,因为注释在此类文件中确实很重要(例如配置)。有谁知道是否可以使用现有库来解析评论,或者这是我自己完成所有操作的唯一方法吗? 最佳答案 我们也

xml - 使用 Ruby 和 Hpricot 将 xml 转换为 yaml - 这里出了什么问题?

我正在尝试将xml文件blog.xml输出为yaml,以便放入vision.app,这是一种用于在本地设计shopify电子商务网站的工具。Shopify的yaml如下所示:-id:2handle:bigcheese-blogtitle:Bigcheeseblogurl:/blogs/bigcheese-blogarticles:-id:1title:'Onethingyouprobablydidnotknowyet...'author:Justincontent:Loremipsumdolorsitamet,consecteturadipisicingelit,seddoeiusmo

java - 任何基于 YAML 的 Java fixture 加载器?

关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。关闭5年前。Improvethisquestion我用过DbUnit但是在玩了PlayFramework之后最近我发现它是Fixtures.load(StringyamlFilename)真的很有用。有人知道可用于任何Java项目的类似工具吗?

header 或 .cpp 中类变量的 C++ 声明?

到目前为止,我一直按以下方式使用类:GameEngine.h声明类如下classGameEngine{public://Declarationofconstructorandpublicmethodsprivate:InputManagerinputManager;inta,b,c;//Declarationofprivatemethods};我的GameEngine.cpp文件然后只实现这些方法#include"____.h"GameEngine::GameEngine(){}voidGameEngine::run(){//stuff}但是,我最近读到变量声明不应该在头文件中。在上面

c++ - Visual Studio 2010 Arduino cpp 错误 : argument of type "char *" is incompatible with parameter of type "LPCWSTR"

我正在尝试设置一个arduinouno用于与visualstudio2010中的C++程序进行串行端口通信。我正在使用此处找到的代码:http://playground.arduino.cc/Interfacing/CPPWindows不幸的是,.cpp文件在第9行为变量“portName”提供了以下消息:错误:“char*”类型的参数与“LPCWSTR”类型的参数不兼容我不明白这个错误消息,并尝试了一些不同的方法来修复它。任何帮助将不胜感激! 最佳答案 鉴于您问题中的代码链接,问题似乎出在这里:Serial::Serial(cha

c++ - cpp cout中的单引号

关闭。这个问题是notreproducibleorwascausedbytypos.它目前不接受答案。这个问题是由于错别字或无法再重现的问题引起的。虽然类似的问题可能是on-topic在这里,这个问题的解决方式不太可能帮助future的读者。关闭4年前。Improvethisquestion摘自《Programming:PrinciplesandPracticesusingC++》第72–73页:Wesawthatwecouldn’tdirectlyaddcharsorcompareadoubletoanint.However,C++providesanindirectwaytodob

在 header 中定义并在 cpp 中实现的 C++ 结构

当你在另一个类中使用它时,我如何确保我实现的somecolor保持他的值(value)?结构.hstructColor{unsignedcharr;unsignedcharg;unsignedcharb;};ColorsomeColor;//ifidefinethecolorhereitsays...:ColorsomeColor={255,255,255};//error:datamemberinializernotallowed结构.cppstruct::ColorsomeColor={255,255,255};someotherclass.cppstruct*str=newstr