Symofny 1.4 form: add validator for alternative email or secret question

I had a case recently – the registration form with alternative email and secret question.
In this form user needed to enter alternative email OR/AND secret question for password reminder function – at least one field must be filled. So I used approach of adding form validators dynamically.


Continue reading “Symofny 1.4 form: add validator for alternative email or secret question”

The best IDE for Samsung Smart TV developer

My primary workstation is Macbook Pro with OSX Lion.
Perfect for Web development (Symfony, Rails, etc), my past OS was Ubuntu Linux 10.04 LTS – the same, but without good video and flash movies 🙂

When I decided to develop application for Samsung Smart TV I was Googling for best practices in developing such project.
The thing was that it’s very new and only resource for this was www.samsungdforum.com and russians pristavka.de website.
The SamsungDForum is perfect for novices and this is official forum for Samsung SmartTV developers.
They provide developers with own IDE and I decided to try this too.

I was disappointed, very unuseful product, no any code completion, go-to-class-declarations, refactoring features and so on. Like I used to use in my favorite IDE IDEA/PHPStorm from IntelliJ guys. This is related to all their IDE versions from 1.x to 3.0.x.

Few days ago I found they released new IDE based on Eclipse and I thought “finally, they quit trying make something own and decided to make something good” 🙂 And I tried this Smart TV Eclipse IDE too.

And deleted it because there is almost nothing new from original Eclipse. Why? Below are reasons.

  • I’d like to see there something related to developing Smart TV Apps with their Javascript Framework but there were nothing about Scenes!
  • When I tried to open my old project for 2011 Smart TVs the IDE didn’t recognize it and I needed to create new Javascript project and import my old one, pretty hacky.
  • You cannot choose which Smart TV emulator to use to test your project – there is only one as default. I believe using Eclipse shortcuts you can set up all three emulators for this. But this feature should be out of the box!

In general this is good step for Samsung IDE developers to use Eclipse. I hope they will give us very useful product very soon and for Mac OS too!

But for now I continue using the following tools for Smart TV development:

As for using standalone Smart TV Emulator you need to download entire SDK for Eclipse and create project in its “apps” folder to have emulators see your project.

PG::Error: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)

When you create your Rails project with PostgreSQL you might have following error after run rake db:create:all

[php]PG::Error: ERROR:  new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT:  Use the same encoding as in the template database, or use template0 as template
[/php]

This error because template database (template1) has been created with an ASCII encoding and you’re екнштп to create the new database with UTF8.

 

I fixed that by adding ‘template’ parameter to my ‘database.yml’:

[php]
development:
adapter: postgresql
encoding: unicode
database: database_development
template: template0
pool: 5
username: username
password:
[/php]