It comes down to these cases for XML elements having maxOccurs="1" (which the default for maxOccurs):
adding nillable="true" will convert from a regular type to a nullable type.
adding minOccurs="0" will add boolean …Specified properties in the generated C# for each element.
you can have both nillable="true" and minOccurs="0" in an element which gets you a nullable type and a …Specified property.
Note I’m not considering fixed or default here, nor attributes (that have use instead of minOccurs/maxOccurs, but do not allow for nillable) nor larger values of maxOccurs (which both xsd.exe and xsd2code regard as unbounded).
From the above, XML has a richer type system than C#, so in XML there are subtle a differences between:
an explicit nil in the XML element
the XML element being absent
the XML element being empty.
Hopefully later more text and examples to show how to actually work with this.
A while ago, StackOverflow user Kobus Smit did some brilliant editorial work that – due to current state of StackOverflow – sort of fired backwards: his question got marked as duplicate before he could post his excellent answer. After that answer was posted, the oh-so pride SO-demi gods never took any energy to revisit to see which answers were best.
His simple question:
How can my Delphi app easily write to the Windows Event Log?What is the difference between TEventLogger and ReportEvent? How do I use the ReportEvent function?
Which somehow should be encompassed by this Delphi 5 question (apparently that 15+ year old Delphi version is still considered current by the SO demi-gods).
The answer summarises and extends existing answers spread out over StackOverflow and adds an EventLog git repository wrapping the ReportEventandRegisterEventSource (which somehow is always a pain: Delphi services for instance often forget that).
Lesson learned when doing editorial work:
prepare both the answer and question in markdown off-line
ensure you mention in the question that the answer is meant as collection of “best of” answers found elsewhere
post the question and answer in rapid succession
cross your fingers for the StackOverflow demi-gods being in a good mood
Every methodology has their own. I like the ones in the picture, of which the teacher obviously didn’t get them at all. Maybe because COP 3331 is about Object Oriented Design?
PowerShell 4.0 is madly in love with “English (United States)”
A long time ago I started writing up my blog post like this in March 2015 when I bumped into this the first time when upgrading from PowerShell 2 to PowerShell 4:
Good and not so good news: after reading the below linked posts, this is what works:
PowerShell 4 and up works fine with any [Wayback] Lucida Console size (including 12) and boldness
only when the “Language for non-Unicode programs” is set to “English (United States)”.
PowerShell 4 works fine with [Wayback] Consolas on any size and boldness
for any “Language for non-Unicode programs”
So if you’re like me and switch between “Dutch (Netherlands)” and “English (Ireland)” a lot (both use the EURO as currency, but have distinct enough other locale settings to cover a lot of European stuff) then you need to get used to the Consolas font.
Most developers I speak to have trapped into a case of copy/pasting some source code containing quotation marks from documentation or post immediately failing on curly quotes like left double quotation marks (“) and right double quotation marks (”) that should have been regular double quotation marks (").
Note it’s not only the auto-correct of office applications. For instance “blog engines” like WordPress do that too, unless you add a code or pre around them:
code: "blog engines"
pre:
"blog engines"
Very irritating, but apparently nowadays beauty trumps accuracy.
Reddit user sammiesdog discovered recently that Visual Studio 2015 C++ compiler was inserting calls to a Microsoft telemetry function into binaries. “I compiled a simple program with only main(). When looking at the compiled binary in IDA, I see a call fortelemetry_main_invoke_trigger and telemetry_main_return_trigger. I cannot find documentation for these calls, either on the web or in the options page,” he wrote. Only after the discovery did Steve Carroll, the dev manager for Visual C++ admit to the “feature” and posted a workaround to remove it.
A Microsoft spokesperson confirmed the existence of this behavior to InfoQ, adding that the company wil be removing it in a future preview build. For those who wish to get rid of it, the blog writes:
Users who have a copy of VS2015 Update 2 and wish to turn off the telemetry functionality currently being compiled into their code should add notelemetry.obj to their linker command line.
There is a little trick to disable “Known IDE Packages”: you can stop Delphi from loading one by either making “Value data” of the registry blank, or prepending it with an underscore:
packages that might have been disabled, by checking any string entries where the data has been pre-pended with an underscore OR is blank
I’ve pre-pended underscores to some packages in the registry key [HKEY_CURRENT_USER\Software\Borland|Codegear|Embarcadero\BDS|Delphi\#.0\Known IDE Packages] and intend to keep the list below updated over time.
Note that you have to prepend the description with an underscore: it is not sufficient to add these to [HKEY_CURRENT_USER\Software\Borland|Codegear|Embarcadero\BDS\#.0\Disabled Packages].
Empirically, the Disabled Packages seem to work only for packages starting with dcl in their filename.
A while ago I bumped into this interesting bit: LLLPG (Loyc LL(k) Parser Generator) is a new recursive-decent parser generator for C#, with a feature set better than ANTLR version 2.