Sunday, February 26, 2012

Embarcadero Academy

In 2012, Embarcadero with the help of Slovenian distributor Marand is preparing a series of presentations, focused on different aspects of Delphi programming – Unicode, FireMonkey, multiplatform development, Object Pascal as a modern programming language, debugging, multithreading and more. Presentations will be given in Slovenian language by yours truly. The rest of my post is directed to potential participants and is therefore written in the Slovenian language.

Friday, February 24, 2012

Exceptions in Async

Pop quiz time! What would the user see if this code is executed in your application?

Parallel.Async(
procedure
begin
raise Exception.Create('Exception in Async'); end);

The answer may surprise you: Nothing! At least if you’re not using the latest SVN version.

Wednesday, February 22, 2012

Introduction to Debugging

Blaise Pascal Magazine #21 is out with with my introductory article on debugging. Two more advanced articles on the same topic are scheduled to follow.

Tuesday, February 21, 2012

Accelerometer Revisited

I wrote about handling accelerometer in iOS from the browser before (Detecting Device Movement, Accelerometer Demo) but I wasn’t happy enough with my code and I promised to return with the third part. Today I returned to the topic with advanced features – handling data smoothing and calibration.

Monday, February 20, 2012

Sunday, February 19, 2012

Blaise Pascal Magazine Rerun #9: High Level Multithreading

This article was originally written for the Blaise Pascal Magazine and was published in Issue #18.
Relevant Delphi code is available at
http://17slon.com/blogs/gabr/BPM/HighLevel.zip.

Saturday, February 18, 2012

Friday, February 17, 2012

OmniThreadLibrary Documentation: Future

I have just finished a pretty long chapter on futures.

Any comments, corrections, ideas etc are welcome.

8 Simple Rules for Modifying Production Database

  1. Make sure you have a backup!
  2. And by that I mean a fresh backup, made just now, not an idea that there may exist a person who knows where a backup is stored!
  3. Make sure you can restore from the backup!
  4. And by that I mean that you have tested the restore procedure. On the backup that you have just created. And that you have tried accessing restored backup with the program that usually operates on it!
  5. Don’t type any SQL commands. Use only scripts/programs that were previously tested on a development/test database.
  6. And by that I mean tested by yourself, not by a fictitious somebody who may have tested a script three years before on a database used by a completely different program!
  7. Don’t modify production database!
  8. And by that I mean DON’T MODIFY PRODUCTION DATABASE!

Thursday, February 16, 2012

Tuesday, February 14, 2012

Monday, February 13, 2012

Blaise Pascal Magazine Rerun #5: Four Ways to Create a Thread

This article was originally written for the Blaise Pascal Magazine and was published in Issue #10.
Relevant Delphi code is available at http://17slon.com/blogs/gabr/BPM/FourWaysToCreateAThread.zip.

Blaise Pascal Magazine Rerun #4: Introduction to Multithreading

This article was originally written for the Blaise Pascal Magazine and was published in Issue #9.

Friday, February 10, 2012

Accelerometer Demo

My accelerometer blog ended rather abruptly, without a demo program so today I’m returning to the topic.

To test the accelerometer control I wrote a very simple program in which you can move a rectangle around the screen by tilting your iOS device. You can test it here.

This program builds heavily upon the source code I found on Alberto Sarullo’s blog. Thanks!

Wednesday, February 08, 2012

OmniThreadLibrary Documentation: Async

First small part of the forthcoming documentation is available in the wiki, Any comments, corrections, ideas etc are welcome.

Tuesday, February 07, 2012

Detecting Device Movement

For my next quest I decided to find out how accelerometer works in web applications. IOW, I wanted to control an object on my HTML page just by moving my iPad around.

I limited my quest to iOS because that’s my favorite toy. don’t know yet how to do it in Android – this StackOverflow post hinted that access from bare JavaScript may not be possible. PhoneGap somehow does that, but it’s quite possibly that they implement Java wrapper that exposes native accelerometer data to your JavaScript. But that’s just guessing.

Thursday, February 02, 2012

Wiki Editing

Is there a Windows application that simplifies editing of Wiki-formatted documents? I would settle for a very basic one - all formatting can be displayed in wiki format on screen but I would like some helpful shortcuts and logic that would simplify multilevel list editing, basic formatting, cross-document linking etc.

Do you have any recommendation? I'm sick of using Notepad2 for these purposes.

In case there's no such tool available - is there a young programmer that needs a pet project? Put together a TSynEdit (to bring in highlighting and printing) and a toolbar/ribbon and you'll be half done...