Delphi Linux … create a background process… daemon service stay tuned https://chapmanworld.com/2017/04/05/creating-a-linux-daemon-service-in-delphi/ http://blog.paolorossi.net/2017/07/11/building-a-real-linux-daemon-with-delphi-part-1-2/ http://blog.paolorossi.net/2017/09/04/building-a-real-linux-daemon-with-delphi-part-2/
WebSocket è una tecnologia che permette un interazione bidirezionale tra server e client, mi direte, nulla di nuovo con una connessione socket degli anni 90 facevamo la stessa cosa. Vero!!! La cosa che però rende questa tecnologia molto vantaggiosa è che per prima cosa, implementa degli standard nei protocolli di trasmissione e fruizione dei dati…
Leggi tutto
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
// initialize cURL $ch = curl_init(); // set the URL of the remote resource to download curl_setopt($ch, CURLOPT_URL, 'http://www.site.com/index.html'); //set url as curl_init() parameter --> $ch = curl_init('http://www.site.com/index.html'); // required that no headers be downloaded curl_setopt($ch, CURLOPT_HEADER, 0); // prevent remote content from being passed to print curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // set the timeout to 10 seconds curl_setopt($ch, CURLOPT_TIMEOUT, 10); // run the call and save the result in a variable $output = curl_exec($ch); // close cURL curl_close($ch); |
Decode JSON object with an array value:
1 2 3 4 5 6 7 8 9 10 11 12 |
$jsonobj = '{"dataset":[{"field1":"hello","field2":0,"field3":1},{"field1":"hola","field2":2,"field3":3}]}'; $obj = json_decode($jsonobj); // it returns object $array_dataset = $obj->dataset; for ($i = 0; $i < count($array_dataset); $i++) { $singoloArray = $array_dataset[$i]; foreach($singoloArray as $field => $value) { echo $field . " => " . $value . "<br>"; } } |
Decode array of JSON object:
1 2 3 4 5 6 7 8 9 10 |
$jsonobj = '[{"field1":"hello","field2":0,"field3":1},{"field1":"hola","field2":2,"field3":3}]'; $obj = json_decode($jsonobj, true); // it returns array for ($i = 0; $i < count($obj); $i++) { $singoloArray = $obj[$i]; foreach($singoloArray as $field => $value) { echo $field . " => " . $value . "<br>"; } } |
Try this on https://3v4l.org/
Easy HTML editor with instant preview into TWebBrowser Component to use: – TSynedit – TSynHTMLSyn – TWebBrowser – TTimer (set Interval 1000) – TSplitter (set Align alLeft) Here the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
procedure TForm1.SynEdit1KeyPress(Sender: TObject; var Key: Char); begin Timer1.Enabled := True; end; procedure TForm1.Timer1Timer(Sender: TObject); var Doc: Variant; begin Timer1.Enabled := False; if not Assigned(WebBrowser1.Document) then WebBrowser1.Navigate('about:blank'); Doc := WebBrowser1.Document; Doc.Clear; Doc.Write(SynEdit1.Lines.Text); Doc.Close; end; |
What is FMX for Linux? FireMonkey for Linux, also known as FMXLinux, is an add-on component provided to Delphi and RAD Studio Enterprise and Architect edition customers via an exclusive OEM agreement with FMXLinux. FMXLinux provides capabilities for building GUI applications for Linux, extending RAD Studio’s (Delphi Edition) FireMonkey cross-platform framework. Starting with 10.3.1, the FireMonkey…
Leggi tutto