Monthly Archive for October, 2006

PHP Performance Problems in Ubuntu Firefox

I think I have a performance problem with PHP and Javascript in Firefox running on my Ubuntu computer. I just recently reinstalled Ubuntu and got the 64-bit version to work (after fixing the video driver problem) and the speed difference is amazing!  I never thought I’d see such an increase in loading times. But I run a few blogs and two photo galleries on my host, DreamHost - which, by the way, did work out their performance issues and things are way better than they used to be. But I still think there is something going on and I think its my choice of browser/OS.

I first noticed in on my photo site. I have a Gallery2 for my pictures and the theme I installed uses AJAX to load pictures that you click on to view (you know, the full size pictures - not the thumbnails). On my Ubuntu/Firefox setup, the picture would not load when you clicked on it for the first time. On a refresh, however, the picture drew very fast - the way I expect it to. Then I asked a friend to log on to the site and tell me how his performance was. Perfect - and he runs Vista RC1 (or 2) with Firefox 1.5.7. Then, on a hunch, I broke out my laptop, fired up The Fox and went to my site. PERFECT! My only conclusion was it must be a combination of my OS or the build of Firefox.

Thinking it could be the OS, I went to my wife’s Mac where she has Firefox 1.5.5 installed. Same problem. I had to refresh the page just to see the image. Now I thought it was the browser but wondered why it happened on all but my Windows computer. Could it be that because OS X is based on Linux/Unix that was the problem. I tried updating my Java code from Sun’s website but I only find the JRE.

Its not a hardware issue. Like I said, my Ubuntu PC suffers from this performance issue. So does my wife’s Mac. But my laptop doesn’t. And my Windows latop is a POS by today’s standards. Its a 1.6Ghz processor - single core and one of the first Centrino based setups by IBM/Lenovo. It has 512MB of RAM (like my wife’s Mac running OS X 10.4.7) but minuscule to the 4GB I have on my AMD X64 2 box that is suffering from this problem. I’ve maxed out the hardware on my Ubuntu PC and there isn’t anything faster.  The connection isn’t a problem either because the laptop is using WiFi and the others are hard wired.

I don’t even know for sure if its a Javascript issue.  It could be a PHP problem or even a MySQL thing but the site’s performance has been great all things considering.  I can see it in the site reports I have generated; the response time has improved by 200%.  I also see this issue with the new K2 theme which has that AJAX scroller thing for past posts.  Since AJAX is just Javascript, it doesn’t appear anything other than that kind of performance issue.

But I don’t know how to track down the core problem or how to fix it.  Anyone out there have an idea on how to make things faster?

P.A.D. - Post #2: Color Tools

This one has to be quick.  I’ve got lots of work to do today.

I’m changing the theme again because I want to add a little more color to the site - make it more energetic.  I still want to keep it light and image free so I downloaded K2 and installed it.  So far, it looks ok but it looks like every other K2 theme out there.  I’ve got to come up with a new color scheme for it and then, I think, it will look good.  To do that, I’m using two sites that help web developers get the right color combos.

The first one is an old favorite of mine and it’s a free offering from VisiBone called Color Lab.  VisiBone sells ‘cheat sheets’ for HTML, CSS, javascript, fonts, and other website related topics so when coding, one doesn’t always have to look at a large book or toggle between windows to find information.  And while I haven’t purchased their books or cards (but tempted to), I have used their free tool.  That tool shows you a 216 color pallet that displays the hex, RGB, and CMKY values for any color you select.  As you select other colors, it shows how the previous color looks next to the newly selected color and you can view up to 8 color sections at any one time.  You also see how each color would look as a background and foreground color so you can pick 8 colors and see how they look as text, links, hovers, background, and headers together.  You can do all this without even having to code yourself - it takes the trial and error out of the color selection process.

The other site I am using is the Color Palette Generator from DeGraeve.com.  Steve DeGraeve has created a wonderful set of tools that anyone can use.  There are too many to list but check them out here.  The palette generator, however, lets you take an image on the web and create hex values of the colors in that image.  If you like a company logo, for example, point to it and let his code tell you what the colors’ hex translations are.  I’m tempted to take some color swatches from Home Depot, scanning them in and posting them to this site and use Steve’s tool to do its thing.  I’m even thinking of taking screen shots of other websites and using those colors for inspiration.

Ultimately, I’m not sure what I’ll do color wise, but these two websites are going to help me.  If you are into HTML, CSS, and design.  These two offerings may help you pick the right colors.

P.A.D. - Post #1: Google Reader

Today I’m switching my RSS reader from Bloglines to Google Reader. Google recently upgraded their reader and just about everyone agrees that it was changed for the better. I, for one, agree that it has changed for the better but I also think it can get better still. Mostly through user preferences, however, and not so much in the most raw or basic functionality. I’m not as happy with Google Reader as I am with Bloglines but I like it enough to use it for all my RSS reading.

Bloglines is great. it has a great interface with the feeds you watch & read on the left with the articles on the right. It looks like a Windows Explorer interface if it were able to handle RSS feeds - folders on the left, folder contents on the right. And that’s what I like about Bloglines. if you organize your feeds into categories, like I do, you can easily navigate to a particular subject or feed very easily; it makes reading 110 feeds more manageable than just a simple list. If I wanted, I could navigate to the main topic area - say, technology - and read all my tech blogs like Engadget, DownloadSquad, TUAW, Slashdot, and the other 36 sites that cover that general subject. Of course, I can also navigate to a particular blog or feed and read it only. It comes in handy when you want to review a feed with rapidly changing entries like Ask MetaFilter. Bloglines has made improvements to itself which make getting updates easier but its an already robust web application.

Google Reader, however, is not a mature application and, admittedly so, it lacks some of the refinements that Bloglines has. Its first version was openly criticized and almost no one that I spoke to used it. But with the recent upgrade, people are beginning to switch to it - and with good reason. Not only does it address the concerns people had with it before, it offers functionality that many other services - Bloglines included - do not, and it makes the reading even easier still.

Like Bloglines, Google Reader has a folder like view but uses tags or labels as its way of separating the feeds from one another - their version of folders, really. And like the others, Google Reader lets you select from all your feeds, a folder, or a specific feed in the folders to read. It displays the first 20 or so unread articles and as you scroll down, it loads new ones; you never have to wait for the entire feed to load like you do with Bloglines. But Google Reader has some features that make it much easier to use which is why I’m switching.

First, it shares the familiar interface of Gmail and Calendar and, now, Docs & Spreadsheets. The shared select all or none is there with the filter by tag option helping out. And with those features, changing folders is a breeze. Bloglines lets you drag and drop - a very cool GUI based tool - but sometimes less is more and I can get a lot more changes made by using less flashy means. Also like Google’s other offerings is the seamless navigation between your feeds and the settings. Adjusting your preferences is fast that way and makes quick adjustments even more hassle free. The familiar DHTML/AJAX/Fancy Google code makes this all possible and you can see the lessons from Google Maps, Gmail, and other GOOG products materialize here.

Another reason I’m switching is the ways you can view your feeds. You can select the traditional interface with the articles fully expanded on the right or you can use a Gmail like interface with the unread articles in a list. In place of the author is the feed’s title and the subject is the title of the blog entry. And like Gmail, the first few words of the posts appear as conversation snippits that help you determine the importance of reading an article. If you click on the double arrows on the very right, you are taken to the post right off the site (useful for those feeds that don’t offer you the full article). If you click on the blog or article title, the entire article shows up and you can read that single post without others cluttering up your view. While Bloglines lets you customize how you view your feeds, you can’t change it on the fly like you can with Google Reader.

I do wish somethings were different about Google Reader that I like about Bloglines. For example, I like it how Bloglines asks you want folder you want to put new feeds into. With Google, its a two step process and you first have to subscribe to the feed and then add the tag to it later.

I also wish that the sorting options were better. I happen to like chronology as a sorting method like all the others do but I also want it sorted by feed title first. That way, I’m not flipping subject matter within a category. In my technology folder, I have different feeds for Apple, AJAX, gadgets, software, and tech commentary; with Google’s sorting system, all the feeds are listing in the order in which they were posted - no matter what site they came from. That means I’m reading a post on an iPod and then an article on JavaScript only to go back to an older iPod article.

I also wish there was a search feature or a history feature. With Bloglines, I can search for a post and I can go back in time with my session or a specific calendar period for all articles. If I forget to tag an article with del.icio.us, I can always use Bloglines to search for it again - very useful when you don’t know what feed the entry came from. I’m surprised Google hasn’t added that since they offer that feature with Gmail. If they had that search, I would have no reason to look at Bloglines again.

Generally, though, I like the latest version of Google’s RSS aggregator. And they recently made it a goal for their programmers to make their existing products better instead of launching new products for the sake of launching them. Even after the recent update, there was another minor update again based on some feedback in the forum they set up. If they continue to innovate like that I’ll be singing the praise of Google Reader for months to come.

Post A Day for 30 Days

I’ve been inspired by app a day blogger/coder Dana Hanna a.k.a the Software Jedi and will write one post a day for 30 days starting tomorrow.  I could count this day and this post as one but I won’t cheap out like that.

I’ve written about how I want to write more.  I’ve also talked about how I want to get into a good business school and writing skills are a part of that.  So I thought that I could use the post-a-day program as a way to help me prepare for the day I take the GMAT and make me a better writer in the process.

The GMAT is made up of three sections: essay, English/verbal, and math.  The math is pretty straight forward.  They give you a few different types of problems from calc, geometry, and algebra and gauge how well you are at those objective questions.  Like most multiple choice questions, its just as much a matter of picking out the obviously wrong answers as it is knowing how to get the right ones.

The verbal section is also multiple choice.  It, too, can be whittled down to what are the wrong ones and what could be the right ones with the foundations you should have to help figure the answer out from there.

The essay portion - which comes first I’m told - is still done on a computer just like the adaptive multiple choice questions.  But the grading is very subjective and also weighed by the computer with grammar and spelling going into that curve.  A person must construct an argument well in addition to the sentence structure to get a good score.  And its this part of the test for which I need practice.

Like I said earlier, multiple choice is half knowing how to get the right answer and half knowing what the obvious wrong answers are. It gives me an advantage over the 20 to 25% chance one normally has in getting a question correct.  If you can eliminate half of the four possibilities, you’ve increased the likelihood of getting the question correct considerably: to 50%.  Still not great when you are taking a test like this but 50% chance is better than a 25% chance.  Hell, a 33% chance is better than what you are handed.

And I’m confident that once I reach that 50% mark, I can learn how to get the correct answer 80% of the time (or better).  Its just a matter of understanding why the answer is the way it is and categorizing it into a question type so it can be identified later when the actual test is taken.

Of the multiple choice sections, the math test will be the hardest for me.  I struggled to get understand even the basic algebra when I was in high school and only understood calculus my senior of high school when most kids were at AP calc or, at the least, calc 2.  In college, I did almost as bad and only begun to master the advanced calc 2 concepts in my senior year when it was my only hard course (the easy courses being law, computer programming, database design and management, and operational management (Statistics 3).  Re-learning those fundamentals will be my biggest challenge.

The other day, I stopped into a book store and looked at their test prep books.  While they didn’t have the one I wanted, I looked at the advanced version and did a few practice questions.  If I was confident in myself, I would have gotten 3 out of 4 correct.  Because I doubted myself, I only got 2 right - not great - but if I can get 75% of the hard ones correct without practicing much, I can get even more correct with my studies.  On the math section, however, I got only one correct answer if I was confident in my choice.  Because I wasn’t, I got no right answer.

So the lesson here is: be confident and practice.  I’ve been reading prep books and will soon begin the practice problems included in the “regular” version.  When I’m done with it, I’ll buy the advanced book and revisit those questions.  And as long as I keep writing, I’ll get my practice for the essay part and, hopefully, do very well on the GMAT.  The goal is to reach for 750 but to accept a 700 or better.  650 is a good score too and I’ll be happy with it but won’t feel like I reached my full potential otherwise.

Writly So

Google Just updated Writly and completely merged it with its spreadsheet application calling the collaborative efforts Google Docs & Spreadsheets. I have to say that I miss the old Writly interface but I’ll give Google the benefit of the doubt. Although if they change the interface to YouTube, I’ll definitely be upset. For some reason, though, Docs & Spreadsheets doesn’t roll as well as Google Spreadsheets or Writly did. Oh well…. that’s progress for you.