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 May, 2017

Anders Hejlsberg on Modern Compiler Construction | Seth Juarez | Channel 9

Posted by jpluimers on 2017/05/18

One of those “must watch” videos if you are remotely or more interested in how compilers influence our day to day coding activities.

The Red Dragon Book, first edition: Compilers. Principles, Techniques and Tools.

The Red Dragon Book, first edition: Compilers. Principles, Techniques and Tools.

It starts out with referring to the Dragon Book (well, actually the first edition of the Red Dragon Book, as there are three) describing the compilers as having front-ends consisting of a Lexer, Parser and Type Checker and back-ends consisting of Code Generator and Emitter. A full compilation is going through all five stages and there is an increasing cost using these traditional stages when going from syntax highlighting via collapsible regions to red squiggles and code completion will need to go further along those stages taking an increasing time – like seconds or even longer – whereas the user experience requires responses in ~ 100 milliseconds where his code might not even compile in the first place.

Then Anders goes on describing Roslyn, TypeScript and Compiler API JSON interfaces to them so you can run them as a service and keep compiler state, rebuilding just enough of the state on source code changes. He goes on talking about how Visual Studio, Visual Studio Code, Command-Line Compiler, Sublime Text and other tools (can) use these APIs to interact with the compiler so it keeps state of slowly evolving code of which the tools than can emit what they need.

Anders explains this much better and much more visually than I do: so it’s a highly recommended video.

Read the rest of this entry »

Posted in .NET, C#, Delphi, Development, Software Development | 2 Comments »

Delphi Corner Weblog: New: Velthuis.AutoConsole unit – helps against the “optimised” Embarcadero FastMM fork.

Posted by jpluimers on 2017/05/17

Brilliant:

if it is a console program and it was started any other way (from the Windows Explorer, from the Delphi IDE with or without debugger, from another non-console program), then, before the console window can close, it will display:

Press any key...

Source: Delphi Corner Weblog: New: Velthuis.AutoConsole unit [WayBack]

via:

–jeroen

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, FastMM, Software Development | Leave a Comment »

If you were using Managed / IManaged in Spring4D, be aware they got renamed to Shared / IShared

Posted by jpluimers on 2017/05/17

Sometimes changes are breaking. In this case it’s a Spring4D change: https://bitbucket.org/sglienke/spring4d/commits/a7c9bc92f30f7b5ec71b4905c1f0d97339b3c807

It renames Managed / IManaged to Shared / IShared and introduces compatibility with weak references.

Together they are the Spring4D manifestation of smart pointers about which I wrote a few times before:

–jeroen

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

Bitbucket – when you suddenly cannot login with git username/password from git any more

Posted by jpluimers on 2017/05/16

When logging in using the Web UI with a username

When logging in using the Web UI with a username

As of a few days, I was getting this error in my SourceTree output when pushing to git :

remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.

I think this is at least related to a change Bitbucket made 2 years ago for their site logon:

You can no longer log in with a username. Use your Atlassian account email address instead.

Source: Bitbucket

Pushing to bitbucket with cached credentials from SourceTree has worked for months. One thing that was different now (and should have given me a clue) the broken [WayBack] broken Git Credentials Manager popup showed but should not have.

When you get this credential manager you have to escape it as otherwise you will get an “Empty password” error.

Broken Git Credential Manager for Windows

Broken Git Credential Manager for Windows

Initially I blamed the error on the SourceTree 2.x upgrade I did last week. Unlike previous upgrades, this one had kept the old version (in my case 1.9.13.7) around and after a few clicks (skipping the “go to download page” prompt forever) and closing SourceTree 2.0, I fas able to start SourceTree 1.9 again.

SourceTree 1.9 had the same problem which meant it was either git itself, or the Bitbucket back-end.

To prove it was the Bitbucket back-end, I did everything An example of this is in the output below.

Solving the problem

What helped were these steps:

  1. Change the git repository from https://jeroenp@bitbucket.org/jeroenp/fastmm.git to
    https://bitbucket.org/jeroenp/fastmm.git
  2. Change the “username” field for the bitbucket repository to be my email address.
  3. Remove any bitbucket cached credentials from SourceTree.
  4. Restart SourceTree.
  5. Performing a push
  6. Cancel the Git Credential Manager popup
  7. Use my primary bitbucket email address for logon

Now SourceTree happily cached my credentials.

I’ve used this to scan the git config files for ones starting with a username:

grep -inSwl jeroenp@bitbucket config

Notes:

From the console

Reproduction of the issue:

C:\Users\jeroenp\Versioned\FastMM>git --version
git version 2.12.2.windows.1

C:\Users\jeroenp\Versioned\FastMM>git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream bitbucket develop:develop
Pushing to https://jeroenp@bitbucket.org/jeroenp/fastmm.git
Logon failed, use ctrl+c to cancel basic credential prompt.
Password for 'https://jeroenp@bitbucket.org/':
remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.
fatal: Authentication failed for 'https://jeroenp@bitbucket.org/jeroenp/fastmm.git/'

This has worked for months (after [WayBack] canceling the Git Credentials Manager popup as that has been broken for a very long time and gives you a remote: Empty password).

What helped was this:

C:\Users\jeroenp\Versioned\FastMM>git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream bitbucket develop:develop
Pushing to https://bitbucket.org/jeroenp/fastmm.git
Logon failed, use ctrl+c to cancel basic credential prompt.
Username for 'https://bitbucket.org/': jeroen...@....com
Password for 'https://jeroen...@....comcom@bitbucket.org/':
Total 0 (delta 0), reused 0 (delta 0)
POST git-receive-pack (196 bytes)
remote:
remote: Create pull request for develop:
remote:   https://bitbucket.org/jeroenp/fastmm/pull-requests/new?source=develop&t=1
remote:
To https://bitbucket.org/jeroenp/fastmm.git
   xxxxxxxx..xxxxxxxx  develop -> develop
updating local tracking ref 'refs/remotes/bitbucket/develop'
Branch develop set up to track remote branch develop from bitbucket.

–jeroen

 

 

Posted in BitBucket, Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

On the design of the Delphi TStream classes – why aren’t they decomposed better?

Posted by jpluimers on 2017/05/16

Ever since I started using Delphi more than 2 decades ago, I wondered about the design of the TStream classes, especially as “stream16.zip” by Duncan Murdoch from the DOS Turbo Pascal era (which I copied in the below gist) showed how to perform composition using streams.

Even though by now there is TStreamReader/TStreamWriter allowing some level of composition, it always bugged me that large parts of the resource handling and component (de)serialisation is in it (centred around ReadComponentRes/WriteComponentRes in stead of fully being in TFiler/TReader/TWriter or even further decomposed), that you cannot interrogate capabilities (like supporting seeking, length, directionality and such) and that a lot of overloads (for instance Read/ReadBuffer/ReadBufferData/Write/WriteBuffer/WriteBufferData) are still based on signed or 32-bit types (though it has improved back in the early days they were even signed 16-bit types).

I’m not the only one who wonders about this: Faster FileStream with TBufferedFileStream • DelphiABall mentioned a new Berlin piece the TStream hierarchy and – being in the field a lot longer – Stefan Glienke rightly asked why the buffering isn’t done with the decorator pattern like JclStreams does, and Asbjørn Heid chimed in with a very dense version of more gripes.

Even TZCompressionStream/TZDecompressionStream (though relatively new) aren’t doing composition really well (by not abstracting the compression/decompression from the write-only/read-only behaviour).

Now that all key players from the early TStream design day and age have left the core Delphi R&D team, maybe one of them can step in and explain why.

–jeroen

via: [WayBack] I was wondering if the TBufferedFileStream (see https://delphiaball.co.uk/2016/04/29/faster-filestream-tbufferedfilestream/) would not have been implemented using the decorator pattern… – Stefan Glienke – Google+ -> https://github.com/project-jedi/jcl/blob/master/jcl/source/common/JclStreams.pas#L207

TJclBufferedStream = class(TJclStreamDecorator)

Read the rest of this entry »

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

northfield_systems/noip2.c at master · sweetonmac/northfield_systems

Posted by jpluimers on 2017/05/15

Never noticed there were sources available for the official Linux no-ip client, but there are: northfield_systems/noip2.c at master · sweetonmac/northfield_systems

Looks similar to what these do: Dynamic DNS through NO-IP: keeping your hosts current, and your NO-IP account happy. « The Wiert Corner – irregular stream of stuff

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

PatchCleaner just cleaned 10-20 gigabyte per Windows 7-8.x installation

Posted by jpluimers on 2017/05/15

PatchCleaner just cleaned out 10-20 gigabyte per VM for most of my Windows 7-8.x VMs. After that, the updates still worked fine.

So it indeed does:

Safely remove all orphaned patch and installer files from your windows installer directory in one easy click

–jeroen

Download: https://sourceforge.net/projects/patchcleaner/

Posted in Power User, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9 | Leave a Comment »

How to Download YouTube 4K Videos with Youtube-dl Script

Posted by jpluimers on 2017/05/12

Interesting Python script: https://yt-dl.org/downloads/latest/youtube-dl [WayBack]

Source: How to Download YouTube 4K Videos with Youtube-dl Script [WayBack]

via:

 

 

Posted in SocialMedia, YouTube | Leave a Comment »

Magnetic Bottle Opener | Best Funny Gifs Updated Daily

Posted by jpluimers on 2017/05/12

Still one of the nicest bottle openers I’ve seen: Magnetic Bottle Opener | Best Funny Gifs Updated Daily

–jeroen

Via:Very useful fridge magnet

Posted in LifeHacker, Power User | Leave a Comment »

$59 HDFury Universal PSU Doctor Supports Power Monitoring via iOS or Android

Posted by jpluimers on 2017/05/11

Interesting device [WayBack]: $59 HDFury Universal PSU Doctor Supports Power Monitoring via iOS or Android which has a lot more details.

Via: [WayBack] +HDfury has launched a 3-port USB charger/power supply with power monitoring function. – Jean-Luc Aufranc – Google+

–jeroen

Posted in Android Devices, Apple, Development, Hardware Development, Hardware Interfacing, iOS, Power User, USB | Leave a Comment »