Translator

Programming

Oracle SQL: Create new column, renama a column, change data type of column

Oracle SQL Create new column:
alter table tablename1 add project_codes varchar2(3);

Oracle SQL Rename:
alter table tablename1 rename column project to projects;

Oracle SQL change data type:
alter table tablename1 modify projects varchar2(20);

Oracle Commands

How to Duplicate existing table in oracle

create table table_name2 as select * from table_name1

How to Drop database in Oracle XE (10 g)

How to drop database in Oracle XE (10g)

Open cmd

sqlplus / as sysdba

SQL> shutdown immediate;
oracle database closed
oracle database dismounted
oracle instance shutdown

SQL> startup restrict mount;

SQL> drop database;

Database dropped

SQL> exit

Branding ILIAS 4

This is document for Branding ILIAS 4 for reference

Branding ILIAS 4

How to include a user define class file in zend controller file

Disclaimer: This tutorial was taken from linked in, just for the sake of my reference.

Ramesh Chetipalli • To add user define class (or custom library) u can use zend framework’s autoloader namespaces.

Add the below line in application.ini file

autoloaderNamespaces.custom = “Custom_”

All the user defined classes will start ‘Custom_’ as prefix (e.g. Custom_Abc). The path for the file will be – /library/Custom/Abc.php

In the controller u can use – $abc = new Custom_Abc();

Warning: require_once(Spreadsheet/Excel/Reader/OLERead.php)

I am now developing web application that requires to read and write to excel file. So my first milestone is to read it.  I have choosen PHP Excel Reader to read the excel.

I have encounter the problem:

Warning: require_once(Spreadsheet/Excel/Reader/OLERead.php) [function.require-once]: failed to open stream: No such file or directory in D:\xampp\htdocs\phpexcel\Excel\reader.php on line 31

Fatal error: require_once() [function.require]: Failed opening required ‘Spreadsheet/Excel/Reader/OLERead.php’ (include_path=’.;\xampp\php\PEAR’) in D:\xampp\htdocs\phpexcel\Excel\reader.php on line 31

Solving:

1) Open the reader.php file from the Excel folder. Remove the below code from the top of the line.
require_once ‘Spreadsheet/Excel/Reader/OLERead.php’;

2) And add the below code after remove that.
require_once ‘Excel/oleread.inc’;

Source:  http://icfun.blogspot.com/2009/09/php-warning-requireoncespreadsheetexcel.html

Flash/Flex Tutorial

Using External Call from HTML to Flash

http://blog.circlecube.com/2008/02/tutorial/actionscript-javascript-communication/

Flash MMO Server

These was some of my research on how to create Flash MMO Server:

MMO Server

http://www.smartfoxserver.com/products/basic.php

MMO Server with Flash Component/Editor

http://www.openspace-engine.com

MMO Flash API

http://www.nonoba.com/developers/multiplayerapi/overview

http://playerio.com/pricing/

Chat room kind of flash

http://palabre.gavroche.net/content/view/19/38/

Optimizing MySQL

Today i have encounter a problem where mysql used by our clients got hang.

And after 2 days of searching, i finally know that using too many left join (joining mysql table) while NOT INDEXING it would make database queries too long that can cause database hang.

The solution this situation is by using mysql index.

To retrieve rows from other tables when performing joins. MySQL can use indexes on columns more efficiently if they are declared as the same type and size. In this context, VARCHAR and CHAR are considered the same if they are declared as the same size. For example, VARCHAR(10) and CHAR(10) are the same size, but VARCHAR(10)and CHAR(15) are not.

Comparison of dissimilar columns may prevent use of indexes if values cannot be compared directly without conversion. Suppose that a numeric column is compared to a string column. For a given value such as 1 in the numeric column, it might compare equal to any number of values in the string column such as '1'' 1','00001', or '01.e1'. This rules out use of any indexes for the string column.

from http://dev.mysql.com/doc/refman/5.1/en/mysql-indexes.html

You can read more about this and how to create indexes as below:

http://dev.mysql.com/doc/refman/5.1/en/mysql-indexes.html

http://dev.mysql.com/doc/refman/5.0/en/create-index.html

Problem Solving: JQuery Pagination not working for next page

Problem Statement

I have used the jquery pagination that i have posted before. It was great tool but i have encounter some problem when deploying it to one of our client

Causes & How to solve it

1. You must ensure that you have followed the table structure by using <thead></thead> and <tbody><\tbody>

2. Remove Limit option in pager.

Jquery Problem cause at LIMIT

Jquery Pagination Solving

Jquery Pagination Solving: Remove LIMIT

Set Default Value for Pager JQuery plugin and Page Peel Plugin

Previously i have posted links for table pager using tablesorter pager plugin, however when i used it i found that i need to change the default value for different clients when first load.

This is how to do it:

Find these code

this.defaults = {
size: 10,
offset: 0,
page: 0,

and replace size with your choice. Example for me is size=4.

Thats all!

And while searching a solving for jquery pager plugin, i found out few interesting jquery plugins such as:

Page Peel

http://www.smple.com/pagePeel/

A simple but yet very easy page peel plugin. Just like the popular peel used by internet marketers…