EKON 12 – with a compiler engineer from CodeGear!

Today I visited the page of EKON12, the german conference for Delphi and all the other stuff from CodeGear. And, wooow, there are in the Delphi - area two very, very interesting sessions with Barry Kelly, who is one of the software engineers working on the Delphi compiler at Embarcadero's CodeGear.Here are the details from the EKON-page:New Delphi for Win32 language features Barry Kelly - CodeGear This session provides an overview of the new Delphi language features for RAD Studio 2009 - Unicode, generics and anonymous methods, and some intermediate and more advanced usage scenarios, including generic collections and concurrency idioms enabled by anonymous methods. Advanced anonymous method and generics usage Barry Kelly - CodeGear This session covers more advanced usage scenarios for anonymous methods and generics. For anonymous methods, it will show a survey of closure-passing idioms as well as uses in threading: marshalling, futures, parallel-loop constructs. For generics it will be about escaping from constraint limitations via helper interfaces.
Read More

Repositorios lazarus testing

Thinking about what it is sometimes difficult for beginner Lazarus install a Linux system, I've created some repositories to facilitate their work.Here instructions. Repository Lazarus / testing FPC versions The version of Lazarus is the 0.9.25 revision 15753 compiled with GTK2 in ide and packages, which works perfectly in our labs (delphi 7 is a steroid): PThe version 2.3.1 is freepascal super testing, just to risky (though not confess has given us a single complaint, on the contrary)Following the instructions.Repositories Lazarus and freepascal testing.There's no guarantee at all! Use it at your own risk.Installation instructions:Add the key GPGgpg --keyserver hkp://pgp.mit.edu:11371 --recv-keys F93F2601Add the key to APT system: gpg --export F93F2601 | sudo apt-key add -Check whether the key was built:sudo apt-key list Add the repository to its list of repositoriesYou can use synaptic or edit / etc / apt / sources.list directly. Add the line:deb http://www.petrobox.net/lazarus/ lazarus-testing universeInstall Lazarussudo apt-get updatesudo apt-get install lazarusEnjoy!Namaste.
Read More

Detecting a virtualized environment

CubicDesign on delphi-talk.elists.org recently asked the question: "How do I know/detect if my software is running under Windows [or a virtual environment]?" Well, it turns out that it's a lot harder to tell than you would think. Apparently, the VM (VMware, Xen, Wine, etc.) doesn't really want you to be able to do this. At least not easily.For VMware, there is a decent little C routine called jerry.c that does the trick. Jerry actually uses a simple communication channel that VMware left open. It's not 100% foolproof since the admin can change the channel, but that's not likely going to happen unless the system is specifically designed to be a honeypot. If you're running on a honeypot and still have a legitimate reason for detection, you could look at the much more complex scoopy implementation which inspects how the system is actually virtualized using the SIDT CPU instruction instead of a communication channel. Another reference (red pill) is here.For Wine, there is a special dll entry called wine_nt_to_unix_file_name that they added to NTDLL.DLL. If you use LoadLibrary and GetProcAddress, you can determine if you are under Wine simply by the entry's presence or absence. Of course, if you specifically want to know what version of Wine you're on, you have to use NTDLL_wine_get_version but that function is only available in the bleeding edge version of wine. As an interesting side note, the Jerry test above actually returns true for VMware workstation under Wine. If you really have to know Wine vs VMware, make sure you test Wine first, otherwise you'll get a false positive.For Xen, the most reliable method appears to be to use the WMI interface and get the Bios manufacturer's information. If it's Xen, then you are under some version of Xen. Since I don't have a Xen environment setup currently, I couldn't test this information. I am relying on information published here to make this assertion. At some point, I'll setup a Xen server and play with it.For true VM's like Xen and Vmware, you can also test against the mac address. VMware uses 00-05-69 as the lead and Xen uses 00-16-3E. To see a list of all registered Mac addresses, go here. Keep in mind, that the VMM supports changing the MAC address so this is also easily defeated.At any rate, here's some sample code that uses the described methods to detect VMware and Wine. Enjoy!VMware://credit to chitchat@lycos.jp who discovered this method and//checkvm + IDA Pro ;)//converted from C source posted on www.trapkit.deprocedure TForm1.btnJerryClick(Sender: TObject);var a, b:cardinal;begina:=0;try asm push eax push ebx push ecx push edx mov eax, 'VMXh' mov ecx, 0Ah mov dx, 'VX' in eax, dx mov a, ebx mov b, ecx pop edx pop ecx pop ebx pop eax end;except on E:Exception do ShowMessage(E.Message);end;if a=$564D5868 then begin ShowMessage('In VMware'); case b of 1 : ShowMessage('Express'); 2 : ShowMessage('ESX'); 3 : ShowMessage('GSX'); 4 : ShowMessage('Workstation'); else ShowMessage('Unknown version') end; endelse ShowMessage('Native system');end;Wine:function TForm1.IsRunningWine: boolean;var hnd:THandle; wine_get_version: function : pchar; {$IFDEF Win32} stdcall; {$ENDIF} wine_unix2fn: procedure (p1:pointer; p2:pointer); {$IFDEF Win32} stdcall; {$ENDIF}beginresult:=false;hnd:=LoadLibrary('ntdll.dll');if hnd>32 then begin wine_get_version:= GetProcAddress(hnd, 'wine_get_version'); wine_unix2fn:= GetProcAddress(hnd, 'wine_nt_to_unix_file_name'); if assigned(wine_get_version) or assigned(wine_unix2fn) then result:=true; FreeLibrary(hnd); end;end;
Read More

Delphi 2007 Essentials in Göteborg, Sweden

From Monday, May 19th until Wednesday May 21st, 2008, I'll be in Göteborg, Sweden, for a 3-day Delphi 2007 Essentials seminar (spoken in English) covering topics like the IDE and Language enhancements, VCL Database Development (BDE/dbGo for ADO/TClientDataSet/DBX4 and DataSnap), Web Development (WebBroker/WebSnap but especially IntraWeb, ASP.NET 2.0, and AJAX), and XML, SOAP and Web Services. See the complete agenda online.
Read More

Upgrading OS X to Leopard

Having just returned from two holidays: Colorado with a motorbike (lovely people, stunning scenery) and Firenze with my lovely girlfriend (lovely people, stunning architecture and art) I decided to update my OS X partition to the new shiny leopard. Here are a couple of notes of how I got on, which is hopefully useful to anyone else doing the same. Read More ...
Read More

Professional Development on a MacBook Pro

Like a number of people in the Delphi Community ( Steve Trefethen, Dan Miser ), and the development community as a whole, I now do all my development on a MacBook Pro. I changed to an Apple machine six months ago, for a number of reasons: I needed a new laptop, and the MacBook Pro hardware is so goddamn thin, light, and good looking. I am becoming increasingly disillusioned by Windows, especially the new DRM stuff. I fancied trying out OSX, a change is as good as a rest and all that. Bootcamp and virtualisation allow me to use Windows XP on an Apple laptop. The web is freeing us from being locked into particular Operating Systems. As a professional developer, most of my clients run Windows, and most of my native development is done using Visual Studio 2005 or Delphi 2006, connecting to SQL Server or Oracle backends. I boot my laptop into Windows to do this work, or use Parallels to run it with Mac OSX (when I got my MacBook Pro I got it with 3G of RAM so Windows runs pretty fast inside OSX). Increasingly though I am doing web development, which means I can do much more work inside just OSX. The more I have used OSX, the more I prefer it to Windows, so I have put together this list of tools and hints for doing professional development on OSX: Read More ...
Read More

Rules of Thumb to Make a Project Work

I am currently coming to the end of a large project for one of our clients, where I have been acting in the Business Analyst and Technical Lead roles. It has been a fun and successful project, and I wanted to pass along some of the lessons I’ve learnt (again) about how to make Technical Analysis (and the project as a whole) successful (and also make a checklist for next time around ;–). It must be remembered that IT solutions (and really any business change) are all about two things: Incentives and Trade-offs. Read More ...
Read More

DataSnap to the rescue

I'm maintaining a custom setup program used to install applications. In some cases it needs to perform actions which require administrative privileges, e.g. writing into Program Files directory, or modifying the registry under HKEY_LOCAL_MACHINE.On Windows Vista, the privileges can be acquired by elevation. However, elevation actually switches the user context; but the setup program also needs to
Read More

Devco Wish List

This is my wishlist for Delphi when the new company running it is planning the next version. My requests are not large things (except maybe the last one), and are in order of priority. Summary: Language construct: return . operators on basic types Include all source code (midas, dbExpress) Ruby Read More ...
Read More

GIS

I’m writing this posting for two reasons. Firstly my company is currently engaged in a project with a client about getting
more of their data onto their intranet based mapping tool, so I’ve spent the last 3 days researching and getting back… … Read More

Read More