Tuesday, October 26, 2010

Proton Exora

4 Starts Or 4 Starts??

Detected at :: http://www.proton-edar.com.my/exora/

Proton Exora

4 Starts Or 4 Starts??

Detected at :: http://www.proton-edar.com.my/exora/

Denda memakai pakaian seksi

Bilakah sebuah negara ISLAM yg bernama MALAYSIA hendak melakukan perkara sebegini.

Denda memakai pakaian seksi

Bilakah sebuah negara ISLAM yg bernama MALAYSIA hendak melakukan perkara sebegini.

Duit Elaun Tok Batin short

Tok Batin dpt RM200 je drp RM400.. Sapa nak jawap.

Duit Elaun Tok Batin short

Tok Batin dpt RM200 je drp RM400.. Sapa nak jawap.

Adik ipar Tony Blair peluk Islam

Adik ipar Tony Blair peluk Islam setelah lawatan ke Iran.

I wish the Presiden(s) of USA will do the same.

Adik ipar Tony Blair peluk Islam

Adik ipar Tony Blair peluk Islam setelah lawatan ke Iran.
I wish the Presiden(s) of USA will do the same.

Friday, October 22, 2010

Ayam sembelih vs Ayamtak sembelih

Kepada saudara(s) yang suka makan ayam, hati2 apabila memilih ayam. 

Kalo beli ayam yg dah potong memang susah nak pilih. 
Tapi kalo kita beli ayam seekor yg blom potong, cuba kaji keadaan leher ayam.

Saya pernah melihat jumpa tengkok ayam yg macam xde kesah semelih langsung.
Tempatnya di Pasar Tani Setiawangsa. Penjualnya adalah Melayu, dan saya yakin dia juga adalah beragama Islam. 
Tp kebanyakan ayam yg dijual tidak menunjukkan sebarang kesan sembelihan. 
Terus hilang selera nak makan ayam.

Thursday, October 21, 2010

Reset HTC Tytn To Factory Default

++ Achtung : All data will be  erased. Backup required. ++

Oracle SQL : How to SELECT with LIMIT and OFFSET

This is how it can be done. ( Choose either of these ) should be working ....
 
SELECT * FROM (
            SELECT TKN.*,
                   RANK() OVER (ORDER BY negeri DESC , ROWNUM ASC ) NAMAROWGMI 
            FROM TKNEGERI TKN )
    WHERE NAMAROWGMI >0 AND NAMAROWGMI < 5;
    
    
    
  SELECT * FROM (
            SELECT TKN.*,
                   RANK() OVER (ORDER BY negeri DESC , ROWNUM ASC ) NAMAROWGMI 
            FROM TKNEGERI TKN )
    WHERE NAMAROWGMI >5 AND NAMAROWGMI < 10;   
    

    
  SELECT * FROM (
            SELECT TKN.*,
                   RANK() OVER (ORDER BY negeri DESC , ROWNUM ASC ) NAMAROWGMI 
            FROM TKNEGERI TKN )
    WHERE NAMAROWGMI BETWEEN 5 AND 10;   

Wednesday, October 20, 2010

Convert BBCODE to HTML tag equivalent


// Convert BBCodes to their HTML equivalent
FUNCTION do_bbcode($text){
     GLOBAL $lang_common, $FORUM_user;
 
     IF (STRPOS($text, 'quote') !== FALSE){
          $text = STR_REPLACE('[quote]', '
', $text); $text = PREG_REPLACE('#\[quote=("|"|\'|)(.*)\\1\]#seU', '"

".str_replace(array(\'[\', \'\\"\'), array(\'[\', \'"\'), \'$2\')." ".$lang_common[\'wrote\'].":

"', $text); $text = PREG_REPLACE('#\[\/quote\]\s*#', '
', $text); }   $pattern = ARRAY('#\[b\](.*?)\[/b\]#s', '#\[i\](.*?)\[/i\]#s', '#\[u\](.*?)\[/u\]#s', '#\[url\]([^\[]*?)\[/url\]#e', '#\[url=([^\[]*?)\](.*?)\[/url\]#e', '#\[email\]([^\[]*?)\[/email\]#', '#\[email=([^\[]*?)\](.*?)\[/email\]#', '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');   $replace = ARRAY('$1', '$1', '$1', 'handle_url_tag(\'$1\')', 'handle_url_tag(\'$1\', \'$2\')', '$1', '$2', '$2');   $text = PREG_REPLACE($pattern, $replace, $text);   RETURN $text; }     /////////////////////////////////////   // If the message contains a code tag we have to split it // up (text within [code][/code] shouldn't be touched) IF (STRPOS($text, '[code]') !== FALSE && STRPOS($text, '[/code]') !== FALSE){ LIST($inside, $outside) = split_text($text, '[code]', '[/code]'); $outside = ARRAY_MAP('ltrim', $outside); $text = IMPLODE('<">', $outside); }

PHP Regular Expression Remove BBCODE

How to remove BBCODE from a string ?
 
<?php 
$String = "[b][color=#0000ff]TEST[/color][/b]";
$regex = '|[[\/\!]*?[^\[\]]*?]|si';
$String = preg_replace($regex, '', $String);
print $String."\n";
?>

Saturday, October 16, 2010

Oracle how to create table space

Permanent tablespace

create tablespace ts_something   
logging   
datafile '/dbf1/ts_sth.dbf'    
size 32m    
autoextend on next 32m 
maxsize 2048m   
extent management local;

----
create tablespace data 
datafile '/home/oracle/databases/ora10/data.dbf' 
size 10M 
autoextend on 
maxsize 200M extent 
management local 
uniform size  64K; 

source::http://www.adp-gmbh.ch/ora/sql/create_tablespace.html

Thursday, October 14, 2010

Thursday, October 7, 2010

Install php oci8 on OSX

how to install oci8 for php:
refer to:

what not mention in the documtation is :::
after finished installation and i want to  use cli, I must define
the DYLIB_LIBRARY_PATH in my .bash_profile OR /etc/profiles if i want
ex: 
export DYLIB_LIBRARY_PATH=/usr/lib/oracle/10.2/lib:$DYLIB_LIBRARY_PATH       the instantclient library downloaded

this also goes to Linux installation but the export variable is different

for linux(s):
export LIBRARY_PATH=/path/to/instantclientlib:${LIBRARY_PATH}

Wednesday, October 6, 2010

Postgresql cannot add new column

 Is Postgresql can add new column after/before specific existing column in table ???

Like :: 
ALTER TABLE some_tbl_name ADD some_column_name column_type AFTER some_existing_column_name
.
.
.

psql: FATAL: Ident authentication failed for user "postgres"

I encounter this problem when trying to list down the db for a newly installed Postgress on a machine ::

#host:>psql -Upostgres -l
psql: FATAL:  Ident authentication failed for user "postgres"

What to do::
1-> su - postgres    and then run psql.  Or:  Edit pg_hba.conf, and write   trust  instead of "ident sameuser" -- then reload PostgreSQL

Open up the pg_hba.conf 
# Put your actual configuration here
# ----------------------------------
#
# If you want to allow non-local connections, you need to add more
# "host" records. In that case you will also need to make PostgreSQL listen
# on a non-local interface via the listen_addresses configuration parameter,
# or via the -i or -h command line switches.
#



# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                                      trust          <-- default is ident sameuser
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust         <-- default is ident sameuser
# IPv6 local connections:
host    all         all         ::1/128                  trust         <-- default is ident sameuser

Tuesday, October 5, 2010

howto clear bash history?

Another way to clear history is to delete .bash_history file. 
rm -f ~/.bash_history 

However, actions on .bash_history will not clear the history of commands 
used in the bash session running at that time. That history is stored in 
RAM and written to .bash_history when the session ends. The correct way 
to clear history is to use 'history -c' because this will clear all 
history, including commands used in the session from which the command 
'
history -c' is given.

Centos 7 reset root/ any user lost password / lockout due to cant remember password

1. Need to be in front of the terminal. (Physically if not vm). 2. Reboot the server 3. Press 'e' in the GRUB2 boot screen. 3. bunch...