-
Content Count
1977 -
Joined
-
Last visited
-
Days Won
26
Everything posted by Attila Kovacs
-
As I put more code into the pipeline stages some questions are arising. For example, some of the exceptions are arriving as "string" into the final output collection instead as "exception". One case is "Abort" and the other one is if I'm re-raising an exception in the stage code. Why is that? Also, what is the proper way to re-run a task or add a new one after "CompleteAdding"? I would like to return the task with the exception and be able to re-fire the same task. (Network communication) Do I need a new pipeline?
-
Ha-ha. ATM I entered the code here I just noticed that pipeline is a local variable, and also an interfaced obj. 🙈
-
Sadly I'm stuck already, if I omit WaitFor(), nothing happens. Occasionally one task will be executed if I'm hitting the start button like a maniac, but I have 4 values assigned to the input. I'm playing with the example with retriever/inserter. pipeline := Parallel.pipeline // .Stage(Retriever) // .NumTasks(Environment.Process.Affinity.Count * 2) // .Stage(Inserter, Parallel.TaskConfig.OnMessage(Self)) // .Run // ; pipeline.input.Add(TThreadParam.Create(....)); pipeline.input.Add(TThreadParam.Create(....)); pipeline.input.Add(TThreadParam.Create(....)); pipeline.input.Add(TThreadParam.Create(....)); pipeline.input.CompleteAdding; // pipeline.WaitFor(INFINITE); I've tried to put ".run" after completeadding as a 'trial and fail'attempt, and in this case on the first run 2 tasks are executed, and from the second run all tasks are executed. I'm really missing the explanations from the doc, there is also an example "procedure TfrmOtlParallelExceptions.btnPipeline1Click(Sender: TObject);" where is no waitfor() but processing output right after "CompleteAdding", which is also confusing. // Provide input 37 with pipeline.Input do begin 38 // few normal elements 39 Add(1); 40 Add(2); 41 // then trigger the exception in the first stage; 42 // this exception should be 'corrected' in the second stage 43 Add('three'); 44 Add(4); 45 CompleteAdding; 46 end; 47 48 // Process output; there should be no exception in the output collection 49 for value in pipeline.Output do 50 Log(value.AsString);
-
Thank you Primož. Awesome lib.
-
Thanks, does this mean pipeline is the wrong approach here or can I run the pipeline without Waitfor? Could not find anything in docs. Edit: ok, I think I just have to omit WaitFor. I'll give it a try.
-
Automatically make your PC wake up at a given time
Attila Kovacs replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
you could just work 7/24, problem solved -
Or get rid of "parentfont" and do it like css? Inherit and overwrite if apply. Anyway, you have to implement it carefully to not to affect rendering speed too much and keep the dfm as tiny as possbile.
-
Issue with TVirtualStringTree OnNodeDblClick
Attila Kovacs replied to Mike Torrettinni's topic in VCL
defer your showmessage with a custom message -
Issue with TVirtualStringTree OnNodeDblClick
Attila Kovacs replied to Mike Torrettinni's topic in VCL
because the mouseup event will be swallowed by the modal window (showmessage) -
Why is ShowMesssage blocking all visible forms?
Attila Kovacs replied to Mike Torrettinni's topic in VCL
because showmessage pops up a form in modal mode? -
Is Class with 2 'nested' constructors bad design?
Attila Kovacs replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Ok. Try to restructure your units until TINIComparer and TCompareType are in the same unit, and don't be shy creating 2-3 more units if needed. Unseen, i would say, your structure is done when "uINIComparerStructure" becomes empty. -
Is Class with 2 'nested' constructors bad design?
Attila Kovacs replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
First you said it's in a different unit, now you are telling me, you want to hide it. I'm not sure what your goal is, why would you have it in a different unit or why would you want to hide it? There is something else you are not telling or you are not sure about. Lay your cards on the table. -
Is Class with 2 'nested' constructors bad design?
Attila Kovacs replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
constructor Create(const AIniFileName1, AIniFileName1: string; AOptions: TCompareOptions = []); Where else would you declare TCompareOptions as in the same unit as this class is? -
Is Class with 2 'nested' constructors bad design?
Attila Kovacs replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
@Mike Torrettinni It's completely fine, I'm just against "Indian Naming". What if your class gets 2 more options, how would you name the constructors? -
Is Class with 2 'nested' constructors bad design?
Attila Kovacs replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
as long as nobody else have to use this class and you have memories like an elephant, it should be fine.. -
@Stefan Glienke yes, you are right, I wasn't paying too much attention, and I also wasn't following any compiler hint, I saw this and just added "new" without thinking.
-
@Stefan Glienke Thx a lot! I just followed the compiler hints 😉
-
@Stefan Glienke I've tried, without success. "public virtual void Test()" in TTest1 and "public new void Test() {" in TTest2. That's why I'm asking, but really don't want to convert this conversation into a c# for dummies (me).
-
I have never seen c# before. And we were living in a small shoebox in the middle of the road. Now, hijacking the topic for a small moment, how do you make this c# snipplet to print "TTest2.Test"?
-
You mix static and non static? Remove 'static' and new TTest<TTest2>().TestIt(); prints "TTest1.Test" https://dotnetfiddle.net/S3DAGW
-
FireDAC Postgresql performance vs ADO SQL/Server performance
Attila Kovacs replied to Martyn Spencer's topic in Databases
I have no idea how should both work at the same time. Does the grid filters per sql and refetch? What "fetchmode" setting will be used? Are there keyfields in the tables? (primary key) Can you monitor the traffic to find bottlenecks? (TFDMonitor? I don't know it's name) -
Array size increase with generics
Attila Kovacs replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
@Dmitriy M Yes, but if I would touch the RTL I would rather make some of the methods virtual and get is solved without any attribute decoration if possible. Or adding an OnCreateObject event for the case it's not able to create the object from the RTTI information (which I'm still not getting why isn't it able to do so). Maybe I should make these changes and present a working version instead of speculating. I wish I had time for that (too). -
Array size increase with generics
Attila Kovacs replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
"Note that we need at least one type keyword between the alias and its use inside the attribute." As If Millions Of Voices Suddenly Cried Out Didn't know this 😮 Then this "type"-ing could also impact compile speed in some units. Unfortunately this will barely work for example in Berlin U2 (or prior) as it was released meanwhile a coffee break and my "REST.JsonReflect.pas" has things like raise Exception.Create('NOT IMPLEMENTED'); or "revAttr.ObjectsReverter(Data, FieldName, GetArgObjects(revEv.FFieldClassType," where revEv is not setted in the 3rd case of the if, and it's either nil or points to garbage. I gave up pursuing TObjectList and JSON. A single "virtual;" on any random method of any random JSON handler class would make it 1000% more usable. I ended up with a base class where I'm managing the objects through RTTI, and storing them in arrays. Drawback is, every object must inherit from this base class or handle its objects himself. I don't like it either. -
google found this on the first place: https://templates.machinezoo.com/ansi378-2004 first 26+ bytes are "ANSI INCITS 378-2004 template", don't ask me what is it, but this lead to this site: https://www.nist.gov/itl/iad/image-group/resources/incits-standardized-biometric-data and this dl link "INCITS 378 index finger minutiae templates - 233K. Last updated Oct 3 13:24" where are .frmpiv files in it, which contain 0000000050: 00 00 00 00 00 00 00 00 │ 46 4D 52 00 20 32 30 00 FMR 20 0000000060: 04 40 FF FF FF FF 80 01 │ 01 D0 02 20 00 C5 00 C5 @ÿÿÿÿ€Ð Å Å there is your header magic, 46 4D 52 = FMR
-
10.4 10.4 Beta with Update Subscription
Attila Kovacs replied to ŁukaszDe's topic in Delphi IDE and APIs
Rather later than a monday version again.