Preparation, direction and common sense

March 28th, 2009

OK, so this post is all about the importance of the aforementioned title. Whether you are a first timer or a seasoned veteran, creating a new website is a huge task. Just like home renovation, a new site will take longer than you want, be more involved that you imagined and cost more than you had hoped.

Also just like home renovation, preparation is vital. If you don’t do your homework, and allow PLENTY of time for the research and planning stages, buy the time you start developing the stitching will fall out of the design. I cannot stress this enough… starting to develop a site without an ENTIRE scope and direction is foolish and unprofessional. I’m just sayin’….. :)

Chris Fontes Programming

MySQL Conditional Left Joins

March 27th, 2009

Ok,  so the title is a bit misleading… I am not going to show you necessarily how to only LEFT JOIN a table based on a condition, but I will show you how to get the same results as you would expect.

First, you may be asking…. why would I ever need to? Well, let ’s say you have 3 tables. Table One is acting as your primary index relation table. Then, based on the info IN that table, you need to join either table Two or table Three. How would you do it?

SELECT `one`.first_name, `one`.male_female,
IF(`one`.male_female=’boy’,boyTable.meaning,girlTable.meaning) AS name_meaning
FROM `one`
LEFT JOIN `two` AS boyTable ON boyTable.first_name=`one`.first_name
LEFT JOIN `three` AS girlTable ON girlTable.first_name=`one`.first_name

This will let you, for example, select the meaning of someones name if the meanings where in two different tables based on gender. This is of course, is just an example, and this particular situation would be handled better by just setting a flag in a singular table that specifies male of female, but I needed to come up with some way illustrate the concept, so her you are!

hope this helps someone

Chris Fontes Programming , , ,

Christian Web Design?

March 27th, 2009

For those of you who are Christian and either are web developers, web designers or somewhere in between, you need to read this….

http://mirificampress.com/permalink/christians_would_rather_copy_than_create

The entire Blog is great, and I am a subscriber… but this post stuck out to me. Matt, the gentleman who produces this Blog, has some GREAT things to say, er, I mean write. ;)

Chris Fontes Christianity, Programming ,

Battletoads, a renewed love

March 27th, 2009

I was in conversation of old NES games yesterday, and Battletoads came up. I used to LOVE that game! I can also say, that I am part of the elite group that has actually beaten it. Well, enough tooting of my own horn… the reason for the post is to share a Battletoads wallpaper that I made, for fun. Enjoy!battletoads

Chris Fontes Other , , , ,

Code Jedi Master

March 25th, 2009

So, (in reagards to web applications), if learning HTML makes you a padawan, and becoming a solid programmer (PHP, javascripts, CSS, etc) makes you a Jedi, than learning Regular Expressions makes you a Jedi Master! I still have to use a reference about half the time, but regular expressions make life easy… and you feel like a rock star when they work properly! Look at http://www.regular-expressions.info for a GREAT reference and tutorial.

Chris Fontes Programming ,

Javascript nodeType

March 24th, 2009

have you ever looped through your page to grap inputs to post somewhere? If you have, then surely you have used something like:

for (var i=0;i<elem.childNodes.length;i++)

if so, then you might have run into a little issue in which some browsers (including firefox) will render the “n” as a childNode (this is correct actually, just frustrating).

In comes the solution ….. Node.nodeType. You can check elem.childNodes[i].nodeType to see what it is (https://developer.mozilla.org/En/DOM/Node.nodeType). If it is a 1, it is an element (li, div, etc). skip everything that is != 1, and tada! You are in business!

hope this helps someone

Chris Fontes Programming , , ,

New Blog!

March 18th, 2009

This is my new blog… I got tired of not having one….. So now that I am here, what I am gonna do?

Well, this will probably be a dumping spot of personal posts (family, etc), interesting code stuff (I’m a web developer), Jeet Kune Do related topics, and Christian theology.

Yeah!

Chris Fontes Other