I guess that's what happens when you use beta software! Now, I could write it myself and submit it to the repository, couldn't I? That would be a nice way of saying thanks to the kind folks who developed the rest of the code.
| [ 0 trackbacks ] | permalink | related link |




( 2.9 / 50 )It's been quiet around here lately, mainly because I've had about 5 days of broadband in the last 5 weeks. While I should have been reading Kafka, I didn't have to because my life became The Trial. First iinet (my isp whom i now hate with a passion, but more on that in a moment) told me it was my equipment/phone line/ house that was causing the problem. Then they sent Telstra who, of course, turned up within an hour of the connection coming back online and who, of course, said there was nothing wrong. Then the connection died again and now I was going to have to pay a call-out fee to get Telstra back again because 'everything is working fine'. Even though I have no sync.
Eventually, after a month of "<quote>"customer support"</quote>" calls and an infinite number of line isolation tests, Telsta reappear last Friday to inform me that no, my equipment is fine and yes, the phone line is crystal clear (I am 200m from the exchange, I challenge you to find a better phone line!) and <drumroll> the problem is with the iinet dslam port</drumroll>.
Well, "3 to 5 working days" later and still nothing. Then, at 8pm on a wednesday evening, the modem lights up in ways I remember it used to do way back in late March... I have ADSL (not ADSL 2+, which is what I have been paying $100 a month for, but it is a form of ADSL nevertheless).
Now, the first thing I do is queue up my downloads and start my backups for my Web sites and databases. And, instead of just watching progress bars all night I decide to go onto my blog, dust away the cobwebs and COMPLAIN ABOUT MY ISP. :)
WHY I HATE IINET
Now onto the juicy stuff. I am technically a journalist. I write for illustrious titles such as PC User, NetGuide, Australian Personal Computer - the list goes on. I even told my friendly iinet customer support people that my job is to review broadband services. Did that get me anywhere?
I even told them I had already decided to cancel ALL my services - line rental, VOIP, ADSL etc etc and did they care? They just want to get off the damn phone as fast as they can so they can get off the phone to someone else as fast as they can...
So I decide that even a mainstream supplier like Optus has got to be better than this so I say to them "Get me out of iinet as quickly as you can, put me on your most expensive plan and get me OUT."
I get through the credit check without breaking a sweat. I sign up the next 2 years of my life to inferior upload speeds...
(aside - Optus won't give you ADSL if they have cable in your area. Why? because "cable is a superior product". I said, I am an uploader, not a downloader, I need 500k UPLOAD!!! They push the "superior product" button again... and again... aand eventualy I say "I don't care, just sign me up!!!")
Right, so now I'm down for 2 years of cable even though I want ADSL. I can cope with that. Then, just as I'm drawing the blood I intend to use as ink on the parchment, I am informed that "we don't have an agreement with iinet" to transfer phone numbers. In other words, my phone munber (and the phone number of my company, house mate and family) which I have had for over 10 years will have to change if I want to change ADSL providers.
Apparently it's in the fine print when you sign up to iinet. No-one brought it to my attention and now I'm being held to ransom over my phone number.
If you've made it this far I thank and congratulate you. I have now re-learned that the power of large companies is bolstered by their own lack of internal responsibility and accountability. It doesn't help that Telstra is a perfect scapegoat, either. Like all bureaucracies, they endure because the hatred they create amongst their customers is diffused by the same bureaucracy that protects them. I had one excellent tech support person but all the others were utterly unhelpful. The Telstra guy was helpful when the link was down but not much help when it worked... all because it's always somebody else's problem.
When the technology works, everything is shiny. But when there's a problem you'll be made to suffer - especially if it's not your fault. These are the lessons I have learned. By the way, did I mention that even the dial-up connection didn't work 9 times out of 10? Ok, at least I still had a landline - and one of the best landlines in the country, apparently. This time, however, being back online isn;t going to shut me up, I'll just have more places to throw the hair that I've been pulling out these last few weeks.
| [ 0 trackbacks ] | permalink | related link |




( 2.9 / 47 )Some days just suck. Especially the ones that aren't 24 hours long. You see, there I was calculating all the names and dates for the next 28 days, as you do when building a calendar or something. The obvious way to do it was to loop from 1 to 14 adding 60x60x24 seconds per iteration and then formatting the timestamp accordingly.
So, being PHP, I did something like this:
$timestamp=time();
for($i=1;$i<=28;$i++){
$timestamp += 60*60*24*$i;
$dates[] = date("Y-m-d",$timestamp);
}
Why not? That's the way everyone does it, right? Well, lo and behold I was getting an array with 2 copies of "2007-03-25" in it. At first I thought it was an integer rounding bug, so I started using this: 60.0*60.0*24.0*$i. Needless to say that didn't fix it. Anyway, to cut a long story short you already know what was happening don't you?
The 25th of March marks the end of daylight savings in Sydney, Australia which is the default timezone of my server. It just so happens that this day is 25 hours long, which means adding 24 hours to midnight gives me 11pm on the same darn day. Hence two copies of the date in my array.
Now I know better than to perform my own timestamp calculations on anything other than GMT, where every day really is 24 hours long. Anywhere else and you need to do something like this instead:
$date = new DateTime(date("Y-m-d",$timestamp));
for($i=1;$i<=28;$i++){
$date->modify("+1 day");
$dates[] = $date->format("Y-m-d");
}
[ Note that here the $date variable is a PHP5 date object]
| [ 0 trackbacks ] | permalink | related link |




( 3 / 41 )domTT is an excellent cross-platform DHTML tool-tip library which I have used for about 2 years on a range of projects. While building a custom AJAX interface for my current project I came across a weird error for the first time...
In FireFox under Windows, the domTT library sometimes throws an exception "Permission denied to get propertyHTMLDivElement.tagName".

After scouring the Web I see I am not the only one to have experienced this, but no-one has posted a solution. Well, if you found this page on Google then you are in luck! Open up domLib.js and change this:
if (typeof(in_bannedTags) != 'undefined' &&
(',' + in_bannedTags.join(',') + ',').indexOf(',' + in_object.tagName + ',') != -1)
{
return false;
}
to this:
try {
if (typeof(in_bannedTags) != 'undefined' &&
(',' + in_bannedTags.join(',') + ',').indexOf(',' + in_object.tagName + ',') != -1)
{
return false;
}
} catch(err) {
return false;
}
Your page will now be catching the exceptions and FireBug will stop giving you those nasty red lines that ruin your day...
| [ 0 trackbacks ] | permalink | related link |




( 3 / 44 )For some time now I have been two versions of Apache - one for PHP4 and the other for PHP5. This has been satisfactory except that my SVN repository was only installed for the Apache 2 install (the other install was 2.2 which doesn't support SVN).
So after a forced rebuild of my server I had trouble getting the 2 Apache's coexisting again so I went looking for another solution - and I found one that is way more elegant than having to stop-start every time I switched between projects....
Thanks to lukasz who posted a tip on php.net I have set up php5 as the default CGI handler for my Apache server with PHP4 set to override the default for specified directories. It works like a charm. I can now have specific PHP versions with specific extensions loaded for each project in the one Apache instance. Here's what it looks like:
ScriptAlias /php5/ "C:/Program Files/Apache Group/php-5.2.0/"
ScriptAlias /php4/ "C:/Program Files/Apache Group/php-4.4.2/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php5/php-cgi.exe"
<Directory "C:/inetpub/wwwroot/BestAdsRebuild">
Action application/x-httpd-php "/php4/php.exe"
SetEnv PHPRC "C:/Program Files/Apache Group/php-4.4.2/"
</Directory>
<Directory "C:/inetpub/wwwroot/">
SetEnv PHPRC "C:/Program Files/Apache Group/php-5.2.0/"
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
| [ 0 trackbacks ] | permalink | related link |




( 3 / 53 )It's been done a million times, but the fastest way to do it is to use the online rounded corner generator at:
http://www.roundedcornr.com
You get the CSS, the DIV tags and the four corner images all dynamically generated and ready to copy into your code....
| [ 0 trackbacks ] | permalink | related link |




( 3 / 49 )
Came across a little problem today where my Xinha WYSIWYG HTML editor fields were not being submitted when the form was submitted from JavaScript. As a workaround, the getHTML() method can be called and dynamically assigned to the text area like so:
var html = xinha_editors.my_text_area.outwardHtml(editor.getHTML());
document.my_form.my_text_area.value = html;
Of course, replace my_text_area and my_form with the actual textarea and form elements' names and you can now do this:
<script>
/* xinha init code snipped */
function do_submit(){
myed = xinha_editors.my_text_area;
var html = myed.outwardHtml(myed.getHTML());
document.account.my_text_area.value = html;
document.my_form.submit();
}
</script>
<form name="my_form">
<textarea name="my_text_area"></textarea>
</form>
<a href="javascript:do_submit()">Submit!</a>
This is also a handy trick if you want to submit your Xinha HTML using AJAX.
| [ 0 trackbacks ] | permalink | related link |




( 3 / 43 )Aha a bug! Well, sort of. If you use Rico and Prototype/Script.aculo.us then you may find updating to Prototype 1.5.0 makes ALL your XHR requests fail. Ouch! Well, it turns out Rico defines a function called extend which is then added as a header in Ajax.request() that forces Firefox to throw an exception. The fix?
Change this (line 916):
for (var name in headers)
this.transport.setRequestHeader(name, headers[name]);
To this:
for (var name in headers){
if (typeof headers[name] != 'function'){
this.transport.setRequestHeader(name, headers[name]);
}
}
Hopefully Rico will get an update that renames the extend function accordingly...
| [ 0 trackbacks ] | permalink | related link |




( 2.9 / 42 )After some trial and error using $F() and other serialize commands from the Prototype AJAX library I googled this tasty treat:
var checked = Form.getInputs(element.form,
"checkbox",
element.name).findAll(function(item)
Then I turned it into a function like so:
function get_checkboxes(from_form, from_field){
return Form.getInputs(from_form, "checkbox",
from_field).findAll(function(item) {
return item.checked;
}).pluck("value");
}| [ 0 trackbacks ] | permalink | related link |




( 3 / 40 )It turns out you cannot use an ISO image mounted in VMware to install Windows Vista. While the installer will boot, once it goes to Vista's desktop, the virtual CD/DVD device is not detected and you cannot continue.

The solution? Mount the ISO in Alcohol 120% and retry! Note that my ISO wouldn't mount correctly in PowerISO due to the UDF file system.
| [ 0 trackbacks ] | permalink | related link |




( 3 / 50 )Back Next



Avatar



