This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Jumat, 26 November 2010

PHP Programming Pattern

Got this from fluppycat.com


 

PHP Design Patterns Reference and Examples

GoF Creational Patterns

Abstract Factory

Sets of methods to make various objects.

Builder

Make and return one object various ways.

Factory Method

Methods to make and return components of one object various ways.

Prototype

Make new objects by cloning the objects which you set as prototypes.

Singleton

A class distributes the only instance of itself.

 

GoF Structural Patterns

Adapter

A class extends another class, takes in an object, and makes the taken object behave like the extended class.

Bridge

An abstraction and implementation are in different class hierarchies.

Composite

Assemble groups of objects with the same signature.

Decorator

One class takes in another class, both of which extend the same abstract class, and adds functionality.

Facade

One class has a method that performs a complex process calling several other classes.

Flyweight

The reusable and variable parts of a class are broken into two classes to save resources.

Proxy

One class controls the creation of and access to objects in another class.

 

GoF Behavorial Patterns

Chain Of Responsibility

A method called in one class can move up a hierarchy to find an object that can properly execute the method.

Command

An object encapsulates everything needed to execute a method in another object.

Interpreter

Define a macro language and syntax, parsing input into objects which perform the correct opertaions.

Iterator

One object can traverse the elements of another object.

Mediator

An object distributes communication between two or more objects.

Memento

One object stores another objects state.

Observer

An object notifies other object(s) if it changes.

State

An object appears to change its` class when the class it passes calls through to switches itself for a related class.

Strategy

An object controls which of a family of methods is called. Each method is in its` own class that extends a common base class.

Template

An abstract class defines various methods, and has one non-overridden method which calls the various methods.

Visitor

One or more related classes have the same method, which calls a method specific for themselves in another class.

Other PHP Design Patterns

Non OO MVC

MVC - Model View Controller - shown using procedural and not OO architecture.

Object Oriented PHP Basics

PHP OO Class Basics

The basics of creating a class with OO PHP.

PHP OO Abstract Class Basics

The basics of creating an abstract class with OO PHP.

PHP OO Interface Basics

The basics of creating an interface with OO PHP.

PHP OO Static Basics

The basics of using Statics with OO PHP.

PHP OO This and Parent Basics

The basics of using this and parent with OO PHP.

PHP Performance Testing

PHP Performance Tuning if / elseif VS switch

Which is faster in PHP - if / elseif or switch?

Other PHP Stuff

PHP Job Interview Questions

As a contractor and freelancer I`ve had a number of interviews, and the same questions seem come up on a regular basis.

Comments and Questions

A few of the many emails about patterns and PHP I have gotten over the past few years.

MongoDB : a Database that worth to try

MongoDB is document oriented database, mean it's not store database based on table but it store database like json object. So i will find out things that maybe related to my previous experiences with rdbms. In it's web it has a console like tutorial, that was fascinating to test and see if its works.

Kamis, 25 November 2010

Tools PHP Development

https://github.com/sebastianbergmann/

PHPUnit
Phpdcd

Dan masih banyak yang lainnyaa..... ( bang Rhoma mode on)

Bacaan Baru : Rife java web framework

http://rifers.org/


RIFE is a full-stack web application framework with tools and APIs to implement most common web features. Each of its toolkits is usable by itself and together they offer powerful integrated features that boost your productivity. RIFE ensures that every declaration and definition is handled in one place in the code. This simplifies the developer's task by reducing code replication, enforcing consistency, and easing maintenance.

RIFE's differentiators are:

  • you get 90% of the features with 10% of the usual effort, thanks to its full stack
  • logic-less HTML templates that can be previewed in any browser and edited with standard tools
  • uniform component model, designed from the ground up for reusability: applications, sub-sites, pages, porlets, widgets, ... can be easily packaged and placed in any other context
  • integrated native Java web continuations and flow continuations
  • metaprogramming, driven by your domain model, but without polluting it
  • flexible declaration and configuration with support for plain Java as well as XML
  • core support for web data flow as well as page logic flow
  • integrates with existing solutions such as Spring and standard JDBC datasources
  • multi-dimensional conversational state management with scoping
  • language-independent template engine with support for XHTML, HTML, XML, Text, SQL, Java
  • persistence layer with content management integration and versioning
  • designed for the creation of consistent maintainable applications as well as on quick delivery
  • embraces standard protocols and specifications, providing larger building blocks by wrapping lower layers with high-level functionalities
  • out-of-container testing with full introspection capabilities of the executed flow and components
  • lightweight execution model that has been proven in production
  • built for Java 5 with intelligent downgraded support for Java 4
  • designed for developer comfort: minimal application restarts thanks to automatic detection of file modifications

Tools Keren : Microemulator – can convert jad to apk

Dengan tools ini bisa convert JAD ke APK , jadi buat yang punya program game bisa dengan mudah konversi ke android. Gila!

http://www.microemu.org/microemu-webstart/index.html
http://microemu.blogspot.com/2009/08/converting-javame-applications-to.html

  • Application demonstration in web browser applet
  • Java Web Start demonstration
  • Faster development of application in Eclipse
  • Using standard java profiling tools to tune your application
  • Creation of unit tests for J2ME application that runs during build process
  • Development support for platforms where no emulator is available. See api modules


     

  • Support for MIDP 2.0
  • Generic Connection Framework
  • Support for MMAPI (JSR 135)
  • Support for FileConnection API (JSR 75)
  • Support for Nokia APIs
  • Support for Siemens APIs
  • Skinnable and configurable interface
  • Works with different graphics libraries; currently with Swing and SWT
  • Platform independent: Windows, Linux, OSX

Rabu, 24 November 2010

CakePHP Swf object

http://bakery.cakephp.org/articles/alkemann/2008/11/25/flashhelper-a-wrapper-for-the-swfobject-js-class


Examples

<div id="flashy"><p>No flash loaded</p></div>
<?php echo $flash->renderSwf('test.swf',400,200,'flashy');?><?php
$flash
->init(array('width'=>200,'height'=>100));
echo
$flash->renderSwf('test1.swf');
echo
$flash->renderSwf('test12swf');
?><?php
echo $flash->renderSwf('fl_countdown_v3_3.swf?mo=1&da=24&snd=off&co=AA3333',800,250,false,array('params' => array('movie'=>'?mo=1&da=24&snd=off&co=AA3333')));
?>

Links

  1. http://code.google.com/p/swfobject/
  2. http://code.google.com/p/swfobject/downloads/detail?name=swfobject_2_1.zip
  3. http://code.google.com/p/swfobject/wiki/documentation
  4. http://code.google.com/p/alkemann/issues/entry

Fungsi jQuery untuk mengecek apakah variabel adalah function

To check if variable is a function

jQuery.isFunction(varName);

contoh penggunaan :

var x = function(){
alert("aa");
}

if(jQuery.isFunction(x)){

x();
}

Membatalkan jQuery ajax request

Sebenernya gak Cuma jQuery, tapi ajax secara keseluruhan.

var x = $.ajax({
type:
"POST",
url:
"some.php",
data:
"name=John&location=Boston",
success:
function(msg){
alert(
"Data Saved: " + msg );
}
});

//kill the request
x.abort()


Sumber : http://stackoverflow.com/questions/446594/kill-ajax-requests-using-javascript-using-jquery

Tempat Kerja Impian

stackoverflow.com

•20 days vacation
•ridiculous health insurance (no copay)
•free catered lunch
•insanely great workstations, chairs, and desks
•free monthly metrocards
•gym membership reimbursement
•flexible hours
•employees will never be poked with a sharp stick

Selasa, 23 November 2010

Don’t use <A href=’#’> as your custom object

When you need custom object such as treestate checkbox or even six state checkbox please don't use <a href='#'> as your container of object/css background. It will makes page autoscrolled to the top of page and its annyoying. So use <span> instead when you need custom object to your page.

Jumat, 19 November 2010

Using Apache virtual directory with cakephp

Change your .htaccess file in your application folder, in my case is myapp

/--myapp
|--app
|--cake


<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /myapp
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]

</IfModule>


This should be working.

Agar jQuery object selalu bisa berfungsi setelah recreate

Seringkali object – object dicreate ulang untuk mendapatkan kesan interaktif. Tapi seringkali juga object – object tersebut kehilangan fungsi yang telah diikat/bind atas object itu. Untuk itu pada saat object selesai digunakan

  1. Unbind , misal jQuery(this).unbind() , perintah ini akan memastikan bahwa action telah hilang sehingga object bisa aman dihilangkan dari memory
  2. Remove, misal jQuery(this).remove(), setelah melakukan unbind, printah remove memastikan object sudah benar2 tidak ada lagi dilayar.


PERHATIAN : remove tanpa unbind() akan menyebabkan memory penuh, karena referensi action tidak bisa dibersihkan oleh javascript garbage collector.

Rabu, 03 November 2010

Sony Ericsson Android WebSDK is PhoneGap

http://developer.sonyericsson.com/wportal/devworld/search-downloads?cat=[1.716760,+1.706824,+1.706817]

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More