Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/25/24 in all areas

  1. The blog post recently got an update: https://blogs.embarcadero.com/we-are-experiencing-a-hardware-outage/
  2. We had the same issue last year, ordered a server in July, turned up in November. At least in our case, this was an upgrade not an emergency replacement. I have to agree - how hard is it to spin up a tempory vm on a cloud service - I suspect there is more to the story but we will probably never know.
  3. DelphiUdIT

    Athens Skia TSkPaintBox error in compile

    TRectF is declared in "System.Types"
  4. Sorry, I think this topic should now be closed. He is going around in circles installing random packages not designed for his compiler, then wasting our time repeatedly asking why they don't work. And ignoring all our efforts to install ICS properly. He needs professional help, but this is not the correct place. I will no longer be responding. Angus
  5. uses VarPyth; ... var Res, S: string; PythonEngine1.ExecStrings(sl); Res := MainModule.Parser(S); It would help to watch the tutorial videos and play with the Demos.
  6. This may be what you're after: https://github.com/synopse/mORMot/blob/master/SynCrtSock.pas
  7. Remy Lebeau

    Testing a Semaphore??

    Unfortunately, that does not work. The LastError property is set only if THandleObject.Wait() fails with an OS error. If a creation or acquisition/release fails, an exception is raised instead. If a creation succeeds with a non-zero error code, the LastError property is not set to reflect that. I have now opened a ticket for that feature: RSP-44312: THandleObject.LastError should be set during object creation
  8. Yeah. I could maybe forgive them their general incompetence as it's probably caused by a lack of resources - but that lie is just insulting.
  9. Meanwhile I managed to send email using MS Graph API. The example project with full source code is described here: Microsoft identity platform and OAuth 2.0 authorization code flow example for Daraja HTTP Framework The Authorization Code Flow with Proof Key for Code Exchange (PKCE) is a recommended OAuth 2.0 flow for native apps. No client secret is required in this flow. Instead, a secret is created by the calling application that can be verified by the authorization server. The example application requests an authorization code, redeems the code for an access token, and then calls the Microsoft Graph API to retrieve user profile data, and to send an email on behalf of the signed-in user. It may be a starting point for a ICS based application.
  10. Please read my previous message again. Do not attach screen shots and copies of our files to these messages. Even your text file named errors has no error information, just more source code. If you want support, you need to report the actual compiler errors, not just send copies of code I wrote back to us. Angus
  11. @dan27125 I commented earlier on your same question on StackOverflow: https://stackoverflow.com/questions/77868076/collect-json-ajax-data-from-a-local-zigbee-web-server Now that I see this post, the StackOverflow post appears to be a direct copy/paste of this post? That would explain why it mentions "Attached is ajax.xml, debug.html" without actually providing those files. It is generally frowned upon by internet etiquette to post the same question in multiple forums at the same time. It shows a lack of patience on your part, and a disrespect for people who might take time out of their day to answer. That being said, now that I see the relevant data files are on this post and not the StackOverflow post, I can fill in some gaps from my StackOverflow comment. The HTML is running a client-side JavaScript that uses a timer to invoke the browser's built-in AJAX client at regular intervals to send an HTTP request to download the XML file, parse the XML, and inject the results into the HTML elements using the browser's DOM. There is no streaming involved at all, each data update is an independent HTTP request. In C++Builder, you would simply do the same thing. Run a timer that uses any HTTP client you want (TIdHTTP, T(Net)HTTPClient, libcurl, etc) to download the XML from the appropriate URL, and then you can use any XML library, such as (T|I)XMLDocument, to parse the XML and do what you need with the data values.
  12. No that would be pointless - restore from backup onto temp server.
  13. And then what? What will be served? The default apache landing page?
  14. Due to the supply chain disturbances, we had a 5 month delivery wait for servers and parts for a while, so I can relate to delays. The problems here are: - Lack of proper communication. "No news. Next update at ..." is better than silence! - Insufficient contingency planning? - Insufficient backup and recovery plans? - No plan B? There are many capable cloud hosting services that doesn't take forever to spin up a pack of servers. The cost might be high, sure - but so is the cost of losing the trust of your customers.
  15. Stefan Glienke

    Upgrade from Spring4d 1.2 to Spring4d 2.0

    Do you mean this? https://bitbucket.org/sglienke/spring4d/wiki/Spring4D 2.0 Releasenotes (I think they are not linked from the readme thus easy to miss - I will fix that shortly)
  16. The problem with that approach is that you may not get a decoding error, so you wouldn't really know which encoding "works" right away. You might just end up with garbage when reading data. And what do you consider to be "valid"? Because different formats can produce results without errors, but just won't be what you are expecting. Can you parse the string first to make an educated guess about its likely format before you then try to decode it as a TDateTime? Yes, and more than that, its the BOM for UTF-16LE specifically. So you can use TEncoding.Unicode when loading the file. Actually, internally TMemIniFile reads the file into a TStringList first before parsing it, and TStringList is smart enough to look for a BOM when no TEncoding is specified, so in theory TMemIniFile should be able to load your file in the correct encoding provided a BOM is always present and TMemIniFile.Encoding is nil. However... The file you have provided has a UTF-8 BOM, not a UTF-16 BOM. So your example code would need to use TEncoding.UTF8 instead of TEncoding.Unicode (or, don't specify the encoding at all and let TMemIniFile figure it out for you).
  17. Tired of creating the descendants of TActiveRecord by hand? GitHub MVC_AR_EntityGenerator is an OpenSource project developed in Delphi XE 12 that takes the metadata of your Database and creates one class ActiveRecord of each Table in the Database. You can generate the AR of one table or one AR class for each table in the Database. You can indicate in which folder the AR file should be deployed, and the program will remember it. Each AR is generated in an independent .pas file. And this is only the Beta version. You save all the information used to generate the AR; when you need to develop it again, you only need to use it. In the next version, we plan to implement more types of AR, like, for example, AR with a Master-Detail Relationship. In the current version, you can change the name of the Class generated. This is useful when you want, for example, the AR class representing one member of the entity Customers, instead of being named TCustomers, to be named TCustomer; that is more accurate. I want to implement, too, a connection with the AI (probably Chat-GPT) to ask directly for the translation of the plural table names to singular class names. In this target, I want the AI to modify the table name to respect the Camel Style of Pascal Class names. For example, a table named Items_Owned_by_user is currently created as TItemsownedbyuser. The AI can easily convert this to TItemsOwnedByUser, which is more accurate to the style of Pascal code. And many more things can be made with an open-source project. Do you don't think it!! Try it, and let us know what you think! Thanks PD: The project is also an excellent example of using SQLite as a memory store for the data and treating this data as a standalone project, in contrast to the concept of a Database on Disk, which is more current in Delphi.
  18. I use a similar approach as aehimself for Window programs with an addition I saw in a Holger Flick video. He created a very simple static TController class and replaced the .dpr code with a single line: begin TAppController.Run; end. This way you don't have to add code to the .dpr which I have had cause trouble in the past since Delphi edits this file as well. You can add code to the Run procedure and not worry about messing things up. TAppController = class public class procedure Run; private class function CheckSingleton: Boolean; class procedure SetFocusRunningInstance; end; class function TAppController.CheckSingleton: Boolean; begin Result := FindWindow(WINDOW_CLASS_NAME, nil) = 0; end; class procedure TAppController.SetFocusRunningInstance; begin ShowWindow(FindWindow(WINDOW_CLASS_NAME, nil), SW_SHOWMAXIMIZED); end; class procedure TAppController.Run; begin Application.Initialize; Application.MainFormOnTaskbar := True; if TAppController.CheckSingleton then begin //Add conditional defines, splash screen whatever Application.Run; end else begin TAppController.SetFocusRunningInstance; end; end; Someone else (Can't remember where) also suggested setting the main form window to something unique you need to override the CreateParams of the Main form. procedure TfrmMain.CreateParams(var Params: TCreateParams); begin inherited; StrCopy(Params.WinClassName, WINDOW_CLASS_NAME); end;
  19. Mike Torrettinni

    Unit testing for beginners

    I guess it's time I start to learn this topic. There's plenty resources I can find on google, but seems more scattered than focused material that would teach from first test case to more substantial examples. I'm looking for something with more meaningful examples because this is completely useless for me: https://blogs.embarcadero.com/learn-how-to-do-unit-testing-in-delphi-with-the-powerful-dunitx-framework/ I just started new project, created a couple of file parsers and now I would like to implement unit testing. So, Calc examples... I just don't get it. Any suggestion on resources for beginners?
×