Haven't decided yet, but here's a nice summary of the features involved in blogger.com vs wordpress.com. I wonder if tumblr or posterous are more relevant now? I've got a ton of this old stuff to port over. Looks like I won't be able to show comments made by their rightful authors for old posts no matter which site I use. Decisions decisions.
read more...
Showing newest posts with label application-development. Show older posts
Showing newest posts with label application-development. Show older posts
9.13.2009
1.30.2009
How good system administration is like new underwear
I can't remember the last time I bought my own underwear. I may not have EVER bought any for myself. Each Christmas, there's typically a few new pairs of boxers under the tree with my name on them. Well, more precisely, my name is on the wrapping paper that the underwear come in, not actually on the boxers themselves (because I'm either too old now or much too young to have people labeling my clothes for me).
But I never have to worry about underwear. There's an unseen process chugging along that keeps my clothes drawers replenished with fresh undergarments. It's a constant. The underwear is just there and it just works.
Good quality system administration is like new underwear because it's a constant, it's just there, and it just works.
If the development team is worried about placating the system administration team or if the dev team constantly has to work around various odd limitations in the system, then you're system administration is not like new underwear at all. It's like a sock that has holes.
You don't want to worry when you put on your socks in the morning that your big toe might shoot out of your sock into the cold morning air, right? Is there a more uncomfortable feeling? Similarly, you don't want to launch your new app and have to cross your fingers that the database is going to hold up. (Perhaps I'm starting to mix metaphors here with all the underwear and socks talk)
But my point is this... When your dev team has to worry about the system administration, they're going to spend more time talking about and coming up with solutions to issues that could probably be addressed by more robust system administration. That makes your programming projects take longer. And that's costing you money. Real countable money.
So get yourself a good admin. Pay them wisely. Give them new toys to play with. And never worry about your underwear again.
.
read more...
But I never have to worry about underwear. There's an unseen process chugging along that keeps my clothes drawers replenished with fresh undergarments. It's a constant. The underwear is just there and it just works.
Good quality system administration is like new underwear because it's a constant, it's just there, and it just works.
If the development team is worried about placating the system administration team or if the dev team constantly has to work around various odd limitations in the system, then you're system administration is not like new underwear at all. It's like a sock that has holes.
You don't want to worry when you put on your socks in the morning that your big toe might shoot out of your sock into the cold morning air, right? Is there a more uncomfortable feeling? Similarly, you don't want to launch your new app and have to cross your fingers that the database is going to hold up. (Perhaps I'm starting to mix metaphors here with all the underwear and socks talk)
But my point is this... When your dev team has to worry about the system administration, they're going to spend more time talking about and coming up with solutions to issues that could probably be addressed by more robust system administration. That makes your programming projects take longer. And that's costing you money. Real countable money.
So get yourself a good admin. Pay them wisely. Give them new toys to play with. And never worry about your underwear again.
.
12.15.2008
Development Environment layout using Linux, Apache, PHP, and Subversion
Some of the age old questions I face lately are:
Some of you may be asking yourselves the same questions. The choice of dinner is a personal one. I won't go into that except to say that everyone loves a good burrito. Spicy! And you probably don't care about my take on Facebook etiquette since your friends list probably dwarfs mine.
But I do have some definite thoughts on the layout of development environments. And I find that there's a huge lack of information about this on the interweb, so here you go.
We use Linux, Apache, PHP, and subversion in our development environment and so these instructions will be biased towards these topics but I think you can apply this method using various other technologies.
I like to give each developer their own development web site and development database. I find it's easier for everyone to have their own individual sandbox to play in. We give them each their own domain using their initials, something like rzdev.domain.com for me and vbdev.domain.com for another developer, Vinny Bag-o-Donuts. We set the Apache directories up on the Linux dev box in a similar fashion:
/var/www/rzdev.domain.com/
/var/www/vbdev.domain.com/
This has a few benefits. If I need to show Vinny something with my site development, I can just send him the link to http://rzdev.domain.com/broken-page. I can make changes to code, even major infrastructure code and not break anything for the other developers. We do the same thing with the databases, prefacing them with our initials.
Now, since our dev boxes use Linux, we set up Samba for sharing on these web directories. This means that all the devs can edit files and use source code management on the Linux server itself or on their Windows machines (we use either Eclipse or Zend Studio and create projects on the shares, that's a whole different posting!).
This dev site layout is closely linked to the way we use Subversion for version control. When we start a new site or application, if we can split out the development evenly enough, we'll just have everyone work from the trunk version of the code, with each developer working on their own little section. Each developer puts the trunk in their Apache dir and we edit the Apache configs to reflect this:
/var/www/rzdev.domain.com/trunk/
/var/www/vbdev.domain.com/trunk/
The root of the dev sites typically look like this:
/var/www/rzdev.domain.com/trunk/docs ( your Apache document root )
/var/www/rzdev.domain.com/trunk/lib ( non-public PHP library code )
When we commit code changes in Subversion, we have a hook that updates our main development site here:
/var/www/dev.domain.com/trunk
Again, that site can be seen on the web at http://dev.domain.com/ This way, we can do integration testing on our code to make sure our new code doesn't break code from someone else within the dev site.
Now, the important thing here is that the Quality Assurance (QA) and Testing people ( if you're lucky enough to have them ), don't use any of these previously mentioned sites for their testing. Why not? Well, because if they're doing a good job and are therefore sufficiently anal, they're going to complain when code is changing on the site they're looking at.
So we give them their own test site and database that's viewed on the web at http://test.domain.com/ and setup in apache at:
/var/www/test.domain.com/trunk/docs
/var/www/test.domain.com/trunk/lib
The developers will meet and create the list of files and database changes that get moved over to the test site. How the actual moving is done doesn't really matter. If you have the time and energy to set up some Ant or Phing tasks, that works great. But copying/rsyncing files and running some SQL on the test database works just as well. The most important part is that the developers meet to decide which part can go to test. Otherwise, you could have code going to test and eventually production that might not be fully vetted.
When QA finds bugs in test.domain.com, they can send them to the developers. The developers can instantly start working on fixing the bugs in their own dev space at rzdev.domain.com and not affect the other developers or the ongoing testing of the application. Pretty nice right?
Advantages of this approach
Disadvantages
So what do you think? How do you setup YOUR PHP development environment?
..
read more...
- What's for dinner?
- Should I accept that friend request on Facebook for the friend of a friend of a friend that I knew 15 years ago?
- What's the best development and test environment layouts for PHP using Apache as a web server with Subversion for version control for multiple developers?
Some of you may be asking yourselves the same questions. The choice of dinner is a personal one. I won't go into that except to say that everyone loves a good burrito. Spicy! And you probably don't care about my take on Facebook etiquette since your friends list probably dwarfs mine.
But I do have some definite thoughts on the layout of development environments. And I find that there's a huge lack of information about this on the interweb, so here you go.
We use Linux, Apache, PHP, and subversion in our development environment and so these instructions will be biased towards these topics but I think you can apply this method using various other technologies.
I like to give each developer their own development web site and development database. I find it's easier for everyone to have their own individual sandbox to play in. We give them each their own domain using their initials, something like rzdev.domain.com for me and vbdev.domain.com for another developer, Vinny Bag-o-Donuts. We set the Apache directories up on the Linux dev box in a similar fashion:
/var/www/rzdev.domain.com/
/var/www/vbdev.domain.com/
This has a few benefits. If I need to show Vinny something with my site development, I can just send him the link to http://rzdev.domain.com/broken-page. I can make changes to code, even major infrastructure code and not break anything for the other developers. We do the same thing with the databases, prefacing them with our initials.
Now, since our dev boxes use Linux, we set up Samba for sharing on these web directories. This means that all the devs can edit files and use source code management on the Linux server itself or on their Windows machines (we use either Eclipse or Zend Studio and create projects on the shares, that's a whole different posting!).
This dev site layout is closely linked to the way we use Subversion for version control. When we start a new site or application, if we can split out the development evenly enough, we'll just have everyone work from the trunk version of the code, with each developer working on their own little section. Each developer puts the trunk in their Apache dir and we edit the Apache configs to reflect this:
/var/www/rzdev.domain.com/trunk/
/var/www/vbdev.domain.com/trunk/
The root of the dev sites typically look like this:
/var/www/rzdev.domain.com/trunk/docs ( your Apache document root )
/var/www/rzdev.domain.com/trunk/lib ( non-public PHP library code )
When we commit code changes in Subversion, we have a hook that updates our main development site here:
/var/www/dev.domain.com/trunk
Again, that site can be seen on the web at http://dev.domain.com/ This way, we can do integration testing on our code to make sure our new code doesn't break code from someone else within the dev site.
Now, the important thing here is that the Quality Assurance (QA) and Testing people ( if you're lucky enough to have them ), don't use any of these previously mentioned sites for their testing. Why not? Well, because if they're doing a good job and are therefore sufficiently anal, they're going to complain when code is changing on the site they're looking at.
So we give them their own test site and database that's viewed on the web at http://test.domain.com/ and setup in apache at:
/var/www/test.domain.com/trunk/docs
/var/www/test.domain.com/trunk/lib
The developers will meet and create the list of files and database changes that get moved over to the test site. How the actual moving is done doesn't really matter. If you have the time and energy to set up some Ant or Phing tasks, that works great. But copying/rsyncing files and running some SQL on the test database works just as well. The most important part is that the developers meet to decide which part can go to test. Otherwise, you could have code going to test and eventually production that might not be fully vetted.
When QA finds bugs in test.domain.com, they can send them to the developers. The developers can instantly start working on fixing the bugs in their own dev space at rzdev.domain.com and not affect the other developers or the ongoing testing of the application. Pretty nice right?
Advantages of this approach
- Uses source code management
- Developers can unit test their own code
- Developers can do integration testing between each other's code
- Developer A typically doesn't destroy code or data that developer B is using
- Developers don't destroy code or data that QA/testing is looking at
- Developers can both edit files and use source code management in either Linux or Windows environment
- Very scalable. Adding new developers into the mix is as simple as adding their respective sub domains and databases (of course, this can also be viewed as a disadvantage, see below)
- Less bugs make it to production
Disadvantages
- Lots of sysadmin overhead initially and with each subsequent domain added. You have to set up all those developer sites, rzdev, vbdev, etc. Same overhead when using branching within subversion. Plus, you have to setup all those databases and setup the config code to connect to the appropriate database for each developer domain.
- Lots of file space for all the sites and databases.
- Confusing for lone wolf and gunslinger developers who are used to overwriting production or each other's development code (too bad for them!)
So what do you think? How do you setup YOUR PHP development environment?
..
10.30.2008
linkedin.com needs to sync up company names when the company name changes
My invites to present and former colleagues via linkedin.com have started to tumble in as opposed to the normal trickle. I think that's a fairly accurate sign of our flagging economy as anything I can personally put a number on. Of course it could also be that I'm a loser who has never really used linkedin a lot and so have practically no contacts there. ;-)
What's annoying however is the way linkedin keeps track of company names and what happens when a company name changes. For instance, let's say I work at a company called "Davisons." I put that in my linkedin profile. "Davisons" gets bought by "Johnson, Inc" and they change the name of the company to "Johnson Davisons." So any new people coming into the company know it as "Johnson Davisons," not just "Davisons." When they look for current employees on linkedin, they won't find all of them because some have the old company named listed while some will have the new company name listed. Not to mention how bad this problem gets when one of your previous employers changes names after you have left.
This problem is what I would call an issue with name history. This kind of name history problem is starting to creep into other areas of the web as well. I've already had the misfortune of trying to email someone I haven't emailed in a few years and reached a completely different person (ie, one person's email acct was shut down and another started with the same address). Pretty embarassing -- makes me think twice about starting emails with "Hey dirtbag! Long time no see!"
The solution for linkedin's name history problem is pretty simple. They should ask you if the company has gone by any other names and let you choose from possible alternates (or even free type them). It won't take long for their system to build up the necessary relationships between past and current company names. It could even be pretty slick and auto-update old companies in your profile to their present name if the name is now different from what you specified.
A search for employees of "Davisons" in this case would give you both Davisons and Johnson Davisons and whatever other company names are "linked in" to this company.
read more...
What's annoying however is the way linkedin keeps track of company names and what happens when a company name changes. For instance, let's say I work at a company called "Davisons." I put that in my linkedin profile. "Davisons" gets bought by "Johnson, Inc" and they change the name of the company to "Johnson Davisons." So any new people coming into the company know it as "Johnson Davisons," not just "Davisons." When they look for current employees on linkedin, they won't find all of them because some have the old company named listed while some will have the new company name listed. Not to mention how bad this problem gets when one of your previous employers changes names after you have left.
This problem is what I would call an issue with name history. This kind of name history problem is starting to creep into other areas of the web as well. I've already had the misfortune of trying to email someone I haven't emailed in a few years and reached a completely different person (ie, one person's email acct was shut down and another started with the same address). Pretty embarassing -- makes me think twice about starting emails with "Hey dirtbag! Long time no see!"
The solution for linkedin's name history problem is pretty simple. They should ask you if the company has gone by any other names and let you choose from possible alternates (or even free type them). It won't take long for their system to build up the necessary relationships between past and current company names. It could even be pretty slick and auto-update old companies in your profile to their present name if the name is now different from what you specified.
A search for employees of "Davisons" in this case would give you both Davisons and Johnson Davisons and whatever other company names are "linked in" to this company.
5.20.2008
Beware the Lone Wolf PHP Developer
With all the posts on interviewing PHP candidates popping up lately, I thought I'd post this draft that I've been sitting on for awhile that's related to new jobs and interviewing candidates.
I've run into the Lone Wolf PHP Developer at several places I have done work. Sometimes, I've had to work side-by-side with the Lone Wolf. Other times, I've replaced the Lone Wolf who had moved on to different hunting grounds. Still other times I've had to hire people and had to choose between a Lone Wolf and several other candidates.
Just who is this Lone Wolf and why should we fear them so much? Here are some telltale signs of the Lone Wolf PHP Developer:
Now, I personally have run into this Lone Wolf scenario with other programming languages as well. But I think because it is so simple to work with PHP without much formal training that it lends itself to this problem much more readily then other languages. The blessing and curse of PHP is that it is the new VB 6.
read more...
I've run into the Lone Wolf PHP Developer at several places I have done work. Sometimes, I've had to work side-by-side with the Lone Wolf. Other times, I've replaced the Lone Wolf who had moved on to different hunting grounds. Still other times I've had to hire people and had to choose between a Lone Wolf and several other candidates.
Just who is this Lone Wolf and why should we fear them so much? Here are some telltale signs of the Lone Wolf PHP Developer:
- The Lone Wolf doesn't understand how to work in a team of developers. They typically don't even understand what benefits that would create. They do all development on their own, listening to very little input from qualified sources.
- The Lone Wolf got to page 141 on Enter-A-Beginner-PHP-Book-Title-Here and no further. Objects? They've never heard of them. They must not need them.
- The Lone Wolf re-invents the wheel for every project and doesn't use standard tools and practices.
- The Lone Wolf eats their young. OK, I made that one up. Frankly, how could a Lone Wolf have young anyway?
- The Lone Wolf is perfectly satisfied with doing programming work on production servers and using FTP to deploy their code. It never occurs to them that they should strive to create development and test environments. It never occurs to them that deployment via FTP doesn't scale higher then one developer.
- The Lone Wolf doesn't know what the letters SCM, CVS, or SVN are, or how to use them in their daily work.
- The Lone Wolf never reads my blog or any other blogs on programming. The Lone Wolf may not know what a blog is.
- The Lone Wolf says crazy things like "MySQL can't do transactions" and somehow gets management to believe them.
- The Lone Wolf was initially adored by management because they launched a lot of code live during their short stay. Too bad all that code is buggy and completely un-maintainable moving forward. Management doesn't like that.
- The Lone Wolf whips up incredibly stupid and unnecessarily complex solutions like template systems in which the templates are stored in a database instead of the file system/memory/cache. They shun using tried and true templating methods like PHP files, XSLT, or at the very least, Smarty. (see also: reinventing the wheel)
- The Lone Wolf names variables after themselves that mean nothing to anyone else (ex, $lonewolfFlag )
- And worst of all… The Lone Wolf PHP Developer fails to realize that there are other developers out there in the business world, trying to earn a living just like they are. By failing to conform to development standards that have been proven and tested, they make everyone's job more difficult.
Now, I personally have run into this Lone Wolf scenario with other programming languages as well. But I think because it is so simple to work with PHP without much formal training that it lends itself to this problem much more readily then other languages. The blessing and curse of PHP is that it is the new VB 6.
5.13.2008
PHP Developer Jobs are the Hottest EVER!!!
** I'll preface this by saying that I'm not specifically looking for a new position but I think it is important to be aware of the market that you serve. Even in happy times during my employment, I routinely scan job ads to see the health of the market and to gauge its direction. **
If anecdotal evidence means anything, and sometimes it does... and at the risk of sounding like a teenage girl writing on a myspace page, the PHP job market is literally blasting off! I've never seen the market for PHP programmers as strong as it right now in the NYC/Philadelphia region.
While there are lots of PHP jobs in the usual suspects like small start-ups, there also seem to be a number of jobs at established companies and developer shops. I'm also seeing a definite split in PHP jobs where there are both entry level jobs as well as jobs for more experienced people with titles like "Senior PHP Developer" and "PHP Tech Lead." I can't remember seeing so many senior PHP positions. The salaries I'm seeing are also at an all time high. Many ads have salary ranges that extend well into 6 figures.
As far as requirements I have seen, there definitely seems to be a shift towards frameworks like Symfony and Zend Framework as well as items specifically mentioning IDEs like Eclipse and Zend Studio. However, I rarely see mention of source code management and unit testing. Hopefully those items were cut from the job ads due to space requirements. ;-)
If you are a PHP developer in the area and are highly experienced, get ready to reap the rewards for your hard work. If you are a hiring manager in the area, prepare to shell out more for top talent.
So what is everyone else seeing in their area with regards to PHP developer jobs?
.
read more...
If anecdotal evidence means anything, and sometimes it does... and at the risk of sounding like a teenage girl writing on a myspace page, the PHP job market is literally blasting off! I've never seen the market for PHP programmers as strong as it right now in the NYC/Philadelphia region.
While there are lots of PHP jobs in the usual suspects like small start-ups, there also seem to be a number of jobs at established companies and developer shops. I'm also seeing a definite split in PHP jobs where there are both entry level jobs as well as jobs for more experienced people with titles like "Senior PHP Developer" and "PHP Tech Lead." I can't remember seeing so many senior PHP positions. The salaries I'm seeing are also at an all time high. Many ads have salary ranges that extend well into 6 figures.
As far as requirements I have seen, there definitely seems to be a shift towards frameworks like Symfony and Zend Framework as well as items specifically mentioning IDEs like Eclipse and Zend Studio. However, I rarely see mention of source code management and unit testing. Hopefully those items were cut from the job ads due to space requirements. ;-)
If you are a PHP developer in the area and are highly experienced, get ready to reap the rewards for your hard work. If you are a hiring manager in the area, prepare to shell out more for top talent.
So what is everyone else seeing in their area with regards to PHP developer jobs?
.
4.16.2008
Setting up Google App Engine SDK
I've started playing around with the Google App Engine SDK. So far I've found this fellow's posts on setting up Python, Eclipse, PyDev, and the Google App Engine very helpful. He also has a great post on ER-modeling and relational models in Google App Engine.
Check them out.
.
read more...
Check them out.
.
3.19.2008
Symfony sfException Call to undefined method BaseModel::__toString
Working on some projects in Symfony recently. I ran into a problem when I used the symfony admin generator to create a "backend" module for a table that has a foreign key relationship.
Symfony was looking for me to have a __toString() function in my model so it could create the drop down menu. So for instance, let's say you have tables like countries and states in your schema.xml. Country_id in the states table is a foreign key to the Countries table like so:
[xml]
[/xml]
When you do:
[code]
symfony propel-init-admin backend states States
[/code]
Symfony is going to create the edit and create actions of the States screens with a drop-down menu of countries that the state is a part of. The value of the country drop down is the country_id. the value needs to be set in a __toString() function in your Country propel model. The easiest thing is to just return a simple string name (if that's in your db model):
[php]
function __toString()
{
return $this->name;
}
[/php]
That should solve the problem. It's odd that this comes up. And I couldn't find anything on it when googling.
read more...
Symfony was looking for me to have a __toString() function in my model so it could create the drop down menu. So for instance, let's say you have tables like countries and states in your schema.xml. Country_id in the states table is a foreign key to the Countries table like so:
[xml]
[/xml]
When you do:
[code]
symfony propel-init-admin backend states States
[/code]
Symfony is going to create the edit and create actions of the States screens with a drop-down menu of countries that the state is a part of. The value of the country drop down is the country_id. the value needs to be set in a __toString() function in your Country propel model. The easiest thing is to just return a simple string name (if that's in your db model):
[php]
function __toString()
{
return $this->name;
}
[/php]
That should solve the problem. It's odd that this comes up. And I couldn't find anything on it when googling.
2.18.2008
Using Subversion externals property for WordPress upgrades
Take WordPress for example. A typical upgrade of WordPress involves copying the new WordPress files over your existing files. Then you have to copy back safe versions of things like wp-config.php, .htaccess (if you're using it), as well as any custom themes/modules from the wp-content/ directory. Not to mention any of your own directories that should exist alongside your wp-includes/ and wp-content/ directories. After that you can run the upgrade.php file.
These upgrade steps aren't terrible. They're quite a bit better then most open source apps out there but they still suffer from a few problems:
- If you have your code, including your WordPress install, in Subversion or another source code control system, you have to commit all the files that change with each WordPress version. There may be files added, deleted, etc. You'll have to keep combing thru "svn status" messages to figure out everything you need to do to get all the WordPress files into your repository. This can be painful. And take a long time.
- WordPress is specifically written so that you don't ever have to muck with the guts of it. You create themes and plugins for added functionality. So, since you're not maintaining the code that powers WordPress, do you really need all those deltas in your Subversion repository? I think not.
- What do you do with your own code in directories that sits alongside wp-includes/? What if it’s in a Subversion repo?
The WordPress site also has instructions for using Subversion with your site. Here, they advocate the use of “svn switch” to update your site. This is much more manageable and solves a few of the above problems. Most svn users can probably can get away with this method. But unfortunately not me.
I have additional directories on some of my sites that I need to add into my WordPress install. So I have to copy/move them into the WordPress dirs which gets tough. And then my “svn status” will get all wonky because my WordPress dir is under one repo and my code is under another. This was endlessly confusing for me.
So I found myself looking for a way to completely wall off my WordPress install from the rest of my files. I was reminded recently of the use of the Subversion externals property and my mind started buzzing with possibilities. With "externals," I can say:
Pull the stable WordPress code from WordPress.org and put it into this directory named /docs/wp/
Then my other directories, which are under my own local subversion repo can exist at /docs/dir1, /docs/dir2, etc. Of course, some Apache Alias magic is needed to make all this work.
Here's the way I set it up for my some of my projects. So far so good. This is a bit hairy to set up but subsequent upgrades are a breeze. I use this across development, testing, and production systems (how to get those environments to work with WordPress will be another entry)
First off, the previous Apache document root for domain1 was at /www/domain1/docs, so the WordPress files wound up like this:
/www/domain1/docs/wp-content/
/www/domain1/docs/wp-includes/
But I also have a lot of dirs that sit alongside of wordpress like this:
/www/domain1/docs/dir1
/www/domain1/docs/dir2
We're going to wind up changing that.
Create an subversion external property in /www/domain1/docs for WordPress
[code]
$$ cd /www/domain1/docs
$$ export SVN_EDITOR=vi ( or your editor of choice )
$$ svn propedit svn:externals .
[/code]
vi starts up and you can add the following line:
[code]wp http://svn.automattic.com/WordPress/tags/2.3.3[/code]
Save and exit
[code]$$ svn commit
$$ svn update [/code]
( This downloads the WordPress code from the above address into your wp/ directory. Now we are cooking. )
- Now, /www/domain1/docs/wp is where all your WordPress code lives.
- Copy wp-config.php to /www/domain1/docs/wp/
- Copy .htaccess to /www/domain1/docs/wp/
- Create a link from the stock wp-content/ dir to your personal wp-content dir like this
[code]$$ cd /www/domain1/docs/wp
$$ rm -Rf wp-content/ ( use -Rf with care please! )
$$ ln -s /www/domain1/docs/wp-content wp-content
[/code]
- In Apache config, set document root for this domain to /www/domain1/docs/wp
- Put wp-content/ dir and any other non-WordPress dirs/files into /www/domain1/docs
- Create an alias for wp-content/ and any other non-WordPress dirs/files in Apache config
[code]
Alias /wp-content /www/domain1/docs/wp-content
Alias /dir1 /www/domain1/docs/dir1
Alias /dir2 /www/domain1/docs/dir2
[/code]
This looks like a lot of work, but it's really only a lot the first time around. Next time WordPress has an upgrade:
[code]
$$ cd /www/domain1/docs
$$ svn propedit svn:externals . ( change the tag to new version of WordPress )
$$ cd wp/
$$ rm wp-content (to remove the link)
$$ svn update (to update to new version of WordPress)
$$ rm -Rf wp-content/
$$ ln -s /www/domain1/docs/wp-content wp-content
[/code]
Everything after the propedit in this group can and should be scripted which will basically give you a 2 step process for upgrading WordPress, while keeping you wp-content/ dir under local source code control, as well as leaving room for any other directories or files your site might require.
This technique will probably also work with Symfony although I haven’t tried it yet.
12.13.2007
People work with WS-* web services in PHP? Why?
I'd love to give ws02 a fair shake because they have an open source business model. They have a web services framework for PHP which seems interesting from an academic standpoint. But I think WS-* web services are WAY too complicated when compared to REST.
Just look at this new product description from ws02:
Your life is now 1 minute shorter after trying to read and fully understand that paragraph. Nevermind how much time would be spent trying to actually get this stuff to work.
I spent a lot of time in 2001-2002 working with Amazon's merchant program and the SOAP feeds required for putting client product on the Amazon site. I generally think that Amazon has a pretty good clue about how to do things technically and they seemed to make it as easy as possible while using SOAP. But it was still way too complicated for what we were trying to achieve (ie, send a list of available product to Amazon to sell ). And at the time, it was a nightmare in PHP. Now of course, we have the official PHP SOAP extension and some items in PEAR to work with too (does nusoap still exist?)
But I've run screaming from WS-anything since then, only getting caught in its claws a few times. It hasn't gotten any easier. It's gotten more difficult. And more pointless. I'm not alone in this thinking.
So I guess the ws02 folks are trying to solve the issue of authentication for web services. Hasn't web services authentication been solved already in a much easier way too?
read more...
Just look at this new product description from ws02:
The WSO2 IS enables LAMP and Java websites to provide strong authentication based on the new interoperable Microsoft CardSpace technology, which is built on the open standards Security Assertion Mark-up Language (SAML) and WS-Trust.
Your life is now 1 minute shorter after trying to read and fully understand that paragraph. Nevermind how much time would be spent trying to actually get this stuff to work.
I spent a lot of time in 2001-2002 working with Amazon's merchant program and the SOAP feeds required for putting client product on the Amazon site. I generally think that Amazon has a pretty good clue about how to do things technically and they seemed to make it as easy as possible while using SOAP. But it was still way too complicated for what we were trying to achieve (ie, send a list of available product to Amazon to sell ). And at the time, it was a nightmare in PHP. Now of course, we have the official PHP SOAP extension and some items in PEAR to work with too (does nusoap still exist?)
But I've run screaming from WS-anything since then, only getting caught in its claws a few times. It hasn't gotten any easier. It's gotten more difficult. And more pointless. I'm not alone in this thinking.
So I guess the ws02 folks are trying to solve the issue of authentication for web services. Hasn't web services authentication been solved already in a much easier way too?
10.31.2007
Open source twitter clone anyone?
Does anyone know of an open source twitter clone? Preferably in PHP or Python. Not a client mind you, but the server guts of receiving IMs and doing something with them, enabling followers, public viewing, etc. I want to implement this on an intranet inside a corp network and obviously not display our tweets for public consumption, but only internal consumption. If this doesn't exist, what do you all think is the easiest way to create this? An instance of jabber or something else?
read more...
7.02.2007
Drupal for single hierarchy corporate website
We needed a content management system (CMS) for a website at work for 3 reasons:
- So the developers could be out of the content maintenance loop.
- So the developers could be out of the content maintenance loop.
- So the developers could be out of the content maintenance loop.
I remember when I first started web development years ago (gosh, has it been 10 years already?), that the “web guy” was called upon to make every little edit to the website. It could be a typo, a broken link, or an add-on to an existing application. Obviously, some of these things are not like the others. Fixing typos and broken links shouldn’t really be done by the programmers. They’re making too much money to deal with such minor issues. The people in charge of creating that content should be in charge of that stuff (ie, the marketing people).
There are a lot of companies where this is still the norm, the web development folks have to take care of a lot of minor issues like this. My current company was like that. But I’m trying to change the culture there. I’m trying to make the content creators responsible for the content and the programmers responsible for the programming. Enter stage left… use of a CMS for our new website.
After looking at a bunch of open source CMS apps (in PHP if you please) and also a handful of commercial CMS apps, I’ve come to the conclusion that CMS apps suck. ;-) No, really they do. Well, it’s not that they suck, it’s that you are never going to find one CMS that does every single thing that you want it to do. You’re just not. So give up now. I did.
So instead, putting my open source hat on, I tried to find the CMS that looked to be the most extensible or hackable. Drupal won this round hands down. There aren’t a lot of of examples out there about using Drupal for a fairly static corporate website, so I had to create some new modules to do things that I wanted but all in all the coding on the project went very quickly and we launched a successful site. I’ll be posting a few things that we learned along the way about using Drupal in this way in subsequent entries.
But for now, just know that we did keep the developers out of the content maintenance loop. And if you have any specific questions about the process, just holler.
5.25.2007
Yes you, Mr. ASP.NET developer can use a hosted open source Subversion source control for your projects also
For some reason, most .NET devs that I run into insist on using closed source applications for everything they do. I have no idea why. I guess it's a culture thing. That's why I love it when a mostly ASP.NET fellow starts using something open source, like Subversion source code control. All the tools are in place to do what you need, the TortoiseSVN windows explorer plug-in, the Ankh Visual Studio plug-in. It's all there.
Plus, I've really fallen in love with the concept of a hosted subversion solution. For me, I host my own at my provider. But for my side projects, its great to be able to access them from multiple computers. If I can get to the internet, I can get to my project code.
read more...
Plus, I've really fallen in love with the concept of a hosted subversion solution. For me, I host my own at my provider. But for my side projects, its great to be able to access them from multiple computers. If I can get to the internet, I can get to my project code.
11.11.2005
Form data validation in PHP and JavaScript
I'm mentoring a few folks at work in web app development, specifically PHP. Today, the subject of form data validation came up when I pointed out to them that their app had none. No matter what data I entered for name, email address, etc., that data went right into the database (or at least the insert was tried). It was hack city.
There are 3 different types of data validation checks one can do:
Syntactic validation is when you need to make sure that the syntax of incoming data is correct. For instance, if it's a "first name" field, you wouldn't expect numbers, ampersands or other strange characters in there. You'll have to strip out the garbage before you can put that name into the database, so you'd better make the user fix their data before you have to. Another common one I find is when trying to get telephone numbers, social security numbers, etc. You don't want any chars in there.
Syntactic validation also takes care of checking minimum and maximum lengths for fields. If a new user must have a username that's 5 or more characters, you would check that thru syntactic validation. Same thing for maxlengths. Syntactic validation is what's going on too with checking for required fields (ie, is the username field blank).
Another common use of syntactic validation on the web is for checking valid email addresses and urls. You need to make sure those email addresses folks are giving you are at least of the proper form so you can email them good marketing stuff later. You could also check to make sure that email address actually exists (this would fall under domain validation though).
Syntactic validation is the simplest form of validation. The beauty part of it is that you can do most syntactic checks in both JavaScript on the client-side and then again in PHP on the server side. This aspect of "double-checking" stumped my associates too until I mocked up a quick form on my own machine that posted junk values to their test app, causing all kinds of mysql errors. I've seen programmers that don't do validation on both the client-side and server-side, but those programmers are no longer working steadily.
Another form of data validation is Semantic validation. In semantic validation checks, you are checking to make sure that one piece of information makes sense in regards to other incoming information.
For example, when registering a new user, most web apps will place the password box twice to make sure the user enters their desired password correctly. Checking these two passwords to make sure they are the same would be an example of semantic validation. Another example of semantic validation is checking to make sure that a required field based off another field is actually filled in. So, if the user specifies the country as US, then they also have to specify a state in the US... otherwise, they don't have to specify a state.
Semantic validation rules can get very complex, very quickly. While it's easy to build up a library of reusable code of syntax validation rules, semantic validation rules often require some custom work on every form. Again, semantic validation rules are most effective when used on both the client-side and server-side.
The third kind of form data validation is Domain or model validation. Domain validation requires checking the incoming info against another source of acceptable values. This could be existing database records, a config file, or simply PHP code. This kind of validation is checking the "domain" or "model" to make sure this incoming info makes sense.
A great example of domain validation is when registering as a new user on a site. After passing all the syntactic and semantic checks for registering a new username and password on the site, the app has to check to make sure the username you are requesting isn't already taken. So, it queries the users table in the db to see if your requested username is there. If it is, then the app needs to alert you to what went wrong and give you another chance to suggest a username. So, our web app is checking your requested username against the domain of existing usernames in our system.
Other examples of domain validation include checking to make sure an article_id in a CMS exists before we edit/delete it. Domain validation is also used in many permission schemes in web apps (ie, you can perform this action if your user level is > 5 or something).
Domain validation will almost always need to be done on the server-side as that's where the domain or model usually resides. So, you can't do any domain validation in JavaScript (well, you could, but it would be the most insecure app in the world).
Now the trick with form data validation is that most of the checks you're doing on the data will be done over and over again in every web app created. So, you're best bet is to create some type of class to take care of all this for you. (more on this in future article).
read more...
There are 3 different types of data validation checks one can do:
- Syntactic validation
- Semantic validation
- Domain or model validation
Syntactic validation is when you need to make sure that the syntax of incoming data is correct. For instance, if it's a "first name" field, you wouldn't expect numbers, ampersands or other strange characters in there. You'll have to strip out the garbage before you can put that name into the database, so you'd better make the user fix their data before you have to. Another common one I find is when trying to get telephone numbers, social security numbers, etc. You don't want any chars in there.
Syntactic validation also takes care of checking minimum and maximum lengths for fields. If a new user must have a username that's 5 or more characters, you would check that thru syntactic validation. Same thing for maxlengths. Syntactic validation is what's going on too with checking for required fields (ie, is the username field blank).
Another common use of syntactic validation on the web is for checking valid email addresses and urls. You need to make sure those email addresses folks are giving you are at least of the proper form so you can email them good marketing stuff later. You could also check to make sure that email address actually exists (this would fall under domain validation though).
Syntactic validation is the simplest form of validation. The beauty part of it is that you can do most syntactic checks in both JavaScript on the client-side and then again in PHP on the server side. This aspect of "double-checking" stumped my associates too until I mocked up a quick form on my own machine that posted junk values to their test app, causing all kinds of mysql errors. I've seen programmers that don't do validation on both the client-side and server-side, but those programmers are no longer working steadily.
Another form of data validation is Semantic validation. In semantic validation checks, you are checking to make sure that one piece of information makes sense in regards to other incoming information.
For example, when registering a new user, most web apps will place the password box twice to make sure the user enters their desired password correctly. Checking these two passwords to make sure they are the same would be an example of semantic validation. Another example of semantic validation is checking to make sure that a required field based off another field is actually filled in. So, if the user specifies the country as US, then they also have to specify a state in the US... otherwise, they don't have to specify a state.
Semantic validation rules can get very complex, very quickly. While it's easy to build up a library of reusable code of syntax validation rules, semantic validation rules often require some custom work on every form. Again, semantic validation rules are most effective when used on both the client-side and server-side.
The third kind of form data validation is Domain or model validation. Domain validation requires checking the incoming info against another source of acceptable values. This could be existing database records, a config file, or simply PHP code. This kind of validation is checking the "domain" or "model" to make sure this incoming info makes sense.
A great example of domain validation is when registering as a new user on a site. After passing all the syntactic and semantic checks for registering a new username and password on the site, the app has to check to make sure the username you are requesting isn't already taken. So, it queries the users table in the db to see if your requested username is there. If it is, then the app needs to alert you to what went wrong and give you another chance to suggest a username. So, our web app is checking your requested username against the domain of existing usernames in our system.
Other examples of domain validation include checking to make sure an article_id in a CMS exists before we edit/delete it. Domain validation is also used in many permission schemes in web apps (ie, you can perform this action if your user level is > 5 or something).
Domain validation will almost always need to be done on the server-side as that's where the domain or model usually resides. So, you can't do any domain validation in JavaScript (well, you could, but it would be the most insecure app in the world).
Now the trick with form data validation is that most of the checks you're doing on the data will be done over and over again in every web app created. So, you're best bet is to create some type of class to take care of all this for you. (more on this in future article).
10.07.2005
Adobe Creative Suite, First impressions, Where are the Keyboard Shortcuts?
Just got Adobe CS 2 for some graphics work on the PC at home. I'll be the first to admit that programmers shouldn't do graphics, but there's an urgent need (and I also like to play) so there you go. So far, so good, everything is similar enough to previous versions of Adobe programs that I can be productive.
I can't remember any of the keyboard shortcuts though and it's driving me mad. For instance, in photoshop or illustrator, how do I fill with foreground or background color via keyboard shortcut? It's ctrl-something. No clue, can't find it in the help anywhere.
Also started working with Version Cue, the new version control system within Adobe. It's a memory hog, using about 128mb of memory while it's just sitting in the tray. I don't like that. But it does seem much more in tune to graphics work then using something like subversion or cvs for version control. The actual working of Cue is sort of similar to a normal version control system. With Cue, you can opt to "Save as Version" instead of "check in" a file. You have to make sure that Version Cue is running in the tray and that each Adobe program is set up in the preferences for working with Cue.
What is super annoying is that there doesn't seem to be any keyboard shortcut for "Save as Version" at all. There's a shortcut for every single option in the File menu except for "Save as Version." Anyone got any clues?
read more...
I can't remember any of the keyboard shortcuts though and it's driving me mad. For instance, in photoshop or illustrator, how do I fill with foreground or background color via keyboard shortcut? It's ctrl-something. No clue, can't find it in the help anywhere.
Also started working with Version Cue, the new version control system within Adobe. It's a memory hog, using about 128mb of memory while it's just sitting in the tray. I don't like that. But it does seem much more in tune to graphics work then using something like subversion or cvs for version control. The actual working of Cue is sort of similar to a normal version control system. With Cue, you can opt to "Save as Version" instead of "check in" a file. You have to make sure that Version Cue is running in the tray and that each Adobe program is set up in the preferences for working with Cue.
What is super annoying is that there doesn't seem to be any keyboard shortcut for "Save as Version" at all. There's a shortcut for every single option in the File menu except for "Save as Version." Anyone got any clues?
5.07.2005
Perl tutorials for HTML output?
I realize I've been pretty busy with my projects lately and haven't had that much time to check out all that's hip and happening in the world of web development... but... ummm... when did it become cool to develop web apps in Perl? Found this today... CGI::Application: A Simple, Extensible Web Framework
Why anyone would develop a web application in a language whose default output is not HTML remains a mystery to me. What year is this anyway?
Another recent find... Proof Positive Perl is Pushing up Petunias At least this fellow has it right. Someone with Perl as their primary language probably gets to watch a lot of daytime soaps (because they aren't working). Don't get me wrong, I love Perl, it was probably my first "modern" programming language. But let's leave 1998 in the past, shall we?
read more...
Why anyone would develop a web application in a language whose default output is not HTML remains a mystery to me. What year is this anyway?
Another recent find... Proof Positive Perl is Pushing up Petunias At least this fellow has it right. Someone with Perl as their primary language probably gets to watch a lot of daytime soaps (because they aren't working). Don't get me wrong, I love Perl, it was probably my first "modern" programming language. But let's leave 1998 in the past, shall we?
12.17.2004
.Net MVC framework for winforms and ASP ?
One of my biggest complaints so far with working on projects in .NET is the total lack of community projects. It seems every worthwhile-looking solution that is out there is spearheaded by Microsoft and slapped into its “patterns and practices” section. The problem I have with this of course is that if I choose any of these framework solutions to build upon, I wonder if MS will continue to support it moving forward. There are already a few of these solutions that have largely been abandoned.
My present needs have me creating a lightweight MVC framework for .NET. I need to have a system whereby I can create the core functionality one time and port the solution to either a desktop Winforms solution or an ASP.NET web-based solution. It seems to me that loads of people would want this same functionality. And yet, I haven’t been able to find an MVC framework that can do this except for the UIP Application block. Not only is that block created and supported by MS (strike one), but it is needlessly complicated (strike two). The user community surrounding it seems to also be non-existent (strike three).
There are a few MVC frameworks for ASP solutions on sourceforge and/or freshmeat but nothing with the ability to go from Winforms to ASP and back again. So, when I’m done with my own framework, I’ll probably open it up and slap it on sourceforge as a new project. Of course if I’m missing something in my search here, please drop me a line.
read more...
My present needs have me creating a lightweight MVC framework for .NET. I need to have a system whereby I can create the core functionality one time and port the solution to either a desktop Winforms solution or an ASP.NET web-based solution. It seems to me that loads of people would want this same functionality. And yet, I haven’t been able to find an MVC framework that can do this except for the UIP Application block. Not only is that block created and supported by MS (strike one), but it is needlessly complicated (strike two). The user community surrounding it seems to also be non-existent (strike three).
There are a few MVC frameworks for ASP solutions on sourceforge and/or freshmeat but nothing with the ability to go from Winforms to ASP and back again. So, when I’m done with my own framework, I’ll probably open it up and slap it on sourceforge as a new project. Of course if I’m missing something in my search here, please drop me a line.
Subscribe to:
Posts (Atom)