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

Archive for 2015

Using httpbin to test http/https requests

Posted by jpluimers on 2015/09/15

StackOverflow user Kenneth Reitz has written a great on-line and free httpbin tool that responds to many kinds of http/https requests including the standaard http request methods (or verbs) used by REST: get, post (for http 1.0) and patch, put, delete (for http 1.1).

These verbs are not supported: head (http 1.0) and trace, options, connect (http 1.1).

The site is geared towards JSON (as most the responses are in JSON, except for one XML response and a few TEXT responses), but even if your environment does not use JSON, it is very useful as you basically get an echo of information on what you pass to it.

Except one endpoint (/encoding/utf8), none of the response encodings can be determined by the request. This is a pity as sometimes it is good to see how a specific encoding works for JSON, but it is very hard to support encodings well, so I can understand the support is not there (or not there yet).

There are many examples on the site, which I won’t list.

There are at least two sites hosting them. The original supports HTTP and HTTPS only, but the ngHttp2 people also support HTTP2 and SPDY:

What I do list are the endpoints as copied from the site on 20141228:

Read the rest of this entry »

Posted in .NET, Delphi, Development, HTTP, Internet protocol suite, REST, Software Development, TCP | Leave a Comment »

A few links on modifying Windows console (cmd.exe) appearance and behaviour (registry settings, commands, etc)

Posted by jpluimers on 2015/09/14

For my own link archive:

Modify cmd.exe properties using the command prompt – Stack Overflow.

On:

  • mode con: cols=XX lines=YY
  • HKLM and HKCU keys Software\Microsoft\Command Processor\CompletionChar with values like CompletionChar and PathCompletionChar

windows – How to change Screen buffer size in DOS Command Prompt from batch script – Stack Overflow.

On setting the cmd.exe parameters through the registry

  • values like ScreenBufferSize and WindowSize
  • setting the values from the .NET Console class with properties like WindowWidth, BufferWidth and BufferHeight

Microsoft Windows XP – Configure the command prompt.

On setting it through the properties for your console prompt.

For Batch – Where is CMD.EXE options stored?.

On setting the registry values for various console window titles.

–jeroen

Posted in Console (command prompt window), Power User, Windows | Leave a Comment »

Introducing the new Microsoft Remote Desktop Preview app for Mac – Remote Desktop Services (Terminal Services) Team Blog – Site Home – MSDN Blogs

Posted by jpluimers on 2015/09/11

During the last update of Microsoft Remote Desktop for my Mac, I noticed there is a beta available with a feature very familiar for users of visionapp – ASG-Remote Desktop: it allows you to manage common credentials.

Note the uncommon URLs of both the beta page redirect and the download:

In the mean time, I learned that “Microsoft has acquired HockeyApp. This is a tremendous opportunity to continue to provide developers with the best app development tools and users with the best app experiences.”, but the aka.ms is new to me. Anyone knows what it is about? A successor of go.microsoft.com/fwlink redirects?

New Mac OS X beta of Microsoft Remote Desktop announced.

New Mac OS X beta of Microsoft Remote Desktop announced.

I’m keeping an eye on this, as future features interest me much: Multiple monitors, Clipboard redirection, Remote Desktop Gateway, Remote Resources (RemoteApp and Desktop Connections), and Azure RemoteApp preview.

BTW: I wasn’t aware Remote Desktop made it this many platforms yet, as I’m mainly a Windows 8.x/7, Mac and Android user, but here you go:

  1. Windows 10 Universal Windows platform (Preview).
  2. Windows 8.1.
  3. Windows Phone.
  4. iOS.
  5. Mac OS X.
  6. Android.

–jeroen

via:

Posted in Apple, Mac, Mac OS X / OS X / MacOS, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Remote Desktop Protocol/MSTSC/Terminal Services, Windows | 1 Comment »

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 »