FreelancePHP

6Jul/110

Employer Morality

Posted by Mark Evans

Something I have been pondering over the last few days whilst studying a course on management is where in the hierarchy of needs does the morality of ones employer fit.

For those who haven't heard of the hierarchy of needs, this was a theory proposed in the 1940's by a social psychologist called Abraham Maslow. This theory revolves around the idea that the behaviour of all human beings revolves around 5 basic innate needs and wants. These are:

  1. Physical Needs - Food, Warmth, Shade, Shelter etc
  2. Security Needs - Regular food, Warmth, Shade, Shelter etc
  3. Social Needs - Being part of a team, Social events etc
  4. Recognition Needs - Increased responsilbity and status
  5. Self-Fulfilment needs - Personal Interests, Challenges

With some of the stories running in the press recently (NoTW I am looking at you) I started to wonder where about the need for an employer to "appear" moral would fit in the above pyramid.

My initial thoughts are that it would come under the social need, as who would want to be known to work for a company who did some pretty despicable things, I then pondered recognition as that is linked to status, which I am sure Andy Coulson would understand is very linked to the morality of ones employer. And then finally self-fulfilment, could I see myself being fulfilled whilst working for a questionably immoral employer? Personally I don't think I could.

I am not sure I know 100% the answer to the question but I would love to hear from people on what their thoughts are on this post as I am sure there are sides to the argument I haven't thought of or idea's that I haven't considered. I have seen some interpretations of Maslow's hierarchy include Morality under security and self-fulfilment, which would tend to back up my points above.

If you want to read more on this theory, the wikipedia page Maslow's hierarchy of needs is a great place to start.

Disclaimer: This isn't meant to be an attack on anyone who works for NoTW or any other company you may consider morally questionable, its aimed to provoke debate and discussion only. I also understand that there is criticism of Maslow's hierarchy of needs, this post doesn't aim to debate the validity of that theory, only that the theory exists.

Filed under: Random No Comments
3Jul/114

Back to Blogging

Posted by Mark Evans

Its been quite a while since I last blogged anything, partly because I have been quite busy and partly because I didn't have anything interesting to say.

Well now a challenge has been set by Russell Smithers to blog more frequently and this is a challenge I have accepted, so prepare for a number of posts over the next few weeks/months on a wide range of topics.

I'll be writing the first of my real blog posts in the coming days and if anyone has some suggestions on what they would like to see blogged about post them here and I'll be sure to work through them.

Filed under: Random 4 Comments
16Jan/110

MySQL Query Analysis – Explain Extended

Posted by Mark Evans

I have recently discovered a feature in MySQL which is useful in debugging performance issues with queries.

We all know about the EXPLAIN statement which looks something like

EXPLAIN SELECT statement

This is used to display information from the optimizer about the query execution plan for the SELECT statement including information about how tables are joined and in which order. There is also a second statement called EXPLAIN EXTENDED which will provide even more information about what is happening under the hood.

To show you how this works lets take a common query from the current development version of osCommerce 3.x

EXPLAIN SELECT DISTINCT p.products_id FROM osc_products p LEFT JOIN osc_product_attributes pa ON (p.products_id = pa.products_id) LEFT JOIN osc_templates_boxes tb ON (pa.id = tb.id AND tb.code = "Manufacturers"), osc_products_description pd, osc_categories c, osc_products_to_categories p2c WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 AND p.products_id = p2c.products_id AND p2c.categories_id = c.categories_id

You should get some output similar to the following


MySQL Explain Example

As you can see there is lots of useful information there to help understand just what is happening. But it seems the MySQL engine has some other things it would like to tell us. And we get to this extra information by adding the keyword EXTENDED in combination with SHOW WARNINGS to get information about how query looks after transformation as well as any other notes the optimizer may wish to tell us.

Here is the same query again but with some extra information.


MySQL Explain Extended

You can see there is a new column here called "filtered" which was added in MySQL 5.1.12. This column indicates an estimated percentage of table rows that will be filtered by the table condition.

Now if we send the statement

SHOW WARNINGS \G

We get back exactly how the optimizer has changed the query internally before executing it

SELECT DISTINCT `osc3`.`p`.`products_id` AS `products_id` FROM `osc3`.`osc_products` `p` LEFT JOIN `osc3`.`osc_product_attributes` `pa` ON(((`osc3`.`p`.`products_id` = `osc3`.`pd`.`products_id`) AND (`osc3`.`p2c`.`products_id` = `osc3`.`pd`.`products_id`) AND (`osc3`.`pa`.`products_id` = `osc3`.`pd`.`products_id`))) LEFT JOIN `osc3`.`osc_templates_boxes` `tb` ON(((`osc3`.`tb`.`code` = 'Manufacturers') AND (`osc3`.`tb`.`id` = `osc3`.`pa`.`id`))) JOIN `osc3`.`osc_products_description` `pd` JOIN `osc3`.`osc_categories` `c` JOIN `osc3`.`osc_products_to_categories` `p2c` WHERE ((`osc3`.`c`.`categories_id` = `osc3`.`p2c`.`categories_id`) AND (`osc3`.`pd`.`language_id` = 1) AND (`osc3`.`p`.`products_id` = `osc3`.`pd`.`products_id`) AND (`osc3`.`p2c`.`products_id` = `osc3`.`pd`.`products_id`) AND (`osc3`.`p`.`products_status` = 1))

As you can see to get better performance the engine has changed the order of the query. Using this knowledge it is possible for the developer to understand exactly what the optimizer is doing and possibly find a better way to achieve the same results.

Hopefully I am not the only person in the world who didn't know about this EXTENDED option ;-)

5Dec/100

How one line of Javascript killed the Internet

Posted by Mark Evans

Warning: The post below is a rant based on my own personal views and should be read as such.

There is a constant battle which rages across the Internet almost everyday. Users want up-to-date content and they don't want to pay for it, content producers want to create more and more content but can't do so without a way to monetize that content.

There have been some recent pushes towards content which is no longer free and sits behind a paywall, this in some instances works out great when users cannot get the content you are offering from any other source but for general news and views a quick search in Google or Bing and people can generally find an alternative source of the information they want.

This pushes content providers to follow a more "Ad-Supported" model where content producers try harder and harder to make increased revenue from an ever diminishing market which is seeing lower and lower rate of CPM.

This causes quite a conundrum as getting a larger share of a reducing revenue model doesn't do the content providers much good. Therefore they start to look at other ways of monetization such as behavioural targeting and ad-retargetting in order to get better value from the "Ad-Supported" model. This is where the "one line of javascript" comes in.

One thing I hate as an end user is when I am waiting for content to be shown to me and it seems to take forever (or at least over 6 seconds in real terms). Seeing that blank white page and the waiting for www.blah.com to respond in the bottom of the browser window can quite quickly see my blood pressure rise to the point where I just click the close button and try and find somewhere else to get the information I was looking for.

This can cause big problems for content producers, they want to try and get a larger share of the ad revenue but by doing that they reduce the number of users who want to visit their website due to it taking forever to get to the real content, therefore driving down their ad-revenues.

Enter the all too familiar Best Practices for Speeding Up Your Web Site which gives advice on how to make your website faster, some of the things to do is reduce DNS lookups, use a CDN and defer javascript calls (or move to the bottom of the page) quite often however the code used to serve ads and conduct behavioural targeting requires to be at the top of the page due to document.write or other reasons which I won't go into here which means there is not much the developer can do to optimize this, meaning the end user suffers.

This problem can only get worse as content providers try more and more ways of targeting ads to the end user and implement multiple different providers on the same pages which increases the slow performance of the site.

There needs to be a sense check somewhere by the content providers to decide if a targeting / retargeting platform is really delivering value, if it isn't and they decide to implement an alternative then please please please for the sake of the whole Internet take off the platform that isn't working.

2011 in my opinion will be the year of performance where sites that perform badly will be penalised and move further down the search engine rankings, and whilst this will be great for end users it will be a disaster for content providers.

18Sep/104

Love Thy Project

Posted by Mark Evans

I've been planning to write again for a while but things such as "life" have gotten in the way, today however I decided to stop finding reasons to avoid writing and actually sit down and write about something which has been bothering me for a while.

Being part of an open-source project can invoke a wide range of emotions, from feeling proud you are creating something cool for others to benefit from, to the deep despair of trying to get a release ready whilst your family/friends compete for your attention.

A majority of people in the community are pretty understanding about the dedication you bring to a project and understand when you don't provide firm commitments on when something will be ready (a.k.a "it will be ready when its ready"), there are however a minority of people who think that you "suck" and have no idea how an open-source project should be run.

See Exhibit A:

I've lost count the number of times I've read comments similar to the following

  • Version X is dead, no-one cares anymore
  • You suck because you don't know when version X will be ready
  • You should stop wasting your time, project X is doing it better

From the posters perspective some or all of the above maybe true, however from the projects perspective some or all of these statements maybe false, there are most likely people who do care about version X and who prefer that a release is done right rather than done quickly.

Enter the conundrum of what vocal users want vs what the project/silent users want.

Finding the right balance is never easy for a project, there is no magic formula to follow so that they get it right every time, all a project can can do is follow what it believes is the right course of action and hope the community agrees and follows.

This can sometimes be misinterpreted as the project not listening or ignoring feedback, but rest assured that for most projects all constructive feedback is noticed and used to help formulate decisions even if a project doesn't reply to every single post you make.

Posting comments like

  • Don't bother your comment will likely be ignored
  • The project team don't care so why even bother
  • I wonder if the team will even bother to read this

Is a real simple way of making all of your points however valid irrelevant and easily forgettable.

So when giving feedback to a project, remember they are run by people, powered by motivation, so make sure to keep it on topic, detached from emotion and constructive, and the rest assured it will be heard.

So, to sum up the theme of this post in as few words as possible.

You have your way. I have my way. As for the right way, the correct way, and the only way, it does not exist. - Friedrich Nietzsche

Tagged as: , , 4 Comments