Jump to content

Vandrovnik

Members
  • Content Count

    522
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Vandrovnik

  1. Vandrovnik

    TImage (JPG) not scaling, but PNG and BMP DO ???

    It is possible to load a JPG image in original size, or 1/2, 1/4 or 1/8 of original size. Maybe it firsts loads it optimized in, for example, 1/4 of its original size, and later it does not have "pixels enough" to scale up?
  2. Vandrovnik

    Strange Benchmark Results; Am I Missing Something?

    I know (I have used it in my thread example), but is it possible to do also with tParallel.For?
  3. Vandrovnik

    Strange Benchmark Results; Am I Missing Something?

    I have tried this (will probably not work fine for MaxValue not divisible by Workers), it is 3.6 times faster than single thread on an old i7 CPU. I guess it should be possible to use IFuture<Int64>, but I do not know how to pass parameters to it... It is easy to use tParallel.For, but there I used tInterlocked.Add(total, num), which resulted in much worse time than single thread. const MaxValue=1000000000; type tCalcThread=class(tThread) public CalcFrom: integer; CalcTo: integer; Value: Int64; procedure Execute; override; end; procedure tCalcThread.Execute; var PartialTotal: Int64; num: integer; begin PartialTotal:=0; for num:=CalcFrom to CalcTo do if (num mod 3 = 0) or (num mod 5 = 0) Then inc(PartialTotal, num); Value:=PartialTotal; end; function PLoop32: Int64; const Workers = 8; Var total : Int64; Calcs: array[0..Workers-1] of tCalcThread; a: integer; begin total := 0; fillchar(Calcs, sizeof(Calcs), 0); try for a:=0 to Workers-1 do begin Calcs[a]:=tCalcThread.Create(true); Calcs[a].FreeOnTerminate:=false; Calcs[a].CalcFrom:=Int64(MaxValue)*a div Workers; Calcs[a].CalcTo:=Int64(MaxValue)*(a+1) div Workers-1; Calcs[a].Start; end; for a:=0 to Workers-1 do begin Calcs[a].WaitFor; inc(total, Calcs[a].Value); end; finally for a:=0 to Workers-1 do FreeAndNil(Calcs[a]); end; result := total; end;
  4. Vandrovnik

    Strange Benchmark Results; Am I Missing Something?

    I think the result will not be the same - original code adds number 15 just once to the total, while your code will add it twice...
  5. Is there Parnassus Parallel Debugger for Delphi 11.0? Debugging threads is a night mare for me, so I wanted to try this IDE enhancement, but did not found it in GetIt...
  6. Let's hope it wasn't "soon" from a geological perspective...
  7. Vandrovnik

    What is good replacement for FastReports?

    There is https://blogs.embarcadero.com/must-have-this-free-powerful-report-generator-for-your-windows-apps/ , I have not tried it.
  8. Vandrovnik

    docwiki.embarcadero.com is not working

    I suppose it will be more difficult to find information on docwiki.embarcadero.com using Google, because Google Bot probably most of the time also sees just errors...
  9. Vandrovnik

    ANN: Better Translation Manager released

    Thank you! I will try it as soon as possible.
  10. Vandrovnik

    ANN: Better Translation Manager released

    This is very interesting, please are there instructions how to prepare the application to use this tracking?
  11. Vandrovnik

    docwiki.embarcadero.com is not working

    ... and these are silently ignored, I guess 😞 [RSP-37138] Product documentation has been unavailable for several days - Embarcadero Technologies Internal status: Validation. How much time does it need just to validate this problem?
  12. Vandrovnik

    docwiki.embarcadero.com is not working

    It says it cannot connect to MySQL database server, so the problem would probably happen with newer MediaWiki, too.
  13. Vandrovnik

    Free vs Paid Version of an app

    Hello, Inno Setup is able to take a file which is out of the setup.exe and install it, so if they can distribute more then just one file, they can put logo.jpg etc. in the same directory (or a subdirectory, as in my example) and install would find it there. [Files] Source: "{src}\Licence\*.*"; DestDir: "{app}\Bin"; Flags: external comparetimestamp; Components: Licence
  14. Vandrovnik

    Using translations in unit Consts with Delphi 10.4 VCL

    I have copied Vcl.Consts.pas and System.SysConst.pas to my project folder. I have added them to my project and in them, made translations. With each new version of Delphi, I use WinMerge to find differences and solve them, otherwise it does not compile anymore.
  15. Hi, I am using IBX on Windows (32 and 64bit) and Android (32 and 64bit). Database = Firebird (2.5 and 3.0). In Delphi 11, I have not found any problem.
  16. Vandrovnik

    PC-specific memory corruption...?

    I would first test the memory of the computer - for example, https://www.system-rescue.org/ It has a memtest included. When memory is OK, then test disk...
  17. Ups, yes, it has a bug 🙂 I was reading it as _Value1 := _Value1+1;
  18. OK, when we change it to this, so there is an unitialized variable: procedure bla(var _Value1: integer; _Value2: integer); begin if _Value2 > 0 then _Value1 := _Value2+1; end; procedure blub; var Value1: integer; begin bla(Value1, 3); writeln(Value1); end; What will be the value of Value1? I would prefer to get a warning in this case.
  19. From my point of view, it is wrong. For "var" parameters, I expect they are already initialized. For uninitialized variables, that are used as output, there is "out". https://docwiki.embarcadero.com/RADStudio/Sydney/en/Parameters_(Delphi) - Out parameters are frequently used with distributed-object models like COM. In addition, you should use out parameters when you pass an uninitialized variable to a function or procedure.
  20. It does not have to look inside - it sees (immediatelly), that uninitialized variable is passed as "var" parameter. It means that I should initialize the variable, or change the procedure and use "out" parameter instead of "var".
  21. It helps to avoid mistakes. Here it produces a warning: ([dcc32 Warning] Test79.dpr(22): W1036 Variable 'a' might not have been initialized) procedure Test2; var a: integer; begin if a=1 then exit; end; I believe it should be consistent and produce a warning in Kryvich's example, too.
  22. Please will you report it and post here the link? I would vote for it.
  23. Vandrovnik

    Is Graphics32 ready for Delphi 11 yet?

    Do you get the same error when you specify full path to the .bmp file?
  24. In my opinion, in these situation you sometimes have to ask the user. Even when data is sent to printer, it does not mean it was really printed OK (out of paper, damaged printout...).
×