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

TPersistent: UI Design - What Not To Do

$
0
0

I would never claim to be a good UI designer.  What I know of design is from personal use.  One principle that applies to both code and UI design is that consistency is king.  I often look to widely used commercial software as models for UI design.

Of course, one of the software packages I use most often is the Delphi IDE.  That’s why it’s particularly frustrating to see that when attempting to add a new unit test case to a project right clicking the project and choosing Add New -> Other… invokes the New Items Delphi dialog as shown below:

New Items Dialog invoked from Project Manager local Menu

New Items Dialog invoked from Project Manager local Menu

If I choose File -> New -> Other from the main menu I get the following New Items dialog, that does include the Unit Test folder in the tree, and provide a Test Case item.

New Items Dialog invoked from IDE Main Menu

New Items Dialog invoked from IDE Main Menu

Now considering the project I have selected in the project manager is a Unit Test project, one might think the Unit Test item should appear on the Add New local menu flyout.

Add New Flyout Menu

Add New Flyout Menu

I thought I could work around the initial limitations of the menu by Customizing it, but after adding the Test Case item using the Customize Dialog, it still doesn’t appear on the local menu.  It only appears on the main menu.

Customize New Menu Dialog

Customize New Menu Dialog

You might also notice the label “Default Application in Startup”.  To me this label is very confusing, so I invoked the help which indicates:

“If you want to set a default application type, drag the item that represents the application type from the center pane and drop it on this button. To remove the default application, click the button.”

Not only is the help incomplete, it is also inconsistent.  Within a single sentence it conveys conflicting semantics.  An application type is not the same as a default application.  It doesn’t mention anything to do with “Startup” as the label indicates.  In short, it does not sufficiently describe the functionality to which this option pertains.

I decided to experiment, so I changed the default application to a console application, closed all projects, closed the IDE, and re-launched it.  A new console application project was in fact created.  How this pertains to Menu customization is beyond me.  Personally, I don’t care if the IDE creates a new project because most of the time I am loading an existing project to work on it, or I explicitly create one.

In short, just as a poet carefully chooses his words, developers and documentation writers also have to do likewise.  In the case of documentation, it also makes more sense to be overly explicit to ensure the reader cannot misinterpret your prose.  Consistent UIs with logical grouping of functionality, meaningful hints and labels and discover-ability are also important in an age where users don’t read manuals, expecting software to be intuitive.  Of course it helps to dog food your own product, as if you were a an actual end user…


Firebird News: A new build of embedded Firebird for IOS is available

$
0
0
A new build of embedded Firebird for IOS is available, this corrects some issues locating and loading ICU dylibs.

Delphi Code Monkey: What am I missing out on if I'm not using Distributed Version Control?

$
0
0

As requested, I'm posting my thoughts about Centralized version control versus Distributed version control.

 Centralized version control was, in its day, a wonderful thing.   It is dated now, and for many teams, the benefits of moving to a distributed version control system could be huge.

But I Want One Repo To Rule Them All!

Fine. You can still have that.  You can even prevent changes you don't want to get into that One Repo from getting in there, with greater efficiency.  Distributed Version control systems actually provide greater centralized control  than central version control systems.    That should sound to you like heresy at first, if you don't know DVCS, and should be obviousto you, once you've truly grasped DVCS fundamentals.

Even if having a real dedicated host server is technically optional, you can still build your workflow around centralized practices, when they suit you.

Disclaimer: There Are No Silver Bullets.  DVCS may not be right for you.

Note that I am not claiming a Silver Bullet role for this type of tool.  Also, for some specific teams, or situations, Centralized version control may still be the best thing.  There is no one-size-fits-all solution out there, and neither Mercurial nor Git are a panacea.  They certainly won't fix your broken processes for you.   Expectations often swirl around version control systems as if they could fix a weak development methodology.  They can't.  Nor can any tool.

However, having a more powerful tool or set of tools, expands your capabilities. Here are some details on how you can expand your capabilities using a better, and more powerful set of tools.

1.  Centralized version control makes the default behavior of your system that it inflicts your changes on others as soon as you commit them yourself.   This is the single greatest flaw in central version control. This in turn can lead to people committing less often, because they either have to (a) not commit, or (b) decided to just go ahead and commit and inflict their work on others, or (c) create a branch (extra work) and then commit, and then merge it later (yet more extra work).   Fear of branching and merging is still widespread, even today, even with Subversion and Perforce, especially when changes get too large and too numerous to ever fall back on manual merging.  I recently had a horrible experience with Subversion breaking on a merge of over 1800 modified files, and I still have no idea why it broke.  I suspect something about '--ignore-ancestry" and the fact that Subversion servers permit multiple client versions to commit inconsistent metadata into your repository, because Subversion servers are not smart middle tier server, they're basically just dumb HTTP-DAV stores. I fell back to manually redoing my work, moving changes using KDiff3, by hand.    With Distributed Version control, you can take control,  direct when changes land in trunk, without blocking people's work, or preventing them from committing, or forcing them to create a branch on the server and switch their working copy onto that branch, which in some tools, like Subversion, is a painful, slow, and needlessly stupid process.

2.  Centralized version control limits the number of potential workflows you could use, in a way that may prevent you from using version control to give your customers, and the business, the best that your team can give it. Distributed Version Control Systems encourage lightweight working copy practices.  It is easy to make a new local clone, and very very fast, and requires no network traffic.  Every single new working copy I have to create from Subversion uses compute and network resources that are shared with the whole team.  This creates a single point of failure, and a productivity bottleneck.


3.  Centralized version control systems generally lack the kind of merging and branching capabilities that distributed version control systems provide.  For example, Mercurial has both "clones as branches", and "branching inside a single repo".    I tend to use clones and merge among them, because that way I have a live working copy for each and don't need to use any version control GUI or shell or command line commands to switch which branch I'm on.     These terms won't make sense to you until you try them, but you'll find that having more options opens up creative use of the tools.  Once you get it, you'll have a hard time going back to the bad old days.

4.  For geographically distributed teams, Distributed Version control systems have even greater advantages.  A centralized version control system is a real pain over a VPN.  Every commit is a network operation, like it or not.  DVCS users can sync using a public or private BitBucket repository at very low cost, and don't even have to host their own central servers.


5. For open source projects, Distributed Version control permits the "pull request" working model.  This model can be a beneficial model for commercial closed source projects too.   Instead of a code review before each commit, or a code review before merging from a heavyweight branch, you could make ten commits, and then decide to sync to your own central repository.   Once the new code is sitting there, it's still not in the trunk until it is reviewed and accepted by the Code-Czar.

6.  For working on your own local machine, if you like to develop in virtual machines, having the ability to "clone" a working copy quickly from your main physical machine down into a VM, or from VM to VM, using a simple HTTP-based clone operation, can really accelerate your use of VMs.  For example, my main home Delphi PC is a Dell Workstation that has Windows 8.1 on the Real Machine, and runs Hyper-V with a whole bunch of VMs inside it. I have most of the versions of Windows that I need in there. If I need to reproduce a TWAIN DLL bug that only occurs in Terminal Server equipped Windows Server 2008 R2 boxes, I can do it. I can have my repos cloned and moved over in a minute or two.  And I'm off.

7.  Rebasing is a miracle.  I'll leave this for later. But imagine this:  I want to commit every five minutes, and leave a really detailed history while I work on some low level work.  I want to be able to see the blow-by-blow history, and commit things in gory detail.  When I commit these changes to the master repo, I want to aggregate these changes before they leave my computer, and give them their final form.  Instead of having 80 commits to merge, I can turn it into one commit before I send that up to the server.

8.  Maintaining an ability to sync fixes between multiple branches that have substantial churn in code over time, is possible, although really difficult.  By churn, I mean that there are both "changes that need merging and changes that don't".  This is perhaps the biggest source of pain for me with version control, with or without distributed version control systems..  Imagine I'm developing Version 7 and Version 8 of AmazingBigDelphiApp.   Version 7 is running in Delphi 2007, and Version 8 is running in Delphi XE5, let's say.  Even with Distributed Version Control (git or mercurial), this is still really really hard.   So hard that many people find it isn't worth doing.  Sure, it's easy to write tiny bug fixes in version 7 and merge them up to version 8, unless the code for version 8 has changed too radically. But what happens when both version 7 and version 8 have heavy code churn? No version control system on earth does this well. But I will claim that Mercurial (and Git) will do it better than anybody else.   I have done fearsome merge ups and merge downs from wildly disparate systems, and I will take Mercurial any day, and Git if you force me, but I will NOT attempt to sync two sets of churning code in anything else.  I can't put this in scientific terms. I could sit down with you and show you what a really wicked merge session looks like, and you would see that although Git and Mercurial will do some of the work for you, you have to make some really hard decisions, and you have to determine what some random change is that landed in your code, how it got there, and whether it was intentional, or a side effect, and if it was intentional, if it's necessary in the new place where it's landing.  If it all compiles, you could go ahead and commit it. If you have good unit test coverage, you might even keep your sanity and your remaining hair, and your customers.

9.  Mercurial and Git have "shelves" or "the stash".  This is worth the price of admission all by itself. Think of it as a way of "cleaning up my working copy without creating a branch or losing anything permanently". It's like that Memory button in your calculator, but it can hold various sets of working changes that are NOT ready to commit yet, without throwing them away either.

10.  Mercurial and Git are perfect for creating that tiny repo that is just for that tiny tool you just built.  Sometimes you want to do version control (at work) for your own temporary or just-started-and-not-sure-if-the-team-needs-this utility projects without inflicting them on anybody else. Maybe you can create your own side folder somewhere on your subversion server where it won't bother anybody, or maybe you can't do that.  Should you be forced to put every thing you want to commit and "bookmark" up on the server as a permanent thing for everybody to wonder "why is this in our subversion server?". I don't think so.

11.  Mercurial and Git are perfect for sending a tiny test project to your buddy at work in a controlled way.  You can basically run a tiny local server, send a url to your co-worker and they can pull your code sample across the network.   They can make a change, and then they can push their change back. This kind of collaboration can be useful for training, for validation of a concept you are considering trying in the code, or for any of dozens of other reasons.    When your buddy makes a
change and sends it back, you don't even have to ask "what did you change" because the tool tells you.


Bonus: Some Reasons to Use Mercurial Rather than Anything Else

TortoiseHG in particular is the most powerful version control GUI I have ever used, and it's so good that I would recommend switching just so you get to use TortoiseHG.  Compared to TortoiseSVN, it's not even close.  For example, TortoiseSVN's commit dialog lacks filter capabilities.    SVN lacks any multi-direction synchronization capabilities, and can not simplify your life in any way when you routinely need to merge changes up from 5.1-stable to to 6.0-trunk, it's the same old "find everything manually and do it all by hand and hope you do it right" thing everytime.

Secondly, the command line. The Mercurial (HG) command line kicks every other version control's command line's butt.  It's easy to use, it's safe, and it's sane.

SVN's command line is pathetic, it lacks even a proper "clean my working copy" command.  I need a little Perl script to do what the SVN 1.8 commandline still can't do. (TortoiseSVN's gui has a reasonable clean feature, but not svn.exe). Git's command-line features are truly impressive. That's great if you're a rocket scientist and a mathematician with a PhD in Graph and Set Theory, and less great if you're a mere human being.   The HG (mercurial) command line is clean, simple, easy to learn, and even pretty easy to master.  It does not leak the implementation details out and all you should need to evaluate this yourself is to read the "man pages" (command line help) for Git and Mercurial. Which one descends into internal implementation jargon at every possible turn? Git.
 I've already said why I prefer HG to GIT,   I could write more about that, but I must say I really respect almost everything about GIT.  Everything except the fact that it does allow you to totally destroy your repository if you make a mistake. That seems so wrong to me, that I absolutely refuse to forgive GIT for making it not only possible but pretty easy to destroy history. That's just broken.

Side Warning


Let me point out that you need a backup system that makes periodic full backups of your version control server, whether it is centralized or distributed.  Let me further point out that a version control system is not a backup system.  You have been warned. If you use Git, you may find that all your distributed working copies have been destroyed by pernicious Git misfeatures.  If you choose to use Git, be aware of its dark corners, and avoid the combinations of commands that cause catastrophic permanent data loss. Know what those commands are, and don't do those things.

 Get Started: Learn Mercurial

If you want to learn Mercurial,  I recommend this tutorial: http://hginit.com/

I really really recommend you learn the command line first, whether you choose to learn the Git or the Mercurial one. Make your first few commits with the command line.  Do a few clone commands, do a few "show my history" commands (hg log), and a few other things. If you don't know these, you will never ever master your chosen version control system.  GUIs are great for merges, but for just getting started, learn the command-line first.  You're a programmer, darn it.  This is a little "language", it will take you a day to learn it.  You will reap benefits from that learning time, forever.





Andy's Blog and Tools: System.ByteStrings support for XE5 Update 2

$
0
0

XE5 Update 2 broke the Android System.ByteStrings.o file. So I recompiled it with XE5 Update 2 and now you can use the Byte-Strings (UTF8String, AnsiString, RawByteString, ShortString) also with XE5 Update 2.

The unit System.ByteStrings reintroduces:

  • ShortString
  • AnsiString
  • AnsiChar
  • PAnsiChar
  • PPAnsiChar
  • UTF8String
  • PUTF8String
  • RawByteString
  • PRawByteString

Usage:
Add the System.ByteStrings.dcu’s path to the compiler’s search path and add the unit to your uses clauses.

There is no *.PAS file because the DCU is patched with a hex editor to get access to the hidden types.

NameIDE VersionFileSizeDownloadsAdded
System.ByteStringsXE5 RTM/UP1 onlyXE5ByteStrings.7z2.45 KB317 times 2013-10-23
System.ByteStringsXE5 UP2 onlyXE5Up2ByteStrings.7z2.85 KB0 times 2013-12-20

Delphi Haven: InfoPower grid for FireMonkey free with XE5

$
0
0

In case anyone interested in FMX isn’t aware, Woll2Woll’s InfoPower grid for FireMonkey can be got free with XE5. OK, no source, but it’s much, much better than the standard offering:

InfoPower

If you want to see the Android targeting in action, Woll2Woll have a demo on Google Play (https://play.google.com/store/apps/details?id=com.woll2woll.IP2SearchGridDemo&hl=en).

That said, one small issue I’ve found is that the setup file available on ‘My Registered Downloads’ at Embarcadero’s site is a bit outdated – on opening one of the iOS demos and building, I got a compiler error:

[DCC Fatal Error] SearchGrid.pas(10): F2051 Unit fmx.wwlayouts was compiled with a different version of FMX.Effects.TEffect

Presumably this is due to update 2 breaking DCU compatibility for iOS targets (this issue is mentioned in the update 2 readme files). To fix, I downloaded the latest setup file from Woll2Woll’s website and installed over the top of the original installation – see the top link here:

http://www.woll2woll.com/download-infopower-release-versions.html

Having done that, the iOS demos now compiled fine.


twm’s blog: Multiple Batch Files in Pre-/Postbuild Events in Delphi / msbuild

$
0
0

Since version 2007 Delphi supports pre- and postbuild events for projects. If you only want to start programs or one batch file it’s a simple matter of adding the call to the respective section of the project options dialog. I use it to manage version numbers in the program resources and manifest files in prebuild and append translations and jcl debug info in postbuild and it works fine.

But a few days ago, I wanted, in addition to the above, to copy some dlls that the program needs to the output directory. So I went and added another batch file like this:

..\..\buildtools\postbuild.cmd $(OUTPUTDIR)$(OUTPUTNAME)
..\copydlls.cmd $(OUTPUTDIR)

To my astonishment I found that only the first of the batch files was executed. After looking for the obvious problems (like typos, wrong paths etc.) and adding some debugging code to the batch files which confirmed the assumption, a question on StackOverflow seemed to be in order (which usually works much better than posting to the Embarcadero forums, because of the great guys frequenting it.) While I was waiting for an answer I continued to experiment and found one workaround:

%comspec% /c ..\..\buildtools\postbuild.cmd $(OUTPUTDIR)$(OUTPUTNAME)
%comspec% /c ..\copydlls.cmd $(OUTPUTDIR)

This was like a flashback to the bad old days of DOS, but it worked. I added this result to my question and while I was at it, checked for answers. Still none (but then it had been less than 5 minutes since I posted it. So I started looking for similar questions on StackOverflow that were not tagged Delphi but MSBuild. I found this answer and tried it:

call ..\..\buildtools\postbuild.cmd $(OUTPUTDIR)$(OUTPUTNAME)
call ..\copydlls.cmd $(OUTPUTDIR)

It also worked so I added it to my question as well. It looked like a more elegant solution than the %comspec% hack to me, so after more digging didn’t turn up anything else, I posted it as an answer to my own question and went on with my work.

Around half an hour later I looked at the question again and found that it had been answered by David Hefferman. I posted the question at 15:19 and got his answer at 15:36 which is not unusual for StackOverflow (At least this time he didn’t beat me to the solution, but hey, I was actively working on that problem while he was probably doing something completely different.).

DelphiTools.info: Slim Reader/Writer Locks Rock!

$
0
0
I recently posted abut the new Slim R/W Locks introduced with Vista, and how they were vastly more efficient than TMREWS. Apparently, they’re also more efficient than Critical Sections… Following Up If you follow the comments in the previous article, some extra benchmarks where published, including “degenerate” cases where the Slim R/W Locks are used…

twm’s blog: Some Batch File Wizardry for Automated Builds

$
0
0

At work and also on my private computer I am maintaining multiple Delphi projects that are (currently) managed in subversion repositories. They have a general structure like this:

projectname
  \- buildtools (-> svn:external)
  \- src (project sources)
  \- libs
    \- dzlib (-> svn:external)
    \- some other libraries, all svn:external

Being a lazy bastard (deutsch: faule Socke) I don’t want to start Delphi just to compile the projects or check whether they still compile but have a build script to do that. Also, I don’t want to right click and svn update all the time (and build after that) so I have got an autobuildcheck script. And last but not least, since on my computer all Delphi versions since version 6 are installed, I need a method to automatically launch the correct IDE for each of the projects.

First, auto_build_check.cmd:

That one is simple. It needs to

  • svn update
  • call the build script
  • revert the build number increment which the build script automatically made
  • if no error occurred, just exit, otherwise pause to let me examine the error message
rem Update sources from repository
rem Build them
rem in case of error(s): Stop and show the error
rem revert the automatic build number incrementation

svn update
if errorlevel 1 goto Error

set BatchBuild=1
call _BuildProject.cmd

if not exist src\*_version.ini goto :eof
svn revert src\*_version.ini
if errorlevel 1 goto error

goto :eof

:error
echo ***** ERROR *****
pause

Next, _buildproject.cmd:

It needs to

  • determine the project name from the current directory (I don’t want to write different build script for each project, lazy bastard again)
  • determine the Delphi version to use for building (this one only supports Delphi 2007 and later)
  • call msbuild
  • if an error occurs, show that error
  • pause, to let me examine the results
rem @echo off
REM - assumes that the parent directory is also the project name, extracts it
REM - and calls msbuild with %project%.dproj

setlocal

rem Has the project been passed as parameter?
set project=%1
if not "%project%"=="" goto projgiven
rem Is there a __SetProjectName.cmd which supposedly sets %project%?
if exist __SetProjectName.cmd call __SetProjectName.cmd
if not "%project%"=="" goto projgiven
rem Still no project, use the parent directory name to get it
call :GetLastDir %0
set project=%result%

:projgiven

call buildtools\delphiversions.cmd

set DelphiVersion=Delphi 2007
set DelphiDir=%Delphi2007Dir%
if exist __SetDelphiVersion.cmd call __SetDelphiVersion.cmd

set OldPath=%PATH%
echo building project %project%.dproj using %DelphiVersion%
call "%DelphiDir%\bin\rsvars.bat"

if NOT "%DelphiVersion%"=="Delphi 2007" goto no2007
rem Delphi 2007 sets the FrameworkDir incorrectly on 64 bit Windows, so we fix this here
SET FrameworkDir=%SystemRoot%\Microsoft.NET\Framework\
SET PATH=%FrameworkDir%%FrameworkVersion%;%FrameworkSDKDir%;%OldPath%
:no2007

pushd src
msbuild %project%.dproj | ..\buildtools\msbuildfilter ..\errors.txt
popd
if errorlevel 1 goto error

endlocal
if "%BatchBuild%"=="1" goto nopause
pause
:nopause
goto :eof

:error
echo ************************************
echo ***** Error building %project% *****
echo ************************************
if "%MAILSend%"=="" goto nomail
%MAILSend% -sub "Error building %project%" -M "Build Error" -attach errors.txt,text/plain,a
endlocal
goto :eof

:nomail
endlocal
pause
goto :eof

:GetLastDir
rem extract path
set directory=%~p1%
rem remove backslash (=last character)
set directory=%directory:~0,-1%
rem extract "filename" (= last directory of path)
call :LastItem %directory%
goto :eof

:LastItem
set result=%~n1%
goto :eof

Actually, this script does some more things:

  • It allows me to pass the project name as a parameter.
  • If no parameter is passed, it looks for a file called __SetProjectName in the current directory, which can set %project%.
  • If that doesn’t exist either, it calls the GetLastDir subroutine to get the last part of the current directory and uses that as the project.
  • next, it calls buildtools\delphiversions.cmd which is a script that knows where all my Delphi versions are installed and sets the base directories for them as Delphi2007Dir, Delphi2009Dir etc. environment variables.
  • Determine wichh Delphi version it should use. It assumes Delphi 2007 (which I still use for the majority of my projects), looks for __SetDelphiVersion.cmd in the current directory, which is supposed to set %DelphiVersion% and %DelphiDir% if a different version is to be used.
  • If Delphi 2007 is to be used, it implements a workaround to fix a problem this version has with setting %FrameworkDir% on 64 bit Windows.
  • It calls rsvars.bat (which is a script installed by Delphi)
  • It switches to the src subdir
  • It calls msbuild for %project%.dproj (msbuildfilter is an internal tool that filters the output and counts hints, warnings and errors)
  • If there is no error it either pauses, or if in batchbuild mode, it just exists.
  • If there is an error, it checks whether it should send an e-mail and does that (I’ll come back to that in a future blog post.).
  • If it sent an e-mail, it exists, otherwise it pauses to let me examine the error.

Last, _OpenInIde.cmd

It needs to:

  • Determine the project name (see above)
  • Determine the Delphi version to use (again: see above)
  • Call the IDE of that version and pass it the appropriate .dproj file
@echo off
REM - assumes that the parent directory is also the project name, extracts it
REM - and calls the IDE with %project%.dproj

setlocal

rem Has the project been passed as parameter?
set project=%1
if not "%project%"=="" goto projgiven
rem Is there a __SetProjectName.cmd which supposedly sets %project%?
if exist __SetProjectName.cmd call __SetProjectName.cmd
if not "%project%"=="" goto projgiven
rem Still no project, use the parent directory name to get it
call :GetLastDir %0
set project=%result%

:projgiven

call buildtools\delphiversions.cmd
set DelphiVersion=Delphi 2007
set DelphiDir=%Delphi2007Dir%
if exist __SetDelphiVersion.cmd call __SetDelphiVersion.cmd

start "%DelphiVerson%""%DelphiDir%\bin\bds.exe" -pDelphi src\%project%.dproj
endlocal
goto :eof

:GetLastDir
rem extract path
set directory=%~p1%
rem remove backslash (=last character)
set directory=%directory:~0,-1%
rem extract "filename" (= last directory of path)
call :LastItem %directory%
goto :eof

:LastItem
set result=%~n1%
goto :eof

So, am I lazy? I don’t really know. Writing the scripts described above was quite a lot of work. On the other hand, that was interesting work and it keeps me from making stupid errors again and again, like opening a project with the wrong Delphi version and having to revert the changes done by that version, or forgetting to do svn update before checking if the project still compiles. Also, they allow me to run a continuous build server to automatically find compile errors caused by incompatible changes to one of the libraries used, before I or my coworkers forget the reason for that change.

But why have copies of these scripts in all my projects rather than having them in buildtools and only small stubs in the project, that call these scripts? So that’s the next step.

If you want to use these scripts in your own projects or roll your own based on them, feel free to do so. You can find them in my buildtools repository.


The Wiert Corner - irregular stream of stuff: jpluimers

Smart Mobile StudioSmart Mobile Studio: Bling up your apps

$
0
0

Today we are going to visit the wonderful world of webkit animations. I'm going to demonstrate how you can use relatively simple CSS animations to bring your application to life. So start up Smart Mobile Studio and let's get cracking!

The post Bling up your apps appeared first on Smart Mobile Studio.

Smart Mobile StudioSmart Mobile Studio: What is new in community beta 2?

$
0
0

Below are some of the new features that has been added to Smart Mobile Studio community beta II. We hope you find our efforts in creating this product,a product that is both unique, innovative and extremely powerful, useful and interesting. Our customers can look forward to gestures, databases, even better browser support, Phone-Gap support and [...]

The post What is new in community beta 2? appeared first on Smart Mobile Studio.

Žarko Gajić: Generating QR Codes Using Delphi DelphiZXingQRCode Open Source Unit by Debenu

$
0
0

TDelphiZXingQRCode
A QR code (Quick Response Code) is a specific 2D barcode that gained popularity during the last years when mobile phones with cameras allowed mobile phone users to quickly scan the image and get more info on a product, business, event, offer, URL address, …

If you need to include the generation of QR barcode images in your Delphi application, you might want to take a look at Debenu’s open source “DelphiZXingQRCode” – a Delphi port of the QR Code functionality in ZXing, an open source barcode image processing library.

QR codes are used to encode URL, text or other data. Most smartphones like iPhones and Android phones have apps that let you to read QR codes. When your mobile reads (scans) a QR Code, the QR code will then send you to a website or online voucher or an online business card.

There are several Delphi-style QR code implementations but only a few are free and/or include source code.

DelphiZXingQRCode is a single-unit implementation you simply add to your (new or) existing project, set a few properties and paint the image. DelphiZXingQRCode (for the moment) supports auto, numeric, alphanumeric, ISO-8859-1, UTF-8 without Bom and UTF-8 with Bom encoding.

Just a few lines of code, TDelphiZXingQRCode related, and your QR is ready:

var
  QRCode: TDelphiZXingQRCode;
  Row, Column: Integer;
begin
  QRCode := TDelphiZXingQRCode.Create;
  try
    QRCode.Data := edtText.Text;
    QRCode.Encoding := TQRCodeEncoding(cmbEncoding.ItemIndex);
    QRCode.QuietZone := StrToIntDef(edtQuietZone.Text, 4);
    QRCodeBitmap.SetSize(QRCode.Rows, QRCode.Columns);
    for Row := 0 to QRCode.Rows - 1 do
    begin
      for Column := 0 to QRCode.Columns - 1 do
      begin
        if (QRCode.IsBlack[Row, Column]) then
        begin
          QRCodeBitmap.Canvas.Pixels[Column, Row] := clBlack;
        end else
        begin
          QRCodeBitmap.Canvas.Pixels[Column, Row] := clWhite;
        end;
      end;
    end;
  finally
    QRCode.Free;
  end;
end;

If you only need the image generated out of your application, you might want to try this fantastic free online QR Code Generator from the ZXing Project.

What Delphi-style QR generator are you using? Have something Delphi-style to read QR Codes?

The Podcast at Delphi.org: Delphi XE5 Mobile App Development Workshop

$
0
0

Glenn Stephens with Orchard eBusiness has a Delphi XE5 Mobile App Development Workshop coming up next month. It is divided up into 4 different 4 hour workshops, each on a different day. This gives you a chance to work on what you learned in preparation for the next workshop. The objective is to take a developer who is experienced with Delphi and prepare them for Mobile App Development.

Glenn does good work, so I am sure this is a great opportunity to anyone who wants to make the move to mobile app development.

If you haven’t yet, take advantage of the end of year special offers before time runs out so you will have XE5 and be ready for Glenn’s workshop. I’m looking forward to seeing all your apps in the app stores!

DelphiTools.info: A Terapixel Image for the DelphiWebScript Christmas!

$
0
0
As a step up from the previous Mandelbrot Set explorer, I’m running a Terapixel image experience for DWScript Christmas 2013. This is again on the Mandelbrot set, and involves a massive step up in complexity from the previous version, this one isn’t just server-side computed, it’s “Grid Computed” For the impatient, jump to the browser,…

Delphi Code Monkey: What do you lose by moving to distributed version control from Subversion? When is using Subversion the right choice?

$
0
0
This is a follow-up post with a few counterpoints to the last post about distributed version control.  There are a few things that I can see that Subversion does better than either GIT or Mercurial. In the interest of fairness, I will point them out here:

1.  It appears that Subversion, given adequate server hardware, and adequate local area network bandwidth, may be a better solution for teams who need to do checkouts more than 2 gigabytes in size, especially if you simply must check in binaries and version control them. Your mileage may vary, in your situation, you may find that the point of inflection is 750 megabytes.    A common example of this is video-game development, where assets easily hit 10-20 gigabytes, and are commonly versioned with Subversion.

2. Subversion has support for partial and  sparse checkouts, something that you don't get with distributed version controls systems,  and all the attempts to add sparse checkouts to DVCS have been so flawed that I would not use them.  The nearest relevant and useful DVCS equivalent  is submodules.  Most users who need to do partial checkouts in subversion will find that they want to investigate using submodules in a DVCS.  If submodules do not meet your needs, then maybe CVCS is best for your team. If you need different users to have different subsets of the repo, using scatter/gather workflows, or otherwise do sparse checkouts (svn co http://server/trunk/path/to/sub/module3 rather than being forced in Git or mercurial to do a clone which is equivalent roughly to svn co http://server/trunk/ ) you may find Subversion meets your needs better.  It is a common rookie mistake  to conflate DVCS repo scope with CVCS repo scope.   DVCS repos are typically simpler and smaller intentionally, rather than the subversion "this server is your whole code-universe" monster-mega-repo strategy that Subversion limits you to. 

3.  Subversion has global version commit numbering, that is your ONE and only Subversion server has a commit counter, and since this global asset is shared among everybody, you can never have a "commit #3" on one computer be anything other than "commit #3" on anyone else's computers. On Git and Mercurial the system generates globally unique hash tags instead to identify commits, and the commit numbers, if available, should generally just be ignored as they are different for each user.  For some workflows you might find this global commit numbering system suits you better than referring to the hex strings of 8 to 24 characters that identify your commits, which have no ordering.

If I've missed anything, I'll add it in an update. Anyways, those are the three golden reasons that I know of that some teams will want to evaluate DVCS, and then stick right where they are with Subversion, which by the way, does seem to me to be the best open-source CVCS out there right now.  I only wish there was a better GUI than Tortoise, and that they'd do a little work to make command line merging less stupid.

Update: Someone was confused about why you would want users to "generate" hash keys.  This means I didn't explain it properly. The version control system generates hash keys, and "hashing" means feeding the input of your changeset through a cryptographic hashing function. The possibility of a hash collision is so low, that you will never encounter one.  Git and Mercurial both use them, and I have never heard of a hash collision, ever.  My only reason for mentioning it is that in a distributed system there is no single incrementing counter available to give you unique incrementing numbers. Not a big deal, but something to know before you leap.  More info here. 

The Wiert Corner - irregular stream of stuff: Beyond Compare 4 beta on Mac OS X

$
0
0

I’ve been wanting this a very long time, so I’m going to install it Right Now ™ (:

Right before X-Mas, Scooter Software did the ANN: Beyond Compare 4.0 beta available on Windows, Linux, and OS X:

Posted: Dec 23, 2013 4:17 PM

Beyond Compare 4.0 beta is now available for testing on Windows, Linux, and OS X.

http://www.scootersoftware.com/beta

This version adds a number of new features:

  • - OS X support
  • - An improved user interface
  • - 3-way folder merge
  • - Support for marking text unimportant separately from the file format
  • - Compare against WebDAV servers, Subversion remote repositories, and Dropbox\’s cloud
  • - An overhauled picture compare
  • - Inline editing in the hex compare
  • - A \”View Patch\” command that pulls the patch apart into a side-by-side display
  • - Improved high DPI support
  • - .zipx support for all compression algorithms
  • - Many other fixes and enhancements


Craig Peterson
Scooter Software

The G+ announcement has a few more details: Craig Peterson – Google+ – Beyond Compare 4.0 beta is now available, on Windows,….

A few notes:

  • Since this is a beta, all regular warnings apply.
  • It is a public beta, so anyone can download for Mac OS X, Windows, and 4 different Linux package flavours.
  • The BC4 beta what’s new shows there is a lot more than “just” Mac OS X support.
  • The BC4 beta forums are open to the general public. There is already quite some content from the alpha phase.
  • The BC4 beta change log shows it has been in alpha for more than 9 months now.
  • The BC4 beta videos show that the regular features are still there (including portable install) but with a completely new Firemonkey like UI so you can watch it run on Mac OS X as well. The fun part: it is not Firemonkey, it is Lazarus!
  • Current “drop dead” license ends end of Februari 2014.

OS X and command-line tip

One important thing if you have installed on OS X and are used to command-line and/or VCS integration using the bcomp or bcompare command line tools that already were available on Linux and Windows:

Using BComp instead of Beyond Compare.app for VCS and OSX Command Line Utilities

To use Beyond Compare with the Command Line, please

  1. use the Beyond Compare menu and
  2. select Install Command Line Tools.

This will add ‘bcomp’ and ‘bcompare’ utilities into /usr/local/bin. By default, this location is available from the command line or for third party applications.

via Using BComp instead of Beyond Compare.app for VCS and OSX Command Line Utilities – Scooter Forums.

–jeroen

via: Embarcadero Discussion Forums: ANN: Beyond Compare 4.0 beta available ….

Beyond Compare 4 beta on Mac OS X

Beyond Compare 4 beta on Mac OS X


Filed under: *nix, Apple, Beyond Compare, Delphi, Development, Linux, Mac, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, OS X, OS X Lion, OS X Mountain Lion, Power User, Software Development, Source Code Management, SuSE Linux, Windows

Firebird News: Merry Xmas! Enjoy our band XMas song ;)

$
0
0
Do you remember the “Exclusive Christmas performance” of FB Core Team band? I hope the guys will enjoy it! Personalize funny videos and birthday eCards at JibJab! Band is: Drums: Alex “Bonham” Peshkov Guitar: Vlad “Vai” Khorsun Guitar: Claudio “Friedman” Valderrama Bass: Adriano “Harris” Fernandes Vocal: Dmitry “Plant” Yemanov

Delphi Code Monkey: Merry Christmas to all.

$
0
0
Merry Christmas everyone. Here are some fun things for you to play with over the Christmas break.  Remember to put your laptop down and just hang out with those family people.

Some Toys to play with:
First, a list of interesting free stuff, a present from Scott Hanselman.

Some Delphi Specific Fun Things:

Apologies if you've seen these before, but hopefully these will be new to some of you.



  • The Itinerant Developer blogged about a Firemonkey Container for VCL forms in July, I missed it then, if you did too, check it out. Pretty cool. 
  • Nick Hodge's awesome new book mentions Delphi-Mocks by Vincent Parrett.    I'm playing with this right now, to increase my unit-testing powers. If you never read Vincent's intro post about it, this is a good read, even though it's been a year. I get the idea that lots of people still haven't seen the need for this yet, which means they aren't testing enough.
  • If you still haven't downloaded it, you owe it to yourself to go get Andreas Hausladen's latest IDE Fix Pack for your Delphi/RAD Studio.  Thanks Andreas for building such a great add-on. I use it and swear by it, for Delphi XE2, XE4, and XE5 which are the versions I have active coding duties in right now.










Behind the connection: Hotfix 3 for Delphi XE5 update 2

$
0
0
If you haven't noticed yet, there is a 3rd "hotfix" available for Delphi XE5, C++ Builder XE5 and RAD Studio XE5 update 2. This hotfix contains compiled obj files for JPEG support. Download from Embarcadero CodeCentral available for registered users of the mentioned products. Follow me on Twitter Follow me on LinkedIn Follow me on Google+ Visit my website: http://www.overbyte.be This article

DelphiTools.info: And the Terapixel Became Four

$
0
0
The Christmas Mandelbrot Experiment is now nearing has achieved completion of Level 13, or a Four Terapixel image! This will be the end of the experiment (at least temporarily) as the server is running out of storage space Finishing Level 13 I’ve temporarily closed off browsing of Level 12 to make room for Level 13, at the same…
Viewing all 1725 articles
Browse latest View live