Leaderboard
Popular Content
Showing content with the highest reputation on 08/11/21 in all areas
-
Website: github.com/viniciusfbb/skia4delphi Skia4Delphi is a cross-platform 2D graphics API for Delphi based on Google's Skia Graphics Library (skia.org). Google's Skia Graphics Library serves as the graphics engine for Google Chrome and Chrome OS, Android, Flutter, Xamarin, Mozilla Firefox and Firefox OS, and many other products. Skia provides a more robust Canvas, being very fast and very stable, with hundreds of features for drawing 2D graphics, in addition to a text shaping engine designed to render texts in the most diverse languages with right-to-left support (such as the Persian language), full support for loading SVG files, support for creating PDF files, support for rendering Lottie files (verotized animations created in Adobe After Effects), integration with the GPU, among countless other cool features. Skia's idea is similar to Firemonkey's, the same codebase used in an OS will work the same on other platforms. It is also possible to design using the CPU in independent background threads. Skia also has native codecs, of course if you don't use the SKCodec class, when loading an encoded image it will give priority to using the platform's native codec, but it is possible to use its codec, for example for jpeg files it uses libjpeg-turbo and for png files libpng which maybe in certain environments may perform better than native. See some examples: Advanced shapes Advanced text rendering / shaping Svg Lottie files And much more...
-
upcoming language enhancements?
Stefan Glienke replied to David Schwartz's topic in RTL and Delphi Object Pascal
We know they never do that but rather hope they be ready when they ship which also as we know it not the case either. -
upcoming language enhancements?
Remy Lebeau replied to David Schwartz's topic in RTL and Delphi Object Pascal
Please, please, please, with sugar and cherries on top!! I remember way back in the day when Borland actually did release things "when they are ready". I miss those days. -
Delphi Daily WTF / Antipattern / Stupid code thread
Tommi Prami replied to Tommi Prami's topic in RTL and Delphi Object Pascal
with MainForm, ButtonCancel do ... with MainForm do with ButtonCancel do ... Nested with clauses are pure evil to refactor out. If it is complex code and there are common properties (Like Caption in VCL on above) how to decode which is which. Made feature request of this one way way back. Hope they make refactorer that would cast the first stone, so can manually refactor rest. : https://quality.embarcadero.com/browse/RSP-18953 -
upcoming language enhancements?
David Heffernan replied to David Schwartz's topic in RTL and Delphi Object Pascal
If they released when it was ready, and spent time fixing the broken windows immediately, then they would be able to develop more efficiently. By letting the defects endure, they just store up problems for the future. Technical debt. I don't find a comparison of modern vs historical delphi very instructive. Should be modern delphi vs its peers. -
Delphi Daily WTF / Antipattern / Stupid code thread
dummzeuch replied to Tommi Prami's topic in RTL and Delphi Object Pascal
We could probably improve this with a try ... finally and exceptions. 😉 (I actually have some code that does this because a coworker complained loudly about the gotos I was originally using.) Let's create a new thread with worse "improvements" ("Verschlimmbesserung") for this code. -
Delphi Daily WTF / Antipattern / Stupid code thread
Uwe Raabe replied to Tommi Prami's topic in RTL and Delphi Object Pascal
Ehm! That Exit call will only exit procedure gotoTrue, but not function BlankControl. Funny, that such a suggested improvement perfectly qualifies for the reason of this thread -
Delphi Daily WTF / Antipattern / Stupid code thread
dummzeuch replied to Tommi Prami's topic in RTL and Delphi Object Pascal
+1 for goto! 😉 -
Delphi Daily WTF / Antipattern / Stupid code thread
Stefan Glienke replied to Tommi Prami's topic in RTL and Delphi Object Pascal
Certainly but that would change the behavior - currently if the class is found it exits, regardless. With a giant if and/or statement it would continue to evaluate the is checks. -
I very often have the case that I need to parse records in files and data streams where some integer field identifies the type of content that follows. Some of them were generated by software of my own, some by others. So for that, it is eminently useful: Instead of declaring tons of constants with prefixes to clarify the context they apply to, one just declares an enum which locks the constants into a common namespace. For example, look at what Borland did a long time ago in units System.pas and Variants.pas. It's full of prefixed constants like VarEmpty, VarNull, VarInteger .... where a single enum type tVariantType= (Empty=0, Null=1, ...) would have been much prettier. This example comes to mind because I need to decode and encode variants quite often.
-
Delphi Daily WTF / Antipattern / Stupid code thread
Stefan Glienke replied to Tommi Prami's topic in RTL and Delphi Object Pascal
Apart from the names of the labels its actually not that terrible tbh - certainly better than repeating the same code over and over in every check. -
The result of a simple demo in delphi: ezgif.com-gif-maker.mp4
-
No StringHelper for saving to file?
PeterPanettone replied to PeterPanettone's topic in RTL and Delphi Object Pascal
Maybe: MyString.ToBitCoin? That would make Delphi developers RICH! -
No StringHelper for saving to file?
Der schöne Günther replied to PeterPanettone's topic in RTL and Delphi Object Pascal
Saving to file has nothing to do with the string itself. What's next, myString.SendOverNetworkByUDP(..)? You have TFile.WriteAllText(filePath, fileContent) from System.IoUtils, that should be enough for everybody 😉 -
On Android, problems in deployment can cause the app to fail to start, however you have indicated it is also a problem on iOS, so it is more likely to be a problem with the initialization of one of the units included. Can you create a blank app that runs OK? If so, use that, and start adding your original to the project until it breaks - then you have a reproducible example.
-
Delphi Daily WTF / Antipattern / Stupid code thread
corneliusdavid replied to Tommi Prami's topic in RTL and Delphi Object Pascal
I recently inherited an old project that had many bad code examples that looked like whenever anyone made a change to the code, they just left it like they found it instead of refactoring. There were empty IF-blocks, while-true loops, exit statements one line before the end of a procedure, and one of my favorites: for j := 0 to 0 do begin Temp := StartTop[j] + CompRow; CreateLabel(CNameL[j], LeftSide - 4, Temp, 150); ... All of these were in that ONE project. But the worst code in that I found in that project was a bunch of GOTOs: function BlankControl(EditControl: TObject; const EditMess: string; ShowErrorMsg: Boolean; MaxLen: Integer): Boolean; label 900, 1000; begin if EditControl is TCustomEdit then if length(trim((EditControl as TCustomEdit).Text)) < MaxLen then goto 1000 else goto 900; if EditControl is TComboBox then if length(trim((EditControl as TComboBox).Text)) < MaxLen then goto 1000 else goto 900; if EditControl is TDBComboBox then if length(trim((EditControl as TDBComboBox).Text)) < MaxLen then goto 1000 else goto 900; if EditControl is TDBRadioGroup then if ((EditControl as TDBRadioGroup).Value = '') then goto 1000 else goto 900; if EditControl is TDBLookupComboBox then if ((EditControl as TDBLookupComboBox).Text = '') then goto 1000 else goto 900; if EditControl is TDBCheckBox then if ((EditControl as TDBCheckBox).State = cbGrayed) then goto 1000 else goto 900; 900: Result := false; exit; 1000: Result := true; Showerror(EditControl, EditMess, false, ShowErrorMsg); end;