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

When using Apple Hardware, be prepared for security updates. iOS already there, OS X and others will follow. #gotofail

Posted by jpluimers on 2014/02/24

Last week, Apple fixed the so called #gotofail bug for iOS devices. Other devices (Macs with OS X 10.9 Mavericks, maybe earlier versions and I also suspect Apple TV to be vulnerable) will follow soon.

I thought that Old iOS devices would be in the dark as the updates are for iOS 6.x and 7.x only. So any device that can only run on iOS 5 or lower might not be supported.

So I thought these devices would be unsupported, but found out an iPad 1st generation would pass the gotofail.com test.

So if you have any of these, please let me know if they fail or pass:

  • iPhone 3 or earlier,
  • iPod Touch 3rd generation or earlier,
  • iPad 1st generation: passes.

Please watch any security announcements carefully with using Apple equipment, as the bug can highly facilitate a man-in-the-middle attack.

Some other site with background information (it hit the news wildly): Read the rest of this entry »

Posted in Apple, Development, iOS, iPad, iPhone, iPod, iPod touch, Mac, Mac OS X / OS X / MacOS, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, OS X 10.9 Mavericks, Power User, Software Development | 1 Comment »

MSTSC/Remote Desktop Connection .RDP and Registry Settings links

Posted by jpluimers on 2014/02/24

Before I forget:

Got there because I lost the “Connection Bar” of MSTSC, and this solved it:

HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
"PinConnectionBar" = REG_DWORD:1

Will make the connection bar pinned.

–jeroen

via: Connection bar stay pinned.

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

Coding in Delphi available in printed form: USD $40 + shipping

Posted by jpluimers on 2014/02/24

On my way back from France, I noted the printed edition of Coding in Delphi has become available through CreateSpace (which is Amazon’s self publishing mechanism):

Coding in Delphi is a new programming book by Nick Hodges that covers a variety of powerful Delphi programming features and techniques including Generics, Interfaces, Exception, Handling, Anonymous Methods, Collections, RTTI, Enumerators, Attributes, Dependency Injection and Unit Testing

  • Publication Date: Feb 22 2014
  • ISBN/EAN13: 1941266037 / 9781941266038
  • Page Count: 242
  • Binding Type: US Trade Paper
  • Trim Size: 8.5″ x 11″
  • Language: English
  • Color: Black and White
  • Related Categories: Computers / Programming / Software Development

In related news: his paper and recored Rad in Action session about Unit Testing is also available.

via:

Posted in Delphi, Development, Software Development | 5 Comments »

Steps to take when WordPress.com Publicize/Sharing to Facebook breaks (via: WordPress.com Forums)

Posted by jpluimers on 2014/02/21

Every couple of months, WordPress.com posts do not arrive on FaceBook

A few quotes, the last one is what I found out myself after reading the first post:

raincoaster:

sharing and Publicize are two different things. You have to manually Share. Publicize is automatic.

Facebook continuously changes things and you may have to disconnect the Publicize to Facebook, clear your Facebook Cache, and reconnect.

jpluimers:

@raincoaster how do I clear my Facebook cache?

The /wp-admin/options-general.php?page=sharing page is a bit confusing: the title is “sharing,” but it is indeed about “publicizie”. In that page, Facebook is connected, and all my posts are marked as publicize to Facebook.

jpluimers:

No need to clear the Facebook cache.

The trick is to

  1. read the topic at http://en.forums.wordpress.com/topic/publicize-to-facebook-not-working-1?replies=11
  2. then follow the Publicize — Support — WordPress.com steps here: http://en.support.wordpress.com/publicize/#reconnecting-facebook
  3. and here: http://en.support.wordpress.com/publicize/#facebook

–jeroen

via: Sharing at facebook.com broken since august 1st? « WordPress.com Forums.

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

Koushik Dutta – Google+ – Building a new hackintosh. Found my case.…

Posted by jpluimers on 2014/02/21

Koushik Dutta – Google+ – Building a new hackintosh. Found my case..

(:

–jeroen

Posted in Uncategorized | Leave a Comment »

Enabling HgFlow in SourceTree for Windows: “abort: No module named ConfigParser!” error message with “flow: Flow was already initialized for workspace:”

Posted by jpluimers on 2014/02/20

When you get the below error when adding an HgGlow with SourceTree, then do one of these:

Short error message:

hg flow -y -f init
abort: No module named ConfigParser!

Full error message (the middle line is funny “flow: Flow was already initialized for workspace:”):


hg flow -y -f init
abort: No module named ConfigParser!
flow: Flow was already initialized for workspace:
Completed with errors, see above.

view raw

error.txt

hosted with ❤ by GitHub

Ultimately, hgflow should fix yinwm / hgflow / issues / #8 – Failing on Windows Binary version, but they haven’t for almost 3 years now.

–jeroen

Posted in Development, DVCS - Distributed Version Control, Mercurial/Hg, Software Development, Source Code Management | Tagged: , | Leave a Comment »

Hidden Features in Delphi related topics (from StackOverflow, until the diamond moderators kill these too)

Posted by jpluimers on 2014/02/20

There are (soon probably “were”) a few very interesting Q&A threads on Stack Overflow in the “Hidden Secrets of” series on Delphi related topics.

I sort of can get (but don’t agree: there is a very good voting system to de-emphasize material that is not useful, but who am I to argue with the minority of “the world is black and white, we just follow the rules” diamondss) that these get closed, but cannot get that very useful material gets deleted for anyone with less than 10-thousand reputation.

–jeroen

@Jeroen & David, I’ve deleted my off-topic comments from here. Could you do the same, please ? I’ve also asked moderators to delete my meta question as it seems the users there are not even humans. Never mind. Stack Overflow is not what it was few years ago as I observe. It’s getting worse. Another piece to this mosaic was running the portuguese version of Stack Overflow ideal for cross posting between the sites.

Posted in Delphi, Development, Software Development | Tagged: | 8 Comments »

How to Use Your Google Maps — Offline | Gadget Lab | Wired.com

Posted by jpluimers on 2014/02/20

Will try this in France this weekend: via: How to Use Your Google Maps — Offline | Gadget Lab | Wired.com.

And if it fails, I have CityMaps 2Go Offline Maps and a downloaded map with me as well.

Here’s how to do it. Read the rest of this entry »

Posted in Android Devices, Google, Nexus 4, Power User | Leave a Comment »

Delphi: the Factory Pattern with virtual Create Constructors (via: What Design Patterns do you implement in common Delphi programming? – Stack Overflow)

Posted by jpluimers on 2014/02/20

Delphi Component Design

Delphi Component Design

From long ago, but still very valid, as I recently had another question like “what design patterns does Delphi use?”.

The Delphi usage of patterns to make the VCL and your applications work is one of the reasons I like the Delphi Component Design: Danny Thorpe so much.
Do not let you scare by the book title: a lot of information in this book is much broader than designing components.
It is about why and how things are done in the RTL and VCL, and which patterns you can use yourself.

Try and git it while you can still get it. It is excellent, but rare to get as it has been out of print for a while.

Only a minority of the Delphi developers knows that every Delphi developer uses a Factory pattern (delphi.about.com has an example in “regular” Delphi), but then implemented using virtual Create constructors.

So: time to shed some light on that :-)

Virtual constructors are to classes like virtual methods are like object instances.

The whole idea of the factory pattern is that you decouple the logic that determines what kind (in this case “class”) of thing (in this case “object instance”) to create from the actual creation.

It works like this using virtual Create constructors:

TComponent has a virtual Create constructor so, which can be overridden by any descending class:

type
  TComponent = class(TPersistent, ...)
    constructor Create(AOwner: TComponent); virtual;
    ...
  end;

For instance the TDirectoryListBox.Create constructor overrides it:

type
  TDirectoryListBox = class(...)
    constructor Create(AOwner: TComponent); override;
    ...
  end;

You can store a class reference (the class analogy to an object instance reference) in a variable of type ‘class type’. For component classes, there is a predefined type TComponentClass in the Classes unit:

type
  TComponentClass = class of TComponent;

When you have a variable (or parameter) of type TComponentClass, you can do polymorphic construction, which is very very similar to the factory pattern:

var
  ClassToCreate: TComponentClass;

...

procedure SomeMethodInSomeUnit;
begin
  ClassToCreate := TButton;
end;

...

procedure AnotherMethodInAnotherUnit;
var
  CreatedComponent: TComponent;
begin
  CreatedComponent := ClassToCreate.Create(Application);
  ...
end;

The Delphi RTL uses this for instance here:

Result := TComponentClass(FindClass(ReadStr)).Create(nil);

and here:

// create another instance of this kind of grid
SubGrid := TCustomDBGrid(TComponentClass(Self.ClassType).Create(Self));

The first use in the Delphi RTL is how the whole creation process works of forms, datamodules, frames and components that are being read from a DFM file.

The form (datamodule/frame/…) classes actually have a (published) list of components that are on the form (datamodule/frame/…). That list includes for each component the instance name and the class reference.
When reading the DFM files, the Delphi RTL then:

  1. finds about the components instance name,
  2. uses that name to find the underlying class reference,
  3. then uses the class reference to dynamically create the correct object

A regular Delphi developer usually never sees that happen, but without it, the whole Delphi RAD experience would not exist.

Allen Bauer (the Chief Scientist at Embarcadero), wrote a short blog article about this topic as well.
There is also a SO question about where virtual constructors are being used.

Let me know if that was enough light on the virtual Create constructor topic :-)

–jeroen via: What Design Patterns do you implement in common Delphi programming? – Stack Overflow.

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Tagged: , | 4 Comments »

HTTP protocol requires you to escape spaces (usually with %20 or with +), but web-browsers will do that for you

Posted by jpluimers on 2014/02/20

Since the time that spaces are allowed in path and file names, it has caused confusion.

I personally like the readability of  spaces, but still tend to avoid them as they usually cause more harm than the readability gains.

An interesting thread about spaces in file names is operating systems – What technical reasons exist for not using space characters in file names? – Super User.

In URLs, you there are various kinds of places where spaces can be used. You have to escape as Xah Lee wonders in does HTTP protocol require space be encoded in file path?.

The escaping is part of the URL Encoding, but the escapes depends on the position of the space. In the query part (after the first ?), you can have it escaped by both %20 and plus sign, but in the path part (before the first ? sign), it can only have a %20.

This is explained by bobince in urlencode – when to encode space to plus (+) and when to %20? – Stack Overflow.

That escaping basically makes path and file names a lot less readable when passed as a URL. It causes posts like these:

But why can you still use spaces when you type a URL in your web browser, or use it in a href, src or other HTML URL attribute?

Xah Lee rightfully earlier wondered about that in webserver – space in url; did browser got smarter or server? – Stack Overflow.

Technically, both are not allowed. But web browser manufacturers understand we humans are lazy, and accommodate for that by encoding these when putting them into the HTTP request.

You can type “https://www.google.com/search?q=foo bar” in your web browser, and depending on the browser, it gets translated into either one of these:

Recap:

  • encode spaces in URLs as %20
  • try to avoid spaces in path and filenames

–jeroen

via:

Posted in Development, Encoding, HTML, Software Development, URL Encoding, Web Development | Leave a Comment »