-
Content Count
1180 -
Joined
-
Last visited
-
Days Won
16
Everything posted by FPiette
-
You should explain what you want to do, what is the problem in your code and which part you don't know how to do.
-
Added to the repository.
-
I didn't. If you are interested, my application is there: https://github.com/fpiette/OvbImgOrganizer
-
WSocket1 send image as memory stream
FPiette replied to Lindawb's topic in ICS - Internet Component Suite
This is the way to send the content of the stream. But you have a problem for the receiver: how will the receiver know the length of the stream? It would be OK if this is the only thing sent for the whole session. Not a very good design. You should probably first send an integer with the stream size and then the stream content. The receiver will then first receive the length and then know how many byte it has to receive for the content. Also, you don't need to decode the JPEG before sending. Just load the file into the memory stream. The receiver will decode the JPEG. This will result in much less data sent thru the network. I don't know why you want to send the image using a bare socket. Bette to use a higher level component such as HTTP of FTP. Since you have not explained your whole problem, I cannot help you more. -
Is there any "standard protocol" for recovery from a failure in non atomic operations?
FPiette replied to roPopa's topic in Algorithms, Data Structures and Class Design
You could use a database transaction. Begin the transaction before printing and commit the transaction after printing. Roll the transaction back if printing failed. If a program crash occurs while printing or before the program crashes, the transaction will automatically rolled back. -
Hello! I have the need to profile my application to find a performance bottleneck. This 32 bit application written in Delphi 11 is using IXmlDoc to read a GPX file and build an equivalent Delphi class hierarchy. This process look abnormally long. This could comes from IXmlDoc which is not the fastest XML parser, or from the code I wrote. I hope that using a profiler I will discover where the issue lies. So I searched the web and found several products. Among them I found GpProfile2017 (https://github.com/ase379/gpprofile2017) which is open source and still maintained. Before jumping to this project, I would like to know if someone has some experience to share. Thanks.
-
To keep you up-to-date, I have modified my code to use OmniXML that is delivered with Delphi 11 (unit Xml.Internal.OmniXML) and to use a record instead of a class for the most used data structure. The net result is a speed increase by a factor of 10 (Ten!) on a large GPX file. If time permit, I will give a try to neslib.xml.
-
For help, how can I use TIcsproxy?
FPiette replied to yshejia's topic in ICS - Internet Component Suite
For your information, HTTP is based on TCP as many other high level protocols such as FTP, SMTP, POP3 and more. You are right that the HTTP proxy will only work for HTTP. Maybe you can have a look at it to understand how it works? Or you have to study how TIcsProxy: you have full source code. -
For help, how can I use TIcsproxy?
FPiette replied to yshejia's topic in ICS - Internet Component Suite
Did you read the explanation that is in TIcsProxy source code ? -
I did not know! And this looks very promising. Thanks a lot.
-
Presednce of operations...
FPiette replied to Mark-'s topic in Algorithms, Data Structures and Class Design
I'm pretty sure you are wrong and that it is not specified in languages. -
You are using the wrong sample. If you want encrypted mail, use with OverbyteIcsSslMailSnd.dproj.
-
When I do that, the debugger always stops at the same place: ntdll.RtlUserThreadStart. And the call stack is empty!
-
Currently trying omniXML that comes with Delphi 11. If unsuccessful, I will give a try to XMLLite. Thanks.
-
We cannot help you is you don't even mention the errors you get. Does it works with the sample applications delivered in ICS distribution? You should really start with those samples to verify your setup is OK.
-
This stops at Delphi 10.3. I'm using Delphi 11.
-
Yes it is. Clearly mentioned by the current maintainer. @Primož Gabrijelčič is a highly skilled Delphi developer, that's why I'm interested in GpProfile2017 and I ask here for feedback from actual user of GpProfile2017.
-
That's where I discovered GpProfiler2017.
-
GPX file have very simple structure but there are tens of thousands of nodes (Example of GPX file). Before changing my code, I would profile it to know if the slowness comes from the XML parser our from my own code which is fully class oriented with generic TObjectList. I suspect this is much slower in my case compared to records and pre-allocated dynamic arrays.
-
This link is dead.
-
Your code compute the elapsed time for a given calculation, not the time your application is running. Which one do you need? If what you need is the time elapsed since the start of your program, use the main form OnCreate event to record the starting time and a timer to periodically compute the elapsed time (Just the difference between current time and recorded start time) and display it on screen.
-
Find a face in an image is not a trivial task. Blurring the face once found is easy. There are libraries for both tasks, google is you friend.
-
Is it your homework? It would be better that you show the code you already wrote so that we can help you with it. If we give you the solution - which is quite trivial - you won't learn anything.
-
There are a huge number of encryption methods. The best depends on the context you say nothing about. As a start, see this article which is really a very basic encryption method. For a more advanced solution, look for example at this source code on github.
-
One possible solution: procedure TForm1.Button1Click(Sender: TObject); const SrcString : String = '2090Lj32J5Y6Ni6Q2Rt8c538u1X227L340Q8N1...ce4A3z6l96S5v7LZ3OhSVoB538k7wPTn13E2w2D0h104fJ7HP09xo7W71J1o02c088922A3t420697F5431XP91C6JF9w1Ss0Tuk5S669207816gp57pW193BPWL27AZ052nr2S714...30'; Delim : String = '...'; var S : array [1..3] of String; I, J, K : Integer; begin J := 1; I := Low(S); while I <= High(S) do begin K := Pos(Delim, SrcString, J); if K <= 0 then begin S[I] := Copy(SrcString, J); while I < High(S) do begin Inc(I); S[I] := ''; end; break; end; S[I] := Copy(SrcString, J, K - J); J := K + Length(Delim); Inc(I); end; for I := Low(S) to High(S) do Memo1.Lines.Add(S[I]); end;