TurboMagic
Members-
Content Count
242 -
Joined
-
Last visited
-
Days Won
9
Everything posted by TurboMagic
-
By the way: the whole thing is now available here: https://github.com/rmesch/Bitmaps2Video Android 64 bit support for the sample provided should be available soon, I need to commit it and create a pull request. Which I'll do in a minute.
-
Byte and Integer
TurboMagic replied to Skrim's topic in Algorithms, Data Structures and Class Design
I guess it's rather a missing overflow check in the server software for the vote counter 😉 But I guess this Jira software is not written in Delphi (oh, if it were overflow checking would be available and this issue would have been caught during testing...) Of course I voted for this as well. -
What should use: Stringlist, Advanced Record, Database or Tlist Class?
TurboMagic replied to Johansy's topic in Algorithms, Data Structures and Class Design
If your Delphi version is new enough to support generics: Create a TDictionary where the key is the number (ID) of the question and the data is the number of points of the answer selected. Store the ID of the question in the tag of the tab the question is on (assuming one tab holds one question, if not put each question in some container which has a tag, it doesn't matter if that container is visible or not). Store the number of points associated with an anwer to the question in the tag of the checkbox or radio button for the answer. If somebody selects an answer look in the list if there is already some entry with hat question ID. If yes, remove it and add it again with the new data or overwrite the data. When the questionaire is finished iterate through the dictionary and count the points. uses Generics.Collections; type // first one is the key = question ID, last one the data asociated with the key in your case the points. TAnswerDict = Dictionary<integer, integer>; var Answers:TAnswerDict; Pair: TPair; Points: Integer; begin Answers := TAnswerDict.Create; try Answers.Add(1,3); Answers.Add(2,1); Points := 0; for Pair in Answers do inc(Points, Pair.Value); finally Answers.Free; end; end. The code has not been tested but it should be a starting point for you, if still relevant. -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Ok, besides accepting Uwe's pull request I did some changes to the Peek method in order to make it more compatible with managed types. Feel free to look at it and critisise where necessary, I admit that I didn't test it yet (need to create unit tests) but it's getting late enough already. I can only learn from it. And if somebody wants to contribute: feel free. As far as I understood Stefan, one could get rid of the 2nd class implemented for managed types altogether by using IsManaged and calling the appropriate code to release the items where necessary. -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Ok, thanks for this hint. -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Yes, unit tests for managed types would still have to be created. And yes one would have to do some for strings and interfaces as well as tey're of course managed as well. I contributed this to the public because it will not help the community if one always consumes only without giving. That also means, if there's interest in this library others should contribute fixes etc. as well. My main open source commitment currently is DEC (Delphi Encryption Compendium) and that's enough work. -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Thanks! That could be fixed at the place where items get taken out of the list. I guess one would have to make a distinction of cases via IsManagedType(T) so one can keep using Move for non manages types and assignment operator for managed ones. Would that be correct? -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Ok, I think I see what you're after. In case of the peek one would have to use the assignment operator then (if the type is a managed one) in order to increase the reference counter. Am I right? But how to find out whether the type is managed? -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Why would those have to be cleared? One shoukdn't be able to read those out and I don't remember but if the buffer has to free any instances contained in it when the buffer is freed it will only free the instances still in the buffer. -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Since I didn't hear from him with a ull request or any other "delivery" yet I guess he got stuck translating the comments... -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Ok, I see the FAQ pages but in the wiki documentation for the various components the SSL ones are usually read = nonexisting links. My earlier question was what we can do to help generate the Wiki sceleton as automatically as possible. About the help you started to create: is this CHM based and is the "source" available for contribution somewhere? -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Uwe Raabe is already working on this 😉 But others than MVPs and the usual folks could contribiute as well... Often such easy things or even parts of those would help the community! -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Oh, another remark: If somebody would "donnate"! English translations for CircularBuffer I would submit the updated version to GetIt! -
Generic circular buffer library released
TurboMagic replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
I can understand the request to do so. I have already written in the project description that this would be a task one could/should do. As I'm busy enough with my other open source project (DEC - Delphi Encryption Compendium) I will accept such translations and update the code with them but won't invest the time in those at this time. As user Dummzeuch (a German by the way! ;-) ) stated: maybe somebody could contribute them. I guess there are enough Delphi developers out there who didn't contribute code etc. yet but only consumed so far what others contributed. That could be a start to give something back. As we're talking about contributing and my next topic is related to F. Piette: is there an easy way to write a Delphi source code parser (maybe using Delphi AST which I only know by name) to parse the source of ICS and generate output in the Wikipedia syntax so that for the still undocumented SSL ICS code the Wiki sceleton could be generated at least as a starting point to finally get documentation started? While I value the library and its many demos, a written documentation about the individual properties and methods is also worth quite something! -
[Fmx, Rx10.4 Patch 3] Anybody working productively with this patch ?
TurboMagic replied to Rollo62's topic in Cross-platform
Meanwhile the necessary TChart files have been "published" via some download link in the QP report RSP-28780. -
[Fmx, Rx10.4 Patch 3] Anybody working productively with this patch ?
TurboMagic replied to Rollo62's topic in Cross-platform
Did you already see the new comments to this one? https://quality.embarcadero.com/browse/RSP-28780 They indicate that TChart works in release configuration! -
Problem with Delphi RIO 10.3.3 and Google API Level 29
TurboMagic replied to Massimiliano S's topic in Cross-platform
Hello, what please does "the app crashes" mean? Is there any failure message? If yes , which? Can you run monitor.bat from your Android SDK? With that you can see the logcat log of your device. Run the app then until it crashes and look at the log. Maybe there are helpful messages in it. Have you looked into QP for any reports regarding this? Does one exist? The app that you tried, was this created new in 10.3.3 or is it updated from some earlier version? If the latter it might help to delete AndroidManifestTemplate and let the IDE regenerate it. Then change targetSDKVersion. Maybe there were other changes in it as well. Does the crash happen with a blank FMX app created in 10.3.3 as well? Regards TurboMagic- 20 replies
-
- api
- play store
-
(and 1 more)
Tagged with:
-
If somebody likes to have the shared objects used by the above demo unzip this attachment here into the project folder. FFMultiDemoLibraries.zip
-
Ok, I got the libraries loaded, at least in a 32 bit version, which is sufficient at the moment. But now I'm stuck on a permission error where I don't know what kind of permission is meant. The problem is calling this function: ret := avcodec_open2(c, codec, @CodecSetup.OptionsDictionary); in UBitmaps2VideoM's construktor. It always returns -13 which means permission error, but I don't know which kind of permission is meant. I already tried two different output paths and had added Android 8 style external write permission requesting, but to no avail. The paths tried are: GetSharedDownloadsPath GetDocumentsPath Has anybody any clue? FFMPEGMultiDemo.zip
-
The shared objects I have are for armeabi-v7a afaik. For a first test a 32 bit build of the app would be sufficient. But would this mean I need a 2nd set of .so files for a 64 bit version? The files we have are from here: https://github.com/PassByYou888/FFMPEG-Header/tree/master/BinaryLibrary
-
For some research we need to create an Android app with a precisely timed output of colored rectangles/bars. Unfortunately TTimer has a too big jitter. I need a low interval (if possible < 10ms) and unless my code in the timer event runs for longer than the interval the timer events should come precisely and not sometimes after 10ms (given a 10ms interval is set) and sometimes after 11 or 12 ms).
-
Precisely timed display output on Android
TurboMagic replied to TurboMagic's topic in Cross-platform
For us it is sufficient to swap color of a rectangle. Today we tried something with the bitmap of a TImage which has a clear method where you can specify the new color. That might be sufficient, if the timer would be more jitter free. Thus we call it from a secondary thread as TBitmap is thread-safe nowadays. Question is how to "time" such a thread on Android precisely enough? Do busy waiting with TStopWatch until the necessary time is elapsed? Or is there something better? -
Precisely timed display output on Android
TurboMagic replied to TurboMagic's topic in Cross-platform
Thanks for this reply. In German Delphipraxis somebody posted this link: https://developer.android.com/games/develop/gameloops But I couldn't find any Delphi implementation yet. It seems to integrate deep into OpenGL or Vulkan. -
Does debugger handle WITH better in latest versions, 10.3+?
TurboMagic replied to Mike Torrettinni's topic in General Help
Better get rid of with in your code where possible... Nick Hodges back then even wanted to deprecate with so I wouldn't expect EMBT to invest much time in improving the debugger in this area. I guess there are things waiting to be done with more worth for us developers... -
Hello, I'm using the TChart wich comes with 10.3.3 out of the box. I managed to add a 2nd right hand vertical axis via the TChart design editor, but I can neither there nor in code set min and max, at least they will always be ignored and min will always be 0 and max 64000 or 65535. I need -4090 and +4095 as min and max. Here is the variant where I tried to change them in code: ChartCurrentValues.Axes.Right.SubAxes[0].AutomaticMaximum := false; ChartCurrentValues.Axes.Right.SubAxes[0].AutomaticMinimum := false; ChartCurrentValues.Axes.Right.SubAxes[0].Automatic := false; ChartCurrentValues.Axes.Right.SubAxes[0].SetMinMax(-4096, 4096); ChartCurrentValues.Series[cMySeries1].CustomVertAxis := ChartCurrentValues.Axes.Right.SubAxes[0]; ChartCurrentValues.Series[cMySeries2].CustomVertAxis := ChartCurrentValues.Axes.Right.SubAxes[0];