tag:blogger.com,1999:blog-15948506446496830042024-03-13T05:38:20.061-03:00Pseudo-random tech thoughtsAbout technology, software development and Delphi ProgrammingAlexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.comBlogger103125tag:blogger.com,1999:blog-1594850644649683004.post-42804321575020436952023-04-28T22:19:00.009-03:002023-04-28T22:25:16.751-03:00Multiple RDP Connections to Windows 10 or 11 machine Best way to make your Windows 10 accept multiple RDP connections or, in my case, allow a local and a remote session simultaneously:http://www.federa.lt/multiple-rdp-sessions-in-windows-10/I opted by doing the patch of termsvr.dll. Just one note about it:Just look for this sequence of bytes 39 81 3C 06 00 00 and replace the following with the sequence B8 00 01 00 00 89 81 38 06 00 00 90 Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com0tag:blogger.com,1999:blog-1594850644649683004.post-1821761906419617952023-01-07T18:56:00.016-03:002023-01-07T19:11:18.253-03:00SystemBuilder da Squadra II - A missão (final)Há mais de 15 anos, publiquei um post sobre o SystemBuilder da Squadra, aqui:https://alexandrecmachado.blogspot.com/2007/11/systembuilder-da-squadra.htmlPessoalmente nunca usei o SystemBuilder e hoje, mais do que nunca, acho que foi uma péssima idéia quem usou. O SystemBuilder facilitou o desenvolvimento às custas de introduzir muitas coisas erradas no código e no sistema.Bem, isto não vem ao Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com0tag:blogger.com,1999:blog-1594850644649683004.post-60776269249981981602018-06-12T23:10:00.003-03:002018-06-12T23:11:40.021-03:00Erik Meijer on AgileThat's exactly what I think about Agile
Not that I think everything about Agile is bad. But the bad parts took over and what's left is not much better than nothing. Probably worse.Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com2tag:blogger.com,1999:blog-1594850644649683004.post-73403626180053494792018-06-08T04:17:00.000-03:002018-06-08T06:47:30.076-03:00Delphi fix up mechanism
There are a few methods and functions in Classes.pas unit which take care of something that I call "fix up mechanism". Just search for "fixup" inside Classes.pas and you will find them. The fix up mechanism exists to "fix" (really?) references to other components which are owned by a different container, when they are created at runtime, loaded from a DFM resource.
So, let's say you have a Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com1tag:blogger.com,1999:blog-1594850644649683004.post-73632342967530960572018-06-07T01:01:00.002-03:002018-06-07T01:05:39.358-03:00Back to businessAfter a long long period of inactivity, I'm back to business. I'll publish some new stuff here, probably some IntraWeb related material as well.
Actually I have plans to create a brand new IntraWeb application to host some documentation about IntraWeb itself. It will contain new stuff and I intend to make a *really nice* IntraWeb application to handle it.
Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com0tag:blogger.com,1999:blog-1594850644649683004.post-10627801167629295412017-03-01T19:35:00.002-03:002017-03-01T19:46:31.698-03:00Delphi...
Back in 2013, Marco Cantu wrote this blog post:
http://blog.marcocantu.com/blog/strings_immutability_cow_ansistrings.html
Simon Kissel, a very active and respected member of the old Delphi community posted a comment which I find very relevant and I want to emphasize here. If you are interested in Simon's Delphi story, you can read his alternative (and controversial) Delphi roadmap, here:
httpAlexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com2tag:blogger.com,1999:blog-1594850644649683004.post-28266381386007677082016-01-25T07:19:00.002-02:002016-01-25T07:20:06.785-02:00My Delphi code on BitbucketFinally I started using Bitbucket as a repository to my personal projects. Some are free, like the MergeSort algorithm, and the FastStringReplace unit. Soon I'll publish one more project that I've been working on during the last month...
So here they are:
https://bitbucket.org/alex7691/delphi
Enjoy!Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com1tag:blogger.com,1999:blog-1594850644649683004.post-4159824812796779742015-08-20T06:30:00.002-03:002015-08-20T06:32:20.538-03:00Crappy Windows Media Player in Windows 8Microsoft still didn't get it. The most crappy media player of all times. I guess Win 10 is even worse!
Remove it for good:
Go to "Control Panel\Programs\Programs and Features" and click on turn windows features on or off
Uncheck Windows Media player and click OK
Then Yes...
Wait until it completes. Then reboot and voilá!
Install WinAmp 2.95 and be happy!Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com2tag:blogger.com,1999:blog-1594850644649683004.post-40786921101929138782015-06-14T19:53:00.001-03:002023-01-07T19:18:10.508-03:00Fast StringReplace fixI did a small and silly mistake in my original FastStringReplace implementation that could cause the FastStringReplace() routine to fail completely when rfIgnoreCase was used and the OldPattern was already in upper case.
The bug is fixed and I'm also writing a unit test for it. If you are already using FastStringReplace in your code, please update using latest version.
Direct download link here.Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com7tag:blogger.com,1999:blog-1594850644649683004.post-35613304489635645312015-03-12T11:44:00.000-03:002016-06-18T05:07:26.200-03:00Merge Sort for Delphi RevisitedA reader named dangph did me a great favor and created a complete test case for my MergeSort unit. He had already commented on my StackOverflow answer.
Well, he found that the algorithm was not stable after all. And he is correct. BTW, thank you!
So I did a little test to discover why it was not stable. Some hidden bug or a complete logic failure? Seems that the book algorithm has a Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com0tag:blogger.com,1999:blog-1594850644649683004.post-27245049371078933752015-03-10T10:43:00.000-03:002015-03-12T11:52:00.377-03:00So, .NET code is not slower than native Delphi code?Just to prove once again that .NET IS slower than Delphi generated code in LOTS of scenarios:
In this post I created a few implementations for a StringReplace() replacement and found that my custom FastStringReplace() implementation was the fastest, correct?
Now, I want to check if it is REALLY fast. Why not compare with something like .NET super-duper-optimized-code?
In .NET, they told me Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com0tag:blogger.com,1999:blog-1594850644649683004.post-37758404761606452252015-03-05T21:50:00.003-03:002023-01-07T19:22:11.910-03:00Fastest StringReplace for Delphi?Not sure. At least this is the fastest pure pascal, unicode compatible, StringReplace() alternative I've ever tested. I wrote this based on some very old code I found in my HDD and I just don't know where it came from.
I also use a Pos() replacement for x64 (this came directly from FastCode project), because Delphi x64 Pos() function is DOG SLOW!!!
If someone has a faster StringReplace() Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com21tag:blogger.com,1999:blog-1594850644649683004.post-36855510498421255542015-02-25T15:23:00.001-03:002016-06-18T05:06:03.223-03:00Merge Sort for DelphiToday I was investigating a problem in TList sort order after calling the built-in Sort() method . A few objects were added to the list and then the Sort() method is called. In this specific case, happens that all objects were equally ranked, and once TList uses a Quick Sort algorithm, the order of elements in the list change, even though there is no need to sort them (they are equally Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com7tag:blogger.com,1999:blog-1594850644649683004.post-56692851380129154632013-06-12T13:48:00.000-03:002013-06-12T13:48:58.826-03:00Why I use if MyString <> '' and not if Length(MyString) > 0 ?1) if MyString <> '' then
2) if Length(MyString) > 0 then
Both forms are used to test whether a string is empty. Let's see what the Delphi compiler has to say:
Create a new project and add this code to it:
procedure Proc1;
var
MyString: string;
begin
if
MyString
<> '' then begin
end;
end;
procedure Proc2;
var
MyString: string;
begin
Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com4tag:blogger.com,1999:blog-1594850644649683004.post-6917821188721218082013-02-26T10:00:00.003-03:002013-02-26T11:31:01.994-03:00Why Mr. Delphi Hater should be called Mr. Dumbass HaterMr. Hater is a well known Delphi-related FUD spreader. From times to times some colleague or friend send me a link pointing to one of his infamous posts.
Mr. "dumbass" Hater pretends to be some kind of Delphi user defender, some kind of Batman of the Delphi community, but he turned out to be more like the Jokerman. His correspondents from the north pole, Atlantis and Bermuda triangle always send Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com1tag:blogger.com,1999:blog-1594850644649683004.post-91827244001020685722012-12-19T11:50:00.000-02:002012-12-19T11:50:43.650-02:00ShellExecute as administrator + Drag and Drop in Windows 7This is a little tip that took me sometime to figure it out:
This kind of issue happened when I was debugging a IntraWeb application created with Delphi XE3 in Windows 7. I often run Delphi XE3 as local administrator. I know, I know... but sometimes it is required for proper ISAPI debugging.
This application renders a control that supports drag and drop from Windows Explorer, when the browser Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com2tag:blogger.com,1999:blog-1594850644649683004.post-67213065863496724532012-07-12T08:58:00.001-03:002012-07-12T08:58:50.476-03:00My IntraWeb optimizations are not required anymoreYes! If you are using the latest 12.2.6 IntraWeb version you won't need my "speed patches" anymore because IntraWeb 12.2.6 are using these same faster routines, and more! :-)
You may download the new IntraWeb 12.2.6 version from here (follow the Test Releases link)
http://www.atozed.com/IntraWeb/Download/Download.EN.aspx
Enjoy!
Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com1tag:blogger.com,1999:blog-1594850644649683004.post-31418931700963989752012-04-15T14:04:00.001-03:002012-04-20T08:10:34.793-03:00Debug ISAPI extensions in Windows 7 and IIS 7.5 using Delphi XE2Many things have changed in IIS from version 6 to 7 (and 7.5 that comes with Windows 7). If you are not familiarized with IIS 7 (and 7.5) debugging, maybe this post may help you.
In fact, debugging ISAPI in Winodws 7 is easy if you follow a few steps:
Setting up IIS
First, you have to create a new application in IIS and set it up as usual. Two things are important during IIS and application Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com8tag:blogger.com,1999:blog-1594850644649683004.post-54659912270385002852012-04-09T11:48:00.000-03:002012-04-09T12:23:31.032-03:00Faster IntToStr functions for Delphi 32 bitsLast week I was trying to use the excellent "Enhanced Run time library" from A. Bouchez, in a Delphi 2006 project. Unfortunately, due copyright restrictions, the modifications are released as a code patch and for Delphi 7 only.
Use all the modifications in a Delphi 2006 project is not an easy task. So I decided to use some of its code in another unit, patching the RTL original functions with new Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com1tag:blogger.com,1999:blog-1594850644649683004.post-57645845623390184232012-04-09T08:46:00.000-03:002012-04-09T08:49:25.298-03:00TCodeRedirect rewriteA few weeks ago I wrote a post about TCodeRedirect. After that, I had a few problems using that code in Delphi 2006, specifically internal compiler errors (Internal Compiler Errors = useless error message!). The errors were occurring in some projects, not in all...
After a few tests I thought that could be something related to naming conflicts with original CodeRedirect function in Andreas Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com0tag:blogger.com,1999:blog-1594850644649683004.post-80173960330762039392012-03-12T08:31:00.000-03:002012-03-12T08:37:01.584-03:00Show "loading animation" during long Intraweb AJAX requestsYesterday I was talking to another Intraweb developer and I've created a demo application to show him how I lock the screen, showing the loading AJAX animation (IWLocker), during an AJAX request that takes long time to return. After that, I've improved my demo using 3 different techniques do do that. In this post I will show you all the 3 techniques.
The problem
Suppose you have a IWButton in Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com2tag:blogger.com,1999:blog-1594850644649683004.post-48259792419101203992012-03-07T09:58:00.000-03:002012-03-07T09:58:56.096-03:00Crossbrowser, multi-line hints in IntrawebYesterday I saw a post in Embarcadero forums asking how to create multi-line hints in a IWGrid, inside an Intraweb application.
Well, this doesn't have a simple answer because IWGrid cells are TD HTML tags, and the hint is the title attribute. There is no reliable way to make the title attribute break lines across browsers. It is doable in IE but not in Firefox, for instance.
I will show you a Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com0tag:blogger.com,1999:blog-1594850644649683004.post-75867316072706890052012-03-06T08:35:00.002-03:002012-03-06T09:43:22.976-03:00Intraweb TextToHTMLStringLiteral in a multi-threaded testIn a recent blog post (Speeding Intraweb up again) I wrote that I suspected that in a multi-threaded test, running in a multi-core computer, the modified version of TextToHTMLStringLiteral would perform even better. So I decided to test it in this context. Now I can tell you that I was right ;-)
The test
Today I created a new multi-threaded test. Two threads running in parallel doing the Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com1tag:blogger.com,1999:blog-1594850644649683004.post-75469356957238370982012-03-05T12:33:00.000-03:002012-03-05T14:18:58.574-03:00TCodeRedirect reduxIn my latests posts I was dealing a lot with Delphi classes runtime patching. Thanks to Andreas Hausladen, Chau Chee Yang (among others) most of the hard work is already done, but...
I've created a new and different version of Yang's TCodeRedirect that I consider easier to work with, because it works as a singleton. This way, you won't need to create a new TCodeRedirect instance for each patch Alexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com2tag:blogger.com,1999:blog-1594850644649683004.post-79953186161793825562012-03-05T11:16:00.000-03:002012-03-05T13:55:42.979-03:00Modifying Intraweb PatchesToday I received a message from a blog reader, pointing that my patches were not compiling under more recent versions of Delphi, specially Delphi 2010. Really, I haven't checked D2010 compatibility before releasing my code. The problem is not in IntrawebPatch.pas but inside my modified RtlVclOptimize.pas (from Andreas Hausladen). Trying to compile it under Delphi XE2, for instance, showed me thatAlexandre Caldas Machadohttp://www.blogger.com/profile/01461341015084340422noreply@blogger.com0