Quantcast
Channel: Planet Object Pascal
Viewing all 1725 articles
Browse latest View live

The Wiert Corner - irregular stream of stuff: jpluimers

$
0
0

Some notes if I ever want to do something like this.

In this case I worked around it by having the Items include different text (since I had object pointers in the TStrings anyway) so I could stick to the csDropDown Style.

A very easy way to show different string values than the Items is to set the Style property fromcsDropDown to csOwnerDrawFixed as Andreas Rejbrand has answered a few years ago.

The thing is: as soon as you do that, you loose Windows Theming support.
The same limitation applies to using csOwnerDrawVariable

These two Style values get translated into adding the CBS_OWNERDRAWFIXED orCBS_OWNERDRAWVARIABLE (in addition to CBS_DROPDOWNLISTstyles of the Windows COMBOBOX control.

In turn, CBS_OWNERDRAWFIXED or CBS_OWNERDRAWVARIABLE cause you to instantly loose the Windows theming support.

When you do full custom painting like a colour picker, that is all fine. But when you only want to replace the drawn text, it is not.

The Windows COMBOBOX control does not seem to have a way around this, so I’m wondering: how can you simulate the Windows theming from Delphi?

I assume it has to do with DrawThemedBackground, but it has been a while since I’ve done serious Delphi Control work, so any pointers on how to get started there are fine too (even if they invalidate my assumption).

share|edit|close|delete|flag
75% accept rate
1
Just change the text in the control and let Windows do the work. – David Heffernan Sep 9 at 11:08
@DavidHeffernan That is a lot of work, so I wonder if simulating the theming is less work. And it would be a good exercise to learn more about how the theming support actually functions. – Jeroen Wiert Pluimers Sep 9 at 11:14
2
up voted
I cannot imagine that ComboBox1.Items.Assign is harder than working out theming. Very easy to get themed painting wrong as you can see from the VCL. Windows gets it right. – David Heffernan Sep 9 at 11:38
@DavidHeffernan The problem is not the Assign, but the mapping back to what I want. But I appreciate your point. Just waiting to see if someone comes with an answer into the theming direction and if not, work on the mapping. – Jeroen Wiert Pluimers Sep 9 at 12:21
1
up voted
Can you work it out by reading the code for TComboBoxStyleHook. – David Heffernan Sep 9 at 13:13
I tried, not much success yet, but when I do, I will post. First some non work though (: – Jeroen Wiert PluimersSep 9 at 13:24
1
up voted
As david says, I really don’t see the point of your question. You’re doing it the hard slow way, instead of the fast easy way (Just change the item text?) – Warren P Sep 10 at 3:21
I simplified the question a lot. Doing the reverse mapping requires me to enumerate over all items, which I’d rather not do (especially since I’d need abstract that for multiple not so similar kinds of occasions that are in different parts of the class hierarchy). – Jeroen Wiert Pluimers Sep 10 at 11:03
 
@JeroenWiertPluimers But you need to do that mapping at some point. The text has to come from somewhere. – David Heffernan Sep 10 at 12:09
@DavidHeffernan But now I need to do the reverse mapping… It’s not impossible like a trapdoor, but it is impractical. But probably less impractical than doing the theming. – Jeroen Wiert Pluimers Sep 10 at 14:19
1
up voted
If you can work the text out to paint it, you can work the text out to stuff into the combo box items. – David Heffernan Sep 10 at 14:42
@DavidHeffernan stuffing the text into the items isn’t the problem. The reverse (getting the right underlying item back from that text) is. That’s my mapping problem, hence the reference to the trapdoor. – Jeroen Wiert Pluimers Sep 10 at 15:14
 
OK, now I understand. I guess at this point you wished you had a better separation between business logic and UI! – David Heffernan Sep 10 at 15:15
I usually want, as most code I maintain at clients has very bad separation. But in this case the separation is quite OK. The Business Layer gives me a TStrings with the Objects filled (it is pre-Delphi-2009, so no generics yet). That’s why I can get out the Text sou easy (: First I need to finish about a week of .NET work though. – Jeroen Wiert Pluimers Sep 10 at 16:03
 
I actually wish that I had a completely VCL-implementation of TComboBox if only due to the issues in the Standard Control ComboBox setting its item height however it wants. If I was stuck in your situation, I think I’d almost write my own TExtComboBox and its own VCL styles feature. – Warren P Sep 10 at 20:45
The comments by @DavidHeffernan did give me some thought. Since the Object instance references are already in the TStrings, I wrote a small function to return a new temporary TStrings that has the string values with the captions I needed and keep the Object references. Since it has the same item ordering, and same Object references I don’t need any mapping at all. Just need to make sure I free the new TStrings at the right moment. – Jeroen Wiert Pluimers Sep 10 at 21:24

add comment

–jeroen

via: delphi – How to simulate Windows Theme behaviour when TComboBox uses csOwnerDrawFixed or csOwnerDrawVariable? – Stack Overflow.


Filed under: Delphi, Delphi XE2, Delphi XE3, Development, Software Development

Andreano Lanusse | Technology and Software Development: Delphi XE4 official announcement coming

$
0
0

In general you expect a new version of Delphi around August, this year is going to be different, Delphi XE4 is coming next week.

I just heard that next week Embarcadero is going to announce Delphi XE4, which is part of RAD Studio XE4 and will include C++Builder XE4 and HTML5 Builder.

An important change initiated last year related to Prism (Delphi for .NET) will affect RAD Studio this year, I think you won’t see Prism included in RAD Studio, of course REM Objects continue to develop their compiler and integration with Visual Studio, so you will have order directly from them.

What’s new in Delphi XE4?

Delphi XE4 will bring Embarcadero’s new ARM compiler and will allow Delphi developers to compile FireMonkey apps to iOS devices at this point. The project around this new compiler started years ago, I had the opportunity to talk about this project with many Delphi developers, so the new compiler is really new and a beginning that will allow to move Delphi language much easier to other platforms, as you already heard Embarcadero is already promising Android support and it suppose to come soon.

The iOS support is going to be better them what you saw in XE2 and you are expecting something way better. A very important point is the focus on iOS, trying to make everything you use for Windows available on iOS is not the way to go, so in XE4 you will see what is specific for iOS when developing for iOS and this is good.

Of course Embarcadero will promote FireDAC as a new feature in XE4, even it came recently on XE3 still a good point to talk about this, since FireDAC is way better them dbExpress. I blogged about that recently and you can read here.

I believe you will see InterBase for iOS on this release, even you already have SQLite on iOS devices I see a lot of space for InterBase on iOS, especially for developers that need protect their data on mobile devices.

Upgrade and pricing

Embarcadero will release all the SKUs and upgrade paths. Early this year they mention about to release iOS support as add-on, maybe you will be able to buy just this piece, let’s wait and see.

There is a webinar scheduled for next Wednesday April 24th and it will show this new release.

I will be back in the following days and will share my comments about this release.

Andreano Lanusse | Technology and Software Development
Follow me on Twitter: @andreanolanusse

The Wiert Corner - irregular stream of stuff: jpluimers

$
0
0

Link clearance, mostly centered around “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports” and “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices“:

–jeroen


Filed under: .NET, Delphi, Development, Software Development

while true do;: Sneak peek to simple integration between DMVCFramework and DORM

$
0
0
This is a really simple (not optimized and dirty) integration between the upcoming DMVCFramework (WebBroker based MVC framework) and DORM, “the Delphi ORM”. This is the DMVCFramework controller with the relative mapping and methods. In the method “GetUsers” dorm is used to execute a select to the database using the sanitized parameter passed on the url. unit [...]

Delphi Haven: Delphi XE4 pricing

$
0
0

It’s not exactly a ‘leak’ given it comes from an official promo video, albeit in Russian, but anyhow, the US pricing for Delphi XE4 has come out:

Screen Shot 2013-04-18 at 22.00.44

See here (for some reason, the video couldn’t show on Firefox, my usual browser, but it ran fine in Safari). In a nutshell, the XE4 upgrade will be a ‘nominal’ $49 for XE3 Professional edition owners uninterested in iOS support, or $499 if they are. In contrast, the upgrade cost from XE3 for Enterprise and above will be a flat $499. Slightly disappointingly (well, in my view at least), nothing clever has been done with the Starter edition – that remains Win32 only.

Does $499 (I shan’t guess the exchange rate for outside the US) fulfil the promise of iOS support being a ‘low cost add-on’ for XE3 Professional owners? Probably not, and while I’d prefer it lower, I’m not sure it’s particularly expensive for the market either:

  • RemObjects are currently running a ‘limited offer’ promotion for getting Oxygene for Windows, OS X, iOS and Android for $499. While this is more platforms than Delphi, at least for now, you’re only getting a vaguely Delphi-like language – ignoring the lack of a shared visual component library (which RemObjects are no doubt quite sincere in dismissing the very idea of), there’s no shared RTL either, at least at the level of Delphi’s, let alone .NET’s.
  • Xamarin sell their eponymous Mono-based tools for $299 per platform for ‘indie’ developers, and $999 per platform per seat for ‘business’ customers. Since only the ‘business’ (or beyond that, ‘enterprise’) edition comes with Visual Studio integration, if you want that, you’re looking at $2,697.30 (!) for all supported platforms (this includes a multiplatform discount). On the other hand, unlike Oxygene, you are buying a commercial licence for not just a language (C# in Xamarin’s case – and a very fine language it is too), but an extensive RTL (i.e., their implementation of the .NET BCL) and a dedicated IDE, which Xamarin ships alongside (or in the case of the ‘indie’ edition, instead of) its VS integration.

Of course, beyond pricing, there is the quality issue to consider too. Put briefly, it’s all very well promising the moon, but if you end up delivering a trip to a boggy field instead, the original promise will backfire. Time will tell…


Te Waka o Pascal: XE4 Pricing Revealed

$
0
0
Chris Rolliston just posted a link to a video (from Russia) where-in the pricing for XE4 is revealed. All $ amounts mentioned in this article are US $ prices. Your local price may vary depending on how much exchange rate gouging is added on top of the gouging already built in. In a nutshell, Delphi [...]

Castle Game Engine news: Development: better Mac OS X support, networking, CAD level 2, more

$
0
0
view3dscene on Mac OS X, with nice icon, menu bar, file dialog
view3dscene on Mac OS X, with nice icon, menu
Model with textures loaded from network, URL dialog
CAD example model from http://www.web3d.org/wiki/index.php/X3DOM_CAD#X3D_Models

Hello everyone!

  1. There is a contest for best open-source project on Polish portal http://www.spinacz.edu.pl/. Please take a moment to vote for our Castle Game Engine!

  2. Our engine was submitted to devmaster.net, with lots of information and screenshots. You're welcome to review and rate us there!

  3. We also want to remind that we have a Google+ page about our Castle Game Engine, you can follow it to see (a little more frequent) news about our engine development.

New engine features in development:

  1. Mac OS X with native look. This is already much more user-friendly than our previous GTK-based releases for Mac OS X. See development details. Hopefully, this will allow us to release next view3dscene as normal Mac OS X application, that will be trivial to install for Mac OS X users.

  2. Network (http) support. Most "FileName" parameters and properties are now URLs. You can use protocols like file: and http: and data: everywhere, and of course http will be automatically downloaded. Try view3dscene from snapshots, enable "Preferences->Download Resources From Network" and then use menu item (Ctrl+L) to load URL, or pass URL on the command-line.

    This is a little user-unfriendly, as the downloading is blocking (the process waits for the download to finish, instead of letting you enjoy the game and download in the background; there isn't even any nice way to cancel the download, or even notification about it, except for --debug-log message). For this reason, it is disabled by default: you have to explicitly allow it by "Preferences->Download Resources From Network" (in code: CastleDownload.EnableNetwork variable).

    For some test scenes on the Internet, try e.g. Inline demo or Texture demo or AudioClip demo. (from ConformanceNist X3D Examples Archive). Or see our demo models through http, by browsing through SVN http link.

    view3dscene automatically downloads the model, as well as all linked resources (textures, inline models, sounds, scripts etc.). You can also use VRML/X3D Anchors to jump to any URL (for example, you can jump from a local file to a model available through http). Also data: URI handling is now more uniform. Also the engine uses now MIME types more, instead of merely file extensions. This makes us work with http transfers, and improves cooperation with data: URIs.

    In a game, you could also use URLs inside files like level.xml and resource.xml. For example, you could distribute now a level.xml file that contains URLs to levels on your server, downloaded each time.

  3. Clipboard (Ctrl+C, Ctrl+V, Ctrl+X in message boxes, especially handy to copy/paste URLs). For developers: use Clipboard.AsText property. Implemented for CastleWindow WinAPI, GTK, LCL backends.

  4. CAD level 2 support (CADXxx nodes).

  5. Improvements to 2D rendering. They also workaround crashes on some Mesa 9 drivers.

  6. Support for 8 and 16 samples for anti-aliasing, there are (at least NVidia) GPUs supporting it.

  7. Renamed our event Idle to Update.

    This reflects our implementation and usage of this event clearer. This event is for continuous tasks, called even when the application is not "idle" (when application is processing something, like mouse moves). Our Update event doesn't correspond 100% to normal (as used by LCL or GTK) meaning of "idle" (which is also evidenced by code if TCastleWindow LCL and GTK backends, that cannot simply use LCL/GTK "idle" concepts to implement our Update).

  8. TCastleControl.AggressiveUpdate* are removed. The (simplified and improved) version of this mechanism is now always "on" and automatically makes mouse look work better. It's still not perfect (it seems LCL event loop is just too slow to process events during mouse look fast enough), but it's better now. If you want perfectly smooth mouse look, you should still consider TCastleWindow instead of TCastleControl.

Behind the connection: TabOrder blues

$
0
0
In every Windows form, the user is allowed to use the tab key to cycle thru all controls on the form. When building a form, the developer can select the tab order to fit his needs. For example if the form looks like a grid, he set tab order so that the focus goes horizontally first. Alternatively, he can select that controls are visited in column order. Of course the crazy developer can select

Delphi Haven: XE4 documentation is up

Delphi Code Monkey: Delphi Prism is dead, long live Oxygene.

$
0
0
I just learned that Rad Studio XE4 will not include the "Prism" (delphi compiler for .Net) product in the bundle anymore.

I for one am not surprised.  RemObject's delphi-flavored "Oxygene" language that powered the "Delphi Prism" product (a rebranding of Oxygene, since day one) has been more of a threat to Embarcadero than an asset, since the move towards iOS ("Nougat") and Java.

Embarcadero has a really nice plan, a cross-platform-Delphi go-to-market strategy, and I believe that their plans and RemObject's plans have been on a collision course for some time. As a consumer who purchases products from both, I am happy.  As I should be.  Because that means there will be competition.  I believe that the perception from inside the Embarcadero camp might be that they are a serious producer of compilers and native-code-generation tools, and the idea that .Net based "JIT" is "native development" is laughed at inside the hallowed halls of Delphi's developers, the idea being that  Delphi's core compiler and IDE technology is of an order of magnitude more importance and sophistication than the tiny little product known as "Prism" inside the RAD Studio box, and Oxygene everywhere else.  

I don't actively use Oxygene/Prism, but I'm definitely interested in both it, and in XE4's cross-platform abilities when they ship.  As I have already learned iOS and Objective-C I don't need anyone to spare me that learning curve. It's done.  But I could use a tool that will let me build one app and target more than one mobile platform at once.

RemObjects' products, including Oxygene, are powerful precisely because they are built on top of a big open source ecosystem (Mono on non-Windows platforms) and by being built atop .Net are also leveraging powerful .Net platform capabilities, on Windows.

Ironically, the era of doing your own compiler from scratch is drawing to a close as Embarcadero prepares for a future where a new llvm-based Delphi compiler allows for native-compilation on iOS, and Android.  This is an era of collaboration and an era of competition, at the same time.  While Embarcadero may be "big" compared to RemObjects, both are small compared to the real juggernauts in the software industry.  Microsoft has the Windows platform just about sewn up, and VisualStudio has a commanding presence on Windows.   As Embarcadero and RemObjects set sail on the "blue ocean" of cross-platform development I wish them both the best of luck.

My personal bet is on the Embarcadero horse, because I like the idea of an llvm-based compiler and no runtime, on mobile, windows, and mac.  But if that falls short of its promise for some reason, I am glad that there is another horse in this race.  Having Embarcadero and RemObjects as competitors is better for me, the intended target market for both company's products.

I am not on any Delphi XE4 field tests or betas and the information in this post is based purely on what I have read in public websites.

It's a blong, blong, blong road...: Delphi for iOS (aka Delphi XE4 aka RAD Studio XE4) has appeared

$
0
0

We’ve heard lots of noises about Embo’s pending Delphi support for iOS over the last 6 months or more and now the wait is over.

RAD Studio XE4 Installer

The iOS support has arrived, but not as the largely expected add-on to XE3, but instead as a new version: XE4 (available with or without iOS support). Delphi XE4 has arrived (along with C++Builder XE4 and RAD Studio XE4) and now targets:

  • 32-bit Windows
  • 64-bit Windows
  • 32-bit OS X
  • iOS Simulator (Intel)
  • iOS (ARM)

There is a flurry of activity about this new release over the blogosphere and here’s a summary of the key points regarding information about the product and regarding the product itself.

Information

Product details

The main thrust of this release is the Delphi support for iOS, specifically two new cross-compilers that support targeting the iOS simulator (Intel) and native iOS (ARM) called dccios32.exe and dcciosarm.exe.

As you might expect there have been a raft of changes in FireMonkey to support this wider platform range and improve the existing platform support. Indeed FireMonkey has now changed from being known as FM2 to now being FM3. The online help has much information on the changes to FireMonkey.

The IDE has new mobile form designers (no longer floatable) and new target platforms to get your app on the simulator or iOS device. Of course FireDAC is in the box too.

InterBase ToGo is now supplied as an option for an embedded database in your application, including iOS applications. Note that InterBase ToGo requires a license to be bought, whereas IBLite does not (and also does not support encryption, more than 1 core, more than 1 connection, etc.). More info on InterBase ToGo is available in this quick-start guide.

iOS support has been added for SQLite, IBExpress and the MIDAS client components (notably TClientDataSet).

The iOS compilers introduce the Next Generation Delphi language, which some of you will have seen hints of in the Delphi XE3 source code via the NEXTGEN conditional compilation symbol that is checked for in many places. This Next Generation Delphi support is currently only available in the iOS compilers, though it’s a safe bet we’ll also see it in the Android compiler, whenever that appears.

The Next Generation Delphi compiler takes the opportunity to off-load some aspects of the Delphi language that are a little archaic and at the same time bring in some new helpful features.

Things that have gone/changed include:

  • Some of the many string types have gone (AnsiString, UTF8String, RawByteString, WideString, AnsiChar, PAnsiChar, PWideChar, OpenString, ShortString) leaving just the basic type string , an alias for UnicodeString.
  • Pointer support is gone. For interfacing with external library APIs there is a new TMarshaller record, which works with the TPtrWrapper record.
  • Strings are 0-indexed instead of 1-indexed by default. It is recommended you employ TStringHelper (introduced in XE3) to work with strings as it knows about the string indexing on the different platforms.
  • Strings are to be considered immutable. Currently you can change string contents but will get a warning for your trouble. This is to encourage you to change the code to use a TStringBuilder to build a new string. Future versions may change the warning to an error.
  • Inline assembler support is gone.
  • You are advised to rewrite code that uses with as this is likely to be removed in future versions. I can see the benefit in enforcing this, as I have bumped into so many scope errors caused by over-zealous with usage over the years…

New things include:

  • New predefined conditional symbols (* the content of this table is subject to change based on proper testing - the corresponding documentation page is incomplete/incorrect, so some educated guesswork has gone on thus far):
    Symbol:

    Defined:

    For compilers:
    AUTOREFCOUNTif ARC is availabledcciosarm, dccios32
    CPUARMif the CPU is ARM-baseddcciosarm
    EXTERNAL_LINKERfor compilers with an external linkerdcciosarm, dccios32
    IOStarget platform is iOSdcciosarm, dccios32
    NEXTGENfor Next Generation Delphi compilerdcciosarm, dccios32
    UNDERSCOREIMPORTNAMEfor compilers that add leading underscores when importing libsdcc32, dccosx, dccios32
    WEAKREF for compilers that can use weak references dcciosarm, dccios32
    WEAKINSTREF when weak references are defined for instancesdcciosarm, dccios32
    WEAKINTFREFwhen weak references are defined for interfaces dcciosarm, dccios32
  • New compiler directives:
    • {$ZEROBASEDSTRINGS ON/OFF} controls whether 0-based or 1-based string indexing is active. You can, for example, use this to force 1-based indexing in mobile code that you haven’t yet updated
    • {$EXTENDEDCOMPATIBILITY ON/OFF} allows use of Extended data type on platforms that do not normally support it (Win64 and iOS). The given support offers the expected 10 bytes storage but doesn’t offer the higher floating-point support that Win32 Extended gives.
  • New compiler attributes:
    • [volatile] to indicate the field may be changed by other threads (it’s a hint to the code optimiser).
    • [weak] to mark a weak reference.
    • [Ref] to ensure constant parameters are passed by reference rather than by value.

    Given these changes there is a page that talks about how to migrate code from the desktop to iOS.

    Taking all the above onboard, it looks currently like Embo offer a common component framework (also, slightly confusingly, referred to as a platform) to program against for different target platforms (Win32, Win64, OS X, iOS) in FireMonkey (aka FMX aka FM3). As for your Delphi code, however, it would currently appear that desktop code and mobile code will look a bit different, thanks to the string changes (1-indexing to 0-indexing and the push towards immutability) and of course the specific form factors of the UI on the respective platforms.

    So, you build a mobile UI and you build a desktop UI. With the desktop UI you take great care to ensure the app looks like a Windows app when compiled for and running on Windows (menu layout, button order and placement on dialogs), and looks like a Mac app when compiled for and running on OS X.

    Then when you come to build the code base, you write it once for the desktop using all the standard Delphi-desktop paradigms of creating objects and ensuring they are destroyed with try/finally/free/end. On the mobile side you skip all that and let objects be cleaned up by ARC, and ensure weak references are specified where appropriate.

    I’m sure the desktop compiler will catch up with these changes at some point, but in the interim there is a requirement for quite a bit of conditional compilation, or making use of no-op calls in the mobile code. And if/when the desktop compiler catches up, that will potentially force a big hit in massaging desktop code into the new realm of Next Generation Delphi.

    It’s all a bit up in the air as to how things will pan out, but to my eyes currently, the only common thing is the FireMonkey framework. Other than that, the coding and design looks to require dedication per platform targeted. Which is no bad thing. In my opinion, when targeting a given platform you should put some effort into making sure the application works gracefully and looks in keeping with its peers.

    With that mindset in place, the iOS support looks pretty neat and the changes to the language make Delphi behave a little more like many of the other popular languages in existence. I’ve certainly got no issues with kicking out with and dropping to a single string type. Let’s just be careful to not play the “write once run anywhere” card too frequently, eh?

    Andreano Lanusse | Technology and Software Development: Whats new in Delphi XE4?

    $
    0
    0

    This time you didn’t have to way a full year to see a new Delphi release, 8 months after XE3 release Delphi XE4 is out.

    iOS development is the major topic of course and bring the second version of FireMonkey to iOS, a lot of expectation on this topic specially after XE2.

    Also there is a bunch of new stuffs to talk about, like:

    • New Delphi compiler for mobile platform, which brings several changes in the language and set a future path to the Delphi language, obvious these changes will affect desktop development in the future and you need to start learning about that now.
    • The SQLite and InterBase support for iOS
    • ClientDataSet available on iOS
    • Several FireMonkey changes for iOS, componentes, new classes
    • Etc..

    RAD Studio XE4 now includes only Delphi, C++Builder and HTML5Builder. Delphi Prism is no longer part of RAD Studio, the name is dead and from now you have to refer to Oxygene from RemObjects. You can check the official communication from RemObjects here, where Marc Hoffman provide more details about the future related to .NET development with Oxygene (old Prism) and their support to iOS and Android development.

    Trial is already available here or if you prefer download the full Delphi and C++Builder ISO here.

    The Delphi XE4 documentation has a extensive list of What’s new in Delphi and C++Builder XE4, below the table of content:

    That’s it for now.

    Andreano Lanusse | Technology and Software Development
    Follow me on Twitter: @andreanolanusse

    Behind the connection: Serial Port Programming RS232 / RS485

    $
    0
    0
    Using the serial port is a common task and there are a huge number of components for doing that. I'm using TCiaComPort by Wilfried Mestdagh for years. It is a freeware with source code available at: http://www.mestdagh.biz/soft_components.html Recently, I have updated the source code for Unicode enabled Delphi versions. I use it with Delphi XE3 but it should be OK starting from D2009. My use

    Te Waka o Pascal: DPROJ Woes

    $
    0
    0
    I spent the best part of half a day last week trying to get to the bottom of a very strange issue on a project I was working on. I had just created a new unit in the project and had reached a point where I needed to add that unit to the uses list [...]

    The Wiert Corner - irregular stream of stuff: jpluimers

    $
    0
    0

    You might think the below question on CodePage zero is Delphi related, but most of it is not.

    It is about CP_ACP (the currently Active CodePage, and has some interesting observations:

    CP_ACP is the major reason people have difficulties exchanging the data in text files between applications on different computers.

    Oh and you can get the actual value of the active Active CodePage using GetACP, but CP_ACP isn’t always slower..

    –jeroen

    via: delphi – What is Codepage 0? – Stack Overflow.


    Filed under: .NET, Delphi, Development, Software Development

    The Podcast at Delphi.org: 52 – Marco Cantu & Delphi XE4 for iOS

    $
    0
    0

    The big news for Today, April 22nd, 2013 is the release of RAD Studio XE4 which includes the new Delphi for iOS. I thought it would be fitting to talk with Marco Cantu, long time Delphi author and supporter who recently took over as the Delphi product manager.

    The big news for Today, April 22nd, 2013 is the release of RAD Studio XE4 which includes the new Delphi for iOS. I thought it would be fitting to talk with Marco Cantu, long time Delphi author and supporter who recently took over as the Delphi product manager.

    Behind the connection: Delphi XE4 is available

    $
    0
    0
    With Embarcadero RAD Studio XE4 you can create true native apps for PCs, tablets, and smartphones from a single code base, and get them to markets and users fast. True native apps run directly on the device, getting full access to all underlying capabilities, tighter security, and a better user experience. Try it! http://embt.co/RADXE4Trial Now you have one set of development tools to create

    The Wiert Corner - irregular stream of stuff: jpluimers

    $
    0
    0

    Firebird News: Database Workbench 4.4.0 released

    $
    0
    0
    Upscene Productions is proud to announce the next version of the popular multi-DBMS development tool: ” Database Workbench 4.4.0 Pro ” For more information, see here. This version includes small new features, enhancements and fixes for issues as reported by our users. Changes include: improved SQL Insight improved stored routine debugging improved Unicode support And [...]

    DelphiTools.info: Not in (interpreted) Kansas anymore

    $
    0
    0

    dws-mirrorFor a few weeks now, an experimental JIT compiler has been available in the DWScript SVN for 32bits code. A more detailed article into the hows and whats and WTFs will come later.

    Consider this article as an extended teaser, and a sort of call for test cases, benchmarks and eyeballs on the source code.

    Following benchmarks were compiled in XE2 with full optimization, no stack frames and no range checking. Absolute values aren’t meaningful, just consider them relatively.

    Mandelbrot fractal

    bench_mandelbrot(lower is better)

    Delphi XE2-32bit : 515
    Delphi XE3-64bit: 162
    DWScript JIT 32bit: 281

    The JIT was initially tested on the Mandelbrot benchmark, so that’s one of the cases where JITing is almost complete, with the exception of the SetPixel() call.

    SciMark 2

    bench_scimark(higher is better)

    Delphi XE2-32bit : 507
    Delphi XE3-64bit: 682
    DWScript JIT 32bit: 215

    Delphi version uses pointers, DWScript version was slightly updated to use dynamic arrays instead  and JITting is partial at the moment.

    The benchmark involves fairly large matrices, and DWScript use of Variant (16 bytes) rather than Double (8 bytes) means the data no longer fits in the CPU cache, which partly accounts for the poor showing of the JIT.

    Array statistics

    bench_array_stats(lower is better)

    Delphi XE2-32bit : 208
    Delphi XE3-64bit: 47
    DWScript JIT 32bit: 63

    This test measures of execution time of the following code (fully JITted), which computes the base values for common array statistics (range, average, deviation, etc.). The Delphi 32bit compiler really suffers because of Min/Max (despite having inlined them).

    // "a" a floating point array of non-ordered values
    for v in a do begin
       s := s + v;
       s2 := s2 + v*v;
       mi := Min(mi, v);
       ma := Max(ma, v);
    end;

    What next?

    The DWScript JIT compiler relies on SSE2 to outperform the Delphi 32bit compiler, its current main limitations are:

    • JIT centers around floating point and a limited subset of integer and Boolean operations, the rest isn’t JITted yet.
    • Function calls aren’t JITted at the moment, and neither are a variety of other statements.
    • The JIT works with the same data structures as the interpreted engine, that means script debuggers and everything else works on JITted code as if it was still interpreted, but that also means the basic data unit is still the 16 bytes Variant at the moment.
    • The JIT register allocator is currently limited to floating point (ie. no integer or pointer allocations).
    • DWScript Integer type is 64bit sized, so for 32bit values, Integer performance is lower than what Delphi 32 can do, even though the JIT can generate typically faster code for it than the Delphi 32bit compiler does for Int64.

    The JIT also suffers against a 64bit compiler as there are 64bit CPU instructions (and registers) not accessible in 32bit mode, but a 64bit JIT should be able to go farther.

    If you’re interested and want to help, I’m currently looking for benchmarks and test cases, if you have code that compiles in both Delphi and DWScript,  particularly on integer maths (encryption, etc.) or object-oriented manipulations (graphs, trees…) that could help. You’re even allowed to have the Delphi version use pointers and other tricks, the comparison doesn’t need to be fair ;-)

    Viewing all 1725 articles
    Browse latest View live