Thursday, April 15, 2010

calling Lambda methods in haXe

The calling procedure of lambda method is same for all the methods. The first parameter is an iterable. Lambda function will operate on it. We can take functions as a parameter. For instance, we can call the exists function like:
static function exists( t : Iterable , func : A -> Bool ) : Bool
Here the first parameter is iterable and the second one is a function. Lambda will iterate over iterable t. During traversing, function func will be called on every iterator. This function will take a single argument of the same type as the iterator. This function can be anonymous type.

See the book
OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Abstract class with haXe

There is no abstract class in haXe. An abstract method is a method that is declared without an implementation. We can define a private constructor. This way, such a class can't be constructed. Only subclasses might define a public constructor.

We cannot define any abstract method in haXe either. But there is a way to gain the power of abstract feature in haXe. When an abstract class is subclassed, the subclass usually provides implementations for all of the abstract methods in its parent class. So, we need to define an empty body (or maybe throw an exception) in the main class. Then these functions will be overridden in subclasses.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Auto load in haXe

HaXe uses autoloading feature of php. It dynamically autoloads the class definitions when it is needed. It has a drawback also. It checks the lib folder for type definition checking. To reduce the impact of this operation we can create a cache folder at the same level of lib and also give write permission to it to store the files. Then when we run our next haXe program, it will automatically generate a file named ‘haxe_autoload.php’. This file will contain all the necessary information for autoloading a class.
We can see the result while autoloading a large number file. We should use this feature only on production server, because in the development server we may create several classes for testing.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

override with haXe

We can override a method of super class with a method of subclass. We must precede the method with override keyword. In haXe 2.x, it is mandatory to use override keyword while overriding a method in super class with that of subclass. The override keyword brings the following features:
We know that super class method actually exists.
This prevents overriding a super class method accidentally.
Using the override keyword, we inherit the types of attributes of super class method. So, we need not to redeclare it.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

how import works in haXe

We can gain access to all the attributes of a file without needing to specify the package name using imports.
package my.pack2;
class C2 extends my.pack.C {
}
Is identical to the following :
package my.pack2;
import my.pack.C;

class C2 extends C {
}
When use imports we can have access to Enum types. This is the main difference between the above two.
We can have access to a single type with import keyword. Suppose we have a class like:
package my.pack2;
typedef A = { a : String }
typedef B = { b : String }
import my.pack2.A; we can do to load multiple types in haXe.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Interfaces in haXe

An interface is a group of related methods with empty bodies. Yes, interfaces are abstract type. We declare interface with interface keyword. The syntax for interface is like the following:
Interface interface-name
{
function func-name([arg-name:type])[:return-type];
}
Here we create an interface interface-name with method func-name. It has an optional return-type and a parameter name.
We can’t instantiate an interface. All methods are by default declared as public.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Super keyword in haXe

Using the super keyword, we can use the methods of parent class in a derived class while that method is being overridden in derived class. See the following example:
class child extends parent {
function care() : Int {
return super.care() + 1;
}
}
Here we override care() method of parent, but still we use the parent class method in it using super keyword. We can also call the constructor of parent class in our class using super:
class child extends parent {
function new(){
super();
}
}
Note that we do not use the constructor function name of parent class here, only used super(). It brings the properties of parent class to the derived class.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Class inheritance in haXe

Yes, we can inherit properties of one class to another in haXe. Inheritance helps us to reuse existing code with little or no modification. In haXe we can extend one class and implements many interfaces. So, we can inherit several types at same time. The new class is said as derived class and the inherited class is called as super class. Inheritance is different from subtype-polymorphism. To declare a subtype we need to define a new class.
This syntax can be shown like this:
Class super-class extends subclass1, implements subclass2, implements subclass3
{
}
Here super-class inherits properties from subclasses.
When we wish to add a single function or more to an existing class without changing the class itself, we can simple extend the class and then create our function in our new class. Let’s see an example of it.
Class brain{}
Interface eye{}
Interface hand{}
Class human extends brain, implements eye, implements hand
{
}
Here class human has its own types and also uses types of brain, eye, and hand as required. The difference with other languages is that it uses the ‘implements’ keyword for every implementations. Other languages implements interfaces like ‘implements eye, head, brain’, uses the ‘implements’ keyword only single time.




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Public access in haXe

We use public keyword with fields, methods and constructors to impose least restriction. Public class is visible to any class in the Java program, whether these classes are in the same package or in another package. If a field or method does not have any access modifier set to it, then it is assumed that the field or method is set with public access. But it is recommended to use ‘public’ keyword when it is to be used.
The syntax for using private field is as follows:
[public] var variable-name [: type[ = value]];
We make variable-name as public by placing the public keyword in front of it. This is optional. We can set type and initialize it at the same time.
In haXe, we can write it like:
public var pound:Int;
Here integer type pound is declared as public.




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

The constructor class of haXe

The constructor is called when the class is instantiated. In HaXe, we use new keyword to create a constructor for our class. This class does not have a return type and this function is never inherited. We can overload our constructor so that we can create more than one constructor for a class, each will have different parameters.

Now we will go through an instance of constructor.
class Student {
public var Roll : Int;
public var Marks : Int;

public function new() {
this.Roll = 0;
this.Marks = 0;
}
}
Here constructor initializes the two attributes of the class. We first declare the attributes Roll and Mark. In the constructor we assign values to them.




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide