The opening sentence on Wikipedia for We Are Hunted reads like a eulogy, solemnly stating that “We Are Hunted was a San Francisco based software company”.
Freelancing can take a developer in many directions that they wouldn’t get to go in a specific company role. The three years that I spent in front-end development taught me a lot about jQuery, CSS and conditional PHP but it really even touch on handling data. The terms ‘sanitize’ and ‘data object’ are still new-ish to me, gleaned from the lexicon of colleagues and peers. Nevertheless, it is the job of a freelancer to understand that anything is possible and then find out how to do it.
I have an ftp folder with about 10 .xml files that get updated by a 3rd party every day at midnight. i need to a) initially insert them into MySQL and b) cron check daily for new new records and for records that need updated.
In my mind, it is a matter of breaking apart arrays and analysing them… but, I wanted a pro opinion on how it should be done. So I asked my friend Lloyd Leung what he recommended and he laid it out for me:
First, you will have to create a .php page
1.) validate the xml, make sure it’s correct. look into “tidy” in the php manual.
2.) load object if exists, or start a new object.
3.) validate the data object’s data.
4.) save the data object.
– Run the cron on your .xml at 2am, so it gaves them time to upload, and finalize the data.
– If at anypoint, something F’s up… send an email out to report the error as to what happened.
So, of course, this is perfectly clear but I still wanted to double check that I had my wording right. I asked exactly what he meant by ‘data object’ and was told that it’s a class, that would represent a single row in a database. Or ‘collection’ of data that is represented in the database.
– “human” would be an object.
– Human has “color of eyes”, “hair color”, “height”… and those are all properties of “human”.
– human[‘hairColor’] or human->getHairColor(), would return “brown”
When you “setHairColor();” you can check if it’s a string, in a list of acceptable “colors”, if it’s “capitalized”, whatever business rules that need to happen.
So, now you’re dealing with a single class, that houses logicallly, all functions that are tied to “human”.
Thanks Lloyd! This was helpful for me.
There are many methods available to help fight spam, however, none offer complete protection against manual labourers.
Less Framework is a cross-device css grid system based on using inline media queries.
The core idea is to first create a default layout normally, and then additional layouts using inline media queries. Any browsers incompatible with media queries will simply ignore the additional layouts, and will only use the default one. The additional layouts will inherit any styles given to the default layout, so coding them is a breeze.
All four of the layouts included in Less Framework share a common column-width and gutter-width, which makes it easy to design them consistently. Also included are two sets of typography presets composed around a baseline grid of 24 px.
I spent a long time clumsily messing around with Php’s mail() function. After failing to figure out how to satisfy the header requirements to for HTML e-mails that looked good in Gmail, Outlook and iMail (rather… in every possible viewing scenario), I found Swiftmailer.
The Arcade Fire have made another entry into the history books. This time not for being the biggest Internationally recognized Canadian recording act since Celine Dion, but for making the most innovative music video since The Buggles launched MTV in 1981. Why is it so important? Because this music video is tailor-made for me.
Google announces the release of a direct competition to Skype‘s web-to-phone service, Google Talk. with free calls to USA and Canada for the rest of 2010. Currently, when a call is made a charge of 10 cents appears next to your call history. My hope is that will be erased at the end of 2010, and I will no long be able to make calls until I have purchased credits to continue to make long distance calls at low rates.
I was migrating a website containing about 100 links to pdfs on one page. I didn’t have access to the old site’s ftp so I needed a utility to speed up the process, instead of right-clicking on each file and saving the link manually.
I found a link to this on a very handy utilities list […]
The Google Font Directory lets you browse all the fonts available via the Google Font API. All fonts in the directory are available for use on your website under an open source license and served by Google servers.