The Wiert Corner – irregular stream of Wiert stuff

Jeroen Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20120127-Microsoft-Visual-Studio-2010-New-Work-Item-menu-still-loading...-(try-again-in-a-moment)

    20120127-Microsoft-Visual-Studio-2010-Cannot-navigate-to-definition.Disable-this-productivity-power-tool

    20120127-Microsoft-Visual-Studio-2010-Cannot-navigate-to-definition

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 366 other followers

Archive for August, 2011

.NET SecureString – storing/retreiving passwords and other sensitive data

Posted by jpluimers on 2011/08/31

Let me start that you should store as little sensitive information as possible. But if you do, you should store it in a secure way. That’s why the .NET 2.0 introduced the SecureString class.

I won’t go into detail here, as the links below and the demo source do that much better than I can:

One warning: be very cautious when you convert a SecureString in a regular unsecure array of characters, string, or compare the unsecured content. To quote Fabio Pintos, everytime you do, a little village bursts on fire. When you access it in an insecure way, make sure it is pinned, clear and release the insecure memory as soon as possible.

The problem with a garbage collected environment like .NET is that strings live on the heap, and you can’t deterministically eliminate a string from memory like you could in deterministic environment like Delphi or C/C++.

Have fun with it!

–jeroen

Posted in .NET, C#, Development, Software Development | 2 Comments »

Batch file to get parent directory (not the directory of the batch file, but the parent of that directory)

Posted by jpluimers on 2011/08/30

The problem solved here is two-fold:

  1. The ~dp syntax for getting the directory/path part only works for parameters and loop indexes, not on variables.
    You can work around this by having a 1-iteration for-loop.
  2. The :~ syntax for getting the substring works only for variables, not for parameters and loop indexes.
    You can work around this by assigning to a temporary variable.

Example:

  echo batchfile=%0
  echo full=%~f0
setlocal
::http://stackoverflow.com/questions/636381/what-is-the-best-way-to-do-a-substring-in-a-batch-file
  set Directory=%~dp0
echo Directory=%Directory%
:: strip trailing backslash
  set Directory=%Directory:~0,-1%
echo %Directory%
::  ~dp does not work for regular environment variables:
::  set ParentDirectory=%Directory:~dp%  set ParentDirectory=%Directory:~dp%
::  ~dp only works for batch file parameters and loop indexes
  for %%d in (%Directory%) do set ParentDirectory=%%~dpd
  echo ParentDirectory=%ParentDirectory%
endlocal

This will show:

  1. The directory of the batch file
  2. The directory but without the trailing backslash
  3. The parent directory of the batch file

Hope you can give this some use.

–jeroen

Posted in Batch-Files, Development, Power User, Scripting, Software Development | Leave a Comment »

RDP issue solved itself; research list to see what might be involved

Posted by jpluimers on 2011/08/29

Recently, I got the below message when trying to MSTSC into a RDP targeting a Windows 7 machine having multiple NICs.

—————————
Remote Desktop Connection
—————————
Your computer could not connect to another console session on the remote computer because you already have a console session in progress.
—————————
OK Help
—————————

I was connecting from a WAN. The Windows 7 machine is connected on two different subnets through port forwarding.

The above message was only on one on one WAN connection. When I tried the other, I could connect immediately. After that, I could connect through the other WAN connection as well.

I’m not sure what caused it, but I suspect the port forwarding, though that has worked in the past and now works without any change.

Still a couple of links, just in case it happens again:

Posted in Power User | Leave a Comment »

xs4all ONLY issues with ADSL sync and Fritz!Box 7340

Posted by jpluimers on 2011/08/26

Recently, I had big problems with my Fritz!Box 7340 losing ADSL sync on my xs4all ONLY connection.

The odd thing is: the problems started after it worked well for quite a while.

I had multiple dozens of these reconnects per day, sometimes as few as once every fre hours, but often as many as half a dozen per hour:

11.07.11 05:14:08 IPv6 Internet connection established successfully. Prefix: 12ab:34cd:56ef::/48
11.07.11 05:14:08 IPv6 Internet connection established successfully. IP address: 12ab:34cd:56ef::fe01dc23:ba45:9867
11.07.11 05:14:07 Internet connection established successfully. IP address: 172.31.120.210, DNS server: 194.109.6.66 and
194.109.9.99, Gateway: 194.109.5.205
11.07.11 05:14:01 DSL is available (DSL synchronization exists with 10007/1029 kbit/s).
11.07.11 05:13:47 DSL synchronization starting (training).
11.07.11 05:13:32 Internet connection cleared.
11.07.11 05:13:32 IPv6 Internet connection was cleared; prefix no longer valid.
11.07.11 05:13:32 Internet connection cleared.
11.07.11 05:13:31 DSL not responding (no DSL synchronization).

The xs4all helpdesk didn’t respond on my emails, and Google searches didn’t reveal much.

This is what I tried:

  1. I tried getting the FRITZ.Box_Fon_WLAN_7340.en-de-es-it-fr.99.05.04-19769.image firmware, mentioned in this thread, but could not download it any more.
  2. I also tried to set the DSL settings to “maximum stability” without any improvement, resetting to factory settings, etc.
  3. The router is already very close to the ISRA point (where DSL enters the house), and I tried both with/without splitter with no improvement whatsoever.
  4. Read the steps in this sat4all thread, but found nothing unusual in my hardware and software config.

I didn’t expect any improvement as nothing on my side has changed, and before xs4all ONLY, I ran DSL for more than 10 years with different modems and no problems whatsoever.

Finally, I downgraded to Firmware-Version 99.04.88 from Firmware-Version 99.04.90.

When downgrading, keep this in mind:

  • Fritz! does not keep old firmware versions on-line; you must regularly get the Fritz!Box 7340 part of their ftp site and keep an archive yourself
  • It will reset your router to factory state and not remember any settings
  • It cannot restore your settings if you saved them with a higher firmware version, not even when you save them with a password as the web-interface seems to suggest

Luckily, one of the things that xs4all did well, is keep an archive of firmware versions for the Fritz!Box 7340, including a Firmware-Version 99.04.88.

Perform these steps when downgrading: Read the rest of this entry »

Posted in Power User | Leave a Comment »

A world without iWords?

Posted by jpluimers on 2011/08/25

With Steve Jobs just having resigned as Apple CEO, will the world soon be without iWords?

Just Pods, Pads, Macs, Books, etc?

I don’t think so.

Though often stylized as hues of grey, Steve Jobs brought a lot of colour to Apple. Not only by himself, but by collecting a circle of really great people around him. His excellent successor already has shown a good track record, and Apple has many talented people to fill the void he leaves.

Steve will be dearly missed, so I wish him all the best (knowing from direct experience how badly sickness can affect your health).

–jeroen

Posted in Opinions | Leave a Comment »

Excel XML Spreadsheet: Styles and formatting

Posted by jpluimers on 2011/08/25

I found some time to continue my series that started with Excel XML Spreadsheet: Date.Type is mandatory :)

This time, it is about Styles and using the styles to format. I’ll limit myself to formatting Columns, but you can equally apply this to individual Cells, Rows, and Tables.

Note that in the below XML listings, I have replaced the angle brackets with { and }, because the WordPress editor will otherwise delete the XML from the sourcecode portions.

First, let’s look at some ss:Styles:

 {Styles}
  {Style ss:ID="Default" ss:Name="Normal"}
   {Alignment ss:Vertical="Bottom"/}
  {/Style}
  {Style ss:ID="s21"}
   {NumberFormat ss:Format="yyyy/mm/dd"/}
  {/Style}
  {Style ss:ID="s22"}
   {NumberFormat ss:Format="yyyy/mm/dd\ h:mm:ss"/}
  {/Style}
  {Style ss:ID="s31"}
   {NumberFormat ss:Format="[ENG][$-409]ddd"/}
  {/Style}
  {Style ss:ID="s32"}
   {NumberFormat ss:Format="[$-F800]dddd\,\ mmmm\ dd\,\ yyyy"/}
  {/Style}
 {/Styles}

Then the usage of the styles in Columns:

   {Column ss:StyleID="s21" ss:Width="53.25"/}
   {Column ss:Index="4" ss:StyleID="s31" ss:Width="89.25"/}
   {Column ss:StyleID="s22" ss:Width="95.25"/}
   {Column ss:StyleID="s32" ss:Width="95.25"/}

First a few remarks about the ss:Styles:

  1. Styles have IDs, which don’t need to be in the form s##, you can use any unique ID for them. Excel uses s## because that’s how the formatting pick-list works.
  2. You specify the formatting as a ss:NumberFormat using the components from the Creating international number formats documentation.
  3. You can add an Excel specific LCID (locale identifier) to a format. Without it, it will use the user’s locale settings.
  4. You can ommit the language hint (like [ENG]) from the formatting.
  5. The Excel LCID is very similar to the LCID Structure using hexadecimal values from the Locale ID Chart,  Language Identifier Constants and Strings table or list of Locale IDs Assigned by Microsoft, but with a few twists.
  6. There is a lot of confusion about [$-F800] and [$-F400] which actually behaves as LANG_SYSTEM_DEFAULT (0×0800 in the latter table), where [$-F800] displays the long date and [$-F400] displays the time (as correctly identified in this Openoffice Bugzilla bug report – or the Google cache of it).
  7. Three digit language [$-409] should be extended to 4-digit LCID 0×0409. It will format the cell using that specific language (in this case: English 3-letter weekday abbreviation).

A few remarks about the ss:Columns:

  1. These columns define formatting for column A, D, E and F.
  2. You don’t need to have a definition for every column in your Worksheet.Table, just for the ones that need formatting.
  3. The Column definition is smart: it can be sparse! After each gap, define a column having an ss:Index attribute, then continue defining subsequent columns until you need another gap.
  4. You can ommit the ss:Width attribute: when empty, the column will auto-size

–jeroen

PS: Rob van Gelder posted a nice formula to show nice translations using Excel formatting.

Posted in Development, Software Development, XML, XML/XSD, XSD | Leave a Comment »

#NS #QPark den Haag Laan van NOI begint een #fail te worden

Posted by jpluimers on 2011/08/24

Ik parkeer al een maand of wat mijn auto op de NS Q-Park bij station Den Haag Laan van NOI om van daar met de trein verder te reizen.

Helaas begint het parkeren nu zo langzamerhand een #fail te worden omdat de kaartlezers bij de uitgang en ingang steeds meer en vaker kuren vertonen.

Al sinds een week of 3 doet de kaartlezer bij de uitrit vaak nogal vreemd: meldingen als “alleen contactloos” of “draai uw kaart” (ook na 4 mislukte pogingen met verschillende kaart oriëntaties) zijn aan de orde van de dag, en de medewerkers achter de “help” knop zijn helaas van sterk wisselende kwaliteit.

Wat er bij problemen het uitrijden meestal gebeurt is dit:

  • Ze geven aan dat ze geen betalingen of kortingen kunnen verwerken
  • Ze geven aan dat je het 0900 nummer moet bellen om de zaak met betaling en kortingen te corrigeren
    (maar vergeten aan te geven wanneer op dat 0900 nummer geen afwezigheidsmelding: van 0800 tot 1800, iets wat ook ontbreekt op de kortingskaart)
  • Ze openen de  poort

Betalingen en kortingen kunnen ze echter wel ter plekke verwerken (de customer desk kan dit ook, maar alleen op dezelfde dag, dus alleen als je dezelfde dag binnen de openingstijden belt).

Wat de help medewerkers behoren te doen is het volgende:

  • Vragen naar (NS of andere) kortingskaart
  • Gegevens betalingskaart vragen en opzoeken (bijvoorbeeld laatste 4 cijfers creditcard)
  • Betaling verwerken
  • Poort openen

Inmiddels (ik heb al een aantal medewerkers achter het 0900 nummer gesproken) weet ik dit en kan ik de medewerker achter de help knop correct instrueren.

Gisteren stond er – na 3 weken modderen! – zelfs een medewerker om te checken wat er nu allemaal mis ging.

Dat modderen kost helaas veel tijd: uitrijden levert vaak een wachtrij op van soms wel 20 minuten, en vandaag bij het inrijden ook 10 minuten langer gedaan (en 2 treinen gemist).

Dus: NS en Q-Park: dit kan beter!

–jeroen

PS: Even de Q-Park contactgegevens op een rijtje:

Q-Park

T.a.v. Q-Park Customer Desk
Antwoordnummer 1125
6200 VB Maastricht
telefoon: 0900 – 44 66 880

(op werkdagen tussen 08.00 uur en 18.00 uur, € 0,45 per gesprek)

Posted in Opinions, Power User | Leave a Comment »

Batch file to get TCP/IP info from local LAN

Posted by jpluimers on 2011/08/24

I needed an automated way of inspecting the local LAN.

The batch files below will on IPv4 networks, with thanks to articles from Windows IT Pro and Rob van der Woude for some ideas:

  • find the TCP/IP gateways/netmasks
  • enumerate all the IP addresses on each subnet (assuming the netmask is 255.255.255.0)
  • ping each IP address and get ARP info, and dump that to the console

There are other tools that can do this too (like Angry IP Scanner), and more but the ones I tried could not copy the output to the clipboard.

find local subnets: Read the rest of this entry »

Posted in Batch-Files, CommandLine, Development, Power User, Scripting, Software Development | Leave a Comment »

delphi has TTransparentCustomControl in the Controls unit

Posted by jpluimers on 2011/08/23

Wow, I never noticed that Delphi 2006 introduced the TTransparentCustomControl.

I spotted it a while ago from the delphi – Transparent TCustomControl? answer on StackOverflow.

It is not used in the Delphi VCL itself, but a google search reveals that a few people have actually used it, and Steve Trefethen (former member of the VCL team) mentioned it too.

Note that it contains a mouse interception bug that is still open.

–jeroen

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

Foto’s 14e editie van de Katwijkbinse Truckrun – Oranjevereniging Katwijk a/d Rijn

Posted by jpluimers on 2011/08/22

Afgelopen zaterdag was alweer de 14e editie van de Katwijkbinse Truckrun.

Dit geweldige evenement laat mensen met een verstandelijke beperking meerijden in één van de 100 trucks en 3 touring cars door de bollenstreek.

Ook dit jaar mocht ik mijn broer wegbrengen en ophalen, en heb meteen de kans schoon gezien ‘s ochtends en ‘s middags wat foto’s te schieten van de trucks op het voormalige Marinevliegkamp Valkenburg.

  • Foto’s ochtend (foto’s op volgorde van binnenkomst, het blauwe formulier achter elk raam bevat het trucknummer)
  • Foto’s middag (foto’s op volgorde van Trucknummer)

Dit jaar was de eerste keer dat de vrachtwagen van Adest Musica mee mocht rijden.

Met nieuwe bestickering van al onze sponsors luidt dit twee belangrijke dingen in:

  1. De Adest Night of Music op 8 oktober die de Rotary Sassenheim samen organiseert, en waar – samen met de diverse afdelingen van Adest Musica – de bekende trombonist Ben van Dijk, saxofonist Wouter Kiers en partyband Ain’t no Secret zullen optreden.
    De opbrengst komt ten gunste van de Jeugdband van Adest Musica, en natuurlijk geven zij die avond ook een mooi optreden!
  2. De aanloop naar het Wereld Muziek Concours 2013 (de tijd gaat snel: over 2 jaar dat alweer achter de rug!) waar de Drum- en Showband Adest Musica weer een puik product gaat neerzetten.

Ben je trucker of deelnemer, en wil je graag originele foto’s, laat het dan even weten via het contactformulier: vul in ieder geval het nummer van je Truck in.

Ben je benieuwd naar Adest Musica? Schrijf je in voor de nieuwsbrief van Adest’ Night of Music!

Volgend jaar is de 15e Katwijkbinse Truckrun, tot dan!

–jeroen

via: Oranjevereniging Katwijk a/d Rijn.

Posted in About, Adest Musica, Event, Personal, Truckrun | Leave a Comment »

TypedReference Structure (System)

Posted by jpluimers on 2011/08/22

Somehow this landed on my research list: TypedReference Structure (System) (together with __arglist, __makeref, __reftype and __refvalue)

Probably because of two reasons:

A few interesting links:

–jeroen

Posted in .NET, C#, Development, Software Development | Leave a Comment »

Hardloopcursus bij AV’23 Watergraafsmeer – Amsterdam – dichtbij.nl – Amsterdam-Centrum

Posted by jpluimers on 2011/08/19

Hardloopcursus bij AV’23 Watergraafsmeer

Dit is echt een toffe cursus; ben ik ook bij begonnen om – na een blessure door zelf aanklooien – weer lekker aan de gang te gaan.

Inmiddels zit ik op 10 km, en nog steeds blessurevrij.

–jeroen

Via: Hardloopcursus bij AV’23 Watergraafsmeer – Amsterdam – dichtbij.nl – Amsterdam-Centrum.

Posted in About, Personal | Leave a Comment »

Importing Facebook friends in …

Posted by jpluimers on 2011/08/19

Somehow, Facebook is very protected about you accessing your friends’ info in an automated way.

For instance, recently Facebook tried to block a Google Chrome extension that exported the info on your friends, and also blocked a Facebook contacts CSV export tool.

Luckily, Yahoo! has a Facebook Connect deal with Facebook that enables Yahoo!  to import the Facebook contacts.

So, if you have a Yahoo! account, you can always that as a back-door: import your Facebook! contacts into Yahoo! contacts.

Importing is easy: start at the Yahoo! Address Book Contact Import Landing page, then go from there.
The Yahoo! Mail Transfer Contacts page offers some other import sources too (but no Facebook source yet).

For instance, these are possible:

Other tools can directly import from Facebook, for instance, Skype can, and many mobile phones can too (so you can do the “Facebook, mobile phone, Outlook, export” path too).
–jeroen

 

Posted in LifeHacker, Power User | Leave a Comment »

#HTC #Sensation: how to #disable/#enable your #GSM/#3G #Radio

Posted by jpluimers on 2011/08/18

It is very easy to turn off the GSM/3G radio on your HTC Sensation:

  1. Manually dial *#*#4636#*#* to get in the “testing” menu
    (don’t dial this from your phone book as it won’t work, but dial it manually; it helps adding an entry in your phone book so you can remember the code more easily while typing it)
  2. Click on “Phone Information
  3. Scroll down and there’s a button “Turn off radio” or “Turn on radio”.
  4. Press this button and wait a couple of seconds for it to effect

In similar ways, you can select the “Set preferred network type“, which for me is “GSM auto (PRL)“.

Note that the link below talks about “On the US version…”, however this worked on my HTC Sesensation obtained through the Dutch Vodafone Business branch.

– jeroen

Via: Disable 3G on Sensation Help ? – xda-developers.

Posted in HTC, HTC Sensation, Power User | Leave a Comment »

ISO 8601 Date, Time and DateTime in Delphi (was: Simple example to show DateTime.Now in ISO 8601 format on ideone.com | Online C# Compiler & Debugging Tool)

Posted by jpluimers on 2011/08/18

In the past I wrote about a Simple example to show DateTime.Now in ISO 8601 format on ideone.com | Online C# Compiler & Debugging Tool , using ISO 8601 in batch-files, and how ISO 8601 is used in Google Calendar URLs.

Time to write something about ISO 8601 Date, Time and DateTime and Delphi.

First of all the DateUtils unit contains a bunch of routines (for instance DecodeDateWeek) that understand ISO 8601 week numbers, where:

  • Weeks start at Monday
  • The first week of a year contains (these are equivalent):
    • The first thursday in that year
    • Has at least 4 days in that year
    • Contains the 4th of January

Otherwise the week containing January 1st is week 52 or 53 of the previous year

ISO 8601 also specifies how to format Dates, Times,  DateTimes and durations according to some basic principles.

XML uses ISO 8601 to format Date, Time and DateTime and some other formats as text too.

So it is no wonder that since Delphi 6, it contains a XSBuiltIns unit covering (among other things) ISO 8601 formatting.

Given the many Delphi ISO 8601 relates questions on StackOverflow of which I answered two, and my need for ISO 8601 DateTime conversion for exporting Excel XML, here is are some samples to get started in the unit below (and in this codeplex changeset).

The unit covers Date, Time and DateTime.
You can write similar code for Duration. Read the rest of this entry »

Posted in Delphi, Development, Software Development | 1 Comment »

Why is LTE equipment being installed in an Apple Store? — Engadget

Posted by jpluimers on 2011/08/17

Interesting: is Apple going to include LTE in their next product line?

Not that we will have LTE in The Netherlands soon, we won’t, we only have one test network at Tele2 :)

–jeroen

Via: Why is LTE equipment being installed in an Apple Store? — Engadget.

Posted in iOS, iPad, iPhone, Power User | Leave a Comment »

some reflections on #Delphi #FireMonkey support for #iOS based on the #FPC compiler that caused quite a surprise

Posted by jpluimers on 2011/08/17

When looking over a few forums, it seems that the way Delphi XE2 will support FireMonkey on iOS (by using FPC aka the FreePascal Compiler) was very surprising, even for the FPC dev team.

Actually, Embarcadero’s Michael Swindell posted some very interesting reactions on the Lazarus forum and his series of comments on Jon Lennart Aasenden blog entry discussing Delphi XE2 and iOS.

Recommended reading!

A lot of pieces of the puzzle fall into place now: Embarcadero aquiring KSDev (that made DXScene/VXScene), and the support in FPC 2.5.1 for a more Delphi Language compatible syntax, and Objective Pascal binding to Objective C as indicated by Phil Hess. VGScene already supported iOS using FPC in Delphi Mode, as this thread on the embarcadero forums also indicates, so it is logical that FireMonkey does too.

Embarcadero, FreePascal and RemObjects are in parallel (and sometimes cooperation) working on cross platform compiler development.
For the Mobile world, ARM (for iOS) and Java (Android, BlackBerry) are very important.

Clearly, Borland was far ahead of its time when they demonstrated their dcc32j Delphi to Java bytecode compiler proof of concept at BorCon conferences back when their opening evenents had great videos (I think it was both at BorCon 1998 and BorCon 1997), and not so great shifts (the Inprise identity crisis).

The same holds for the Sun’s slogan “the network is the computer” (actually by John Gage): basically that was about predecessors of Cloud computing.

Things from the past come back, sometimes presented as “new”, a few (partially from this Evolution of Pascal programmers.stackexchange.com thread):

All of those are (partial repetitions) of technologies that help you build systems. The trick is how to be able to quickly learn and apply those technologies (as opposed to add a bunch of TLAs or FLABs wich are about the only thing that most modern “recruiters” use to match résumés/CVs to positions).

Some of the things above have died, or are not in wide use any more.
That is OK: Life can’t have ups without having downs, and without some form of long wavelength repetitions: that’s what makes the journey so interesting (just think about the financial markets, there will be good times…).

Using FPC for iOS opens the road to develop applications using a very productive environment consisting of the Delphi IDE and the FPC compiler in a short while from now.

–jeroen

PS: two more events that I will be attending and/or speaking:

PS2: Now it probably is more clear why I bought and installed my Mac Mini Server last year :)

Posted in .NET, C#, Delphi, Development, Java, Software Development | 6 Comments »

#Unlocking non-branded #HTC #Sensation: HTCdev – #Unlock #Bootloader

Posted by jpluimers on 2011/08/16

For fellow non-branded HTC Sensation users: HTC now allows unlocking your bootloader: HTCdev – Unlock Bootloader.

–jeroen

Posted in Android, HTC, Power User | Leave a Comment »

Revisited: .NET/C# – TEE filter that also runs on Windows (XP) Embedded « The Wiert Corner – irregular stream of Wiert stuff

Posted by jpluimers on 2011/08/16

More than a year ago, I wrote about .NET/C# – TEE filter that also runs on Windows (XP) Embedded.

Since then, I have made two changes to the code (which is below and in this CodePlex changeset):

  1. using file modes FileAccess.Write and FileShare.Read, which allows you to load the output files with tools opening them in a read-only, deny none mode
  2. optional flush of the files every CRLF pair, or every 4096 bytes

Read the rest of this entry »

Posted in .NET, C#, Development, Software Development | 2 Comments »

Back to the 80s: Apple Pascal on the Lisa Machine

Posted by jpluimers on 2011/08/15

Talking about Pascal history: Index of /pdf/apple/lisa/pascal_monitor.

That was then, soon it will become easy to write Pascal apps for Apple iOS using Delphi XE2 :)

–jeroen

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

Nice deal: ANWB – Ledenvoordeel – Yellowbrick – gratis registratie

Posted by jpluimers on 2011/08/15

Handig als je lid bent: ANWB – Ledenvoordeel – Yellowbrick gratis registratie.

–jeroen

Posted in LifeHacker, Power User | Leave a Comment »

Tomazy’s Software Development Blog: Testing modal windows in Delphi

Posted by jpluimers on 2011/08/14

Tomazy’s Software Development Blog: Testing modal windows in Delphi.

Recommended reading!

–jeroen

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

Nice gadget: 5Port USB Power Metal Ethernet Network Hub Switch BL-S805-U – DinoDirect.com

Posted by jpluimers on 2011/08/12

Sometimes you are in situations where the number of power outlets and the number of LAN connections is limited.

That’s where the 5 Port USB Powered Ethernet Network Switch BL-S805-U from DinoDirect comes in handy.

It was the only reasonably priced USB powered ethernet switch I could find, and it works like a charm.

Highly recommended :)

Thanks to the BrightHub article that pointed me to it!

–jeroen

via: 5Port USB Power Metal Ethernet Network Hub Switch BL-S805-U – DinoDirect.com

Posted in Gadget, Power User | Leave a Comment »

#fail #rookzone #astmapatient #schiphol personeel weigert in te grijpen

Posted by jpluimers on 2011/08/11

Ik sprak enkele Schiphol medewerkers aan, nadat ik een longpatient hoestend en proestend zich een baan door de massa rokers had zien bewegen, of ze de rokers uit de rookvrije zone naar de (overdekte!) rokerszone wilden sturen.

Wat ik letterlijk te horen kreeg: “We laten die mensen lekker staan, want als we ze wegsturen, staan ze er over 3 minuten weer”.

Ofwel: Schiphol voldoet niet aan haar verplichtingen en laat longpatienten in de kou staan.

Ook na aandringen dat ik het erg op prijs zou stellen, bleven ze bij hun standpunt.

Toen ik aangaf dat ik dan foto’s zou publiceren, gaven ze aan dat dat mocht.

Dus bij deze:

Foto van de rokers om het bord “rookvrije zone” (rechts onder de rest van de overkapping stonden er zeker nog 20):

Foto van de (ook overdekte!) lege rookzone:

Posted in About, Opinions, Personal | Leave a Comment »

Excel XML Spreadsheet: watch your Worksheet.Table.ExpandedColumnCount (or just leave it out)

Posted by jpluimers on 2011/08/11

Recently, I blogged about the Excel XML Spreadsheet: Date.Type is mandatory.

Here is another error you can get:

XML ERROR in Worksheet Setting
REASON:	Bad Value
FILE:	V:\CAS400\docs\statistics.cascall-logs\cascall.JU03HV.Bobbe, P.J.L. (Paul).20110620.xml
GROUP:	Worksheet
TAG:	Table
ATTRIB:	ExpandedColumnCount
VALUE:	9

This basically means your Worksheet.Table.ExpandedColumnCount is too small to hold your spreadsheet.

In other words: you either have more Worksheet.Table.Column definitions than ExpandedColumnCount, or you have a WorkSheet.Table.Row that has more WorkSheet.Table.Row.Cell entries than the ExpandedColumnCount.

In my case, I made an error generating too many Column definitions (by accidentaly duplicating some of them), and invalidated the ExpandedColumnCount.

Lesson learned: Since Excel will automatically calculate an absent ExpandedColumnCount, you can safely leave it out.

–jeroen

Posted in Development, Software Development, XML, XML/XSD, XSD | Leave a Comment »

Windows authorization: Adding/Removing users from local groups

Posted by jpluimers on 2011/08/10

Though there are API ways to add users to local groups in Delphi, you need the JwaLmAccess unit from the JEDI API library project to import those.

Sometimes that is not feasible, and sometimes you want to just script things.

For those, you can use the Windows net localgroup command (if you have sufficient privileges, you can even apply it to the local groups on your domain controller by appending it with the /domain parameter, or use the net group /domain command to execute on global domain groups instead of local groups).

Sample of using this in a cmd script:

net localgroup Guests Me Myself I ACME\BugsBunny /delete

It will remove the local users Me, MySelf and I, and remove the domain user ACME\BugsBunny from the local group Guests.

Sample source of using this in Delphi: Read the rest of this entry »

Posted in CommandLine, Delphi, Development, Software Development | 1 Comment »

batch files: getting directory and parent directory

Posted by jpluimers on 2011/08/09

In some situations, batch files are the only thing you have.

In this case, I needed the parent directory of a batchfile.

i.e. not the directory of the batch file itself, but the

  echo batchfile=%0
  echo full=%~f0
setlocal
::http://stackoverflow.com/questions/636381/what-is-the-best-way-to-do-a-substring-in-a-batch-file
  set Directory=%~dp0
echo Directory=%Directory%
:: strip trailing backslash
  set Directory=%Directory:~0,-1%
echo %Directory%
::  ~dp does not work for regular environment variables:
::  set ParentDirectory=%Directory:~dp%  set ParentDirectory=%Directory:~dp%
::  ~dp only works for batch file parameters and loop indexes
  for %%d in (%Directory%) do set ParentDirectory=%%~dpd
  echo ParentDirectory=%ParentDirectory%
endlocal

The point is that the %~dp0 trick as explained in this StackOverflow answer on substrincgs in batch files only works for batch file parameters (starting with a single percentage sign: %0, %1, %4, etc) or for-loop indexes (starting with double percentage signs: %%1, %%d, etc). They don’t work for getting path portions of  regular environment variables.

So I used the substring trick (as explained in the same answer), and then used a for loop (which will have one iteration) to get the path portion.

Note: The substrings trick only works on regular environment variables, not on parameters and loop indexes.

Note 2: I used setlocal/endlocal so the changed environment variables stay local to the batch file and won’t leak out to your command-prompt. If you need the value there, then remove the setlocal/endlocal, or use an “endlocal & set” command on a single line. Read the rest of this entry »

Posted in Batch-Files, Development, Scripting, Software Development | Leave a Comment »

Mac OS X Lion reveals passwords in sleep mode? | The Digital Home – CNET News

Posted by jpluimers on 2011/08/08

If you have a Mac, and enabled automatic login, then it is vulnerable to a FireWire password snooping bug.

Looking at that article, you should either:

  • turn it off
  • disable FireWire
  • disable automatic login and reboot

–jeroen

via: Mac OS X Lion reveals passwords in sleep mode? | The Digital Home – CNET News.

Posted in Mac, Power User | Leave a Comment »

Javascript PC Emulator – Technical Notes

Posted by jpluimers on 2011/08/08

Fabrice Bellard wrote a brilliant piece of code: a PC x86 Emulator running in JavaScript.

It can run JSLinux inside your (FireFox 4.x, Chrome 11+, Opera 11.11 and Internet Explorer 9) browser :)

Some links: News, FAQ, Notes and JSLinux.

–jeroen

via: Javascript PC Emulator – Technical Notes.

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

@NShispeed: OV Chipkaart en #NS-Businesscard perikelen

Posted by jpluimers on 2011/08/05

Zo maar een greep van de afgelopen weken waarin ik met een NS-Businesscard (een soort OV-Chipkaart voor zakelijke reizigers) die wordt geadverteerd als “Met één kaart voordelig reizen van deur-tot-deur”.

NS-Businesscard als OV Chipkaart

De eerste ervaring was goed: door de zomer dienstregeling, reden er minder treinen van Den Haag Laan van NOI naar Rotterdam Centraal. Dus heb ik de Randstadrail lijn E gepakt: die doet er normaal 5 minuten langer over dan de trein, maar met minder treinen per uur tijdens de NS zomerdienstregeling ben je toch eerder op Rotterdam Centraal daan wachten op de volgende NS trein.

Dit werkte in 1 keer: ik kon de NS-Businesscard moeiteloos gebruiken als OV Chipkaart. Handig!

Onhandig: Activeren van NS-Businesskaart voor in-/uitchecken op NS stations

Je zou denken dat je met een NS-Businesscard meteen vanaf de NS Station kunt in-/uitchecken, maar dat is niet zo. Je moet dit op http://ns.nl/bc activeren.

Daarmee dacht ik dat het meteen werkt: de OV-chipkaart palen van de NS staan on-line in verbinding met de NS, en kunnen zowel lezen als schrijven op de kaart, maar zo simpel is het niet. Je moet eerst op een NS kaartjesautomaat de producten op je NS-Businesscard activeren. Daarna werken de OV-chipkaart palen van de NS.

Onhandige plaatsing van de OV-chipkaart palen op station Schiphol

Op Schiphol staan in tegenstelling tot de stemelautomaten (die staan boven) de de OV-chipkaart palen alleen beneden, vaak verborgen achter wachtende reiziers.

Erg onhandig als je haast hebt en niet precies weet waar ze staan.

Daarom dit eens nagevraagd bij de servicebalie op Schiphol: Schiphol verbiedt de NS om de OV-chipkaart palen op een meer logische plek te zetten. De stempelautomaten mogen wel blijven staan omdat ze daar al sinds het begin staan, maar nieuwe zaken mogen niet.

Handig voor een luchthaven die de efficientie voor reizigers hoog in het vaandel heeft staan!

Standaard NS-reizen met in-/uitchecken op NS stations werkt

Daarna een paar dagen heel makkelijk tussen Rotterdam Centraal en Schiphol: wegens werkzaamheden hoefde je geen Fyra toeslag te betalen, dus maakte het niet uit met welke trein ik ging.

Fyra toeslag op NS-Businesscard kan niet

Een conducteur gaf tijdens een van de reizen aan dat je de Fyra toeslag op een OV-chipkaart kunt laden. Dus dat probeerde ik op Schiphol. Ik had er een minuut of 10 voor uitgetrokken, maar het lukte niet, dus de Fyra gemist en een normale Intercity genomen.

In het weekeinde las ik op de site van de Fyra, dat je de Fyra toeslag wel op een normale OV-chipkaart kunt laden, maar niet op een NS-businesscard (die wel gewoon op de metro werkt). Om met George Orwell te spreken: sommige OV-chipkaarten zijn dus meer gelijk als andere.

Links op de NS-site doen niet wat je denkt dat ze doen

In de loop van de middag gecontroleerd weke trein ik we/niet ging halen. Er is zomerdienstregeling, dus niet alle treinen rijden, en het wil met aankomst/vertrektijden nog wel eens hommeles zijn, dus de vertrektijden van Rotterdam Centraal gecontroleerd. Je denkt dat de link die je op de NS-site kopieert ook echt werkt: http://ns.nl/actuele-vertrektijden/main.action?vertrekstationdetails=rtd

Helaas, je moet hier dus alsnog “rtd” of  ”Rotterdam Centraal” intikken om de juiste vertrektijden te zien.

Er zijn verder zat andere links die het op de NS-site niet doen, en die ze nooit gaan terugvinden zoals bijvoorbeeld de eerste link op http://www.ns.nl/zakelijk/producten/voor-reizigers/diensten-met-ns-business-card/de-trein-en-fyra.html die wijst naar een niet bestaande pagina http://www.ns.nl/cms/aanvragen-reizen-op-rekening_1.

Niemand bij de NS gaat die links terugvinden omdat in plaats van HTTP foutcode 404 (not found), er een HTTP successcode 200 (OK) wordt teruggeven.

Product op dezelfde dag bestellen en opladen op de NS-businesscard werkt niet

Toen ik zeker wist welke trein ik ging halen heb ik op de http://www.ns.nl/businesscard site een reis geboekt: 20% korting (want na 09:00), met Fyra toeslag.

Bij station Rotterdam Centraal aangekomen geprobeerd (op 3 verschillende automaten!) om dat product op de NS-Businesscard te laden. Dat werkt dus niet! Alle automaten gaven aan dat er geen producten voor deze NS-Businesscard klaar stonden.

Daarom maar een papieren Fyra-toeslagkaartje gekocht, en met de NS-Businesscard ingechecked op Rotterdam Centraal en later uitgechecked op Schiphol.

Een bestelling waar je niets meer aan hebt verwijderen kan niet

In de trein heb ik daarna gebeld met het 0900-betaalnummer achter op de NS-Business card. Daar in eerste instantie geprobeerd om het product dat ik besteld had te annuleren. Dat was nog lastig, want dit nummer heeft aan de ene kant keuzemenus waar je een nummertje moet intikken, maar op andere plekken moet je met natuurlijke taal inspreken wat je wilt. Daar kom je natuurlijk pas sachter als je een paar minuten en een paar keer de melding dat de computer niet begrepen heeft wat je bedoelt.

Een bestelling verwijderen mag niet als je die op dezelfde dag besteld hebt.

Daarom het nummer nog eens geprobeerd te bellen en een minuut of wat de menus doorgegaan om te kijken of ik een mens aan de lijn kon krijgen, maar dat werkt niet: dit nummer is alleen maar computer-operated.

Service loket op Schiphol weet ook niet precies

Het NS Service loket op Schiphol was heel vriendelijk; ik mocht zelfs op hun kosten de 0900 nummers bellen. Hun eerste reactie was “dat moet u via uw werkgever regelen”, handig: als ZZP-er ben ik dat zelf :)

Ze waren heel verbaasd wat er niet mogelijk was (ook de mensen die per portofoon werden geconsulteerd), en na wat heen en weer gebel bleven de opties “internet” en NS Servicedesk over.

Omdat er inmiddels een redelijke rij achter me stond, heb ik het bel-aanbod vriendelijk afgewezen en dat later zelf gedaan.

De NS servicedesk weet nauwelijks iets van de NS-Businesscard

Om te kijken of ik via een mens verder kon komen daarna via via het 0900-betaalnummer van de NS servicedesk opgezocht.

Dat is ook een computer-operated menu, maar onder sommige entries (niet alle entries die beginnen met “een mens spreken” geven ook een mens aan de lijn) krijg je dus een mens aan de lijn.

Het viel me al op dat in de menu’s nergens “NS-Businesscard” voorkomt, maar omdat dit een OV-Chipkaart is dit en één van de “mens spreken” opties onder “OV-chipkaart” inderdaad een mens aan de lijn gaf, daar gevraagd hoe het zat. En inderdaad: ik kreeg iemand aan de lijn die aangaf  - na de opties “internet en 0900-nummer op de NS-Businesscard” aan te bieden – dat NS-Businesscard iets “aparts” is en dat die een eigen (030!) nummer hebben.

Dat 030 nummer is (handig voor B2B) alleen tijdens kantooruren (08:30 tot 17:00) geopend.

Wordt vervolgd…

–jeroen

Posted in LifeHacker, Power User | 2 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 366 other followers