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 January, 2015

Downgrading to SourceTree 1.5.x from 1.6.x, but keeping up with the youngest embedded Git and Mercurial

Posted by jpluimers on 2015/01/15

Hopefully it is not a coincidence that Steve Streeting left the SourceTree team four years after the first SourceTree release and shortly after the first release of SourceTree 1.6. version, but the SourceTree 1.6.x versions suck: it often hangs and is (often extremely) slow. This apart from numerous NullReferenceExceptions. I find this odd, as 1.5.x is far more stable in that respect, hence my hope it is not about Steve Streeting.

Even though many people complained about 1.6.x. being bad (read the comments on the release page), and quite a few ask for a way to downgrade, a downgrade option isn’t provided there.

A SourceTree downgrade itself is not that difficult. Ensuring the embedded versions of Git and Mercurial/Hg are up to date is more difficult. Getting that right is especially important on Windows: hgflow works much better with the embedded Mercurial/Hg. More importantly: both Git and Mercurial/Hg recently had a very nasty security issue.

So here are steps on how to downgrade, then upgrade the embedded versions of Git and Mercurial.

Read the rest of this entry »

Posted in Development, DVCS - Distributed Version Control, git, Mercurial/Hg, Power User, Software Development, Source Code Management, SourceTree, Windows | 7 Comments »

Delphi: ZEROBASEDSTRINGS and maintaining cross-version Delphi libraries

Posted by jpluimers on 2015/01/14

One of the features that bites me over and over again is the ZEROBASEDSTRINGS that got introduced in Delphi XE3 and is by default ON in mobile compilers and OFF in Desktop compilers.

Back then, Mark Edington showed a small example of the effects:


procedure ZeroBasedTest;
const
S: string = '012';
begin
{$ZEROBASEDSTRINGS OFF}
Writeln(S[1]); // shows "0"
Writeln(S.Chars[1]); // shows "1"
{$ZEROBASEDSTRINGS ON}
Writeln(S[1]); // shows "1"
Writeln(S.Chars[1]); // shows "1"
end;

view raw

gistfile1.txt

hosted with ❤ by GitHub

and then explained:

The XE3 RTL source code has been refactored to be string index base agnostic. In most cases this is done by utilizing string helper functions which are always zero based.
When it is necessary to traverse a string, the Char[] property is often used to access the individual characters without concern for the current state of the compiler with respect to zero based strings.

In addition, the “Low” and “High” standard functions can now be passed a string variable to provide further flexibility as needed.
When zero based strings are enabled, Low(string) will return 0,  otherwise it will return 1. Likewise, High() returns a bounds adjusted length variation.

The problem is the non-existent forward compatibility of the other compilers (Delphi XE2 and lower).

So if you have library code that needs to work in Delphi versions, you cannot use the High and Low to make the code ZEROBASEDSTRINGS neutral.

Many Delphi developers regularly skip many Delphi versions, so these are still popular:

  • Delphi XE1 and XE2 (the last 2 compilers before Delphi really started to support mobile)
  • Delphi 2007 (the last non-Unicode Delphi compiler)
  • Delphi 7 (the last non-Galileo IDE)

The result is that library code is full of conditionan IF/IFDEF blocks like these:

Fix: this works only in XE3 or higher: “for Index := Low(input) to High(input) do // for ZEROBASEDSTRINGS”


{$ifdef GX_VER240_up}
for Index := Low(input) to High(input) do // for ZEROBASEDSTRINGS
{$else}
for Index := 1 to Length(input) do
{$endif GX_VER240_up}

view raw

gistfile1.txt

hosted with ❤ by GitHub

–jeroen

via: Mark Edington’s Delphi Blog : XE3 RTL Changes: A closer look at TStringHelper.

Posted in Ansi, Delphi, Delphi 2007, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Encoding, Software Development, Unicode | 8 Comments »

“KeySweeper is a stealthy Arduino-based device, camouflaged as a functioning…

Posted by jpluimers on 2015/01/13

I never use wireless keyboards because of the bad signal quality. Now there is one more reason not to use them…

By Andrian Knoth, thanks to a link by Kristian Köhntopp:

KeySweeper is a stealthy Arduino-based device, camouflaged as a functioning USB wall charger, that wirelessly and passively sniffs, decrypts, logs and reports back (over GSM) all keystrokes from any Microsoft wireless keyboard in the vicinity.”

–jeroen

via “KeySweeper is a stealthy Arduino-based device, camouflaged as a functioning….

The sniffing assembly...

Posted in LifeHacker, Power User | Leave a Comment »

Debugging MSBuild script with Visual Studio – The Visual Studio Blog – Site Home – MSDN Blogs

Posted by jpluimers on 2015/01/13

A while ago, i had a failing msbuild script that I fixed by restoring a backup.

Next time, I’ll try debugging it first, so the below is on my research list.

Debugging MSBuild script with Visual Studio – The Visual Studio Blog – Site Home – MSDN Blogs.

–jeroen

Posted in Continuous Integration, Development, Software Development | Leave a Comment »

Cross-site Scripting (XSS) – OWASP

Posted by jpluimers on 2015/01/12

When I look what is possible with Cross-site Scripting (XSS), then I wonder how you can defend your site to any and all of these and future attacks.

Coming from a desktop application and back-end background, the jungle of the web keeps being overwhelming.

–jeroen

via: Cross-site Scripting (XSS) – OWASP

Posted in Development, Software Development, Web Development | Leave a Comment »

Password requirements by @NicvantSchip – via Koushik Dutta – Google+

Posted by jpluimers on 2015/01/12

Brilliant: password requirements by @NicvantSchip.

“Your password must contain at least 8 letters, a capital, a plot, a protagonist with good character development, a twist & a happy ending.”

And Dilbert via Thomas Kear:

“Starting today, passwords must contain letters, numbers, sign language and squirrel noises”

–jeroen

via: Koushik Dutta – Google+.

Read the rest of this entry »

Posted in Fun, LifeHacker, Power User | Leave a Comment »

Mac OS X GeekTool: like Windows BgInfo on steroids.

Posted by jpluimers on 2015/01/12

A long time fan of BgInfo on Windows, I was looking for a Mac OS X replacement.

And I found one: GeekTool is on steroids compared to BgInfo (:

Much more than I needed (plenty of add-on scripts too), but more than enough to get some simple text displayed.

–jeroen

via: windows – Tool to put text on desktop wallpaper – Super User.

Posted in Apple, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, OS X 10.8 Mountain Lion, Power User | Leave a Comment »

What would be a real world example of heavy coupling?  A space satellite?…

Posted by jpluimers on 2015/01/09

Interesting suggestions at What would be a real world example of heavy coupling?  A space satellite?….

Via Nick Hodges.

Posted in Development, Software Development | Leave a Comment »

Like Process Explorer, but open source, with some extra options: Process Hacker

Posted by jpluimers on 2015/01/09

Process Hacker is on my research list:

A free, powerful, multi-purpose tool that helps you monitor system resources, debug software and detect malware.

–jeroen

via: Overview – Process Hacker.

Posted in Microsoft Surface on Windows 7, 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 | 1 Comment »

Search engines for the Embarcadero/CodeGear/Borland newsgroups

Posted by jpluimers on 2015/01/08

Even though 15 years ago they proudly announced to have archived 20 years of usenet, it is virtually impossible to find usenet groups through groups.google.com, and they certainly do not archive the groups at forums.embarcadero.com (formerly forums.codegear.com and forums.borland.com).

So I found only a few sites that do index the Delphi groups (and they do index more than just the Delphi newsgroups), so if you know more, please let me know!

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