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

Archive for September, 2015

HTTPS Everywhere Firefox/Chrome/Opera extension – Electronic Frontier Foundation

Posted by jpluimers on 2015/09/11

Over time this has become a must have: HTTPS Everywhere | Electronic Frontier Foundation developed by EFF and TOR.

Too bad many sites still do not work correctly with it.

This is especially true for places or networks where HTTP (or even worse HTTPS) is going through a MitM layer, for instance many mobile providers do this by injecting tracking bits to your traffic:

–jeroen

via: HTTPS Everywhere | Electronic Frontier Foundation.

Posted in https, Power User, Security | Leave a Comment »

Workaround for Delphi 2010 compiler error “E2076 This form of method call only allowed for class methods” when it infers a generic parameter type.

Posted by jpluimers on 2015/09/10

Generic support in Delphi took a very long time to get stabilised. Which means that compilers older than Delphi XE2 are hardly usable for code using generics. XE did get better, but Delphi 2010 and especially Delphi 2009 were hopeless.

A while ago, I bumped into another subtle error “E2076 This form of method call only allowed for class methods” when back-porting to Delphi 2010 the code like below calling the Spring4D unit Spring.SystemUtils which has a TEnum class that includes this TEnum.GetName<T> method:

    class function GetName<T>(const value: T): string; overload; static;

In Delphi XE and up, you do not have to specify the generic parameter T: the compiler automatically infers it.

In Delphi 2010, you have to, otherwise you will get the (totally unrelated!) error “E2076 This form of method call only allowed for class methods“.

Example code:


uses
Spring.SystemUtils;
procedure Test;
var
RuntimeError: TRuntimeError;
Name: string;
begin
RuntimeError := reNone;
// in the Spring.SystemUtils unit:
// class function TEnum.GetName<T>(const value: T): string;
// Workaround in Delphi 2010 (also works in Delphi XE+, but these do not require the Generic type to be specified).
Name := TEnum.GetName<TRuntimeError>(RuntimeError);
// Delphi 2010 does infer the type of the generic parameter, but then barfs with error E2076.
// Delphi XE+ infers the parameter type and do not generate an error: no need to explicitly specify the generic type:
Name := TEnum.GetName(RuntimeError); // Delphi 2010: [DCC Error] : E2076 This form of method call only allowed for class methods
end;

–jeroen

Posted in Delphi, Delphi 10 Seattle, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »

Delphi: rolling your own code or (dis)trusting the libraries that ship with Delphi?

Posted by jpluimers on 2015/09/09

Over the two decades I’ve come across a lot of Delphi projects.

All of them have one thing in common: even for functionality available in the Delphi libraries, much of that code was self-written.

You even see this in big libraries that have shipped with Delphi bit not originate from the Delphi team. Take Indy: lots of “roll your own” in it.

I’ve made some thoughts about that, and see these main causes with the points below.

What’s your thought on this?

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Delphi 10 Seattle, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Event, QC, Software Development | 1 Comment »

On why there is no Assert.AreEqual(T t1, T t2) where T: IEquatable – via Stack Overflow

Posted by jpluimers on 2015/09/08

On why there is no

Assert.AreEqual<T>(T t1, T t2) where T: IEquatable<T>

Interesting. And I need to give some thought because when calling Assert.AreEqual<T1, T2>(T1 object1, T2 object2) where T1 does not equal T2 will map to Assert.AreEqual(object, object) without compile time warning.

Assert.AreEqual(object, object) ultimately calls Assert.AreEqual<T>(T, T, String, Object[]) which calls Object.Equals(object, object) failing only at run-time.

This has bitten me too many times.

I wonder what NUnit provides here; will look into that later.

–jeroen

via: c# – Microsoft.VisualStudio.TestTools.UnitTesting.Assert generic method overloads behavior – Stack Overflow.

Posted in .NET, Agile, C#, C# 3.0, C# 4.0, C# 5.0, C# 6 (Roslyn), Development, MSTest, NUnit, Software Development, Testing.NET, Unit Testing, VSTest | Leave a Comment »

ICA client keyboard shortcuts

Posted by jpluimers on 2015/09/07

Too bad the Citrix Receiver remaps the keyboard shortcuts in a way that keyboards without a numeric keypad is a pain.

First of all, it was a bit tough to find the shortcuts, and I have not found a way to modify them.

Here is what I did find:

Read the rest of this entry »

Posted in Keyboards and Keyboard Shortcuts, Power User, Remote Desktop Protocol/MSTSC/Terminal Services, Windows | Leave a Comment »

Posted by jpluimers on 2015/09/06

logitech :: modula-2 :: Logitech Modula-2 Version 3.0 Turbo Pascal to Logitech Modula-2 Translator Sep87 http://bitsavers.trailing-edge.com/pdf/logitech/modula-2/Logitech_Modula-2_Version_3.0_Turbo_Pascal_to_Logitech_Modula-2_Translator_Sep87.pdf

Posted in Uncategorized | Leave a Comment »

Posted by jpluimers on 2015/09/06

logitech :: modula-2 :: Logitech Modula-2 Version 3.0 Turbo Pascal to Logitech Modula-2 Translator Sep87 http://bitsavers.trailing-edge.com/pdf/logitech/modula-2/Logitech_Modula-2_Version_3.0_Turbo_Pascal_to_Logitech_Modula-2_Translator_Sep87.pdf

Posted in Uncategorized | Leave a Comment »

Breaking Out of Citrix and other Restricted Desktop Environments Pen Test Partners

Posted by jpluimers on 2015/09/04

(:

Breaking Out of Citrix and other Restricted Desktop Environments Pen Test Partners.

Posted in Power User, Remote Desktop Protocol/MSTSC/Terminal Services, Windows | Leave a Comment »

TFS: sometimes “Object reference not set to an instance of an object” means “out of disk space”

Posted by jpluimers on 2015/09/03

A while ago, we encountered this error when doing merges in TFS (non-GIT ones):

---------------------------
Microsoft Visual Studio
---------------------------
Source Control Merge Wizard
Merge encountered 1 error(s) and 0 warning(s).
First error/warning encountered:
    Server was unable to process request. ---> Object reference not set to an instance of an object.
See output tool window for information on any other errors.
---------------------------
OK   Help
---------------------------

In the end this was caused by an out of disk space on the volume containing the TFS datastore.

–jeroen

Posted in Development, Software Development, Source Code Management, TFS (Team Foundation System) | 2 Comments »

Rudy’s Delphi Corner – Pitfalls of converting, on converting from C/C++ to Delphi

Posted by jpluimers on 2015/09/02

If ever in need to translate C/C++ headers or code to Delphi, this refernece by Rudy Velthuis – a dentist with a strong interest in programming – is the best I could find: Rudy’s Delphi Corner – Pitfalls of converting.

It is written in a pretty version agnostic way, and covers the vast majority of conversion topics.

And it has been updated over time numerous times.

–jeroen

Posted in Borland C++, C, C++, C++ Builder, Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 10 Comments »