A DHCP server listen on a network interface (e.g: eth0)
$ cat /etc/default/isc-dhcp-server
INTERFACESv4="eth0"
INTERFACESv6=""| version: '2.4' | |
| services: | |
| dns: | |
| image: estreamsoftware/coredns-forward | |
| restart: always | |
| networks: | |
| default: | |
| ipv4_address: 10.10.50.255 |
A long running task may cause the application runtime become unresponsive and lead perception of application halt or hang during the operation.
For example:
| procedure AlignHorzCenter(aControls: array of TfrxView); | |
| var i: Integer; | |
| iTotalWidth, iLeft: Extended; | |
| CalcWidths: array of Extended; | |
| Gaps: array of Extended; | |
| begin | |
| if not Engine.FinalPass then Exit; | |
| if Length(aControls) = 0 then Exit; | |
| // Calculate actual width of controls |
| uses System.Messaging, FMX.Platform; | |
| var FId: Integer; | |
| // Subscribe to TOrientationChangedMessage | |
| FId := TMessageManager.DefaultManager.SubscribeToMessage(TOrientationChangedMessage, DoOrientationChanged); | |
| // Write orientation change handler: | |
| procedure TMyForm.DoOrientationChanged(const Sender: TObject; const M: TMessage); | |
| var s: IFMXScreenService; |
| uses Patterns.Singleton.Generic; | |
| var o1, o2: TSingleton<TStringList>; | |
| s1, s2, s3: string; | |
| begin | |
| o1.Get.AddStrings(['a1', 'a2']); | |
| s1 := o1.Get.Text; // return "a1<cr,lf>a2" | |
| s2 := o2.Get.Text; // return "a1<cr,lf>a2" | |
| s3 := TSingleton<TStringList>.Get.Text; // // return "a1<cr,lf>a2" |
| uses | |
| System.SysUtils, | |
| Winapi.Windows, | |
| Winapi.IpTypes, | |
| Winapi.IpHlpApi; | |
| var | |
| Adapter, Current: PIP_ADAPTER_ADDRESSES; | |
| Buffer: NativeInt; | |
| Error: DWord; |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| procedure UpdateExeResource(Const Source,Dest:string); | |
| var | |
| Stream : TFileStream; | |
| hDestRes : THANDLE; | |
| lpData : Pointer; | |
| cbData : DWORD; | |
| begin | |
| Stream := TFileStream.Create(Source,fmOpenRead or fmShareDenyNone); | |
| try | |
| Stream.Seek(0, soFromBeginning); |
| uses Winapi.ShellAPI; | |
| function GetIconByFileExt(aFileExt: string): TBytes; | |
| var C: TIcon; | |
| N: SHFILEINFO; | |
| S: TBytesStream; | |
| begin | |
| C := TIcon.Create; | |
| try | |
| Win32Check(Succeeded( |