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 ‘Visual Studio and tools’ Category

Web means Unicode

Posted by jpluimers on 2010/02/12

Google published an interesting graph generated from their internal data based on their indexed web pages.Encodings on the web

A quick summary of popular encodings based on the graph:

  1. Unicode – almost 50% and rapidly rising
  2. ASCII20% and falling
  3. Western European* – 20% and falling
  4. Rest – 10% and falling

Conclusion: if you do something with the web, make sure you support Unicode.

When you are using Delphi, and need help with transitioning to Unicode: contact me.

–jeroen

* Western European encodings: Windows-1252, ISO-8859-1 and ISO-8859-15.

Reference: Official Google Blog: Unicode nearing 50% of the web.

Edit: 20100212T1500

Some people mentioned (either in the comments or otherwise) that a some sites pretend they emit Unicode, but in fact they don’t.
This doesn’t relieve you from making sure you support Unicode: Don’t pretend you support Unicode, but do it properly!

Examples of bad support for Unicode are not limited to the visible web, but also applications talking to the web, and to webservices (one of my own experiences is explained in StUF – receiving data from a provider where UTF-8 is in fact ISO-8859: it shows an example where a vendor does Unicode support really wrong).

So: when you support Unicode, support it properly.

–jeroen

Posted in .NET, ASP.NET, C#, Database Development, Delphi, Development, Encoding, Firebird, IIS, InterBase, ISO-8859, ISO8859, Prism, SOAP/WebServices, Software Development, SQL Server, Unicode, UTF-8, UTF8, Visual Studio and tools, Web Development | 7 Comments »

Validate XML with XSD in .NET and native MSXML – big difference in string maxLength validation with newlines (samples in C# and Delphi)

Posted by jpluimers on 2010/01/19

Recently, I had an issue while validating XML with XSD: validation in .NET using the built in classes in the System.XML namespace, and validation in native Windows using the COM objects exposed by  MSXML version 6 (which incidentally ships with the .NET 3.0 framework).

Some documents validating OK in .NET did not validate well with MSXML.

I’ll show my findings below, and try to explain the difference I found, together with my conclusions.
The main conclusion is that MSXML version 6 has a bug, but I wonder why I can’t find much more information on it.

Since there is not so much ready to use for validating XML by XSD in .NET and native, I’ll include complete source code of command-line validations applications for both platforms.
.NET source code is in C#.
Native source code is in Delphi.
Read the rest of this entry »

Posted in .NET, C#, C# 2.0, C# 3.0, Delphi, Development, Software Development, Visual Studio and tools, XML, XML/XSD, XSD | 4 Comments »

.NET/C#/ASP.NET – CodeProject: Multi-Threading in ASP.NET. Free source code and programming help

Posted by jpluimers on 2010/01/12

Finally someone who explains this topic well: CodeProject: Multi-Threading in ASP.NET.

Most of it is based on Web 405 “Building Highly Scalable ASP.NET Web Sites by Exploiting Asynchronous Programming Models” by Jeff Prosise, which should be here on the Microsoft events site (which currently has connection problems) and is referenced here and here.

Recommended reading!

–jeroen

Posted in .NET, ASP.NET, C#, C# 2.0, C# 3.0, C# 4.0, Development, IIS, Software Development, Visual Studio and tools | 2 Comments »

Delphi – Announce: ModelMaker Code Explorer 8.02 beta

Posted by jpluimers on 2010/01/05

Gerrit Beuze just announced the new beta of ModelMaker Code Explorer 8.

For me, ModelMaker Code Explorer (especially at a price of only EUR 99!)  is an indispensable tool for both creating new sources, and maintaining old sources (the refactorings it can do are awesome, but there are many other useful features in it as well).

Over the years, I’ve been using interfaces in Delphi more and more.
Actually, in some of my projects almost all classes implement interfaces.

Therefore, I’m particularly glad with the new feature  ‘auto complete style drop down list’ in the ‘Edit Class dialog’ that this beta brings.

More info: ModelMaker Code Explorer 8.02 beta.

Note: if you use Visual Studio, there is a Visual Studio edition of ModelMaker Code Explorer too.

–jeroen

Posted in C# 2.0, C# 3.0, Delphi, Development, Software Development, Visual Studio and tools | Leave a Comment »

.NET/C# – ExceptionCatcher and ExceptionHelper gems

Posted by jpluimers on 2009/09/14

http://it-republik.de/dotnet/basta/The class presented in this article is part of my “.NET Gems – Small Pieces of Code that make your Day” session that will be presented at the BASTA! conference next week in Mainz, Germany.
It is going to be a fun conference, with lots of (internationally) renowned speakers (like Oliver Sturm, Ingo Rammer, Stephen Forte, Neil Ford and Dino Esposito).
Well worth attending!

OK. Let’s show the gems, and assume you are writing a method that is not allowed to let exceptions leave it’s implementation.
This is a common case, for instance you develop COM Servers, Windows Services and to a lesser extent Web Services.
Read the rest of this entry »

Posted in .NET, BASTA!, C#, C# 2.0, Development, Event, Software Development, Visual Studio and tools | Leave a Comment »

CodeRage 4: session replays are online too!

Posted by jpluimers on 2009/09/13

Embarcadero has made available the replays of the CodeRage 4 sessions.
You can find them in the CodeRage 4 sessions overview.

In order to download them from that overview, NOTE: To access this session replay, you must be logged into EDN. you can login or sign-up (which is free).

To make it easier to find all the relevant downloads, below is an overview of my sessions and their links.

Let me know what you use it for, I’m always interested!

Update 20090918: changed the download locations because CodeCentral messed up.
Read the rest of this entry »

Posted in .NET, ASCII, C#, C# 2.0, CodeRage, CommandLine, Conferences, CP437/OEM 437/PC-8, Database Development, Debugging, Delphi, Development, Encoding, Event, Firebird, InterBase, ISO-8859, ISO8859, Java, Prism, Software Development, Unicode, UTF-8, UTF8, Visual Studio and tools, XML, XML/XSD, XSD | 4 Comments »

CodeRage 4: session “Practical XML in Delphi” chat and Q&A transcripts

Posted by jpluimers on 2009/09/09

Not only can you download CodeRage 4 session on materials on Practical XML in Delphi, but below you can also find the chat transcripts below.

Note the times are a bit odd: when the chat window refreshes, it sometimes uses the PST time zone, but new posts are using the local time zone.
Hence the sudden jump from 9 AM to  almost 6 PM.

VIP Room Transcript with Q&A

[5:46:28 PM] <davidi>

Q: thomasgrubb asked: “Is there an implementation for XMLDocument (for Delphi Win32) that is file-mapped, e.g., the whole doc is not loaded into memory?”
A: Not that Jeroen is aware of.
[5:46:54 PM] <davidi>

Q: thomasgrubb asked: “Is there an implementation for XMLDocument (for Delphi Win32) that is file-mapped, e.g., the whole doc is not loaded into memory?”
A: Not that Jeroen is aware of. Send Jeroen an email and he will blog about other solutions.
[5:47:20 PM] <davidi>

Q: thomasgrubb asked: “For Embarcadero Technologies: Are you going to develop a better option for validating XML on the Win32 side in the future?”
A: David I – replied – I will forward this to R&D and Product management
[5:53:14 PM] <davidi>

Q: devtux asked: “are you using any XML test generator? Please, suggest one if yes”
A: XMLSpy
[5:53:47 PM] <davidi>

Q: richz asked: “I’ve been trying for weeks to find out how to have the Win32 Delphi IDE generate code to serialize/de-serialize my class properties to an XML file. Is there anything in the IDE to do that?”
A: From Delphi 2010 on – you can use DBX support for JSON!

Public Room Transcript

[7:58:58 AM] * Christine_Ellis has set the topic to: Session Room 2 – Next Session”Practical XML in Delphi” at 8AM PDT
[8:02:15 AM] <Jeroen_Pluimers> Starting livemeeting
[8:03:59 AM] * Jeroen_Pluimers is wondering why LiveMeeting is always asking for email/company. Does it suffer from Korsakov’s disease?
[8:07:34 AM] <Christine_Ellis> It asks because we tell it to.
[8:08:22 AM] <Jeroen_Pluimers> but it never remembers, even if you start it with the same session parametes.
[8:08:41 AM] <Christine_Ellis> live meeting doesn’t use cookies and doesn’t know who you are
[8:08:47 AM] <Jeroen_Pluimers> ok.
[8:09:29 AM] <Jeroen_Pluimers> can we do a quick audio test?
[8:12:48 AM] <Jeroen_Pluimers> I mean: fro my current Microphone; it works with sound recorder, but wonder if Live Meeting will get it today as well.
[8:15:55 AM] * Christine_Ellis has set the topic to: Session Room 2 – “Practical XML in Delphi
[8:35:37 AM] <Peter_Wolf> a lot of memory = usually 10 timer more than the size of XML file bytes
[8:36:27 AM] <Peter_Wolf> … the size of XML file in bytes
[8:39:14 AM] <Jeroen_Pluimers> @Peter: that totally depends on what you use to read that XML. The MSXML and Internet Explorer are notorous memory hogs. But .NET is much more efficient on memory usage.
[8:40:15 AM] <Peter_Wolf> i ment MSXML which is default for most users
[8:41:17 AM] <Jeroen_Pluimers> @Peter: yup, that’s why I mentioned that as the first one. Most of the Win32 users will use MSXML, because that is the default for Win32.
[8:43:45 AM] * Jeroen_Pluimers warns: be carefull where you press ESC in IE: it can unload your chat window.
[8:47:29 AM] <Scott_Hollows> my brain hurts
[8:48:57 AM] <Jeroen_Pluimers> Scott: let me know later on if I can make it more clear to you.
[8:50:27 AM] <Ryan_Ford> Will this presentation be available for download?
[8:51:05 AM] <Jeroen_Pluimers> @Ryan: yes it will.
[8:52:59 AM] <Ryan_Ford> Its so nice to run 8GB for development
[8:52:59 AM] <Jeroen_Pluimers> @Ryan: the session materials are available for download here: https://wiert.wordpress.com/2009/09/09/coderage-4-session-materials-available-for-download/ The replays will be available for download after the conference.
[8:58:56 AM] <Jeroen_Pluimers> My VIP room died.
[9:00:08 AM] <AbsaLootly> … you have to hate it when that happens…
[9:01:46 AM] <Ryan_Ford> What alternatives for MSXML are there for WIN32
[9:02:22 AM] <Peter_Wolf> it also takes forever to open really big XML files wh MSXML
[5:45:31 PM] <AbsaLootly> I saw one developer try to put an entire database in one xml file… it took several hours to load it.
[5:51:59 PM] <Jeroen_Pluimers> MSXML
[5:52:03 PM] <Jeroen_Pluimers> ADOM XML
[5:52:05 PM] <Jeroen_Pluimers> Xerces
[5:52:56 PM] <Jeroen_Pluimers> That straight from the Delphi 2010 TXMLDocument.DOMVendor property
[5:53:25 PM] <Jeroen_Pluimers> XMLSpy can generate test ML
[5:54:16 PM] <Rich__> Thx
[5:55:17 PM] <Jim_Ferguson> Can you briefly describe JSON?
[5:56:02 PM] <Jim_Ferguson> what tool do you use transcribe your chat?
[5:56:23 PM] <Jon> it’s called a keyboard :)

–jeroen

Posted in .NET, CodeRage, CommandLine, Conferences, Database Development, Debugging, Delphi, Development, Encoding, Event, ISO-8859, ISO8859, Prism, Software Development, Source Code Management, TFS (Team Foundation System), UTF-8, UTF8, Visual Studio and tools, XML, XML/XSD, XSD | Leave a Comment »

CodeRage 4: session materials are available for download« The Wiert Corner – Jeroen Pluimers’ irregular stream of Wiert stuff

Posted by jpluimers on 2009/09/09

My CodeRage 4 session materials are available for download:

CodeRage 4 is a free, virtual conference on Embarcadero technologies with a lot of Delphi sessions.
It is held from September 8 till 11, 2009, i.e. while I write this :-)
If you want to watch sessions live, be sure to register through LiveMeeting (the technology they use for making this all happen).

Let me know if you download, and what you are using the sample code for.

–jeroen

Posted in .NET, CodeRage, CommandLine, Conferences, Database Development, Debugging, Delphi, Development, Encoding, Event, Firebird, InterBase, ISO-8859, ISO8859, Prism, Software Development, Source Code Management, SQL Server, TFS (Team Foundation System), Unicode, UTF-8, UTF8, Visual Studio and tools, XML, XML/XSD, XSD | 4 Comments »

CodeRage 4: sessions recorded; Delphi 2010 migration was a beeze; samples/slides will be uploaded soon

Posted by jpluimers on 2009/09/05

I just finished recording my CodeRage 4 sessions:

  • Practical XML in Delphi
  • Reliable Communication between Applications with Delphi and ActiveMQ
  • Using Unicode and Other Encodings in your Programs

CodeRage 4 is a free, virtual conference on Embarcadero technologies with a lot of Delphi sessions.
It is held from September 8 till 11, 2009, i.e. next week :-)
If you want to watch sessions live, be sure to register through LiveMeeting (the technology they use for making this all happen).

This week, I found some time do migrate all the sample projects to the release versions of Delphi Win32 2010 and Delphi Prism 2010.

Delphi Win32 2010 works like a charm: it is much faster and has a much smaller footprint than any other Galileo based IDE.
In fact, it feels almost as fast as the pre-Galileo based IDE’s.
With the added benefit that all the new features make me much more productive, not the least because it has not yet crashed on me this week once.
Crashing has been a frequent thing on me since Delphi 4 (maybe I should not even mention that number ), for most IDE’s at least a couple of times a week, so this is good.

Delphi Prism 2010 works really nice too, it is rock solid, and the language as some great features not found in other .NET languages.
But it still needs a tiny bit more polishing on the Visual Studio IDE Integration part.
There are a few things not as smoothly integrated as I’m used to in C# and VB .NET (for instance when adding assembly references; C# and VB.NET allow you to do that from multiple places in the IDE; Delphi Prism from only one).
I know it is nitpicking (the same holds for the Team Foundation System integration in the Visual Studio IDE: ever tried to add files or folders? There is only one icon that allows you to do it. Ever tried to move files or folders around? No way you can drag & drop, in fact you can move only 1 file or folder at a time, and then the folder tree leaves you at the target).

The Embarcadero folks have worked hard on developer productivity in the Delphi Win32 2010 IDE.
(Did I mention the F6 key? It is an awesome way of directly jumping into configuration dialogs a zillion levels deep.
Did I mention the Ctrl-D key? It instantly reformats your source code to your formatting settings).
So maybe it is now time to put some of that effort into the Prism side as well.

Back to my CodeRage sessions: the recordings are done, they will soon become available as downloads together with the samples/slides.

Keep watching :-)

–jeroen

Posted in .NET, CommandLine, Database Development, Debugging, Delphi, Development, Encoding, Event, Firebird, InterBase, Java, Package Development, Prism, Software Development, Source Code Management, TFS (Team Foundation System), Unicode, Visual Studio and tools, XML, XML/XSD, XSD | 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 »