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,854 other subscribers

Archive for 2018

CodeRage 8 replays: REST stuff

Posted by jpluimers on 2018/07/12

It seems I forgot to schedule this post, as it was still in the drafts.. So here it is for historic purposes. Likely a few links have died by now.

Last year I could not make it to CodeRage 8 as I was prepping for EKON 17 and ITDevCon 2013.

But there were some nice presentations, some of which I really wanted to see again.

So I was glad to have found the CodeRage 8 Replayshttp://www.youtube.com/playlist?list=PLwUPJvR9mZHiaYvH9Xr7WuFCVYugC4d0w.

Especially for these sessions as REST support is an under-marketed aspect of Delphi XE5:

And a few others as well:

–jeroen

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

The Relationship between Static Analysis and Continuous Testing – DaedTech

Posted by jpluimers on 2018/07/12

You need both, no matter what software development environment you use: [WayBack] The Relationship between Static Analysis and Continuous Testing – DaedTech

Via: [WayBack] The Relationship between Static Analysis and Continuous Testing – DaedTech – Marjan Venema – Google+

–jeroen

Posted in Development, Software Development | Leave a Comment »

Delphi TList.Grow and TStringList.Grow perform differently

Posted by jpluimers on 2018/07/12

Just as a reminder to self: the non-generic TStringList and TList grow way less aggressive than the generic TList:

  • TList.Grow and TStringList.Grow:
    • 4, 8, 12, 28, 44, 60, 76, 95, 118, 147, 183, 228, 285, 356, 445, 556, 695, 868, 1085
  • Generic TList growth via TListHelper.InternalGrow:
    • 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024

Sources:

–jeroen

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

“The login already has an account under a different user name.” – MSSQL

Posted by jpluimers on 2018/07/11

You get “The login already has an account under a different user name.” when you try to create a user that already exists.

In this case it was a statement somewhere in a database creation script having a statement like this:

exec sp_addlogin N'<<UserName>>', N'<<Password>>', @logonDatabase, @logonLanguage

What happened was that the <<UserName>> in the script already existed and was used to create the new user using sp_addlogin.

I know that this is deprecated, but the search above also shows it happen with other ways of adding users.

It had been a while since doing SQL Server, so this was a good time for me to find back the relation between [WayBack] SQL Server Logins and Users

These queries will help you identify which ones are currently in your database:

use CRM124TestJWP
go

select sl.name as LoginName
     , su.name as UserName
     , sl.dbname as DatabaseName
from sys.sysusers su
join sys.syslogins sl on sl.sid = su.sid

select sp.name as LoginName
     , sp.type_desc as LoginType
     , dp.name as UserName
     , dp.type_desc as UserType
     , sp.default_database_name as DefaultDatabase
     , dp.default_schema_name as DefaultSchema
from sys.server_principals sp
join sys.database_principals dp on dp.sid = sp.sid

Via: [WayBack] sql server – The login already has an account under a different user name – Database Administrators Stack Exchange

Read the rest of this entry »

Posted in Database Development, Development, SQL Server | Leave a Comment »

Delphi – pressing Ctrl-A on a TDBEdit was partially fixed in Delphi 10.2 Tokyo

Posted by jpluimers on 2018/07/11

[WayBack] QualityCentral 110308 – TDBEdit updates wrongly Datalink.Modified when Dataset being in Browse mode and [WayBack] QualityCentral 127300 – Closed Exception When Ctrl+A (select text) on TDBEdit have been partially fixed in Delphi 10.2 Tokyo under [RSP-16288] Bug after selecting all the text by pressing Ctrl+A in TDBEdit and pressing TAB – Embarcadero Technologies.

Since there is only manual syncing from Quality Portal to Quality Central, and only Quality Central is indexed by search engines, the public at large usually finds the Quality Central bugs.

Basically, the affected controls ([WayBack] TDBEdit, [WayBackTDBComboBox, [WayBack] TDBMemo, but not [WayBackTDBRichEdit – probably not needed as I could not reproduce the [WayBack] TClientDataSet based QC127300 attachment in Delphi 10.1 with TDBMemo or TDBRichEdit, though neither selected of these two all text, which 10.2 also fixes).

the .KeyPress methods now check for a Ctrl-A case like this:

    ^A:
      begin
        SelectAll;
        Key := #0;
      end;

and some of the .KeyDown methods have been tuned a little by setting Key := 0 when Edit returns false.

–jeroen

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

“Don’t access VCL from a background thread” – how to demo that?

Posted by jpluimers on 2018/07/11

When accessing the VCL from multiple threads at the same time: adopted from ...\DEMOS\THREADS\THRDDEMO.DPR

When accessing the VCL from multiple threads at the same time: adopted from …\DEMOS\THREADS\THRDDEMO.DPR

Great question a while ago:

[WayBack] “Don’t access VCL from a background thread” – how to demo that? – Primož Gabrijelčič – Google+

For me, the ultimate way why not to access the VCL from a background thread is the precursor of the official threads demo that ships from Delphi 2 to Delphi XE6 in ...DEMOS\THREADS\THRDDEMO.DPR. where you’d think the thread isolation would be in ...DEMOS\THREADS\ThSort.pas but actually is in ...DEMOS\THREADS\SortThds.pas.

The first public showing of that demo did not include main thread protection. It originates from a session at the the 1995 Borland Developers Conference where Ray Konopka showed the below code from Bob Ainsbury.

That session reminded why this joke [WayBack] Via the EKON20 sessions… – Jeroen Wiert Pluimers – Google+ was so funny:  “When Ray Konopka enters the room you have a Raize condition.“.

The question above also made me find back this reference to BorCon95 in San Diego:

Read the rest of this entry »

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 10.2 Tokyo (Godzilla), Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 2 Comments »

Transform Your ESP8266 Board into a USB to Serial Board Easily with Arduino Serial Bypass Sketch

Posted by jpluimers on 2018/07/11

An interesting re-use: [WayBackTransform Your ESP8266 Board into a USB to Serial Board Easily with Arduino Serial Bypass Sketch

Via: [WayBack] If you don’t have a USB to TTL board around, you can use an +ESP8266 board instead (or any other Arduino compatible boards with USB). – Jean-Luc Aufranc – Google+

–jeroen

Posted in Development, ESP8266, Hardware Development, IoT Internet of Things, Network-and-equipment, Power User | Leave a Comment »

MSSQL: finding column names

Posted by jpluimers on 2018/07/10

This small query gives you the tables, views and columns having characters likely not translating directly to ORM identifiers because they contain other characters than a-zA-Z0-9:

select *
from INFORMATION_SCHEMA.COLUMNS c
where 1=0
or c.TABLE_NAME LIKE '%[^a-zA-Z0-9_]%'
or c.COLUMN_NAME LIKE '%[^a-zA-Z0-9_]%'

The view [WayBack] COLUMNS (Transact-SQL) | Microsoft Docs in the … has been around since at least SQL Server 2000, so this is a pretty safe method for finding those columns.

As a bonus, I learned that SQL Server supports a subset of regular expression matches in like also since at least SQL Server 2000: LIKE.

Via [WayBack] SQL Server 2008 query to find rows containing non-alphanumeric characters in a column – Stack Overflow.

Related:

–jeroen

Posted in Database Development, Development, SQL Server | Leave a Comment »

Professional techniques for C# – Lecture Notes Parts 1..4 of 4 – CodeProject

Posted by jpluimers on 2018/07/10

If you’re new to C#, below is a good series of articles to get started.

Even if you’re not so new, there are quite some interesting bits to learn from them:

  1. [WayBackAn advanced introduction to C# – Lecture Notes Part 1 of 4 – CodeProject
    1. Introduction
    2. The right development environment
    3. Basic concepts
    4. Namespaces
    5. Data types and operators
    6. Reference and value types
    7. Control flow
    8. Object-oriented programming
    9. Inheritance and polymorphism
    10. Access modifiers
    11. Properties
    12. The constructor
    13. Abstract classes and interfaces
    14. Exception handling
    15. Outlook
    16. Other Articles in this Series
    17. References
    18. History
  2. [WayBackMastering C# – Lecture Notes Part 2 of 4 – CodeProject
    1. Introduction
    2. Enumerations
    3. Delegates
    4. Auto-generated properties
    5. Generic types
    6. Generic methods
    7. Constraints
    8. Lambda expressions
    9. Anonymous objects & inferring types
    10. Extension methods
    11. LINQ
    12. Windows Forms development
    13. Custom drawing in Windows Forms
    14. Outlook
    15. Other Articles in this Series
    16. References
    17. History
  3. [WayBackAdvanced programming with C# – Lecture Notes Part 3 of 4 – CodeProject
    1. Introduction
    2. Events
    3. The .NET standard event pattern
    4. Reflection
    5. Dynamic Types
    6. Accessing the file system
    7. Streams
    8. Threads
    9. Thread-communication
    10. The Task Parallel Library
    11. Tasks and threads
    12. Awaiting async methods
    13. Outlook
    14. Other Articles in this Series
    15. References
    16. History
  4. [WayBackProfessional techniques for C# – Lecture Notes Part 4 of 4 – CodeProject
    1. Introduction
    2. More control on events
    3. Overloading operators
    4. The yield statement
    5. Iterators
    6. Understanding co- and contra-variance
    7. Using attributes effectively
    8. Elegant binding
    9. Unsafe code
    10. Communication between native and managed code
    11. Effective C#
    12. Outlook
    13. Other Articles in this Series
    14. References
    15. History

 

–jeroen

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

IoT & Smart Location of Things – Google Maps, Google Cloud

Posted by jpluimers on 2018/07/10

#IoT + Google Maps Geocoding API

Convert between addresses & geographic coordinates to determine the location of devices relative to known addresses https://goo.gl/BfwYTF

Edit 202400819: the Googl link above will die, and the link it pointed to (enterprise.google.com/maps/iot) back then pointed to [Wayback/Archive] IoT & Smart Location of Things – Google Maps, Google Cloud.

Source: [WayBackIoT & Smart Location of Things – Google Maps, Google Cloud

Via: [WayBack] Google Maps API – Google+

--jeroen

Posted in Development, IoT Internet of Things, LoRa - Long Range wireless communications network, Network-and-equipment, Power User, Software Development | Leave a Comment »