Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/28/21 in Posts

  1. Zoran Bonuš

    A screen mirroring utility

    scrcpy https://github.com/Genymobile/scrcpy opensource, nothing to install on the phone - just enable usb debugging and setup adb over tcpip
  2. aehimself

    Synedit Help

    I solved this with the handler of TSynCompletionProposal.OnExecute (TableNamesSelector is a TSynCompletionProposal, SQLEditor is a TSynEdit) : Procedure TSQLConnectionFrame.TableNamesSelectorExecute(Kind: SynCompletionType; Sender: TObject; Var CurrentInput: String; Var x, y: Integer; Var CanExecute: Boolean); Var sa: TArray<String>; Begin If TableNamesSelector.ItemList.Count > 0 Then Exit; sa := SQLEditor.LineText.Substring(0, SQLEditor.CaretX - 1).Split([' ']); If Length(sa) > 0 Then sa := sa[Length(sa) - 1].Split(['.']); If Length(sa) < 2 Then TableNamesSelector.ItemList.Assign(SQLHighlight.TableNames) // No dot, offer table names immediately Else Begin CanExecute := False; If Length(sa) = 2 Then // Start a thread to collect field names of said table... End; End; You have to pass sa[0], sa[1], X and Y to the thread. sa[0] is the table name, sa[1] is the field name fragment which was already typed, x and y is the position where the proposal should pop back up. Once it finishes, you can: TableNamesSelector.ItemList.Assign(worker.FieldNames); TableNamesSelector.Execute(worker.FilterForText {passed to the thread as sa[1] from OnExecute}, worker.X, worker.Y); Also handle the OnClose event of the completionproposal: Procedure TSQLConnectionFrame.TableNamesSelectorClose(Sender: TObject); Begin TableNamesSelector.ItemList.Clear; End; The idea is that if the ItemList is empty the data still has to be collected and execution is disallowed. It will be popped up when the thread finishes.
  3. I have that a lot too, but I face it in several 3rd party apps, not only delphi-written ones I think it's actually more on the iOS side that the problem stands. It's very intrusive and bothering. It's probably linked to handoff between Apple devices and one can't expect the iOS users to turn it off It's very unfortunate.
  4. I added auto-close as an option now 🙂
  5. Fr0sT.Brutal

    multi-threading question

    No need in pool or something extra. Just create new threads, set their OnTerminate event and increase counter. In OnTerminate handler do what you need for single thread finish, decrease counter and when it reaches do overall finish.
  6. A straight C++ translation of the Hash_Console demo would look something like this: /****************************************************************************** The DEC team (see file NOTICE.txt) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. A copy of this licence is found in the root directory of this project in the file LICENCE.txt or alternatively at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ******************************************************************************/ /// <summary> /// Most simple demonstration of DEC hash routines /// </summary> #include <vcl.h> #pragma hdrstop #include <System.SysUtils.hpp> #include <DECFormat.hpp> #include <DECHash.hpp> #include <iostream> #include <limits> int main() { THash_RipeMD160* Hash = new THash_RipeMD160; try { try { // Calculate a hash value in accordance to the original author's test data // http://homes.esat.kuleuven.be/~bosselae/ripemd160.html RawByteString s = "message digest"; std::cout << "RipeMD160 digest (hash value) of " << s.c_str() << " is \n" << Hash->CalcString(s, __classid(TFormat_HEX)).c_str() << std::endl; std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); THash_Whirlpool1* W = new THash_Whirlpool1; s = "The quick brown fox jumps over the lazy dog"; std::cout << "RipeMD160 digest (hash value) of " << s.c_str() << " is \n" << W->CalcString(s, __classid(TFormat_HEX)).c_str() << std::endl; delete W; std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); } catch(const Exception &E) { std::wcout << const_cast<Exception&>(E).ClassName().c_str() << _D(": ") << E.Message.c_str(); } } __finally { delete Hash; } }
  7. Rollo62

    JCL support for Linux64 compiler

    Thats very good that someone takes care of this nice peace of code, but I'm afraid the golden days of Jcl had been gone for a while. Meanwhile Delphi, System, RTL, RTTI has improved much, and also added their own native Linux cross-platform support. What I would suggest is to check and cleanup the code a little, to find the golden nuggets that were worth to be unraveled ( I'm sure there are many ). Who is using Jcl / Jvcl actively, who can give some hints ? If Jedi would not be such a big unsorted mess I would like to look deeper into this too, but I always have the bad feeling that it brings more overhead than it brings useful features. Maybe you have some deeper insights, and you can explain what features especially should stay and which one should be separated ? To have a general, external library that could fill some gaps of Delphi would be a good idea, in my opinion, but it should be directly VCL/FMX ready, not especially platform binded.
  8. Fr0sT.Brutal

    Parsing Text search expression

    There are plenty of open-source parsers available. - ZeosDBO has powerful engine in \src\core\ (units ZExpression.pas, ZExprParser.pas, ZExprToken.pas, ZTokenizer.pas), you could take any part of it and customize to your needs - IBExpress from std lib has RAD\source\IBX\IBX.IBScript.pas with the parser as well, just as FireDAC in RAD\source\data\firedac\FireDAC.Stan.Expr.pas for expressions and FireDAC.Comp.Script.pas for scripts - Template engine from DVDChief also has expression parser - and so on Moreover, with such simple tokens you can easily write it yourself Btw, I don't realize what "testing" and "text" are in your example. Variables? Or just single words to search for, with quotes removed for simplicity (a la Google)? That's a nice task to solve, huh. Depending on maximum nesting level allowed it could require some discrete maths.
  9. Marco Cantu

    Tool to inspect properties at run-time?

    Yes, I dwell here from time to time. I'll have a look, I know there are other tools doing the same but I'll update mine, should not be a big deal... time permitting.
  10. pyscripter

    New Community Edition

    In case you have not seen it: Delphi & C++Builder Community Editions Now Available in Version 10.4.2! (embarcadero.com)
×