Import Ricoh GX100 RAW files into Apple’s Aperture in MacOS 10.5 Leopard
Here’s a little hack to enable you to use Ricoh GX100 RAW files in Apple’s Aperture.
Make a backup of the following file:
/System/Library/CoreServices/RawCamera.bundle/Contents/Resources/Raw.plist
Find the key for the Leica D-LUX 3 (line 3316 in MacOS 10.5.1):
3316: <key>Leica D-LUX 3</key> <string>Panasonic DMC-LX2</string> <!-- 10.4.10 -->
Then insert the following line before the line showing the Leica D-LUX 3:
3316: <key>RICOH Caplio GX100</key> <string>Panasonic DMC-LX2</string>
3317: <key>Leica D-LUX 3</key> <string>Panasonic DMC-LX2</string> <!-- 10.4.10 -->
You should now be able to use the Ricoh’s RAW files in Aperture.
This is based on a previous hack (detailed here), which doesn’t apply to Leopard.
Published at 5:57 pm on November 16th, 2007
Topic: Apple Mac
Link to this entry (4 comments)
Bristol City Council – Planning application documents only viewable using Internet Explorer
From Britol City Council’s PublicAccess for Planning page:
Please note that the documents within PublicAccess can only be accessed by using Internet Explorer. This is due to a limitation within the system which has been raised with the suppliers.
Not good enough. Here’s form I knocked-up in about 2 minutes that gives users of other browsers access to associated planning documents. The associated documents are things like supporting letters, photographs, a copy of the application form etc.
Enter a planning application number to view any supporting documents.
Published at 10:43 am on August 1st, 2007
Topic: Bristol
Link to this entry (0 comments)
ActionScript trim function
ActionScript 2.0 doesn’t have a trim function to strip whitespace from the start and end of a string. Here’s a simple function I wrote because I couldn’t find a satisfactory example on Google!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| function trim(str:String):String
{
var stripCharCodes = {
code_9 : true, // tab
code_10 : true, // linefeed
code_13 : true, // return
code_32 : true // space
};
while(stripCharCodes["code_" + str.charCodeAt(0)] == true) {
str = str.substring(1, str.length);
}
while(stripCharCodes["code_" + str.charCodeAt(str.length - 1)] == true) {
str = str.substring(0, str.length - 1);
}
return str;
} |
The horrible "code_" prefix hack is there because I don’t think there’s a native way to search an array or object for a key or value in ActionScript.
Update: just found this function at: frogstyle.ch. This one does a similar thing, but strips more characters.
1
2
3
4
5
6
| function trim(str:String):String
{
for(var i = 0; str.charCodeAt(i) < 33; i++);
for(var j = str.length-1; str.charCodeAt(j) < 33; j--);
return str.substring(i, j+1);
} |
Published at 4:26 pm on July 23rd, 2007
Topic: Flash
Link to this entry (2 comments)
array_mode
If you’ve ever needed to get calculate a mode value in php, you’ll notice that there isn’t a native function to do so.
I couldn’t get the function in Pear’s Math_Statistics to work with non-numeric values, so here’s a function that does.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
| <?php
/**
* Calculates the frequently occuring value(s) in an array.
*
* @param array $data
* @return array
*/
function array_mode($data)
{
if(!is_array($data)) {
throw new Exception('First argument $data must be an array.');
}
$frequencys = array_count_values($data);
// Double-check that frequencys are sorted in reverse order,
// I think array_count_values actually returns in this format
// already, but the manual doesn't mention it.
arsort($frequencys);
$isFirst = true; // Yuk
$mode = array();
foreach ($frequencys as $thisValue=>$thisFrequency) {
if ($isFirst == true) {
$isFirst = false; // Wince
$mode[] = $thisValue;
$modeFrequency = $thisFrequency;
continue;
}
if ($modeFrequency == $thisFrequency) {
$mode[] = $thisValue;
}
if ($modeFrequency > $thisFrequency) {
break;
}
}
return $mode;
}
var_dump(array_mode(array('a', 'a', 'b', 'c', 'd')));
/*
array(1) {
[0]=>
string(1) "a"
}
*/
var_dump(array_mode(array('a', 'a', 'b', 'b', 'c')));
/*
array(2) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
}
*/ |
Published at 10:49 am on May 3rd, 2007
Topic: PHP
Link to this entry (0 comments)
Magners

mankners…, originally uploaded by i y e r s.
My thoughts precisely. It’s depressing how this stuff has become so popular when there’s such a variety of decent local cider producers within a 25 mile radius of Bristol.
Given the food-miles accumulated importing apples from the UK, France and the Netherlands to Ireland and shipping them back as cider, its a tad ironic that they have to import CO2 from Poland to make it fizzy.
Published at 10:32 am on April 29th, 2007
Topic: Bristol
Link to this entry (0 comments)