Still relevant [WayBack] When did we stop caring about memory management? – Scott Hanselman
Via: [WayBack] Jeroen Wiert Pluimers – Google+
–jeroen
Posted by jpluimers on 2020/09/29
Still relevant [WayBack] When did we stop caring about memory management? – Scott Hanselman
Via: [WayBack] Jeroen Wiert Pluimers – Google+
–jeroen
Posted in Development, Software Development | Leave a Comment »
Posted by jpluimers on 2020/09/29
As a (then) go lang n00b, the less upvoted answers helped me e lot: [WayBack] variables – What is “_,” in a Golang declaration? – Stack Overflow:
The Go compiler won’t allow you to create variables that you never use.
for i, value := range x { total += value }The above code will return an error message “i declared and not used”.
Since we don’t use i inside of our loop we need to change it to this:
for _, value := range x { total += value }
_is the blank identifier. Meaning the value it should be assigned is discarded.Here it is the value of
examplekey that is discarded. The second line of code would discard the presence boolean and store the value inprs.
So to only check the presence in the map, you can discard the value. This can be used to use a map as a set.
–jeroen
Posted in Development, Go (golang), Software Development | Leave a Comment »
Posted by jpluimers on 2020/09/29
Cool, this works in a Mac and Linux too: mssql extension for VS Code.
Links:
–jeroen
Posted in .NET, Database Development, Development, Software Development, SQL Server, Visual Studio and tools, vscode Visual Studio Code | Leave a Comment »
Posted by jpluimers on 2020/09/28
Windows 10 comes with a broken Camera viewer and before that, Windows 7 killed the one in Windows XP.
On a Mac you have the open source Quick Camera (which named QCamera before, seeViewing an USB camera on Mac OS X without mirroring and Capturing from a Magewell XI100USB on a Mac using OS X) at [WayBack] GitHub – simonguest/quick-camera.
For Windows 7, a long search initially revealed a lot of bloat-ware, but finally ended to these two both from the same author:
It is not open source (yet?), but since it is .NET, it is reasonable easy to see the innards.
Like QCamera, it does not require installation: just unzip and run. Enjoy!
Yes, I know there are Windows 10 workaround steps via Microsoft.CameraApp.App.ctor, but if you look at [WayBack] Win10 Home N – Camera App fails: System.IO.FileNotFoundException – Microsoft Community you will understand I did not apply them.
Similarly, when you install Skype from the app store, then sign-in, it will tell you that Skype is out of date.
–jeroen
via:
Posted in .NET, Apple, Development, Mac OS X / OS X / MacOS, Power User, Software Development, 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 »