Scala Expressions Evaluation PRO

When creating a variable using val or var and assigning the value of an expression into it the expression is evaluated when the variable is created. When creating a function using def and assigning the value of an expression to it the expression is evaluated when calling the function. object Program { def main(args: Array[String]):Unit […]

Node.js on Cloud9 Jump Start PRO

Node.js is a platform built on top of JavaScript v.8, Google’s JavaScript runtime engine. Node.js enables us to develop web applications that excellent in their performance. The following code sample is a simple HTTP web server developed using node.js that returns the hello greeting back to the client from which the HTTP request arrives. var […]

Android Logcat & PhoneGap PRO

When developing an hybrid application we encounter difficulties when tried to track (debug) code we wrote in Java Script that is executed inside the WebView object. The problem becomes even more complex when using PhoneGap. The following code sample shows how we can use the android logcat for getting log messages from the code we […]

Zend_Db_Table Simple Demo PRO

Using the Zend_Db_Table class, which is part of the Zend Framework, we can easily access a specific table in our database. The following code sample shows how simple it is to add a new row using this class. The following code includes our definition for the users controller. <?php require_once ROOT_DIR.’/models/Users.php’; class UsersController extends Zend_Controller_Action […]

Simple Zend_Form Demo PRO

I have recently created a simple demo for using the Zend_Form. In order to keep it simple I chose to avoid using decorators. You can download the files and place them on your own server. The demo provides us with a simple BMI calculator. The user get to see a simple form where he should enter […]

Simple Zend Framework Jump Start PRO

I have recently created a simple demo for using the PHP Zend Framework. The simple demo was prepared in order to assist my students doing their first steps using this framework. The demo includes few controllers and it basically shows a list of books and a list of reviews for each one of them. In […]

The __PHP_Incomplete_Class Object in PHP PRO

When storing an object in $_SESSION trying to retrieve it in another page we will get an error if the class itself is not available when the session_start() function builds the $_SESSION array. Debugging the $_SESSION we will find that our object is available and is stored as a __PHP_Incomplete_Class object. In order to avoid […]

Pausing & Resuming Java Script Execution in Web View PRO

When executing code written in Java Script in our web view we would like to pause it when the user moves to another activity and resumes it when he returns. The following code sample includes two activities. The first activity includes a web view that executes code written in Java Script. The second activity is […]

HTML5 Relational Database INFO

HTML 5 provides us with a relational database running on the web browser. This relational database supports SQLite sql syntax. The following code sample checks whether the web browser supports the HTML 5 relational database. <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”> <html> <head> <title></title> </head> <body> <script type=”text/javascript”> if(window.openDatabase) { document.write(“support”); } else […]

Simple Trait in PHP PRO

Defining a trait is very similar to defining a class. Instead of using the keyword class we use the keyword trait. The purpose of traits is to group functionality in a fine grained and consistent way. It is not possible to instantiate a trait. The trait servers as an additional capability that provides us with additional capabilities when […]

Update cookies preferences