Posts

Showing posts from August, 2013

How to open Galaxy S4 configuration emulator

Image
How to open Galaxy S4 AVD: Google has not released Galaxy S4 configured built in emulator. It is not available in android SDK. So it is very tough to test app in this configuration basically for who does not have the real Galaxy S4 device. I don’t have this device but I like to test my app in Galaxy S4. In this tutorial I am trying to help to create Galaxy S4 configuration emulator.    Caution: As Galaxy S4 is not available now in android SDK so it will not give you proper feel and behavior.   To get the same behavior it is recommended to use the real device. S4 device screen is HD so your desktop or laptop screen will have to be HD resolution capability if at least you want to create S4 avd.   How to open Galaxy S4 AVD: At first click on the Virtual device manager and set the following attributes like the image below.   Now you are ready to run your Galaxy S4 AVD.   Problems in opening Galaxy S4 AVD: I have seen many developers complain that th...

5 Best tools for Web Developers And Designers

Image
Web designing and web development are two professions that are highly on demand in today’s age and time. With the help of the several tools, web designers and developers are in an advantageous position to create the best looking sites today. Dreamweaver : One of the most trusted web development tools that have been with the developers for a long time is Dreamweaver. It gives users a one-stop-shop feel to designers who can use the tool to create almost any kind of site. Photoshop : Photoshop needs no introduction. From designing attractive logos to creating web templates, this is a must-have tool for all. CoffeeCup Free HTML Editor : CoffeeCup Free HTML Editor is a tool that is perfect for beginners. It has all the basic HTML requirement but a few essential tools are missing such as CSS menu, FTP upload etc. Brackets : Brackets is an open source code editor which can be used by web developers to write HTML, CSS and JavaScript-based code. Foundation by Zurb : Foundation is a...

Multiple Images Upload in CakePHP

Image
In this post we will see how to uload multiple images in cakephp.I am going to show the additional code for multiple image handling for both the action Add and Edit.What all you need is to simply copy paste in your application according to needs. My table : posts CREATE TABLE `posts` ( `id` int(10) NOT NULL AUTO_INCREMENT, `title` varchar(200) NOT NULL, `body` text NOT NULL, `image1` varchar(200),  `image2` varchar(200),  `image3` varchar(200), PRIMARY KEY (`id`) ) As you can see what are the fields of my 'posts' table.I have three fields for the images.Example: image1,image2,image3 etc.You may have different fields. Add the code given below for multiple image handling. My uploaded images are stored in  app/webroot/img/uploads/posts  folder.I have one default image called 'no-icon.jpg' in the same folder which will be shown if the correct image is not available or in case of NULL value. Controller : PostsController.php Add Function public function add() { $this-...

Recursive in CakePHP

Image
Today we are going to learn about Recursive in CakePHP . Using this recursive property, Cake will know about the depth of the result that needs to be generated when find() and read() methods are used.It is needed to set the depth of the retrieval of records associated with a model data so we can limit how much data is fetched from the query in case of multi levels of associations between your models. Lets say for example we have Author module which has many Books.Now you have such case in which you want to retrive the data of the authors plus their books too.So in this case how Recursive play its role? We have Model file for Author having the following code. <?php class Author extends AppModel {    var $name = 'Author'; } ?> and Model for the Book, <?php class Book extends AppModel {    var $name = 'Book'; } ?> Now write the index function in AuthorsController.php file   public function index()    {       $authors = $thi...

10+ android based project ideas for programmers or final year students

Many of us interested to develop mobile based application instead desktop based application. You think that you will develop mobile based application especially for android for your final semester project or for fun. But you can't  even think what you should do or should not do. What types of project you can take as you are beginner or don’t know about it. May be searching internet you will not get huge information on this topics. In this discussion I will try to provide you 10+ android based project ideas by which at least you can understand the trends of android project. I will start with some fundamental android project idea and then I will try to provide you some advance project idea that will help you to be a professional android application developer.    In android developer site you can get 20+ sample projects . These projects are one of the best resources for learning android application development. You can take a look on these projects before reading it. So now...

Top 5 E-Commerce Themes For Drupal

Image
Drupal is a stable and robust e-commerce platform that is extensively used to run shopping portals. Coupled with the fact that Drupal is also open source and easily available, it is one of the most used platforms along with WordPress, Joomla and Magento. You can easily get extensive range of e-commerce themes for Drupal and make the most of them for your business. 1. BigShop : Developed by TabVN, BigShop is a responsive Drupal theme that can be used to run a sturdy and attractive e-commerce platform. BigShop uses Drupal Commerce module along with API payment method add-to-wishlist, Tax calculation support, product rating etc. 2. Spotlight : The theme is compatible with the latest Drupal version 7. Developers can use the theme to design portrait or landscape designs mainly for the mobile version using the Spotlight theme. 3. Retail Shop :  To add freshness and clarity to designs, Retail Shop is a good theme for Drupal e-commerce. Created by ThemeSnap, Retail Shop supports importa...

SVC handlers missing in IIS on Windows8

Image
A quick tip. I recently upgraded OS to windows 8 and installed both VS2010 and VS2012. Post that, my svc files stopped working in IIS and threw a 404 not found error. After a little struggle I found that .svc mappings were missing in IIS and the easy way to restore them is: 1. Open Control Panel 2. Select "Turn windows features on or off" 3. Expand.NET framework and check HttpActivation for WCF and you're done!

Dynamic Fields Validation in CakePHP

Image
In this post we'll learn about dynamic fields validation .Generally validation is achieved by placing the validation rules in the model file.You can get the idea of how validation rules are written in model file by the example given below. <!-- file:app/models/yourmodel.php --> var $validate = array( 'name' => array( 'notempty' => array( 'rule' => array('notempty'), 'message' => 'This field is required..!', //'allowEmpty' => false, //'required' => false, //'last' => false, //'on' => 'create', ), ), 'SRRP' => array( 'numeric' => array( 'rule' => array('numeric'), 'message' => 'This field is required..!', //'on' => 'create', ), ) ); But here,the fields (Example: name,SRRP) are static fields.Following lines of code were written in view ...

CRUD in CakePHP Part : 2

Image
In previous post we learnt about view and listing of the Users.In this post we'll learn about add,edit and delete operations. Adding Users To add a user record put the below function in our UsersController.php public function add() {         if ($this->request->is('post')) {             $this->User->create();             if ($this->User->save($this->request->data)) {                 $this->Session->setFlash(__('User has been saved.'));                 $this->redirect(array('action' => 'index'));             } else {                 $this->Session->setFlash(__('Unable to add User.'));             }         }     } Here we have to include the SessionComponent ...

CRUD in CakePHP Part : 1

Image
In this post we will see how to create simple CRUD application in CakePHP. Creating the Users Database Let’s set up the database for our blog.Right now, we’ll create a single table for our users. We will  add few records of users in order to test. Simply run the SQL query given below into your DB: /* Create our users table: */ CREATE TABLE users (     id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,     firstname VARCHAR(50),     lastname VARCHAR(50),     email VARCHAR(50),     message TEXT ); /* Then insert some users for testing: */ INSERT INTO users (firstname,lastname,email,message)     VALUES ('Ricky', 'Astley', 'test1@test.com','Hello...!'); INSERT INTO users (firstname,lastname,email,message)     VALUES ('John', 'clinton','test2@test.com','How are You...!' ); INSERT INTO users (firstname,lastname,email,message)     VALUES ('Smith', 'Johnson', 'test3@test.com','I am Fine...!'); Create a Us...

MySQL Event Scheduler

Image
If you are running a large web application then you must have lots of data(unwanted data also).For example, spam emails,unused records of the users.All these spamy and junk data will cause problem of database overload and backups.Its performance will also affected.So what could be the solution to overcome this problem.The solution is topic of this post called “MySQL Event Scheduler”. From the release of MySQL 5.1.6 comes the inclusion of a scheduler. Perfect name "The scheduler" that schedules tasks within the DB. When you will need MySQL Events? (1) To delete junk records automatically on regular interval of time. E.g. delete every week. (2) Used to Call a stored procedure at specific time. (3) Automatically perform any scheduled SQL operation. Three basic steps are required to schedule a task. • Event Name • Event Interval • SQL Statement Create a Table – Cart CREATE TABLE cart( cartID INT AUTO_INCREMENT , userID INT, product_id INT, created TIMESTAMP DEFAULT CURRENT_TIMEST...