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,860 other subscribers

Archive for the ‘Delphi’ Category

Weaving: Source code, IL, ByteCode, Native

Posted by jpluimers on 2011/06/28

Weaving extends your program adding new functionality.

It can be at different levels for difference purposes (AOP, Debugging, Automated Testing, etc).

This .net – What is IL Weaving? question on StackOverflow contains a few pointers to interesting reading material.

–jeroen

Posted in .NET, Debugging, Delphi, Development, Software Development | Leave a Comment »

Delphi and COBOL syntax highlighters

Posted by jpluimers on 2011/06/21

I’ve been working on a project that uses both COBOL and Delphi.

For documentation purposes, Syntax Highlighted code makes your code so much easier to read.

Delphi has GExperts for source code export (in either HTML or RTF), but it took me a while to find a good syntax highlighter for COBOL.

I finally found a COBOL syntax highighter at tohtml.com: it exports to HTML.

I’m glad I found that site, as they have a ton of syntax highlighters, divided into groups.

Quite amusing to see COBOL classified as ‘rare’ (given that it has one of the largest code bases in the world).

This is what they support:

  • main: Java
  • main: C
  • main: Visual Basic
  • main: PHP
  • main: C++
  • main: Perl
  • main: Python
  • main: C#
  • main: Ruby
  • main: JS.NET
  • main: VB.NET
  • main: Pascal
  • main: JavaScript
  • inet: html
  • inet: css
  • inet: css for html
  • inet: css for svg
  • inet: jsp
  • inet: xhtml transitional
  • inet: xhtml strict
  • inet: xhtml frameset
  • inet: asp – VBScript
  • inet: asp – JavaScript
  • inet: asp – PerlScript
  • inet: SVG 1.0
  • inet: ColdFusion
  • inet: ActionScript
  • inet: VBScript
  • xml: xml
  • xml: dtd
  • xml: xslt 1.0
  • xml: XML Schema
  • xml: Relax NG
  • xml: xlink
  • database: Clarion
  • database: Clipper
  • database: FoxPro
  • database: SQLJ (Java sql)
  • database: Paradox
  • database: SQL, PL/SQL
  • database: MySQL
  • scripts: Batch/Config.sys/NTcmd
  • scripts: sh/ksh/bash script
  • scripts: Apache httpd.conf
  • scripts: Config, INI and CTL
  • scripts: Colorer HRC
  • scripts: Colorer HRD
  • scripts: Delphi form
  • scripts: Java Compiler Compiler
  • scripts: Java properties
  • scripts: Lex
  • scripts: YACC
  • scripts: makefile
  • scripts: Regedit
  • scripts: Resources
  • scripts: TeX
  • scripts: OpenVMS DCL
  • scripts: VRML
  • scripts.install: RAR Install Script
  • scripts.install: Nullsoft Install Script
  • scripts.install: InnoSetup script
  • scripts.install: IS script
  • rare: ASM
  • rare: 1C
  • rare: Ada
  • rare: ABAP/4
  • rare: AutoIt 2.x
  • rare: AWK
  • rare: Dssp
  • rare: ADSP-21xx Asm
  • rare: Baan
  • rare: Cache/Open-M
  • rare: Cobol
  • rare: Eiffel
  • rare: Forth
  • rare: Fortran
  • rare: Haskell
  • rare: Icon
  • rare: IDL
  • rare: Lisp
  • rare: MatLab
  • rare: Modula2 and Oberon2
  • rare: PicAsm
  • rare: Rexx
  • rare: Standard ML
  • rare: OCaml
  • rare: Tcl/Tk
  • rare: Sicstus Prolog
  • rare: Turbo Prolog
  • rare: Verilog HDL
  • rare: VHDL
  • rare: z80asm
  • rare: asm80
  • rare: 8051 asm
  • rare: AVR asm
  • other: files.bbs
  • other: Diff/Patch
  • other: message
  • other: plain text
  • other: default type

--jeroen

Posted in COBOL, Delphi, Development, LISP, Software Development | 6 Comments »

SVN tree to source code of Marco Cantu’s Delphi Books

Posted by jpluimers on 2011/06/09

If you love the Delphi books by Marco Cantu as much as I do, then you certainly will love that Marco has created a public SVN repository at code.marcocantu.com containing all the samples of his Delphi 6, 7, 2007, 2009, 2010 and XE books.

Way to go Marco!

–jeroen

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

GExperts version 1.35 was released on June 5th, 2011

Posted by jpluimers on 2011/06/08

Earlier this week, the new GExperts 1.35 Release got published: a free set of expert extensions supporting Delphi 6 through XE.

It is an incremental release has a few new features of which I like the new subgroup support in the Grep Search extensions most.

Now hopefully, Thomas Müller will release an experimental GExperts build of version 1.35 soon: his experimental builds integrate a source code formatter that works across many Delphi versions and often formats better than the one included in Delphi 2010 and up.

–jeroen

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

Delphi sorcery – great new blog by Stefan Glienke: DataBinding, MEF, Lamda Expressions and more

Posted by jpluimers on 2011/06/07

I just came across the great new Delphi sorcery blog by Stefan Glienke from Soest, NRW, Germany.

He uses some cool new features recently introduced into Delphi for new ways of DataBindingYield-Return, Delphi Lambda Expressions, Delphi Dependency Injection with MEF and more.

Sample code is at his Delphi Sorcery Google Project.

I hoped that somebody would do all that, as this shows the real power of what Delphi can do.

Now it’s there for

–jeroen

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

Delphi Win32 talking to .net – Different WSDL ASMX,WCF web-services – Stack Overflow

Posted by jpluimers on 2011/05/31

An interesting question on Stackoverflow.com: .net – Different WSDL ASMX,WCF web-services – Stack Overflow.

The answer is simple when you know it: flatten the WSDL that comes from WCF.

Note that Delphi Win32 is not the only client having these issues, as Elton Stoneman shows on his blog and the WCFExtras toolkit for WCF that allows for single WSDL export.

–jeroen

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

FM USB Library

Posted by jpluimers on 2011/05/10

The FM USB Library is on my research list.

–jeroen

PS: a few raw links that might fit in:

http://www.silabs.com/usbradiohttp://www.silabs.com/products/mcu/Pages/USBFMRadioRD.aspx

http://code.google.com/p/silabsradiodll/

http://parts.digikey.nl/1/1/543483-usb-fm-radio-stick-usbfmradio-rd.html

http://www.mouser.com/ProductDetail/Silicon-Laboratories/USBFMRADIO-RD/?qs=42TdBvIR%2fY7X5XVJkFBvBg%3d%3d

http://nl.farnell.com/jsp/search/productdetail.jsp?sku=1186925

http://www.newark.com/jsp/Non-Stocked/All+Non-Stocked+Products/SILICON+LABORATORIES/USBFMRADIO-RD/displayProduct.jsp?sku=98K2140

http://www.mp3car.com/hardware-development/64550-usb-fm-rds-solution-with-sofware-40.html

http://www.mp3car.com/hardware-development/64550-usb-fm-rds-solution-with-sofware-41.html

http://usb.brando.com/prod_detail.php?prod_id=00136

http://usb.brando.com/usb-radio-ii_p1785c35d15.html

http://www.whitebream.com/p811.shtml?id=p811

http://khason.net/blog/read-and-use-fm-radio-or-any-other-usb-hid-device-from-c/

http://www.dealextreme.com/p/usb-digital-radio-receiver-dongle-fm-76-108mhz-1929

http://www.silabs.com/products/audiovideo/fmreceivers/Pages/default.aspx

http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=usb+fm+rds+site%3Amouser.com

http://www.mp3car.com/hardware-development/69493-hqct-module-new-thread-following-hu-rds-rdbs.html

http://www.mp3car.com/hardware-development/64550-usb-fm-rds-solution-with-sofware-2.html

http://www.cartft.com/catalog/il/1139

http://www.digital-car.co.uk/forum/showthread.php?12194-New-CarTFT-FM-(Automotive-USB-FM-RDS-tuner)

http://www.cartft.com/catalog/il/1017

http://btwincap.sourceforge.net/download.html

http://btwincap.sourceforge.net/supportedcards.html

http://www.alibri.it/RRMobile/Silab%20USB%20Radio.htm

http://www.mo-co-so.com/Car-TFT-FM-Tuner-with-RDS-p/mcs-tft-rad.htm

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272

Posted in .NET, C#, Delphi, Development, Prism, Software Development | Leave a Comment »

Tortoise SVN Global Ignore Pattern for Delphi and Visual Studio

Posted by jpluimers on 2011/04/26

Since I use (among others) both Visual Studio and Delphi, I changed the Tortoise Global Ignore Pattern to be this:

Debug lib *.identcache *.local *bin *obj RECYCLER Bin *.user *.suo *.dcu __history ModelSupport_* *.rsm thumbs.db *.bak *.~* __recovery *.tvsconfig *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo *.rej *~ #*# .#* .*.swp .DS_Store

The bold portion is what I changed when compared to the original one:

*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo *.rej *~ #*# .#* .*.swp .DS_Store

Input from [WayBack] Tortoise SVN Global Ignore Pattern for Visual Studio (which also included some of the Delphi patterns), [WayBack] this Stackoverflow question (that indicated the patterns are case sensitive) and [WayBackShawn Oster | TortoiseSVN global ignore pattern for Visual Studio and Delphi.

–jeroen

PS: Added __recovery as Delphi 10.* started to use that for recovery files, which – unlike __history  is not documented, see [WayBack] What is the __recovery folder ? In C++ Seattle 10 Professional running under Win 7 I now get a folder called __recovery.

Posted in .NET, Delphi, Development, Software Development, Source Code Management, Subversion/SVN | Leave a Comment »

Delphi Constraints in Generics – RAD Studio XE documentation wiki

Posted by jpluimers on 2011/04/21

Quite a few things are similar when doing Generics in both Delphi and C#.

But constraints are a bit different.

To quote the Delphi Wiki page on Constraints in Generics – RAD Studio XE:

Constraints can be associated with a type parameter of a generic. Constraints declare items that must be supported by any particular type passed to that parameter in a construction of the generic type

Constraint items include:

  • Zero, one, or multiple interface types
  • Zero or one class type
  • The reserved word “constructor“, “class“, or “record

You can specify both “constructor” and “class” for a constraint. However, “record” cannot be combined with other reserved words.
Multiple constraints act as an additive union (“AND” logic).

A few other differences are these:

  • In .NET, there is a unified typing system: everything descends from System.Object, including both value types and reference types. In Delphi this is not the case. In .NET, when you don’t specify a constraint, but use the type in a reference way, it will do automatic boxing. Delphi has no concept of automatic boxing, so you cannot use a non-constrained type as a reference
  • In both .NET and Delphi, you cannot specify a constraint on an enumeration type. In .NET you can work around this by constraining on the underlying interfaces. In Delphi you cannot do that because enumeration types are ordinal types that do not implement interfaces.
  • In Delphi you cannot constrain on ordinal types.

Note that – like the Delphi documentation – the C# constraints on type parameters documentation is not complete on those either.

Related: a great post [WayBack] Using Generics in Delphi – Phil Gilmore covering the comparison between C# and Delphi in more depth.

–jeroen

via: Constraints in Generics – RAD Studio XE.

Posted in C#, Delphi, Development, Software Development | 10 Comments »

Entity Framework 4 – security warning popup workaround: Do you trust all the T4 “text templates” on your system, even future ones?

Posted by jpluimers on 2011/04/13

When using Entity Framework 4, your transofmrations (model to classes, DB to model, etc) are performed by T4 Text Templates.

Those templates are executed all over the place (when saving your project, building your project, changing your model, etc).

Since anyone can insert a T4 Text Template into Visual Studio, and those are scripts, it is a potential vulnerability.

The default Visual Studio behaviour is to show you a dialog like this:

[Security Warning]

Running this text template can potentially harm your computer. Do not run it if you
obtain if rtom an untrusted source.

Click OK. to run the template.
Click Cancel top stop the process.

[X] Do not show this message again

[OK]  [Cancel]

Some blogs mention Just click OK and feel free to check “do not show this message again.”

I’m not sure I want that: it would indicate I always trust T4 Text Templates, even the ones added in the future (T4 Text Templates are executable content, malicious software could find it’s way into your development environment; anyone remember the virus that hooked itself into the run-time library sources of a development system so it would spread through anything compiled on that system?).

But I also don’t want to click OK on that dialog.

It would be so nice if the dialog:

  1. Showed which template is about to be executed
  2. Allowed me to skip only for that particular template

Anyone better thoughts on this?

–jeroen

via Customizing EDM Code Gen in EF4 : Don’t Be Iffy.

Posted in .NET, C#, Delphi, Development, EF Entity Framework, Prism, Software Development | 4 Comments »