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,861 other subscribers

Archive for the ‘.NET’ Category

The C language specification describes an abstract computer, not a real one – The Old New Thing – Site Home – MSDN Blogs

Posted by jpluimers on 2014/04/09

Interesting read:

The C language specification describes an abstract computer, not a real one – The Old New Thing – Site Home – MSDN Blogs.

In other words: any language that merges null behaviour in the underlying storage will have a problem somwehere.

So if you want to have true nullable types, your null flag should be stored outside the underlying storage.

The .NET framework 2 and up, most database management systems and many other environment support that.

But most languages don’t support it for pointer types. So there will be portions of address spaces either inaccessible, or only accessible when skipping the null pointer checks.

Note that the thread above contains some very interesting bits, for instance this one:

Matt 28 Mar 2013 5:58 PM #

@MarkY “Dereferencing null is undefined?  Cool!  I thought it was guaranteed to crash, just like a false assertion or something.  So crashing is the OS guarantee, not the language guarantee apparently.”

Nope. It’s not an OS guarantee either. The OS won’t ever normally allocate memory at address zero, but there’s nothing to stop you telling it to. Try doing “VirtualAlloc(1, 4096, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE)” on your pre-Windows8 machine.

In fact, this is the reason why null-dereferences in kernel mode are often exploitable as elevation of privilege attacks. The null-page is mappable and within the user-addressable region of memory, so if the kernel dereferences a null pointer, it reads attacker controllable data.

And btw, this is the reason why on Linux and Windows8+ you can’t map the null-page.

–jeroen

via: The C language specification describes an abstract computer, not a real one – The Old New Thing – Site Home – MSDN Blogs.

Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, Borland C++, Borland Pascal, C, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C++, C++ Builder, Database Development, Delphi, Development, Pascal, Quick Pascal, Software Development, Turbo Pascal, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 8.0, VB.NET 9.0 | Leave a Comment »

Getting Microsoft Product Keys back from the registry (via StackOverflow and various other sources)

Posted by jpluimers on 2014/04/02

Every once in a while, someone hoses their computer far enough that it has to be reinstalled, but the original Microsoft product keys are misplaced, and some creepy anti-virus tool disallows the running of standard product key recovery tools like nirsoft’s.

Well, there is enough sourcecode that does recover it, just look for any of these strings:

Some hits:

The below full executables can trigger a virus warning (ordered from less often to most often):

–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, CommandLine, Delphi, Development, PowerShell, Software Development | Leave a Comment »

TFS/Visual Studio: View Pending Changes in Other Workspaces

Posted by jpluimers on 2014/04/01

For my reminder list: lots of people forget to checkin/undo changes in TFS of stuff automatically checked out by Visual Studio when investigating a problem in their program.

This shows how to view changes made by other users (always in other workspaces because they are not you).

You can do it from Visual Studio, of with the tf command line tool.

View Pending Changes in Other Workspaces.

–jeroen

Posted in Development, Software Development, Source Code Management, TFS (Team Foundation System), Visual Studio 11, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

Charset Detector :: Summary

Posted by jpluimers on 2014/03/31

In case I ever need it: [Wayback] Charset Detector :: Summary.

It is empirical (you cannot 100% reliably find out what character set / encoding a file is), but has a good score.

A similar problem is detecting the language. There too you can get a good score.

–jeroen

via:

Posted in .NET, C#, Delphi, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Encoding, Software Development | Leave a Comment »

smallestdotnet.com via: shanselman/SmallestDotNet (thanks @shanselman)

Posted by jpluimers on 2014/03/29

Brilliant piece of open source:

SmallestDotNetSmallestDotNet.com is a single page site that does one thing. It tells you the smallest, easiest download you’d need to get the .NET Framework on your system.

Even on Mac OS X it is helpful and recommends Mono and on iOS it recommends looking at MonoTouch.

Thanks Scott Hanselman for making this available!

–jeroen

via:

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, Apple, Development, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Software Development, Windows, Windows 7, Windows 8, Windows 8.1, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Tagged: , | Leave a Comment »

WinForms Container Controls 5: FlowLayoutPanel

Posted by jpluimers on 2014/03/24

When using a FlowLauyoutPanel, I always forget on which control the FlowBreak design time property / SetFlowBreak run time method operates.

Then I always end up writing a short demo program like Container Controls 5: FlowLayoutPanel.

It operates after the control on which you set it.

It is like text in a Word Processor: it breaks after the place where you set the break. Read the rest of this entry »

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, WinForms | Leave a Comment »

Mark Miller coding by Guitar: DevExpress Code Rush (Coding via Guitar)

Posted by jpluimers on 2014/03/21

Today I got a request from friend that never saw this: Mark Miller coding by Guitar using a CodeRush plugin.

For the people that never saw Mark Miller coding by Guitar (he did this many times on conferences around 2009/2010), watch the video here: DevExpress Code Rush (Coding via Guitar).

In the box on the left, scroll to Code Guitari, then play the video from there.

–jeroen

Posted in .NET, C#, Development, Software Development | Leave a Comment »

Podcast 106: Shipping | iDeveloper; about RemObjects C# and a lot of other stuff

Posted by jpluimers on 2014/03/13

Listen to Podcast 106: Shipping | iDeveloper.

A few notes:

  • RemObjects C# on iOS is based on LLVM, so I assume the other platforms use that too.
  • Both guys are really busy shipping stuff, and it is hard.

–jeroen

Posted in .NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, RemObjects C#, Software Development | 2 Comments »

.NET/C#/PowerShell: building .NET DiscUtils library for virtual disk images

Posted by jpluimers on 2014/03/11

Edit 20250107: added various [Wayback/Archive] archived links (dated as close to the blog post as possible) because of link-rot; marked some keywords as code; found the current .NET DiscUtils repository at [Wayback/Archive] GitHub – DiscUtils/DiscUtils: Utility libraries to interact with discs, filesystem formats and more where you also can download it.

 

.NET DiscUtils is an interesting open source .NET library for accessing and manipulating virtual disk images. Since it is entirely written in C# (without the need for P/Invoke), you should even be able to run this on non-Windows machines using mono. Later on, you will see the 0.11.0 build fails this, but it gives good hope it eventually will.

Virtual disk formats supported are DMG, ISO, RAW (IMG/IMA/VFD/FLP/BIF), VDI, VHD, VHDX, VMDK, and [Wayback/Archive] XVA, regular disks like Physical, iSCSI and NFS.

There are two ways of getting the .NET DiscUtils tools to run:

  1. [Wayback/Archive] download pre-build binaries (at the time of writing: version 0.10) from via [Wayback/Archive] .NET DiscUtils – Home, or
  2. from the [Wayback/Archive] latest source page, click the download button, then build the binaries from the source package. At the time of writing, that version is 0.11.

This post describes the second way, and requires PowerShell to be installed on your system (which probably is, as Windows 7 and Windows Server 2008 R2 include it). Read the rest of this entry »

Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, CommandLine, Development, PowerShell, Software Development | 1 Comment »

Sorting algorithms are art forms. Just see and hear how beatutiful they are.

Posted by jpluimers on 2014/03/10

Image and video art came through SORTING – A visualization of the most famous sorting algorithms and 15 Sorting Algorithms in 6 Minutes – YouTube.

Both via This is why I Code – Google+

Posted in .NET, Delphi, Development, Opinions, Software Development | 3 Comments »