[WayBack] Dear diary, today I learned that it is better to use ifndef rather than ifdef if I want the IDE to keep working properly. I had a uses clause with an i… – Stefan Glienke – Google+
I promised to remind myself, so here it is (:
–jeroen
Posted by jpluimers on 2017/12/28
[WayBack] Dear diary, today I learned that it is better to use ifndef rather than ifdef if I want the IDE to keep working properly. I had a uses clause with an i… – Stefan Glienke – Google+
I promised to remind myself, so here it is (:
–jeroen
Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | Leave a Comment »
Posted by jpluimers on 2017/12/27
A long while ago I quoted [WayBack] Ideara / Embaracdero is flushing away user trust in their ability to do secure computing… – Jeroen Wiert Pluimers – Google+.
Since then they have fixed some of the issues:
Still, parts of their infrastructure run over http or use other insecure patterns.
Infrastructure and DevOps are hard, but an integral aspect of any company.
Hopefully, their most important new-years resolution is to improve on that.
I don’t hold my breath as [Archive.is] https://appanalytics.embarcadero.com/ for more than a month now has been showing
503 Service Unavailable
No server is available to handle this request.
On the other hand: they have improved, so let’s keep our fingers crossed, and it had been running since 2015: [WayBack]Embarcadero Introduces AppAnalytics, the First Usage Analytics Service for Desktop, Mobile, and Wearable Applications
There are three ways to disable AppAnalytics in the Delphi IDE to phone home (this is for Delphi XE8, change the version numbers accordingly):
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\16.0\UsageAnalytics" /v Enabled /t REG_DWORD /d 0 /fdel "C:\Program Files (x86)\Embarcadero\Studio\16.0\bin\TrackingSystem220.bpl"$(BDS)\Bin\TrackingSystem220.bpl(normally having value Embarcadero Tracking System Package) as described in Delphi packages I have disabled by prefixing their description with an underscore (and why)That should at least get rid of the 30 second shut-down timeout in some Delphi versions while they try to post the usage data to AppAnalytics (thanks Uwe Raabe for this great tip!)
–jeroen
Related:
Posted in Delphi, Development, Power User, Security, Software Development | 5 Comments »
Posted by jpluimers on 2017/12/27
It’s too bad that you need workarounds to get ByteStrings working on mobile devices as there are APIs there (like shaders) that work best with them.
There was a nice discussion on this last year at [WayBack] I miss AnsiString on Mobile…not only for Internet but for Shaders also.// FMX.Context.GLES.pasconstGLESHeaderHigh: array [0..24] of byte =(Byte(‘p), … – Paul TOTH – Google+ based in this code example in the FMX library undocumented unit FMX.Context.GLES:
// FMX.Context.GLES.pas
const
GLESHeaderHigh: array [0..24] of byte =
(Byte('p'), Byte('r'), Byte('e'), Byte('c'), Byte('i'), Byte('s'), Byte('i'), Byte('o'), Byte('n'), Byte(' '),
Byte('h'), Byte('i'), Byte('g'), Byte('h'), Byte('p'), Byte(' '), Byte(' '), Byte(' '), Byte('f'), Byte('l'),
Byte('o'), Byte('a'), Byte('t'), Byte(';'), Byte(#13));
There are more than 500 places in the Delphi library sources that uses this construct and even more that do other fiddling (like [WayBack] TEncoding.GetBytes) to get from strings to bytes.
I wonder if by now we still need the workarounds that Andreas Hausladen provides:
–jeroen
Posted in Conference Topics, Conferences, Delphi, Development, Encoding, Event, Software Development | 6 Comments »
Posted by jpluimers on 2017/12/27
From my SO Question Archive:
Just curious: Why is the syntax for try catch in C# (Java also?) hard coded for multiple statements? Why doesn’t the language allow:
int i; string s = DateTime.Now.Seconds % 2 == 1 ? "1" : "not 1"; try i = int.Parse(s); catch i = 0;The example is for trivial purposes only. I know there’s
int.TryParse.
[WayBack] c# – Why does Try-Catch require curly braces – Stack Overflow.
I asked this question partially because of my Delphi background where there are two try statements (one for finally and one for except a.k.a. catch) neither having the braces problem as try/finally/except all are block boundaries.
The most interesting bit was the [WayBack] answer by [WayBack] Eric Lippert (ex C# compiler team, now at Facebook after an intermediate position at Coverty) referring to his [WayBack] Why are braces required in try-catch-finally? | Fabulous adventures in coding blog entry.
The answer and blog entry come down to preventing ambiguity.
His answer reveals that a compound try/catch/finally statement is converted by two try statements like this:
try
{
try
{
XYZ();
}
catch(whatever)
{
DEF();
}
}
finally
{
ABC();
}
This emphasises that catch and finally are conceptually indeed two different things which statistics show.
I need to dig up the numbers (I remember researching this for Java and Delphi code a very long time ago – think Delphi 7 era – and C# code a long time ago – think C# 2 era), but this comment should still hold:
My observation in most code I’ve seen is that the combination of
catchandfinallyis hardly (i.e. far less than 1%) used in the same statement (or in other languages in nested statements), because they serve two very different purposes. That’s why I prefer not to mix them, and if I do, use the nested construction to both emphasize the difference in purpose, and execution order. Learning new things every day: How often is youroccasionallypercentage wise? – Jeroen Wiert Pluimers Dec 23 ’12 at 19:34
–jeroen
Posted in C#, Delphi, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2017/12/26
Ever introduced an extra parameter on a method, tracked all its usages and made the compiler happy by providing a corresponding extra argument in all the calls of that method? Sure you have…
Things like that need a reminder: the joy of reflection and lambdas…
Very good train of thought (and solving!) at [WayBack] Head scratching with a TargetParameterCountException | Software on a String
By [WayBack] Marjan Venema – Google+
–jeroen
Posted in .NET, C#, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2017/12/25
Merry Christmas:
Joe C. Hecht of Code4Sale, LLC is very proud to announce that the ÜberPDF™ SDK version 1.0 is now complete, is ready for public distribution, and will be made available for download in the next few days.
More details at [WayBack] The ÜberPDF™ SDK is DONE! – COMPLETE BUILD SYSTEM – 100% OPEN SOURCE – ALL PLATFORMS – ALL DEVELOPMENT TOOLS… – Joe C. Hecht – Google+
Posted in C, Delphi, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2017/12/21
Since I’m pressed for time, but didn’t want to wait until putting the dumps on-line, below is a rendering of my gist QCScaper ClientDataSet XML dump results – README.md.
Wishing everybody a great holiday season!
This gist contains two QCScaper XML dumps of the http://qc.embarcadero.com content taken a few days after it came up.
There are four files: two files per dump (both in plain downloaded format as well as formatted with
tidy -xml -utf8for easier comparison, for instance with Beyond Compare).Each file is compressed uzing 7-zip as the original files would each exceed the 100 megabyte gist size limit; please see https://developer.github.com/v3/gists/#truncation
- (tidy)
QCScraper.Anonymous.cds.xml.7zhas the data that you get when you are not logged on atqc.embarcadero.com- (tidy)
QCScraper.Regular.cds.xml.7zwas generated using a fresh new EDN accountThere are slight differences because of the internal QC architecture, which you can for instance see in issue #7788
- http://qc.embarcadero.com/wc/qcmain.aspx?d=7788
- https://web.archive.org/web/20171221120117/http://qc.embarcadero.com/wc/qcmain.aspx?d=7788
- https://archive.is/CEx5m
Hopefully I will find some time later to blog about this in a better way.
Related links:
- http://www.uweraabe.de/Blog/2017/06/09/how-to-save-qualitycentral/ (describes QCScraper)
- http://www.uweraabe.de/Blog/downloads/download-info/qcscraper-zip/ (QCScraper source code)
- http://www.uweraabe.de/Blog/downloads/download-info/qcscraper-compiled-exe/ (QCScraper executable)
- https://plus.google.com/+JeroenPluimers/posts/cdn4JGLp8P3 (asking for help in https://plus.google.com/communities/103113685381486591754)
- https://plus.google.com/+JeroenPluimers/posts/bKigepTHdcE (asking for help on https://wiert.me/2017/12/20/qualitycentral-report-95543-an-overloaded-routine-cannot-be-assigned-to-the-method-reference/)
- https://plus.google.com/+JeroenPluimers/posts/jbh7WBPs8MQ (QC issues I forgot to archive which I will do shortly)
- https://plus.google.com/+DalijaPrasnikar/posts/Z5nJ2A6Sy1X (QC being down earlier)
- https://wiert.me/2017/06/05/embarcadero-qualitycentral-is-dead-man-decades-of-customer-work-down-the-drain/ (which now at least temporarily has been undone)
Entries I still need to look at:
- https://web.archive.org/web/*/http://qc.embarcadero.com/wc/qcmain.aspx?d=139278
- https://web.archive.org/web/*/http://qc.embarcadero.com/wc/qcmain.aspx?d=139126
- https://web.archive.org/web/*/https://forums.embarcadero.com/thread.jspa?threadID=23840
- https://web.archive.org/web/*/http://qc.embarcadero.com/wc/qcmain.aspx?d=118124
–jeroen
Related:
Posted in Delphi, Development, QC, Software Development | Leave a Comment »
Posted by jpluimers on 2017/12/21
About a year ago, Vincent Parret proposed many [WayBack] Delphi Language Enhancements that a lot of developers feel long overdue.
It sprouted a nice G+ discussion at [WayBack] Blogged – Delphi Language Enhancements – Vincent Parrett – Google+
Now this post is a reminder for myself to check out how Idera lived up to the promises they made in that thread.
Evaluation time…
I just found out that Vincent beat me a few days before I scheduled my post (I wrote my post about a year ago): [WayBack] Just over a year ago, I wrote a blog post where I listed some ideas for enhancing the Delphi language… – Vincent Parrett – Google+
Recommended reading.
Oh BTW: in that thread there was a cool way simulating interface helpers by hardcasting an interface to a record having only one field typed as the interface:
[WayBack] [Delphi] Interface helper proposal – Pastebin.com. By Stefan Glienke. Who else (:
In addition, Allen Bauer chimed in with some great insights.
Finally Document Insight author [WayBack] Baoquan Zuo – G+ posted with more suggestions:
I would suggest Embt consider introducing standard function
NameOfandinterface helper. These two features will fundamentally changes a lot of things with “minimum” cost.
His thread too has some really nice comments.
–jeroen
Posted in Delphi, Development, Software Development | 10 Comments »
Posted by jpluimers on 2017/12/21
I started this post as “A case against FreeAndNil” but soon found out about [WayBack/Archive.is] A case against FreeAndNil – Community Blogs – Embarcadero Community.
Recently I was refactoring a bunch of code that was classed based to become interface based.
The old code had a lot of references to classes like this:
FMyField: TMyClass;
The compiler had detected those as compiler errors so now they were like this:
FMyField: IMyInterface;
But the compiler would still happily compile code (for instance in destructors) containing:
FreeAndNil(FMyField);
The only way that FreeAndNil can be implemented is with an untyped var parameter:
Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 14 Comments »
Posted by jpluimers on 2017/12/20
Since I bumped into this while qc.embarcadero.com was down, and quality.embarcadero.com is not publicly indexed and requires an account to be able to manually search:
I’m not sure how long qc.embarcadero.com will be up again, so if people can help archiving these entries in the WayBack machine: please indicate how you can help.
Thanks a lot!
I bumped into [Archive.is] QualityCentral Report 110364: Open Interface methods are not assignable to anonymous method variable which is related to [WayBack/Archive.is] QualityCentral Report 95543: An overloaded routine cannot be assigned to the method reference.
The former is now tracked as RSP-13007, but I could not find back the latter (JIRA search keeps insisting it cannot find 95543).
The latter is the actual problem I was having: this is code that does not work:
{ Expected: the test case gets compiled.
Actual: E2010 is issued.
}
procedure foo; overload;
begin
writeln('FAIL')
end;
procedure foo(const c: char); overload;
begin
writeln('PASS')
end;
var f: procedure (const c: char);
type T = reference to procedure (const c: char);
var r: T;
begin
{$apptype console}
f := foo;
// correctly picks the proper version
f('1');
r := foo;
// E2010 Incompatible types: 'T' and 'Procedure'
r('2')
end.
–jeroen
Posted in Delphi, Development, QC, Software Development | 1 Comment »