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

Firebird News: Firebird Transaction Simulator

$
0
0
The transaction simulator uses either scripts or random commands to simulate the Firebird database versioning system and the result of the simulator are checked with Firebird’s outputs. Read committed and Snapshot transactions are presented. Some remarks about long transactions and Firebird slowdown caused by transactions

Firebird News: Last chance to subscribe to FDD

$
0
0
Sorry, this is mostly for Brazilians… Sexta-feira é o último dia para se inscrever antecipadamente para o Firebird Developers Day. Todas as informações podem ser obtidas no site do evento: www.FirebirdDevelopersDay.com.br

Firebird News: Screencast – Trace failed SQL statements with the Firebird Trace API and FB TraceManager

$
0
0
New Screencast with FB TraceManager from Thomas Steinmaurer

DelphiTools.info: DWScript Programming enters TIOBE

$
0
0
As a followup to the TIOBE & Pascal micro saga, thanks to David Champion, DWScript programming is now a (very) small part of the TIOBE TPCI stats, and Oxygene became its own language at position #163. Here is an excerpt from the TIOBE update for July 2013 An interesting discussion with David Champion resulted in [...]

Daniel Magin's Logfile: FMX TForm do NOT use ShowModal

$
0
0

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

$
0
0

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.

Survey Mobile  2013

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.

Survey 2013 - Architecture


Survey 2013 - Desktop

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

Survey 2013 - Migration

 

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?

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

Firebird News: Firebird, Angularjs, Node and Socket.IO – Part 1

$
0
0
John Tomaselli wrote on his blog about his main stack: I’m going to post my latest project I’m working on and will go back to publish some older works that might be of interest to the community. About a year ago I attended an AngularJS meetup at Google’s NY office and since then have completely [...]

Firebird News: Firebird .Net Provider is moving to Git/Github

$
0
0
Jiri Cincura wrote about his issues with SourceForge and SVN also his idea to move to a better system : git/github: Maybe you remember the thread “Releasing more often???“. Yeah and nothing happened. Because there was not a strong protest, I think it’s something we all ‘d like to have. I was lately really pissed [...]

Firebird News: Database Workbench 4.4.0 free Lite Editions released

$
0
0
Upscene Productions is proud to announce the next version of the popular Windows-based multi-DBMS development tool: ” Database Workbench 4.4.0 Lite ” For more information, see here. Database Workbench Pro supports: - Borland InterBase (6.x – XE ) - Firebird ( 1.x, 2.x ) - MS SQL Server/MSDE ( 7, 2000, 2005, 2008, MSDE 1 [...]

DelphiTools.info: New theme

$
0
0
Time for a summer facelift! This website is getting new responsive theme which is more mobile-device friendly and will hopefully load slightly faster. Truth be told, I was also getting tired of seeing the old look here and in 618965 other blogs and websites. I’ve changed the theme from the aging inove (fixed) to a customized version…

The Wiert Corner - irregular stream of stuff: jpluimers

Firebird News: Firebird Embedded on MacOSX article is Updated

$
0
0
Paul Beach wrote on his blog : Based on a document written by Fulvio, a while ago, I finally spent time writing a make file that will automatically create an embedded version of Firebird that will run on MacOSX as a bundle.

TPersistent: Sorting things out with the TDebugInspector

$
0
0

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 Delphi Debug Inspector

The Delphi Debug Inspector

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

$
0
0
Changes to libreoffice and firebird driver can be seen in the git log And here is announcement : Firebird has now been integrated into LibreOffice master! It now builds on Mac and Windows in addition to Linux. (I’ve only tested on Linux but will be testing/fixing as necessary on Mac/Windows this week.) The database driver [...]

DelphiTools.info: Mobile performance – a look back

$
0
0
How fast are mobile CPUs these days? Well, they are pretty fast processors. While some still consider that x86 is ten times faster than ARM, that is just not the case anymore these days, the difference is much smaller, and closer to just two times if you compare a regular smartphone to a regular laptop/desktop.…

The road to Delphi: Listing the running user applications under osx using Delphi

$
0
0

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.

Mac OS X Lion

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

$
0
0

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:

  1. finds about the components instance name,
  2. uses that name to find the underlying class reference,
  3. 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

$
0
0
It is quite easy to create an AVI file from a number of individual bitmaps. The AVI file maybe compressed on the fly using any installed codec. An example application would be creating a video from computer generated images such as 3D view or discrete bitmaps such as those generated from a Mandelbrot fractal zoom in. Each zoom step produces a new bitmap. Taking all bitmap into an AVI makes a nice

Delphi Haven: How to have a blue FMX TPanel, redux

$
0
0

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:

  1. Add a TRectangle to the form.
  2. Change Stroke.Color to Gray.
  3. Change Fill.Color to whatever you want.
  4. 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

$
0
0

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
Viewing all 1725 articles
Browse latest View live