Category: Technology


Symfony: sub-domains and front controllers

A lot of us really do need to just RTFM sometimes.
View full article »

Captcha is useless

Well, it seems that spambots have found an easy way around the SI Captcha plugin for WordPress…

What a pain in the ass. I swear, if I ever catch someone to runs a spam operation, I’ll kill them. It’s the most pointless and annoying blight on our generation since reality TV.

Frankenstein’s Monster’s Avatar

This is you on social media

This is you on social media

There’s been lots of talk recently about the prospect of using a person’s online social history to “recreate” a version of them after death, a la Zoe Graystone. While the concept of uploading a person (their memories, personality traits, etc) to a computer is a promising, yet tentative, possibility, the whole idea of trying to recreate someone from their online profiles and blog scares the shit out of me; what kind of monstrous chimera will be created?

View full article »

Receiver not registered: android.widget.ViewFlipper

Don’t get me wrong: I love Google. Not to the extent of some raving fanboys, but I do have a soft spot in my heart for our increasingly powerful friend from Mountain View, California. If I’m going to have to sell my soul (read: personal data, genetics, history of movements) to a massive company, I’d rather it be Google than Yahoo, Microsoft, or Facebook.

There’s one thing that niggles me, and a lot of other people, about Google though and it’s nothing to do with privacy, monopoly, or power; it’s their complete inability to provide decent customer service or timely bug fixes.
View full article »

L.A. Noire Review

I swear I didn’t just play L.A. Noire for 3 hours.

A) Truth
X) Doubt
Y) Lie

…but seriously, I’ve come to the conclusion that it’s really not a very good game. The missions are repetitive, the story ridiculously linear, the game mechanics are dated, the player interaction is trival (it’s like watching a movie but being forced to twiddle a joystick every 15 minutes until something beeps).
View full article »

L.A. Noire

I picked up L.A. Noire from EB Games this morning, much to the chagrin of the store clerk who wanted the day off to play it but got called into work regardless.
View full article »

Beware the Jackson “Energy Saver”

I thought I’d do the right thing and buy one of those $70 Jackson 6 plug “energy saver” PT9778 powerboards that have a master socket and a number of slave sockets. The idea is that you plug your computer or TV into the master socket, and when you flick it to standby mode, everything plugged into the slaves is instantly turned off — saving you money.
View full article »

Symfony and How To Keep Your Files

Another boring tech post, but I found it so difficult to find a simple, straight answer online that I have to post this.

All I wanted to do was make sure that when editing a record in Symfony using a page created using the admin generator, that it didn’t crack the shits if you didn’t edit an image that you’d previously uploaded. What if you just wanted to change the name of a recipe, but not the photo?

That’s a pretty simple request, right? I’ve seen posts advocating javascript and ajax, checkboxes that turn the input boxes on and off, extending the base Doctrine/Propel classes… wow.

Want to allow users to keep the existing file? Modify your *Form class and set the sfValidatorFile ‘required’ field to $this->isNew().

Eg.,

$this->setValidator(‘banner_file’, new sfValidatorFile(array(
‘required’ => $this->isNew(),
‘mime_types’ => ‘web_images’,
‘path’ => sfConfig::get(‘sf_upload_dir’).’/',
)));

Done. If the user edits the file, it will save. If they don’t, the original file will remain. If they create a new record, they’ll be forced to upload the file.

JQuery Tinyscrollbar and Images

Well, that wasn’t exactly the most fun I’ve had coding.

I evaluated a couple of jQuery scrollbar plugins and found that Tinyscrollbar was one of the better ones. So, I threw it into my template, messed around and got it looking right, and then discovered that in some instances it wasn’t actually scrolling all the way to the bottom of the div, leaving 1/5 to 1/3 of the div missing from view.

Wracking my brain for hours, searching solutions on Stack Overflow, hacking the code to pieces… nothing. Moving to another page and then hitting back fixed the problem; I could scroll all the way through. Not really a nice work around for users though. In desperation, I went back to the drawing board and found another plugin that wasn’t quite as good (so I won’t mention the name) but that might serve as a replacement.

Same. Fucking. Problem.

Okay, so, it couldn’t have been the plugin’s fault. It was obvious that it was a problem with the page rendering, be it timing or just a bug; I was going to have to delve deeper using up a bunch of time that I didn’t really have up my sleeve. In order to bolster my sagging spirits, I wandered downstairs, grabbed a Lucky Beer, hugged the dog, and decided to look at the rendering issue.

What could it possibly have been? I was running the javascript after the page was loaded, so everything should have been kocher, but the evidence suggested that something wasn’t set properly in the DOM. Height had to be wrong. Maybe it was a floating element… I threw in a bunch of clear:both divs around the place, tried putting the child content into a single div instead of multiple, tried some P tags just in case… and then it dawned on me… oh, did it dawn on me.

The fucking images. All of the headings and sub-headings are being generated on the fly using GD and the client’s preferred font, cached, and displayed on the page. Shouldn’t really be a problem, but in our jQuery case it was. I modified the function that was generating the image tag to explicity state the image height and presto! — the scrollbar suddenly allowed me to scroll all of the way down!

Long story short: the problem was resolved by drinking Lucky Beer. Not only did I discover and fix the issue, but Nell also brought me the best apple crumble I’ve ever tasted!

Thank you, Lucky Beer!

Luckiest Beer Ever

Luckiest Beer Ever


Nell's Apple Crumble

Nell's Apple Crumble

List of country names and codes (almost CSV)

It’s amazing how many websites try to rip people off by selling CSV files containing country listings.

If you want an up-to-date listing of all countries and their codes, go no further than iso.org:

http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm

For non-commercial purposes only ;)

Powered by WordPress | Theme: Motion by 85ideas.