Leaderboard
Popular Content
Showing content with the highest reputation on 04/28/21 in all areas
-
https://delphisorcery.blogspot.com/2021/04/testinsight-12-released.html
-
Good quality Random number generator implementation
Stefan Glienke replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
https://xkcd.com/221/ -
Good quality Random number generator implementation
Anders Melander replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Yes it is, but if you can't define what "better quality" is then your request is meaningless. In any case, like David said, a web search should give you plenty of candidates. Did you try that first? -
Good quality Random number generator implementation
Wagner Landgraf replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
What is the problem about the current one? What makes it "low quality"? -
14.5.0 + MSI_SysProcMon - Added process username to sampling data + TMiTeC_Display - added GPU property indicating GPU presence * TMiTeC_CPU - fixed cpu core and thread count detection + TMiTeC_CPU - added SocketCount and SocketDesignation properties * TMiTeC_SMBIOS - fixed cache size detection when its size exceeding word boundary For more information about the library, download locations and documentation, see the MiTeC System Information Component Suite Home Page
-
Congrats to both of you
-
List of usable RegEx for source code
Mike Torrettinni replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
A new one: trim(left|right|)\(trim(left|right|)\( this will check for all combinations of TrimLeft(TrimRight())... I did find a few of these in some open source projects, There is one that has it's own LTrim and RTrim implementations, I assume they were implemented before TrimLeft/Right were introduced in Delphi. Of course it's using them as LTrim(RTrim(str)). -
10.4.2: Android Projectoptions/Version/VersionCode problem
microtronx posted a topic in Cross-platform
It is a small bug but it annoys us every day: https://quality.embarcadero.com/browse/RSP-25667?jql=text ~ "versioncode" Please vote for it so it gets solved!-
- android
- projectoptions
-
(and 2 more)
Tagged with:
-
Fmx Rx10.4.2: Is Android compilation to APK32 and APK64 broken ?
Rollo62 posted a topic in Cross-platform
Hi there, I know the similar thread, and now it hits me too. From my normal AAB project, I just need to creat separate APK, to send to some testers. If I build as the project as APK32/64 separately, which I did many times before, and Yes, I removed the checkbox, restarted IDE, and tried everything 10 times. My IDE always generates an AAB. This happens with a project that could build APK before flawlessly. Next step I have to create a complete new project, but I would like to ask is somebody knows a workaround for this ? Edit: Oh yes, RSP-32995 -
ANN: MiTeC Project Maker 1.4.2 - Delphi project building tool
mitzi posted a topic in Delphi Third-Party
What is Project Maker? MiTeC Project Maker is tool for automated batch Delphi projects building. With Project Maker, you can set compiler and its configuration, define actions processed before and after building, patch version information of built binary, sign this binary with specified certificate, apply 3rd-party software protection and many more. How does Project Maker work? Project Maker offers clear powerful interface for project building task definition. Every project can contain unlimited number of tasks. Task represents Delphi project, defined in dpr or dproj file. In addition Project Maker features Profiles, where you can define common properties for project. The project can have unlimited number of profiles. Using profiles you can simply switch between variety of build configurations. Who is Project Maker targeted on? Project Maker is targeted on developers who need to make various build scenarios and make repeated actions automatic. Project Maker is simple but powerful and provides one-click building of very complex and dependent projects. For more information see https://www.mitec.cz/pm.html -
Is it possible to dynamically generate an editor GUI based on a data type class?
aehimself replied to wuwuxin's topic in VCL
Joke: In today's world you are better suited with a string type. -
No, as weabow said and as stated in the requirements, you need XCode and a MAC to deploy to Mac or iOS/iPadOS You can't sideload apps to Apple devices for security reasons. They need to be signed by certificates issued by Apple.
-
Hi, 1) you need to compile teh app (needs mac and an IPad/IPhone connected or simulator maybee) You can use VM for the mac (forbidden), maybee the IPad simulator (I don't know), 2) you need to deploy the app to the store (use transporter from Apple - runs fine) 3) in your Apple account, create the app and fill the forms (with all the fine certificates).
-
In Unicode environments (Delphi/C++Builder 2009+, and FreePascal in UNICODESTRINGS mode), Indy encodes the Subject (and other headers) using UTF-8 by default (which can be overridden using the TIdMessage.OnInitializeISO event). But for the message body, you need to manually set the TIdMessage.CharSet and/or TIdText.CharSet property to 'utf-8', as they default to 'us-ascii' if left blank and the corresponding ContentType property is set to a 'text/...' media type, like 'text/html' (I am open to consider changing this default to UTF-8 instead). Note that the TIdMessageBuilder... classes already default the CharSet properties to UTF-8 in Unicode environments. No, it doesn't matter. That has no effect on how Indy encodes the email. And in fact, since the TIdMessage.Body and TIdText.Body properties are TStrings objects, you can't store UTF-8 text in the them anyway, only UTF-16 text. So if you want the text encoded as UTF-8 during transmission, make sure the corresponding CharSet properties are set to 'utf-8'. But, are you loading that file as UTF-8? Does the file have a UTF-8 BOM? If not, you must explicitly make use of TEncoding.UTF8 or equivalent when loading the file. What does your loading code look like? That is not true at all. TIdMessageBuilderPlain has a PlainText property for the body, just as TIdMessageBuilderHtml has an Html property for the body. I think you are just confused because the PlainText property is not declared in the TIdMessageBuilderPlain class, it is actually inherited from the TIdCustomMessageBuilder class (which means TIdMessageBuilderHtml also has the PlainText property, so that you can provide alternative plain text for HTML-unaware readers). You should read my articles on this topic on Indy's website: HTML Messages New HTML Message Builder class I have posted an update to my answer on that question. As of 2 months ago, the order in which ContentType and CharSet proerties is set is no longer important. No, you do not. However, if you do need to specify a CharSet explicitly, you should do so on the MessageBuilder classes themselves. TIdMessageBuilderPlain has a PlainTextCharSet property, and TIdMessageBuilderHtml has PlainTextCharSet and HtmlCharSet properties. With that said, try something more like this: procedure SendEmailIndy( const SMTPServer: string; const SMTPPort: integer; const SMTPUserName : string; const SMTPPassword : string; const FromName, FromAddress: string; const ToAddresses: string; //comma "," separated list of e-mail addresses const CCAddresses: string; //comma "," separated list of e-mail addresses const BCCAddresses: string; //comma "," separated list of e-mail addresses const Subject: string; const EmailBody: string; const IsBodyHtml: Boolean; //verses Plain Text const Attachments: TStrings; UseTLS : Boolean); var smtp: TIdSMTP; // IdSmtp.pas TLSHandler : TIdSSLIOHandlerSocketOpenSSL; // TLS support msg: TidMessage; // IdMessage.pas builder: TIdCustomMessageBuilder; //IdMessageBuilder.pas s: string; emailAddress: string; begin msg := TIdMessage.Create(nil); try if IsBodyHtml then begin builder := TIdMessageBuilderHtml.Create; end else begin builder := TIdMessageBuilderPlain.Create; end; try try if IsBodyHtml then begin TIdMessageBuilderHtml(builder).Html.Text := EmailBody; TIdMessageBuilderHtml(builder).HtmlCharSet := 'utf-8'; TIdMessageBuilderHtml(builder).HtmlContentTransfer := '8bit'; end else begin TIdMessageBuilderPlain(builder).PlainText.Text := EmailBody; TIdMessageBuilderPlain(builder).PlainTextCharSet := 'utf-8'; TIdMessageBuilderPlain(builder).PlainTextContentTransfer := '8bit'; end; if Attachments <> nil then begin for s in Attachments do builder.Attachments.Add(s); end; builder.FillMessage(msg); except {$IFDEF TRACEDEBUG} on E : Exception do begin AddDebugEntry('Email Builder Exception : ' + E.Message); Exit; end; {$ELSE} Exit; {$ENDIF} end; finally builder.Free; end; msg.From.Name := FromName; msg.From.Address := FromAddress; msg.Subject := Subject; for s in ToAddresses.Split([',']) do begin emailAddress := Trim(s); if emailAddress <> '' then msg.Recipients.Add.Address := emailAddress; end; for s in CCAddresses.Split([',']) do begin emailAddress := Trim(s); if emailAddress <> '' then msg.CCList.Add.Address := emailAddress; end; for s in BCCAddresses.Split([',']) do begin emailAddress := Trim(s); if emailAddress <> '' then msg.BccList.Add.Address := emailAddress; end; smtp := TIdSMTP.Create(nil); try smtp.Host := SMTPServer; smtp.Port := SMTPPort; smtp.Username := SMTPUserName; smtp.Password := SMTPPassword; if UseTLS then begin TLSHandler := TIdSSLIOHandlerSocketOpenSSL.Create(smtp); smtp.IOHandler := TLSHandler; if SMTPPort = 465 then begin smtp.UseTLS := TIdUseTLS.utUseImplicitTLS; end else begin smtp.UseTLS := TIdUseTLS.utUseExplicitTLS; end; end; try smtp.Connect; except {$IFDEF TRACEDEBUG} on E : Exception do begin AddDebugEntry('SMTP Connect Exception : '+E.Message); Exit; end; {$ELSE} Exit; {$ENDIF} end; try try smtp.Send(msg) except {$IFDEF TRACEDEBUG} on E : Exception do AddDebugEntry('SMTP Send Exception : '+E.Message); {$ENDIF} end; finally smtp.Disconnect; end; finally smtp.Free; end; finally msg.Free; end; end; Note that TIdMessageBuilderHtml CAN create plain-text emails as well, if no HTML is assigned, so you can alternatively use this instead: procedure SendEmailIndy( const SMTPServer: string; const SMTPPort: integer; const SMTPUserName : string; const SMTPPassword : string; const FromName, FromAddress: string; const ToAddresses: string; //comma "," separated list of e-mail addresses const CCAddresses: string; //comma "," separated list of e-mail addresses const BCCAddresses: string; //comma "," separated list of e-mail addresses const Subject: string; const EmailBody: string; const IsBodyHtml: Boolean; //verses Plain Text const Attachments: TStrings; UseTLS : Boolean); var smtp: TIdSMTP; // IdSmtp.pas TLSHandler : TIdSSLIOHandlerSocketOpenSSL; // TLS support msg: TidMessage; // IdMessage.pas builder: TIdMessageBuilderHtml; //IdMessageBuilder.pas s: string; emailAddress: string; begin msg := TIdMessage.Create(nil); try builder := TIdMessageBuilderHtml.Create; try try if IsBodyHtml then begin builder.Html.Text := EmailBody; builder.HtmlCharSet := 'utf-8'; builder.HtmlContentTransfer := '8bit'; end else begin builder.PlainText.Text := EmailBody; builder.PlainTextCharSet := 'utf-8'; builder.PlainTextContentTransfer := '8bit'; end; if Attachments <> nil then begin for s in Attachments do builder.Attachments.Add(s); end; builder.FillMessage(msg); except {$IFDEF TRACEDEBUG} on E : Exception do begin AddDebugEntry('Email Builder Exception : ' + E.Message); Exit; end; {$ELSE} Exit; {$ENDIF} end; finally builder.Free; end; msg.From.Name := FromName; msg.From.Address := FromAddress; msg.Subject := Subject; for s in ToAddresses.Split([',']) do begin emailAddress := Trim(s); if emailAddress <> '' then msg.Recipients.Add.Address := emailAddress; end; for s in CCAddresses.Split([',']) do begin emailAddress := Trim(s); if emailAddress <> '' then msg.CCList.Add.Address := emailAddress; end; for s in BCCAddresses.Split([',']) do begin emailAddress := Trim(s); if emailAddress <> '' then msg.BccList.Add.Address := emailAddress; end; smtp := TIdSMTP.Create(nil); try smtp.Host := SMTPServer; smtp.Port := SMTPPort; smtp.Username := SMTPUserName; smtp.Password := SMTPPassword; if UseTLS then begin TLSHandler := TIdSSLIOHandlerSocketOpenSSL.Create(smtp); smtp.IOHandler := TLSHandler; if SMTPPort = 465 then begin smtp.UseTLS := TIdUseTLS.utUseImplicitTLS; end else begin smtp.UseTLS := TIdUseTLS.utUseExplicitTLS; end; end; try smtp.Connect; except {$IFDEF TRACEDEBUG} on E : Exception do begin AddDebugEntry('SMTP Connect Exception : '+E.Message); Exit; end; {$ELSE} Exit; {$ENDIF} end; try try smtp.Send(msg) except {$IFDEF TRACEDEBUG} on E : Exception do AddDebugEntry('SMTP Send Exception : '+E.Message); {$ENDIF} end; finally smtp.Disconnect; end; finally smtp.Free; end; finally msg.Free; end; end;