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,616 other followers

Archive for the ‘Prism’ Category

Difference Between Int32.Parse, Convert.ToInt32, and Int32.TryParse – CodeProject

Posted by jpluimers on 2015/08/05

Every C#/VB/.NET developer should read Difference Between Int32.Parse, Convert.ToInt32, and Int32.TryParse – CodeProject.

Then also read TryParse with default values.

It is all about handling values that are not Integers, Overflow values and Nulls. There are subtle differences, in the handling of the methods, and the exceptions they could throw: ArgumentNullException, FormatException and OverflowException.

Finally read all about the NumberStyles enumeration, IFormatProvider interface and CultureInfo (especially the difference between InvariantCulture, CurrentCulture, CurrentUICulture and InstalledUICulture).

Because getting your conversions right matters.

–jeroen

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C# 6 (Roslyn), Development, Mono, Mono for Android, Prism, RemObjects C#, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 7.0, VB.NET 7.1, VB.NET 8.0, VB.NET 9.0 | Leave a Comment »

RosettaCode: cool way to improve your coding skills

Posted by jpluimers on 2015/01/22

Wow: I feel like having lived under a stone for 8 years, as RosettaCode has been alive since it was founded in 2007 by Mike Mol.

The idea is that you solve a task and learn from that, or learn by seeing how others have solved tasks or draft tasks.

So in a sense it is similar to the Rosetta stone: it has different languages phrasing the same tasks.

There are already a whole bunch of languages on RosettaCode (of which a few are in the categories below), and you can even suggest or add your own languages.

When you want to solve tasks, be sure to look at the list unimplemented tasks by language that leads to automatic reports by language (for instance two of the languages I use most often: C# and Delphi).

I’m sure there are lots of programming chrestomathy sites, even beyond the ones, and it feels very similar to programming kata sites.

–jeroen

Posted in .NET, APL, Awk, bash, Batch-Files, C, C#, C++, COBOL, CommandLine, Delphi, Development, Fortran, FreePascal, Java, JavaScript/ECMAScript, Lazarus, Object Pascal, Office VBA, Pascal, Perl, PHP, PowerShell, PowerShell, Prism, Scripting, sed script, Sh Shell, Software Development, Turbo Prolog, VB.NET, VBS, VBScript, Visual Studio and tools, Web Development | Leave a Comment »

.net – xcopy ASP.NET / WinForms deployment: find common location to access relative files to it (via: Stack Overflow)

Posted by jpluimers on 2013/12/25

StackOverflow user Joe (sorry, no last name) helped me big time by answering my question on Business logic shared by ASP.NET / WinForms: find the location of the assembly to access relative files to it.

Before showing the code at the bottom of this blog post, let me explain the question in more detail:

Basically I was in the midst of refactoring some ‘inherited’ business logic code that – before refactoring – for the ASP.NET side needs to be initialized with an absolute path, but on the WinForms / WPF side only with a relative path to a GetExecutingAssembly directory.

To ease xcopy deployment, I wanted all configuration settings to be relative. But I hadn’t found a common means for these platforms to obtain a directory usable as a root for accessing relative files.

That way I could put identical settings in both the Web.config and App.config, heck even generate them based on a common fragment, whithout having to hard-code absolute path names.

I knew about Assembly.GetExecutingAssembly, but in ASP.NET that location is not where the web site is (both IIS and the WebDevelopment server make use of temporary locations to store the assemblies).

ASP.NET does have Server.MapPath and HostingEnvironment.MapPath, but I didn’t want to make the business logic depend on ASP.NET.

Joe came up with this solution, which works dandy: Read the rest of this entry »

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, ASP.NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, F#, Prism, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 7.0, VB.NET 7.1, VB.NET 8.0, VB.NET 9.0, Web Development | Leave a Comment »

Interesting SO question: What are the experiences with using unicode in identifiers?

Posted by jpluimers on 2013/10/29

Toon Krijthe posted an interesting question to SO.

Though 5 years old, I think it stilll is very valid one:

At my work, we have decided to stay with the ANSI characters for identifiers. Is there anybody out there using unicode identifiers and what are the experiences?

For all projects I work on (in various Languages like  English, German, Dutch or other), I stick to ASCII characters (not even ANSI) for:

  • file names
  • identifiers

I also try to abstract the non-ASCII strings into places where I am sure that the encoding is preserved (for text files, I prefer UTF-8), or where these characters are properly escaped.

What is your take on this?

–jeroen

via: uniqueidentifier – What are the experiences with using unicode in identifiers – Stack Overflow.

Posted in .NET, Agile, AS/400 / iSeries / System i, C, C#, C++, COBOL, Continuous Integration, Delphi, Development, F#, Prism, Scripting, Software Development, VB.NET, Visual Studio and tools | 4 Comments »

.NET/C#: Igor Ostrovsky wrote a few great MSDN magazine articles helping you write better threading code

Posted by jpluimers on 2013/09/17

Igor Ostrovsky wrote a few very nice MSDN magazine articles. Not all of them have ended up in the list at MSDN magazine, so here is a more complete list:

Though the articles show the majority of sample code in C#, the actual topics are of great interest to any developer writing .NET code or interfacing to it.

Some keywords in his articles: Read the rest of this entry »

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, .NET CF, C, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C++, Delphi, Development, F#, LINQ, PLINQ, Prism, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 7.0, VB.NET 7.1, VB.NET 8.0, VB.NET 9.0 | Leave a Comment »

 
%d bloggers like this: