Categories
Conferences

CodeRage C++

Tomorrow is the start of CodeRage 8 C++, which is a lot like regular CodeRage, but with an emphasis on C++Builder. This time there is a lot of coverage on the new iOS support, as well as the new REST Components and FireDAC data access.

It all starts with JT’s opening keynote at 6:00 AM Pacific Time, which may also be of interest to Delphi developers who want to get some glimmers of future plans, roadmaps and announcements. Actually most of the sessions will have content of interest to Delphi developers, especially if you’ve missed some of the more recent CodeRage conferences. But if you are a C++ developers, then be sure to make time for all the sessions!

CodeRage C++ - February 25-26, 2014

Categories
Commentary

The Delphi Object Pascal Language

What’s in a name? That which we call a rose
By any other name would smell as sweet;

The other day I noticed Github has a language choice for Pascal, but not Delphi. It turns out originally they had Delphi listed as a language, but some of the Delphi clones were getting marked as Delphi, so they renamed it to the more generic Pascal. Which immediately resulted in people requesting they rolled it back.

This brings up a good question though, “What is Delphi and what is Object Pascal?” Interestingly there were three implementations of Object Pascal that evolved from the original Pascal. The one we are all familiar with was designed at Borland as part of Turbo Pascal. Apple also designed one consulting with Nicholas Wirth. And there was the Think Pascal IDE with it’s own flavor.

The Borland flavor of Object Pascal evolved into the language we see in Delphi today, while the other two faded away. There actually exists a few other variations of Object Pascal, most all of which were inspired by the language that still lives in Delphi today.

Personally I think it is exciting to see so many other tools and languages in the Object Pascal and Pascal space. That is part of what made C & C++ so vibrant: All the other languages wanted to copy them (Java, JavaScript, C#, etc.)

So back to the question, “What is Delphi and what is Object Pascal.” Object Pascal is the language that powers Delphi. Object Pascal can exist without Delphi, but part of what defines Delphi is it’s Object Pascal language. Just in the same way C++Builder isn’t the only implementation of C++, but part of C++Builder is the C++ language. So Delphi and C++Builder are each the whole package: Language + IDE + Compiler + Debugger + Libraries + Tools. You could say they are the definitive implementation of those languages.

Could we see Delphi with a different language? That would be interesting. At one end of the spectrum there was Delphi for PHP (which evolved into HTML5 Builder.) It was Delphi’s Rapid Application Development concept combined with the PHP language. And then Delphi Prism which used the Oxygene language variant of Object Pascal combined with Visual Studio and .NET.

In my opinion, Delphi is a specific version of Object Pascal, if for no other reason than because it has a fabulous runtime library and framework. Using Object Pascal without TStringList and all the other useful types, function and libraries that Delphi comes with wouldn’t be much fun.

Categories
Commentary

Hidden features in the Delphi Object Pascal language

A list of hidden features in Delphi Object Pascal that are great, obscure, best avoided or remarkable.

This was copied from Stack Overflow’s question of the same name which is closed and flagged for deletion. Licensed under cc by-sa 3.0 with attribution required. I’ve made a few changes, updates and some copy editing. Original question by Johan and others on May 19 2011 at 18:34. Post inspired by Jeroen W. Pluimers’ post.

Categories
Components Tools

Indispensable Delphi Libraries

What are your indispensable Delphi libraries? The 3rd party libraries you just can’t imagine starting a new project without? I know mine have changed over the years and we have an interesting new crop of libraries in recent years. I listed some unit testing libraries recently, but thought it would be useful to focus on general purpose libraries (as opposed to visual component suits). Here are some open source libraries I either find myself using a lot, or I look forward to using:

I’m sure there are a lot that I am missing . . . What would you add to my list?

Categories
webinar

Delphi Unit Testing Tools

Recently I was discussing with some friends if everyone should learn to code and one friend said “I think everyone should learn to write unit tests.” I was reading Nick Hodges’ Coding In Delphi book (available free when you buy XE5) in the chapter on Unit Tests and my son asked me about it. In trying to explain it to him, my son was convinced it was a great idea and wanted to know why everyone didn’t do unit testing. Good question.

This month, for our RAD-In-Action webinar series we have Nick Hodges talking about Unit Testing in Delphi. If you sign up to attend the event you get a copy of the chapter on unit testing from Nick’s book. It is a good one.

Wednesday, February 12, 2014

This is sure to be a great event, and I highly recommend everyone makes time for it. In preparation for the event I thought I would list out some Delphi Unit Testing tools. These are covered in Nick’s book, but I’ll add my commentary here:

  • DUnit: The original unit testing framework for Delphi. It still ships with Delphi, and still works great.
  • DUnit2: A fork of the original DUnit this is an alternative unit testing framework that is enhanced to work with the language features introduced in Delphi 2009.
  • DUnitX: There are a lot of new language features in Delphi since DUnit was created. DUnitX is a whole new unit testing framework that takes advantage of these new language features to do some really cool things. MVP Robert Love has an excellent blog post about some of the cool things you can do with DUnitX and his plans and contributions.
  • Delphi Code Coverage: Curious how much of your code is covered by unit tests? This tool answers that question for you. There is a wizard that goes with it to integrate it into the IDE.
  • Delphi Mocks: One of the tricks with unit testing is to separate dependencies, but if your code depends on a database or network socket, how do you test it by itself? Enter Mocks. A brilliant tool to let you test the independent units of code without dependencies.

One side not about unit testing is you actually don’t need to use a framework, you just need to do it. Maybe there is another framework or tool you use, or you’ve developed your own in-house methodology. I’d love to hear about it, and I hope you join us Wednesday for Nick’s webinar, and bring your questions. I’ve got a few myself.

Categories
Android iOS webinar

Revisiting Google Glass

Few weeks ago I posted about how to launch a Google Glass app with a voice command. The app I built used buffered sensor data from the accelerometer and smooth animation to show a level. The video below is from our Making the Connection: Programming Devices and Gadgets with RAD Studio where I put all the pieces together.

Google Glass is an exciting new platform and form factor. Éric Bonilha from Digifort joined us to show interfacing IP Controllers and streaming video from IP Cameras.

Something we didn’t get to show is Éric built a prototype app for streaming video to Google Glass. His plan is to build a version of his camera surveillance app for Google Glass that will stream surveillance video to security guards on patrol. Additionally it will stream the video from Google Glass back to the security system.

It was so cool how fast Éric used Delphi XE5 to prototype accessing the camera on Google Glass and streaming video from his system to it.

The source code for my Google Glass app, and Éric’s code for accessing IP Camera & IO Controllers is available along with the replay from our RAD-In-Action Webinar. I’m looking to pick up a PTZ IP Camera and streaming it to my Google Glass next.

Categories
Android Components iOS Tools

Scanning Barcodes with RAD Studio XE5

Turns out there are a few ways to scan a barcode with RAD Studio XE5, and no sooner do I make a video about it then TMS releases a component to scan barcodes, and then Thomas Krampe sends me his component that combines them all together.

Not that we need another barcode scanning app on our smartphones, but it can be a useful feature for an app that performs another purpose to be able to scan a barcode too.

This video was part of our Making the Connection: Programming Devices and Gadgets with RAD Studio webinar. Check out the on demand replay to get the source code.

Categories
gadgets

Connecting to the Kinect for Windows with RAD Studio XE5

The Kinect is a 3D motion sensing input device for Windows. Based around a webcam-style add-on peripheral, it enables users to control and interact with their computer through a natural user interface using gestures and spoken commands.

You can get the Kinect SDK and drivers from Microsoft and the Delphi header files and samples from Google Code. This video was part of the Making the Connection: Programming Devices and Gadgets with RAD Studio webinar. You can view the full directer’s cut of the webinar on demand and download the code.

Categories
REST Source Code Tools

XE5 REST Debugger Supercharged

Some people asked for the source code to using the new XE5 REST Client Library to consume the Kimono web service. The crazy thing is there isn’t any. I decided to make a video about how easy it is to consume REST web services the the new REST Client Library and the REST Debugger. In the process I thought of a way to make it even easier by supercharging the Rest Debugger (source code below).

In this video I show you how to create a REST Web service with Kimono Labs (in beta, so it will change) and then bind that data to your XE5 app using the REST Debugger.

You can supercharge your REST Debugger too. The source code is installed with XE5

C:\Program Files (x86)\Embarcadero\RAD Studio\12.0\source\data\rest\restdebugger

You will want to copy it somewhere else before modifying it. Then add a button where ever you want, and on the click event for the button add the following code:

StreamToClipboard([RESTClient, RESTRequest, RESTResponse, RESTResponseDataSetAdapter, RESTClient.Authenticator]);

And then download uCopyComponents.pas and add it to your project and uses clause. It is pretty simple, but is designed specifically to work with non-visual components, although could be modified to work with visual components too.

If you want to include the TClientDataSet in the copy, then add it to the array (although make sure it is not active). Or you could modify it to add a TFDMemTable. Use it how you wish, I hope it works for you. If you discover any bugs make any changes let me know. If anyone is interested in contributing to it, let me know.

Categories
webinar

Oh Yeah, the Ouya!

The Ouya is an Android powered game console / set-top box that you can pick up for $99. Not only is it a cheap game console, but it is also an affordable Android platform designed to drive big screen TVs. Easily turn a TV into a wall mounted dashboard or living picture frame.

Once the ADB driver is installed, You can develop for and deploy to it with Delphi XE5 just like any other Android device.

This video is from our Making the Connection: Programming Devices and Gadgets with RAD Studio webinar. Check out the on-demand replay and download the full source code too.

The Ouya has an SDK that goes beyond what I showed above. I’ll be revisiting it with more updates in the future.