Showing posts with label development. Show all posts
Showing posts with label development. Show all posts

Tuesday, September 23, 2008

Interesting Hosting Services

New hosting service that has api to allow you to programatically scale your application onto more nodes in the cloud as you see fit.

http://www.gogrid.com/

Monday, September 22, 2008

Safari doesn't like spacer gifs before consecutive floated unordered lists

The current version of Safari for PPC chips is 2.0.4 build 419.3 (and possibly previous versions) does not like having <img tags followed by consecutive <ul tags. The behavior is strange it actualy will display the first and last of the consectutive <ul tags correctly but any that are in between them get floated to the top left of the <div containing them.

Check it out:

<DIV xmlns:exsl="http://exslt.org/common" xmlns:isutil="com.infusedsolutions.template.xsl" id="related_content">
<IMG border="0" height="1" width="1" alt="Related Content" src="/staticfiles/NGS/NGKids/SiteAssets/img/spacer.gif">
<UL>
<LI class="cat_name">Activity</LI>
<LI>
<A href="/Activities/Recipes/Treat-your-pet">
<IMG border="0" height="50" width="75" alt="Illustration shows a cartoon boy rolling out dough while a cartoon cat watches." src="/staticfiles/NGS/Shared/StaticFiles/NGKids/Image/treatyourpet-NGK1298-mi.jpg">
</A>
<A href="/Activities/Recipes/Treat-your-pet">Treat Your Pet</A>
</LI>
<LI>
<A href="/Activities/PhotoFillins/Photomusicaldog?vgnextfmt=alternate">
<IMG border="0" height="50" width="75" alt="What's the dog thinking?" src="/staticfiles">
</A>
<A href="/Activities/PhotoFillins/Photomusicaldog?vgnextfmt=alternate">Photo Fill-Ins: Musical Dog</A>
</LI>
</UL>
<UL>
<LI class="cat_name">          Stories        </LI>
<LI>
<A href="/Stories/AnimalsNature/Balloonpoppingdog">
<IMG border="0" height="50" width="75" alt="Anastasia is a balloon-popping dog!" src="/staticfiles/NGS/Shared/StaticFiles/NGKids/Image/balloon-dog-mi.jpg">
</A>
<A href="/Stories/AnimalsNature/Balloonpoppingdog">Balloon-Popping Dog: Anastasia, Jack Russell Terrier</A>
</LI>
</UL>
<UL>
<LI class="cat_name">            Related Web Links        </LI>
<LI>
<A target="_blank" href="http://www.dogpsychologycenter.com">Dog Whisperer Cesar Millan Dog Psychology Center</A>
</LI>
<LI>
<A target="_blank" href="http://www9.nationalgeographic.com/channel/dogwhisperer/index.html">Dog Whisperer Web Site</A>
</LI>
<LI>
<A target="_blank" href="http://www9.nationalgeographic.com/channel/dogwhisperer/video_preview_1.html">Dog Whisperer Videos</A>
</LI>
</UL>
</DIV>



php based ORMs

Doctrine (available as symfony plugin)
Propell (currently used by symfony)
adodb_active_record:
http://phplens.com/lens/adodb/docs-active-record.htm


Best SVN folder structures

for a project that has no sub projects:
/path/to/repos/projectname/trunk
/path/to/repos/projectname/tags
/path/to/repos/projectname/branches

for a project with multiple sub projects:
/path/to/repos/projectname/trunk/subprojectname1
/path/to/repos/projectname/trunk/subprojectname2

I am not sure that it is completely necessary to have the subprojectname folders under both tags and branches however.

nice folder structure for virtual hosts and subdomains under neath them

the vhosts are held in the vhosts folder of your primary repository of web sites (aka /var/www, /usr/local/apache2/htdocs, ~Home/Sites, etc.)

/path/to/www/vhosts/vhostname.com/httpdocs
/path/to/www/vhosts/vhostname.com/httpsdocs
/path/to/www/vhosts/vhostname.com/cgi-bin

the subdomains are located in a subdomains folder of the original vhost:
/path/to/www/vhosts/vhostname.com/subdomains/subdomainname/httpdocs
/path/to/www/vhosts/vhostname.com/subdomains/subdomainname/httpsdocs
/path/to/www/vhosts/vhostname.com/subdomains/subdomainname/cgi-bin

creating new svn repos and adding new project

Start by using svnadmin to create the repository somwhere that make sense. Most times if your just putting it on your workstation you should just put it in your home directory. If you want other users to have access to the repository put it somewhere globally accessible like /usr/local/subversion/repos

$ svnadmin create /usr/local/subversion/repos

then once the repository has been created you will want to add your current project to it.

go into the directory that holds the files you want to put into the repository.

$ cd /path/to/project/directory

then import the files into the repository making sure to use a similar path structure like below including the projectname and trunk and possibly a subproject name if your project has multiple subprojects. If not you can omit that part.

$ svn import ./ file:///usr/local/subversion/repos/projectname/trunk/subprojectname -m 'Initial import of projectname subprojectname'

now that that has been done you still need to get a working copy of the files on your local machine so delete all the files in the current directory.

$ svn checkout file:///usr/local/subversion/repos/projectname/trunk/subprojectname -m 'Initial import of projectname subprojectname'

now you will have a copy of all of the files you imported recreated within the folder you just deleted them from but this time their versions will be tracked and you can do things like:

svn status (to check what you have changed in your working copy)

svn update (to get all new files from the repository)

svn add filename (to add new files into the repository)

svn commit (to update the repository with all the changes from your working copy)

Install and setup mysql 5 with ports

MySql 5 Server
sudo port install mysql5 +server
sudo chown -R mysql:mysql /opt/local/var/db/mysql5
sudo -u mysql /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql
ln -s /opt/local/var/run/mysql5/mysqld.sock /tmp/mysql.sock

Ruby’s gems installation
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-include=/opt/local/include/mysql5 --with-mysql-lib=/opt/local/lib/mysql5 --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config

Start MySql server
sudo -u mysql /opt/local/lib/mysql5/bin/mysqld_safe &

Stop MySql server
/opt/local/bin/mysqladmin5 -u root shutdown

It’s a good idea to create alias for you, here’s mine:

alias mysql_start='sudo -u mysql /opt/local/bin/mysqld_safe5 &'
alias mysql_stop='/opt/local/bin/mysqladmin5 -u root shutdown'

And remeber: mysql.socks lives on /opt/local/var/run/mysql5 as mysqld.socks
/opt/local/var/run/mysql5/mysqld.sock