jump to navigation

NOTE: The spam filter is being unusually aggressive. If you comment does not immediately appear, it has simply been placed in moderation and I will approve it as quickly as possible. Thank you for your patience.

"Murphy was an optimist!"

Magento References January 19, 2010 9:23 pm

Posted by Doug McCaughan in : Programming, Technology
, add a comment

Relevant to my life right now:

add a comment

Magento Actions January 17, 2010 11:26 am

Posted by Doug McCaughan in : Programming, Technology
, 2comments

The Magento E-commerce system is an exciting open source alternative to systems like OS Commerce. The learning curve isn’t really a curve at all. The learning curve is more like a sheer, glassy. polished mountain face shooting straight up into the heavens. However, plenty of documentation exists, Google overfloweth with links to blog post, and IRC support is available on Freenode #magento (although I believe most questions go to /dev/null so expect to feel a little like you are talking to yourself but like your $200/hr psychologist will explain, sometimes that’s all we need).

As I work through understanding how Magento handles layouts, I struggle to find a simple list of actions and perhaps I’m trying to hard. So far the is this:

addJs
addCss
addLink
addItemRender
unsetChild
setHeaderTitle
setTemplate

Ah! I found a reference! See page 7 of Magento Layout Files Reference (see also same document, different format).

Update: The Magento wiki has this defined under Designing for Magento.

2comments

Today’s Magento Ecommerce Quotes January 14, 2010 3:53 pm

Posted by Doug McCaughan in : Programming, Technology
, add a comment

Read here:

I’ve been wrestling with Magento for the last month or so and I’m still trying to figure it out.

The general architecture is so mind-numbingly complex, that even if I completely understood it, I’d need to write a book to cover it.

add a comment

Ultimate Unsubscribe Page December 18, 2009 1:35 pm

Posted by Doug McCaughan in : Communications, Programming, Technology
, add a comment

add a comment

Maximum length of an email address is 254 characters, not 320 December 16, 2009 5:07 pm

Posted by Doug McCaughan in : Communications, Programming, Technology
, 1 comment so far

I work in a business of constant learning. Technology is continually evolving and being revised. Somethings are rather constant but, being human, weI tend to develop habits occasionally rooted in wrong assumptions. Perhaps a deadline forced a decision without having time to look up the specification and over time, our mind took that unresearched decision as fact. I’ve made numerous databases over the years based upon just such a wrong assumption. My error has been in the acceptable maximum length of an email address. My number is irrelevant but I am in good company with being incorrect on the length of an email address as many people mistakenly believe it to be 320 characters.

An RFC is a request for comments which "is a memorandum published by the Internet Engineering Task Force (IETF) describing methods, behaviors, research, or innovations applicable to the working of the Internet and Internet-connected systems." (Wikipedia) RFCs set the standards that define how the Internet works. RFC3696 and RFC5321 explain that the maximum length of an email address is 254 characters.

There appears to be some confusion over the maximum valid email address size. Most people believe it to be 320 characters (64 characters for the username + 255 characters for the domain + 1 character for the @ symbol). Other sources suggest 129 (64 + 1 + 64) or 384 (128+1+255, assuming the username doubles in length in the future).

This confusion means you should heed the ‘robustness principle’ ("developers should carefully write software that adheres closely to extant RFCs but accept and parse input from peers that might not be consistent with those RFCs." – Wikipedia) when writing software that deals with email addresses. Furthermore, some software may be crippled by naive assumptions, e.g. thinking that 50 characters is adequate (examples). Your 200 character email address may be technically valid but that will not help you if most websites or applications reject it.

The actual maximum email length is currently 254 characters:

"The original version of RFC 3696 did indeed say 320 was the maximum length, but John Klensin (ICANN) subsequently accepted this was wrong."

"This arises from the simple arithmetic of maximum length of a domain (255 characters) + maximum length of a mailbox (64 characters) + the @ symbol = 320 characters. Wrong. This canard is actually documented in the original version of RFC3696. It was corrected in the errata. There’s actually a restriction from RFC5321 on the path element of an SMTP transaction of 256 characters. But this includes angled brackets around the email address, so the maximum length of an email address is 254 characters." – Dominic Sayers

[Source, EPH, Email Address Length FAQ]

Every day I learn something new! (even when I should have known it for a couple of decades)

1 comment so far

Project Done November 30, 2009 2:40 am

Posted by Doug McCaughan in : Programming, Technology
, add a comment

I just put the wraps on one of my projects. This one was a site scrapper and a site rebuild. Scraping means the site which controls the data did not provide an API or other means to get the data so using PHP, cURL, and AJAX (in this case, jQuery), I retrieved the data, used PHP and regular expressions to parse the data to use only the parts I needed, and CSS to present it correctly. The rebuild was applying a new design, furnished by the client, to the rest of the site. Overall fun, albeit with some speed bumps and hiccups.

add a comment

Today’s Work Related Links November 30, 2009 2:33 am

Posted by Doug McCaughan in : Daily Life, Programming, Technology
, add a comment

I work in an ever changing industry. New techniques, new standards, new languages, new buzzwords are always developing. These changes are why programmers must be constant learners. I learn principles. Specifics of a language simply require a decent reference. I rely heavily upon Delicious as my own personal search engine and reference tool. To date, I have bookmarked 10024 websites. I can spent hours researching a problem and clicking through search engine results to read misinformation or bad links but when I find the resource I need, I bookmark it at Delicious with keywords which will help me find the information easily. The next time I need that info, I can find it in seconds.

Links I have used in my work today:

add a comment

My Clients Now Get P3P Privacy Policies November 17, 2009 11:15 am

Posted by Doug McCaughan in : Privacy, Programming, Security, Technology, Touchy Subjects
, add a comment

Does your website collect identifying information on your visitors? If you think because you do not sell anything, ie. no shopping cart, and have no subscription services that you are not collecting identifying information on your site’s visitors then you are probably wrong. Most web servers log IP addresses along with the time of the visit and what that IP address read. ISPs keep logs showing which IP addresses were allocated to what users at particular times. Your logs can be correlated to their logs to identify a person. If your site as a comment form then you are definitely collecting information but more importantly that form gives you a name of a person to associate with the IP address without having to involve the ISP.

So now that we are clear that you are probably collecting identifying information about the visitors to your site, do you have a privacy policy? A privacy policy states how you will use that identifying information. For instance, perhaps you sell it to mailing lists. Or perhaps you specifically do NOT sell it to mailing lists but aggregate it to be able to explain to your potential advertisers that 70% of your site’s visitors are women between the ages of 22 and 35.

If you have a privacy policy, as a human, I can follow the link to that policy, read it, and try to interpret it. But why should I do that when I may not even understand what I’m reading? Shouldn’t the browser or other software handle the privacy policy for me? Yes! And on April 16, 2002 the W3C recommended the Platform for Privacy Preferences Project or P3P which is "a machine-readable language that helps to express a website’s data management practices." What this comes down to is that you can set your privacy preferences in your browser and if the website’s policy does not match, the browser blocks cookies from that site. Certainly there is a bit more to it than that but for most users, it boils down to blocking cookies.

P3P is a bit of a pain in the neck but every website (and that means your blogs) should have a privacy policy. This is definitely something I will encourage of each of my clients.

add a comment

Incense Means Intense November 10, 2009 10:10 pm

Posted by Doug McCaughan in : Daily Life, Programming, Technology
, add a comment

uh oh. I’ve pulled out the candles and incense. That can only mean one thing! Coding is getting serious! Bits and bytes are flying now.

add a comment

On programming – how to read other people’s code and why October 23, 2009 11:15 am

Posted by Doug McCaughan in : Programming, Technology
, add a comment

Programming is an art. I [You] do a lot of business that starts off with "…and my developer just isn’t around anymore…" Dozens of statements could come before or after that but no of those statements change the meaning. Quite simply, you are [I am] about to look at someone else’s code and that person may be an expert programmer or a newbie borrowing snippets from other people’s examples. The code may be documented correct or incorrectly or not at all. Regardless, you [I] have to work with that code no matter its state or quality.

If you are a professional software developer, or aspire to be one, you will need to know a lot of of things. Various maths, stats, languages, frameworks, methodologies, tools, etc. Fads and buzzwords will come and go, all during your career. You’ll master some, ignore some, laugh at some. … You have got to be able to read other people’s code. [Source, Design by Gravity, How to Read Other People’s Code — and Why]

Worthwhile read by Christopher Schanck

add a comment

Love and care of your web developer – For artists October 13, 2009 9:03 pm

Posted by Doug McCaughan in : Programming, Technology
, add a comment

Dear Graphic Designers,
I understand that you are artists and by definition probably a little prone to inconsistencies for the sake of artistic license and creativity. I’m a little artsy fartsy myself so I can appreciate the desire to freehand a stroke rather than pull out a straight edge and right angle; after all this is art, not drafting…or is it. See, a web developer craves and desires regularity. Consistency, predictability, repeatability are programmable. That is, I can write something once and use it over and over with forecastable results. In odd cases, I can program exceptions. Exceptions to rules, much like the real world, are ripe for abuse and unpredictable results.

Consider the job of a doorman at a nightclub. He has been given a procedure. When someone enters the club, he increases the number on a counter in his hand. When someone leaves the club, he decreases the number on a counter in his hand. He is now given a rule which is as long as the number of people in the club is less than a particular number, let’s say 740, then he should let the person in the front of the line in. Once the counter hits 740, he doesn’t let people in. Nice and simple. Now let’s say the manager has a thing for a certain type of woman so he makes an exception to the rule. Any pretty blond woman under the age of 30 wearing a tank top and skirt above the knees immediate gets in without standing in line. We have introduced several opportunities for error but let’s focus on the most obvious one. If 740 people are in the club and a pretty blond 23 year old in a mini-skirt and tank top walks up, does the doorman let her in or send her to the back of the line?

Back to our graphic artists. When you are designing a layout for a website, the layout is typically created as a single image then sliced into smaller images. If you are designing a horizontal navigation bar, when slicing it up do not make two images 41 pixels tall, one image 42 pixels tall, one image 43 pixels tall, and the creme de la creme, the final image 44 pixels tall, and expect me to easily line up the text below the images. Especially don’t do this when the extraneous pixel height is all white space! Thank you. That is all.

/rant

add a comment

On Freelancing October 12, 2009 5:17 pm

Posted by Doug McCaughan in : Programming, Technology
, add a comment

Rule 417: You will work every bit as hard or harder on small, low budget jobs as you will on large jobs.

Note: This rule is unbreakable.

add a comment

Hocus Pocus September 30, 2009 4:33 pm

Posted by Doug McCaughan in : Programming, Technology
, add a comment

I don’t like explaining this to my clients but sometimes the solution to the problem is simply…magic.

add a comment

I need a new editor September 24, 2009 6:15 am

Posted by Doug McCaughan in : Programming, Technology
, 6comments

For most of the past decade I have coded using CFStudio 5. It is a fantastic editor that was bought by Allaire from another company under the name Homesite. CFStudio was a more robust version of Homesite. Eventually CFStudio was abandoned which probably had something to do with Macromedia buying Allaire and wanting to promote Dreamweaver as their preferred editor. Now that Adobe owns Allaire/Macromedia, CFStudio has been reborn as Homesite+ and Dreamweaver still exists.

When my computer crashed, I found myself reinstalling everything. Yes, the computer is back up. It is running Windows XP and has a 500 GB hard drive. I can finally download all the podcasts I want! It also begs the question of whether or not I am using the best IDE for my purposes. I am not an eclipse fan. I see the potential and I really want eclipse to be a good solution but I’ve had too many bad experiences with it. For the past several weeks I have been coding in Notepad++ and although the compare plugin rocks the editor itself is really just an editor and I need an IDE.

Suggestions? IDE should accommodate PHP, ColdFusion, CSS, JavaScript, etc.

6comments

What do bits and bytes look like? September 18, 2009 2:10 pm

Posted by Doug McCaughan in : Programming, Technology
, add a comment

I spend a lot of my days staring at stuff like this:

fV,da){var result=[];for(var i=0;i<=da.length-1;i++){if(da[i]!=fV){result[result.length]=da[i];}}return result;};function um_aM(fV,f){for(var i=0;i<=f.length-1;i++){if(fV==f[i]){return true}}return false;};function log(fi){regetPopDoc();var fW=um_K.getElementById("debugHint");if((um_v)&&(fW)){fW.value=fi+"\r"+"\n"+fW.value;}};function um_aZ(fV){var dn=0;if(fV.offsetParent)while(1){dn+=fV.offsetLeft;fV=fV.offsetParent;if(!fV.offsetParent)break;}else if(fV.x)dn+=fV.x;return dn;};function um_ba(fV){var dp=0;if(fV.offsetParent)while(1){dp+=fV.offsetTop;fV=fV.offsetParent;if(!fV.offsetParent)break;}else if(fV.y)dp+=fV.y;return dp;};function um_aF(el,gP){if((um_J)||um_I||ie){var gX=gP.split('-');var gY='';if(gX.length>0){gP="";for(var i=0;i<=gX.length-1;i++){if(i>=1){gY=gX[i].substr(0,1);gY=gY.toUpperCase();gY+=gX[i].substring(1);}else{gY=gX[i];}gP+=gY;}}else{}}var x=el;if(um_p||um_n||um_o){var y=x.currentStyle[gP]}else if(um_q){var y=eval('x.currentStyle.'+gP);}else if(um_I||um_J){var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(gP);log('get style: y is '+y);}else{var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(gP);}return y;};function um_aN(){var fB=navigator.userAgent;var hd=navigator.appVersion;log('navigator is: '+fB);log('version is:'+hd);if(hd.indexOf('MSIE 5.5')!=

add a comment