The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for the ‘Stackoverflow’ Category

Repeating characters into strings in C# and Delphi (via: .net – Best way to repeat a character in C# – Stack Overflow)

Posted by jpluimers on 2012/06/26

Switching back and forth between mainly Delphi and C#, sometimes it is hard to remember which idiom works best in each environment.

Recently, I had to dupe a lot of tab characters for some Tab-Delimited interface to an archaic system.

I remembered the Delphi idiom: use the DupeString function as about Delphi explains (yes, I know: it dupes more than just characters).

In C#, these work best for me:

Small code sample of the first way (thanks CMS):

static string Tabs(int n)
{
    return new String('\t', n);
}

–jeroen

via: .net – Best way to repeat a character in C# – Stack Overflow.

Oh BTW: I have reduced my StackOverflow presence. It looks like the success of StackOverflow made them instantiate many moderators. A lot of those moderators work under the mantra “we follow the rules strictly, and favour punishment over encouragement” (some  even talk about “changing heritage“). That’s a real pity, as I see a lot of StackOverflow users get scared by the very active downvoting, question/answer closing and even deletion of material that is in essence valuable, if it were edited up a bit. Deleting content is always bad, as it increases the link rot that StackOverflow are trying to prevent in questions/answers as per their FAQ. Links are the foundation of the web.

Alas, devoting real attention to the quality of StackOverflow requires putting real energy in it, which for some of the moderators seems to be too much to ask.

Posted in .NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Delphi, Development, Pingback, Software Development, Stackoverflow | 5 Comments »

Funny how StackExchange, StackOverflow, ServerFault, SuperUser and differ in indicating their site outage “We are Offline”

Posted by jpluimers on 2012/02/18

Tonight these most StackExchange sites have maintenance, including their bogs and meta sites (the chat sites like http://chat.stackoverflow.com/ are on-line). I checked these to be off-line, most of the bigger table below are offline too.

Later I will amend this post with the HTML and try to get some site previews too.

A bit later I got this kind of message from Chrome, that tried to protect one of the sites:

Error 139 (net::ERR_TEMPORARILY_THROTTLED): Requests to the server have been temporarily throttled.

Note that http://askubuntu.com/ is up and running :) Read the rest of this entry »

Posted in Development, Pingback, Stackoverflow, Web Development | Leave a Comment »

Jon Skeet and Tony the Pony on Vimeo

Posted by jpluimers on 2011/10/26

This is from 2009, but still sooooo funny.

Lets use these 2 thumbs as parity bits.
I should have done this with pounds and pounds.
Why doesn’t John Skeet does never sleep.
No, you can’t have Visual Studio … yes telepathy is fine.

And more great quotes, sample code and experiences (like the Turkey Test) in this wonderful presentation by Jon Skeet and the famous Tony the Pony
[Wayback] Jon Skeet and Tony the Pony on Vimeo on Vimeo

Hilarious, and true :)

--jeroen

via Jon Skeet and Tony the Pony on Vimeo.

Posted in .NET, Development, Jon Skeet, Pingback, Software Development, Stackoverflow | Leave a Comment »

c# – What can I use to let users build their own avatar character? – Stack Overflow

Posted by jpluimers on 2011/02/21

Some cool suggestions on avatar sites: c# – What can I use to let users build their own avatar character? – Stack Overflow.

–jeroen

Posted in Pingback, Power User, Stackoverflow | Leave a Comment »

Stack Overflow ebooks

Posted by jpluimers on 2011/02/10

Greg Hewgill published a bunch Stack Overflow ebooks and StackExchange stats.
His readme explains a bit more on the books.
The blog he maintains makes up for some nice reading too.
Be sure to read the blog entry on the ebooks.

–jeroen

via Stack Overflow ebooks.

Posted in *nix, .NET, ASP.NET, C#, C# 2.0, C# 3.0, C# 4.0, Database Development, Delphi, Delphi for PHP, Development, HTML, HTML5, Java, Pingback, Power User, RegEx, Scripting, SocialMedia, Software Development, SQL, SQL Server, Stackoverflow, XML/XSD | Leave a Comment »

#StackOverflow and Stack Exchange now support Suggested Edits and Edit Review even by anonymous users

Posted by jpluimers on 2011/02/06

Good news: StackOverflow and the Stack Exchange sites now allow all visitors (even anonymous) suggested edits to questions and answers.

Joel Spolsky explains all the details of this great new feature!

–jeroen

via: Suggested Edits and Edit Review – Blog – Stack Overflow.

Posted in Pingback, Power User, Stackoverflow | Leave a Comment »

Quora versus StackExchange – SE wins hands down

Posted by jpluimers on 2011/02/02

StackExchange wins hands down because of one reason:
the Quora page forces you to create an account before you can do anything else.

–jeroen

Posted in Pingback, Power User, Stackoverflow | Leave a Comment »

.NET – Delphi Prism – How to generate wrapper classes code from XSD file

Posted by jpluimers on 2009/09/04

I do a lot of .NET work; most in C#, but also some in Delphi Prism (which like C#, VB.NET and other languages integrate in the Visual Studio Shell).

Both Visual Studio and the .NET Framework SDK include a nifty tool called XSD.EXE.

XSD.EXE allows you you to generate the code for wrapper classes from your XSD or other schema definition file, both for regular classes (that you can use for XML Serialization) as well as for typed dataset classes.

You need to specify the Oxygene language to generate Delphi Prism code.

A sample batch-file is here:

xsd /classes /language:Oxygene /namespace:xokumClasses xokum.xsd
rename xokum.pas xokumClasses.pas

xsd /dataset /language:Oxygene /namespace:XokumDataset xokum.xsd
rename xokum.pas xokumDataset.pas

Thanks to Peter Nowotnick who posted this answer at Stackoverflow!

–jeroen

Posted in .NET, CommandLine, Delphi, Development, Pingback, Prism, Software Development, Stackoverflow, Visual Studio and tools, XML/XSD, XSD | 4 Comments »

Answered @ Stackoverflow – on Parsing a record of unknown structure: use classes with published properties and the Delphi streaming mechanism

Posted by jpluimers on 2009/08/24

At Stackoverflow, user AB asked about Delphi: Parsing a record of unknown structure.

Basically his question came down to iterating over the fields of a record, then writing out the values to some sort of human readable file, and then reading them back in.

His idea was to use INI files, but also needed support for multi-line strings.
I suggested to use classes in stead of records, and published properties in stead of fields, then use the Delphi built-in streaming mechanism to stream to/from Delphi dfm files.

Normally, Delphi uses dfm files (they have been human readable text files since Delphi 6 or so) to store Forms, DataModules and Frames.
But why not use them to store your own components?
Read the rest of this entry »

Posted in Component Development, Conference Topics, Conferences, Delphi, Development, Event, Package Development, Pingback, Software Development, Stackoverflow | 5 Comments »

Answered @ stackoverflow – on virtual constructors called through class references in Delphi

Posted by jpluimers on 2009/04/27

I just tried to elaborate on an answer to a question from Michael Justin on stackoverflow.
(yes, that’s the author of some message broker clients like the Habari ActiveMQ client that allows Delphi applications to talk to the Apache ActiveMQ message queueing broker).

His question is on virtual constructors and class reference: How can I detect if a Delphi class has a virtual constructor?
The combination of class references and virtual constructors is one of the fundaments of how Delphi became Delphi; in simple terms:

  • class references allow you to register components on the component palette in Delphi
  • virtual constructors allows the designer to construct  the instances of those components at design time

That’s why I think it is important to describe the distinction between virtual constructors and regular non-virtual constructors in the answer below (which is a copy of the answer I posted to stackoverflow)

Read the rest of this entry »

Posted in Delphi, Development, Pingback, Software Development, Stackoverflow | Leave a Comment »