Jump to content

TurboMagic

Members
  • Content Count

    255
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by TurboMagic


  1. Just to let you know that the development branch of that project now contains a much improved version, which will be released as V2.0 in the near future.

    What did improve?

    • Fixed issues with units whith dots in their name by adding some parameter automatically
    • Updated the version of CodeCoverage used to a current one, thus the generated HTML output looks much nicer
    • Added further output formats
    • Added further parameters
    • Added the possibility to specify any parameters not already covered by the wizard
    • Added the possibility to specify where these additional parameters will be placed in the generated batch file
    • Create output dir etc. if that doesn't exist yet
    • Bugfixes

  2. Master branch is updated with new code and some documentation (format of that needs fixing though):

    there are some command line params now -O for opening and -R for opening and running a project file and Tools menu
    integration has been reworked to contain two entries now.

     

    If you place your DCCP project file inthe same directory as the dpr/dproj, you can run it from tools menu now...

     

    Enjoy!


  3. I just commited an updated version:

    1. I fixed a bug where empty paths/file names were added to the .lst files under some circumstances.
      This really upset CodeCoverage.exe (it created an av in ntdll.dll!)
    2. The log-file output path is now the same as the report output path.
    3. The links in the new about dialog are opened in the browser now.
    4. If you pass a file name as command line parameter the tool will act as if you had clicked "Open" in
      the tool and loaded the file.
    5. I added some screenshots to the readme on GitHub.

    That's not a new release yet but some good improvements in my eyes. More should be comming over the next few days.


  4. I found out by talking to the one posting the bug report on the DE Delphipraxis forum, that this does not seem
    to be in the wizard but rather in the coverage tool itsself. We'll investigate. I cheched my project source and

    it has no JCL/JVCL units in its uses at all.


  5. Hello,

     

    do good and talk about...

    I'm currently shortly before releasing a new tool. It''s named "Delphi Code Coverage Plus"

    and is a completely rewritten and improved version of "Delphi Code Coverage Wizard".

     

    You can already get it on GitHub and it already works, the things before a 1.0 release I want to do

    are mostly cosmetic ones.

     

    Here is the link: https://github.com/MHumm/delphi-code-coverage-wizard-plus

     

    Now what can it do for me?

    • It is a GUI tool which can generate everything needed to run the commandline Delphi Code Coverage tool
    • that Delphi Code Coverage tool would run your unit tests and find out which lines of code your unit tests
      are actually run by the unit tests and which ones are never reached

     

    Why did I rewrite it and what's new/improved?

    • The former Wizard (remember: I only reworte the wizard, not the command line tool itsself!)
      would generate the batch file to run the command line tool and create other necessary files, but
      if you changed something in your Delphi project, you would have to update these files/batch file
      yourself manually
    • The new wizard got rid of JVCL components so it uses only what comes with Delphi itsself, which
      hopefully makes it easier for others to contribute
    • The new wizard introduces a project format so you can load and modify an existing project, e.g. if you
      added more units to your project or need a different output format
    • The new wizard can add itsself to Delphi's Tools menu if you like.
    • The new wizard stores his position and window sze so it opens the same positionand with the same size
      new time it is started
    • The new wizard should be HiDPI capable
    • The new wizard can directly show the HTML output if you selected that one as output format

     

    What else is there to know?

    • it was developed with 11.2, but most likely will compile and work fine with 10.4
    • For isntallation download the ZIP from GitHub or clone it, then open and run the project file
    • There are plans to release it via GetIt package manager as well
    • If you like this tool you can "star" it on GitHub 😉
    • Like 4

  6. 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.


  7. 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


  8. 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.


  9. 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. 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


  11. 1 hour ago, Uwe Raabe said:

    AFAIK, that won't work with Inserts via SQL (at least I never did it that way). The reason may be, that an INSERT query will never retrieve any fields like a SELECT query. There simply are no fields you can get the ID from.

     

    The usual way you have something like SELECT * FROM MYTABLE which retrieves all fields including the ID field. For adding a new record you just call Append or Insert, set the field values as needed and call Post. If everything is set up correctly, the new ID should then be available in the PERSON_ID field.

    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. 4 minutes ago, Uwe Raabe said:

    AFAIK, that won't work with Inserts via SQL (at least I never did it that way). The reason may be, that an INSERT query will never retrieve any fields like a SELECT query. There simply are no fields you can get the ID from.

     

    The usual way you have something like SELECT * FROM MYTABLE which retrieves all fields including the ID field. For adding a new record you just call Append or Insert, set the field values as needed and call Post. If everything is set up correctly, the new ID should then be available in the PERSON_ID field.

    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. On 4/12/2019 at 11:56 AM, Uwe Raabe said:

    There actually is some documentation about this: Auto-Incremental Fields (FireDAC)

    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.

×