brettbrewer.com

Programming + Design

Home
Brett is officially looking for a job
Written by Brett Brewer   
Friday, 20 July 2007
I am somewhat sad to announce that I tendered my resignation to The Real Estate School, Inc. today where I served for over 5 years as the VP of Technology and more recently as the Executive Vice President. My departure marks the beginning of the next phase of my career and my life as I seek better opportunities to utilize the wide range of programming, design, and SEO skills I have honed over the past decade. Ideally I would like to work with a team of skilled PHP/MySQL developers on useful web based products and services similar to the ones I've already successfully built. My ideal job would be located in Canada or Western Europe or New Zealand, but I would consider another job in the U.S. with the right company. If you are interested in my experience and qualifications, please check out my resume and if you know anyone that could use someone like me I'd love to hear about it, regardless of where the job is located . In the meantime, I will be working on getting officially certified in PHP/MySQL and any other relevant technologies. Sadly, most of the companies in Tallahassee are ASP.NET shops and despite the fact that ASP and PHP programming is very similar, I suspect it will be hard to land the kind of job I'm looking for at one of the local ASP shops. So drop me a line if you hear anything.
 
Joomla VFM File Repository Component Bug Fixes
Written by Brett Brewer   
Thursday, 26 July 2007

I've been testing out a few download managers on my site and so far my favorite is the VFM File Repository component. It's got some nice AJAX functionality, but lacks a functional category feature, so all downloads simply display in a list. When editing the descriptions via AJAX, I discovered some issues with quotes not being properly unescaped. To fix this, simply open the "components/com_vfm/vfm.php" file. On about line 191 you will see the following code:

 $result = $vfm->setAttribute(array( 'description' => $_REQUEST['contents'] ));

 Simply replace it with 

 $result = $vfm->setAttribute(array( 'description' => stripslashes($_REQUEST['contents']) ));

This will fix the escaping problem and allow you to embed quotes and html with attributes into your descriptions. You can do the same thing for the title field by making a similar edit to line 179 of the source file. 

Last Updated ( Thursday, 26 July 2007 )
 
Filtering User Input for XSS with PHP
Written by Brett Brewer   
Friday, 22 June 2007
I've been building some web apps that rely on integrated WYSIWYG text editors for user input, which is something that is typically very dangerous to do in a secure application. Fortunately, I discovered an amazing PHP library, written by Edward Z. Yang, called HTML Purifier , which will take html input, parse its node structure and break it into tokens, validate and correct any nodes according to the relevant RFC definitions, then spits out safe, standards-compliant XHTML which can be used anywhere without fear that some 13-year-old Russian kid found a way to sneak some malicious javascript through your filters. Of course, if you want your users to be able to add specific bits of javascript  code to a page, HTML Purifier can be easily extended with plugins to allow your custom code to pass through unaffected. In just a few minutes I was able to use their example YouTube video plugin to write my own filter that will let FlashObject code pass safely through the filters. Unfortunately the developer doesn't have a donation page so I couldn't send him money, but he said that just spreading the word would suffice for now, so consider the word officially spread. 
Last Updated ( Saturday, 23 June 2007 )
 
Apple's Safari browser on Windows
Written by Brett Brewer   
Friday, 15 June 2007
I just had a chance to start using Apple's Safari browser on my work PC and I must say it seems to work great so far. I already have a new favorite feature. It appears that by default, Safari adds resize handles to any multi-line input fields on a web page. This has the effect of allowing you to resize elements in a CSS-based layout while watching the page layout change as the Safari CSS box model re-renders everything on the fly. This is nice because it lets you really see how the layout of subsequent form elements change as input fields are resized. It's not terribly useful, but it does let you see the Safari box model in action, which might provide some insight into some tricky layout problems. I just wish there was a way to toggle this feature on and off for every element on the page. That would help so much with fixing box sizes when doing complex CSS layouts that may have issues in some browsers. To see the page layout reflow in realtime as things are resized is really helpful. Perhaps this feature is already built into the Firefox WebDeveloper plugin, but I haven't found it. So kudos to Apple for what appears to be a decent addition to the latest generation of "standards compliant" browsers.
Last Updated ( Friday, 15 June 2007 )
 
Electricity directly from trees
Written by Brett Brewer   
Saturday, 19 May 2007

I have been speculating for years about alternative methods for generating electricity. Recently I was thinking about how plants are able to efficiently store solar energy as sugar and wondered if it might be possible to coax them into generating free electrons that could be siphoned off directly as an electrical current. I wondered if there might be some way to splice some genes from an electric eel or some other bioelectric organism and get a tree to produce a similar electrical field. Of course, this seems somewhat impossible since they biological systems in a tree are nothing like those in an eel. But after a bit of searching I came across this article which describes a method of extracting current directly from a tree using a method that most elementary school science fair participants will probably be familiar with from their "potato battery" experiments. Apparently Gordon Wadle, an inventor from Thompson, IL. was thinking about how lightning eminates from the ground, often near large trees. He basically did a variation of the "potato battery" experiment with a tree instead of a potato and it worked.

"Simply drive an aluminum roofing nail through the bark and into the wood of a tree -- any tree -- approximately one half inch; drive a copper water pipe six or seven inches into the ground, then get a standard off-the-shelf digital volt meter and attach one probe to the pipe, the other to the nail and you'll get a reading of anywhere from 0.8 to 1.2 volts of DC power," he said.

And apparently, no matter how many spikes you put into a tree, they all produce the same amount of energy, so a single tree is probably capable of putting out much more energy than the simple experiment suggests. Talk about a sure-fire way to get people to plant more trees! Anyway, the inventor and a company called MagCap Engineering, LLC. have applied for a patent, so hopefully we will hear some more about this in the near future. In the meantime, I think I'll see how much electricity the oak tree in my back yard is producing. 

Last Updated ( Saturday, 19 May 2007 )
 
Fix for Joomla MP3Player module
Written by Brett Brewer   
Tuesday, 24 April 2007

I had a small issue (several actually) with the Joomla MP3Player module . There are several out there based on the jeroenwijering Flash MP3 player , but all of them are a bit picky about how you configure them and they seem to fail to properly implement the options available in the original standalone player. In particular, the "repeat" option doesn't work right. Instead of using the values "true", "false" and "list" for the values of the "repeat" variable, the module uses "0" and "1" and completely omits the option to jump to the next playlist item using the value "list". So I made a slight change to two module files and am posting them here for your pleasure. 

Download the module files 

Just extract the two module files from the above archive and upload them into your Joomla "modules" folder, overwriting the old versions. Then go to the config screen for the mp3player module (or whatever you have named it in on your modules admin screen) and set the "repeat" option to "list". Now when a song finishes playing, the next song in your list will automatically start. If you have shuffle play enable then it will play the next random selection instead. Also, if you do not set the repeat option at all, it will default to the "list" repeat behavior. 

Please note that I DID NOT WRITE THIS MODULE or the player from which it is derived. I take no credit for anything, not even this patch. Use at your own risk, yada, yada, yada. 

To see the module in action, head on over to my music section

Last Updated ( Thursday, 26 July 2007 )
 
Roomba reborn!
Written by Brett Brewer   
Thursday, 29 March 2007
It seems like only yesterday I lamented the loss of my first Rooma, Lolita, as she descended into a schizophrenic seizure of starts and stops and half-circles. I cleaned her, I removed/replaced her battery and nothing worked. I had all but resigned myself to sending her back for a replacement when I decided to spray out her front sensor area with compressed air. A big chunk of dust shot out of the left side and suddenly, my sweet Lolita was back in business. My sweet Lolita has been reborn!
Last Updated ( Thursday, 29 March 2007 )
 
PHP $_REQUEST variables not showing up when you submit your form?
Written by Brett Brewer   
Thursday, 29 March 2007
Had an annoying little problem with some variables I submitted to a PHP script now showing up in any of the $_REQUEST, $_POST or $_GET arrays. After an hour or so of head scratching and echoing, and print_r-ing, I figured out that my form had some duplicate form elements with identical names and IDs. This seems to have caused Firefox to completely lose MOST, but not all of the form submission. I didn't delve much further to find out what exactly was going on, I simply fixed my form and the problem went away. Strange though. It seems like the last instance of the duplicate form element on the page should have simply overridden any previous values, but not cause the loss of other variables. I didn't test in IE, so it may only be a Firefox 2.0.0.3 issue. 
 
<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>

Results 73 - 80 of 81

Search

Who's Online

We have 3 guests online

© 2012 www.brettbrewer.com
Joomla! is Free Software released under the GNU/GPL License.