The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,839 other subscribers

Archive for the ‘Development’ Category

New years resolution: CHASM64 – More on Delphi x64 by twitter kylix_rd (Allen Bauer)

Posted by jpluimers on 2010/12/29

As a continuation of the previous assembly, the new twitter kylix_rd messages on Delphi x64:

To save people from browsing Twitter history: the first link in the quote has the CHASM64 picture :-)

kylix_rd:

I wonder what to make of this? http://yfrog.com/h2e20wp
28 dec

@davidheff I cannot confirm or deny any relationship CHASM64 has to dcc64 ;-)
24 Dec

kylix_rd Allen Bauer
As a followup… there is now a CHASM64 folder in the dev tree.
23 Dec

kylix_rd Allen Bauer
Interesting tidbit; The current Delphi inline assembler is called CHASM internally. Why? Chuck J. wrote it for Kylix. CHuck’s ASM = CHASM
23 Dec

kylix_rd Allen Bauer
Another reason why writing tools for x64 is a bit more fiddly than x86: http://bit.ly/hh3Q59 . Now consider the restrictions on asm…
15 Dec

kylix_rd Allen Bauer
Another excellent discussion of the x64 calling conventions ABI: http://bit.ly/hgLl8N
15 Dec

–jeroen

via: More on Delphi x64 by twitter kylix_rd (Allen Bauer) « The Wiert Corner – irregular stream of Wiert stuff.

Posted in Delphi, Development, Software Development | 5 Comments »

SwitchResX helped me switch my Mac machine to 1360×768 and 1888×1062

Posted by jpluimers on 2010/12/24

A while ago, I got involved in Mac programming again after more than a decade of absence.
It felt like a warm reunion.

A Mac Mini Server serves as a development machine: it is about the same price as a regular Mac Mini, but packs 2 HDDs which for me is more useful than one HDD and a DVD player.

However, living in the Windows world for a long time long, and having had RSI in the DOS era almost two decades ago, I had a few wishes for using it.

The first was keyboard wise. The second is custom resolutions. Read the rest of this entry »

Posted in Apple, Development, Keyboards and Keyboard Shortcuts, Power User, RSI, Software Development, UltraNav keyboards, xCode/Mac/iPad/iPhone/iOS/cocoa | 10 Comments »

iBook store: Apple Published Six Free Electronic Books for Developers

Posted by jpluimers on 2010/12/23

Apple added some of their on-line books to the iBooks store for off-line reading on your iPad (or iPhone, though I double people will use that for readong).

Since you can only get to those from your iPad/iPhone iBook app, I included google search links for the online versions:

Note that iOS Human Interface Guidelines is not availeble outside the USA iBook store.
But it is almost as easy to read your PDFs through the DropBox iPad app (it even links to iBooks if you want to!).

Sharing your PDFs using DropBox has the added benefit that you can have the PDF both on your development machine and your iPad for reference.

–jeroen

via Apple Publishes Six Free Electronic Books for Developers | Cult of Mac.

Posted in Development, Software Development, xCode/Mac/iPad/iPhone/iOS/cocoa | 2 Comments »

Great post on “Single Responsibility Principle”: SRP, as easy as 123… | Hadi Hariri’s Blog

Posted by jpluimers on 2010/12/22

SRP (Single Responsibility Principle) is not limited to classes.

Often I see source files running like thousands of lines.
That surely is a sign if code smell, and leads to lots of problems, especially when working with teams of people, or sharing sources across multiple projects.

SRP solves these and other problems, regardless of programming language or framework you use:

  • hating your version control system because merges are a pain
  • tripping over the same source file because you need to change it for the umpteenth time each from a different perspective
  • searching for that line of code within dozen comment blocks that explain old versions of its intricacies

Hadi Hariri –  evangelist at JetBrains – has a great post called SRP, as easy as 123… on his blog (and refers to the fantastic Clean Code book by Robert C. Martin).

SRP originates from objec oriented design, but for me, SRP is not limited to classes.
For me, SRP is all about the design of your apps and the structure of your code.

Classes are just one form of ‘boxing’ things, as are interfaces, source files, services, forms, etc.
All these boxes change, and you need to be prepared for that.

Which leads me to the statement that he only thing you know about code is that it will change.
Did I mention you need continuous integration to get a grip on change?

–jeroen

Posted in Agile, Development, Software Development | Leave a Comment »

cocoa pointer types: the * is mandatory

Posted by jpluimers on 2010/12/21

Coming from a Delphi background I’m highly spoiled by the feature that you do noe need to explicitly mark each and every use of a reference, pointer or class type as being a pointer: they always are, so Delphi implicitly knows. No need for a ^reference marker there (yes, there are a few corner case exceptions to this rule).

The same holds for .NET languages: they know when a type is a reference type, no need for those extra characters.

The Objective-C compiler – used for building cocoa applications in xCode – doesn’t know, so you have to include a star whenever a type is to be used as a pointer.

For instance, this will yield a compiler error “Cannot use object as a parameter to a method“: Read the rest of this entry »

Posted in Development, xCode/Mac/iPad/iPhone/iOS/cocoa | Leave a Comment »

Volgende week woensdag: Hands-On Delphi Developer Workshop (8 december 2010, 08:30-17:00 Jaarbeurs Utrecht)

Posted by jpluimers on 2010/11/29

Volgende week woensdag geef ik tijdens de Hands-On Delphi Developer Workshop een sessie over Delphi Productiviteit

Er zijn nog een aantal plaatsen vrij.
Deze unieke dag kost slechts EUR 69,95 exclusief BTW, dus pak die kans!

Mijn sessie is de laatste van de dag; eerder zijn deze sprekers aan bod:

  • Danny Wind van de DelphiCompany: Cloud Data Storage Using Azure
  • Pawel Glowacki van Embarcadero: DataSnap (Engelstalig)
  • Bruno Fierens van TMS Software: Ontwikkel Office 2007/ Office 2010 style applicaties

Het doel van mijn sessie is om interactief met wat opdrachten te zien hoe je productief kunt zijn in Delphi.
Er is genoeg ruimte voor discussie, dus heb je zelf ook tips: kom er gerust mee!

Ik begin te laten zien wat ik minimaal aan mijn Delphi ontwikkelstraat toevoeg om een productief basis-systeem op te zetten.
Delphi specifieke tools als GExperts en ModelMaker Code Explorer komen aan bod, maar ook externe tools als Everything en SysInternals: tools die zowel geïntegreerd als los te gebruiken zijn.

Verder ga ik in op de versiebeheer integratie van SVN in Delphi: wat als er nieuwe versies zijn, hoe ziet u verschillen met oude versies, etc.
Er is voldoende gelegenheid om zelf aan de hand van opdrachten met een aantal van deze tools ervaring op te doen.
Tijdens de opdrachten doet u vaardigheden op met refactorings, vergelijkingen, unit testen, etc.

Ook toon ik een een aantal interessante sites die binnen de Delphi community erg gewaardeerd worden.
Genoeg dus om – ook na deze dag – uw kennis verder verrijken.

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

Generate XSD from XML – XSD.EXE versus on-line tools

Posted by jpluimers on 2010/11/23

Quite a while ago, I wrote about the XSD.EXE tool to generate wrapper classes from an XSD file.

Recently, I had to create an XSD based on some XML.
Actually: a client was implementing a tool, that could export some of the data as XML.
That XML had to go into their database.
But the tool vendor told the client that the underlying XSD was ‘not supported’ (odd: why allow exporting XML and then not provide something supporting as the XSD?).

Anyway, the data was not that difficult, but having an XSD at hand made the import process a lot easier.
So lets see how to get a starting XSD from an of XML files (in practice, you would do this with a couple of XML files, then collect the best pieces into your final XSD). Read the rest of this entry »

Posted in .NET, Delphi, Development, Software Development, XML, XML/XSD, XSD | 11 Comments »

TFS: moving files using the TF.EXE command-line utility (Team Foundation System)

Posted by jpluimers on 2010/11/18

I recently needed to move around a bunch of files in TFS to a new directory structure.

Doing that from within the Visual Studio 2010 IDE was tedious, so I wrote a batch-file like below.
This batch file should also work for Team Foundation System 2005 and 2008.
Notes:

  • %~dp1 fetches the drive + directory from %1.
  • %~nx1 fetches the filename + extension from %1.
  • relative target directories work better than absolute ones
  • the batch-file assumes it executes with the current directory is %sourceDirectory%

Read the rest of this entry »

Posted in Development, Source Code Management, TFS (Team Foundation System) | Leave a Comment »

Hardware Will Cut You

Posted by jpluimers on 2010/11/16

Amanda Wozniak on hardware design (which is almost, but not quite entirely unlike software design).

Quote from a viewer:

Very cool, fast paced intro. Its odd to hear about hardware design from software based world we now have – i started when things were reversed and it was/is near impossible to convey that there are different design processes. I wish production sw folks would realize that prototype != production, but once sw works sorta, it ships. Also interesting views on CAD SW and how unlike photoshop, houdini, etc it is. Perhaps the industry is ripe for a package that does recognize last 15yrs of software improvements.

Quote from the video:

If you want start tinkering around, get an Arduino. It is like 30 bucks…. Arduino is like electronics for artists. If artists can do it, so can you.

–jeroen

via Hardware Will Cut You.

Posted in Development, Hardware Development, Hardware Interfacing | Leave a Comment »

PowerShell: the 2 most common error messages for starters

Posted by jpluimers on 2010/11/11

I’ve waited for PowerShell to become pretty mature before diving into it:
Version 2 has been out for a year, no service packs have been needed, so time to get into it.

PowerShell code can be stored in scripts.
The convention is to use the .ps1 extension for that (even when running PowerShell 2.0. Lesson learned: don’t put version numbers in file extensions).

Having lots of scripting and programming experience, I was a PowerShell beginner, and similar people usually bump into a few error messages.

Luckily, lots of people have gone through that phase, so there is lots of help on the internet.
So this post is not only to show you about some common things you bump into when starting with PowerShell, but also about the power of the internet as a collective pool of knowledge.

This was the first error message I bumped into:

C:\bin>powershell first-script.ps1
The term ‘first-script.ps1’ is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.
At line:1 char:16
+ first-script.ps1 <<<<

A message by mosoto (Marcel J. Ortiz Soto) answered this as one of the first in the search results for “is not recognized as a cmdlet, function, operable program, or script file”.
The reason for this error is that unlike cmd.exe (but similar to unix shells), PowerShell does not include the current working directory (.) in the search path.

Solution: prepend the directory for your script file, in this case by prefixing it with “.\”.

This immediately leads to PowerShell rookie error message 2:

C:\bin>powershell .\first-script.ps1
File C:\bin\first-script.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details.
At line:1 char:18
+ .\first-script.ps1 <<<<

Even though searching for “cannot be loaded because the execution of scripts is disabled on this system” quickly reveals a few posts describing the cause, the error message gives a hint: get-help about_signing.

Executing this on the command-prompt gets youa lot of help about signing:

c:\bin>PowerShell get-help about_signing

This is the summary:

  • PowerShell scripts can be signed.
  • PowerShell as a global execution policy defaulting to Restricted (see below).
  • By default, PowerShell does not want to run any scripts at all.
  • You can assign these values to the execution policy: Restricted, AllSigned, RemoteSigned and Unrestricted
    (note if not specified, the policy is global, so changing this changes it for your whole system, so better define the scope)

Documentation is at:

If you set the execution policy in all scopes to Undefined and the Group Policy is not set, the default execution policy, Restricted, is effective for all users of the computer.

This is how you ask for the current policy:

C:\bin>powershell Get-ExecutionPolicy

This is how you set the current policy to only require remote scripts to be signed:

C:\bin>powershell Set-ExecutionPolicy RemoteSigned

Now you can run unsigned local scripts.
Beware: if anyone sends you a virus in an unsigned PowerShell script, that can now be executed too!

Hope this helps a few other PowerShell rookies too :-)

–jeroen

Posted in CommandLine, Conference Topics, Conferences, Development, Event, PowerShell, Software Development | 2 Comments »