Archive for the ‘Conferences’ Category
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/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:
Read the rest of this entry »
Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 14 Comments »
Posted by jpluimers on 2017/10/31
A few tricks to write long strings to files when the Delphi debugger cuts them off (just because they like using 4k buffers internally);
TStringStream.Create(lRequestMessage).SaveToFile('c:\temp\temp.txt')
TIniFile.Create('c:\a.txt').WriteString('a','a',BigStringVar)
TFileStream.Create('c:\a.txt', fmCreate or fmShareDenyNone).WriteBuffer(Pointer(TEncoding.UTF8.GetBytes(BigStringVar))^,Length(TEncoding.UTF8.GetBytes(BigStringVar)))
They all work form the debug inspector, but they do leak memory. See comments below.
Via:
–jeroen
Read the rest of this entry »
Posted in About, Conference Topics, Conferences, Delphi, Development, Encoding, Event, Software Development | 6 Comments »
Posted by jpluimers on 2017/10/24
I barely made it to EKON21 mainly because of extensive family members care-taking, so could not attend everything and archived the site for
The Conference for Delphi & More | 23 – 25 October 2017, Cologne | presented by Entwickler Akademie and Entwickler Magazin
[WayBack] EKON 21 – The Conference for Delphi & More:
It seems one older conference is archived.
–jeroen
Posted in Conferences, Delphi, Development, EKON, Event, Software Development | Leave a Comment »
Posted by jpluimers on 2017/09/25
At the end of April 2014, Roman Yankovsky started a nice [Wayback] discussion on Google+ trying to get upvotes for [Wayback] QualityCentral Report #: 124402: Compiler bug when comparing chars.
His report basically comes down to that when using Ansi character literals like #255, the compiler treats them as single-byte encoded characters in the current code page of your Windows context, translates them to Unicode, then processes them.
The QC report has been dismissed as “Test Case Error” (within 15 minutes of stating “need more info”) by one of the compiler engineers, directing to the [Wayback] UsingCharacterLiterals section of Delphi in a Unicode World Part III: Unicodifying Your Code where – heaven forbid – they suggest to replace #128 with the Euro-Sign literal.
I disagree, as the issue happens without any hint or warning whatsoever, and causes code that compiles fine in Delphi <= 2007 to fail in subtle ways on Delphi >= 2009.
The compiler should issue a hint or warning when you potentially can screw up. It doesn’t. Not here.
Quite a few knowledgeable Delphi people got involved in the discussion:
Read the rest of this entry »
Posted in Ansi, ASCII, Conference Topics, Conferences, CP437/OEM 437/PC-8, Delphi, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, Encoding, Event, ISO-8859, Missed Schedule, QC, SocialMedia, Software Development, Unicode, UTF-8, Windows-1252, WordPress | Leave a Comment »
Posted by jpluimers on 2017/09/14
Some inspiration for writing a proper bookmarklet that finds or saves a WayBack machine page:
On the last link, I was hoping that the https://web.archive.org/liveweb/https://www.example.org would work but it doesn’t work for many URLs and I’m not sure yet why that is.
It has a nice tip that works though:
Read the rest of this entry »
Posted in Bookmarklet, Conference Topics, Conferences, Development, Event, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers | Leave a Comment »
Posted by jpluimers on 2017/09/11
I was debugging an issue where a Delphi SOAP implementation was shoe-horned into an Indy server and came across the [WayBack] TWebRequest.UpdateMethodType Method.
The further you get down the if/then/else tree, the more often the indexed property Method is accessed, same for the conversion/comparison code.
property Method: string index 0 read GetStringVariable;
So if the HTTP method is POST (very common), then the calls are being made 3 times:
procedure TWebRequest.UpdateMethodType;
begin
{$IFDEF NEXTGEN}
if Method = 'GET' then { do not localize }
FMethodType := mtGet
else if Method = 'PUT' then { do not localize }
FMethodType := mtPut
else if Method = 'POST' then { do not localize }
FMethodType := mtPost
else if Method = 'HEAD' then { do not localize }
FMethodType := mtHead
else if Method = 'DELETE' then { do not localize }
FMethodType := mtDelete
else if Method = 'PATCH' then { do not localize }
FMethodType := mtPatch;
{$ELSE !NEXTGEN}
if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'GET') = 0 then { do not localize }
FMethodType := mtGet
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'PUT') = 0 then { do not localize }
FMethodType := mtPut
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'POST') = 0 then { do not localize }
FMethodType := mtPost
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'HEAD') = 0 then { do not localize }
FMethodType := mtHead
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'DELETE') = 0 then { do not localize }
FMethodType := mtDelete
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'PATCH') = 0 then { do not localize }
FMethodType := mtPatch;
{$ENDIF NEXTGEN}
end;
–jeroen
Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 4 Comments »
Posted by jpluimers on 2017/04/20
You think you know Unicode? Think again, then read [Wayback] Dark corners of Unicode / fuzzy notepad.
On basics, sorting, comparison, decomposition, composition, width, whitespace, encoding, emoji, interesting code planes and dark corners. Lots of dark corners.
The examples are in Python, but hold for almost any programming language
–jeroen
via: Kristian Köhntopp
Posted in Conference Topics, Conferences, Development, Encoding, Event, Software Development, Unicode | Leave a Comment »
Posted by jpluimers on 2017/04/18
One of the reasons I favour using RTL based functionality over Delphi Intrinsic Routines like Length, Abs and others is that you cannot use compiler intrinsics in Generics. For instance Length is not compatible with TFunc<string, Integer> unless you declare it yourself like function StringLength(value: string): Integer; as otherwise you get en E2029 error (in this case the cryptic '(' expected but ';' found).
It’s one of the many areas where the Delphi compiler developers took a shortcut, but in this case I think the results are somewhat good.
Other reasons for using the RTL over compiler intrinsics have to do with scoping: the intrinsics are in the global scope which can clutter what you’re trying to work on.
So I much rather use the file and stream related functions when I’m actually working with a file or stream. For instance Assign for me has nothing to do with a file outside of a file context (it’s the reason AssignFile exists in the first place).
–jeroen
via: I cant use “Length” as a TFunc (tested in XE and XE6), but if…
Posted in Conference Topics, Conferences, Delphi, Delphi 10 Seattle, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Event, Software Development | 1 Comment »