Archive for July, 2011
Posted by jpluimers on 2011/07/31
This week has been really busy, so only this weekend I found some time to go through the incoming comments.
I found quite a bunch of spam, which is unusual, because WordPress.com uses Akismet which is trying to trap this. Mostly it succeeds (like 99+% of the time), but sometimes it doesn’t, and this week there were more than normal.
So I marked them all as spam, and now the Askimet stats headline at http://wiert.wordpress.com/wp-admin/index.php?page=akismet-stats-display still says “0 missed spam”, and a “100% accuracy rate” but the tables there clearly indicated a bunch of missed spam.
Just in case you wonder too: The spam this week was all about low priced installation guides on getting old software installing on new operating systems.
–jeroen
Like this:
Be the first to like this post.
Posted in Power User | 1 Comment »
Posted by jpluimers on 2011/07/30
Last week, Google+ improved a lot; Matt Waddell posted a list, including a reference to the “What’s new in Google+” page.
–jeroen
via: Matt Waddell – Google+.
Like this:
Be the first to like this post.
Posted in G+: GooglePlus, Power User, SocialMedia | Leave a Comment »
Posted by jpluimers on 2011/07/29
Don’t forget to hug your sysdadmin, as today is System Administrator Appreciation Day!
–jeroen
Like this:
Be the first to like this post.
Posted in Opinions | Leave a Comment »
Posted by jpluimers on 2011/07/29
Last week, this was big news in the Apple world: the new Mac mini will ship without a built-in SuperDrive DVD-drive leaving room for a 2nd HDD drive.

New Mac Mini has no SuperDrive, but room for a second HDD - image courtesy of Engadget
This was in fact the main reason I bought a Mac Mini Server last year: it had 2 HDD drives built in and no SuperDrive.
The last time I used optical drives for storage media since was back when I bought a ThinkPad A20p early in 2000 (yes, I’ve lived in both the Mac and PC world for decades now).
One of the first things I did back then was buying an Ultrabay 2000 HDD Adapter, so I could fit in a second HDD and ditch the DVD-ROM player.
Since then, I loaded CDs and DVDs using ISO image files usingthe Daemon tools virtual DVD drive.
The Apple Mac lagged behind on this very much, I’m not sure at which Mac OS version they finally introduced support for ISO images in Disk Utility, no later than OS X in 2007 though.
Is this big news?
In the Mac world, apparantly so, but I have lived without optical drives for using data for over a decade now.
In fact, the only two reasons I still have DVD drives are:
- They are the only way to transfer recorded TV broadcasts from my Philips DVD/HDD and Medion DVD/HDD recorders to other platforms
- To help out foundations and voluntary organizations (like Stichting de Zevensprong that organizes activities for people with mental retardation) to distribute multimedia of their activities.
Looking around me, I’m certainly not alone.
Having two HDDs (or three, like the ThinkPad A31p in 2002, and the ThinkPad W70x in 2008) makes it so much easier to make backups or have more storage.
I’m glad I have being able to to that for a very long time, even on a Mac.
–jeroen
via: Apple updates Mac mini: Core i5 and i7, Thunderbolt, AMD Radeon HD, no SuperDrive — Engadget.
PS: Don’t forget to hug your SysAdmin today!
Like this:
Be the first to like this post.
Posted in Apple, Power User | 1 Comment »
Posted by jpluimers on 2011/07/28
When you generate Excel XML Spreadsheets, and you load it in Excel, it will report some errors in your Temporary Internet Files directory.
For instance, when you forget to fill the Data.Type attribute, then you get a log file with a message like this:
XML ERROR in Table
REASON: Missing Tag
FILE: V:\export.xml
GROUP: Cell
TAG: Data
ATTRIB: Type
Note that some errors won’t be reported. For instance if you forget to put your Data in a Cell.Data (and put it in Cell); then Excel just show empty worksheet.
There seems to be no XSD for the XML Spreadsheet format, so you have to get yourself familiar with the XML in Excel and the Spreadsheet Component documentation on MSDN.
You can view where to put your stuff in the XML Spreadsheet Tag Hierarchy. That list doesn’t have individual links to the tags, you need the XML Spreadsheet Reference for that.
To make things more practical for myself, I perfomed these steps:
- created a spreadsheet with all of the data variations I expected
- saved this spreadsheet as XML
- generated the XSD from that XML
- imported the XSD to generate wrapper classes and interfaces
Even with that, you will need to accommodate for many peculiarities.
Hopefully I will find some time to write more those down soon.
The first is ss:Data:
- It contains the actual data of a cell
- It has a required ss:Type attribute, which is an enumeration of Number, DateTime, Boolean, String, and Error.
- When it is String, then x:Ticked should be 1 (meaning True) when the string can be parsed as non-String type (and you would type the value into excel starting with a Tick mark (‘ aka single quote or apostrophe)
–jeroen
Like this:
Be the first to like this post.
Posted in .NET, Development, Software Development, XML, XML/XSD, XSD | 3 Comments »
Posted by jpluimers on 2011/07/27
Having proofread, I’m really glad that Marco Cantu recently announced that Delphi XE Handbook to be Available in both print and electronic forms.
Note that since the announcement, you can also get the Handbooks Collection in PDF form for something like EUR 55.
His books are always a pleasure to read, so: Great work Marco!
–jeroen
Like this:
Be the first to like this post.
Posted in Delphi, Development, Software Development | 2 Comments »
Posted by jpluimers on 2011/07/24
Posted in Power User | Leave a Comment »
Posted by jpluimers on 2011/07/22
About 9 months ago I posted about HTTPS Everywhere | Electronic Frontier Foundation hoping someone would port the HTTPS Everywhere extension for Firefox to force HTTPS in other browsers like Google Chrome, Microsoft Internet Explorer et cetera.
In the mean time, I found out about HSTS (HTTP Strict Transport Security), which is supported by FireFox 4, and Chrome 12.
Also in the mean time I found about a few HTTPS enforcer extensions for other browsers.
For instance, there are two similar Google Chrome Extensions to HTTPS Everywhere:
Internet Explorer does not have such an extension.
Opera has the Security Enhancer extension.
Next to HTTPS Everywhere, there are the ForceHTTPS and NoScript extension for FireFox (NoScript also supports HSTS).
FireFox 4 supports HSTS out of the box.
So now you have a choice!
–jeroen
Like this:
Be the first to like this post.
Posted in Chrome, FireFox, Internet Explorer, Power User, Web Browsers | Leave a Comment »
Posted by jpluimers on 2011/07/21
On my research list: WebSphere MQ and Delphi.
The funny thing is that this Delphi MQ Series question on StackOverflow that I answered actually helped me to get going
A few interesting links:
The research actually is focussed to replace a APPC/CPI-C session based solution that runs on top of SNA using LU 6.2 endpoints and has round-trip response times between 50 and 150 milliseconds with a WebSphere MQ based solution having similar performance characteristics. It binds multiple client applications to multiple function entries on the AS/400 systems at the client.
The current APPC/CPI-C part is written either both a DLL and EXE in Delphi (depending on how it is used), hence the Delphi part of the research.
In many organizations, WebSphere MQ (aka MQSeries) is part of their Enterprise Service Bus. In that regard, the SNA solution was far a ahead of its time.
BTW: Back then (almost 15 years ago), the SNA solution started out as solution using AS/400 Data Queues. Even after months of trying, that didn’t work well because the mixed environment of NetSoft Router, AS/400, SNA Server and Windows NT 4 in a pretty big WAN had huge problems.
Somehow, one of the layers forced sessions to always use 2 connections at a time, which was causing huge problems when those were routed through different SNA servers. That routing was unpredictable (and it was not possible to disable/force it to use stick to one SNA server). In addition, it was memory and CPU hungry on the PC side (when you were glad to have a Pentium MMX based CPU with 32 MB RAM, it ate 20+% of the CPU power, and 25+% of the memory per session, peaking to 100% CPU and 50% of RAM per session).
Specialists from all involved parties weren’t able to pinpoint the actual cause, so we went a few steps down on the OSI layer to the APPC leve.
–jeroen
Like this:
Be the first to like this post.
Posted in .NET, Delphi, Development, Software Development | 2 Comments »
Posted by jpluimers on 2011/07/20
This is from a long time ago, but still fun:
Sometimes simple things in life are hard do remember.
For instance, I always forgot if a file extension parameter should have a dot in it or not.
Normally it should!
But for clearing an extension, you should use a blank string.
Be aware though that empty extensions look differently depending where in the process you look at them:
C# example:
using System;
using System.IO;
public class Test
{
public static void Main()
{
string extensionLess = Path.ChangeExtension(@"C:\mydir\myfile.com.extension", "");
Console.WriteLine(extensionLess);
string extension = Path.GetExtension(extensionLess);
Console.WriteLine(extension);
}
}
Outputs:
C:\mydir\myfile.com.
Delphi example:
program Demo;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
extensionLess: string;
extension: string;
begin
extensionLess := ChangeFileExt('C:\mydir\myfile.com.extension', '');
Writeln(extensionLess);
extension := ExtractFileExt(extensionLess);
Writeln(extension);
end.
Outputs:
C:\mydir\myfile.com
.com
Don’t you love differences in your platforms
–jeroen
Like this:
Be the first to like this post.
Posted in .NET, C#, C# 2.0, C# 3.0, C# 4.0, Delphi, Development, Software Development | 4 Comments »
Posted by jpluimers on 2011/07/19
Recently I needed a way of concerting back and forth ISO 8601 DateTime values used in XML from Delphi.
Thoug the Delphi DateUtils unit has some ISO 8601 features for calculating week numbers, you actually need to the XSBuiltIns unit for converting back and forth to ISO 8601 text representation of a DateTime.
I remembered answering the related In Delphi is there a function to convert XML date and time to TDateTime question on StackOverflow a while ago (and forgot that this was back in 2009 <g>).
ISO 8601 dates can either include a time-zone, or be in UTC, which is not part of that answer. So lets elaborate on that answer a bit now:
UTC times in ISO 8601 format end in a Z time zone designator like this:
<Created>2011-06-29T17:01:45.505Z</Created>
The Z UTC indicator is basically a shortcut for a timezone offset of +00:00 or -00:00, effectively being a zero (or zulu) timezone.
Nonzero timezones start with an optional + or -, followed by the hours and minutes offset from UTC, for instance +01:00 for the Central European Time zone.
<Created>2011-06-29T17:01:45.505+01:00</Created>
When you want historical time zones, then you need the Delphi TZDB interface to the historical TZ database.
To do the timezone calculations, I used the TimeZoneBias function from Indy, which is either in the IdGlobal unit (Indy <= version 9) or the IdGlobalProtocols unit (Indy 10 and up).
Conversion is done by using the TXSDateTime (that like all the XS conversion classes descends from TRemotableXS in the InvokeRegistry unit).
Most of the classes descending from TRemotableXS contain two methods: NativeToXS and XSToNative doing the underlying conversions.
Since I didn’t need the historical reference in the TZDB, this is the code that I came up with:
unit Iso8601Unit;
interface
type
TIso8601 = class(TObject)
public
class function DateTimeFromIso8601(const Value: string): TDateTime; static;
class function UtcDateTimeToIso8601(const Value: TDateTime): string; static;
class function DateTimeToIso8601(const Value: TDateTime): string; static;
class function UtcNow: TDateTime; static;
class function ToUtc(const Value: TDateTime): TDateTime; static;
class function FromUtc(const Value: TDateTime): TDateTime; static;
end;
implementation
uses
IdGlobalProtocols, {IdGlobal for Index SysUtils,
XSBuiltIns;
class function TIso8601.DateTimeFromIso8601(const Value: string): TDateTime;
begin
with TXSDateTime.Create() do
try
XSToNative(value); // convert from WideString
Result := AsDateTime; // convert to TDateTime finally
finally
Free();
end;
end;
class function TIso8601.UtcDateTimeToIso8601(const Value: TDateTime): string;
begin
with TXSDateTime.Create() do
try
AsUTCDateTime := Value;
Result := NativeToXS; // convert to WideString
finally
Free();
end;
end;
class function TIso8601.DateTimeToIso8601(const Value: TDateTime): string;
begin
with TXSDateTime.Create() do
try
AsDateTime := Value; // convert from TDateTime
Result := NativeToXS; // convert to WideString
finally
Free();
end;
end;
class function TIso8601.UtcNow: TDateTime;
begin
Result := ToUtc(Now);
end;
class function TIso8601.ToUtc(const Value: TDateTime): TDateTime;
var
Bias: TDateTime;
begin
Bias := TimeZoneBias;
Result := Value + TimeZoneBias;
end;
class function TIso8601.FromUtc(const Value: TDateTime): TDateTime;
var
Bias: TDateTime;
begin
Bias := TimeZoneBias;
Result := Value - TimeZoneBias;
end;
end.
–jeroen
via In Delphi is there a function to convert XML date and time to TDateTime – Stack Overflow.
Like this:
Be the first to like this post.
Posted in Delphi, Development, Software Development | 7 Comments »
Posted by jpluimers on 2011/07/18
Voor het bepalen van de invoerrechten en BTW geldt de waarde van de aankoop.
Je betaalt rechten en belasting over de waarde van de zending plus eventuele verzend- en verzekeringskosten.
Samenvatting van de grenzen op het moment van schrijven:
- binnen EU: onbeperkt
- buiten EU: tot EUR 22: geen douanerechten, geen omzetbelasting
- buiten EU: van EUR 22 tot EUR 150: geen douanerechten, wel omzetbelasting
- buiten EU: van EUR 150: wel douanerechten, wel omzetbelasting
Op de site van de Douane staat een aantal percentages hier, een uitgebreide tarievenlijst met TARIC codes hier en het proces hier.
Voor PostNL (het vroegere TNT-POST/TPG-POST) beschrijft haar proces hier.
–jeroen
via: Wanneer hoef ik geen of minder belastingen te betalen?.
Like this:
Be the first to like this post.
Posted in Power User | Leave a Comment »
Posted by jpluimers on 2011/07/15
If you use NTP for syncing your time, then choose pool.ntp.org as your time server:
The pool.ntp.org project is a big virtual cluster of timeservers providing reliable easy to use NTP service for millions of clients.
I use it for instance to synchronize the time on my ESXi servers.
Note: when you run Windows VMs as ESXi guests; let ESXi time-sync them through the VMware tools, and disable Windows’ own time syncing. I didn’t disable it, and my Windows VMs were consistently off by over 30 minutes.
–jeroen
via pool.ntp.org: the internet cluster of ntp servers.
Like this:
Be the first to like this post.
Posted in *nix, ESXi4, Power User, VMware, Windows, Windows 7, Windows Vista, Windows XP | 2 Comments »
Posted by jpluimers on 2011/07/14
Boy, I was wrong. Somewhere in the back of my head I knew it.
ParamStr goes from zero (the name of the EXE) through ParamCount (the last parameter). Duh
I’ll keep this so you can have a good laugh:
When you add double quoted arguments to the commandline of your Delphi app, strange things can happen: the first parameter seems to be gone, while it is there.
It appears that the ParamCount/ParamStr logic fails here, and cannot be repaired because of backward compatibility.
Lets look at this commandline:
“..\bin\DumpCommandLine.exe” “C:\Program Files\test.xml” “C:\Program Files\meMySelfAndI.xml”
The demo code below will output something like this:
ParamCount: 2
ParamStr():
0 C:\develop\DumpCommandLine\bin\DumpCommandLine.exe
1 C:\Program Files\test.xml
CommandLine:
"..\bin\DumpCommandLine.exe" "C:\Program Files\test.xml" "C:\Program Files\meMySelfAndI.xml"
CommandLineStrings.Count: 3
CommandLineStrings[]:
0 ..\bin\DumpCommandLine.exe
1 C:\Program Files\test.xml
2 C:\Program Files\meMySelfAndI.xml
You see that regular ParamCount/ParamStr calls will mis the “C:\Program Files\test.xml” parameter.
But getting it through CommandLineStrings will correctly get it.
This is the dump code:
unit CommandlineDemoUnit;
interface
procedure DumpCommandLineToConsole;
implementation
uses
Classes, CommandlineUnit;
procedure DumpCommandLineToConsole;
var
CommandLineStrings: TStrings;
I: Integer;
begin
Writeln('ParamCount:', #9, ParamCount);
Writeln('ParamStr():');
for I := 0 to ParamCount - 1 do
Writeln(I, #9, ParamStr(I));
Writeln('CommandLine:');
Writeln(CommandLine);
CommandLineStrings := CreateCommandLineStrings();
Writeln('CommandLineStrings.Count:', #9, CommandLineStrings.Count);
Writeln('CommandLineStrings[]:');
try
for I := 0 to CommandLineStrings.Count - 1 do
Writeln(I, #9, CommandLineStrings[I]);
finally
CommandLineStrings.Free;
end;
end;
end.
And this the code to get the CommandLine and CommandLineStrings, which will fill a TStrings result using the CommaText property (it uses a default QuoteChar of of double quote #34 and Delimiter of space #32, this will work nicely):
unit CommandlineUnit;
interface
uses
Classes;
function CommandLine: string;
function CreateCommandLineStrings: TStrings;
implementation
uses
Windows;
function CommandLine: string;
begin
Result := GetCommandLine();
end;
function CreateCommandLineStrings: TStrings;
begin
Result := TStringList.Create();
Result.CommaText := CommandLine;
end;
end.
Note that you need to manually free the TStrings object to avoid memory leaks.
–jeroen
Like this:
Be the first to like this post.
Posted in Delphi, Development, Software Development | 13 Comments »
Posted by jpluimers on 2011/07/13
Extracting MSI files can be a pain.
Some compression programs (like 7zip) can unpack them, but leave the unpacked filenames as gibberish.
Many people recommend using msiexec (link to technet docs) on the commandline using the /a parameter (which does an administrative install effectively unpacking it), but others prefer integration in Windows Explorer.
msiexec /a PathToMSIFile /qb TARGETDIR=DirectoryToExtractTo
There are many tools allowing to unpack, and the best seems to be LessMSIerables by Scott Willeke which used to be on the (now defunct) pingpoet blogs, but got resurrected as lessmsi at oogle code.
Note that LessMSI doesn’t always work when msiexec /a works; for instance, I once got this error message:
Error: System.Runtime.InteropServices.COMException (0×00000003): Failed to close cab extract object, error: 3
Note that when you want to view MST files in addition to MSI files, then you need MSTVIEW from ORK XP or ORK 2003 (which you can get through the Office 2003 resource kit downloads page).
–jeroen
Like this:
Be the first to like this post.
Posted in .NET, Development, Power User, Software Development | Leave a Comment »
Posted by jpluimers on 2011/07/12
Good news for developers and IT engineers:
The new Mac OS X Lion EULA contains a phrase basically indicating you are a allowed to run 2 additional copies or instances of OS X Lion on each Mac already running OSX Lion.
This is a big change for OS X users.
For the beta, there were already steps on how to setup such a VM on a Mac or PC (including faking it to be the OS X Server), hopefully those steps have become a lot simpler now.
Probably these steps on how to make a OS X Bootable Installer from a USB Flash Drive helps too.
The OS X Lion release is already available to developers, and should be available to the general public really soon now.
–jeroen
via: Mac OS X Lion Supports Running Additional OS X Instances Within a Virtual Machine.
Like this:
Be the first to like this post.
Posted in Apple, Development, Power User, Software Development, xCode/Mac/iPad/iPhone/iOS/cocoa | Leave a Comment »
Posted by jpluimers on 2011/07/11
Windows contains the versatile netsh command that allows to configure and inspect your network configuration locally or remotely, including WLAN.
One of the things you can do is view the WiFi networks nearby, including all kinds of details not readily visible through the standard Windows UI.
This is the command to do it:
netsh wlan show networks mode=bssid
It shows you information on all WiFi networks nearby, revealing details like this: Read the rest of this entry »
Like this:
Be the first to like this post.
Posted in Power User, WiFi | Leave a Comment »
Posted by jpluimers on 2011/07/08
Recently I had the NTFS partition table of a 2.5 inch USB disk fail because somehow I didn’t correctly attach the split-USB cable: the disk didn’t get enough power, and Windows decided it should overwrite the partition table.
The free TestDisk tool by GCSecurity came to the rescue: TestDisk Step By Step – CGSecurity.
–jeroen
Like this:
Be the first to like this post.
Posted in Power User, Windows, Windows 7, Windows Vista, Windows XP | 1 Comment »
Posted by jpluimers on 2011/07/07
When staying in hotels or holiday parcs, the error messages you get usuaully are terrible.
Not so with KPN Hotspots (which I can access as part of my xs4all ADSL subscription).
Recently I had the pleasure to be at one of the Center Parcs, and most of the Dutch ones have KPN WiFi hotspots.
When you cannot get on-line, at least you get a decent error message that shows you the steps to work around.
I had two outages that week; this is how I solved them:
- Rather than restarting my primary browser, I started a different one (I have Chrome, FireFox, Opera and Internet Explorer) and logged on to KPN HotSpots successfully.
After that, my primary browser would work.
- The second one Disconnected the WiFi adapter for 10 minutes, reconnected, then logged on successfully to KPN HotSpots.
One tiny thing: when you have multiple WiFi devices with you (laptop + iPad for instance), only one can login to KPN Hotspots at a time.
–jeroen
Like this:
Be the first to like this post.
Posted in Power User | Leave a Comment »
Posted by jpluimers on 2011/07/06
OSnews has an interesting view on code quality: the number of WTFs/minute.
I know it is from 2008, but it is so true, so I’m glad I re-found it.
–jeroen
via: wtfm.jpg (500×471).
Like this:
Be the first to like this post.
Posted in .NET, Agile, Delphi, Development, Opinions, Software Development | Leave a Comment »
Posted by jpluimers on 2011/07/05
Recently, Jon Lennart Aasenden (of Surface Library fame) asked a nice winapi – Best way to do non-flickering, segmented graphics updates in Delphi question on StackOverflow.
Though the question is marked Delphi, the boundaries and solution very generic, and apply to any graphics library or GUI you develop: Windows, Mac, iOS, et cetera:
- Avoid double buffering when using GUI connections
- Draw only what you need
- Avoid redrawing whenever possible (for instance by letting the OS perform scrolling for you)
–jeroen
Like this:
Be the first to like this post.
Posted in .NET, Delphi, Development, Software Development, xCode/Mac/iPad/iPhone/iOS/cocoa | 2 Comments »
Posted by jpluimers on 2011/07/04
While playing around to improve the WiFi network reception of my Samsung LED TV, I enabled SWL.
It didn’t do much on the WiFi reception, but I found out that after enabling SWL, other devices could hardly find my regular access point any more.
Somehow, a very strong access point appeared pushing away all access points. The new access point had an SSID like SEC_LinkShare_######.
Though this wasn’t mentioned in the PDF manual of my TV, a quick search on SEC_LinkShare+SSID indicated in the direction of Samsung devices.
So, when you enable SWL on your TV:
- your TV will become a local secured access point
- the SWL access point will be called SEC_LinkShare_###### (with 6 digits at the end)
- you cannot influence the WiFi channel used by the SWL access point
- there is no information on the password to connect to the SWL access point
- the SWL access point will potentially have a higher signal than access points further away (effectively blocking them)
Conclusion: Unless you have other Samsung devices that need the SWL, don’t activate it on your TV.
–jeroen
Like this:
Be the first to like this post.
Posted in Power User | 16 Comments »
Posted by jpluimers on 2011/07/01
Unlike most updates marked as “Important Update”, this one requires a manual license agreement confirmation:
Microsoft Office File Validation Add-in
PLEASE NOTE: Microsoft Corporation (or based on where you live, one of its affiliates) licenses this supplement to you. You may use a copy of this supplement with each validly licensed copy of Microsoft 2003 & 2007 Office System Desktop Application software (the “software”). You may not use the supplement if you do not have a license for the software. The license terms for the software apply to your use of this supplement. To read the license terms, go to the “Help” menu in the software. Microsoft provides support services for the supplement as described at www.support.microsoft.com/common/international.aspx.
Though the security advisory was more than 2 months ago, it only got pushed to Microsoft update this week.
Good thing though that finally Microsoft is able to check the integrity of their document formats in Office 2007 and 2003: Microsoft Security Advisory: Microsoft Office File Validation for Office 2003, 2007 Office, and Office 2010: April 12, 2011.
–jeroen
Like this:
Be the first to like this post.
Posted in Power User, Windows, Windows 7, Windows Vista, Windows XP | Leave a Comment »