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 April, 2019

Just found out about the SysUtils.FindCmdLineSwitch Function

Posted by jpluimers on 2019/04/17

I learn new things every day. So today I learned about [WayBackSysUtils.FindCmdLineSwitch Function, which was introduced in Delphi 4, but I was still messing with ParamCount/ParamStr loops.

It as not changed over time. The above docs are Delphi 2007, and these are some of the newer:

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | Leave a Comment »

Essential drop table animals – now with user-generated content – ThePracticalDev – O RLY?

Posted by jpluimers on 2019/04/17

Source:

'; DROP TABLE animals; --

Now with user-generated content!

O RLY? @ThePracticalDev

Via:

Also available as [WayBack] Big picture.

–jeroen

Posted in Database Development, Development, Fun | Leave a Comment »

Debugging RTL/VCL Code with CodeSite – Dave’s Development Blog

Posted by jpluimers on 2019/04/17

This is so cool! [WayBackDebugging RTL/VCL Code with CodeSite – Dave’s Development Blog.

It comes down to performing CodeSite.Send(...) calls as evaluation expressions in non-breaking breakpoints.

Ensure you have the CodeSite.Logging unit in your uses lists and you’re good to go.

Thanks David for pointing me to this!

This is even more useful than the breakpoint Log Message itself (which is only a string) or plain Eval Expression (which puts just one item into the Delphi event log) despite them being there since Delphi <= 5:[WayBackDebugging code in Delphi XE – Stack Overflow.

–jeroen

via: [WayBack] Debugging RTL/VCL Code with CodeSite – David Hoyle – Google+

 

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

Delphi annoyance: in debug mode, no breakpoints are being adhered to, no blue bullets

Posted by jpluimers on 2019/04/16

For all Delphi Galileo versions (the BDS based Delphi versions: 8 until now), I have bumped into this annoyance:

Over time, while working on an application, running it in DEBUG mode in the debugger, wil not fire any breakpoints and all blue bullets (meaning the lines have code generated) are gone.

There are no warnings or (error) dialogs leading to this situation.

The only remedy is to quit Delphi, start it again, then do a full rebuild of the application.

Of course this happens more often with large applications than with small ones.

Is there anyone who has a reliable method to:

  • signal this before it happens
  • workaround it in a better way

–jeroen

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

Lesson learned: do not copy/paste code from the `Visual` WordPress.com editor…

Posted by jpluimers on 2019/04/16

[WayBack] Lesson learned: do not copy/paste code from the Visual WordPress.com editor; copy from the Text editor or the Preview… – Jeroen Wiert Pluimers – Google+.

Note: likely the HTML below got rendered badly by WordPress.com, so the gist below has the same text as a MarkDown file.

Ever wonder why copy-pasting code from your WordPress.com post fails?

The first statement fails, but the second works:

[root@linux:/etc] # useradd --create-home --shell /bin/false autossh24
useradd: unrecognized option '--shell /bin/false'
...
[root@linux:/etc] # useradd --create-home --shell /bin/false autossh24
[root@linux:/etc] #

The reason is that the first is copied from the Visual WordPress.com editor that renders this HTML inserting &nbsp; which is a different unicode characer (0x00A0) than a normal space (0x0020):

<blockquote><p><code data-mce-selected="1"># <strong>useradd --create-home --shell&nbsp;/bin/false autossh24</strong></code></p></blockquote>

However, the the second copied from the Text WordPress.com editor succeeds because it has all regular spaces:

<blockquote><code># <strong>useradd --create-home --shell /bin/false autossh24</strong></code></blockquote>

Luckily the Preview render is correct:

<blockquote><p><code># <strong>useradd --create-home --shell /bin/false autossh24</strong></code></p></blockquote>

Lesson learned: do not copy/paste code from the Visual WordPress.com editor; copy from the Text editor or the Preview.

–jeroen

[WayBackEver wonder why copy-pasting code from your WordPress.com post fails?

Read the rest of this entry »

Posted in Development, PHP, Scripting, SocialMedia, Software Development, Web Development, WordPress, WordPress | Leave a Comment »

delphi – IfThen(Assigned(Widget), Widget.Description, ‘No Widget’) doesn’t crash. Should it? – Stack Overflow

Posted by jpluimers on 2019/04/16

Very interesting question [WayBackdelphi – IfThen(Assigned(Widget), Widget.Description, ‘No Widget’) doesn’t crash. Should it? – Stack Overflow.

Three important things here:

  • depending on inlining and kind of arguments, function calls can evaluate their arguments one or multiple times
  • lacking formal language specification, you never know if a method will be inlined or not
  • function calls should not have side effects

Via another interesting discussion at [WayBack] Inline functions are not guaranteed to evaluate their arguments exactly once… – David Heffernan – Google+

–jeroen

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

mail-filters/Makefile at master · fumiyas/mail-filters

Posted by jpluimers on 2019/04/15

Cool tool if you use Postfix: mail-filters/Makefile at master · fumiyas/mail-filters.

You set it up like this:

cd /etc/postfix
wget https://raw.githubusercontent.com/fumiyas/mail-filters/master/postfix/Makefile

Then each time you change your postfix configuration:

cd /etc/postfix
make

In that directory, it will (re)generate a Makefile.postmapbased on the lines with hash in main.cf, then make each .db file from the source hash file.

After that you have to manually restart postfix, which depends on your Linux flavour.

Similar solutions:

–jeroen

Posted in *nix, *nix-tools, Development, Makefile, postfix, Power User, Scripting, Software Development | Leave a Comment »

AlessandroZ/LaZagne: Credentials recovery project

Posted by jpluimers on 2019/04/15

Just when I thought I made a note of a password I hardly ever use, I didn’t, luckily this open source tools understands how to recover many kinds of passwords: AlessandroZ/LaZagne: Credentials recovery project.

–jeroen

Posted in *nix, *nix-tools, Chrome, Development, DVCS - Distributed Version Control, Firefox, git, Internet Explorer, Office, Opera, Outlook, Power User, Python, Scripting, Skype, Software Development, Source Code Management, Web Browsers, WiFi, Windows | Leave a Comment »

Default OpenSuSE Postfix main.cf forgets to configure SASL for cyrus…

Posted by jpluimers on 2019/04/15

If you see the below in your Postfix log when trying to test your config, then the SASL configuration is empty. Oddly that seems the default on OpenSuSE for a while now, despite it providing cyrus SASL out of the box.

Sep 15 14:30:07 katrien postfix/smtpd[12719]: fatal: bad string length 0 < 1: smtpd_sasl_path =
Sep 15 14:30:08 katrien postfix/master[12400]: warning: process /usr/lib/postfix/smtpd pid 12719 exit status 1
Sep 15 14:30:08 katrien postfix/master[12400]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

Prior OpenSuSE versions had this in /etc/postfix/main.cf:

# SASL stuff
############################################################
smtp_sasl_auth_enable = no
smtp_sasl_security_options =
smtp_sasl_password_maps =
smtpd_sasl_auth_enable = no
#smtpd_sasl_path = private/auth
#smtpd_sasl_type = dovecot

Newer OpenSuSE versions have this:

# SASL stuff
############################################################
smtp_sasl_auth_enable = no
smtp_sasl_security_options =
smtp_sasl_password_maps =
smtpd_sasl_auth_enable = no
# cyrus : smtpd_sasl_type = cyrus, smtpd_sasl_path = smtpd
# dovecot : smtpd_sasl_type = dovecot, smtpd_sasl_path = private/auth
smtpd_sasl_path =
smtpd_sasl_type = 

Despite the newer having these installed:

# rpm -qa | grep cyrus
cyrus-sasl-crammd5-2.1.26-14.2.aarch64
cyrus-sasl-2.1.26-14.2.aarch64
cyrus-sasl-plain-2.1.26-14.2.aarch64
cyrus-sasl-digestmd5-2.1.26-14.2.aarch64
cyrus-sasl-gssapi-2.1.26-14.2.aarch64

Solution:

smtpd_sasl_path = smtpd
smtpd_sasl_type = cyrus

Since the values for both lines are default, you could even comment them out; see the documentation:

–jeroen

Via: [WayBackpostfix IRC logs [July 26 – 2007]

Posted in *nix, *nix-tools, Linux, openSuSE, postfix, Power User, SuSE Linux, Tumbleweed | Leave a Comment »

When your triple/quad-play providers refuse to give your VoIP SIP credentials, but allows access to your modem: use Wireshark on the WAN side

Posted by jpluimers on 2019/04/12

Every now and then I hear about providers that refuse to hand over the VoIP SIP credentials.

If you do have access to your modem, you can Wireshark the WAN side, then reset the modem and capture traffic until it has obtained the VoIP information:

[WayBack] Telfort SIP (getest met Glasvezel) | Het leven van Teus & Simone:

Veel mensen op het forum van Telfort vragen zich af of ze de SIP gegevens kunnen krijgen voor telefonie zodat men de ExperiaBox niet hoeven te gebruiken. Gezien dat de Telfort Support deze gegevens…

Via:

–jeroen

Posted in *nix, *nix-tools, Internet, Power User, Wireshark | Leave a Comment »