-
Content Count
2268 -
Joined
-
Last visited
-
Days Won
46
Everything posted by Fr0sT.Brutal
-
Actually there's some kind of syntax sugar for Variants - they could accept any "member" that is translated to g(s)etter with string name of that member. Not really helpful though but could shorten some code a bit
-
WSocket1 send image as memory stream
Fr0sT.Brutal replied to Lindawb's topic in ICS - Internet Component Suite
I still recommend HTTP. You'll have to invent your own protocol anyway so why not use already implemented one. Low-level Data events and buffer plays will be hidden from you by higher level events and classes. -
WSocket1 send image as memory stream
Fr0sT.Brutal replied to Lindawb's topic in ICS - Internet Component Suite
Why not use HTTP here? I started some kind of this stuff and got it working but postponed for production. ICS HTTP server procedure TControlServer.ProcessRequest(Client: THttpConnectionEx; SendType: THttpSendType; var Flags: THttpGetFlag); begin ... if AppStatus.FormImg = nil then begin Client.AnswerHeader(Flags, HTTP_Status_204, HTTP_Type_TxtHtml, ''); Exit; end; Client.DocStream := TMemoryStream.Create; Client.DocStream.CopyFrom(AppStatus.FormImg, 0); Client.DocStream.Position := 0; Client.AnswerStream(Flags, HTTP_Status_200, 'image/bmp', Client.DoContentEncoding); end; ... enf; Bmp because screenshot is in bmp, just to not deal with encoding. With this code I got an image of main form available even in any browser -
Getting up to speed with TRestClient and the other components
Fr0sT.Brutal replied to RCrandall's topic in Network, Cloud and Web
Don't these libs implement server side while OP needs client? General hint: if you have some REST soft working and some not, get the dumps of their requests and compare. That will be much more useful than any guessing. curl can dump all traffic with some options but I'm not sure about Delphi client... still, you can use Wireshark (traffic sniffer) for this or some special proxy. -
Weird. It is based on ICS which supports TLS
-
A better way to share global data structures than as global variables?
Fr0sT.Brutal replied to DavidJr.'s topic in Algorithms, Data Structures and Class Design
Amazingly exhaustive answer! Looks like you also highly value your time on writing a meaningful post 😄 -
+ for Filezilla - and honestly there's no other simple free solutions that I'm aware of (besides your own app built on Indy or ICS class). However, I only prefer 0.9.x versions as they changed much in 1.x and I couldn't get it working - some dumb cert issue
-
Using uninitialized object works on Win32, throws AV on Win64
Fr0sT.Brutal replied to aehimself's topic in General Help
Bad practice that Delphi RTL started itself. If usual clause is not applicable for some reason, why not write "raise CreateInternalError(...)"? Mystery for me -
Remote Delphi developer position
Fr0sT.Brutal replied to a topic in Job Opportunities / Coder for Hire
Damn! You're right! Mixed these Germans (LOL) singing about Russians with those 😄- 9 replies
-
- remote job opportunity
- delphi developer
-
(and 1 more)
Tagged with:
-
A better way to share global data structures than as global variables?
Fr0sT.Brutal replied to DavidJr.'s topic in Algorithms, Data Structures and Class Design
Not at all. I'm fine with objects where applicable. Some of my projects have singletone Settings, some use more complicated techs for communication. However I won't bother with object overhead where there are only a few global options exist. What I consider bloat is using datamodule for storage. Just a simple class located in common shared unit will serve equally and without excess entities involved. Anyway, I didn't see YOUR suggestion besides placing stuff into datamodule which is just "the same eggs but from a sideview" as global singletone. Okay, my habits are bad and old and non-OOP, what will be your solution? -
Remote Delphi developer position
Fr0sT.Brutal replied to a topic in Job Opportunities / Coder for Hire
Oh those (Jewish) Russians... © Dschinghis Khan- 9 replies
-
- remote job opportunity
- delphi developer
-
(and 1 more)
Tagged with:
-
Using uninitialized object works on Win32, throws AV on Win64
Fr0sT.Brutal replied to aehimself's topic in General Help
I guess the reason is the way you call the function. Likely the code before function call zeroed the corresponding stack area on x32 but didn't on x64 -
A better way to share global data structures than as global variables?
Fr0sT.Brutal replied to DavidJr.'s topic in Algorithms, Data Structures and Class Design
and so many actions just to hold non-TComponent stuff? Honestly this is a bloat for no reason. 0 pro's and several con's => no-go for me -
Class properties: Wins prettyness over functionality ?
Fr0sT.Brutal replied to Rollo62's topic in Algorithms, Data Structures and Class Design
Live templates work well for me So all users must remember which properties are retrieved and which are calc'ed? And code insight becomes almost useless? -
I did not but see no problem here.
-
Remote Delphi developer position
Fr0sT.Brutal replied to a topic in Job Opportunities / Coder for Hire
It's also interesting in what timezone the working hours are.- 9 replies
-
- remote job opportunity
- delphi developer
-
(and 1 more)
Tagged with:
-
Class properties: Wins prettyness over functionality ?
Fr0sT.Brutal replied to Rollo62's topic in Algorithms, Data Structures and Class Design
Quite acceptable solution IMHO. I've never had a need for different access levels to properties though. In rare cases of protected setters that must be called from outside I just execute these setters. -
-
Class properties: Wins prettyness over functionality ?
Fr0sT.Brutal replied to Rollo62's topic in Algorithms, Data Structures and Class Design
I recently stumbled upon QT API where there's no properties and it looks REALLY awful. Instead of Class.FooProp they have Class.getFooProp and Class.setFooProp. API size is doubled with no real necessity. So properties are awesome. Drawback is that they sometimes do too good job hiding implementation details so a user utilizes them with huge perf impact (Memo.Text := Memo.Text + s - this looks too simple but contains pretty heavy code underneath). Moreover, mechanism of published properties allows automatic (de)serialization - DFM, JSON, XML to and from object could only be done via properties -
Have you cloned whole repo? Mine starts from 2009 with 4.8 mentioned
-
A better way to share global data structures than as global variables?
Fr0sT.Brutal replied to DavidJr.'s topic in Algorithms, Data Structures and Class Design
I wasn't going to go too deep in describing all these design patterns, I'll leave the prize for most huge posts to you 😉 All I wanted to say by "and so on" is said in the 1st line of my post which seem to hide from your attention as well, eh? Sure. What does matter is how to perform further refactoring. With standalone global var you have to search for its usage filtering out possible name collisions with local vars. My way leaves all this work to compiler - force "namespace" and then easy search by an unique name of that "namespace". A data module is not simply a class but more like a form. It requires DFM. Why DFM when there are no components inside? That's excess. You don't have full and flexible control over when a DM is created. You have to track form creation order. For me that's kind of riding down the hill on an office wheeled chair. In theory, you can. In practice, it's senseless. -
Made in Taiwan 😄
-
Github repo Most likely - double free when VTV's OnFreeNode disposes linked object and it also gets freed somewhere else
-
A better way to share global data structures than as global variables?
Fr0sT.Brutal replied to DavidJr.'s topic in Algorithms, Data Structures and Class Design
You likely didn't read the next line I wrote. Datamodule usage is senseless here for me. It's a container for components useful for design-time customizing but nothing else. -
Official Lamborghini screwdriver and Official Lamborghini wrench? XD