Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 08/14/23 in all areas

  1. Don't miss the talk our Grande Boss (aka Geoff) is just putting together. Join now, or live with the regret! 🙂 There are also plenty of other sessions, hope to see you there? https://learndelphi.org/coding-bootcamp-2023/ -- The NexusDB Team
  2. Renate Schaaf

    Project Bitmaps2Video on GitHub

    This is my video-project on GitHub: https://github.com/rmesch/Bitmaps2Video I am presenting it here, because it is useful as it is, but could use some ideas for improvement. Features: A Delphi-class to support encoding of a series of bitmaps and video clips to a video file Requires the ffmpeg-library and is intended as an easy to use interface to this library Versions for Win32/Win64 and a cross-platform version currently supporting Win32/Win64/Android32/Android64 Most popular file formats and codecs supported, more codecs contained in FFMpeg can be registered Rudimentary support for adding an audio-stream Demos for both versions, set up to compile and run "out of the box", as library files and support for their deployment to Android are included There are some problem areas though, the most important one in my opinion being threading issues with TBitmap under Android. For more see the readme and the demos. Critique, ideas, bug reports most welcome, maybe someone would even like to contribute, that would be delightful. There have been valuable contributions so far, but there are some areas which could use the input of an expert. Thanks for reading, Renate
  3. mvanrijnen

    Delphi Coding Boot Camp 2023

    i think that posting was not necessary, as our mailboxes are flooded with announcements of them.
  4. Roger Cigol

    Delphi Coding Boot Camp 2023

    Am I blowing my own trumpet too much to let people know that I am presenting "Introduction to XML Mapper" in this bootcamp today at 20:00 hrs UK time = 14:00 hrs USA CST ? If the answer is "yes" than I apologise
  5. mvanrijnen

    Some REST help please.

    Why could a POST not be a port of a REST API interface?
  6. Patrick PREMARTIN

    Some REST help please.

    Glad it's up and running. Don't hesitate to give a slap in my name to those people who make a REST API that isn't a REST API just because they use a POST.
  7. Hi, try this Query.ParamByName('Name').AsWideString := ... Regards
  8. Ian Branch

    Some REST help please.

    CRACKED IT!!!! As Patrick suggested, put the Json request into the Custom body. It didn't work for me the first time as I suspect I had the Json constructed wrong, and I still had Parameters in the RESTRequest. All sorted now. Now to actually create the App. 🙂 My thanks to all that contributed to my first foray into REST. Appreciated. Regards, Ian
  9. Uwe Raabe

    Some REST help please.

    IMHO the best way ist to use a dedicated class handling the parameters and place that in body: type TMyParam = class private FUserName: string; FSecret: string; FShortcode: string; FMsisdn: string; FMessage: string; public property Message: string read FMessage write FMessage; property Msisdn: string read FMsisdn write FMsisdn; property Secret: string read FSecret write FSecret; property Shortcode: string read FShortcode write FShortcode; property UserName: string read FUserName write FUserName; end; ... var myParam := TMyParam.Create; try myParam.UserName := 'email@email.com'; myParam.Secret :='password'; myParam.Shortcode := 'pacific bulkms'; myParam.Msisdn := '6799998122'; myParam.Message := 'Hello World'; RestRequest1.AddBody(myParam); finally myParam.Free; end;
  10. Lars Fosdal

    DCPCrypt v.2.0 - 64-bit?

    I decided to test switching one my 32-bit apps to 64-bit, to see how it would behave. It uses an encryption algorithm called TwoFish from an old encryption lib - DCPCrypt2 by David Barton- which seems to no longer be maintained, and to my dismay, the encryption failed with a access violation. Project ConsoleTest.exe raised exception class $C0000005 with message ‘c0000005 ACCESS_VIOLATION’. that was eaten by an exception handler in the lib - which presented a different error message EDCP_cipher: Unable to allocate sufficient memory for hash digest It fails on the first half of this expression in the code below; x[1]:= PDWord(longword(@InData)+4)^ xor SubKeys[INPUTWHITEN+1]; i.e. PDWord(longword(@InData)+4)^ Question: Longwords and DWords are supposedly the same in both 32-bit and 64-bit, so why does the pointer arithmetic fail in 64-bit? Below is the original method that works well in 32-bit, but blows up in 64-bit. In the DCPtwofish.pas unit: procedure TDCP_twofish.EncryptECB(const InData; var OutData); var i: longword; t0, t1: DWord; X: array[0..3] of DWord; begin if not fInitialized then raise EDCP_blockcipher.Create('Cipher not initialized'); x[0]:= PDWord(@InData)^ xor SubKeys[INPUTWHITEN]; x[1]:= PDWord(longword(@InData)+4)^ xor SubKeys[INPUTWHITEN+1]; // <- 64-bit Access Violation! x[2]:= PDWord(longword(@InData)+8)^ xor SubKeys[INPUTWHITEN+2]; x[3]:= PDWord(longword(@InData)+12)^ xor SubKeys[INPUTWHITEN+3]; i:= 0; while i<= NUMROUNDS-2 do begin t0:= sBox[0,(x[0] shl 1) and $1fe] xor sBox[0,((x[0] shr 7) and $1fe)+1] xor sBox[2,(x[0] shr 15) and $1fe] xor sBox[2,((x[0] shr 23) and $1fe)+1]; t1:= sBox[0,((x[1] shr 23) and $1fe)] xor sBox[0,((x[1] shl 1) and $1fe)+1] xor sBox[2,((x[1] shr 7) and $1fe)] xor sBox[2,((x[1] shr 15) and $1fe)+1]; x[3]:= (x[3] shl 1) or (x[3] shr 31); x[2]:= x[2] xor (t0 + t1 + SubKeys[ROUNDSUBKEYS+2*i]); x[3]:= x[3] xor (t0 + 2*t1 + SubKeys[ROUNDSUBKEYS+2*i+1]); x[2]:= (x[2] shr 1) or (x[2] shl 31); t0:= sBox[0,(x[2] shl 1) and $1fe] xor sBox[0,((x[2] shr 7) and $1fe)+1] xor sBox[2,((x[2] shr 15) and $1fe)] xor sBox[2,((x[2] shr 23) and $1fe)+1]; t1:= sBox[0,((x[3] shr 23) and $1fe)] xor sBox[0,((x[3] shl 1) and $1fe)+1] xor sBox[2,((x[3] shr 7) and $1fe)] xor sBox[2,((x[3] shr 15) and $1fe)+1]; x[1]:= (x[1] shl 1) or (x[1] shr 31); x[0]:= x[0] xor (t0 + t1 + SubKeys[ROUNDSUBKEYS+2*(i+1)]); x[1]:= x[1] xor (t0 + 2*t1 + SubKeys[ROUNDSUBKEYS+2*(i+1)+1]); x[0]:= (x[0] shr 1) or (x[0] shl 31); Inc(i,2); end; PDWord(longword(@OutData)+ 0)^:= x[2] xor SubKeys[OUTPUTWHITEN]; PDWord(longword(@OutData)+ 4)^:= x[3] xor SubKeys[OUTPUTWHITEN+1]; PDWord(longword(@OutData)+ 8)^:= x[0] xor SubKeys[OUTPUTWHITEN+2]; PDWord(longword(@OutData)+12)^:= x[1] xor SubKeys[OUTPUTWHITEN+3]; end; The answer came from a fellow developer elsewhere: It fails because pointers are not longwords in 64 bit and casting to longword clips the upper 32 bits, so the cast of a pointer to a longword is not the way to do it. Instead - the correct way would be to change the expression to PDWord(UIntPtr(@InData)+4)^ After some fiddling in the debugger, I thought - why not try a cleaner approach to the pointer casts, and this is what I came up with - and it works as intended in both 32-bit and 64-bit, without the explicit offset calculations. type ArrDWord = array[0..3] of DWord; pArrDWord = ^ArrDWord; procedure TDCP_twofish.EncryptECB(const InData; var OutData); var i: longword; t0, t1: DWord; X: array[0..3] of DWord; begin if not fInitialized then raise EDCP_blockcipher.Create('Cipher not initialized'); x[0]:= PArrDWord(@InData)[0] xor SubKeys[INPUTWHITEN]; x[1]:= PArrDWord(@InData)[1] xor SubKeys[INPUTWHITEN+1]; x[2]:= PArrDWord(@InData)[2] xor SubKeys[INPUTWHITEN+2]; x[3]:= PArrDWord(@InData)[3] xor SubKeys[INPUTWHITEN+3]; i:= 0; while i<= NUMROUNDS-2 do begin t0:= sBox[0,(x[0] shl 1) and $1fe] xor sBox[0,((x[0] shr 7) and $1fe)+1] xor sBox[2,(x[0] shr 15) and $1fe] xor sBox[2,((x[0] shr 23) and $1fe)+1]; t1:= sBox[0,((x[1] shr 23) and $1fe)] xor sBox[0,((x[1] shl 1) and $1fe)+1] xor sBox[2,((x[1] shr 7) and $1fe)] xor sBox[2,((x[1] shr 15) and $1fe)+1]; x[3]:= (x[3] shl 1) or (x[3] shr 31); x[2]:= x[2] xor (t0 + t1 + SubKeys[ROUNDSUBKEYS+2*i]); x[3]:= x[3] xor (t0 + 2*t1 + SubKeys[ROUNDSUBKEYS+2*i+1]); x[2]:= (x[2] shr 1) or (x[2] shl 31); t0:= sBox[0,(x[2] shl 1) and $1fe] xor sBox[0,((x[2] shr 7) and $1fe)+1] xor sBox[2,((x[2] shr 15) and $1fe)] xor sBox[2,((x[2] shr 23) and $1fe)+1]; t1:= sBox[0,((x[3] shr 23) and $1fe)] xor sBox[0,((x[3] shl 1) and $1fe)+1] xor sBox[2,((x[3] shr 7) and $1fe)] xor sBox[2,((x[3] shr 15) and $1fe)+1]; x[1]:= (x[1] shl 1) or (x[1] shr 31); x[0]:= x[0] xor (t0 + t1 + SubKeys[ROUNDSUBKEYS+2*(i+1)]); x[1]:= x[1] xor (t0 + 2*t1 + SubKeys[ROUNDSUBKEYS+2*(i+1)+1]); x[0]:= (x[0] shr 1) or (x[0] shl 31); Inc(i,2); end; PArrDWord(@OutData)[0] := x[2] xor SubKeys[OUTPUTWHITEN]; PArrDWord(@OutData)[1] := x[3] xor SubKeys[OUTPUTWHITEN+1]; PArrDWord(@OutData)[2] := x[0] xor SubKeys[OUTPUTWHITEN+2]; PArrDWord(@OutData)[3] := x[1] xor SubKeys[OUTPUTWHITEN+3]; end; Here is the test code: uses DCPtwofish, DCPsha1; const CRYPT_KEY = 'TheVØryBÆDSecretStr.ing'; function EncryptTwofish(const s: string; Key: string = CRYPT_KEY) : string; var Cipher : TDCP_twofish; begin Result:=''; Cipher := TDCP_twofish.Create(nil); try Cipher.InitStr(AnsiString(Key), TDCP_sha1); Result := string(Cipher.EncryptString(AnsiString(s))); finally Cipher.Free; end; end; procedure TestEncrypt; begin Writeln(EncryptTwoFish('Keep this text a secret')); end;
  11. aehimself

    Universal Firebird Server

    Short answer: never. Long answer: there are always code breaking changes in code or in protocols which will make older applications to be unable to communicate with never versions. This is why - if you really can not upgrade - we are using virtual machines with legacy OS-es hosting legacy applications. As ESXi is free you can also have your “museum” built this way but be aware that these legacy systems are usually extremely vulnerable to attacks in todays world.
  12. Remy Lebeau

    What makes code not to compile

    https://docwiki.embarcadero.com/RADStudio/en/E2217_Published_field_'%s'_not_a_class_or_interface_type_(Delphi)
  13. Vandrovnik

    What makes code not to compile

    It probably treats that section as published then: The compiler treats a published section like public unless RTTI is enabled with the $M or $TypeInfo compiler directives, or if the class inherits from a class with RTTI enabled. TPersistent in Delphi’s Classes unit enables published RTTI, so all persistent classes (including all components, controls, and forms) have RTTI. The initial, unnamed section is published for classes with RTTI.
  14. +1 for Wireguard. It is secure and simple. It is well-known, open source, and well-understood. There are countless tutorials on setting it up and using it. Unless you are going to get paid a lot of money and have some kind of contract that absolves you of liability, just don't. https://www.wireguard.com/
  15. You can start from RAS ... Jedi units RAS32 and JvRas32 encapsulate Windows api about RAS. In this way you can create your "client" VPN in Windows (I use it in Windows 7, hope that it works in new Windows version too). I had an example how to use it to create from "zero" a vpn connection with RAS many years ago. If I find it i will post here. For server I dont'know .... Bye
  16. Der schöne GĂŒnther

    Store a large number of images in the filesystem or in a DB?

    If you have no trouble identifying every item by filename alone, I'd personally go with the raw filesystem. Reason is that you can easily purge older files, add or remove content without going through your application which eventually have to be updated. Not sure about the type of app you're building, but sticking with raw files has often helped me so that a technician on site was easily able to "remove all garbage data from scanner 2 between 13:00 and 13:15" without me adding something like this to the application or editing a big database file. Also you can easily corrupt your sqlite database file with sudden power losses and stuff like this. If you set it up correctly then it doesn't happen, but I think the default settings of FireDAC have the journalling behaviour set up so that it is not robust against power losses. It's a mistake I have unfortunately made more than once. I think NTFS (or at least, Windows Explorer) starts having trouble after around 10.000 files in the same directory. You should definitely have some subfolders that also allow you to group/sort things easier. Like a folder for every new day or something like this.
  17. vfbb

    Colored Notification Icon

    Older versions supported multi-color icons (up to Android 6 or 7 if I'm not mistaken). From then on they are treated as mono color. Even if you have your multi-color icon, Android applies a color filter, with the AccentColor color (if the Use Accent Color is selected). When "Use Accent Color" is not selected, your icon will have the default color of the device's theme. Also, in the Android documentation it is stated that the icon should be white, but in practice there is no difference because Android will apply the color filter anyway. Just don't forget to delete your icon's background.
  18. programmerdelphi2k

    Colored Notification Icon

    @AlanScottAgain / @vfbb would be this... all icons should be "Opaque White" for all resolutions in Android / Options / Icons / Notifications: all your custom icons in all res = color: Opaque White <-- mandatory change the "Accent Color" for your choice you can create all XML file customized and add it manually in your "Deploy project menu" this files: colors.xml, splash_image_def.xml, strings.xml, styles.xml, styles-v21.xml is build after your "BUILD" command in IDE, then, just do it and copy for another place, do the changes, and add it your "Deploy" menu (before add new custom XML, uncheck old (default) files used by Delphi, of course) --> but this is not necessary at all... if you dont need any customization! NOTE: a "colors.xml" file has this content: (FF0000 = red in my choice) <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <color name="notification_accent_color">#FF0000</color> </resources>
  19. Lajos JuhĂĄsz

    How convert an android app into an i-phone app?

    I've tried Bing if I ask how to convert a Delphi application the anser is: Hello, this is Bing. I can help you with your question. blush There are different tools and methods to convert an Android app to an iOS app, depending on your requirements and preferences. One possible tool is MechDomehttps://www.devteam.space/blog/convert-android-app-to-ios/, which allows you to upload your compiled Android APK and select whether you want to create an iOS app for a simulator or a real iOS device. It will then convert your Android app to an iOS app very quicklyhttps://www.devteam.space/blog/convert-android-app-to-ios/. Another possible method is to use Kotlin Multiplatformhttps://kotlinlang.org/docs/multiplatform-mobile-integrate-in-existing-app.html, which is a language and a set of tools for creating cross-platform applications that work on both Android and iOS. You can use Kotlin Multiplatform to write your business logic once and reuse it for both platforms, while keeping the native UI for each platform. You can also use existing libraries and frameworks for both Android and iOS in your Kotlin codehttps://kotlinlang.org/docs/multiplatform-mobile-integrate-in-existing-app.html. A third possible method is to use Delphihttps://docwiki.embarcadero.com/RADStudio/Sydney/en/Mobile_Tutorial:_Creating_an_Application_for_Mobile_Platforms_%28iOS_and_Android%29, which is a programming language and an IDE that supports creating multi-device applications for Android and iOS. You can use Delphi to design your user interface with reusable components, write your code in Delphi or C++, and deploy your app to either platform with minimal changeshttps://docwiki.embarcadero.com/RADStudio/Sydney/en/Mobile_Tutorial:_Creating_an_Application_for_Mobile_Platforms_%28iOS_and_Android%29. These are some of the possible ways to convert an Android app to an iOS app, but there may be others depending on your specific needs and preferences. I hope this information was helpful to you. https://www.devteam.space/blog/convert-android-app-to-ios/ https://kotlinlang.org/docs/multiplatform-mobile-integrate-in-existing-app.html For the question how to convert an application in the answer it doesn't mention Delphi: Hello, this is Bing. I can help you with your question. blush There are different ways to convert an Android app to an iPhone app, depending on your requirements and preferences. One possible way is to use the Move to iOS apphttps://support.apple.com/en-au/HT201196, which helps you transfer your content from your Android device to your new iPhone, iPad, or iPod touch. You can transfer your contacts, message history, photos, videos, web bookmarks, mail accounts, calendars, and some of your appshttps://support.apple.com/en-au/HT201196. Another possible way is to use Kotlin Multiplatformhttps://kotlinlang.org/docs/multiplatform-mobile-integrate-in-existing-app.html, which is a language and a set of tools for creating cross-platform applications that work on both Android and iOS. You can use Kotlin Multiplatform to write your business logic once and reuse it for both platforms, while keeping the native UI for each platform. You can also use existing libraries and frameworks for both Android and iOS in your Kotlin codehttps://kotlinlang.org/docs/multiplatform-mobile-integrate-in-existing-app.html. A third possible way is to use MechDomehttps://www.devteam.space/blog/convert-android-app-to-ios/, which allows you to upload your compiled Android APK and select whether you want to create an iOS app for a simulator or a real iOS device. It will then convert your Android app to an iOS app very quicklyhttps://www.devteam.space/blog/convert-android-app-to-ios/. These are some of the possible ways to convert an Android app to an iPhone app, but there may be others depending on your specific needs and preferences. I hope this information was helpful to you. https://support.apple.com/en-au/HT201196 https://kotlinlang.org/docs/multiplatform-mobile-integrate-in-existing-app.html https://www.devteam.space/blog/convert-android-app-to-ios/
  20. Fr0sT.Brutal

    7zip (LZMA) compression

    https://github.com/ccy/lzmasdk/tree/57cdd679924d4dc2747a1cdbbe1134e277a9d28a/Delphi
  21. Yes: https://github.com/DelphiWorlds/Kastri/tree/master/Demos/AssetDelivery
  22. Marcello Mello

    Running .Net Standard Assembly

    aqui esta funcionando assim... DotNetCore.pas
  23. PingPIng

    [Souce code]

    Hello everybody, These are some projects I have created. I have very little time to manage them all continuously so if anyone wants to collaborate or want to make pull requests, they are welcome Keras4Delphi is a high-level neural networks API, written in Pascal(Delphi Rio 10.3) with Python Binding and capable of running on top of TensorFlow, CNTK, or Theano. Based on Keras.NET and Keras https://github.com/Pigrecos/Keras4Delphi Binary Code generator Written in pascal. It can generate native code for x86 and x64 architectures and supports the whole x86/x64 instruction set. Assembly Code Generator able to compile single File or Single asm Command. https://github.com/Pigrecos/D_CodeGen symbolic execution whith delphi. The Triton Dynamic Binary Analysis (DBA) framework - by JonathanSalwan binding (## experimental ##) for Delphi https://github.com/Pigrecos/Triton4Delphi Code Deobfuscator x86_32/64 Dead code removal Peephole optimization remove Multibranch Protection ..More https://github.com/Pigrecos/CodeDeobfuscator And other.... thanks a lot 😉
×