This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TThread.CreateAnonymousThread(procedure () | |
var | |
I: Integer; | |
begin | |
TThread.Synchronize(nil, | |
procedure | |
begin | |
{ Update UI components at begining } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
rabbitmqqtt: | |
build: rabbitmq/ | |
ports: | |
- "5672:5672" # AMQP port | |
- "1883:1883" # MQTT port | |
- "15672:15672" # Management UI port | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use the official RabbitMQ image as the base image | |
FROM rabbitmq:latest | |
# Set environment variables for configuration | |
ENV RABBITMQ_DEFAULT_USER=utest | |
ENV RABBITMQ_DEFAULT_PASS=test1234 | |
# Add labels for better maintainability | |
LABEL version="1.0" | |
LABEL description="Dockerfile for running RabbitMQ" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit AsyncThread; | |
interface | |
uses | |
{Delphi} | |
System.SysUtils | |
{Project} | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit PlatformColorMode; | |
interface | |
uses | |
FMX.Platform | |
{$IFDEF MSWINDOWS} | |
, System.SysUtils, System.Win.Registry, Winapi.Windows | |
{$ENDIF} | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure TFrmMain.OnPyModuleLoad(Sender: TObject); | |
begin | |
with Sender as TPythonModule do | |
begin | |
AddDelphiMethod( 'printme', | |
ConsoleModule_Print, | |
'printme(handle,val1,val2,val3)'); | |
end; | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function TFrmMain.ConsoleModule_Print( pself, args : PPyObject ) : PPyObject; cdecl; | |
var | |
pprint: NativeInt; | |
val1: Integer; | |
val2: Single; | |
val3: PAnsiChar; | |
begin | |
with GetPythonEngine do | |
begin | |
if (PyErr_Occurred() = nil) and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PythonModule1 import printme | |
def print_data(handle): | |
print('starting script...') | |
for i in range(10000): | |
print(i) | |
val1 = 2.5 + i | |
val2 = 'this is the iteration number ' + str(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_app(): | |
settings = dict( | |
cookie_secret=str(os.urandom(45)), | |
template_path=os.path.join(os.path.dirname(__file__), "templates"), | |
static_path=os.path.join(os.path.dirname(__file__), "static"), | |
default_handler_class=ErrorHandler, | |
default_handler_args=dict(status_code=404) | |
) | |
return tornado.web.Application([ | |
(r"/", StatusHandler), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StatusHandler(BaseHandler): | |
async def get(self): | |
self.set_status(200) | |
self.write({'message': 'File upload REST API working as expected'}) | |
self.finish() | |
class UploadHandler(BaseHandler): | |
async def get(self): | |
return self.render('uploads.html') |
NewerOlder