-
Content Count
343 -
Joined
-
Last visited
-
Days Won
4
Posts posted by shineworld
-
-
On the use of the community license, my advice is to be very careful about what you do.
I bring them my case.
At home, on my personal notebook I had installed the community version of Delphi, it was the Rio, to work on an open-source project, GLSCENE.
Since I have little time at home to develop I, unhappily, thought of taking advantage of the hour and a half of free time for lunch break I have at the office, to continue development on my personal notebook BUT attached to the company WIFI network to access the sources, do push and everything else.
Well after a month or so I got a tethered notification from Embarcadero, that according to their logs, Community sends logs of what files you compile, when you compile, what network and domain you are working on, my company was not using Community intebitually for application development while earning over 5000E. The email came directly to the company by going back to the company's internet domain data.
There was no way to make it clear, even after sending the project report I worked on, that it was not of company interest but personal, about it being my personal laptop, etc.
Moral of the story, they gave me a number of days to purchase the full Architect product (the most expensive formula) or legal action would start.
The company covered the cost, thankfully.
Be careful where you connect with terminals....
Since then never again a Community product and since I personally cannot buy Licensed products at those prices, I now participate in open-source projects with other environments and languages.
-
2
-
2
-
1
-
3
-
-
I will do surely.
At the moment, I'm re-installing by zero the uninstalled 10.4.1... I can't stop development, unfortunately! -
Unfortunately does not work 😞
I've started the update downloaded from Getit, which required a full uninstall to start.After full uninstall at the start of installation I got this message:
So I've lost my primary development tool...
Damn!
-
Hi all,
my subscription is expired but in GetIt Package Manager I notice that 10.4.2 Installer for earlier 10.4 Releases 1.0
Does it mean that regardless of the expired subscription program I can still upgrade the system from 10.4.1 to 10.4.2 ?
Before starting the installation and to avoid losing a still working development environment I ask for info from the experts.
Thanks
-
Mmmmm.... seems that Canvas.FillText can't be used...
I'm not a guru on Python and DelphiFMX so I can mistake in anything but debugging:
>>> import DelphiFMX as fmx >>> img = fmx.Image(None) >>> bmp = img.Bitmap >>> bmp.Handle >>> bmp.Width = 200 >>> bmp.Height = 200 >>> c = bmp.Canvas >>> r = fmx.RectF(0,0,10,10) >>> c.FillText(r, 'hello', True, 1, [], ['Center'], ['Center'])
the FindMethod "find" FillRect and first ARect parameter in FMX is a Record when
Python call to c.FillText manages R as a class so the arguments check stops at the first argument with an error.Waiting for GURU info 🙂
-
Seems TTextAlign is not available in DelphiFMX library :
Microsoft Windows [Versione 10.0.19045.2965]
(c) Microsoft Corporation. Tutti i diritti sono riservati.P:\>pip list
Package Version
---------------------- ------------
delphifmx 1.0.6NameError: name 'TTextAlign' is not definedTraceback (most recent call last):
File "D:\x\develop\qem\cnc_api_client_core_1\python\api_client_fmx_demo\api_client_fmx_demo_desktop_view.py", line 692, in __on_timer_update
canvas.FillText(r, 'hello world', False, 1, [], TTextAlign.Center, TTextAlign.Center)
^^^^^^^^^^
NameError: name 'TTextAlign' is not defined*** Remote Interpreter Reinitialized *** >>> import delphifmx as fmx >>> dir(fmx) ['Abort', 'Action', 'ActionList', 'AdapterListView', 'AniIndicator', 'AppearanceListView', 'Application', 'Arc', 'ArcDial', 'BaseBindScopeComponent', 'BaseLinkingBindSource', 'BaseObjectBindSource', 'BaseValueRange', 'BasicAction', 'BasicBindComponent', 'BindComponentDelegate', 'BindingsList', 'BitmapTrackBar', 'Bounds', 'BufferedFileStream', 'BufferedLayout', 'Button', 'BytesStream', 'Calendar', 'CalloutPanel', 'CalloutRectangle', 'CameraComponent', 'CaretRectangle', 'CheckBox', 'CheckColumn', 'Circle', 'Collection', 'ColorBox', 'ColorButton', 'ColorComboBox', 'ColorListBox', 'ColorPanel', 'ColorPicker', 'ColorQuad', 'Column', 'ComboBox', 'ComboColorBox', 'ComboEdit', 'ComboEditBase', 'CommonCustomForm', 'Component', 'ContainedAction', 'ContainedActionList', 'ContainedBindComponent', 'Control', 'ControlSize', 'CornerButton', 'CreateComponent', 'CurrencyColumn', 'CustomAction', 'CustomActionList', 'CustomBindingsList', 'CustomBufferedLayout', 'CustomButton', 'CustomCalendar', 'CustomColorComboBox', 'CustomComboBox', 'CustomComboEdit', 'CustomControlAction', 'CustomCornerButton', 'CustomDateEdit', 'CustomDateTimeEdit', 'CustomEdit', 'CustomEditBox', 'CustomForm', 'CustomGrid', 'CustomLinkControlToField', 'CustomLinkListControlToField', 'CustomLinkPropertyToField', 'CustomListBox', 'CustomListView', 'CustomMediaCodec', 'CustomMediaPlayerAction', 'CustomMemo', 'CustomMemoryStream', 'CustomMultiView', 'CustomNumberColumn', 'CustomPath', 'CustomPopupForm', 'CustomPopupMenu', 'CustomPresentedFramedScrollBox', 'CustomPresentedFramedVertScrollBox', 'CustomPresentedHorzScrollBox', 'CustomPresentedScrollBox', 'CustomPresentedVertScrollBox', 'CustomPrototypeBindSource', 'CustomScrollBox', 'CustomSwitch', 'CustomTimeEdit', 'CustomTrack', 'CustomValueRange', 'CustomValueRangeAction', 'CustomViewAction', 'DateColumn', 'DateEdit', 'DateTimeColumn', 'DateTimeColumnBase', 'DelphiDefaultContainer', 'DelphiDefaultIterator', 'DelphiMethod', 'DialogService', 'Edit', 'Ellipse', 'Expander', 'ExpanderButton', 'FMXBindNavigateAction', 'FMXBindNavigateApplyUpdates', 'FMXBindNavigateCancel', 'FMXBindNavigateCancelUpdates', 'FMXBindNavigateDelete', 'FMXBindNavigateEdit', 'FMXBindNavigateFirst', 'FMXBindNavigateInsert', 'FMXBindNavigateLast', 'FMXBindNavigateNext', 'FMXBindNavigatePost', 'FMXBindNavigatePrior', 'FMXBindNavigateRefresh', 'FileExit', 'FileHideApp', 'FileHideAppOthers', 'FileStream', 'FloatColumn', 'FlowLayout', 'FmxObject', 'Form', 'Frame', 'FramedScrollBox', 'FramedVertScrollBox', 'GetProcessDpiAwareness', 'GlyphColumn', 'GradientEdit', 'Grid', 'GridLayout', 'GridPanelLayout', 'GroupBox', 'HandleStream', 'HintAction', 'HorzScrollBox', 'IDABORT', 'IDCANCEL', 'IDCLOSE', 'IDCONTINUE', 'IDHELP', 'IDIGNORE', 'IDNO', 'IDOK', 'IDRETRY', 'IDTRYAGAIN', 'IDYES', 'Image', 'ImageColumn', 'ImageControl', 'IntegerColumn', 'IsDpiAware', 'Label', 'Layout', 'Line', 'LinkControlDelegate', 'LinkControlToField', 'LinkControlToFieldDelegate', 'LinkListControlToField', 'LinkPropertyToField', 'LinkPropertyToFieldDelegate', 'ListBox', 'ListBoxItem', 'ListView', 'ListViewBase', 'MB_ABORTRETRYIGNORE', 'MB_APPLMODAL', 'MB_DEFBUTTON1', 'MB_DEFBUTTON2', 'MB_DEFBUTTON3', 'MB_DEFBUTTON4', 'MB_HELP', 'MB_ICONASTERISK', 'MB_ICONERROR', 'MB_ICONEXCLAMATION', 'MB_ICONHAND', 'MB_ICONINFORMATION', 'MB_ICONQUESTION', 'MB_ICONSTOP', 'MB_ICONWARNING', 'MB_NOFOCUS', 'MB_OK', 'MB_OKCANCEL', 'MB_RETRYCANCEL', 'MB_SYSTEMMODAL', 'MB_TASKMODAL', 'MB_YESNO', 'MB_YESNOCANCEL', 'MainMenu', 'Media', 'MediaPlayer', 'MediaPlayerControl', 'MediaPlayerCurrentTime', 'MediaPlayerPlayPause', 'MediaPlayerStart', 'MediaPlayerStop', 'MediaPlayerValue', 'MediaPlayerVolume', 'Memo', 'MemoryStream', 'MenuBar', 'MenuItem', 'MultiView', 'NumberBox', 'Object', 'ObjectViewAction', 'OpenDialog', 'PaintBox', 'Panel', 'PascalInterface', 'PascalRecord', 'Path', 'PathLabel', 'Persistent', 'Pie', 'Point', 'PointF', 'Popup', 'PopupColumn', 'PopupMenu', 'Position', 'PresentedFramedScrollBox', 'PresentedFramedVertScrollBox', 'PresentedHorzScrollBox', 'PresentedListView', 'PresentedScrollBox', 'PresentedTextControl', 'PresentedVertScrollBox', 'ProgressBar', 'ProgressColumn', 'PrototypeBindSource', 'RadioButton', 'Rect', 'RectF', 'Rectangle', 'ResourceStream', 'RoundRect', 'SaveDialog', 'ScaledLayout', 'Screen', 'ScrollBar', 'ScrollBox', 'SearchBox', 'Selection', 'SelectionPoint', 'SetHighDpiAware', 'SetProcessDpiAwareness', 'Shape', 'Size', 'SizeF', 'SizeGrip', 'SmallScrollBar', 'SpeedButton', 'SpinBox', 'Splitter', 'StatusBar', 'Stream', 'StringColumn', 'StringGrid', 'StringStream', 'Strings', 'StyleBook', 'StyleManager', 'StyleStreaming', 'StyledControl', 'Switch', 'SysCommonAction', 'TabControl', 'TabItem', 'Text', 'TextControl', 'Thumb', 'TimeColumn', 'TimeEdit', 'Timer', 'ToolBar', 'Touch', 'Track', 'TrackBar', 'ValueRange', 'ValueRangeAction', 'VarParameter', 'VertScrollBox', 'ViewAction', 'VirtualKeyboard', 'WindowClose', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'crAppStart', 'crArrow', 'crCross', 'crDefault', 'crDrag', 'crHSplit', 'crHandPoint', 'crHelp', 'crHourGlass', 'crIBeam', 'crMultiDrag', 'crNo', 'crNoDrop', 'crNone', 'crSQLWait', 'crSize', 'crSizeAll', 'crSizeNESW', 'crSizeNS', 'crSizeNWSE', 'crSizeWE', 'crUpArrow', 'crVSplit', 'fmCreate', 'fmOpenRead', 'fmOpenReadWrite', 'fmOpenWrite', 'fmShareCompat', 'fmShareDenyNone', 'fmShareDenyRead', 'fmShareDenyWrite', 'fmShareExclusive', 'ssAlt', 'ssCtrl', 'ssDouble', 'ssLeft', 'ssMiddle', 'ssRight', 'ssShift'] >>>
-
OK Bitmap can be modified not, but I was not able to find how to use TCanvas.FillText with Python DelphiFMX.
Any try to pass arguments give me:
Traceback (most recent call last):
File "D:\x\develop\qem\cnc_api_client_core_1\python\api_client_fmx_demo\api_client_fmx_demo_desktop_view.py", line 690, in __on_timer_update
canvas.FillText(r, 'hello world', False, 100.0, None, 'Center', 'Center')
TypeError: "FillText" called with invalid arguments.# update tab digital inputs/outputs values if self.TabControl.ActiveTab == self.TabDIO: bitmap = self.DIOImage.Bitmap bitmap.Width = int(self.DIOImage.Width) bitmap.Height = int(self.DIOImage.Height) bitmap.Clear(0xFF000000) canvas = bitmap.Canvas r = RectF(8 + 15, 10, bitmap.Width - 8, bitmap.Height - 10) # from delphi FMX documentation # procedure FillText( # const ARect: TRectF; # const AText: string; # const WordWrap: Boolean; # const AOpacity: Single; # const Flags: TFillTextFlags; # const ATextAlign: TTextAlign; # const AVTextAlign: TTextAlign = TTextAlign.Center # ); virtual; canvas.FillText(r, 'hello world', False, 100.0, None, 'Center', 'Center')
-
Hi all.
There is a way to modify Bitmap contents (actually create content) of a DelphiFMX Image.Bitmap to add a text ?
I've tried:bitmap = self.DIOImage.Bitmap bitmap.Width = int(self.DIOImage.Width) bitmap.Height = int(self.DIOImage.Height) bitmap.Clear(0xFF000000) canvas = bitmap.Canvas r = RectF(8 + 15, 10, bitmap.Width - 8, bitmap.Height - 10) ??? canvas.FillText(r, 'Hello World', False, 100, 0, 0, 0) ???
But the image remains EMPTY and doesn't show anything...
-
13 hours ago, gidesa said:Anyway, I could download to github the 32 bit versions of Opencv DLL.
This can help because I was able to find and download ONLY OpenCV DLL for 64-bits.
-
I was not able to run pre-made samples.
They are 32-bit not 64-bit and library README.MD say that only 64-bit are possibile.I've tried to activate 64-bit platform in samples project but only 32-bit it is possible.
-
In the company, when we switched from SVN to GIT, it was hard, initially just using console commands.
Then we started using TortoiseGIT and a way opened up.
Everything runs smoothly.
Collaborative work got easier, like tracking changes, versions, etc.
At this point, I honestly don't regret SVN at all... -
15 hours ago, JGMS said:Hi SwiftExpat,
I created a folder with an embedded python 3.11 version in it, and installed all required libraries for my projects. Now my Delphi application(s) all have "PythonEngine1.DllPath" set to this "embedded folder".
I installed the libraries from within with the "Scripts" subfolder using commands like ".\pip install opencv-contrib-python --no-warn-script-location".
The command "python -m pip list -v" still returns the list of the libraries in the 3.10 system, though. Likely, that is due to the system's environment path setting, in where there is (and, I bet, should be) no entry added for the embedded version. I can live with that.
Next, I compressed everthing in a zip file "Python.zip", with the intention to unpack this as "3.11" aside the executable on other machines, using Inno Setup.
I can probably manage that, but after installation on the target machine the DLLPath should first be redirected to subfolder "3.11" in the path of the executable. On this one I am stuck.
Do you have tips to achieve this path change? Or do you have helpful comments on the approach I described?Take care:
You can have a Python embed version OUT of path which works but if you have the same version of Python installed normally
your embedded version pip list will reach ALSO a cached path (from the normally installed Python version) in %APPDATA%\Python\Python<version>\site-packages.
This does not overload your native Python embed local packages, just add others to pip visibility. -
Win11/Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz Max 1.99 GHz (Max limited because a notebook)/4-cores/8-threads/16GB/RAD10.4/Release/<below data>
D:\spritz_bench>spritz_bench.exe spritz prng: 149.50 MiB/s D:\spritz_bench>spritz_bench.64.exe spritz prng: 191.12 MiB/s
-
1 hour ago, David Heffernan said:Potrebbe essere lanciato per lo sviluppo, ma il codice prodotto dai compilatori Delphi è lento
I wrote "it's fast" not "it's the fastest".
In some things it is the same as C++, in others, it is slightly slower but not as bad.
I work on very large projects, the last one being about 19 million lines of code, where there is a lot of math and UI.
I don't regret C++, I've tried translating parts from Delphi to Visual Studio C++ and then embedded as a DLL with no significant gains,
but resulting in longer development times and adding debugging difficulties.I use C and C++ a lot in the linux environment for embedded boards in ARM architecture, even if I have never seriously dealt with the freepascal counterpart, as in that environment you would navigate by sight.
-
you can't compare Python vs Delphi but think of Python with Delphi 🙂
-
Delphi is not DEAD is a very very OOP-powerful language.
It is fast.
It is simple and concise.
It is robust and safe.
It is productive (few lines of code compared to C++, Java, etc).
If completely customizable, you can modify any unit of any library (with sources) to do customized things.
Projects code has high longevity (I've moved old projects of 2007 to the latest versions with very few changes).
Support many platforms (I will hope in the future full direct support of Linux also for arm processors).
Long life to the Delphi! -
For me the better solution is
1. To use Python on Delphi, to access the immense packages library of Python overall in math things.2. Use Delphi to create new very fast modules, and packages, for Python, for example to move threaded things on Delphi where Python thread are very funny.
3. Use Delphi VCL/FMX to create robust Python UI and programs.
Delphi compiled code is one of more fast in the market.
Python covers a lot of scientific fields.
Use either and you will be a winner.
-
3 minutes ago, David Heffernan said:Considera un grande dizionario con, per amor di discussione, 1 milione di voci al suo interno. Supponiamo che in Python tu voglia scrivere
valore = foo[nome]
Ora, se foo fosse effettivamente nel tuo codice Delphi e supportato da un dizionario Delphi, vuoi davvero popolare un nuovo dict Python con 1 milione di elementi, quindi esegui la ricerca in Python e poi butta via quel dizionario. Non sarebbe meglio chiedere a Delphi di eseguire la ricerca. Questo è ciò che intendo di ciò che parlo del protocollo di mappatura.
Ma è del tutto possibile che io abbia frainteso ciò che realmente vuoi fare!
Ah ok, I completely misrepresented your previous sugestions.
So it would make more sense to do a normal GetPath(name) method that returns the value instead of returning a dictionary with all the variables 🙂
It makes sense
Thanks for the suggestion -
In other projects, I've used the automatic conversion of Delphi classes to related Python wrapper classes.
In this project, I would like manually create the python module classes using low-level python implementation.
Looking at P4D WrapFireDac.pas code I saw a way to manually create a dictionary.
Seems to work but is hard to know when to apply Py_XDecRef....function TPyCNCCore.GetPaths(AContext: Pointer): PPyObject; var Key: PPyObject; Value: PPyObject; PathsDict: PPyObject; Engine: TPythonEngine; procedure AddItem(const K, V: string); begin Key := Engine.VariantAsPyObject(Variant(K)); Value := Engine.VariantAsPyObject(Variant(V)); Engine.PyDict_SetItem(PathsDict, Key, Value); Engine.Py_XDecRef(Key); Engine.Py_XDecRef(Value); end; begin Adjust(@Self); Engine := GetPythonEngine; PathsDict := Engine.PyDict_New; AddItem('MachineBackupPath', Self.FCNCManager.MachineBackupPath); AddItem('MachineCustomizePath', Self.FCNCManager.MachineCustomizePath); AddItem('MachineMacrosPath', Self.FCNCManager.MachineMacrosPath); AddItem('MachineMediaPath', Self.FCNCManager.MachineMediaPath); AddItem('MachinePath', Self.FCNCManager.MachinePath); AddItem('MachineRunPath', Self.FCNCManager.MachineRunPath); AddItem('MachineVmPath', Self.FCNCManager.MachineVmPath); AddItem('SamplesPath', Self.FCNCManager.SamplesPath); AddItem('UserDataPath', Self.FCNCManager.UserDataPath); Result := PathsDict; end;
I don't know if this is the right way to 'return' a dict in a getter method..
In my ignorance of the subject, I am navigating by sight.
Should be cool a direct way to convert a TDictionary to Python dict. -
Hi all,
I would like to add, to a python4delphi module, a getter method which return a 'dict'.
For example:
> import pycnccore1 as pyc
>cnc_core = pyc.CNCCore()
>print(cnc_core.paths)
{'user_path': 'c:\\xyz', 'machine_path': 'd:\\machine_test', and so on}
I don't know how to create a Delphi type to contain the dictionary and convert it to a Python dict as a result of the getter method.
function TPyCNCCore.GetPaths(AContext: Pointer): PPyObject; begin Adjust(@Self); var PathDict: <i_do_not_know>; PathDict.Append('user_path', Self.UserPathString); PathDict.Append('machine_path', Self.MachinePathString); ... and so on ... Result := GetPythonEngine.VariantAsPyObject(PathDict); end; class procedure TPyCNCCore.RegisterGetSets(PythonType: TPythonType); begin inherited; with PythonType do begin PythonType.AddGetSet('paths', @TPyCNCCore.GetPaths, nil, 'Returns the used paths', nil); end; end;
Thanks in advance for your suggestions
Silverio -
Check also https://www.tmssoftware.com/site/blog.asp?post=1091
or import Adobe Reader ActiveX:
Just 1 minutes to integrate Reader in an empty delphi application
-
To propagate open-source state, on an inherited library, project must be under LGPL.
-
34 minutes ago, Fr0sT.Brutal said:You're able to modify clients? If yes, use TLS and check certificates of both server (at client side) and client (at server side), ensure certificate corresponds to server host and, for the maximum security, add auth by login-password
I will try to learn how to add TLS in TIdTCPServer and TIdTCPClient 🙂
-
1
-
-
1 hour ago, mjustin said:To clarify: you are looking for protection against malicious clients, and the server is not a concern?
The API Server (based on TCP/IP JSON requests) permits commands as {"cmd":"start.axis.movement"} so a TCP/IP client can connect to API Server,
ask for an axis motor to start. At moment any TCP/IP client, eg: Telnet, can ask for an API Server connection and is not safe for machine operator.
I would like to permit connection ONLY on trusted client applications (I my case a python program or a Delphi program which run in office).
And I would like that client/api messages are crypted during transport so none can intercept and learn what commands are used.
I can crypt/decript JSON messages to obfuscate them using for eg: bluefish or similar but I can't avoid a not trusted/client connection.
Community license
in Delphi IDE and APIs
Posted
Your argument lines up right doesn't make a dent.
In fact, beyond describing the reasons, we went no further and paid what was due.
At the company there are no constraints on what one does in one's free time between lunch breaks, and the company has been favorably disposed to those who devote that time to opensource projects that do not conflict with company business, so I have never had a problem collaborating with the Linux project (support embeded boards), or .net-based projects.
At the end of it all, I left the open world of Delphi and devote myself to other projects with Linux, FreePascal and .NET.