A blog on IT, PHP, ASP.NET, MVC Frameworks, Shopping Carts, IDEs, etc

Welcome to my blog on PHP, ASP.NET, MVC Frameworks, Shopping Carts, IDEs and IT in General. Recently I have spent quite a lot of time research many IT related topics and often couldn't find all the info I was looking for in one place, so I decided to finally create a blog to aggregate and share the info to make other people's research a little bit easier (and add my 2c worth of course).

Google Analytics reports wrong / incorrect statistics data

July 13th, 2010 No comments

WOW… I just did some comparisons between what Google Analytics reports in terms of traffic as well as e-commerce sales numbers and Google Analytics is just terrible.  One would think it’s the best thing since sliced bread as it gives you all these ways to look at data, but when both the traffic and sales are out by HUGE numbers, you really change your mind.  I really don’t know how on earth I would ever trust Google Analytics again when the difference is like 25% (and I’m talking sales here).  That’s an absolutely massive difference and throws out your ratios completely.  My recommendation for anyone considering using Google Analytics is DONT, unless you’re ok with completely wrong data being presented and you making decisions based on this data. If you want proper analysis you should use some tool that analyses your server logs, not a javascript based tool.

Categories: Analytics Tags:

Gigabit Ethernet vs USB 2.0 Transfer Speed Performance

June 14th, 2010 43 comments

I’ve tried finding a comparison of Gigabit Ethernet vs USB 2.0 transfer speed performance on the internet but couldn’t find anything useful as everyone compared theoretical speeds rather than actual speeds saying that Gigabit is faster.  I didn’t believe that as actual and theoretical transfer speeds are two different things.  I did the testing myself on an SBS 2008 server with a powered external Seagate USB 2.0 3.5″ 1.5TB drive plugged into the server and compared that with a Gigabit ethernet Thecus NAS and copied 5GB files from both USB and the gigabit ethernet NAS onto the server.  It’s also worth noting that the NAS is connected to the server via Cat6e cable via a quality Netgear Gigabit Ethernet Switch (with separate buffers on each channel, etc), and Both the NAS and the server have dual gigabit cards configured to run in a loadbalanced arrangement.  The result I got was 2:45 for USB 2.0 external hard drive and 3:45 for the Gigabit Ethernet NAS.  This was done on the weekend too, so there was no other load on the network.  So even though in theory Gigabit Ethernet should be faster, in practice USB 2.0 is actually faster.  So if you’re trying to work out whether to do backups to a NAS connected via gigabit lan or an external USB 2.0 drive then if performance is your main consideration the USB 2.0 drive should actually be faster.  It’s also worth noting that 2.5″ USB 2.0 drive that draw their power from USB 2.0 actually seem to run a fair bit slower than the powered USB drive.

Categories: SBS2008 Tags:

EventID 10009 DCOM Error on SBS 2008 with NAS

June 9th, 2010 2 comments

It’s pretty common to connect SAMBA based NASes and other devices to an SBS 2008 network.  For example in our case we’ve got a Thecus NAS, but I’ve heard of other people trying to connect Netgear ReadyNAS, QNAP NAS and other NAS servers.  It’s also pretty common to need to join these devices to the SBS 2008 Domain, which results in these items getting created in Active Directory.  The problem however that this generates is that the Event Log / Event Viewer gets flooded with EventID 10009 DCOM Errors saying DCOM was unable to communicate with the computer <computer> using any of the configured protocols.

I’ve searched far and wide for the solution and still havn’t been able to find anything official.  The best I came across was DCOM 10009 errors on SBS2008 with NAS.  I tried doing that by deleting the computer record in AD and then creating a new record as pre Windows 2000 computer.  I should also mention that I have these records in a separate OU under MyBusiness/Computers.  After deleting and re-creating these records I had to re-join the devices to the domain.  It looked like the issue was fixed, but then I checked the log again and it seems I’m still getting the DCOM 10009 errors, so not really sure what else to do.  Either way, this is the only reasonable solution that might actually fix it for you, and if you don’t re-join the device to the domain after deleting and re-creating the device in AD, then you might not be able to authenticate with the device at all.  Hope this helps.

Categories: SBS2008 Tags:

Yii DAO vs Active Record Performance

May 29th, 2010 10 comments

I’m writing a new app using Yii Framework, but one of my concerns with Yii has been the impact of using ActiveRecord and ORM on the application performance, so I decided to actually compare how the two perform and the results are quite interesting…

Read more…

Categories: PHP MVC Frameworks Tags:

Codeigniter Template Layouts

May 28th, 2010 4 comments

All I have to say is WOW… I decided to give CodeIgniter a try as it’s a pretty light weight library and doesn’t try to force you into using ActiveRecord, but guess what?  There isn’t a built-in template layout concept so you can add a consistent header and footer and that’s like the most common thing anyone will do with a website.

Read more…

Categories: PHP MVC Frameworks Tags:

Object Oriented Design Pattern for Database Driven Applications

May 27th, 2010 1 comment

I’ve been working with database driven applications and object oriented programming for a while now and every time I try to marry up the two patterns I cringe.  Many people seem to love ActiveRecord pattern but it has many shortcomings in that it can only deal with very simple applications and everything is in one place.  Likewise DataMapper at the other extreme is quite complex and you end up doing a lot of shuffling of data in the application.  However what’s even worse is that in complex database driven applications you often want to do things like retrieve results which can span multiple tables and you only need to take a little bit of data from each table.  A good example of this is an Order that was placed by a Customer who belongs to an Account.  With a full object oriented domain model you’d have the following options none of which are great…

Read more…

Categories: Programming Tags:

Writing a Fast PHP MVC Framework – Part 1

May 26th, 2010 8 comments

Well, after tossing and turning and considering using Yii and CodeIgniter, I’ve decided to bite the bullet and write my own fast PHP MVC Framework, that’s not bloated with features or compatibility layers I don’t want and takes advantage of PHP5.  Why re-invent the wheel you ask?  Because in my view what’s current out there is bloated and not quite what I want and most importantly ultimately impacts performance, which I very much about.  This framework that I’m writing is going to focus on speed and keeping ways to do something to an absolute minimum and do only what’s required.  For example, Yii is hell-bent on using ActiveRecord for everything and if you look at the code for active record with it’s built in ORM it’s like 2000 lines of code to generate SQL that you can write yourself just as easily.  With or without opcode caching lots and lots of code, lots and lots of files and all the un-necessary logic is still going to slow things down.  In CI’s care it’s nice and all, but it doesn’t play nicely with PHP IDEs atm so you better know the classes and methods pretty well.  Also, I can’t say I see the reason for doing things like defining file extentions (i.e. .php) as a constant, implementing fancy stuff like :any in the router and so on… just un-necessary logic… but as I said the biggest issue is not playing nice with PHP IDEs like NetBeans and Eclipse PDT.  The closest thing I’ve found to what I like has been what Daniel’s implemented in OpenCart which is somewhat based on PHP Pro MVC tutorial.  So to get started…

Read more…

Categories: PHP MVC Frameworks Tags:

Object Oriented Design for Database Centric Applications

April 27th, 2010 2 comments

I’m writing a few fairly complex apps which are heavily data centric and I seem to be struggling to choose how to best implement such applications.  What I mean by data-centric is that data stored in the database is core to the application and most of the application has to do with working with the database, while the logic tends to be relatively simple.  So what’s the best way to do it…

Read more…

Categories: Programming Tags:

ORM vs Code Generation

April 25th, 2010 4 comments

It seems no matter where you look these days everyone is using ORMs.  Every PHP Framework you look at has an ORM and it seems the preferred way to access data and .NET also now has LinqToSql and LinqToEntities which are both just ORMs.

I look at all these ORMs and read about problems with them where they don’t generate some SQL correctly, require you to learn a new language that tries to wrap SQL but doesn’t have the same power and it really makes me sad.  People have just no idea… They are prepared to trade off control and performance for some new concept that doesn’t really add anything good.  The productivity isn’t really increased all that much and you don’t really cut down on code all that much either if you are using code generation.

Now, code generation on the other is sooo much better and I’m really surprised that it hasn’t made it into all the frameworks and environments.  Code generation takes the mundane work out of initially creating lots and lots of similar code for the likes of CRUD operations but then you can quite easily modify it as needed.  Also people have built great big libraries like NetTiers that are based on code generation, but ultimately even those aren’t really needed.  The beauty of code generation is that you can generate really lean code and hence don’t really need all the compexity.

Ultimately I think serious developers will end up going back to good old SQL and code generation after this latest ORM fad is over.  If you want to write less code then just use a code generator, not some black box that does takes up CPU cycles and spits out SQL that isn’t guaranteed to be right.

Categories: PHP MVC Frameworks Tags:

Designing a PHP MVC Framework – Part 1

April 25th, 2010 5 comments

In Choosing a PHP MVC Framwork - Part 1 I discussed what I feel is needed from a good PHP MVC Framework and Choosing a PHP MVC Framework - Part 2 I outlined my reasons for why I think many of the existing PHP MVC Frameworks aren’t well suited to my needs (and hence presumably to the needs of many others developing website in PHP).  In Designing a PHP MVC Framework series of posts I will be going through designing a PHP MVC Framework that is suitable to my needs and share my progress.  Hopefully, the end result will be something that I will be able to share with everyone in good old open-source spirit.

Read more…

Categories: Uncategorized Tags: