TTS Engine turn off page listen

Recently I installed a WordPress plugin called TTS Engine. TTS Engine allows readers / users of the website to listen to the content of posts and pages. This is all good but some website owners may not want the user to be able to listen to pages but only posts.

I personally thought the “listen button” looked silly on the pages and I only wanted it to appear on the blog posts.

At the time of me writing this there is no setting in TTS Engine to turn off the listen for pages and have it only display on posts. To solve this problem I set about customizing the TTS Engine code to not show the listen button on pages.

To accomplish this I added the following code …

Right above the following code comment …

In the “tts-engine-post-to-speech/tts-engine.php” file. To access the file click Plugins -> Editor in the WordPress admin menu.

Thought I would share this with the world in case anybody else wanted to turn off page listening after installing the TTS Engine plugin.

Update: I no longer use this plugin on my website but the code presented in this article will still work if you decide to install the plugin.

Front-end vs back-end development

Is there such a thing as front-end vs back-end development in today’s web development world? How much do these cross over and even into other roles entirely? What is front-end developer or a back-end developer expected to know or do?

Well there is no easy answer to all of these questions, with today’s expectations both front-end and back-end developers have a lot expected of them. In very basic terms we could say the roles are briefly defined as follows …

Front-end developer

Expected to know HTML, CSS and be good at graphic design.

Back-end developer

Expected to know how to create databases and PHP.

Ok so that is defined very basically, now I will take into consideration all of the criteria not mentioned for each of these roles below …

Front-end developer

Based on the above we could also add the following as potential criteria to the Front-end developer role …

  1. Expected to know CMS systems such as WordPress.
  2. Expected to know front-end frameworks such as Twitter Bootstrap for example.
  3. Expected to know Javascript.
  4. Expected to know any number of Javscript frameworks such as JQuery, KnockoutJS etc.
  5. Expected to know any number of CSS frameworks that are available such as Less, SASS etc.
  6. As mentioned earlier, expected to know graphic design even though graphic design is a completely different discipline altogether.
  7. Expected to know server side templating languages, for example Smarty.
  8. May be expected to know a bit about server side languages so they can incorporate the HTML templates into the web app.
  9. Expected to know about SEO so the website can be coded to accommodate the SEO.

Back-end developer

Based on the above we could also add the following as potential criteria to the Back-end developer role, the first 6 bullet points are the same as the front-end developer role but are still valid, this is the cross over between roles I was talking about and how it blurs the lines between front-end and back-end development …

  1. Expected to know CMS systems such as WordPress.
  2. Expected to know front-end frameworks such as Twitter Bootstrap for example.
  3. Expected to know Javascript.
  4. Expected to know any number of Javscript frameworks such as JQuery, KnockoutJS etc.
  5. Expected to know any number of CSS frameworks that are available such as Less, SASS etc.
  6. Expected to know server side templating languages, for example Smarty.
  7. Expected to know HTML and CSS.
  8. Expected to know any number of backend frameworks, for PHP this would be frameworks like Laravel, Yii etc.
  9. Expected to know any number of database environments and their associated query languages for example MySQL / SQL, MongoDB / BSON etc.
  10. Expected to know any number of code libraries.
  11. Expected to know how to use version control systems such as Git, BitBucket etc.
  12. Expected to know any number of backend languages including all their frameworks and libraries. For example back-end developer could know C# but also PHP.
  13. Expected to know how to create and manage web servers.

So there is probably a lot more that I have not thought about or mentioned but that just about sums it up for now. You can see there is a big cross over between the skills especially in the area of Javascript. Javascript as a language is nothing like coding HTML but Front-end developers can still be expected to know Javascript.

Back-end developers can still be expected to use HTML even though they are Back-end developers. You also have to appreciate that most of these skills are multi-disciplinary and each skill in its own right could take a vast amount of hours to learn and maintain properly.

For example Javascript developer should be a role in its own right. Graphic designer should be a role in its own right. Web server administrator should be a role in its own right. Learning a single web framework like Laravel should be a role in its own right. Not one developer learning multiple frameworks.

The way the skills are listed above in the bullet points make them sound easy and degrades the time and effort it takes to learn the skills properly. However employers list the skills in the same manner as above in job descriptions they send out to potential candidates.

No one could learn all of those skills and be proficient in all of them. The time it takes to maintain such skills would be too much for one person to accomplish if taken to the degree of mastery.

Maybe some employers know this and do not expect the developer to be a master at all of them. Maybe some employers just copy other employers job descriptions without knowing that the other employer did not expect the developer to be a master at all of them.

Any employers listing too many skills that a developer should be a master at should be looked upon as not being very grounded in reality and taken with a pinch of salt. It is not just the time to learn the skill but to maintain them as well.

These technologies are constantly evolving and there is a lot of maintenance time involved as well. To be a master the skill has to be maintained and as mentioned earlier there is no way in reality that one person could be a master at all of them.

Will HTML be the new assembler?

So I was thinking a while back about skill sets and pay rates for specific skill sets. For example if you can program in Assembler today and a company has a need for a Assembler programmer you can charge big money because there are few Assembler programmers compared to other programmers today.

HTML, CSS, PHP programming languages pay less or rather sometimes pay less because there are a lot of programmers in today’s world concentrating on those languages.

This got me thinking, in the early days of computing there would have been less languages to choose from so there would have been a larger percentage of Assembler programmers around years ago compared to other languages.

However due to the early years of computing being a specific niche anyway there might have been less programmers overall therefore the Assembler programmers got paid big money anyway.

But lets look at it like this, below is diagram of computer languages and the hierarchy of languages which those languages are built on top of …

mockup1

As more programmers start using the languages that are built on top of existing languages less programmers will be an expert in the bottom tier languages.

In today’s world now that we have languages such as PHP, programmers do not need to learn Assembler, programmers do not need to learn C or Java etc. Now that we have frameworks such as JQuery programmers do not even need to learn Javascript.

Now let us pretend we are in the future, 20 years from now. New frameworks have been built on top of HTML. Modern programmers are geared towards learning those new frameworks and they do not need to learn HTML.

HTML programmers have become a rarity and companies needing to fix problems at a lower level such as HTML will need to seek out the specialist HTML programmers.

So basically HTML has now become the new Assembler. With the following aspects …

  1. HTML has become a low tier level language.
  2. HTML has become a rare specialist language, not many programmers will know how to program HTML.
  3. Companies will pay big money for people with skills in HTML.

So that is my view of what might happen in future with the languages we have today like HTML. If you remember how to program in those languages long enough one day they could become a highly paid programmer for those rare specialist languages.

Who would think that in 20 years from now, you could be getting paid £1000 per day for programming HTML?

I use Balsamiq Mockups

Balsamiq Mockups is a software program to enable people to mock-up user interface designs. The program is simple to use and all a user has to do is drag and drop generic components onto the white screen area and build the user interface from these generic components.

https://balsamiq.com

There are plenty of components to choose from ranging from forms, datagrids, tables, tabs to navigation bars for designing web based software interfaces the program is perfect.

For doing mockups of websites it is also useful as well but obviously cannot cover in depth “design” in terms of fancy graphics as to mockup fancy graphics the graphic designer would have to do the work of drawing the fancy graphics themselves which is essentially doing the work and is not really a mockup.

For a website you can say this is the header, these are some links, here is a navigation bar to the left etc. It is a mock-up.

Balsamiq Mockups will be used by me in the Roadmap and GUI Design stages. I can now easily mock-up the user interface of the web based software system at the initial stages. Giving the client an idea of what the software will look like and how it will function.

This is also useful for early recognition of problems and getting it right the first time without having to change GUI elements around later when that could prove more costly.

New treadmill on its way!

In the web development industry or rather office industry in general it is easy to pile on the pounds as sitting at a desk all day is generally not very good in terms of psychical activity.

Around 8 years ago I was overweight, I brought a cheap treadmill and within a year I got down to a normal weight. Around 2 years after this I had put all my weight back on plus more.

I used the cheap treadmill again for around a month then it broke. I got another cheap treadmill but it was not powerful enough to support my weight, unlike the first cheap treadmill I brought this one just did not seem as powerful.

treadmill

So basically I gave up for a number of years remaining overweight. Then I decided to join the leisure center and I did some swimming, this is when I found that doing swimming will take twice as long to lose weight even though swimming was more pleasurable then other forms of exercise.

So then I joined the leisure centers gym. Now the gym is not too bad, however it is noisy with the music blurring out of the speakers and the gym instructors instructing people with the “pump! pump! pump!” mentality.

Not to mention the extended time it takes to exercise because of the journey there and back. So in the end I have brought a brand new reasonably expensive treadmill. This treadmill has none of the problems of the cheap treadmill and I can tell just by walking on it that the motor is much more powerful.

I purchased the treadmill from www.fitnessoptions.co.uk and whilst there I noticed some of the other treadmills they where selling and one which particularly stood out was the Lifespan Treadmill Desk.

For those of you who do not know a treadmill desk is part desk and part treadmill with the idea being that you can keep fit whilst doing work at the same time. I love the idea however the treadmill desk only goes up to 4mph.

This is the same on all makes of treadmill desk, it appears it has become the standard. I imagine this being a problem if I use the treadmill desk and reach some sort of plateau with my weight loss.

Not being able to increase the intensity of the workout may mean I will not get past the plateau however I do not know this for definite, maybe a plateau is never reached at all and just the continued walking on the treadmill desk will bring me down to the correct weight anyway. I did not want to take this chance though so I just brought a normal treadmill. If I want a desk I could make one somehow anyway and just use my normal treadmill as a treadmill desk.

I envisage me doing my normal office routines whilst at the office and when I get home I will do a nightly session on my treadmill whilst using a makeshift desk to do my work on whilst using the treadmill. Do that for 3 hours a night and the weight should drop right off.

Is PhoneGap worth it?

Here are some my thoughts about PhoneGap when I used it to develop a client / server phone application to display store offer listings both in text views and on a map.

These thoughts only apply to when I was using PhoneGap a number of months ago, maybe some of these thoughts are not relevant as PhoneGap stands today. I have not used PhoneGap again since this time because I have not needed to develop a phone software application.

Ok so my thought about PhoneGap is that the documentation is not so good. Although it appears to look good there where a lot of times I followed the documentation and it did not work, alternatively it just was not documented.

If the documentation did not work I generally looked around the web but who knows which version of PhoneGap the web tutorials / Q&A was meant for.

Many times I tried what was written on the web and it did not work, alternatively sometimes it did work but only after I read another piece of documentation that told me how to set it up correctly to get it to work but this was not mentioned in the initial piece of documentation I was reading.

LocalStorage options are not so good. Depending on the type of project clients are going to need quite a lot of local storage. Web SQL was an option but apparently it has been or is being deprecated.

IndexedDB was another option but this is only supported on a small number of platforms like Windows and Blackberry.

It is not supported by PhoneGap on IOS or Android. LocalStorage was the only other option that PhoneGap provides and this is the option I went with. However LocalStorage is limited to 5MB of data and only stores data in key / value pairs.

Plugin support is reasonable but depending on the number of devices the phone application has to run on it can be limited. You may find find a plugin that works on IOS but not Android or a plugin that works on Android and not IOS but not both.

No support for native GUI components. This means PhoneGap applications can look like web pages unless serious efforts are made to make them look more like a native PhoneGap. Not a big issue, just depends how native you want the application to look and I guess a lot of customers will want the native look and feel and with all the fancy fold out menus and special effects this could take a quite a bit of work to do.

Maybe there is a library out there that helps with this, I do not know? However I doubt the library will ever give quite the same feel as building the phone application using traditional native programming languages and tools.

The resolution for the PhoneGap application was not very good. For IOS the application was running at 480px by 320px and this is not a matter of simple configuring some setting in the config file.

At the time I was using PhoneGap this was the resolution that PhoneGap supported even though IOS supported a much greater resolution at that time. IPhone 5 1136 x 640 and IPhone 5s 1920×1080.

So these are my thoughts on PhoneGap. It is suited to some types of phone applications and I would use it again if the need called for it and the scope of the project was not too complex but for the really hardcore type phone applications I would stick to using the native programming languages and tools.

Yii 2 is here!

For those of you who do not know Yii is a programming framework built using PHP. For a number of years now I have been using Yii to built its software products.

Yii made programming software a whole lot more efficiently and easier as any framework is designed to do. I got in on the Yii framework in the early days before it became as popular as is it today.

So we have been waiting a number of months for the official Yii 2 release and it has finally been released, it was in an alpha stage until now and was not recommended to be used with building commercial products.

Yii 2 is not backwards compatible with Yii or rather Yii 1 as it can now be named. So any software products will have to be built from the ground up if any programmer had an old project written in Yii 2 but now wants to use Yii 2.

This is the first time a Yii version has been released that was not backwards compatible with its predecessor.

I think this is because the founders of Yii wanted to improve on Yii to such an extent that the fundamental core would have been altered in itself and could not be done by just building on top of what was already there like they did with previous versions.

www.yiiframework.com

This says something about the new Yii 2 in that it is fresh, tailored to its purpose and must be so improved that an entire rewrite was necessary. Rather than just layering on top of the old Yii it had a complete re-write which enabled its developers room to enhance and integrate some real fundamental improvements.

I will start using Yii 2 around January next year when I have finished all my current Yii software projects. I aim to write a new software product to test my skills in Yii 2. I will keep you updated on my thoughts about Yii 2 as I make the progression.

HTML5 Web Storage Implementation

Recently I have been working on a client project which required the ability to store data from a server on the users local machine. In this case the users local machine was a mobile phone, IOS, Android, Windows etc.

It does not really matter on the platform as it will be stored using the mobile phones web browser and most of the browsers are modern enough to have the new HTML5 Web Storage mechanism.

In actual fact the data will be stored using PhoneGaps implementation of HTML5 Web Storage. PhoneGap is a framework that allows the user to write phone software in HTML5, CSS3 and Javascript.

So for all intents and purposes it is like writing a responsive website that works on mobile phone browsers but is actually compiled and runs like a real native software application. PhoneGap interfaces with HTML5 Web Storage for the purposes of using HTML5 Web Storage mechanism.

So to store the data locally I found WebSQL and HTML5 Web Storage to be my options. Although WebSQL looked perfect for storing and querying the data, it is actually being depreciated and will no longer be in use as a standard in future. So my mind was made up for me in that case.

Web Storage on the other hand seems very straightforward, but this would be the case as it does not include the more complex features of querying the data. Web Storage works by storing name / value pairs. So we can say colour = red, or age = 25, name / value.

Like I said this is straightforward but we cannot say give me all persons over the age of 20 for example there is no querying mechanism.

In actual fact there is no mechanism for even storing multiple persons with ages to begin with. The real structured data is left to the programmer to implement and like wise with querying the structured data.

So what approach did I use?

I decided to store the value of the data as a JSON string and the name would be the table name. So for my project this data needed to be fetched from the web server and stored locally using the Web Storage.

I setup a PHP web server that returned a JSON response upon request via the client. The client did this using JQuery standard Ajax request functions. When I got this JSON response from the server which was basically a dump of a particular database table on the server in JSON format.

I stored it in local storage using the particular database table name for the name value. So in the persons / ages example this would be Person = Encoded JSON string of all data in the server Person table.

So now we have all of data for a particular table from the server stored in local storage. I just repeat this process for all the tables I want to store locally. We now have our data.

But what about querying this data?

Well JQuery does not come, out of the box anyway, with functions for querying JSON data. So a developer might think, I know, I will decode the JSON string and write my own functions for querying this data, possibly by putting the data into foreach loops and returning the records when the data matches the developers expectations. Well that is one way to do it however I am not sure how efficient that would be.

Looping through lots of data just to find single records cannot be very efficient however this is JQuery (Javascript) we are talking about, it is not as if it was designed to do this kind of thing anyway, plus Javascript processing power is becoming more powerful as a whole now in modern day browsers.

It is still not a server side language though and does not query a real database like MySQL which was designed for efficiency, but this is not expected of Javascript anyway.

I do not want to talk about efficiency too much as it is easy to slate querying data this way when a lot of internal libraries might just be doing the same thing under the hood anyway. I cannot imagine there being another way to do it with standard Javascript / JQuery when it comes to the rock bottom.

Anyways enough talk of how querying the decoded JSON data might be handled at a lower level. We as developers have libraries for this kind of thing and luckily someone has written a plugin to do this task anyway called json-sql. Here is the link to the library …

www.trentrichardson.com/jsonsql/

The json-sql library allows the developer to query a JSON string using SQL like syntax. Admittedly it only includes a very small subset of the standard SQL functions but it is most certainly good enough for most purposes, selecting, ordering and where clause. So I used this library to query my JSON data.

So that is pretty much it, the project has a web server which sends JSON responses to the client, data is stored in JSON strings in the client local Web Storage and the data is queried using the json-sql library before being displayed to the user.

This is the way I implemented a server / client, DB synchronized, local storage web software application.

Been using PhoneGap

On one of the latest projects I have been working on the client required that I build a software application that would run natively on multiple phone devices, IOS, Android, Windows and Blackberry.

The client required me to build a native software application for each of these devices because the client wanted to publish the software to the Android and IOS app stores and also because the client wanted the software to be able to run without an internet connection.

Up to yet I have mainly built responsive web applications that can run on a mobile phone through the phones web browser. Due to the client specific requirements this software application could not be done in the same way. If publishing to the app store and running without an internet connection was not a requirement, a web based responsive web application could have still been a viable option.

For previous software applications the responsive web application made sense because those projects where really web based systems that needed the convenience of running through a mobile phone and not a pure phone software application with the specific intent to sell the software as a phone application.

So what is PhoneGap? PhoneGap is a framework that allows developers to construct phone software applications using HTML, CSS and Javascript. After the developer has developed the software application using these languages PhoneGap can then build the phone software to run on multiple phone platforms i.e. IOS, Android plus more.

www.phonegap.com

Obviously this saves tons of time as without PhoneGap or similar frameworks developers would have to construct a software application for each platform. Another advantage of PhoneGap is that it allows web developers to build phone software applications in languages they are use to.

Although PhoneGap has made development easier, one of the drawbacks I have noticed with it is that developers still need to install each SDK. An SDK is a toolkit that allows the compiling of the software application to the phones native device. An SDK has to be installed for each device you want the software application to compile to. Installing each SDK can be a real pain in its own right. Most of the SDKs are installed through the command line and in some cases certain dependencies are required.

Another drawback I have noticed with PhoneGap is that the documentation is not very good. It seems like it is good when you are reading it on the main site or when you are reading it on online tutorials. But then you discover that the documentation you where reading is old and does not work for your version or even that it just simply does not work without you having to do something else which was not mentioned in the documentation. A simple task can look simple when reading the documentation, you do everything the documentation says only to discover it does not work in the way you want it to or even does not work at all.

You must be aware of what type of application you are trying to build and do not try to go beyond its limits when the native coding platform would have been a better choice. PhoneGap seems to be able to do everything the native platforms can do, but in practice it is different or rather you may try to do it but it might have been easier just to code it using the native languages, platforms and tools.

Update: PhoneGap does actually include an online builder which allows you to compile to IOS, Android and Windows without having to install the SDKs locally.

Mac free color picker

I was searching for a color picker today and found one already installed on my Mac which is installed as standard with every Mac OS.

I thought I would also write about the already installed color picker to save someone the time of having to find and download a color picker online.

The color picker is located at Application -> Utilities -> DigitalColor Meter.

color-picker

Just go to that location and run the color picker software.