Zydecode Studio

Archive for October, 2005

slice up images into squares in Photoshop

Saturday, October 29th, 2005

var srcDoc = app.activeDocument;
app.preferences.rulerUnits = Units.PIXELS;
var sq = 100;
var widthParam = app.activeDocument.width/sq;
var heightParam = app.activeDocument.height/sq;
var pI = 0;
var pJ = 0;
for (var j = 0; j < heightParam; ++j) {
pJ = j*sq;
for (var i = 0; i < widthParam; ++i) {
pI = i*sq;
srcDoc.selection.select(Array (Array(pI, pJ), Array(pI+sq, pJ), Array(pI+sq, pJ+sq), Array(pI, pJ+sq)), SelectionType.REPLACE, 0, false);
srcDoc.selection.copy();
var img [...]

Open Windows Explorer in non-default drive

Sunday, October 23rd, 2005

How to stop Windows opening Windows Explorer in the default “My Documents” folder, which is bloody annoying if you don’t use My Documents..
C:\WINNT\explorer.exe /e,E:\

SQL for analysing screen dimensions from CW stats

Sunday, October 16th, 2005

SELECT cDesignDate, CONVERT(SUBSTRING_INDEX(cScreen, ‘ ‘, 1), UNSIGNED) AS cScreen FROM tbl_cd_05 WHERE cDesignDate > ‘2005-05-13 00:00:00′ AND cScreen > 800 ORDER BY cScreen;

popup window from JavaScript

Sunday, October 16th, 2005

remove certain HTML tags

Sunday, October 16th, 2005

tppabs=”[^ ]* gets rid of tppabs=”http://www.somesite.com/images/heads/wedding.jpg” etc
looks for first white-space after tppabs and stops

permissions for IIS - ODBC

Sunday, October 16th, 2005

how to set permissions for IIS - ODBC
had problems with IUSR not having permissions for access DB
took me ages to solve - turns out IUSR needs read/write/delete permissions for C:\WINNT directory (not execute).
Also - use MDAC 2.5 as it has Jet 4 drivers in it…

sort an alphanumeric array numerically

Sunday, October 16th, 2005

AlphNumAscend = function(a,b){
return parseInt(a) > parseInt(b);
}
AlphNumDescend = function(a,b){
return parseInt(a) < parseInt(b);
}
myArray.sort(AlphNumAscend);

add ellipses and lengthen Merak subject line

Sunday, October 16th, 2005

add this to readmail.php to add ellipses to subjects longer than ’subjectlimit.

if ($messages[$i]["SUBJECT"]) {
$createdata.= htmlspecialchars(substr($messages[$i]["SUBJECT"], 0, subjectlimit));
$createdata.= (strlen($messages[$i]["SUBJECT"])>(subjectlimit-3)) ? ‘…’ : ”;
} else { $createdata.= $none; }

create list of names from OPTION list using Regular Expression in HS

Sunday, October 16th, 2005

strip <option VALUE=”[A-Za-z]+”> and replace with line break

parsing name=value pairs from a URL in Director

Sunday, October 16th, 2005

on exitFrame
if ImDone true then
global gNetID
gNetID = getNetText(”http://cnet/freestyle/read.php?id=sean”)
end if
end
—————————————————————-
on exitFrame
global gNetID
if netDone (gNetID) then
if netError(gNetID) “OK” then
alert “couldn’t get the text ” & netError(gNetID)
halt
end if
set theFullText = netTextResult(gNetID)
sendSprite(1, #processURLs, theFullText)
[...]