|
You can always use a permanent marker and write it in the bottom, that way you always have it there.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
...and then I'd be able to read it when I went to write it the second time!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
oh lord, are you difficult to please
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
True story!
|
|
|
|
|
But how did you remember the keys to reset?
I, had it the other way. Whenever my PC was not working, I just had to smack it hardly where HDD was close enough. Next time, I could see the Windows 98 screen loading. Loved those days.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I recently had to go into the BIOS, but since my laptop boots so fast I didn't only not know what button to press, but also not when to press it
After a quick Google I discovered there's a "Restart to BIOS" option
|
|
|
|
|
And now, with a UEFI system, you can't get into the settings without booting Windows first.
Not sure how that works if you need to get into the settings because Windows won't boot. Thankfully, I haven't encountered that problem yet.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That's not true of either of the UEFI desktops I've built in the last 18 mo. In the first of them I was fiddling around in the BIOS for several days before I even had an OS loaded. (Porting a BIOS/MBR OS image to a UEFI/GPT system ended up being at least as much of a PITA as reinstalling/configuring half of the eleven jillion apps on my old PC and turning the old boxes OS into a VM would've been.) The second was much easier but I was still in the BIOS first to check stuff like default boot order/etc before installing the OS.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Everything I've read says that Windows boots so fast on a UEFI system that there's no time to press a key to enter the settings.
You have to hold down Shift and restart from within Windows; or go to "Settings -> Updates -> Recovery -> Advanced Startup"; or use shutdown.exe /r /o from the command prompt / run box.
Apparently, if Windows can't start, the UEFI boot menu should come up automatically. Maybe that's why you didn't have any problems getting in to it before you'd installed the OS.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
My XPS13 laptop might post that fast (never really paid attention); but at least for enthusiast class boards the sub second post time hype never came to be. UEFI is faster; but POST times for those boards are still on the ballpark of 15 seconds (which is still a lot faster than on older BIOS systems). It also seems to either be dominated by a few non-optional steps or well parallelized (this was the promise for faster posting vs bios being single threaded one component at a time) because stripping the startup (turning off whatever optional crap you don't use) no longer offers much of a speed up (normally a second or two vs 5 to 20 secs on BIOS).
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
For that matter; most of the BIOS systems I've had for the last dozen years have had at most a second when they accepted the enter BIOS key; and a lot of them didn't flash an indicator so you just had to mash the button continuously from power on until you got the BIOS screen.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Just hit the Konami code. Works wonders.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
For (my extremely slowly) upcoming take over the world project I created a new (C#) serializer!
Why?
Well this take over the world project, without disclosing too much, is a document editor. I need to save those documents. Writing a Save() and Read() method is quite cumbersome... Serializer, XML Serializer and DataContractSerializer don't make the cut for obvious reason. JsonSerializer is too bloated (think a list of 1000 points, endlessly repeating "x =" or "{" or "}") plus it doesn't work very well with property of type object or List<object>
Enter my serializer, it's version tolerant, strongly typed, have some kind of header with all type info, then it's a stream of value and I think it's output quite a compact stream of data.
And it works with PCL (i.e. desktop, UWP, IOS, Android, Linux with .NET core)
And it just finally worked! this morning at 8:35AM!
(well, not completely.. I just tweaked a test which then failed.. apparently there is still a known bug...)
Well all of that to say...
I might make a CodeProject article if there is some interest for it!
As a side note, Not really a GitHub project since it's smack in the middle of my utility library and removing it is .. tedious since I shared plenty of reflection extension method....
modified 21-Jun-16 19:02pm.
|
|
|
|
|
Super Lloyd wrote: might make a CodeProject article if there is some interest for it!
Yes please!
cheers
Chris Maunder
|
|
|
|
|
Alright then!
Plus I got some silent upvote...
CP Article I guess it is! ^_^
Hopefully next week!
|
|
|
|
|
|
I would read it, so yes please.
|
|
|
|
|
Thanks!
Will try to reply again when it's done!
Or maybe announce it in the lounge as well!
|
|
|
|
|
|
Super Lloyd wrote: I might make a CodeProject article no not might - you must write an article!
|
|
|
|
|
Alright then!
|
|
|
|
|
Congratulations on your breakthrough !
I do wonder if you have really explored systematically what the WCF Serialization/Deserialization tools (DataContract, DataMember, etc.) can do.
For example, I can serialize/deserialize a WinForm TreeView TreeNodeCollection object by providing the necessary Type declarations and 'KnownType Attributes. I intend to publish this technique soon, since I have not seen it before (which doesn't mean it isn't "out there").
There is also a remarkable serializer presented in an article here on CodeProject, by Christophe Bertrand (2015), that is the only serializer I've seen that can serialize WinForm Controls as is [1] : [^].
[1] "as is:" i.e., not by creating a kind of "shadow class" that serializes only certain Properties, Fields, etc.
«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
|
|
|
|
|
Yes, yes I did!
One the problem with KnownTypeAttribute is that it disallow plugin, code that are not know when the base class is written.
Alright then, what about DataContractResolver then?
Well it helps... but one still need to put DataContract and DataMember attribute on everything that need be serialized otherwise it will be (sometimes) omitted.
Further as we used it at work, we kept stumbling on bug where some (new) subclass where not serialized properly for lack of proper DataContract and DataMember annotation.
To summarise the second problem with DataContractSerializer , it is far from idiot proof!
On that Newtonsoft.Json seems like a better deal. The development constraints it imposes are minimal and, with some settings, it supports circular reference and strongly typed serialization.
However it is way too chatty!
Finally, using easy to define surrogate classes I can even serialize such things as Stream, Bitmap, etc...
(I did define DateTime, TimeSpan, Tuple<1,2...> surrogates)
And it also supports IList, IList<T>. IDictionary, IDictionary<K, V>
Contrast that with one of my test method:
public class AAA
{
public int ID { get; set; }
public string Name { get; set; }
public List<int> Heights { get; set; }
public List<int> PreviousHeights { get; set; }
public DayOfWeek Day { get; set; }
public AAA Child { get; set; }
public Tuple<int, string> Tuple { get; set; }
public List<object> Objects { get; set; } = new List<object>();
}
[Fact]
public void SimpleSerialTest()
{
var aaa = new AAA()
{
ID = 73,
Name = "hello",
Heights = new List<int> { 1, 2, 4, 8, 16 },
Day = DayOfWeek.Sunday,
Tuple = Tuple.Create(42, "42"),
};
aaa.Child = aaa;
aaa.Objects.Add(aaa);
aaa.Objects.Add("hello");
var sb = new StringBuilder();
var pw = new PrimitiveTextWriter(new StringWriter(sb));
var ow = new ObjectWriter(pw);
ow.Write(aaa);
var s = sb.ToString();
var pr = new PrimitiveTextReader(new StringReader(s));
var or = new ObjectReader(pr);
var o = or.Read();
Assert.IsType<AAA>(o);
var aaa2 = (AAA)o;
Assert.Equal(aaa.ID, aaa2.ID);
Assert.Equal(aaa.Name, aaa2.Name);
Assert.Equal(aaa.Day, aaa2.Day);
Assert.Equal<int>(aaa.Heights, aaa2.Heights);
Assert.Equal<int>(aaa.PreviousHeights, aaa2.PreviousHeights);
Assert.Equal(aaa.Tuple, aaa2.Tuple);
Assert.Equal<object>(aaa.Objects, aaa2.Objects);
}
No work, no particular setup was required to save the data.
Alright, I lied, there is one setup call required, types must be "registered" with a call like
KnownTypes.Register(GetType().Assembly);
For the record this serialization method produce the text below. While largely bloated with Type meta data... it will win in my scenario where I have just a few types, long lists with lot of instances
Output (Text or Binary output is supported, here is the text ouput)
24 25 "Galador.Core.Tests.SerializationTest+AAA" 0 0 1 0 0 0 8 "ID" 11 "Name" 2 "Heights" 26 "System.Collections.Generic.List`1[[System.Int32]]" 2 0 1 0 11 0 1 "Capacity" 11 0 "PreviousHeights" 26 "Day" 27 "System.DayOfWeek" 98 0 1 0 11 0 0 0 "Child" 25 "Tuple" 28 "System.Tuple`2[[System.Int32],[System.String]]" 0 29 "Galador.Core.Serialization.TuppleSurrogate`2[[System.Int32],[System.String]]" 0 0 1 0 0 0 2 "Item1" 11 "Item2" 2 0 "Objects" 30 "System.Collections.Generic.List`1[[System.Object]]" 2 0 1 0 1 0 1 "Capacity" 11 0 0 73 31 "hello" 32 26 8 5 1 2 4 8 16 0 0 24 33 28 42 34 "42" 35 30 4 2 24 31
modified 22-Jun-16 5:23am.
|
|
|
|
|
I really appreciate your lengthy reply, and your comments on your experience with WCF DataContract.
I'd like to join in with the other comments here, and express my hope you will write a CP article on your work !
fyi: the XML output of the WCF DataContract serializer is "bloated" with, imho, bizarrely long internal field/tag-names: that's why I have gotten in the habit of GZiping it going and coming ... typical reduction in file size greater than 70% in my experience.
imho, one of the best "acid tests" for a serializer is self-referential types like a TreeNode that contains a pointer to its Parent Node, a list of pointers to its child nodes ... and, in the case of WinForms TreeView/TreeNodes, a pointer to the TreeView Control itself.
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
|
|
|
|
|
Your serializer looks quite easy to use.
The output is human readable, but does not look to be human 'intuitive'. To get the data even more compact, maybe nice to have an option to compress (GZipStream?) the output since it does not look like anyone would ever 'hand edit' the serialized output, correct?? What am I missing?
Look forward to your CP article!
Curtis
|
|
|
|
|