Posts

Showing posts from 2012

Code Snippets Database Version Support - Update

Back in September in gave notice that I was going to cease supporting CodeSnip versions up to and inlcuding v2 when adding new snippets to my Code Snippets Database (see my post "Code Snippets Database Version Support").This post is just to confirm that the last updates to the database that will be visible in CodeSnip versions 1 and 2 have just been released today.This also means that the online version of the database, which has similar characteristics to CodeSnip 2, will no longer be able to "see" new database updates.So, if you want to keep on getting or viewing updates to the database you need to do one of:Update to the latest version of the CodeSnip program.View the snippets using the new Code Snippets Database – Take 2 web app, which is in early beta at present.If it's new year's eve where you live, have a happy new year!

CodeSnip source now moving to GoogleCode

Well, I've migrated the CodeSnip project to SourceForge's new Allura forge, and I think the Subversion repo software stinks!Lots of external links into the repo that I rely on in documentation can't be made to work as I want and the whole repo support seems badly thought out to me.So, I'm planning to move the repo to GoogleCode, which at least I know quite well because I host some other projects there.I'm afraid this means that the migration will take even longer than I suspected - sorry for that if you're waiting to use the repo. I'll post again as promised once the new links are active.For the time being, downloads and bugs / feature requests will still be kept on SourceForge.UPDATE (3rd Jan 2013): All the changes to CodeSnip's hosting are now complete - more info.

CodeSnip project moving home on SourceForge

Over the next few days SourceForge will be migrating the CodeSnip project to their new "Allura" forge.If you access CodeSnip's Subversion source code repository or download CodeSnip updates from SourceForge you will find that the project may not be available at times.UPDATE 1: CodeSnip's source is now going to be moved to GoogleCode. See "CodeSnip source moving to GoogleCode" for more info.UPDATE 2: All the changes to CodeSnip's hosting are now complete - details.Once the migration is complete the URLs used to access the Subversion repo will change. Once the new URLs are working I will post them here and on CodeSnip's download page on my website.Sorry about the interuption but SourceForge have given notice that all projects now need to be migrated. I just hope the glitches I noted in my mini review a few posts ago have been fixed.

Checking File Preambles and Watermarks

I'm constantly having to check the preambles of files for some kind of signature (or "watermark") to check or validate the file's format.I've re-invented the wheel many times over while doing this. Time, I thought, for a little helper routine or two.First, a little routine to check the next N bytes from a stream for a given sequence of bytes (the "watermark").functionStreamHasWatermark(constStm:TStream;constWatermark:arrayofByte):Boolean;varStmPos:Int64;Buf:arrayofByte;I:Integer;beginAssert(Length(Watermark)>0,'No "watermark" specified');Result:=False;StmPos:=Stm.Position;tryifStm.Size-StmPos<Length(Watermark)thenExit;SetLength(Buf,Length(Watermark));Stm.ReadBuffer(Pointer(Buf)^,Length(Buf));forI:=Low(Buf)toHigh(Buf)doifBuf[I]<>Watermark[I]thenExit;Result:=True;finallyStm.Position:=StmPos;end;end; Pass it a stream and an array containing the required "watermark" and the routine checks to see if the watermark exists…

New look blog

Just finished giving the blog a new look and feel. I hope it's clearer and less fussy than the previous version.The syntax highlighter styling has been switched to emulate the Delphi "Classic" theme, e.g.:procedureFoo;// example of highlighterShowMessage('The answer is '+IntToStr(42));end; So there we are then. Comments appreciated.

CodeSnip 4 Emerges

Image
After a lot of development CodeSnip v4 has finally been released. You can get it from the CodeSnip Download Page or from SourceForge. Here's a list of the key new features and changes:Snippet HandlingNew "unit" and "class" snippet kinds that can include complete units and classes (and advanced records) in the database. Both can be test compiled and classes / advanced records can also be included in generated units.Snippets from both the main and user databases can now be duplicated. This is very useful if you have created a snippet and want to create another one that shares a lot of the source code, dependencies etc.The full range of Unicode characters can now be used for snippet names, descriptions etc., and for source code.There is now finer control over the control of warnings in generated code via the $WARN directive.The names of referenced units may now contain dots so that Delphi namespaces can be used.User InterfaceThe new multi-tab display can display de…

Aaargh - Another BAD CodeSnip Bug - Now Squashed

You couldn't make this up.No sooner had I released CodeSnip 4 release candidate 2 to correct a nasty bug relating to snippet display names than I read a comment in the blog about another new, and even worse, bug.This one affects clean installs of CodeSnip, i.e. installs where there was no previous version of the program installed.It would either crash on start-up or to look into a permanent loop using a lot of processor time. Bad because it means no new users could install it. This bug goes back to beta 2.I've rushed out a patch for this problem - CodeSnip 4 release candidate 3. You can get this on SourceForge or download it direct from my website.If you are using any of the betas or release candidates you really SHOULD update now.I find it strange that no-one has reported this until now, and that I didn't find this bug while testing the installer. But at least it got reported before the final version gets released - big thanks to the anon reporter. I guess people using th…

CodeSnip v4.0 RC-1: Nasty Duplicate Display Name Bug + Fix

Well, this is embarrassing.Only a few days after CodeSnip 4 RC 1 became available I've discovered a nasty bug that causes the user interface to crash if more than one snippet has the same display name. The bug also applies to Beta 1 and Beta 2.It's really nasty for two reasons:Its easy to trigger the bug. All you have to do is to accept an edit where you have created a display name that duplicates an existing one. Once you've pressed OK its too late. Worse, if you duplicate a snippet CodeSnip automatically duplicates the display name if the snippet has one. Once again pressing OK is all that's needed.Because the bug is reported as a fatal error, CodeSnip helpfully tries to save the database before terminating. In the case of this bug it usually succeeds, which means the duplicate display name is saved in the database. When CodeSnip is restarted it instantly crashes again because its UI can't display the duplicate display names.I've rushed out a fix that you can…

SourceForge Allura - First Impressions

Image
Now that SourceForge are promoting their new Allura forge and are encouraging projects to move to it, I thought it was time to dip my toe in the water.I have a tiny project called CompFileDate (a file date comparison utility) that I keep on SourceForge mainly as a test-bed. I thought I'd migrate that to try out the new platform before taking the plunge and migrating the much larger CodeSnip project.Here are my first impressions.The new interface is very clean and looks promising. But it is quite inconsistent and the menus change between a simple clear menu bar on some pages to a kind of toolbar on other pages. Here's part of the menu as displayed when viewing the summary page. And now here's what it looks like when the Wiki item is clicked: Not only has the style changed but, in the first menu you get to the download files page from the "Files" item. In the second menu you get there from "Downloads".It confused the hell out of me at the start, and still c…

Online Code Snippets Database Reverts to Childhood

For a time now the web based Code Snippets Database has been lagging behind the CodeSnip program in the kinds of snippets it can understand and include in compilable units.The compromise position was that it would display any snippet, but would not include some of them in compiled units. These included:Overloaded functions and proceduresSimple typesConstantsCodeSnip 4 is due to make matters worse by introducing class / advanced record types and units, neither of which this venerable web app can handle.It's a lot of work to bring the database up to date, so I've decided to replace it with an all-new Web 2.0 app. In the meantime, I've decided to restrict the old app to displaying only those snippets it understands. In effect, it is now compatible with the CodeSnip 2 way of handling the online database.Sorry if this is inconvenient. If you need the full database, please download the latest version of CodeSnip, which can display everything and can also create units for all the…

Code Snippets Database Version Support

When updating the Code Snippets Database, I have always maintained compatibility with all versions of my CodeSnip program: as many snippets as possible have been available in all versions of CodeSnip.As CodeSnip has developed, and more and more features have been added, supporting them all has become something of a burden.So I've decided to stop releasing snippets that support CodeSnip v2 and earlier from the end of the year.This means that, as of 1st January 2013, any new snippets added to the database will not be visible in CodeSnip v2 and earlier. Existing snippets will continue to be available - I'm not planning to take anything down that's already there.If you're one of the few remaining users of the early CodeSnip versions it's really time to update.There are differences between snippets used in CodeSnip v3 and the new v4, but these are much easier to manage, and so all snippets will continue to be available for both versions, unless they need the new feature…

A Fix for TWebBrowser's Irritating Click Sound

For a a long time now, my CodeSnip program's propensity to make little clicking noises when some pages are displayed or some internal links are clicked has been irritating me to death.Of course, this is because CodeSnip uses Delphi's TWebBrowser control to display the main part of its UI: and TWebBrowser wraps the Internet Explorer display engine, and that's where the well known clicks come from.Many people say that the click is part of the expected user experience, but while I agree for apps that present a noticeably web inspired interface, I don't think it's helpful in apps like CodeSnip that simply use the browser control as a way of diplaying a richly formatted user interface: users aren't supposed to even know there's a browser control there.Any road up, I've finally found how to turn off the dreaded click using a proper API rather than a kludge that hacks about the registry. I've seen this solution discussed for VB and C#, but not for Delphi, …

More help with CodeSnip and Delphi XE2 please

A user has reported that CodeSnip fails to compile snippets with Delphi XE2 and issues an error that suggests it can't find the required .dcu files.EDIT:What follows was not the problem at all! It was in fact the VCL etc. units that couldn't be found and is to do with XE2 namespaces. The problem, and a work around, has been written up in this FAQ. (Actually this should a a TAQ - twice asked question!)This may be because XE2 uses different folders for .dcu files depending on whether it is compiling for 32 bit or 64 bit.Because I don't have XE2 I'm looking for someone who does to check if snippets compile OK on their system (requires CodeSnip v3.9.0 or later).Additionally, I'd like you to also check if setting the -$N command line switch enables compilation to work, whether or not you find snippets compile OK.To do this from CodeSnip, use the Tools | Configure Compilers menu option to display the Configure Compilers dialogue box. Select Delphi XE2 in the left hand li…

Last call for CodeSnip 4 feature requests

The last of the CodeSnip 4 Preview releases is out and the next planned release will be the first beta, sometime around August I guess. That should be feature complete with a bit of luck.That means I'm closing requests for new features at the end of this month - i.e. 30th June. So if you really want to see a new feature in CodeSnip v4, then now's the time to ask. Just head over the Feature Request Tracker on SourceForge.Not guaranteeing anything, but your idea may get accepted for v4.

MPL v2 for me

The Mozilla Public License v2.0 was officially released a few weeks ago. I never though I'd get excited about a source code license, but I have (well nearly)!I have always been attracted to the less restrictive nature of the MPL compared with the Free Software Foundation licenses (GPL / LGPL).Although I personally find the GPL too restrictive - I don't want to insist that my code can only be used in other GPLd project - I do want to ensure my code never goes closed, and that it is always freely available. Therefore some of the most permissive license are out of it for me.So I have settled on the MPL v1.1 for most of my code. The big downside though is that MPL 1.1 code isn't compatible with the GPL, so my code can't be used in GPL projects. I can get round this by changing to the MPL / GPL / LGPL tri-license, but that has its own problems.So, I'm pleased that the MPL v2 is now GPL compatible, is lot simpler to use than tri-licensing and doesn't have the same pr…

PasHi overhaul

I've started working on a major overhaul of the PasHi Pascal Syntax highlighter adding long-overdue parsing updates and Unicode support, along with a bunch of new commands.If you use it and would like to see a new feature, please create a new issue in the PasHi issue tracker and change the "Type-Defect" label to "Type-Enhancement". Just delete the template text and describe the feature you want.The source code for the overhaul is in the GoogleCode Subversion Repository in the branches/v2-dev tree.

Changes to CodeSnip SVN Repo

I've made some changes to the CodeSnip Subversion source code repository on SourceForge that you need to know about if you access the repo:The v4 development code has been integrated into the trunk. All development effort is now on v4, so it makes sense to move it here.The v4-dev branch is now redundant and has been removed.v3 maintenance code has been moved to a new branch named 3.x. All bug fixes to v3 will happen here. v3 is now in maintenance only, and no new features will be added, unless someone is very persuasive.