SQL general error 1005 and errno 150

SQLSTATE[HY000]: General error: 1005 Can’t create table ‘mydatabase.#sql-c7c_81e’ (errno: 150)

My issue was that the Foreign Key didn’t match the type of field I was trying to use as reference.

id (source) = int(10) – unsigned

foreign = int(11)

Foreign here needs to be unsigned as well to avoid this type of errors.

id (source) = int(10) – unsigned

foreign = int(10) – unsigned

Spotify Terms of Service and Facebook

I opened Spotify this morning and I was greeted with an updated Terms of Service document, I don’t have time to go through the whole document this time but I was interested to see if they had made any modifications to their document when you connect your Facebook account and it seems like they are still the same so I would like to share with you some highlights of the document:

2.1 Registration data

If you connect to the Service using your Facebook credentials, you authorise us to collect your authentication information, such as your username, encrypted access credentials, and other information that may be available on or through your Facebook account, including your name, profile picture, country, hometown, e-mail address, date of birth, gender, friends’ names and profile pictures and networks. We may store this information so that it can be used for the purposes explained in Section 3 and may verify your credentials with Facebook.

Let’s scroll down to Section 3

3. How we use the information we collect

We may use the information we collect, including your personal information, to: (i) provide, personalise, and improve your experience with the Service and products and services made available through the Service, for example by providing customised or localised content and advertising; (ii) ensure technical functioning of the Service and products and services made available through the Service, develop new products and services, and analyse your use of the Service, including your interaction with applications, advertising, products and services that are made available, linked to or offered in the Service; (iii) communicate with you for Service-related purposes, including promotional e-mails or messages; (iv) enable and promote the Service, including features and content of the Service and products and services made available through the Service, such as sharing, user interactions, notifications and suggestions, and integration with third party services; (v) enforce this Privacy Policy, the Terms and Conditions of Use, and the Mobile Terms, including to protect the rights, property or safety of Spotify, users or any other person and the copyright-protected content of the Service; and (vi) as otherwise stated in this Privacy Policy.

4.2 Sharing with Facebook and other services

If you connect to Spotify using Facebook or otherwise connect your Spotify account to an Other Integrated Service, the default setting is generally that Spotify automatically shares your activity and activity-related stories with that service, including the music you listen to. You understand that such information may be attributed to your account on Facebook or the Other Integrated Service and may be published on such service. See section 5 below to learn how you can disable sharing of information on Facebook and Other Integrated Services.

Spotify also enables you to share a particular item of content, on an individual basis, to third party services or other Spotify users by using the share functionality in the Service. Please note that sharing of such content on a third party service may be posted as activity on the Service, regardless of your account settings. To share an individual item of content to a third party service, you’ll be prompted to enter your access credentials for that third party service. Spotify may store your username and an access token or similar credentials obtained from the third party service, so that you are able to share particular items of content, on that third party service, on an individual basis, without entering your access credentials again.

You understand and agree that Facebook’s or other third parties’ use of information they collect from you is governed by their privacy policies, and Spotify’s use of such information is governed by this Privacy Policy.

Using applications such as Spotify is fun, specially if you use their free service and you don’t mind the commercials but as any other business Spotify must find ways to create revenue and personal information is valuable that is why it is important to understand what happens with specific applications in the event that you connect them with your social networks (Facebook, Twitter, LinkedIn).

The Rise and Fall of Clash of Clans from SuperCell

I was intrigued by the game Clash of Clans ads in Facebook, altho I never click on Facebook ads I still went directly to the source in the Apple store and installed the game to check it out. It definitely is addicting and for the looks of it the company that created the game was aware of that they were doing and how to do it right , with a monthly gross revenue of $15M as reported by InsideMobileApps you could think nothing could go wrong with this game and company. Until update 2.73 came around…

What’s New in Version 2.73
Chat improvements:
&#10003 Global chat is now moderated! Report offensive messages by tapping them and choosing “Report”.
&#10003 Improved profanity filter for global chat creates a nicer and safer chatting environment.

Clan Improvements:
&#10003 You can now set minimum amount of trophies required for your clan. Players won’t be able to apply if they don’t meet the minimum requirements.
&#10003 Added notices to Clan chat when members are promoted, demoted, join or are kicked out of the clan.
&#10003 You can now send a personal message when you kick someone out of your clan.

Other changes:
&#10003 Players with lower Town Hall levels now lose less resources when attacked by higher Town Hall level players (2 level difference or more).
&#10003 There is now a short no-attack period after maintenance breaks to allow players to log back in unperturbed.
&#10003 Added an extra confirmation step when loading village from Game Center to avoid accidents.

On Monday SuperCell posted a message on their Facebook wall with the comment “Clashers, it’s time for the UPDATE :)” as the time of this writing there are 394 Likes and 1,259 comments. it doesn’t take long to read through some of the comments to that post and most of them are negative towards the game. Some commenters display the amount of money they were able to get back from the Apple store after complaining.

For one I did not invest any “real” money in the game but I had a chance to play the game for some time and it was fun. What ruined it for me was the Global Chat moderation, after I posted a “hello” message to the global chat I was banned without any information on why I had been banned. After reading some comments it looks like I was not the only one being banned randomly but that anyone could “report” you and after a certain number of reports wether they were valid or not you would get banned from the Global Chat for a certain period of time. For sure I am not the ideal client for SuperCell since I didn’t spend any money on the game or gave them access to my social networks data, however I would be interested to find out what effects update 2.73 will have on this game. Will it ruin it completely or will the users get over it and live with the changes? It seems to me that one of the updates was driven by the desire to make more revenue which $500k a day doesn’t sound bad to me but maybe the company uses all the gainings just to keep the game running.

My predictions are that either SuperCell will learn from the latest update to Clash of Clans and create a new game similar which will not be so aggressive at trying to get more revenue or they will be able to revert some of the latest updates and make their current users happy again and have them return. For one I know SuperCell won’t miss me in Clash of Clans and I am happier now not spending time on such a fun game.

PHP Development with XAMPP

Larry Ullman wrote a great post about his experience with MAMP. Many years before I heard about MAMP I had been using XAMPP (http://www.apachefriends.org/en/xampp.html), it was in fact that a friend told me about the great piece of software he was using called MAMP which was only $39 (at the time, today you have to pay $59 for a new version and $29 for an upgrade). MAMP is able to let my friend have a LAMP stack up and running in no time in his MAC. I asked my friend why would he be paying $39 for MAMP while XAMPP was free! and he had two reasons. One, he could update the vhosts quickly, second he had been using the software for quite a while so he didn’t have to learn a new piece of software. I believe there is a free version but you are not able to edit the vhosts which for what I undrestand is one of the main sell point for many.

My setup for PHP development on MAC and PC is the free XAMPP package. Since I use the MAC 99% of the time I have created an alias in my .bash_script which opens two files in TextMate that allow me to create a vhost rather quickly. Lastly I open the XAMPP control panel, restart Apache, and I am set to go.

here is my .bash_script alias:
alias vhosts=”mate /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf mate /etc/hosts”

There are other benefits with XAMPP (it may be very similar with MAMP but I have never used it) after you start mySQL from XAMPP control panel you can do all your database administration by visiting http://localhost/phpmyadmin. I have also set up a “dump” alias http://dump.localhost where I can drop any quick php tests without having to create a new virtual host.