|
Stopping form submissions containing HTML code |
||||||||
I'm already cleaning html code submissions on the server side but why not make things even more informative for my users and tell them up front that their HTML isn't appreciated.
I didn't want a complicated Regex or pattern matching plugin, I simply wanted to detect key HTML elements and tell the user that it wasn't going to be accepted by the form. This code uses the JQuery plugin for form validation. You can get it here:
First things first, let's create a custom validation rule to detect our html elements.
2$(document).ready(function(){
3
4 $.validator.addMethod("findhtml", function(value, element) {
5
6 var commentclean = true,
7 disallowed = ['<', 'http'];
8
9 for (var i=0, len = disallowed.length; i<len; i++) {
10 if (element.value.indexOf(disallowed[i]) != -1) {
11 commentclean = false;
12 break;
13 }
14 }
15
16 return this.optional(element) || ( commentclean );
17
18 }, "* match the string");
19
20});
21</s/cript>
This creates an array of disallowed elements and loops through them when the rule is invoked.
Secondly we will use this rule in our validation routine when a user tries to submit the form.
2 <s/cript type="text/javascript">
3 $(document).ready(function(){
4 $("#form").validate({
5
6 rules: {
7 name: {required: true},
8 email: {required: true},
9 tel: {required: false},
10 message: {required: true, findhtml: true}
11 },
12
13 messages: {name: "Please enter your Name",
14 email: "Please enter a valid email address",
15 tel: "",
16 message: {required: "Please enter a message", findhtml: "You cannot enter HTML in this field"}
17 }
18
19 });
20 });
21 </s/cript>
This invokes our previously created validation rule.
In this way the user is told 'You cannot enter HTML in this field'. A friendly validation message that clearly shows WHY the form isn't going to work.
You can see this working on my contact form here : http://www.mccran.co.uk/contact/
|
Amazon Autorip Music service comes to the UK |
||||||||
For those unfamiliar with it, the idea is that you buy music from Amazon in your chosen format (CD or Vinyl, whatever takes your fancy) and a copy of it is automatically added to your Cloud player library.

Screenshot not of my library, I mean come on 'Lady Antebellum'
It's not completely comprehensive at the moment as not all songs are included but there are nearly 400 thousand albums so a fair bit of your catalogue should be in there. Just lookout for the AutoRip logo when you make a music purchase. Searching the Amazon store displays a list of the available Albums – AutoRip list.
If you don't have Amazon's cloud music player you can get it here:
An interesting angle from my professional perspective (Telecoms) is that the Amazon player does not compress the music it streams. It is full Bitrate streaming MP3. So this could have a fairly large impact on your data plan. Considering that the Amazon sells 320kbs format MP3's and that albums come in at around 160mb to 200mb you are going to start chewing through data quickly.
Its services like this that start to make unlimited data tariffs a little more attractive. These 'over the top' services are often the things that create and then drive consumer demand. This additional demand in turn shapes future network design and infrastructure, which is then monetised in new price plans and tariff designs.
Footnote: The other thing this does is handily show you that you've spent WAY too much money on music @ Amazon.
|
Don’t build a social community, then destroy it with product changes |
||||||||
The key to social media platforms, of any variety, is the user base. Phase one of any social platform launch is "how do we encourage users to join, and how do we keep those users interacting enough to stay, and encourage more users to join". It's the social media circle that marketing agencies add by default into pretty much every web project produced since 2000.
The problem with social media, from a company point of view, is that you have to maintain the user base. With traditional software models people typically pay a license to use your product. Making changes to it is risky, but you essentially know how to shape your product roadmap, and how your buying customers are going to react. With social media every change of functionality is a test of your customer base.
They joined your site / use your application / manage their profile all because it's social. There is a social investment created. Profiles mature, people record their interactions, their scores, their achievements. Any change to your platform HAS to be backwards compatible; otherwise you are throwing away all the credit that has accrued from your users actually using your system.
Online games almost always feature a competitive friend ranking system, with platforms like Facebook now allowing aggregation functionality for non-Facebook based gaming (look at Candy Crush as an example) it is incredibly easy for applications to pull your friend list and create a points comparison scale, or an achievement ladder. The users buy into this social aspect. Developers and marketing have changed their mindset to make this a goal in playing the game. You can't mess with it. As EA recently found out.
EA learns to hard way
EA Games recently took control of the Scrabble game from Mattel. Their first move was to refresh the game with new functionality that erased the history of the players. This caused outrage in the customer base as people had been encouraged to invest time and money in this game, improving their scores, and generally creating a richer account, with depth of statistics. This was EA saying 'we don't care about your data'. Why build a rich profile with a history you are proud of, if a company can just erase it with a software update?
They also changed the functionality of the game, but not everyone is going to like all your feature changes, that is just part of the product lifecycle.
The worst thing about this? EA could have probably written an ETL process to migrate the account information into the new database format for the new revision of the game. They just didn't think it was important enough.
You can read more about the EA story on the BBC website:
|
Where is Google music stored on the Android OS? |
||||||||
Having a dig around on the mobile I couldn't find the music files anywhere. How was I to copy my music? Turns out that Google Music stores the music files in a sector of the memory card that you cannot access unless you have root access.
So you cannot move them around easily. Also watch out for the fact that Google Music applies its own indexing system so all your files are renamed to match a cloud based index database. They have numeric names now instead of the original ones. To work out what each song is you'll have to listen to them each in turn.








