Jump to content

TurboMagic

Members
  • Content Count

    242
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by TurboMagic

  1. TurboMagic

    Code coverage wizard plus

    Just to let you know that I just submitted the form to get it published in GetIt. Now that's EMBT's turn 😉
  2. Not bad the idea, it just might require adding more syntax to { ToDo: "my list item" } comments. I'm also sure you know where you can file such requests officially. If you do that and post the number here others might vote for that.
  3. Sorry for not answering earlier. I'm not often on English DelphiPraxis forum and it seems I don't get E-Mail notifications. Need to check settings for those. Aboue EAS: I guess you mean AES? The key is the key used for encryption descyption. means: both parties need to use the same key. If you just use the AES class the variant of AES algorithm picked/created depends on the length of the key you give. At least in the version in development branch (not sure if that's already in 6.4.1) there are AES128, AES192 and AES256 classes now which do not really check key length to find out which one to create. Init vector: if you use any block mode except ECB (and ECB is not recommended as this is the least secure one) the preceeding block is somehow combined with the data of the currently processed block. That means: if you encrypt the very same data twice, it usually will be encrypted differently because blocks depend on each other. This enhances security. When using ECB mode this is not the case and thus is should not be used. This init vector is just the data which is treated as "output of the former block processed" when calculating the very first block. So it must have a length of block size of the algorithm and you need to supply the same data for encryption and decryption. The recommendation is to use a different value each time you encrypt something. I hope this helps, if not let me know.
  4. TurboMagic

    TShareContract/ShareContractFramework

    Hello, has anybody any hints for me why TShareContract or ShareContractFramework work in the example provided by Delphi 11.1 but not when I copy over that code to my application? So where's my difference? I call it from the OnClick handler of a TMenuItem and not a TButton but that shouldn't be the root cause. I call InitiateSharing but then the mouse cursor changes for just a brief moment and nothing pops up. When I run the demo and click the button it works and I get that popup... Cheers TurboMagic
  5. Hello, I'm currently playing with Kastri's Camera demo, which is based on the Android Camera2 API. Now I'm struggeling with getting capabilities of the camera used and later on I even need to change some settings. After finding out how the basic structure of this demo works I added this method to get some capabilities as string to get started: function TPlatformCamera.GetCapabilities: string; var LCharacteristics : JCameraCharacteristics; Orientation : Integer; Obj : JObject; IntArray : TJavaObjectArray<integer>; i : Integer; begin LCharacteristics := FCameraManager.getCameraCharacteristics(FSelectedCamera); Obj := LCharacteristics.get(TJCameraCharacteristics.JavaClass.LENS_FACING); Orientation := TJInteger.Wrap(Obj).intValue; if (Orientation = TJCameraMetadata.JavaClass.LENS_FACING_FRONT) then Result := 'Camera: front' + sLineBreak else Result := 'Camera: back' + sLineBreak; Obj := LCharacteristics.get(TJCameraCharacteristics.JavaClass.CONTROL_AE_AVAILABLE_ANTIBANDING_MODES); end; FSelectedCamera is a JString and assigned where the component goes through the list of available cameras and selects the desired one. Reading which camera is selected already seems to work, since this just returns a simple integer value. But how to deal with CONTROL_AE_AVAILABLE_ANTIBANDING_MODES, which, according to the API docs API docs returns int[], which is some kind of array? How to access this from Delphi? And even more: CONTROL_AE_COMPENSATION_RANGE, which returns an array (with two elements) of Range<Integer>? And CONTROL_AE_COMPENSATION_STEP which returns a Rational? I haven't found the definition of this Rational type in Androidapi.JNI.JavaTypes or Androidapi.JNIBridge.
  6. Meanwhile I learned that there's no support in the Java bridge yet to get access to these data types, which means one must implement some things on "the Java side".
  7. Hello, I want to use TCameraComponent on Android to capture images with a frame rate as high as possible and search for something/detect something in the individual images. Questions: 1. Is the exposure time of relevance there? If yes, how can I set that? I didn't see anything regarding that. 2. Which Android camera API does TCameraComponent use? 3. If I use .MAP on the obtained bitmap I get a TBitmapData object, where I can call GetScanLine on. Which TPixelFormat do those bitmaps use? Is this the same format on all Android devices or how to set that? Regards TurboMagic
  8. TurboMagic

    Android camera/exposure/GetScanLine/PixelFOrmat

    Can you show on how to add this/implement this? Problem is: without continous capture the thing is not usable for my purpose...
  9. TurboMagic

    Android camera/exposure/GetScanLine/PixelFOrmat

    Regarding your support for Camera 2: Can you got a bit more into details about what work it would need? Does Camera API 2 have a setting for the exposure time? Have you surfaced that one or would it be easy to add it? And why, oh why, does Android need so many different takes on a camera API? Regards TurboMagic
  10. Found a fix myself! FQuery.UpdateOptions.AutoIncFields := 'PERSON_ID'; This makes FireDAC aware that the not null constraint will be fullfilled by the database itsself.
  11. I just tried this, but it does not work. It throws an EDatabaseError exception that the PERSON_ID must not be null. That field is the primary key and as soon as I delcare it as primary key the DB management tool adds a not null constraint. The exception occurs on the Post line. My code looks like this: FQuery.SQL.Text := 'select Person_ID, LastName, FirstName from persons'; FQuery.Open; FQuery.Append; FQuery.FieldByName('LastName').AsString := 'Doe'; FQuery.FieldByName('FirstName').AsString := 'John'; FQuery.Post; Result := FQuery.FieldByName('Person_ID').AsInteger; The generator value us applied via some ACTIVE BEFORE INSERT trigger by the way...
  12. Thanks! Sounds helpfull and I'll try this later!
  13. The developer of FireDAC somewhere recommended this one: FireDAC.Comp.Client.TFDCustomConnection.GetLastAutoGenValue But that also retrieves the last value of the generator and thus should better be avoided for most RDMS, at least in multi user scenarios. Somewhere else adding this to the insert statement is recommended: RETURNING ID INTO :ID This would return the value in a field named ID. But: FireDAC doesn't seem to support this. If I add this to the insert the Prepare call throws an error: Dynamic SQL error. Error code -104, Token unknown, Line 1 column 138. Where column 138 (at least when I copy out the SQL text in the debugger) is one of the parameters before...
  14. In my case I have used this one: FQuery.SQL.Text := 'insert into MYTABLE ' + '(LASTNAME, FIRSTNAME) ' + 'VALUES (:NEW_LASTNAME, :NEW_FIRSTNAME);'; FQuery.UpdateOptions.AutoIncFields := 'PERSON_ID'; FQuery.CachedUpdates := false; FQuery.Prepare; Later on I fill in values like this, which works and created unique IDs: FQuery.ParamByName('NEW_LASTNAME').AsString := 'Doe'; FQuery.ParamByName('NEW_FIRSTNAME').AsString := 'John'; FQuery.ExecSQL; But how to retrieve the generated new PERSON_ID?
  15. This is exactly the help topic I don't fully understand! I'm having the same issue right now, but with a Firebird database. The help topic doesn't show me (at least not in a form I can understand) hot to access the generated value after calling ExecSQL. And the sample linked I don't understand either.
  16. Some Firebird documentation about generators I just read recommends to NOT directly query a generator like that for master/detail tables, as in multi user scenarious you cannot be sure whether somebody already further incremented the generrator etc.
  17. TurboMagic

    TaskMessageDlg('.... behind form?

    Ok, I invested the time to try to replicate this in a reduced demo, but there the problem doesn't happen!
  18. TurboMagic

    TaskMessageDlg('.... behind form?

    Your idea is of course how one might find it, if it shows in a reduced demo. My first question would be: what's different between those two forms that one shows this problem and the other works as expected. So which properties or behavior can influence that? Both forms have set: - BorderIcons := [biSystemMenu,biMinimize,biMaximize] - BorderStyle := bsSingle - DefaultMonitor := dmActiveForm - FormStyle := fsNormal - PopupMode := pmNone also pmAuto doesn't change this - PopupParent := nil, but also setting it to TCustomForm(AOwner) in the constructor didn't change anything - Position := poOwnerFormCenter - WindowState := wsNormal The form itsself only has an OnShowEvent, where one control gets set the focus. Any other properties known which might play a role here?
  19. TurboMagic

    TaskMessageDlg('.... behind form?

    I might try later on, but it might prove difficult. I already tried to do a minimal demo for something else I saw in that project and reported as QP 38385, but the minimal demo failed to show the effect. In the German DP somebody said something that all new forms seem to have some popupparent issue as if always the main form would be used as popup parent... I haven't done any investigation of that theory yet, as I just read it. Could that be related?
  20. TurboMagic

    TaskMessageDlg('.... behind form?

    Strange! I found this post because I have exactly the same issue, but the solution above doesn't fix my issue 😞 Given: - D11.1 - a datamodule containing a TTaskDialog - a main form - two other forms, each having a button for showing that TTaskDialog - both forms have the same popup mode, border style etc. - both are created at runtime and shown via ShowModal and when created both get the main form set as owner - in one form the TaskDialog shows in the foreground, in the other it stays in the background - calling execute with self.handle as param doesn't help Now I copied the Taskdialog from the datamodule directly on the form where it doesn't work and called that directly. Result: still doesn't work 😞 Anybody any clue?
  21. Hello, this is the announcement that I just re-released a classic Delphi component called TComPortDrv. The new release is in agreement of the original author and the license was changed to Apache 2.0 by this. What is this non-visual VCL component about? It is an encapsulation of the Windows RS232 API so you can send and receive data via real and virtual COM-ports. The new version works from 10.4.1 Sydney onwards (due to the use of $(Auto) for the LibSuffix setting of the packages. You should get it compile on older versions though as well. Where can I get it from? https://github.com/MHumm/ComPortDriver/releases/tag/V3.0 What got changed in this V3.0 * made compilable with Unicode Delphi * fixed a severe bug in the data receive event which would overflow the internal buffer when using this component with a high baudrate (over 230400) * changed all external comments to XMLDOC * added a method to get a list of available COM-ports (only as COM3, COM4 etc. as of now) * added SetCommBreak and ClearCommBreak methods * made DelayForRX function a method now and based its calculation on the current serial settings * changed the component Icon Enjoy TurboMagic
  22. Now I am. Thanks! But for which version is this? The one our new project already has as starting point is compatible with 10.3 and I guess mostly compatible with that release so I guess it's newer than the one you linked. But you can compare both versions I guess...?
  23. This would be another approach. At least for the start we should attract many developers to get it started. I know that you're after, but if we make entry barrier as low as possible at the start we might attract more contributors. We can still switch afterwards if we find that some don't do the right things. But: we need people working on it. Otherwise it's useless... 😉
  24. TurboMagic

    DEC V6.4.1 released

    Good news: DEC V6.4.1 jsut got released. https://github.com/MHumm/DelphiEncryptionCompendium/releases/tag/V6.4.1 What is this? DEC, also known as Delphi Encryption Compendium is a cryptography library for Delphi and FPC. What's new in V6.4.1? This is mainly a bugfix release with these topics: fixed some regression which produced wrong output at least for the 2DES encryption algorithm when used with CBC block chaining kode improved layout and handling of GCM block chaining mode in Cipher_FMX demo application added a new Cipher_Console_KDF demo application fixed and improved the documentation, especially about wrongly written GCM properties What's the plan for the future? Have a short rest 😉 Require Delphi 10.1 Berlin instead of D2009 as minimum compatible version The rest of the plan (which exists) will not be disclosed yet. Cheers TurboMagic
  25. TurboMagic

    DEC V6.4.1 released

    I just noticed, that I hadn't completed the release publication back then due to too much going on short before Christmas. This has been "fixed" now. The direct link to the release is here: https://github.com/MHumm/DelphiEncryptionCompendium/releases/tag/V6.4.1 And work on a V6.5 already started. Contributors are welcome. Cheers TurboMagic
×