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

Archive for 2014

Thomas Kang – Google+ – I found these conversions some time back on the web and was…

Posted by jpluimers on 2014/02/07

I almost wetted my pants:

common conversions

–jeroen

via: Thomas Kang – Google+ – I found these conversions some time back on the web and was….

Posted in Comics | Leave a Comment »

Create a Bootable USB Key Thumb Drive in Windows Vista/7 with the Command Line

Posted by jpluimers on 2014/02/07

Open a command prompt with administrator rights and enter the following sequence of commands:

  • diskpart
  • list disk
  • select disk {number}
  • clean
  • create partition primary
  • select partition 1
  • active
  • format fs=fat32 quick
  • assign
  • exit

Which was for experimenting with a few of the entries in Top 5 Free Rescue Discs for Your Sys Admin Toolkit and Kaspersky Rescue Disk 10.

I think I like Download Hiren’s BootCD 15.2 | HBCD Fan & Discussion Platform most.

Another way to get it on a USB stick is through Launching Hiren’s BootCD from USB Flash Drive | HBCD Fan & Discussion Platform.

Wiping out the HPA and DCO stays difficult though: linux – Harddrive – wipe out “hidden areas” like HPA and DCO also after malware infection – Super User.

–jeroen

via: Create a Bootable USB Key Thumb Drive in Windows Vista/7 with the Command Line and Best Free Rootkit Scanner and Remover and Five free portable rootkit removers – TechRepublic and Utility Spotlight: Scan for Malware Outside of Windows | TechNet Magazine and What Is a Host Protected Area?.

Posted in Power User, Windows, Windows 7, Windows 8 | Leave a Comment »

KnowRoaming | Reduce Roaming Fees

Posted by jpluimers on 2014/02/06

Interesting: reducing phone costs when abroad. KnowRoaming | Reduce Roaming Fees.

Posted in LifeHacker, Power User | Leave a Comment »

Voorkom hoge belkosten met Fritz!Box: zet remote access en MyFritz! uit; misbruik telefonie aan de gang

Posted by jpluimers on 2014/02/06

Zelf ben ik klant bij xs4all, maar het komt ook bij andere Nederlandse en buitenlandse (met name Duitse) gebruikers van Fritz!Box apparatuur voor: ineens enorm hoge belkosten.

Gelukkig was bij mij alles goed ingesteld, en had ik geen MyFritz! actief, dus (nog?) geen misbruik hier.

Onderstaande heb ik gepost op de Tweakers.net site. Een deel is generiek, en een deel specifiek voor xs4all: Read the rest of this entry »

Posted in Power User | Leave a Comment »

.NET/C#: When XmlSerializer throws “Unable to generate a temporary class (result=1).” / “error CS2001”

Posted by jpluimers on 2014/02/06

A while ago, I had this error when running an application on a hardened server:

Unhandled Exception:System.InvalidOperationException:
Unable to generate a temporary class (result=1).
error CS2001: Source file 'C:\windows\TEMP\0hocq2nq.0.cs' could not be found  error CS2008: No inputs specified
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, String defaultNamespace, String location, Evidence evidence)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, String defaultNamespace, String location)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, Type[] extraTypes)

Usually I’m not the first with strange errors, but searching for “Unhandled Exception:System.InvalidOperationException: Unable to generate a temporary class” didn’t get many results.

This was a program running from SSIS under a non-system domain account with very little access.

My first guess was the right now: the XmlSerializer wants to generate a temporary C# file, then compile it into a temporary assembly. Since it cannot generate the C# file because the account does not have access to %windir\TEMP%, the compiler cannot find the (not generated) C# file.

After a few tries, I searched for XmlSerializer without GenerateAssembly, where the first hit ended at Changing where XmlSerializer Outputs Temporary Assemblies – Scott Hanselman.

That post indicated I should try looking for tempFilesLocation in the XmlSerializer context.

That got me these posts: 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, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »

.NET/C#/VB.NET – Default value for generics (via: Stack Overflow)

Posted by jpluimers on 2014/02/05

Looking for the pesky little differences between C# and VB.NET, I stumbled over this nice question by Micah Martin on default values for generics in VB.NET as compared to C#. Actually there were 3 questions, so I did a bit of post-editing:

How do I create the default for a generic in VB.NET? in C# I can call:
T variable = default(T);

  1. How do I do this in VB?
  2. If this just returns null (C#) or nothing (VB.NET) then what happens to value types?
  3. Is there a way to specify for a custom type what the default value is? For instance what if I want the default value to be the equivalent to calling a parameterless constructor on my class.

User Konrad Rudolph – Stack Overflow. promptly gave three answers:

Question 1:

Dim variable As T ‘ or ‘ Dim variable As T = Nothing ‘ or ‘ Dim variable As New T() Notice that the latter only works if you specifiy either the New or the Structure constraint for the generic type.

Question 2:

For value types all members of the struct are “nulled” out, i.e. all reference type members are set to null (Nothing) and all value types are in turn nulled out. And no, since string is a reference type, it does not result in "" for strings as suggested in the other answer.

Question 3:

No, there’s no way to specify this. There are some threads about this on Stack Overflow already, e.g. here. Jon has posted an excellent explanation why this is.

–jeroen

via: c# – Default value for generics – Stack Overflow.

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, Development, 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 »

Contact — Support — WordPress.com

Posted by jpluimers on 2014/02/05

Paying customers can use Contact — Support — WordPress.com.

Sometimes they respond sooner than on a regular forum post. Not often though.

–jeroen

Posted in Power User, SocialMedia, WordPress | Leave a Comment »

How can you force SQL Server 2008 R2 to accept an ORDER BY on a column that is not part of a table? – Stack Overflow

Posted by jpluimers on 2014/02/04

I’m sure there are many organizations that only upgrade things until they absolutely have to (i.e. long after mainstream support has ended, often even after extended support has ended). This was from last year: upgrading away from SQL Server 2000 just before extended support ended. While migrating a bunch of applications we inherited from SQL Server 2000 to SQL Server 2008 R2, I came across an ORDER BY style that failed. The queries are generated by an kind of SQL generation layer, so not easy to change. the main questions were:

  • is it possible to force SQL Server 2008 R2 to accept this kind of queries and perform the SQL Server 2000 behaviour (so we can fix the SQL generation layer, and perform regression on it)?
  • why would SQL Server 2000 happily accept this kind of queries?

First two possible fixes, then the full stack overflow question I posted about the migration.

Aaron Bertrand very quickly posted two fixes, which I paraphrased and extended. Read the rest of this entry »

Posted in Database Development, Development, SQL Server, SQL Server 2000, SQL Server 2008 R2 | Leave a Comment »

Why the Heck is Git so Hard? | Probably Done Before

Posted by jpluimers on 2014/02/04

Why the Heck is Git so Hard? | Probably Done Before is wonderful, especially as it points to workspace • Git Cheatsheet • NDP Software.

And I really like this hacker news comment on it: Read the rest of this entry »

Posted in Development, DVCS - Distributed Version Control, git, Source Code Management | 2 Comments »

Display Windows 8.x Edition & Build Version on Your Desktop (via: Team Windows 8)

Posted by jpluimers on 2014/02/04

Display Windows 8 Edition & Build Version on Your Desktop | Team Windows 8:

Two keys needed: one HKCU one HKLM. You need to be Administrative user with a CUA token to install the second one.


Windows Registry Editor Version 5.00
;http://teamwindows8.com/2013/03/display-windows-8-edition-build-version-on-your-desktop/
[HKEY_CURRENT_USER\Control Panel\Desktop]
"PaintDesktopVersion"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows]
"DisplayVersion"=dword:00000001

–jeroen

Posted in Power User, Windows, Windows 8 | Leave a Comment »