Posts

Showing posts from August, 2009

"I See Dead Code"

I've been working on a PHP project recently which has reached over 30,000 lines of code. The project has also undergone numerous requirement changes which have resulted in various bits being redesigned and reimplemented at different times in an iterative prototype development cycle. Needless to say, this has resulted in some dead code, i.e. functions which were originally used in an earlier prototype but commented out or left uncalled in various revisions.
Detecting these dead code blocks is not as easy as it may seem. The project is a mixture of PHP, HTML and JS using the Zend Framework as the MVC layer, YUI and jQuery for various AJAX-like functionality and a custom RESTful XML service layer with abstracted parameterized named queries stored in external SQL files.
The NetBeans refactoring tools (I use NetBeans as my PHP IDE) are not intelligent enough to be able to understand my project structure and mash-up of languages, design patterns and frameworks to be able to analyze my co…

Cloud Security Concerns

Image
I've recently blogged about the GPush iPhone application and how it requires users to entrust some faceless organisation with their GMail username and password. The problem with this is that a GMail account can be used for many other linked services, including Google Calendar, Google Docs, Blogger Blogs and so on. Or if you have a Google Apps account, you could be giving away your administrative password to Google Sites and other services linked to multiple domains and possibly multiple other accounts.
The issue with this is, can you really trust other third-parties with such valuable data? Even under the best intentions, it's possible for insiders to collect and sell off your information to the highest bidder, and a Google Apps administrator account to a large Google Cloud community could be worth a lot on the black market. GPush users are basically giving someone else full control to their cloud accounts, and paying a dollar to do so.
The concern is not with just GPush however…

GPush for iPhone Security Concerns

Tiverias Apps has recently released their GPush application on the iPhone App Store. GPush brings email push notification to iPhone users with GMail (or Google Apps Mail) accounts.
There are two main methods for receiving email on a phone. Using the standard method (often called poll or fetch), a user enters their email login credentials into their phone and sets a periodic update interval, say every 15 minutes. The phone then simply queries the users email server every 15 minutes and retrieves any new emails. Simple.
The alternative, i.e. push email, works the other way around. Instead of the phone querying the users email server every so often, the server simply sends emails directly to the users phone as they arrive. This is akin to SMS. Your phone doesn't poll the carrier base stations for new messages, the towers notify the phone whenever a new message arrives instead.
The problem with push emails is that most email servers typically don't have any connection to mobile carr…

Signs of a struggling system

Image
My Windows 7 Lenovo X300 laptop has recently started going into a hard disk trash state every half-hour or so. When this occurs, the hard disk activity light indicator is completely solid and the system is very unresponsive. The HD thrash period usually lasts around 10 to 20 seconds, but sometimes longer.
At first I thought it may be a problem with a wrongly configured services (disk defrag kicking in, or indexing, or virus scanning, etc.) but I've since turned all those off and the problem still occurs. Taking a look at the Task Manager Performance Tab and the Resource Monitor seems to suggest my system is running out of physical memory (2GB RAM).
Screenshots of these look as follows:



At first I didn't think it was a memory problem as the Task Manager still shows 223 MB as available (this never seems to go below 200), although 0MB free sounds troubling. The Resource Monitor disk activity tab shows the HD going into a spin with 100% utilization (see graphs), and the process respo…

The Definitive iPhone Killer

Firstly, sorry for the title. I realize that 'iPhone Killer' has been used to death and has lost all meaning, but it grabs attention and, well... a mobile phone article without 'iPhone' thrown in somewhere just isn't worth reading.So what phone am I talking about? TheSony Ericsson Xperia X3 (Rachael). Before getting into it, its important to note that this phone hasn't been officially announced or confirmed by Sony Ericsson yet, so for all we know it may be a big hoax, or it may get cancelled or altered in any way shape or form.The stats for the phone were leaked byExpansys, who have since taken the product page down, and looked a little something like this:·Quad-band GSM connectivity (850/900/1800/1900 MHz)·Dual-band 3G (900/2100 MHz) with HSDPA 10Mbps and HSUPA 2Mbps·4 inches touchscreen display with 800 x 400 pixels·Wi-Fi IEEE 802.11g·A-GPS·Bluetooth 2.1·3.5mm audio jack·E-mail (POP3, IMAP4, SMTP, MS Exchange)·MiniUSB·MicroSDHC card supportThispage also clai…

Yahoo YUI TabView IE Render Bug

There's a bug in the Yahoo YUI TabView 2.7.0 component that seems to affect Internet Explorer 6/7/8. In my experience, I had a TabView control with tables in each of the tab panels with borders on the tr elements. This caused a weird corruption where the tr borders from tables on non-active tabs appeared floating around in random places of the document, normally somewhere below the tab component.
This behavior appears to be related to this bug which I came across via this blog post. The blog post lists a whole bunch of CSS for stripping the YUI styling from TabView controls, but the interesting bit are the three lines at the bottom, namely:
/* YUI TabView 2.7.0 Bug Fix (#2527894) */
.yui-skin-sam .yui-navset .yui-content .yui-hidden,
.yui-skin-sam .yui-navset .yui-navset-top .yui-content .yui-hidden {
display: none;
}

Just put these in a style-sheet that overrides the YUI styles, or add it inline to the HTML page that uses the TabView control. This little hack solved my floating table …