Well, we came up with the new name and the teaser page is up. Have fun. ThreadBound.com I’ll make a logo soon as Alpaca gets back from Canada. Fill out the form if you want updates.
Archive for the ‘PHP’ Category
ThreadBound.com
Monday, August 7th, 2006Myspace theming without the ads
Wednesday, August 2nd, 2006Okay, I’m going to make it very clear before I even write the rest of this. I am not a fan of myspace.com. In fact, I think it is the sludgepit of the internet. So no that we’ve made that clear…
So we’ve all seen the disasters of pages created by millions of teenagers (like myself :/ ), that are impossible to read or even look at without giving yourself a seizure. To top all of that off, they have annoying flash ads that even talk without a mute button. So, today I set out to get rid of them and create my own, special, page.
First off, here is a screenshot for you to drool over:
So to start, the first thing I did was see if I could escape the tables. Once I did this, I knew I could get rid of the ads and every other piece of junk I could. So in the About Me section, I had the following:
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</table>
This allowed me to get out of the table-hell layout that is myspace.com, but I had to do one thing to make it not display the rest of the page. I had to reopen the tables. Code is below:
<table>
<tbody>
<tr><td>
Knowing this, I just added the CSS/HTML and images that can be found in the zip below to the About Me section.
Click here to download the zip file.
Click here to see the myspace live.
I hope that helps some of you.
NOTE: This *WILL* violate your agreement to the Myspace.com Terms of Service. Until they allow the iframe, we have no way to show their ads.
Current Ideas
Saturday, May 20th, 2006So today I did some more research for my new site. I into memcached and XMPP. You have to admit, for as much as the LiveJournal site is put down in the technology area on the web, they have some really cool technologies that were developed behind the scenes, memcached being one of them. Many people don’t even realise this, but memcached alone is used by many really large sites, such as sourceforge.net and slashdot.org. I will be using it in my new site as well, if things go as planned. (I haven’t messed with it on BSD yet)
XMPP is the really nice XML based protocol that Jabber uses. Not only does it allow secure remote logins, but it can be used from all over the place. To top that off, the actual XMPP or Jabberd doesn’t have to be open to the public pool, how Gtalk was when it first came out.
I REALLY like this protocal and I’m trying to find a nice implementation to play with. If I don’t find one, I will probably strip the JayantHTTPD code base and start reading the RFC for the protocol. Hopefully, I can get a server up and mod it to do authentication from a local database.
Either way, I’ll be playing with it from the web. My new site needs global accounts that can be accessed from around the internet, similar to OpenID. If I can keep this method fast and simple to work with, I’ll be extremely happy.
Oh, and in other news, I have a work-in-progress mockup of the new design for this slum. See it here. Let me know what you think!
High Traffic Web Development
Sunday, April 16th, 2006Over the past week and a half, I have been in the process of reading up on developing for high traffic sites. It is very interesting that it only requires small optimizations here and there.
One thing I’ve found in common with all large sites and that should be pretty obvious, is a PHP compiler cache and some type of caching system. Some of the more popular ones are APC, Bware Afterburner, Turck MMCache, and the Zend Accelerator. PHP caching systems are easy to write and can speed up template calls a ton.
You can speed up your site by using output buffering. What this does is use writev() instead of write(). The write() calls were sent to apache as 4kb buffers, where as the writev() calls aren’t.
Another speed up can be accomplished by setting Apache’s SendBufferSize to PageSize. This allows the page to be handed over to the kernel, to be sent, without blocking.
To reduce bandwidth, you may want to look into gzipping the contents of your page. I have seen this shrink 80gb backups down by almost a third the size, except for when most of the contents were images. So you should gain a lot for this if you can afford the overhead of the operations to compress your data.
There are also some simple thinks you can do to speed up your code. To speed up database calls, only query for that data you need. No need to SELECT * when you only need to SELECT id. You should also only query a table once. Get the data you need from it and store it, don’t query it again.
If you are using PHP5 or higher, you may also want to use MySQLi. This new MySQL API is much faster than the old API and includes both a functional and OOP interface. Most applications can be easily converted to use it. Plus, you get support for prepared statements and bind statements.
Optimization can also be made during the design of your database. Make sure you realize the differences between MyISAM and the InnoDB storage engines. MyISAM is very efficient for either very high volume writes or reads, but has table level locking. InnoDB has non-locking reads and row level updates, plus high concurrency.
You may also want to cache query results if they are not expected to update as often. An example I often use for this is CMS systems. Why query all of the blocks you want on one page, when you can cache the results of the original query for 6 hours and have them quickly accessible? Plus, if the owner of the site changes them, just clear the cache…
Now, back to what I’ve been up to. Besides reading up on the above, I have also been messing with my new project for the last two weeks straight. It is amazing how many hacks IE5-IE6 requires. I know I’ve used at least four to get my new site to display correctly. While the thing worked in Firefox, Safari, Epiphany, Konqeror, Opera, and IE7 the _whole_ time.
I hope most people will like the design though. I have shown it to around 20 people on IRC, and only one person hasn’t liked it a lot. So I would say I’ve done pretty good considering this was the first site I had designed entirely in Photoshop and then converted it to CSS/XHTML by hand. The core work for this new project starts this week and will probably continue for the next few months to a year.
Reference for high volume PHP: http://www.oreillynet.com/onlamp/blog/2006/04/digg_phps_scalability_and_perf.html
How do I roll? I roll with PHP/6.0.0-dev.
Thursday, March 23rd, 2006I’ve had one insanely sweet idea for a website last Sunday. So after I got home today, I worked on building a php6 installed. I must say it’s not easy. I could not get the direct cvs checkout to compile correctly. It seems to me that flex and yacc weren’t generating the parser and I didn’t feel like fixing.
So I headed on over to snaps.php.net and downloaded a prebuilt cvs export. After installing at least 15 libabc-dev packages via apt-get, I was ready to build. So I started it and saw something about ICU. Well it turns out, the Ubuntu package isn’t up-to-date enough. PHP 6 requires ICU 3.4+. So I had to compile all 8.5mb of that code. Make sure that you run ./configure like this on ICU (according to the one thing I found on google about it, let me know if it works differently) ./configure –prefix=/usr/local/ –disable-threads
Here is what I build my PHP 6.0.0/dev install with:
./configure –program-suffix=6 –with-apxs2=/usr/local/apache2/bin/apxs –enable-openssl –with-zlib –enable-bcmath –with-bz2 –enable-calender –with-curlwrappers –enable-dba –with-inifile –with-flatfile –enable-exif –enable-ftp –with-gd –with-gettext –enable-mbstring –with-mcrypt –with-mhash –with-mime-magic –with-mysql –with-mysqli –with-unixODBC=/usr/ –with-readline –with-mm –enable-soap –enable-sockets –enable-sysvshm –with-tidy –with-xsl –with-icu-dur=/usr/local –disable-mbregex
Now, I’m off to mess with my long wanted namespaces in PHP.

