Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > packing large array of mixed native types

Reply
Thread Tools

packing large array of mixed native types

 
 
keithroe@gmail.com
Guest
Posts: n/a
 
      01-26-2011

I have an array in the form [ uchar, float, float, float, uchar,
float, float, float, .... ]
I know I can pack it like this:
my_array.pack( "CFFFCFFFCFFF...." )
but then I have to create a string with as many elements as the array
I am packing,
which can be quite large. Is there a way to abbreviate this string
(eg, somethign like
my_array.pack( '(CFFF)*' ) ?

Thanks
 
Reply With Quote
 
 
 
 
Waldemar Dick
Guest
Posts: n/a
 
      01-26-2011
Hi,

Am 26.01.2011 21:10, schrieb http://www.velocityreviews.com/forums/(E-Mail Removed):
> I have an array in the form [ uchar, float, float, float, uchar,
> float, float, float, .... ]
> I know I can pack it like this:
> my_array.pack( "CFFFCFFFCFFF...." )
> but then I have to create a string with as many elements as the array
> I am packing,
> which can be quite large. Is there a way to abbreviate this string
> (eg, somethign like
> my_array.pack( '(CFFF)*' ) ?


Why don't you read 4 elements at a time, pack them and write them in an
output buffer in a loop?

Just a thought.

Greetings

Waldemar


 
Reply With Quote
 
 
 
 
keithroe@gmail.com
Guest
Posts: n/a
 
      01-26-2011

I will try this. thanks


>
> Why don't you read 4 elements at a time, pack them and write them in an
> output buffer in a loop?
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Types longer than native machine word Bilgehan.Balban@gmail.com C Programming 3 02-22-2006 05:11 PM
Native cross-compiling (-packing) with GUI Meillo r e t u r n s Ruby 3 12-24-2005 03:48 PM
Mixed types and variants bearophileHUGS@lycos.com Python 2 11-24-2005 04:56 AM
Need to call mixed-mode dll from native code. Mike Kamzyuk C++ 1 04-26-2005 01:35 PM
[Urgent] Is there a size limit on returning a large dataset or a large typed array from web service? Ketchup ASP .Net Web Services 1 05-25-2004 10:11 AM



Advertisments