-
CSS Lint
written:
8 months ago
category:
Programming
Not just another CSS validator, but more: checks your CSS code for bad, unpreferred and browser-incompatible code: http://csslint.net/
-
Set meta description in extension
written:
1 year ago
category:
Programming
To set a page title from within any Typo3 extension, you just access the relevant page array item:
$GLOBALS['TSFE']->page['title'] = 'My title'Now, if you expect this to work also for the meta description you will probably be disappointed. Try this instead, which worked for me on a 4.1 installation:
$GLOBALS['TSFE']->cObj->data['description'] = 'My description' -
How fucked is your database?
written:
1 year ago
category:
Programming
See also: http://howfuckedismydatabase.com/
-
Delphi shortcut
written:
2 years ago
category:
Programming
Just found by accident: When editing a .pas unit, Shift + Ctrl + [ArrowUp or ArrowDown] jumps from procedure declaration to implementation. Very nice if you have large units with several thousands of lines and numerous procedures and functions.
-
Delphi generics
written:
2 years ago
category:
Programming
Just found a wonderful and deep look into generics, anonymous routines and routine references here . Written by Sébastien Doeraene.
Generics were introduced in Delphi 2009, and I'm a big fan of them, as they help me do less type casting on TObjectList's items for example.
Want to know how sorting a TObjectList<TWhatever> works? Here's how it works:
type TDBObject = class Name: String; end; TDBObjectList = TObjectList<TDBObject>; TDBObjectComparer = class(TComparer<TDBObject>) function Compare(const Left, Right: TDBObject): Integer; override; end; procedure TMainform.btnOkClick(Sender: TObject); var o: TDBObject; begin Result := TDBObjectList.Create(TDBObjectComparer.Create); o := TDBObject.Create; o.Name := 'foo'; Result.Add(o); o := TDBObject.Create; o.Name := 'bar'; Result.Add(o); end; function TDBObjectComparer.Compare(const Left, Right: TDBObject): Integer; begin Result := CompareText(Left.Name, Right.Name); end;See also: ftp://ftp-developpez.com/sjrd/tutoriels/delphi-generics/delphi-generics.pdf
-
Typo3, exclude rootline menu on first level pages
written:
2 years ago
category:
Programming
On the root or first level page you probably want to hide a so called breadcrumb menu, as it would be a single word, identically with the page title, looking like a repetition of the page title. All "deeper" page levels should indeed include the complete path.
There is a HMENU.minItems property which looked pretty like what I needed. But that created a dummy item with three dots for missing level items, not what I wanted. So, the trick is to use a conditional block, where the first one is executed on page level 0 and 1, and the second one for all deeper levels:
[treeLevel = 0,1]
# No breadcrumb on root or first level pages
mainPage.10.marks {
BREADCRUMB = TEXT
BREADCRUMB.value =
}
[else]
mainPage.10.marks {
BREADCRUMB = HMENU
BREADCRUMB {
wrap = <p>|</p>
special = rootline
# No item at all for the root page, so we start at level 1
special.range = 1|-1
1 = TMENU
1.NO = 1
1.NO.allWrap = | »
1.CUR = 1
1.CUR.doNotLinkIt = 1
}
}
[end]See also: http://typo3.org/documentation/document-library/references/doc_core_tsref/4.1.0/view/4/1/
-
Add anchor in getTypoLink
written:
3 years ago
category:
Programming
getTypoLink() doesn't allow you to pass an anchor parameter. So, in order to add an anchor to such a link you just have to add the anchor part to the id parameter:
$this->cObj->getTypoLink('Link Label', '123#myanchor');$this->cObj->pi_linkToPage('Link Label', '123#myanchor');$this->cObj->getTypoLink_URL('123#myanchor');By the way, ever saw what the harmless function
class.tslib_content.php:typoLink()does? Have a look just for fun, it's a 300 liner! Feels like Typo3 has a damned considerable amount of workarounds for various special cases and requirements.See also: http://www.typo3-jack.net/typo3-dev-lists-netfielders-de/3076-typo3-dev-typolink-anchor.html
-
VirtualTree Bugtracker
written:
3 years ago
category:
Programming
Mike has just set up a bugtracker at Google Code for his popular VirtualTree component for Delphi. So, finally, all interested developers can actively participate in enhancing and extending this thing.
HeidiSQL makes extensive use of VirtualTree - as replacement for the normal TTree's and TListView's we had in old days. VirtualTree can display tree-like structures as well as lists, in all colors and flavours you can imagine:

Much more: it minimizes CPU and memory usage by strictly following the virtual paradigm (= just process visible nodes, nothing more, the rest is processed when the users scrolls to it). That means you can create millions of nodes in milliseconds. It has support for drag'n drop, custom cell editors (similar to plugins), images in column headers and cells, tons of useful events, and numerous other things you won't like to miss once you get used to them.
See also: http://www.soft-gems.net/index.php?option=com_content&task=view&id=56&Itemid=1
-
Get number of enumerated, ordinal elements in a SET
written:
3 years ago
category:
Programming
Imagine some ordinal type and a set enumeration of it in Delphi:
Now, imagine you have several loops and points where any TLocation is added to or substracted from locs. At a later point in your application you need the number of elements in locs. Although that seems totally trivial that is not implemented in Delphi's compiler. The only SET related procedures in Delphi's compiler are Include, Exclude and In - there is no Count method for SETs. Well, you can help out and write your own one, as I discovered here:type TLocation = (locHere, locThere, locElsewhere); TLocations = Set of TLocation; ... var locs: TLocations; ... begin Include(locs, locHere); end;function CountSetItems(SetValue: Integer): Byte; var Mask: Integer; begin Mask := $80000000; Result := 0; while Mask <> 0 do begin if SetValue and Mask <> 0 then inc(Result); Mask := Mask shr 1; end; end; -
New HeidiSQL release: 4.0 RC3
written:
3 years ago
category:
Programming
Mainly a maintenance release but some nice enhancements in it:
- Legacy MDI (Multi Document Interface) has been removed completely
- Use Ctrl+Tab and Shift+Ctrl+Tab for switching main tabs
- Added quick connect sessions via drop down menu of connect button
- Session background color
- Date time editing fixed
- Various bugfixes
Download your copy.
Note that if you use the original 4.0 RC1 release your auto update mechanism won't update to this new release as in that older release it was broken (caused by the "M" in "r1901M").
In case you're wondering about the missing RC2 release: That version was created as Subversion tag but found as broken (XP theming was accidently disabled in a previous commit). So I decided to fix that first and - for consistency reasons - created a new version tag.
-
Bolan Website online
written:
3 years ago
category:
Programming
Finally done and uploaded to its correct place. A new website is born, selling home fashion and furniture by a flexible and experienced team of Bolan Home Fashion in Wettringen.

See also: http://www.bolan-home-fashion.de/
-
Basic Oracle support in jHeidi
written:
3 years ago
category:
Programming

See also: http://www.heidisql.com/forum/viewtopic.php?p=2961#2961
-
HeidiSQL 4.0 RC1 released
written:
3 years ago
category:
Programming
Some of the new features:
- Completely rewritten user manager
- Full Unicode support for international characters in grids, SQL queries, CSV import etc.
- New grid component, including user friendly popup editors for blobs, date/time, set, enum columns. Grid cells have customizable colors, according to their data type.
- A new view editor
- Enhanced Vista style and a new, stylish iconset
- Automatic update check
- More speed in various places
- much more ...
See also: http://www.heidisql.com/download.php
-
How to enable Unicode in VirtualTree's inplace editor
written:
4 years ago
category:
Programming
VirtualTree's inplace editor is the only thing which is (by default) not Unicode enabled in that package. Just found after having a Unicode enabled inplace editor for VirtualTree half implemented: If you have TNT Controls installed, you can activate "TNT support" in your [PathToVirtualTree]\Source\VTConfig.inc :
{$define TntSupport} -
IE6 reserved word "functions" in class name
written:
4 years ago
category:
Programming
Internet Explorer 6 has several excuses for not wanting to display certain DIVs or text in DIVs. Most of them arise from the internal hasLayout property which has to forced to -1 (on!) to unhide those HTML parts. I just came around another, very odd reason for why IE6 hides text in certain situations: CSS classnames which interfere with reserved words such as functions. Simple example:
<div class="functions">bla blub</div>Just rename functions to whatever and you're done.
-
The mother of all Delphi components
written:
4 years ago
category:
Programming
Thank you, Mike, for Virtual Treeview . It's the most useful, powerful, fast, flexible, beautiful, multifunctional Delphi component I've ever seen. Thank you, thank you, thank you!

-
Ensuring window visibility after plugging off a second monitor
written:
4 years ago
category:
Programming
I recently connected my new HD TV to my notebook, to test the DVI-to-HDMI adapter I just bought and various resolutions. I played a bit with different resolutions, started HeidiSQL, moved it to the TV which was used as second desktop. Then, after having plugging off the TV I started HeidiSQL again and saw - nothing! No window visible... HeidiSQL remembered its last window position and started in the area where the TV has previously provided its resolution. So, looked like a bug :) Started Delphi and found the place where the main window restores its position (Top, Right) and size (Width, Height) from the last session. I discovered the global Screen object has some Monitor* properties - these are:
Screen.Monitors Screen.MonitorCount Screen.MonitorFromPoint Screen.MonitorFromRect Screen.MonitorFromWindow
The most important property to fix the above described bug seemed to be MonitorFromWindow which tells the TMonitor object of the monitor on which the window is being displayed. The great thing about that is: If there is no second monitor plugged in, MonitorFromWindow returns the first TMonitor object available. So it always returns the best fitting monitor number for the given window handle, but never a no longer plugged monitor. Given this TMonitor object you can check if your window is placed within the monitor's resolution:var Monitor: TMonitor; const MoveWinThreshold: Byte = 80; begin // ... // 1. Some code to restore the last GUI position and dimension // ... // 2. Detect the relevant monitor object Monitor := Screen.MonitorFromWindow(Self.Handle); // 3. Now ensure the just positioned window is visible to the user // 3.a. Set minimal visible width if Left > Monitor.Left + Monitor.Width - MoveWinThreshold then Left := Monitor.Left + Monitor.Width - MoveWinThreshold; // 3.b. Set minimal visible height if Top > Monitor.Top + Monitor.Height - MoveWinThreshold then Top := Monitor.Top + Monitor.Height - MoveWinThreshold; .. endIf the window (that means: the upper left corner) is placed somewhere outside the monitor's resolution, the above code moves its Left + Top properties so there's a minimal rectangle of 80x80 pixels visible in the current monitor. Given this minimum rectangle, the user can now manually move and resize the window. P.S.: Don't try to Free the TMonitor object afterwards which you got by Screen.MonitorFromWindow - that will lead to an access violation. Most probably MonitorFromWindow returns a reference to that object. -
How to solve "can't open activity db - access is denied" for SVN commits
written:
4 years ago
category:
Programming
I somehow messed up the file privileges of a rsync'd SVN repository on a Windows server. Most probably it was rsync/cygwin which broke something here. After fiddling around with the folders and files I just zipped the complete directory of the repository, deleted the original files and then unzipped the zipfile again - works perfectly now! A ZIP file cannot store given privileges of files and folder. But be aware that RAR can, so prefer ZIP!
-
Typo3 3.5 running with PHP 5.x
written:
4 years ago
category:
Programming
This took me at least one hour to find out: If you encounter either this error while accessing the backend at /typo3 : Error in init.php: sitepath not specified correctly or this error while accessing the frontend: Cannot find configuration. This file is probably executed from the wrong location. Just ensure the old PHP arrays like $HTTP_SERVER_VARS are registered. You can do so by adding this PHP flag to your .htaccess :
php_flag register_long_arrays 1 -
Am Anfang war Niki
written:
4 years ago
category:
Programming
Meine ersten Gehversuche im Programmieren gehen zurück ins Jahr 1991, als ich ohne irgendwelche Vorkenntnisse in der 11. Schulklasse des Arnold-Janssen-Gymnasiums für ein halbes Jahr das Fach Informatik wählte. Lern-Stoff war eine abgeschlossene Programmier-Umgebung, in der man mit einem stark abgespeckten Pascal den Roboter "Niki" über ein viereckiges Feld steuern musste. Soweit ich mich erinnern kann, waren die damaligen PCs ausgestattet mit einem 80-086 Prozessor (4,7 MHz), 2 x 5¼-Zoll-Diskettenlaufwerken, Hercules-Grafik und Bernstein-Monitor. Vor kurzem fand ich die Niki-Software im Web wieder und sah mit Begeisterung, das es hier bereits eine Windows-Umsetzung gab: http://www.hupfeld-software.de/niki.php. Für alle Programmier-Anfänger heute noch wärmstens zu empfehlen
