The Wiert Corner – irregular stream of stuff

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

  • My badges

  • Twitter Updates

  • Pages

  • All categories

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

    Join 1,839 other subscribers

How to take a screenshot on the Nexus 4 | How To – CNET

Posted by jpluimers on 2013/03/27

Thanks Jason Cipriani – CNET:

To take a screenshot on the Nexus 4, press and hold down the power and volume down buttons at the exact same time. After a few seconds you’ll feel a vibration on your device and you’ll see the screenshot minimize into the notification tray. Pulling down the notification tray will in turn allow you to quickly share the picture.

–jeroen

via: via How to take a screenshot on the Nexus 4 | How To – CNET.

Posted in Android Devices, Google, Nexus 4, Power User | 1 Comment »

Delphi: you should avoid the `with` statement as it makes your code less future proof

Posted by jpluimers on 2013/03/27

As I wrote before, I’m with the [WayBack] Delphi with haters camp, and this is why:

Using the [WayBackwith statement in Delphi makes your code less future proof.

Originally, the with statement in Pascal was argumented in part of allowing compiler optimisations:

PASCAL User Manual and Report – Kathleen Jensen, Niklaus Wirth – Google Books

The with clause effectively opens the scope containing field identifiers of the specified record variable, so that the field identifiers may occur as variable identifiers. (Thereby providing an opportunity for the compiler to optimize the qualified statement.)

Screenshots of this 1975 book are below the fold.

The Delphi (actually even before that Turbo Pascal compiler) has no measurable difference between with and non-with code.

The debugger however, still does not support with, and there are other drawbacks of which one is below.

The below code example is just one of many. I show it because I recently bumped into doing some long overdue code porting to Delphi XE3.

Since I’ve been bitten by using with a couple of times before, it didn’t take me long to find the cause.

Example code where FIConData is of type NOTIFYICONDATAW that used to compile fine:

    with FIconData do
    begin
      cbSize := SizeOf(FIconData);
      Wnd := Self.Handle;
      uID := $DEDB;
      uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
      hIcon := Application.Icon.Handle;
      uCallbackMessage := WM_CAS400NTIcon;
      StrCopy(szTip, PChar(Caption));
    end;

Well, as of Compiler Version 20, it doesn’t compile any more. Read the rest of this entry »

Posted in Borland Pascal, Conference Topics, Conferences, Delphi, Delphi 1, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Development, Event, Pascal, Software Development, Turbo Pascal, With statement | 32 Comments »

WebSphere MQ errors I encountered.

Posted by jpluimers on 2013/03/26

While porting a library from Delphi 2006 to Delphi XE2.

The really cool thing is that the Windows Event Log contains details of what I did wrong (:

  • 2277 (08E5) (RC2277): MQRC_CD_ERROR
    Oops, typo on the header file.The MQCD structure supplied was not valid.The value of the ‘CLWLChannelWeight’ field has the value ‘0’. This value is invalid for the operation requested.Change the parameter and retry the operation.
  • 2538 (09EA) (RC2538): MQRC_HOST_NOT_AVAILABLE
    Oops, typo in the host name (:Remote host ‘Host.Domain’ not available, retry later.The attempt to allocate a conversation using TCP/IP to host ‘Host.Domain’ for channel WebSphereMQChannelName was not successful. However the error may be a transitory one and it may be possible to successfully allocate a TCP/IP conversation later. &P In some cases the remote host cannot be determined and so is shown as ‘????’.Try the connection again later. If the failure persists, record the error values and contact your systems administrator. The return code from TCP/IP is 11001 (X’0′). The reason for the failure may be that this host cannot reach the destination host. It may also be possible that the listening program at host ‘Host.Domain’ was not running. If this is the case, perform the relevant operations to start the TCP/IP listening program, and try again.
  • 2009 (07D9) (RC2009): MQRC_CONNECTION_BROKENTwo causes:- The service job on the AS/400 restarted; need to make the client more robust so it gracefully handles this.
    – WebSphere MQ 7.x needs different initialization than WebSphere MQ 5.x, I didn’t get some of the extra fields initialized correctly.
    Connection to host ‘Host (dot.ted.ip.addr)(TCPPort)’ for channel ‘WebSphereMQChannelName’ closed.An error occurred receiving data from ‘Host (dot.ted.ip.addr)(TCPPort)’ over TCP/IP. The connection to the remote host has unexpectedly terminated. &P The channel name is ‘WebSphereMQChannelName’; in some cases it cannot be determined and so is shown as ‘????’.

    Tell the systems administrator.

–jeroen

Posted in Delphi, Delphi XE2, Development, MQ Message Queueing/Queuing, Software Development, WebSphere MQ | Leave a Comment »

Why don’t the shortcuts I put in the CSIDL_COMMON_FAVORITES folder show up in the Favorites menu? – The Old New Thing – Site Home – MSDN Blogs

Posted by jpluimers on 2013/03/25

Why Internet Explorer does not use these two for showing shortcuts:

  • CSIDL_COMMON_FAVORITES
  • %ALL­USERS­PROFILE%\Microsoft\Internet Explorer\Quick Launch

–jeroen

via: Why don’t the shortcuts I put in the CSIDL_COMMON_FAVORITES folder show up in the Favorites menu? – The Old New Thing – Site Home – MSDN Blogs.

Posted in 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 »

All About SEO on WordPress.com — Blog — WordPress.com

Posted by jpluimers on 2013/03/22

WordPress just posted a nice article on SEO for people that still don’t get that SEO is basically following common sense.

The most important bullets from the article:

SEO DOs and DON’Ts

Do:

  • Regularly publish original content.
  • Use a few precise categories and tags.
  • Write for human ears.
  • Build your traffic in smart, organic ways.
  • Choose simple, meaningful post slugs.
  • Create a descriptive tagline.
  • Include keywords selectively.

Don’t:

  • Start duplicate sites.
  • “Stuff” your site with irrelevant, broad categories, tags, or buzzwords.
  • Write with search engines in mind.
  • Purchase or exchange meaningless “backlinks.”
  • Buy into SEO fads.
  • Worry too much about SEO at the expense of writing good content!

Two things I didn’t know about: WordPress generates two sitemaps for each site: both a regular XML sitemap, as well as an XML based news-sitemap.

–jeroen

via: All About SEO on WordPress.com — Blog — WordPress.com.

Posted in Google, GoogleSearch, Power User, SocialMedia, WordPress | Leave a Comment »

Het Agentschap NL moet nog wat S&O doen naar e-mail templates (Bevestiging Mededeling WBSO RDA 2012)

Posted by jpluimers on 2013/03/22

Als je een mail krijgt als onderstaande, dan weet je dat er iemand niet heeft opgelet bij het maken en controleren van de e-mail templates:

from: noreply@agentschapnl.nl

Geachte ${naam},

Uw mededeling WBSO/RDA 2012 voor is ontvangen op 22-03-2013 18:11.
Alleen als er sprake is van een correctie op de afgegeven WBSO verklaringen en/of RDA beschikkingen ontvangt u hiervan schriftelijk bericht.

In uw ingediende mededeling kunt u zien of er sprake is van een correctie.

Met vriendelijke groet,
Agentschap NL

(Deze e-mail is automatisch gegenereerd en kan niet worden beantwoord.)

–jeroen

via Bevestiging Mededeling WBSO RDA 2012 – jeroen.pluimers.com@gmail.com – Gmail.

Posted in User Experience (ux) | Leave a Comment »

Reminder to Self: after installing the WebSphere MQ client software, reboot!

Posted by jpluimers on 2013/03/22

After installing the WebSphere MQ 7.x client software, you must reboot.

Otherwise the directory where mqic.dll resides doesn’t get added to the system path.

I was bitten by this with an unattended installation at a client where they forgot to have the system to reboot.

–jeroen

Posted in Development, MQ Message Queueing/Queuing, Power User, Software Development, WebSphere MQ, Windows | Leave a Comment »

my flights – Google Search

Posted by jpluimers on 2013/03/21

Cool: Google understands which flights I have booked: my flights – Google Search.

Now hopefully Lufthansa will strike only for one day, and not cancel my Amsterdam->Munich flight on saturday.

Lufthansa ® – Cancelled Flights.

–jeroen

Posted in LifeHacker, Power User | Leave a Comment »

Porting to Delphi XE2: Delphi XE2 Unit scope names not always right

Posted by jpluimers on 2013/03/21

Sometimes, Delphi XE2 gets confused after converting an old Delphi project because the Unit scope names are not correct. When creating a new Delphi XE2 application, the Unit scope names are as follows:

  • System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell

This means that if you don’t prepend a unit with a Unit scope prefix, Delphi will automatically try the list above. The thing is: when importing a Delphi project from an old Delphi version, the Unit scope names are somehow “guessed”, and not always complete:

  • System;Xml;Data;Datasnap;Web;Soap;Winapi

This means it cannot resolve the right name for the VCL units like Controls or Forms, and you get a nice compiler error: But with the default, it cannot resolve the Windows and other units in the Winapi scope. So the list I normally use is one of these:

  • System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;Winapi;System.Win
  • System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;Winapi;System.Win;Bde

(Yes, some apps still store Paradox data locally and use the BDE)

–jeroen

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

Will it live or die like Reader? Did they rush it? – Google Keep – Android Apps on Google Play

Posted by jpluimers on 2013/03/21

Interesting questions that come up:

– did they rush this because of the media attention the last couple of days?
– will it follow the Google Reader after a few years of use?

–jeroen

via: Google Keep – Android Apps on Google Play.

Posted in Opinions | Leave a Comment »