Thursday, April 15, 2010

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

Tuesday, November 10, 2009

long number problem in php 5.2.6

I found an interesting problem with long numbers using php 5.2.6. Yah, the current version of php is 5.3 but some hosting server still using older versions.

my problem was the following:


$integer = 2304200000;
echo $integer; //outputs 2.3042E+09

$float = (float)100000; //float
echo $float; //outputs 1E+05


this gives many weird results in calculation. I have faced this problem and this bug has eaten up a lot of time.So, I am others time regarding the big number problem in php 5.2.6.

If you use number_format or sprintf then you will get the number as aspected.


$integer = 2304200000;
$int = number_format($integer, 0, '.', '');
echo $int; //outputs 2304200000 as expected

$float = (float)100000 //float;
$float = number_format($float, 2, '.', '');
echo $float; //outputs 100000.00 as expected




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

Wednesday, October 14, 2009

increasing file upload size in wordpress.

I have faced a problem regarding uploading of big images in wordress. In php 5.2.5, it has change it's configuration file structure. Now it sets access level to it's directives. The levels are 7,4,2,1. And for this access control now we can't modify every configuration settings by ini_set() function in runtime.

Those that have access level 7, can be modified by ini_set() function. And some can be set using .htaccess file. And some need to have admin level access.

If you want to use .htaccess file then you need to paste the following code into you .htaccess file.


php_value upload_max_filesize 100M
php_value post_max_size 105M
php_value max_execuetion_time 300
php_value memory_limit 64M


you need to set post_max_size to larger size than upload_max_filesize, as there could be multiple upload field in a form.

Now, while you are using .htaccess file, the server may not support the directive changing command that you are trying to modify. I mean your server need to have AllowOverride property On for the specific directive that you are trying to modify. you need to contact with your hosting server support.

There is another way, you can create a php.ini file with the configuration directive that you want to change. For image uploading in wordpress, you can create the following php.ini file.


;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

upload_max_filesize = 100M;
post_max_size = 105M;
max_execution_time = 300;

;End:


you need to place it under the wp-admin folder.






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