Firebird News: Firebird Transaction Simulator
Firebird News: Last chance to subscribe to FDD
Firebird News: Screencast – Trace failed SQL statements with the Firebird Trace API and FB TraceManager
DelphiTools.info: DWScript Programming enters TIOBE
Daniel Magin's Logfile: FMX TForm do NOT use ShowModal
Working on a big Delphi Firemonkey iOS Project i found out calling TForm Method ShowModal create such cross effects for incalculable situations. Working with UITableViewController for example the created SubForms the bouncing effects are not working anymore correct.
So if you create and show a form with a parent form created with show modal replace it with show Method
myNewForm:=TMyForm.create(self);
myNewForm.ShowModal;
myNewForm.Show;
btw: in iOS projects a showModal Method fit not in the concept from iOS.
Andreano Lanusse | Technology and Software Development: Delphi Developers plan for mobile, desktop and n-tier development
Early this year I did a developer survey through my blog. I got over 1500 answers and I safely can say 87% use Delphi as their primarily development tools, the other 13% split between C#, C/C++, PHP and other languages.
Mobile Development
On the mobile development arena I asked about their company plans for mobile development in 2013, and the results are interesting:
- On Android development, 45% will develop apps for Android, 16% maybe will do some development and 5% don’t have any plan in 2013.
- 28% will develop apps for iOS, 24% maybe will do some development, which we can consider pretty high, and 11% don’t have any plan for iOS in 2013.
- Windows Phone is not in a good position; only 13% will do development for Windows Phone. Looking for the Microsoft Tablet (Surface), this one is way behind.
- BlackBerry is not the favorite platform and has only 3% of the developers considering to develop, 11% not sure yet, and 40% will not develop at all.
Android is the first choice, most of Delphi Developers do business application and I see a natural choice on Android, the number of devices out there and the lower price point when compared with iPhone/iOS leads Android more in to the business application development. When we look international market iOS devices would cost at least 60% more then Android devices, different reality from iOS, where we can pay US$200 on an iPhone.
Desktop and N-Tier Development
When asked about desktop development I made three questions, which I believe it’s correlated, here the questions:
- Is your company planning to develop new Desktop applications in 2013?
- Is your company planning to migrate existing Desktop applications to the Web in 2013?
- Which of the following architecture would you use for new applications?
The results showed a clear demand for desktop development, where 73% of the interviewees plans to develop new desktop applications, however when you cross that with the architectural questions, 70% would use N-Tier architecture and only 24% would consider Client/Server.
There is also a significant number of companies (45%) considering to migrate existing desktop applications to the web, 34% not planning and 21% didn’t decide yet. That information leads to us think about the challenges to migrate legacy applications where you can see all kinds of situation. Talking with developers I see most of the time the following scenarios:
- High cost to migrate legacy code, which can’t be financially justifiable
- High demand for maintenance and new projects, that doesn’t allow the team to stop or dedicate time to the migration project
- The current application is working, no reason to change
- And many others
Years ago the software development world moved away rom the traditional Client/Server in to the distributed development. There are so many technologies and architectures for distributed systems out there (SOA, REST, SOAP, WebServices, etc.), which are supported for many languages and IDE’s, but bring the question “Which software vendor has the best implementation and support for distributed applications?”.
Looking forward to see your comments and what’s your choice to build distributed applications?
Related Posts
Andreano Lanusse | Technology and Software Development
Follow me on Twitter: @andreanolanusse
Firebird News: Firebird, Angularjs, Node and Socket.IO – Part 1
Firebird News: Firebird .Net Provider is moving to Git/Github
Firebird News: Database Workbench 4.4.0 free Lite Editions released
DelphiTools.info: New theme
The Wiert Corner - irregular stream of stuff: jpluimers
2 more issues got on-line both close to a 100 pages each:
So the only issues missing are #28, #30 and #31.
–jeroen
Filed under: Assembly Language, C, C++, Development, Pascal, Software Development, Turbo Pascal, Turbo Prolog, x86 Tagged: media, technology
Firebird News: Firebird Embedded on MacOSX article is Updated
TPersistent: Sorting things out with the TDebugInspector
If you have ever used the Debug Inspector you might have noticed it can be rather challenging to find a property, or method in a larger class that is a distant descendant of TObject. Data, Methods and Property names are intermixed in their respective tabs, starting with (I believe) their root ancestor downwards. IOW, they don’t appear in alphabetical order.
The Debug Inspector uses the same TInspListBox as the the ObjectInspector, so you can search for items by name by selecting the item, pressing Tab (The cursor will appear in the names section of the list), and typing the name of the item you’re looking for. Unfortunately, using such a “Begins With” search has limited usefulness when the items are not sorted alphabetically.
Anyone know how to alphabetize this list?
Firebird News: Firebird Driver and Embedded version merged into LibreOffice git master
DelphiTools.info: Mobile performance – a look back
The road to Delphi: Listing the running user applications under osx using Delphi
The NSWorkspace class provides a set of methods and properties which allow open and manipulate files, applications and others useful tasks. One of these properties can be used to list the running applications. The property is runningApplications , this will return an array of NSRunningApplication elements representing the running applications. Unfortunately the definition of this interface (NSRunningApplication) in the Macapi.AppKit is incomplete.
NSRunningApplication = interface(NSObject) ['{96F4D9CA-0732-4557-BA1F-177958903B8F}'] function activateWithOptions(options: NSApplicationActivationOptions): Boolean; cdecl; function activationPolicy: NSApplicationActivationPolicy; cdecl; function executableArchitecture: NSInteger; cdecl; function forceTerminate: Boolean; cdecl; function hide: Boolean; cdecl; function isActive: Boolean; cdecl; function isFinishedLaunching: Boolean; cdecl; function isHidden: Boolean; cdecl; function isTerminated: Boolean; cdecl; function processIdentifier: Integer; cdecl; function terminate: Boolean; cdecl; function unhide: Boolean; cdecl; end;
As you can see in the above definition there is not a property to retrieve the application name or path. So the first task in order to retrieve the list of the running applications is add the missing properties like so.
NSRunningApplicationEx = interface(NSObject) ['{96F4D9CA-0732-4557-BA1F-177958903B8F}'] function activateWithOptions(options: NSApplicationActivationOptions): Boolean; cdecl; function activationPolicy: NSApplicationActivationPolicy; cdecl; function executableArchitecture: NSInteger; cdecl; function forceTerminate: Boolean; cdecl; function hide: Boolean; cdecl; function isActive: Boolean; cdecl; function isFinishedLaunching: Boolean; cdecl; function isHidden: Boolean; cdecl; function isTerminated: Boolean; cdecl; function processIdentifier: Integer; cdecl; function terminate: Boolean; cdecl; function unhide: Boolean; cdecl; //Added functions(properties) //Indicates the URL to the application's executable. function executableURL : Pointer; cdecl;//@property (readonly) NSURL *executableURL; //Indicates the name of the application. This is dependent on the current localization of the referenced app, and is suitable for presentation to the user. function localizedName : Pointer; cdecl;//@property (readonly) NSString *localizedName; //Indicates the URL to the application's bundle, or nil if the application does not have a bundle. function bundleURL : Pointer; cdecl;//@property (readonly) NSURL *bundleURL; //Indicates the CFBundleIdentifier of the application, or nil if the application does not have an Info.plist. function bundleIdentifier : Pointer; cdecl;//@property (readonly) NSString *bundleIdentifier; //Indicates the date when the application was launched. This property is not available for all applications. Specifically, it is not available for applications that were launched without going through LaunchServices. */ function launchDate : Pointer;cdecl;//@property (readonly) NSDate *launchDate; //Returns the icon of the application. function icon : Pointer;cdecl;//@property (readonly) NSImage *icon; end; TNSRunningApplicationEx = class(TOCGenericImport<NSRunningApplicationClass, NSRunningApplicationEx>) end;
Now using a TStringGrid we can list all the user applications running
var LWorkSpace : NSWorkspace; LApp : NSRunningApplicationEx; LFormatter : NSDateFormatter; i : integer; LArray : NSArray; begin LWorkSpace:=TNSWorkspace.create;//or TNsWorkspace.Wrap(TNsWorkSpace.OCClass.sharedWorkspace); LArray:=LWorkSpace.runningApplications; //NSDateFormatter Class Reference //https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSDateFormatter_Class/Reference/Reference.html TNSDateFormatter.OCClass.setDefaultFormatterBehavior(NSDateFormatterBehavior10_4); LFormatter:=TNSDateFormatter.Create; LFormatter.setDateFormat(NSSTR('HH:mm:ss YYYY/MM/dd')); if LArray<>nil then begin StringGrid1.RowCount:=LArray.count; for i := 0 to LArray.count-1 do begin LApp:= TNSRunningApplicationEx.Wrap(LArray.objectAtIndex(i)); StringGrid1.Cells[0,i]:=LApp.processIdentifier.ToString(); if LApp.launchDate<>nil then StringGrid1.Cells[1,i]:=string(LFormatter.stringFromDate(TNSDate.Wrap(LApp.launchDate)).UTF8String); StringGrid1.Cells[2,i]:=string(TNSString.Wrap(LApp.localizedName).UTF8String); StringGrid1.Cells[3,i]:=string(TNSURL.Wrap(LApp.executableURL).path.UTF8String); if LApp.bundleIdentifier<>nil then StringGrid1.Cells[4,i]:=string((TNSString.Wrap(LApp.bundleIdentifier).UTF8String)); if LApp.bundleURL<>nil then StringGrid1.Cells[5,i]:=string(TNSURL.Wrap(LApp.bundleURL).path.UTF8String); case LApp.executableArchitecture of NSBundleExecutableArchitectureI386 : StringGrid1.Cells[6,i]:='I386'; NSBundleExecutableArchitecturePPC : StringGrid1.Cells[6,i]:='PPC'; NSBundleExecutableArchitecturePPC64 : StringGrid1.Cells[6,i]:='PPC64'; NSBundleExecutableArchitectureX86_64: StringGrid1.Cells[6,i]:='X86_64'; end; end; end; end;
And this is the final result.
Note : The runningApplications property only list the user applications and does not provide information about every process on the system. In order to access to all the process you can use the sysctl function with the CTL_KERN, KERN_PROC, KERN_PROC_ALL values.
Download the sample FireMonkey project from here.
The Wiert Corner - irregular stream of stuff: jpluimers
I bumped into the below answer that I gave a while (what is 4 years in a developer’s life ) on StackOverflow.
It is about Delphi Design Patterns. Sepcifically the Factory Pattern, and explains how virtual constructors implement it.
They are one of the 3 corner stones on which the component based Delphi form designer and object inspector are built:
- Virtual constructors
- Properties (events are just a special form of property)
- Run-Time Type Information.
So here it goes:
Only a minority of the Delphi developers knows that every Delphi developer uses a Factory pattern (delphi.about.com has an example in “regular” Delphi), but then implemented using virtual Create constructors.
So: time to shed some light on that :-)
Virtual constructors are to classes like virtual methods are like object instances.
The whole idea of the factory pattern is that you decouple the logic that determines what kind (in this case “class”) of thing (in this case “object instance”) to create from the actual creation.
It works like this using virtual Create constructors:
TComponent has a virtual Create constructor so, which can be overridden by any descending class:
type TComponent = class(TPersistent, ...) constructor Create(AOwner: TComponent); virtual; ... end;
For instance the TDirectoryListBox.Create constructor overrides it:
type TDirectoryListBox = class(...) constructor Create(AOwner: TComponent); override; ... end;
You can store a class reference (the class analogy to an object instance reference) in a variable of type ‘class type’. For component classes, there is a predefined type TComponentClass in the Classes unit:
type TComponentClass = class of TComponent;
When you have a variable (or parameter) of type TComponentClass, you can do polymorphic construction, which is very very similar to the factory pattern:
var ClassToCreate: TComponentClass; ... procedure SomeMethodInSomeUnit; begin ClassToCreate := TButton; end; ... procedure AnotherMethodInAnotherUnit; var CreatedComponent: TComponent; begin CreatedComponent := ClassToCreate.Create(Application); ... end;
The Delphi RTL uses this for instance here:
Result := TComponentClass(FindClass(ReadStr)).Create(nil);
and here:
// create another instance of this kind of grid SubGrid := TCustomDBGrid(TComponentClass(Self.ClassType).Create(Self));
The first use in the Delphi RTL is how the whole creation process works of forms, datamodules, frames and components that are being read from a DFM file.
The form (datamodule/frame/…) classes actually have a (published) list of components that are on the form (datamodule/frame/…). That list includes for each component the instance name and the class reference.
When reading the DFM files, the Delphi RTL then:
- finds about the components instance name,
- uses that name to find the underlying class reference,
- then uses the class reference to dynamically create the correct object
A regular Delphi developer usually never sees that happen, but without it, the whole Delphi RAD experience would not exist.
Allen Bauer (the Chief Scientist at Embarcadero), wrote a short blogarticle about this topic as well.
There is also a SO question about where virtual constructors are being used.Let me know if that was enough light on the virtual Create constructor topic :-)
–jeroen
via: What Design Patterns do you implement in common Delphi programming? – Stack Overflow.
Filed under: Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Software Development
Behind the connection: Creating an AVI file from bitmaps using Delphi
Delphi Haven: How to have a blue FMX TPanel, redux
Back in the XE2 timeframe, I published a short post about giving a TPanel a custom colour. While the solution still works in XE4, give or take an extra unit in the uses clause or use of the TAlphaColors.ColorName syntax rather than claColorName, nowadays I’d emphasise the first part of my original advice. This was quite simple – don’t try and give a TPanel a custom colour in the first place! If you want an irregularly styled TPanel, use a TRectangle instead, whose colours you can customise to your heart’s content:
- Add a TRectangle to the form.
- Change Stroke.Color to Gray.
- Change Fill.Color to whatever you want.
- At runtime, change the colour with code like this:
MyRectangle.Fill.Color := TAlphaColors.Blue;
Annoyingly, and dating from the infamous XE2 update 4, TRectangle is made to pretend it can’t parent other controls at designtime. As such, when a TRectangle is selected and you double click on a control type in the Tool Palette, the new control is added parented to the rectangle’s parent, not the rectangle itself. However, you can use the Structure pane top left to reparent controls as you wish.
As an aside, this highlights a key difference between FMX and the VCL: in FMX, all controls can potentially be parents to any other. Once you grasp this point, obsessing over wanting to use a TPanel specifically, even though you don’t want the normal TPanel ‘look’, is completely illogical.
The Wiert Corner - irregular stream of stuff: jpluimers
Bitsavers published 2 new Logitech PDFs:
Who didn’t have a Logitech mouse back then?
I had the C7, various MouseMans, and a few more modern mice. Why not all mice? I developed RSI in the DOS era, ending up with TrackPoints and more recently Apple touchpads)
I remember the Logimouse C7, not because it was from Logitech, but because it was available from so may OEMs. Long before Logitech built OEM mice for Apple, they were founded in Apples, Swizerland.
The cool thing: the Programmers Toolkit had examples in Modula-2. I used that as a base to write quite some Turbo Pascal code for mouse handing.
Oh: Bitsavers does have a Logitech Modula-2 PDF online too for quite some time. I mentioned that in More Old Micro Cornucopia issues on BitSavers from 1987 and 1988.
–jeroen
via: Bitsavers’ Index of /pdf/logitech.
Filed under: Development, Pascal, Power User, RSI, Software Development, Turbo Pascal Tagged: c7, cornucopia, logitech mouse, modula 2