

mvanrijnen
Members-
Content Count
489 -
Joined
-
Last visited
-
Days Won
1
Everything posted by mvanrijnen
-
"Anyone on the client side with the credentials could run any kind of SQL statements, which may be pretty unsafe, like DROP TABLE or DROP DATABASE in the middle of a SELECT statement. Or it could access data from other customers." 100% agree 🙂 But for us it;s for "inner" use, and not directly sql statements, there are different parameters from which sql statements are generated, filter, (and|or etc), sortby, fields. Thereby for us it's select only, not update/insert/delete. it's more like an excercise for playing with rest
-
Just written our own tool for this. We already have the DB layout in specific tables, with extra attributes, used for generating std forms, lists etc. Now busy with a experiment to acces tables with REST, also publish the table data & info with radserver (internal use only!). Generating now all the radserver resources for schema's (collection of tables for us), tables etc. Mostly just for getting the hang of radserver etc. (developing a a 1990 years environment here) But i agree that you should not expose your tables like this for the "public" or for what application whatever, my colleague likes to use tables for client apps (not through general api's though). I think api's should expose usable information blocks or usable application blocks, not simple table CRUD actions etc.
-
ANN: Sempare Template Engine for Delphi
mvanrijnen replied to darnocian's topic in Delphi Third-Party
Was looking for something like this. Created myself a few half working "engines" (just for own needs), Hopefully can replace those with one good one 🙂 -
Having fun with Delphi
mvanrijnen replied to Attila Kovacs's topic in Algorithms, Data Structures and Class Design
Good idea with the pointer, you do have to encode somevalues in the stringbuilder (escape special chars etc) maybe with an TInterfaced (no need to free) THSURI2 = class(TInterfacedObject) private FScheme: THSURIScheme; FFragment: string; FQuery: string; FPort: Integer; FPassword: string; FHost: string; FUserName: string; FPath : string; function GetAsString: string; constructor Scheme(const AScheme : THSURIScheme); public constructor HTTP; constructor HTTPS; .... TMP2 := THSURI2.HTTPS .UserName('yourname') .Password('andpassword') .Host('www.website.com') .Port(1234) .Path('chapter') .Path('subchapter') .Path('subsubchaper') .Parameter('showall') .Parameter('yearstart', '1990') .Fragment('startreadinghere'); test := TMP2.AsString; -
Having fun with Delphi
mvanrijnen replied to Attila Kovacs's topic in Algorithms, Data Structures and Class Design
Ok, did not know that. So have to be carefull where and how to use this. Would not be wise to use it in highperf code sections, but There where you set up connection strings, sql statements, urls etc, why not use it ? -
Having fun with Delphi
mvanrijnen replied to Attila Kovacs's topic in Algorithms, Data Structures and Class Design
Something like: tmp := THSUri.HTTPS .UserName('yourname') .Password('andpassword') .Host('www.website.com') .Port(1234) .Path('chapter') .Path('subchapter') .Path('subsubchaper') .Parameter('showall') .Parameter('yearstart', '1990') .Fragment('startreadinghere'); tmp.AsString Reults in: 'https://yourname:andpassword@www.website.com:1234/chapter/subchapter/subsubchaper?showall&yearstart=1990#startreadinghere' I'm using the scheme (HTTP, HTTPS) as the record constructor/initializer. .... public class function Scheme(const AScheme : THSURIScheme) : THSUri; static; class function HTTP : THSURI; static; class function HTTPS : THSURI; static; ..... implementation class function THSURI.Scheme(const AScheme: THSURIScheme): THSUri; begin // some needed and needless inits. Result.FScheme := AScheme; Result.FPort := 0; Result.FHost := string.Empty; Result.FUserName := string.Empty; Result.FPassword := string.Empty; Result.FPath := string.Empty; Result.FQuery := string.Empty; Result.FFragment := string.Empty; end; class function THSURI.HTTP: THSURI; begin Result := THSURI.Scheme(usHTTP); end; class function THSURI.HTTPS: THSURI; begin Result := THSURI.Scheme(usHTTPS); end; -
"a specific part of the program" is a thread (amongst other parts) in your case, misunderstood your sentence there 🙂
-
That is tricky, you should not do that, maybe the underlaying physicaldb class takes care of you for this, but with most db types, you must not practise this. (i can not forbid you todo 🙂 ). See this: http://docwiki.embarcadero.com/RADStudio/Rio/en/Multithreading_(FireDAC) I have some troubles with a new project too, with MT and FD, probably some (yet) unidentified loading from a thread in a datamodule which is purely running mainthread.
-
1st You constantly assign the strings of the stringlist, do you do this within a beginupdate/endupdate ? 2nd Not want to be too harsh, but looks not good to be a final solution that code.
-
Hello, maybe someone can help me out with the following problem, serverside resource See following code, i post a request for updating something, serverside can not find body? this is what the post request, posts to the server (captured with fiddler): POST http://pc-pcname:8080/appointments/21140 HTTP/1.1 Connection: Keep-Alive Content-Type: application/json Accept: application/json, text/plain; q=0.9, text/html;q=0.8, Accept-Charset: utf-8, *;q=0.8 User-Agent: Embarcadero RESTClient/1.0 Content-Length: 435 Host: pc-ict1:8080 application/json{"ID":21140,"Description":"blah blah blah" "UpdateState":0} Server Side: procedure TAppoinmentResource.PostAppointment(const AContext: TEndpointContext; const ARequest: TEndpointRequest; const AResponse: TEndpointResponse); var jsonobj : TJSONObject; begin if ARequest.Body.TryGetObject(jsonobj) then begin // do something with the jsonobject end; end; Client Side procedure TPlannerRestClient.UpdateAppointment(const AAppointment: TPlannerAPIAppointment); var request : TRESTRequest; jsonstring : string; jsonobject : TJSONObject; begin request := NewRequest(resAppointment, TRESTRequestMethod.rmPOST); try request.ResourceSuffix := AAppointment.ID.ToString; // todo fix serialization TgoBsonSerializer.Serialize(AAppointment, jsonstring); jsonobject := TJSONObject.ParseJSONValue(jsonstring) as TJSONObject; request.ClearBody; request.AddBody(jsonobject); request.Execute; finally jsonobject.Free request.Free; end; end; Somebody a hint what i'm doing wrong?
-
TEndpointRequest, can not get body (json)
mvanrijnen replied to mvanrijnen's topic in Network, Cloud and Web
Problem solved itself after restarting Delphi and clear all dcu's from the build. strange but true. -
What ScriptEngine to choose ? DwScript, PascalScript, FastScript, TmsScripter, HtmlScripter
mvanrijnen replied to Rollo62's topic in FMX
maybe this is usable: https://blog.grijjy.com/2018/02/28/javascripting-with-duktape-for-delphi/ (those guys write pretty good code) -
Delphi’s TZipFile working on a stream
mvanrijnen replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Look out with the TZipFile class, there is a bug which causes empty zips when it gets too large (or you insert very big files) i posted a bug a few years ago. (i go search if it's fixed) can not find it, but problem is that it did execute normally without raising an exception, but you end(ed) up with an empty zip file. -
Delphi 10.3.3/10.4 IDE Editor on VMware speed issue
mvanrijnen replied to c0d3r's topic in Delphi IDE and APIs
So, where does this leave us? EMB did not test D10.4 on Vmware/HyperV guests? Or they did and just decided to bother us with this ? -
for a fact my first official programming classes where in COBOL 🙂 very long time ago.
-
Not read the whole thread, but this is my opinion. Delphi comes to me as a product for which you pay full price (a lot more then VisualStudio), with less capabilities/tooling, but the most painfull, it seems/looks like it is being developed as a opensource project with some projectmanagers and a varying dev team. They really should sit on their customers seat for a while and get a new perspective on how to go forward with Delphi. It's a wonderful language with enough possibilities, would be a shame if we would have to go look around for another dev platform if quality does not improve. At the moment it;s not future proof.
-
Hey guys, Installed D10.4 in a HyperV guest (Win10Pro, 16GBmem, 4 procs). We notice very slow Options dialogs now, takes more then 10seconds to open the Delphi->Tools->Options dialog, also the project options dialogs are very slow? More people with these complaints? Someone with a hint to better performance?
-
Why does GetIt require Delphi to restart so often?
mvanrijnen replied to David Schwartz's topic in General Help
Sometimes, it seems that with GetIt you just start an installer, and the rest is the same as if you downloaded the installer outside delphi. For this i think they need to restart Delphi, because otherwise adjustments in Paths etc will not be recognized in the running instance of delphi? -
Something whats bothering me a few months now, Is there anybody who knows how to best analyze your application for slow (eg non-indexed or wrong indexed queries), with most databases you can set some switches and they will be logged. With interbase i never found something like that, yes you can output some lowlevel data with firedac but it does not give a (fast) usable result. Anybody some tips, or some tooling for his?
-
Yes i know that one already, but thats realtime, not exactly what i'm looking for., thnx though.
-
TIP: How to preview any text file in File Explorer
mvanrijnen replied to Lars Fosdal's topic in Tips / Blogs / Tutorials / Videos
We are now expecting some handy tool ofcourse :) -
You RAD Studio 10.4 Sydney appreciated features and bug fixes
mvanrijnen replied to Wagner Landgraf's topic in General Help
I like the record initialziation/finalization, but i was working on something i can use it for, and got this: procedure THSNullableBooleanSerializer.Serialize(const AValue; const AWriter: IgoBsonBaseWriter); var jsonvalue : THSNullableBoolean absolute AValue; begin // do stuff end; [dcc32 Error] HESI.NullableTypes.pas(158): E2634 Declaring a managed record with absolute directive is not allowed hmz, to bad .... -
That or just find some information on how to access a LDAP server, AD is an extended LDAP server. (if you search delphi ldap activedirectory, you will find examples)
-
i mean v2 instead v1 sorry for that. I just see that the swagger def i use, has went to v3, work to do 🙂
-
I also for fun run the C# generator, on the swagger def i'm using, and the generated code is similar to that i generate in Delphi. You always will have: - your "data classes", with lists (arrays in my case). - A big class which implements all the various methods (gets, puts, deletes etc, this will be what your calling from your own client application - A base client class which does the "lowlevel" http /json etc stuff. C# is not that different from Delphi, i think they are very similar, they have the same designer "Anders Hejlsberg". It's only that the base code and libs of c# is far more extended then delphi ever will be now days. The partial classes in C# , mainly (as far a i have seen), is handy for seperating forms and there code.