Displaying 3 results from an estimated 3 matches for "header_key".
2010 Dec 20
1
Writing to a CSV with Faster::CSV
Is there a way to write a csv file using a hash instead of an array?
Something like this:
header_keys = :first_name, :last_name, :email
FasterCSV.open("path/to/file.csv", "w") do |csv|
User.all.do |user|
csv << user
end
end
Thanks...
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To p...
2008 Feb 01
2
[PATCH] skeleton.c
On 01/02/2008, Conrad Parker <conrad@metadecks.org> wrote:
> On 31/01/2008, ogg.k.ogg.k@googlemail.com <ogg.k.ogg.k@googlemail.com> wrote:
> > This fixes an off by one bug in the user of snprintf, and returns
> > negative if writing the
> > header returns negative (otherwise we'd just get a short write, losing
> > the error).
> > This patch
2008 Feb 12
4
[PATCH] skeleton.c
...> wrote:
> I've had a second look, and I believe there really was a bug there,
> though my patch may not be optimal.
>
> As an example of an off by one bug:
>
> On the first run through the code, message_header_fields will be NULL,
> so _ogg_calloc will be called. Assume header_key and header_value
> are both "X", so strlen of each is 1. message_size will then by 6, and a
> block of 6 bytes is callocated.
> Then snprintf is called with a byte limit of message_size+1 (7, one more
> than the allocated size), with the string "X: X\r\n", 6 characte...