c# – How to split a text file into multiple files? – Stack Overflow.
c# – File.ReadLines without locking it? – Stack Overflow.
c# – Whats the fastest wto read a file by one line at a moment – Stack Overflow.
Posted by jpluimers on 2013/08/21
c# – How to split a text file into multiple files? – Stack Overflow.
c# – File.ReadLines without locking it? – Stack Overflow.
c# – Whats the fastest wto read a file by one line at a moment – Stack Overflow.
Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2013/08/17
I totally agree that Paint.NET is the best free image and photo editor on Windows.
Writing quality software takes time, not only when writing it in spare time like Rick Brewster does. Getting things “right” is a tedious process and often will set you back: just watch the graph on the right.
So I’m not surprised that it took a very long time after the first Paint.NET 4.0 idea in 2008 to get “close” to a release.
And indeed, it looks like Rick has become much closer which will please many people waiting for Paint .NET 4.
I’m really glad with the announcement that Paint.NET v3.5.11 BETA is now available – Paint.NET Discussion & Questions – Paint.NET Forum.
Edit: while writing this, the final Paint.NET v3.5.11 came out.
It paves the way for Paint .NET 4.0 update in the future, and fixes/improves quite a few things.
A few quotes from it:
This is probably not the update you were expecting I need to push out an update to v3.5 in preparation for the eventual release of v4.0 […] releasing a “beta” today […] I’ll be pushing out the Final/RTM in a few days.
The primary goal of this update is preparing for the v4.0 release: v3.5.10 will not be able to offer the v4.0 update, but v3.5.11 will. […]
Here are the changes for this release:
- Fixed: The Gaussian Blur effect was incorrectly calculating alpha values for non-opaque pixels. (http://forums.getpaint.net/index.php?/topic/18483-gaussian-blur-mistreats-alpha/)
- Improved performance of the Sharpen effect by about 25%
- Improved performance of the Median effect by about 30%
- Improved performance of the Fragment effect by about 40%
- Improved performance of the Unfocus effect by about 100%
- Reduced memory usage when many selection manipulation operations are in the history/undo stack (the undo data is now saved to disk)
- The built-in updater now supports upgrading to paint.net 4.0 (once it’s available)
There have been rumors floating around that Paint.NET is “dead.” This is not true!
–jeroen
via: Paint.NET Blog | The best free image and photo editor. By Rick Brewster..
Posted in .NET, .NET 3.5, .NET 4.0, Algorithms, Development, Floating point handling, Power User, Software Development, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Tagged: computer, software, technology | Leave a Comment »
Posted by jpluimers on 2013/08/14
Everyone knows there is a size difference between a gigabyte of memory, and a gigabyte of disk space.
The former is 102410241024, the latter is 100010001000.
To facilitate this, I’ve created a C# class UnitPrefixes containing quite a few constants and readonly values.
The class is below, but a few interesting facts first:
I used the Wikipedia pages Binary Prefix and Metric Prefix (I could also have used File Size) for the unit names and abbreviations.
Note that BitsPerByte is a const I needed too, and I will probably add constants for 512 and 4096, as you see those often in computing as well.
The below sample code is also available as a changeset on BeSharp.CodePlex.com. Read the rest of this entry »
Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, Conference Topics, Conferences, Development, Event, Jon Skeet, Software Development | Tagged: endregion, region | Leave a Comment »
Posted by jpluimers on 2013/08/08
Peter Leslie Morris asked if Delphi already incorporates the `yield` keyword that C# had introduced in C# 2.
Delphi doesn’t, but for the people interested what it does in C#:
Basically `yield` is syntactic sugar to make it a lot easier to write methods that return enumerators of some sort.
It delays (hence the yield keyword) execution until the enumerator as actually being used.
It is one of the hardest C# things to master (it is the most complicated transformation in the compiler, followed by anonymous methods – well maybe with the exception of async/await), but it can be very useful.
VB.NET doesn’t have it either (thanks André!) has it too, but and also has iterator blocks.
Some start posts on yield:
–jeroen
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Delphi, Development, Software Development | 10 Comments »
Posted by jpluimers on 2013/08/06
Finally a new CLR Week on the Old New Thing.
It starts with via: Why does BitConverter.LittleEndian return false on my x86 machine? which is all about static constructors.
So you should read these as well:
(Note that virtually anything from Eric Lippert and Jon Skeet it worth reading anyway).
--jeroen
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, Development, Jon Skeet, Software Development | Leave a Comment »
Posted by jpluimers on 2013/08/06
Never thought this would work so smoothly: Install Visual Studio 2010 AFTER Visual Studio 2012 – Stack Overflow.
–jeroen
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 8.0, VB.NET 9.0, Visual Studio 11, Visual Studio 2010, Visual Studio and tools | 7 Comments »
Posted by jpluimers on 2013/08/03
If you ever get something similar to
InvalidCastException: [A]Person cannot be cast to [B]Person.
then you are (or more precise: your process is) probably loading the same assembly twice, but from a different context.
.NET allows that, and for reason (side by side loading, appdomains, etc).
Delphi doesn’t (thanks Warren Postma for noticing). But a mistake you see quite often is that Delphi developers try to load the same Delphi type from both an EXE and a DLL wondering why they don’t match. If you want to spread your types in Delphi, then use BPLs (run-time packages) for that. BPLs are similar to .NET assemblies, but cannot be loaded in memory twice.
–jeroen
via c# – InvalidCastException for two Objects of the same type – Stack Overflow.
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 8.0, VB.NET 9.0, Visual Studio 11, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »
Posted by jpluimers on 2013/07/25
Need to find/create a Delphi compatible version of Messagepack or BSON.
–jeroen
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Delphi, Delphi XE2, Delphi XE3, Development, Software Development | 4 Comments »
Posted by jpluimers on 2013/07/24
For Visual Studio 2010 and up (including Visual Studio 2012), the VersionInfo extension will check if you have the latest service pack, update and hotfixes installed.
Of course you can manually check the List of available VS2010 hotfixes, or follow the lists maintained by Terje Sandstrom:
But installing the Visual Studio 2010/2012: Version and update information tool is much easier.
–jeroen
Posted in .NET, Development, Software Development, Visual Studio 11, Visual Studio 2010, Visual Studio and tools | Leave a Comment »
Posted by jpluimers on 2013/07/23
Ever since I started .NET programming after .NET Beta 1 Arrived in 2001, I found that many people struggle with the relation between assemblies and namespaces.
So I was glad that I posted this answer about 2.5 years ago on StackOverflow. Below is the slightly edited form:
People are easily confused by the namespace/assembly thing, as it decouples the concept of where your code is physically located (the assembly) and how you reference it:
- logically reference is by using the namespace
- physical reference is by referencing the assembly
I usually explain the relation using the word contribute:
- An assembly can contribute to multiple namespaces.
For instance, theSystem.Data.dllassembly contributes to namespaces likeSystem.Data(e.g. the classSystem.Data.DataTable) andMicrosoft.SqlServer.Server(e.g. the classMicrosoft.SqlServer.Server.SqlContext).- Multiple assemblies can contribute to a single namespace.
For instance both theSystem.Data.dllassembly and theSystem.Xml.dllassembly contribute to theSystem.Xmlnamespace.
Which means that if you use theSystem.Xml.XmlDataDocumentclass from your project, you need to reference theSystem.Data.dllassembly.
And if you use theSystem.Xml.XmlDocumentclass, you need to reference theSystem.Xml.dllfrom your project.(the above examples are .NET 4.0, but likely hold for previous .NET versions as well).
Danny Thorpe explained the concept of namespace and internal really well, so I won’t go into detail about those.
Ever since I started .NET courses 10 years ago, I draw a table explaining assemblies and namespaces like this:
| Assembly | Namespaces it contributes to | ||
|---|---|---|---|
| ↓ | System.Data | Microsoft.SQLServer.Server | System.Xml |
| ↑ Example classes | |||
| System.Data.dll | DataTable | SqlContext | XmlDataDocument |
| System.Xml.dll | — | — | XmlDocument |
–jeroen
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# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »