yaml

Is YAML suitable for storing records in a key value store?

I need to store records in a key value store, and I have considered XML, JSON, or YAML, and pretty much decided on YAML. However, I am wondering how this will perform when searching through millions of records as alot of text processing is needed. Would it be better to use individual keys for differents columns or use YAML. For example,...

OpenCV: Reading a file into a CvMat structure

Using OpenCV, saving a CvMat structure into a YAML file on the disk is easy with CvMat* my_matrix = cvCreateMat( row_no, col_no, CV_32FC1 ); cvSave("filename.yml", my_matrix); However, I couldn't find an easy way to read the saved files back from the disk. Is there function in OpenCV that can handle this and create a CvMat structure...

Convert YAML to XML in Ruby?

Are there any scripts out there, or have any of you built a tool, to convert YAML to XML using Nokogiri? If not, any suggestions or samples? ...

PyYAML parse into arbitary object

I have the following Python 2.6 program and YAML definition (using PyYAML): import yaml x = yaml.load( """ product: name : 'Product X' sku : 123 features : - size : '10x30cm' weight : '10kg' """ ) print type(x) print x Which result...

Forum board example schema in YAML format - modify for Nested set?

I have created a forum board app, based on YAML schema found in 'real world examples' of Doctrine Manual, which looks similar to this: --- Forum_Category: columns: root_category_id: integer(10) parent_category_id: integer(10) name: string(50) description: string(99999) relations: Subcategory: class: Forum_C...

How is it that json serialization is so much faster than yaml serialization in python?

I have code that relies heavily on yaml for cross-language serialization and while working on speeding some stuff up I noticed that yaml was insanely slow compared to other serialization methods (e.g., pickle, json). So what really blows my mind is that json is so much faster that yaml when the output is nearly identical. >>> import ya...

ruby yaml ypath like xpath ?

Hi i have a yaml file like so --- data: - date: "2004-06-11" description: First description - date: "2008-01-12" description: Another descripion How can i do a "ypath" query similar to xpath for xml ? Something like "get the description where the date is 2004-06-11" YAML.parse_file('myfile.yml').select('/data/*/date == 2...

Why does yaml.dump add quotes this key-value pair

I'm trying to write a new entry to a rails database.yml and for some reason I'm getting quotes around this entry db_yml => {'new_env' => {'database' => 'database_name', '<<' => '*defaults' }} File.open("#{RAILS_ROOT}/config/database.yml", "a") {|f| YAML.dump(db_yml, f)} returns --- new_env: database: database_name "<<": "*defa...

Yaml::load_file acting different between development and production (Rails)

Hi, I am completely stumped at the nature of this problem. We export data from our application into a 'cleaned' YAML file (stripping out IDs, created_at etc). Then we (will) allow users to import these files back into the application - it is the import that is completely bugging me out. In development, YAML::load_file(params[:uploaded...

How to create a custom yaml config file in Symfony

What I want to do is quite simple: store data in a custom config file that I want to read later on. I created my file something.yml that I put in the global config directory. It looks like that: prod: test: ok dev: test: ko all: foo: bar john: doe Then I copied the config_handlers.yml and also put it in the config directo...

YAML in TextMate, color coding wrong?

Im using TextMate to create a YAML document, but the keys and the values have all the same color (brown). Would be more intuitive to have keys and values rendered in different colors, like HTML, CSS, etc Am I missing something? Thanks ...

CSS Frameworks like 960 and Blueprint?

This is at the framework level, not dealing directly with CSS, so posting to SO. I just learned about the existence of CSS frameworks. 960 Grid System seems pretty awesome, then I found Blueprint, which seems to do the same thing and more. Is there a better word than "framework" to categorize this? Are there any other products in this...

Symfony: how would you reverse the "notnull:true" in a schema of a plugin?

Hi, sfGuardUser model of sfDoctrineGuardPlugin is defined this way: sfGuardUser: actAs: [Timestampable] columns: id: type: integer(4) primary: true autoincrement: true username: type: string(128) notnull: true unique: true As you can see 'username' has the feature "notnull:true". Now i ...

Spring to understand properties in YAML

Did Spring abandon YAML to use as an alternative to .properties / .xml because of: [Spring Developer]: ...YAML was considered, but we thought that counting whitespace significant was a support nightmare in the making... [reference from spring forum] I am confident YAML makes a lot of sense for properties, and I am using it currentl...

symfony doctrine build-sql error

I have some big problems with symfony and doctrine at the beginning of a new project. I have created database diagram with mysql workbench, inserted the sql into phpmyadmin and then I've tried symfony doctrine:build-schema to generate the YAML schema. It generates a wrong schema (relations don't have on delete/on update) and after this I...

What does upload in Google AppEngine app.yaml do?

I am going through the various Google AppEngine tutorials sometimes, and I just noticed something odd in a StackOverflow question about favicon.ico - specifically this question: http://stackoverflow.com/questions/887328/favicon-ico-not-found-error-in-app-engine - url: /favicon.ico static_files: media/img/favicon.ico upload: media...

Ruby: How do I define a datetime field in YAML?

I'm creating test data for a Rails app. How do I define the value for a datetime field in YAML? ...

output folded block of text in yaml using ruby

when I do message.to_yaml I am getting the following output mainText: "<h3 class=\"right_column\">Mark</h3> ... " but I want the output in the following format mainText: | <h3 class="right_column">Mark</h3> ... How do you force ruby to use pipe to fold multiple lines of string. I tried message.to_yaml(:UseFold => tru...

Is there a way to easily serialize form input into xml or yaml for database storage?

I am dealing with an old app in asp classic vbscript. I'd like to store the input of a form in a database text field as the form fields are a subject to frequent change and I don't feel like normalizing the old database. Any solutions for serialization in vbscript? Thank you! ...

One-liner to Convert Nested Hashes into dot-separated Strings in Ruby?

What's the simplest method to convert YAML to dot-separated strings in Ruby? So this: root: child_a: Hello child_b: nested_child_a: Nesting nested_child_b: Nesting Again child_c: K To this: { "ROOT.CHILD_A" => "Hello", "ROOT.CHILD_B.NESTED_CHILD_A" => "Nesting", "ROOT.CHILD_B.NESTED_CHILD_B" => "Nesting Again", ...