|
Just call it "Boobies".
Everyone will like it
|
|
|
|
|
Super Lloyd wrote: what name to chose?
SerialKiller
Marc
|
|
|
|
|
I saw both in different time.
The former - too many arguments for every little things. People bother you too much.
The later - quiet and very busy.
I need to change my arguments by getting busy.
Tired!
|
|
|
|
|
As you might have heard... I am working (at home) on a new home made serializer.
I painfully wrote and debug quite an extensive test coverage ...
Then I looked at my work and thought: this just won't do! The type meta data is just too wasteful! I must do a complete rewrite!!!
It took me a whole week!
Not because of the number of lines of code (about one thousands) but because I fumbled in the dark for a while before I manage to find a way to do what I wanted....
It is now much more betterer (more compact, more performant)!
But.. well... all the tests are red now...
I guess more debugging is awaiting me...
[EDIT] [VICTORY] Fixed all the bugs....
Bonus feature, my new format is yet more compact (though strongly typed) and the serialization is now also faster than NewtonSoft.Json!
For fun here is a comparison of NewtonSoft.Json to my serializer with text output (support binary as well) for a list of 10 points:
NewtonSoft.Json
[{"x":0.98958661732710274,"y":0.72857453754571011},{"x":0.59292879821403366,"y":0.060559290023781027},{"x":0.28072819964994128,"y":0.69400526568945742},{"x":0.653773632204986,"y":0.0040844688211029712},{"x":0.35002548915800896,"y":0.14401983802394003},{"x":0.7088265291921918,"y":0.3565747599846566},{"x":0.82151659662905918,"y":0.32049972578906444},{"x":0.33498869106871482,"y":0.41123141274379166},{"x":0.65187721031339707,"y":0.77326123405865455},{"x":0.89198039560205322,"y":0.0075930333731663571}]
My Serializer (Thought I christened it, in honor of silly Javascript library names: TRex, the assembly name might either be Galador.Utils or Galador.Serializer)
1 7 8 805569025 9 806093313 10 "System.Collections.Generic.List`1" 0 2 11 "Capacity" 12 16777227 13 "Count" 12 14 17825792 0 1 15 553648129 16 "Galador.Core.Tests.SerializationTests+Point2D" 17 "Galador.Core.Tests" 2 18 "x" 19 16777232 20 "y" 19 16 10 10 0.98958661732710274 0.72857453754571011 0.59292879821403366 0.060559290023781027 0.28072819964994128 0.69400526568945742 0.653773632204986 0.0040844688211029712 0.35002548915800896 0.14401983802394003 0.7088265291921918 0.3565747599846566 0.82151659662905918 0.32049972578906444 0.33498869106871482 0.41123141274379166 0.65187721031339707 0.77326123405865455 0.89198039560205322 0.0075930333731663571
Well... I guess I just have to work on the CodeProject article now!
modified 1-Jul-16 13:22pm.
|
|
|
|
|
Sometimes it is only one "fat and tasty bug".
Good luck
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
|
On CP'ian has a comment/tag-line that basically says: just because it works doesn't make it good code. Apparently, that thought works both ways.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Haha!! just you wait!
|
|
|
|
|
Hey, I resemble that remark!
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
Adjust the tests and done
modified 19-Jan-21 21:04pm.
|
|
|
|
|
|
|
nice one!
|
|
|
|
|
Real developers don't test. Just push to production.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
|
It's all in your head.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
Good news.
I'd like to suggest you test your serializer against Mehdi Gholam's FastJSON serializers: [^], [^]
As well as the serializer by Christophe Bernard that I mentioned to you recently:[^].
And, may I suggest a few tests:
Dictionary<Class1Instance, Dictionary<Class2Instance, Class1Instance>> Tests using System.Dynamic and Expando.
TreeNodeCollection of a WinForm TreeView (I would be surprised if you nail this one, and I don't expect you to).
RTF Text from a WinForm RichTextBox.
Generic Observable Collection Class
cheers, Bill
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
Hi Bill,
Good of you to post that, I spot another bug in my library!
As a side note this meant to be a document serializer to save my document file easily and efficiently. I am not expecting to cover everything here!
For one thing my serializer explicitly DOES NOT support (just ignore) pointers, IntPtr, Delegates, and private field / properties (unless explicitly specified)
Anyhow it was worth trying some of your suggestions, so...
As to each suggested type:
- What about
FastJSON ?
I am not even trying (to be as fast), since I purposely avoided System.Emit, as it is NOT supported on UWP, .NET Core, Android, iOS - What about
Dictionary<Class1Instance, Dictionary<Class2Instance, Class1Instance>>
Pfff, peanuts! - What about
dynamic ?
You know what? While I have no clue I expected it to fail. However it currently fail on an unexpected bug, so still testing...
The dynamic was deserialized as a Missing (my build in result for when I can't restore the type) wit all the property there! - What about a WinForm form with RTF text and TreeNode collection?
Same here.. I am not too concerned by success, but I got an unexpected bug: Type.GetType("System.Drawing.Bitmap,System.Drawing") returns null... mmm.. since I do NOT want to be restricted by the assembly version number, I might have to use type registration after all.. still in progress....
modified 2-Jul-16 1:00am.
|
|
|
|
|
Hi Super Lloyd,
Sounds like it's going well, and I look forward to seeing the result.
I'm not clear exactly what the connotations of the words "document serializer" are to you; to me, it conjures the image of a some kind of "raw" data file, rather than a file that could be translated into .NET objects ... perhaps my understanding is "challenged" ?
I have a slightly superstitious belief that you should not "name" something before it is finished. It makes perfect sense to me that Thais give their children nick-names that are often a bit grotty, and, if a child is particularly handsome/beautiful, the nick-name is even more "negative."
So we have Nong Oon, Nong Gop, Nong Ngu: "kid fatty," "kid frog," "kid snake." This is based on the idea (shared with the ancient Greeks ?) that the various spirits and entities lurking about in the cluster of animist beliefs and traditions that "surrounds" Theravadan Buddhism are attracted to lovely children and will "mess" with them.
cheers, Bill
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
BillWoodruff wrote: I'm not clear exactly what the connotations of the words "document serializer" are to you; to me, it conjures the image of a some kind of "raw" data file, rather than a file that could be translated into .NET objects ... perhaps my understanding is "challenged" ?
mm.. good question... too much MVVM affected my thinking.
By document I am thinking MMVM models or even better, just M (models) which I see as simpler object because they seldom relying an events (hence my descision to ignore delegate) use few if any unmanaged dependencies (though I have an ISurrogate<> interface for things such as Bitmap or singleton) and can mostly described (and serialized) by their public properties / fields and maybe and IList / IDictionary interface.
Alright.. let's finish debugging this yet unnamed library!
Thanks for the feedback!
|
|
|
|
|
Sorry.. to be more clear.. the intent is not cloning of object or passing them accross process boundary.
The objective is to implement the "File > Save " menu.
So delegate and IntPtr must go... obviously...
But Bitmap can be turned into byte[] with ISurrogate<>
As a side note I just succesfully cloned a WinForm with a TreeNode collection and a RichTextBox.
Though I used the "Text"property so.. no RTF
And the dynamic also work now! Even I can't believe it!
|
|
|
|
|
|
Do young melons not get married because they cantaloupe?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Orange you just hilarious.
That's what I do. I drink, and I know things. ~ Tyrion Lannister
|
|
|
|
|
That was pretty meloncholy.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|