Nested Attribute Dictionaries
-
SKP files are for the most of it two-byte UTF-16 encoded. (Some old data blocks appear to be ASCII.) All though, the strings you get from the Ruby API is UTF-8 encoded.
-
So then is there a normal, and a backup dictionary in the file ?
-
@dan rathbun said:
So then is there a normal, and a backup dictionary in the file ?
Backup?
Not sure what you mean.
But when I have inspected .skp files I saw no duplicate of any attributes blocks - and the attributes data blocks where in UTF-16.
-
@brewsky said:
` i = 0;
s = ""while i < 100000 do
s = s + "a"
i +=1;
end`it's easier in Ruby to do:
s = 'a' * 100000
-
-
@thomthom said:
Backup? Not sure what you mean.
Yes I meant duplicate internal backups, like how a floppy disk has a backup of the master boot record, that can be restored if the primary gets corrupted. (Not that many are using floppies these days, but it's an example.)
-
@dan rathbun said:
it's easier in Ruby to do:
s = 'a' * 100000
Ruby continues to amaze me, it 'reads' so logical!
Still much to learn... -
@thomthom said:
But when I have inspected .skp files I saw no duplicate of any attributes blocks - and the attributes data blocks where in UTF-16.
I wonder if we could use
Zlibto compress data before writing it to dictionaries ??Unzipping it on a read ?
-
Another neat usage of * is for joining arrays:
[1,2,3,4,5] * ' - '
Returns:
"1 - 2 - 3 - 4 - 5" -
@dan rathbun said:
@thomthom said:
But when I have inspected .skp files I saw no duplicate of any attributes blocks - and the attributes data blocks where in UTF-16.
I wonder if we could use
Zlibto compress data before writing it to dictionaries ??I'd love to be able to use zipping in my projects. Think I looked at it some time ago and people had tried to find ways to make it work properyl within SketchUp ruby with mixed results..
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement