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 […]

Array Dereference in PHP 5.4 PRO

As of PHP 5.4 we can develop a function that returns an array and treat the call to that function as an array we want to access its elements. <?php function doSomething() { $vec = [23,53,75,64]; return $vec; } echo doSomething()[0]; ?> The following video clip shows the execution of this code sample and explains […]

PHP 5.4 Access Members on Instantiation PRO

PHP 5.4 allows us to access class members on the instantiation. We will use this special capability in those rare cases in which the only reason for creating the object is in order to allow us to access one of the class members. <? class Utils { function calc($numA,$numB) { return $numA+$numB; } } $temp […]

PHP 5.4 Class::{expr}() Syntax PRO

PHP 5.4 provides us with a new way to invoke static functions. This new way allows us storing the function name in a variable (as a string) and place that variable within curly brackets. <? class GoGo { public static function do_something() { echo “something!!!”; } } GoGo::{‘do_something’}(); ?> The following video clip shows the […]

Shenkar Scala Programming Summer 2012 ACD

During the summer semester I am going to deliver a Java & Scala Programming course in Shenkar. I deliver it as part of Shenkar’s Software Engineering BSc academic program. I am going to teach it on Thursdays 0800-2000. The course starts with a detailed coverage of the Java SE programming language and continues with a detailed […]

Shenkar Scala Programming Spring 2012 ACD

During the coming semester I am going to deliver a Java & Scala Programming course in Shenkar. I deliver it as part of Shenkar’s Software Engineering BSc academic program. I am going to teach two groups. The first group takes place on Sundays 0800-1300 and the second one takes place on Sundays 1700-2100. The course starts with […]

Update cookies preferences