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 2,099 other followers

Archive for July 23rd, 2020

Syncing GExperts svn to git

Posted by jpluimers on 2020/07/23

A while ago, I made a synced git repository and put it on [WayBack] GitHub – jpluimers/GExperts: Synced every now and then from git svn clone https://svn.code.sf.net/p/gexperts/code/trunk GExperts.

I forgot to save my initial notes, but they were based on what I did before with [WayBack] jeroenp / fastmm — Bitbucket**, so I resurrected my notes, after a chat with Graeme Geldenhuys on how he did a similar thing for Indy at

[WayBack] GitHub – graemeg/indy: Indy (Internet Direct) framework. This is an unofficial mirror repository which gets synced every 15 minutes. It contains the full history from the official Indy 10 SVN repository.

So here are my notes, as on GitHub they look odd:

[WayBack] GitHub – jpluimers/GExperts

Synced every now and then from git svn clone https://svn.code.sf.net/p/gexperts/code/trunk;

Syncing steps:

first time

git svn clone https://svn.code.sf.net/p/gexperts/code/trunk GExperts.git-svn
git remote add origin https://github.com/jpluimers/GExperts.git
git push origin master

each additional time from inside the GExperts.git-svn directory:

git svn fetch
git svn rebase
git push origin

It is very similar to what Graeme does for Indy in a cron job for each subsequent sync from https://svn.atozed.com:444/!/#Indy10/view/head/trunk/Lib to https://github.com/graemeg/indy:

#!/bin/sh
# Fetches latest revisions for Indy SubVersion repository
# and then pushes changes to GitHub.
# Created by Graeme Geldenhuys 

GIT="/usr/bin/git"

cd /data/git/indy.git/
$GIT checkout master
$GIT svn rebase
$GIT gc --auto
$GIT push github

And to my FastMM notes:

Getting the latest SVN changes:

git svn rebase

Initial repository creation and add to bitbucket (or github)

git svn clone http://svn.code.sf.net/p/fastmm/code/ FastMM.git

Notes (see [WayBack] Effectively Using Git With Subversion | Viget and [WayBack] Practical tips for using Git with large Subversion repositories for explanation):

  1. Do not include the -s option after git svn clone, as this SVN repository does not have the default trunk/branches/tags structure.
  2. There are no [WayBackSVN ignore entries in this repository, so this is not needed for git svn show-ignore > .gitignore

Add the repository to Bitbucket or GitHub:

Add either of these URLs to  [WayBack] Feedly for monitoring:

Some additional tidbits:

–jeroen

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

Squirrel · GitHub: Server-driven updates for native apps

Posted by jpluimers on 2020/07/23

Reminder to self as I might need it one day:

Server-driven updates for native apps (Windows/Mac/iOS)

[WayBack]Squirrel · GitHub

Via: [WayBackHow do you deploy and update desktop applications? Carl and Richard talk to Paul Betts about the open source project called Squirrel – https://github.c… – .NET Rocks! – Google+

–jeroen

Posted in Deployment, Development, DevOps, Software Development | Leave a Comment »

Yes Delphi does some type inference on generic method calls

Posted by jpluimers on 2020/07/23

Delphi does indeed so some type inference as Primoz found out below. It has been doing this for a long time, improved over time, but has a long road ahead.

One odd thing is that generics (and the majority of inference support) were introduced in Delphi 2009 ([WayBack] Generics with Delphi 2009 Win32), but the inference was already documented in Delphi 2007: [WayBack] Delphi 2007 – Declaring Generics: Parameterized Types

This is a reminder to myself to write some more example code on what kinds of inference work and which do not, especially because of the comments from David Heffernan, Marco Cantu and Stefan Glienke, especially since the improvement over time has been small. I am curious to see how the promised “working on it” by now lives up to reality.

David Heffernan
This is a rare piece of code where type inference actually works. Mostly it does not which is very frustrating.

It’s a little ironic that you ask why you don’t need to include <T>. Normally people ask about the much more frequent instances where you do need to include <T> because the compiler’s type inference is so weak.

David Heffernan
+Marco Cantù Much more commonly there are times when you want the compiler to infer the type, but it won’t. It would really make a difference to us if the compiler was better at this.

Marco Cantù
+David Heffernan I tend to agree the compiler should be much better at type inference. Working on it!

Stefan Glienke
Infering the generic argument from a constructed generic type would be great.

GuessTheType<T>(const x: TArray<T>);

var
  a: TArray<Integer>;
begin
  GuessTheType(a);

does not work although the compiler could infer the parameter for GuessTheType from its x parameter but currently it does not know that a originally was a TArray<T> (yes, I know array of T as signature works but that is a different thing).

P.S. +Marco Cantù btw how hard can it be to finally implement generic standalone routines without that ugly static type? Probably one of the highest voted feature requests: https://quality.embarcadero.com/browse/RSP-13724)

Source: [WayBack] Anybody here knows since when we don’t have to write when calling generic ProcSomething(param: T)? It was brought to my attention today that the… – Primož Gabrijelčič – Google+

–jeroen

A quick look into the generated assembler code proves that the type is indeed resolved correctly:

Project17.dpr.26: TGeneric.GuessTheType<Exception>(x);
0041C530 8B151C484200     mov edx,[$0042481c]
0041C536 A1F4974100       mov eax,[$004197f4]
0041C53B E84CD3FFFF       call TGeneric.GuessTheType<System.SysUtils.Exception>
Project17.dpr.27: TGeneric.GuessTheType(x);
0041C540 8B151C484200     mov edx,[$0042481c]
0041C546 A1F4974100       mov eax,[$004197f4]
0041C54B E83CD3FFFF       call TGeneric.GuessTheType<System.SysUtils.Exception>
Project17.dpr.28: TGeneric.GuessTheType(s);
0041C550 8B1520484200     mov edx,[$00424820]
0041C556 A1F4974100       mov eax,[$004197f4]
0041C55B E83CD3FFFF       call TGeneric.GuessTheType<System.SysUtils.TSimpleRWSync>

Source: https://plus.google.com/+Primo%C5%BEGabrijel%C4%8Di%C4%8D/posts/edE3YWtwY3B

view raw
readme.md
hosted with ❤ by GitHub

program Project17;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils;
type
TGeneric = class
class procedure GuessTheType<T>(const value: T);
end;
var
x: Exception;
s: TSimpleRWSync;
{ TGeneric<T> }
class procedure TGeneric.GuessTheType<T>(const value: T);
begin
end;
begin
TGeneric.GuessTheType<Exception>(x);
TGeneric.GuessTheType(x);
TGeneric.GuessTheType(s);
end.

view raw
project17.dpr
hosted with ❤ by GitHub

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

 
%d bloggers like this: