Welcome to Webeks

transfer OpenX server to another host

E-mail Print
OpenX is ads delivery server. If you want to transfer it from one host to another follow the steps bellow:
Read more...
 

Memcached on Windows (xammp)

E-mail Print

Install memcached as a service

  1. unzip binaries in your desired directory (eg. c:\xammp\memcached) - binaries download
  2. right click on memcached.exe ->Properties->Compatibility->Run this program as an administrator
  3. open command line (Run->cmd) and go to unziped directory (cd c:\xammp\memcached)
  4. memcached.exe -d install
  5. memcached.exe -d start

Install memcache PECL lib

  1. you can compile it with pecl install memcache
  2. OR you can download already complied version (use the right verison)
    1. put it in your php ext folder (eg. C:\xampp\php\ext)
  3. add extension=php_memcache.dll to your php.ini


 

repair QIF format for NLB

E-mail Print
I use NLB (Nova Ljubljanska Banka) and I wanted to import data to Quicken.

The problem was, that NLB only supports QIF or CVS export and Quicken only supports limited QIF import.

When I looked more deeply I found out that the problem occurs because of the date format. NLB exports date as DD.MM.YYYY and Quicken expects date to be MM/DD/YYYY.


This can easily be achieved with search and replace functionality built in almost every text editor. I use a free Notepadd++

Open qif file in your editor, go to search and choose Regular expression mode. You can find all occurrences of a date with expression D(.*)\.(.*)\.(.*) and replace it with expression D\2\\1\\3


Let me know if I helped ;)
 

Facebook IFrame and Ajax require_login()

E-mail Print
Another day another bug (or just weird behavior) in Facebook platform.

When calling $facebook->require_login() from anywhere else then a canvas page it is caught in an endless loop.
Read more...
 

XFBML fb:serverFbml not rendering solution

E-mail Print
If you want to use FBML within iFrame, you should use XFBML fb:serverFbml tag.

However the examples provided in documentation don't work. And I spent quite some time to figure it out.

You should set the Connect URL to the same url as your Canvas Callback URL.




btw. you can test your XFBML here.
 

Zend_Log_Writer_Db - Customising table columns

E-mail Print
Zend offers different logging possibilities. I won't present them all.

But basics remain. By default there are timestamp, message, priority and priorityName entries. If you want to log your own entry you have to deal with event array. To add a custom field use setEventItem() method.
Read more...
 

ampersand (&) operator - used for assigning reference

E-mail Print
$object1 = new SomeClass();
$object2 = $object1;

$property1 = "X";
$property2 = $property1;
Now I have objects of the same class but they are independent from each other. If I change propertyX of the $object1 propertyX of $object2 will stay unchanged. This is so called pass-by-value behavior that was default behavior in PHP 4.  We could enforce pass-by-reference bahavior with use of ampersand operator &. In PHP 5 default behavior changed a bit (btw. thanks for correcting me Phil!). Objects in PHP 5 will be passed as references (this does not apply for variables).

References in PHP are a means to access the same variable content by different names.
Read more...
 

Static methods and properties

E-mail Print
I assume you know the difference between class and an object. If not, read this!

A static method is basically the same as a non-static, but there is one difference: a static method is accessible without needing an instantiation of the class. Because you access a static element via a class and not an instance, you do not need variable that references an object. Instead you use the class name following ::

To access a static method or property from within the same class you should use self keyword instead of pseudo variable $this.
Read more...
 

Class vs Object - the difference explained

E-mail Print

Class

A class is a code template used to generate objects. It is some sort of a blueprint that describes the object.
In PHP a class name can be alphanumerical string that cannot begin with a number. Class code must be enclosed with braces and it consists of attributes and operations.

Example

class Car {
//some variable
private $owner;

//operation
public function setOwner() {
//something to do ...
}

}

Object

An object is data that is structured according to the template defined in a class. It is instance of a class.

Example

$myCar = new Car();
$obamasCar = new Car();

print $myCar; //outputs Object id #1
print $obamasCar; //outputs Object id #2

In real world, you'll often find many individual objects all of the same kind. As an example, there may be thousands of other cars in existence, all of the same make and model even owned by the same person. Each car was built from the same blueprint. In object-oriented terms, we say that the car is an instance of the class of objects known as cars.
 

Education kills creativity

E-mail Print
Imagination is more important than knowledge is a famous quote by Albert Einstein. I've always agreed. One that has imagination can learn. But you can never learn imagination by traditional methods. Just the opposite! Traditional methods kill creativity and they kill imagination!

Yesterday I've stumbled upon a video of Sir Ken Robinson talking about this topic. He has some very good points. It's worth to have a look!

Enjoy :)

 
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  Next 
  •  End 
  • »
Page 1 of 2

Sponsored Links

My friends

Bookingpoint
partner websites

Donate

Do you find content useful? Please donate so I can cover my hosting expenses! Thanks!