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 July, 2014

TortoiseSvn – How do I move a file (or folder) from one folder to another (via: Stack Overflow)

Posted by jpluimers on 2014/07/31

It is the second – italic – paragraph what I always forget. Thanks Mark Embling!

To move a file or set of files using tortoise, right-click-and-drag the target files to their destination and release the right mouse button. The popup menu will have a ‘SVN move versioned files here’ option.

Note that the destination folder must have already been added to the repository for the ‘SVN move versioned files here’ option to appear.

Yes, it is also in the TortoiseSVN documentation under Deleting, Moving and Renaming and Copying/Moving/Renaming Files and Folders. But those are lacking emphasis on the the italic stuff.

–jeroen

via svn – How do I move a file (or folder) from one folder to another in TortoiseSVN? – Stack Overflow.

Posted in Development, Software Development, Source Code Management, Subversion/SVN | Leave a Comment »

Delphi: mapping of COM/Windows exceptions to Delphi Exceptions and run-time errors

Posted by jpluimers on 2014/07/30

Every time

---------------------------
Debugger Exception Notification
---------------------------
Project Some.exe raised exception class $C0000005 with message 'access violation at 0x00537b14: read of address 0x00000000'.
---------------------------
Break   Continue   Help
---------------------------

'Exception "EAccessViolation" with message "Access violation at address 00537B30 in module ''TestWordInterface.exe''. Read of address 00000000" at address 00537B30'

---------------------------
Testwordinterface
---------------------------
Access violation at address 00537B14 in module 'Some.exe'. Read of address 00000000.
---------------------------
OK
---------------------------

In system.pas:

{$IFDEF STACK_BASED_EXCEPTIONS}
procedure       MapToRunError(P: PExceptionRecord); stdcall;
const
  STATUS_ACCESS_VIOLATION         = $C0000005;
  STATUS_ARRAY_BOUNDS_EXCEEDED    = $C000008C;
  STATUS_FLOAT_DENORMAL_OPERAND   = $C000008D;
  STATUS_FLOAT_DIVIDE_BY_ZERO     = $C000008E;
  STATUS_FLOAT_INEXACT_RESULT     = $C000008F;
  STATUS_FLOAT_INVALID_OPERATION  = $C0000090;
  STATUS_FLOAT_OVERFLOW           = $C0000091;
  STATUS_FLOAT_STACK_CHECK        = $C0000092;
  STATUS_FLOAT_UNDERFLOW          = $C0000093;
  STATUS_INTEGER_DIVIDE_BY_ZERO   = $C0000094;
  STATUS_INTEGER_OVERFLOW         = $C0000095;
  STATUS_PRIVILEGED_INSTRUCTION   = $C0000096;
  STATUS_STACK_OVERFLOW           = $C00000FD;
  STATUS_CONTROL_C_EXIT           = $C000013A;
var
  ErrCode: Byte;
begin
  case P.ExceptionCode of
    STATUS_INTEGER_DIVIDE_BY_ZERO:  ErrCode := 200; { reDivByZero }
    STATUS_ARRAY_BOUNDS_EXCEEDED:   ErrCode := 201; { reRangeError }
    STATUS_FLOAT_OVERFLOW:          ErrCode := 205; { reOverflow }
    STATUS_FLOAT_INEXACT_RESULT,
    STATUS_FLOAT_INVALID_OPERATION,
    STATUS_FLOAT_STACK_CHECK:       ErrCode := 207; { reInvalidOp }
    STATUS_FLOAT_DIVIDE_BY_ZERO:    ErrCode := 200; { reZeroDivide }
    STATUS_INTEGER_OVERFLOW:        ErrCode := 215; { reIntOverflow}
    STATUS_FLOAT_UNDERFLOW,
    STATUS_FLOAT_DENORMAL_OPERAND:  ErrCode := 206; { reUnderflow }
    STATUS_ACCESS_VIOLATION:        ErrCode := 216; { reAccessViolation }
    STATUS_PRIVILEGED_INSTRUCTION:  ErrCode := 218; { rePrivInstruction }
    STATUS_CONTROL_C_EXIT:          ErrCode := 217; { reControlBreak }
    STATUS_STACK_OVERFLOW:          ErrCode := 202; { reStackOverflow }
  else                              ErrCode := 255;
  end;
  RunErrorAt(ErrCode, P.ExceptionAddress);
end;

Posted in Algorithms, Development, Floating point handling, Software Development, Uncategorized | Leave a Comment »

Delphi: workaround for when you loose many of the ModelMaker Code Explorer keyboard shortcuts

Posted by jpluimers on 2014/07/29

ModelMaker Code Explorer (MMX for short) stores the keyboard shortcuts in the registry.

I’ve had it occur once that somehow most (about 95%) of the shortcuts got lost.

Two thinks I learned from resurrecting the shortcuts:

  • MMX writes these settings when you exit Delphi
  • Only a few keys (with lots of values under them) store the keys.

To resurrect them,

Read the rest of this entry »

Posted in Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Software Development | Leave a Comment »

Linux: no more correct license file for AntiVir

Posted by jpluimers on 2014/07/28

A short while ago, I wrote about Linux: getting the correct license file for AntiVir.

Too bad that I recently read about the Discontinuation of Antivirus solutions for Linux systems on June 30th 2016.

This means the hbedv.key cannot be downloaded any more.

–jeroen

Posted in *nix, Power User | Leave a Comment »

Pin layouts of hardware

Posted by jpluimers on 2014/07/28

This is yet another post of some information I wish I had known years ago.

AllPinouts: a site that lists pin layouts of common and not so common hardware.

When writing this, the site had Statistics indicating over 3500 pages and close to 1000 pin layouts.

Layouts include cables and connectors for audio, video, computing and much much more.

These were the pin layouts I needed:

I found the 3 and 4 pin layouts also on this page: Desktop Boards — 3-wire and 4-wire fan connectors.

Another site with lots of Power Connectors is Toms Hardware. A good starting page is Additional Power Connectors: Peripheral, Floppy, And SATA – Power Supply 101: A Reference Of Specifications.

The reason I needed it was to add a front case fan to a couple of HP XW6600 workstations in order to improve cooling.

Both 80mm and 92mm fans will fit.

A couple of links:

–jeroen

Posted in Hardware, HP XW6600, Power User, Virtualization | Leave a Comment »

Mac/PC: sending Wake-on-LAN (WOL) packets

Posted by jpluimers on 2014/07/25

I’ve succesfully woken up these machines:

  • HP XW6600 running ESXi 5.1
  • ThinkPad W701U running Windows 7

I still need to try to wake up a Mac Mini Server running OS X 10.6 (Snow Leopard).

MacBook Air on 10.7 (Lion) and Retina on 10.8 (Mountain Lion) won’t work as they are WiFi only, and WOL does not work over WiFi.

On 10.7 and up it might not work on a Mac Mini Server either, as Apple Introduced Dark Wake.

I used these tools to send WOL packets: Read the rest of this entry »

Posted in *nix, Apple, ESXi5.1, Ethernet, Hardware, HP XW6600, Linux, Mac OS X / OS X / MacOS, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, Network-and-equipment, openSuSE, OS X 10.8 Mountain Lion, Power User, SuSE Linux, Virtualization, VMware, VMware ESXi, Wake-on-LAN (WoL), Windows, Windows 7 | Leave a Comment »

A few HTML to Markdown converters written in javascript, Python, Ruby, PHP and C#

Posted by jpluimers on 2014/07/24

It’s not perfect, but makes the conversion a heck of a lot easier:

to-markdown – an HTML to Markdown converter written in javascript (of which sources are on github).

[Edit 20150919: added more converters: now at least there is competition (:]

Read the rest of this entry »

Posted in Development, JavaScript/ECMAScript, MarkDown, Power User, Scripting, Software Development, Web Development | Leave a Comment »

How Can I Determine Which Version of Word is Installed on a Computer? – Hey, Scripting Guy! Blog – Site Home – TechNet Blogs

Posted by jpluimers on 2014/07/24

Late binding sometimes is your friend:

Set objWord = CreateObject("Word.Application")
Wscript.Echo "Version: " & objWord.Version
Wscript.Echo "Build: " & objWord.Build
objWord.Quit

The accompanying Delphi code:

uses
  System.Win.ComObj;

procedure TTestVersionAgnosticWordMainForm.GetWordApplicationInfoButtonClick(Sender: TObject);
var
  WordApplication: OleVariant;
  Version: OleVariant;
  Build: OleVariant;
begin
  WordApplication := CreateOleObject('Word.Application');
  try
    try
      Version := WordApplication.Version;
      Build := WordApplication.Build;
      LogMemo.Lines.Add(Version);
      LogMemo.Lines.Add(Build);
    finally
      WordApplication.Quit;
    end;
  finally
    WordApplication := Unassigned; // release it
  end;
end;

–jeroen

via: How Can I Determine Which Version of Word is Installed on a Computer? – Hey, Scripting Guy! Blog – Site Home – TechNet Blogs.

Posted in Delphi, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Scripting, Software Development, VBScript | 10 Comments »

Delphi syntax for TODO list (via: How set up todo list categories in Delphi 2010 – Stack Overflow)

Posted by jpluimers on 2014/07/23

A while ago, some of the TODO comments in my source code disappeared from the TODO list.

I wondered why, so I found this question: How set up todo list categories in Delphi 2010?.

The Delphi TODO item syntax in source code comments is like this (thanks Nelson H C Nepomuceno):

{ TODO 1 -cImportant :Do this!}
// TODO 1 -cImportant: Do this!

My comment there, after I found out I had done a stupid global search replace involving colons:

The important thing is the colon somewhere after the TODO. If you do not have the colon, then the TODO list will not show the comment. Anything after the colon will be the action item in the TODO list.

–jeroen

via: How set up todo list categories in Delphi 2010 – Stack Overflow.

Posted in Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Software Development | Leave a Comment »

The StackOverflow Pascal/DelphiSyntax Highlighter

Posted by jpluimers on 2014/07/22

Found out where the StackOverflow Pascal has its origins: What happened to comments in syntax highlighter? – Meta Stack Overflow.

Like any syntax highlighter, it is not perfect (only a Delphi compiler driven highlighter would have a chance to be perfect), but it does a pretty good job and gets better over time.

–jeroen

Posted in Borland Pascal, 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 x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, FreePascal, Pascal, Software Development, Turbo Pascal | Leave a Comment »