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 March, 2013

Confusing Delphi message: [DCC Error] E2201 Need imported data reference ($G) to access ‘VarCopyProc’ from unit ‘XXX’

Posted by jpluimers on 2013/03/20

I recently had an error like this when building with packages:

[DCC Error] E2201 Need imported data reference ($G) to access 'VarCopyProc' from unit 'SynCommons'

It was a bit hard to find good information about this error, mainly because of two reasons:

  1. the documentation on E2201 Need imported data reference ($G) to access ‘%s’ from unit ‘%s’ isn’t very well written
  2. [dcc error] e2201 need imported data reference ($g) to access ‘varcopyproc’ from unit – Google Search doesn’t yield very good answers

Finally, it was the FastMM and D2007 – Delphi Language BASM – BorlandTalk.com thread pointing me to Hallvard’s Blog: Hack#13: Access globals faster ($ImportedData).

That explained the error was caused by:

  • VarCopyProc being a variable in one package
  • VarCopyProc access being needed from the package that failed to compile
  • Not having {$G+} or {$IMPORTEDDATA ON} in the failing package would prevent that access

Somehow that does not work for all cases. Apparently, the VarCopyProc isn’t exported from the Delphi RTL as that package is compiled in the $G- state.

So I had to add the USEPACKAGES define to the conditional defines list, which forces the SynCommons to use the standard version of the RecordCopy method in stead of a highly optimized one that calls VarCopyProc.

–jeroen

Posted in Delphi, Delphi XE2, Delphi XE3, Development, Software Development | 2 Comments »

OWC OWCSSDEX3G960 960GB Mercury Electra MAX 3G SSD… in stock at OWC

Posted by jpluimers on 2013/03/20

Awesome write speed while mirroring from my old Intel 320 600GB SSD (SATA) to the new OWC Mercury Electra MAX 3G 960GB SSD (USB3) on my ThinkPad W701.

On average more than 2GB per minute.

                Total    Copied   Skipped  Mismatch    FAILED    Extras
     Dirs :     27029     27028         1         0         0         0
    Files :    160965    160965         0         0         0         0
    Bytes : 546.499 g 546.499 g         0         0         0         0
    Times :   4:17:38   4:15:16                       0:00:00   0:02:22

    Speed :            38311787 Bytes/sec.
    Speed :            2192.218 MegaBytes/min.

    Ended : Mon Mar 18 22:16:36 2013

–jeroen

via: OWC OWCSSDEX3G960 960GB Mercury Electra MAX 3G SSD.

Posted in Hardware, Power User, SSD | Tagged: , , , , , | 3 Comments »

Absolutely awesome MacBook sticker! 

Posted by jpluimers on 2013/03/20

(19) Jeroen Pluimers – Google+ – Absolutely awesome MacBook sticker! .

Posted in About, Personal | Leave a Comment »

inessential.com: Brian’s Stupid Feed Tricks

Posted by jpluimers on 2013/03/20

If you think it’s easy to deal with RSS read this:

inessential.com: Brian’s Stupid Feed Tricks.

It reminds me so much about handling StUF.

–jeroen

Posted in Development, HTML, HTML5, SOAP/WebServices, Software Development, StUF, Web Development | Leave a Comment »

Porting Delphi 2006 to XE2, fields versus properties: tightened compiler error E2197

Posted by jpluimers on 2013/03/19

When porting some communications code that used records as properties from Delphi 2006 to Delphi XE2, I came across a tightened compiler error “E2197 Constant object cannot be passed as var parameter“.

Let me first explain the good old occurrence of E2197 with some code that uses my last Variant Records example:

Just look at TPacket.InitializePacket and TPacketBase.InitializeFPacket: Basically even though the Packet property has storage specifiers indicating it directly reads from a field and directly writes to a field, you cannot pass it as a var parameter in the FillChar method.

Of course you can with a field, you can pass it to FillChar without trouble as TPacketBase.InitializeFPacket shows. Read the rest of this entry »

Posted in Delphi, Delphi 2006, Delphi XE2, Delphi XE3, Development, Software Development | 3 Comments »

TSListUsers: great little console tool to list Remote Desktop / Terminal Services Users

Posted by jpluimers on 2013/03/18

Thanks to Joe KlemencicTSListUsers is a great little console tool that shows you the currently logged on users and which session they use:

List Terminal Services Users

TSListUsers is a command line utility to list both the currently connected and disconnected users, hostname, IP address and RDP session number on either the local or a remote Windows Terminal Server/RDP Server

To list the users, you need to have the following abilities:

  • NetBios access to the server
  • Permissions allowing you to Query RDP session information (if you can log into the TS, you should have this by default)
  • Terminal Services/RDP should be running on the target host

Usage:
TSListUsers.exe /? to get the Help text
TSListUsers.exe to query a target Terminal Server
TSListUsers.exe with no paramters to query the local host

You can download TSListUsers from here.

Example output of remote session:

C:\Windows>TSListUsers.exe
Active Connections:
Username, HostName(IP), SessID, RDP-Port
----------------------------------------
jeroenp, W701UJPL (192.168.71.34), 2, RDP-Tcp#92

Disconnected Connections:
Username, HostName, SessID
--------------------------

Example output of local session:

C:\Windows>TSListUsers.exe
Active Connections:
Username, HostName(IP), SessID, RDP-Port
----------------------------------------
jeroenp,  1, Console

Disconnected Connections:
Username, HostName, SessID
--------------------------

–jeroen

via List Terminal Services Users.

Posted in Power User, Remote Desktop Protocol/MSTSC/Terminal Services, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Leave a Comment »

Track My Runners : Results of NYC Half-Marathon 2013

Posted by jpluimers on 2013/03/17

Ran the NYC Half Marathon 2013 with my wife and friends today.

Here are the unofficial results through Track My Runners : Results.

I cannot copy the graph here, but it is interesting to the comparison of split times and average speeds on each 5K parts at Track My Runners : Graph. It struck me that both Conny and me ran a very flat second half.

You cannot run this event without taking some pictures; they are currently being uploaded here: Jeroen Pluimers – Google+ – NYC Half-Marathon 2013.

NAME MARKER BIB GENDER CITY COUNTRY BACK TO RESULTS
Jeroen Pluimers 14522 M Amsterdam Netherlands
DISTANCE TIME OF DAY ELAPSED TIME EST. FINISH PACE/MILE
5K 08:18:10 AM 0:31:30.05 09:59:22 AM 10:07.73
10K 08:51:16 AM 1:04:35.95 10:02:57 AM 10:24.14
15K 09:26:17 AM 1:39:36.57 10:06:41 AM 10:41.26
DISTANCE TIME OF DAY ELAPSED TIME EST. FINISH PACE/MILE
20K 10:00:14 AM 2:13:34.07 10:07:26 AM 10:44.73
FINISH 10:07:41 AM 2:21:02 10:07:41 AM 10:46
NAME MARKER BIB GENDER CITY COUNTRY BACK TO RESULTS
Nicolette van Cronenburg 14648 F Amsterdam Netherlands
DISTANCE TIME OF DAY ELAPSED TIME EST. FINISH PACE/MILE
5K 08:21:06 AM 0:34:17.06 10:11:14 AM 11:01.43
10K 08:59:20 AM 1:12:31.30 10:19:48 AM 11:40.69
15K 09:38:43 AM 1:51:53.93 10:24:06 AM 12:00.37
DISTANCE TIME OF DAY ELAPSED TIME EST. FINISH PACE/MILE
20K 10:18:41 AM 2:31:52.20 10:26:52 AM 12:13.08
FINISH 10:27:19 AM 2:40:31 10:27:19 AM 12:16

 

NAME MARKER BIB GENDER CITY COUNTRY BACK TO RESULTS
Elke Van Erp 14650 F Amsterdam Netherlands
DISTANCE TIME OF DAY ELAPSED TIME EST. FINISH PACE/MILE
5K 08:22:40 AM 0:35:30.96 10:16:45 AM 11:25.19
10K 09:02:01 AM 1:14:51.62 10:25:04 AM 12:03.28
15K 09:42:28 AM 1:55:19.13 10:29:15 AM 12:22.39
DISTANCE TIME OF DAY ELAPSED TIME EST. FINISH PACE/MILE
20K 10:23:41 AM 2:36:31.60 10:32:07 AM 12:35.55
FINISH 10:32:16 AM 2:45:07 10:32:16 AM 12:37
NAME MARKER BIB GENDER CITY COUNTRY BACK TO RESULTS
Conny Slagboom 14596 F Duivendrecht Netherlands
DISTANCE TIME OF DAY ELAPSED TIME EST. FINISH PACE/MILE
5K 08:30:17 AM 0:43:07.70 10:48:49 AM 13:52.05
10K 09:17:38 AM 1:30:28.07 10:58:00 AM 14:34.08
15K 10:01:30 AM 2:14:21.04 10:56:00 AM 14:24.91
DISTANCE TIME OF DAY ELAPSED TIME EST. FINISH PACE/MILE
20K 10:46:01 AM 2:58:51.51 10:55:39 AM 14:23.35
FINISH 10:55:34 AM 3:08:25 10:55:34 AM 14:23

–jeroen

Posted in About, Personal | Leave a Comment »

ntfs – How do you find what process is holding a file open in Windows? – Server Fault

Posted by jpluimers on 2013/03/15

First a warning: when you have found the process holding open a file, and you want to forcibly close the handle, read this post why you should not: Windows Confidential: Forcing Handles Closed.

In fact:

if you forcibly need to close a handle to salvage something, you should reboot shortly afterwards.

Back to the question at hand:

How do you find what process is holding a file open in Windows?

One thing that annoys me no end about Windows is the old “sharing violation” error. Often you can’t identify what’s holding it open. Usually it’s just an editor or explorer just pointing to a relevant directory but sometimes I’ve had to resort to rebooting my machine.

Any suggestions on how to find the culprit?

All of the below solutions require you to run with Administrative privileges.

On current Windows versions, if you run them without UAC elevation, they will miss a lot of processes. And still: under some secured environments you won’t see all processes anyway.

My preferred answer is not on the list:

Quit the application that holds the handle

All the tools that show you the handles will indicate which process holds the handle.

Often, you can just quit that process, do your job on the affected file, then relaunch that process.

When the process is Explorer, there is a neat little trick that works for Windows Vista and up:

For explorer, btw, hold ctrl-shift and right-click a blank area of the start menu, and you’ll get “Exit Explorer” – ps, not quite Jeff’s answer.. – Mark Sowul

Another answer I like is to use Handle, as it is both a command-line tool, and allows for wildcard searching: Read the rest of this entry »

Posted in Conference Topics, Conferences, Event, Power User, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Leave a Comment »

Retina users, this fixes your fan issue: Apple Releases Retina MacBook Pro SMC Update (via: Mac Rumors)

Posted by jpluimers on 2013/03/14

Today, Apple released SMC version 1.1 for MacBook Pro machines that especially Retina owners will like: it fixes their fan issue that has been present for months, but caused some stir lately.

Apple rushed this update. In fact, it is so new, not even EFI and SMC firmware updates for Intel-based Macs lists it.

It affects both mid 2012 and early 2013 models.

This is how to update:

I had the same problem with the basic installation. Just do the OSX updates from the App Store and the problem will disappear.

Lots of users are reporting the below SMC update fixes the fan issue.

It worked for my MacBook Retina too.

–jeroen

via:Apple Releases Retina MacBook Pro SMC Update to Address Gaming Frame Rates and Fan Issues – Mac Rumors.

Posted in Apple, Mac, MacBook, MacBook Retina, Power User | Tagged: , , , | Leave a Comment »

Google Reader stops at 2013-07-01: How can I download my Reader data? (via: Reader Help)

Posted by jpluimers on 2013/03/14

Google Reader will not be available after July 1, 2013

Learn more.

Reminder to self:

Edit; this Dutch post covered it nicely: Wat zijn alternatieven voor Google Reader?.

Google stopt per 1 juli met Google Reader – IT Pro – Nieuws – Tweakers.

–jeroen

via:

Posted in About, Google, Personal, Power User | 1 Comment »