On my list of things to play with is ScreenToGif via [WayBack] Creating animated GIFs from screenshots – twm’s blog
–jeroen
Posted by jpluimers on 2020/09/25
On my list of things to play with is ScreenToGif via [WayBack] Creating animated GIFs from screenshots – twm’s blog
–jeroen
Posted in Power User, Windows | Leave a Comment »
Posted by jpluimers on 2020/09/25
Great answer by Stefan Glienke at [WayBack] What’s the use of AlignAttribute? The documentation only says Internal use only. – 丽丽乌克 – Google+:
It forces the element it annotates to be aligned like specified – valid values are the same as for
$A(1,2,4,8,16)Example:
{$A4} type TMyRecordA = record x: Integer; y: Int64; end; TMyRecordB = record x: Integer; [Align(8)] y: Int64; end; var a: TMyRecordA; b: TMyRecordB; offset: Integer; begin offset := PByte(@a.y) - PByte(@a); Writeln(SizeOf(a)); Writeln(offset); offset := PByte(@b.y) - PByte(@b); Writeln(SizeOf(b)); Writeln(offset);this will output:
12
4
16
8
–jeroen
Posted in Delphi, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2020/09/24
At [WayBack] References for “The Future of Programming” you find the links and quotes Bret Victor used for his great talk.
The talk reminds me talks by Kevlin Henney, which combine a historic perspective on software development with how to apply that knowledge.
Time to dig into some more talks by Bret Victor and his site [WayBack] Bret Victor, beast of burden
He has done a lot of things, including designing the great resistor decoder I mentioned at Source: Electronics components and resistor decoder colours.
–jeroen
via: [WayBack] Jonas Bandi on Twitter: “It is easy to adopt new technologies, it can be hard to adopt new ways of thinking. https://t.co/gwbDrpWido”
Posted in Development, History, Software Development | Leave a Comment »
Posted by jpluimers on 2020/09/24
I’m connected to database. I use db by Management Studio 2012 Express. Can I check connection string by click something in Management Studio?
[WayBack] sql – How to check connection string in SSMS2012? – Database Administrators Stack Exchange
I adopted the SQL statement in the answer to the above question to:
select
-- part names via https://wiert.me/2012/11/07/netc-sqlclient-connectionstring-keys/
-- prefer SSPI over True via https://wiert.me/2010/10/19/solution-for-ole-db-provider-connecting-to-sql-server-giving-error-multiple-step-ole-db-operation-generated-errors-check-each-ole-db-status-value-if-available-no-work-was-done/
'Data Source=''' + @@servername + '''' +
';Initial Catalog=''' + db_name() + '''' +
case type_desc
when 'WINDOWS_LOGIN'
then ';Integrated Security=SSPI'
else ';User ID=''' + suser_name() + ''';Password='''''
end
as DotNetConnectionString,
-- note the below need to be URI-encoded later on:
'sqlserver://' + suser_name() + ':password@' + @@servername + '/' + db_name() + '?param1=value¶m2=value'
as GoLangConnectionString
-- sqlserver://username:password@host/instance?param1=value¶m2=value
-- https://github.com/denisenkom/go-mssqldb#connection-parameters-and-dsn
from sys.server_principals
where name = suser_name()
You can use this to generate connection strings for use in .NET, OLE DB, Visual Studio Code, go lang and likely many other tools.
Related:
–jeroen
Posted in Database Development, Development, Software Development, SQL, SQL Server, SSMS SQL Server Management Studio | Leave a Comment »
Posted by jpluimers on 2020/09/24
From Client: “How much time will it take to finish this job?”- Your Ex-Waifu
Client: “How much time will it take to finish this job?”
Me: “About six weeks”
Client: “You have two weeks.”
Me: “OK, I’ll try to explain myself better.”
–jeroen
Video: https://www.tumblr.com/video/newandimprovedbeef/170394974576/500/
Posted in Agile, Development, LifeHacker, Power User, Software Development | Leave a Comment »
Posted by jpluimers on 2020/09/23
As of Delphi XE6, the VCL also styles non-VCL controls, but this truncates the texts to 256 characters, for instance in non-balloon hints. This is fixed in Delphi 10.2 Berlin, by making the buffer dynamic and switching obtaining those texts from using GetWindowText to sending a WM_GETTEXT message.
A fix for Delphi XE6..10.1 Berlin is at gitlab.com/wiert.me/public/delphi/DelphiVclStylesAndHintText, with many thanks to Stefan Glienke who based the patch on the ones used in Spring4D. I think they are similar to the ones in [Archive.is] VCL Fix Pack 1.4 | Andy’s Blog and Tools.
The Old New Thing explains the difference between GetWindowText and WM_GETTEXT in [WayBack] The secret life of GetWindowText – The Old New Thing. TL;DR:
GetWindowText strikes a compromise.
- If you are trying to GetWindowText() from a window in your own process, then GetWindowText() will send the WM_GETTEXT message.
- If you are trying to GetWindowText() from a window in another process, then GetWindowText() will use the string from the “special place” and not send a message.
So for your own process, it does not matter as GetWindowText uses WM_GETTEXT.
–jeroen
Related:
Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development, The Old New Thing, Windows Development | Leave a Comment »
Posted by jpluimers on 2020/09/23
Start with this must read post: cross platform – What’s the best CRLF handling strategy with git? – Stack Overflow.
Then read all the links in that answer, especially
Then see if you agree with my conclusion:
use a .gitattributes file to steer line ending conversions on a per-repository base.
I usually try to have git not mess with any line endings: check-out as-is, check-in as is.
Historically this has been a mess (not limited to, but prevalent on Windows installations), not just because core.autocrlf has been superseded by core.eol, so below are some links that will help.
Always execute these after installing git:
git config --global core.autocrlf false
git config --global core.eol native
If needed, repeat in the current repository:
git config --local core.autocrlf false
git config --local core.eol native
Finally verify the settings with git config --list --show-origin (via [WayBack] Where does git config –global get written to? – Stack Overflow)
Note
The
git config listwill show equals signs. Do NOT use these when setting values: that will silently fail.So these fail:
git config --global core.autocrlf=false
git config --global core.eol=native
git config --local core.autocrlf=false
git config --local core.eolnativeDespite the output when listing on a machine that already had these values et:
git config --list | grep -w 'core.autocrlf\|core.eol'
core.autocrlf=false
core.eol=native
core.autocrlf=false
core.eol=native
core.autocrlf overrides core.eoltext attribute on a path tells Git not to attempt any end-of-line conversion upon checkin or checkout.core.safecrlf is set to “true” or “warn”, git verifies if the conversion is reversible for the current setting of core.autocrlf. For “true”, git rejects irreversible conversions; for “warn”, git only prints a warning but accepts an irreversible conversion. | Resulting conversion when | Resulting conversion when
| committing files with various | checking out FROM repo -
| EOLs INTO repo and | with mixed files in it and
| core.autocrlf value: | core.autocrlf value:
--------------------------------------------------------------------------------
File | true | input | false | true | input | false
--------------------------------------------------------------------------------
Windows-CRLF | CRLF -> LF | CRLF -> LF | as-is | as-is | as-is | as-is
Unix -LF | as-is | as-is | as-is | LF -> CRLF | as-is | as-is
Mac -CR | as-is | as-is | as-is | as-is | as-is | as-is
Mixed-CRLF+LF | as-is | as-is | as-is | as-is | as-is | as-is
Mixed-CRLF+LF+CR | as-is | as-is | as-is | as-is | as-is | as-is
╔═══════════════╦══════════════╦══════════════╦══════════════╗
║ core.autocrlf ║ false ║ input ║ true ║
╠═══════════════╬══════════════╬══════════════╬══════════════╣
║ git commit ║ LF => LF ║ LF => LF ║ LF => CRLF ║
║ ║ CR => CR ║ CR => CR ║ CR => CR ║
║ ║ CRLF => CRLF ║ CRLF => LF ║ CRLF => CRLF ║
╠═══════════════╬══════════════╬══════════════╬══════════════╣
║ git checkout ║ LF => LF ║ LF => LF ║ LF => CRLF ║
║ ║ CR => CR ║ CR => CR ║ CR => CR ║
║ ║ CRLF => CRLF ║ CRLF => CRLF ║ CRLF => CRLF ║
╚═══════════════╩══════════════╩══════════════╩══════════════╝
–jeroen
PS: To look at the various local and global settings, read Where does git config –global get written to? – Stack Overflow.
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »
Posted by jpluimers on 2020/09/23
The answer is no: [WayBack] Hi all, Can we truly assert that an array returned from a function is always a new true copy and that this is guaranteed to not change in between compil… – Ugochukwu Mmaduekwe – Google+
From Primož book and comment:
Depending on how you create this array.
For example, the following code outputs 42, not 17.
program Project142;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils;function Bypass(const a: TArray<integer>): TArray<integer>;
begin
Result := a;
end;var
a, b: TArray<integer>;begin
SetLength(a, 1);
a[0] := 17;
b := Bypass(a);
a[0] := 42;
Writeln(b[0]);
Readln;
end.You can use `SetLength(arr, Length(arr))` to make array unique. Changing Bypass to the following code would make the test program emit 17.
function Bypass(const a: TArray<integer>): TArray<integer>;
begin
Result := a;
SetLength(Result, Length(Result));
end;
–jeroen
Posted in Delphi, Development, Software Development | 1 Comment »
Posted by jpluimers on 2020/09/22
Every now and then I forget to git config --local user.name and git config --local user.email, so git takes my global settings and I need to fix one or more commits to it shows the correct author.
For the last commit, when not yet pushed, this is easy:
git commit --amend --author="Author Name <email@address.com>"
For historic commits, or when you already pushed, it gets far more difficult, so I am glad there is a good set of steps at [WayBack] git – Change commit author at one specific commit – Stack Overflow.
For now in my %USERPROFILE%\.gitconfig file, I have added entries for various accounts so it is easier to spot them with git config --list --global then edit them using git config --edit --local:
[user.foo]
name = jeroenfo
email = ########+jeroenfoo@users.noreply.github.com
[user.gh]
name = Jeroen Wiert Pluimers
email = jeroen.vvv.www@pluimers.com
[user.gl]
name = Jeroen Wiert Pluimers
email = jeroen.xxx.yyy@pluimers.com
If you pushed, but nobody pulled, and you are the only one committing, then the steps are like this if your git is 1.8 or higher:
git rebase -i --rootpick into edit:wq)No rebase in progress?:
git commit --amend --reset-author --no-editgit rebase --continue–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »
Posted by jpluimers on 2020/09/22
From a while back, but still relevant: [WayBack] Vererbung funktioniert in Cobol anders als in anderen Sprachen… – Kristian Köhntopp – Google+
Translated, this is:
I found some COBOL code at a client. Nothing special. The last comment in it was from 1985, written by my mother. That was my WTF moment of the year, including the look on the face of the technical manager: here inheritance gets a totally different perspective.
An interesting take from that thread is that in the past, women ruled IT.
They should do this again while they can, as a mixed team can combine “first time right” with “minimum viable product”. It is all about balance.
Andreas Dorfer
Cool-Programmierung in den 70ern und frühen 80ern scheint eine Frauendomäne gewesen zu sein. Zumindest bei uns waren die letzten Aktiven daran in den späten 90ern (die mehr als nur Hotfixes drangebastelt haben), gestandene Frauen mit Lesebrillen an Perlenketten.Jeroen Wiert Pluimers
+Andreas Dorfer yup, and they were doing excellent jobs. Women still could rule IT, there are just to few working in IT.Andreas Dorfer
+Jeroen Wiert Pluimers those folks really listened and asked relevant questions before making any half baked proposal. Then they produced a lot of documents in binders, including flow diagrams… made a prototype, tested the unit and produced another binder full of paper.. And if there any question after going live, they just told you on the phone: “Look at sheet xy, paragraph z, there we documented this behaviour as conforming your request. Shall we schedule a meeting to setup a change request together?”. They had been working like accounting: sometimes incredibly slow, but with precision and accuracy… if things went wrong, the best advice was always to ask yourself, where you might have a flaw in the initial request.
This apart from the fact that comments have not changed much over time:
Posted in Development, History, Software Development | Leave a Comment »