Making phpBB2 working with PHP5

September 20, 2005 Add Comment

Making phpBB2 working with PHP5

Officially, phpBB 2 (as of this writing, up to version 2.0.17) is not supporting PHP 5. If you install PHP 5, and use it to run phpBB, you will encounter the following symptoms and errors:

You cannot post message – When you want to post new topic or reply to a topic, after writing your message, when you click “Submit”, a blank page or screen or error message is shown with address bar showing posting.php, instead of posting confirmation message.
You unable to search – When you want to search by clicking oh “Search”, no search results are been returned, or a black page or screen, or error message is shown.
To enable PHP 5 to work properly with phpBB, some changes to the phpBB source code needs to be done. Just follow steps as below:
OPEN
admin/admin_ug_auth.php
FIND
if( $forum_access[$i][$auth_field] == AUTH_ACL && isset($change_acl_list[$forum_id][$auth_field]) )
REPLACE WITH
if( $forum_access[$i][$auth_field] == AUTH_ACL && isset($change_acl_list[$forum_id]) )
FIND
( !isset($auth_access[$forum_id][$auth_field]) && !empty($change_acl_list[$forum_id][$auth_field]) ) ) ||
REPLACE WITH
( !isset($auth_access[$forum_id][$auth_field]) && empty($change_acl_list[$forum_id][$auth_field]) ) ) ||
Finally, some changes are needed so that functions that get called with functions as parameters are not called ‘by reference’ with functions:
OPEN
includes/functions_post.php
FIND
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length)
REPLACE WITH
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length)
OPEN
includes/functions_search.php
FIND
function clean_words($mode, &$entry, &$stopword_list, &$synonym_list)
REPLACE WITH
function clean_words($mode, $entry, &$stopword_list, &$synonym_list)
FIND
function split_words(&$entry, $mode = ‘post’)
REPLACE WITH
function split_words($entry, $mode = ‘post’)
For the above, the changes involved are some parameters have been stripped off the “&” sign.

Check Oracle Version

September 17, 2005 Add Comment

Check Oracle Version

here are several ways where you can query or retrieve the version number of installed Oracle products:

1. If you just want to check the version information of the Oracle database, simply connect and login to the Oracle database with SQL *Plus. Upon login, you will see:

SQL*Plus: Release 9.2.0.6.0 – Production on Tue Oct 18 17:58:57 2005

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 – 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 – Production

The first italic number is the version of the SQL*Plus client and the second italic number is the version of Oracle database which you are connected to .

2. Retrieve the version information from v$version table by using SQL*Plus. In this table you can find version information on Oracle, PL/SQL, etc.

To retrieve the version information for Oracle, you execute the following SQL statement:

select * from v$version where banner like ‘Oracle%’;

It should return something like this:

Banner
————————————————————————————–
Oracle9i Enterprise Edition Release 9.2.0.1.0 – 64bit Production

3. Version information can also be checked from Installed Products from the Oracle Universal Installer. It will tells you what products is installed on the machine and also its version information too.

In Unix, the installer is located at $ORACLE_HOME/bin/runInstaller.
In Windows, access the installer by Start -> All Programs -> Oracle Installed Products -> Universal Installer.

Install, Setup and Configure CGI and Perl in Windows XP

September 16, 2005 Add Comment

Install, Setup and Configure CGI and Perl in Windows XP

Prerequisite
Obviously, a web server needs to be running on the Windows machine. Refer to this post for instructions on how to install Apache2 in Windows.
Download Active Perl
Download Active Perl from http://www.activestate.com/Products/ActivePerl/?mp=1. Click on Free Download to start the download process. There is no need to input any contact info. Just leave it blank and press ‘Next’ to start the download.
Then download the latest version of Windows MSI package.
Install Active Perl
Start the installation by double clicking the setup file. Follows the on-screen instruction. If you will be using Perl CGI programs and want to maintain some level of portability between both Linux machines and Windows machines, you may want to install Perl at the same location on your Windows machine as it is on most Linux machines.
For example, on Linux machine, Perl is located at /usr/bin/perl and so every Perl program that I write begins with #!/usr/bin/perl. So, it’s best when install Perl on an Windows machine, instead of installing it in the default location (i.e. C:\perl), install it in C:\usr instead, so that the Perl executable is located at /usr/bin/perl. This allows codes written on Windows machine been moved to, without changes, to Linux machine, and have it run there, and vice versa.
To change the installation path, click on browse button when you’re on the installation screen that prompts you to select which features you want to install. Set it to C:\usr\ if needed.
Make sure that the following options is checked (selected):
Add Perl to the PATH environment variable
Create Perl file extension association
Activating CGI
Open the httpd.conf file for editing by selecting Start > Programs > Apache HTTP Server > Configure Apache Server > Edit the Apache httpd.conf Configuration File. Alternatively, open the httpd.conf with any text editor.
In the main directory section, search for Options Indexes FollowSymLinks (at about line 267), and add ExecCGI to the end so it looks like:
Options Indexes FollowSymLinks ExecCGI
Search for the following line and remove the hash mark character (#) to uncomment this line. (You can also change .cgi to .pl, or add .pl behind .cgi if you prefer that perl extention is also treated as cgi files) For example:
#AddHandler cgi-script .cgi
Should look like:
AddHandler cgi-script .cgi .pl
or
AddHandler cgi-script .pl
or
AddHandler cgi-script .cgi
Save the httpd.conf configuration file, restart the Apache server. Test the configuration as described in Testing Your Web Server CGI Configuration at the end of this article.
Optional: Enabling CGI in Any Directory
If you want to use CGI outside Script Aliased directory (Script Alias is usually the Apache2/cgi-bin/), comment out the following line:
ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/”

Should look like:

#ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/”

Alternatively, if you want to specify just one directory to put all your cgi programs, change the path instead, but makes ure that directory exists.

Should look like (for default settings):

ScriptAlias /cgi-bin/ “your_prefer_cgi-bin_direcotry”

Save the httpd.conf file. Restart the Apache server.
Finding Perl Executable Location
If you don’t know where is perl.exe installed to, go to Start -> Search and search for perl.exe. This location is the path to the perl executable that has to be put on the top of all cgi scripts. If you follow default installation procedure, the path should be C:/perl/bin/perl.exe
For the path to perl.exe path, all of these format are valid:
#!c:/perl/bin/perl.exe
#!c:/perl/bin/perl
#!/perl/bin/perl.exe
#!/perl/bin/perl
Testing Your Web Server CGI Configuration
Save the following test script in your DocumentRoot directory (if you have uncomment ScriptAlias, you can put it anywhere inside your DocumentRoot directory, or if you have set ScriptAlias to some particular directory, put the cgi in that directory only, i.e Apache2/cgi-bin) as test.pl or test.cgi (depending on your configuration of the AddHandler line) and modify the first line as required to point to your ActivePerl interpreter:
#!c:\perl\bin\perl.exe
# ^^^ this must be the first line of the script! ^^^
# start code
use strict;
use CGI;
my $q = new CGI;
# print header and start the markup output
print $q->header( “text/html” ),$q->start_html( “hello from perl cgi!” );
print $q->h2(“hello dave…”);
print $q->end_html;
# end code
Now go to http://localhost/cgi-bin/test.cgi (scripts in Apache2/cgi-bin/ are read as http://localhost/cgi-bin/ by default). You should see a page that displays a level two heading with the following text:
hello dave
If you see the above message, CGI is running. If you get a 500 error, go to the last entry in your Apache2/logs/error.log (or the Review Error Log in the Start menu) to see exactly what caused this error.

Disable and Remove ThinkPad Hidden Service Partition

August 19, 2005 Add Comment
Disable and Remove ThinkPad Hidden Service Partition


IBM/Lenovo ThinkPad usually comes a protected hidden service partition that takes up about 5 GB of hard disk space. So you need not be surprise when you check your available hard drive space and found out that the size of hard disk is less than the size advertised.

ThinkPad service partition is a non-DOS partition Hidden Protected Area (HPA). This partition is used to store original system files necessary to restore the system to its out of the box (factory) condition. To know if your ThinkPad system has service partition, there are two ways to check:

If your machine displays the message “Press F11 to invoke the Product Recovery Program” or “To start the product recovery program, press F11″ during system start-up, then your system has the service partition.
If the instructions located in the User’s Guide concerning recovering preinstalled software state to recover your system by choosing F11 at boot-up, then your system came preconfigured with the service partition.
The trouble with service partition is that it takes out quite a bit of precious laptop/notebook hard disk space. Normally, ThinkPad users won’t be restore your system frequently, unless system crash occurs. So, service partition is one of the least used component that reside on the hard disk, and thus it can be stored at other medium, such as CD or DVD. Beside, the hard disk in a laptop has the highest possibility of crash or broken. When the hard disk spoilt, you can be sure that the service partition will not be able to use too. So it’s logical too to store the data in service partition as a product recovery CD.

After creating the ThinkPad recovery CD, or if you simply just don’t like the service partition space to be wasted idle, the next step is obviously to reclaim and recover the space that previously occupied by service partition.

Important: Once you remove the service partition, you will not be able to restore your ThinkPad notebook system to original state at it leaves factory, unless you have prepared or have the recovery CD.

The first step to remove ThinkPad service partition is to unhide and unprotect the service partition in the BIOS. ThinkPad BIOS will overwrite the HDD controller so that the disk will assume the space allocated to service partition doesn’t exist in order to safeguard the partition from accidental deletion. Press F1 or Access IBM at the beginning of the boot sequence when the ThinkPad boots up. In the BIOS setup menu, go to Security, and then set the IBM PreDesktop Area to Disabled.

Now you can use any partition manager such as fdisk, diskpart, BootIt NG or Partition Magic to manipulate the partition, either delete the partition and create a new partition on reclaimed space, or merge the service partition to existing partition. If you having trouble trying to delete the service partition, try to boot to DOS, or use a bootable partition manager.

Alternatively, if you have a non-IBM/Lenovo laptop or older IBM/Lenovo laptop that doesn’t HPA-aware, you can download Feature Tool from Hitachi Global Storage Technologies. The IBM’s (Hitachi’s) Drive Feature Tool can also remove the Hidden Protected Area service partition by changing the capacity of the hard disk.

Troubleshoot your computer by using Event viewer

June 12, 2005 Add Comment

Troubleshoot your computer by using Event viewer




The Windows Event Viewer is a handy utility to diagnose computer problems. It keeps a log of what is going on with your computer in respect to applications, security and system services. If you use it in a Windows server environment you will get additional logs on items such as DNS and directory services.


To get to the Event Viewer tool simply right click your My Computer icon and select Manage.
Event Viewer logs are categorized into groups that include informational alerts, warnings and errors. You can sort these entries by type, date, time, source, category, event, user and computer. When you double click an entry you will get more detailed information about that entry.





In this example you can see that the type of the entry is a warning, the source of the error is Symantec AntiViurs and the computer name is JIM. Under the description it tells you that the Symantec AntiVirus could not scan the pagefile.sys file. You can use this information to search the web to find answers to more complicated events by using the Source, Category and Event ID information.
You can also export the event logs to a file if you want to save them or have someone else look at them on their computer. To do this simply right click the log you want to save and pick Save Log File As. You will have an option to save it as an Event Log, text file or CSV file.
To clear the contents of the log file right click the log and pick Clear all Events. It will ask you if you want to save the log before clearing it. 

MOBILE PHONE HARDWARE AND SOFTWARE

May 22, 2005 Add Comment

MOBILE PHONE HARDWARE AND SOFTWARE


MOBILE PHONE HARDWARE
1. POWER SUPPLY SECTION
Mobile Phone is an electronics device, to run any electronics device, “Power Supply” is necessary. Power Supply section of Mobile Phone is:-

a.BATTERY
b.CHARGER
c.BACK OFF BATTERY
b.MMI SECTION – MMI SECTION OR (Main Machine Interface) are basically used to transfer the user data to Motherboard and Motherboard data to User Data.
Example: Keypad, Display, Speaker, Camera etc.

2. MOTHERBOARD – It the Backbone of Mobile Phone. It is a Multilayer Printed Circuit Board (PCB).
That controls all the MMI Component of a Mobile Phone. It contains many electronics components like Resistors, capacitors, diode, transistors, IC, etc.

MOBILE PHONE SOFTWARE

It is a set of program me that start or boot the mobile phone and enable it the Hardware Component to run.


  1. PHONE OPERATING SYSTEM – that boot or start to the Mobile Phone and enable it its entire hardware component to run. It is present in the memory IC of a Mobile Phone. Ex. - Menu Option, Settings, Video Recording, Messaging etc.
  2. DOWNLOADING SOFTWARE – Downloading Software allow transferring Ringtone, Sing tone, Video Clips, Image etc from Computer to Mobile Phone and Vice Versa. Through Data Cable or IRDA.
  3. MULTIMEDIA SOFTWARE – With this Software we can create Ringtone, Sing tone, Image, Video Clips for Mobile Phone.
  4. SERVICE OR REPAIRING SOFTWARE – when any fault arises in the Phone Operating Software like SimLock, Keypad Lock, Network Lock or Contact Service, Phone Hang that we have to repair it through Service or Repairing Software. 

Ex:- J.A.F., UNIVERSAL FLASHER BOX, UFS 3, SPIDERMAN, INFINITY

Search for RapidShare Files with Google

January 01, 2005 Add Comment

Search for RapidShare Files with Google


RapidShare is a free and unlimited file hosting and file storage service that been used frequently to share big files such as music, mp3, video and software to other users in the world. With search technology of Google, we can search for uploaded and shared files in RapidShare.

To search for all RapidShare download links that been posted on the Internet, blogs and forums, use the following search string (including quote):

“rapidshare.de/files”

Alternatively, the following search term can be used to search for all URLs from rapidshare.de domain which, of course, includes all the download links (the search results will be lesser, as not all download URLs are been crawled and indexed):

site:rapidshare.de

You can refine the search by adding the keywords (file format or singer name or etc) that you want to search specifically. As the file name of the uploaded file in RapidShare is actually contained in the download links, so there’re several ways to search for just the file you want by narrowing down the search results.

To search for mp3 audio files only:

“rapidshare.de/files” mp3
site:rapidshare.de mp3
+inurl:mp3 site:rapidshare.de

Note: inurl will search for the URLs that contains the specified keywords only, while the other searches will search for the keywords beyond the URLs, as long as it fulfills the search criteria.

To search for files related to Jessica Simpson only:

“rapidshare.de/files” jessica simpson
site:rapidshare.de jessica simpson
+inurl:jessica|simpson site:rapidshare.de

To search for multiple file format, such as audio and music:

“rapidshare.de/files” mp3 OR wma OR ogg
site:rapidshare.de mp3 OR wma OR ogg
+inurl:mp3|wma|ogg site:rapidshare.de

Modify the above search string to search for the file type you want, such as avi, mpg, rm and wmv for video files or pdf, exe, doc, rar and zip for documents and software programs.

Note: Google will group together related and similar search results. Click on “repeat the search with the omitted results included” to expand the search results to get all RapidShare links.

How to Fix Hardware Correctly of computer

December 07, 2004 Add Comment

How to Fix Hardware Correctly of computer


If you have a hobby in the fields of computer, whether related to hardware, software, and also various kinds of trouble shooting, you've never experienced a variety of interference, whether the error in the hardware, and also problems in the software that you install. Various kinds of disturbances occur frequently, especially if you often assembly the computer. Usually things like this happen at the time you finish up the hardware components, such as hard disk, motherboard, memory, processor, VGA, and another component, and also some hardware support. In making a component of the hardware, then here you have a high accuracy are required, although each is in the hardware design of such system with "Plug and Play", so the possibility of errors can occur reduced.

However, it does not mean mistakes will not happen. For instance, for example, if you install one of the jumpers are on the back of the hard disk drive, the motherboard can not recognize the hard drive. Why? Because if you use a one hard disk only, the software will assume hard disk as "Primary Master", but if you install one in the position of jumpers, for example, the position of "Slave", the BIOS will not recognize the hard drive, so the computer can be a new you just can not install booting process next.

In addition, small errors often occur if you are still using Windows 98 operating system, where you still have to use the startup disk booting, if at the time you finished making the disk booting, and you forget to remove the floppy, then this is also can cause the error occurred, where the error is often to make us dizzy, but the solution is very simple, that is, turn off the computer, then remove the floppy diskette is booting, and then turn on your computer again, enter the BIOS menu, and change the BIOS settings on the menu at the first position HDD, after that press escape key, then your computer will be guaranteed return to normal as they are.

From some of these, then we should note in this case is we have to install all components, whether hardware, software, and also some components that support should be installed in accordance with their respective position, because any little mistake is not justified, because it will cause damage on your computer.

JSE1.5 In A Nutshell

June 01, 2004 Add Comment

JSE1.5 In A Nutshell

I have been wanting to catch up with some of the new features that are being added to J2SE 1.5, but haven't have much time to actually sit down and go through them. A recent article from java.sun.com called "J2SE 1.5 in a Nutshell" caught my eyes, so I decided to read it. I am trying out a new approach where if I would like to remember some of the key points from an article, then I would summarize it in writing similar to a blogging format. So here it is. (BTW this is my first attempt) 


New features of J2SE1.5 can be grouped into the following themes: 


1) Ease of development 

2) Scalability and Performance 

3) Monitoring and Manageability 

4) Desktop Client 

5) Miscellaneous Features 


The following sections will briefly summarize each of the new features in each of the themes 


Ease of development 

================================ 


Metadata 

-------------------------------- 

The ability to associate annotation with Java classes, methods, interfaces, methods and fields. This information can be used by javac or other tools. One example of is for a tool to use the annotation to generate additional source code or provide additional information when debugging. 



Generic Types 

-------------------------------- 

This is concept borrowed from C++ templates. The obvious place to see the benefits of generic types is in the Collection API. This feature will remove the casting when getting an element out of a collection and the collection can be checked for type safety at compile time. This is a really nice feature and developers will like this. Previously some of us wrote our own class to enforce the type, i.e IntegerArrayList. 


Autoboxing 

-------------------------------- 

Converting a primitive type to and from the equivalent wrapper classes is a bit tedious. This feature will leave the job to the compiler to perform the conversion. 


An example from the article: 

-------------------------------- 

ArrayList(Integer) list = new ArrayList<Integer>(); 

List.add(0, new Integer(40)); 

Int total = (list.get(0)).intValue(); 


ArrayList(Integer) list = new ArrayList<Integer>(); 

List.add(0, new Integer(40)); 

Int total = list.get(0); 


Enhanced For Loop 

This feature can be used to traverse through a Collection with style. Developers now can forget about the Iterator.hasNext() and Iterator.next APIs. 


ArrayList<Integer> list = new ArrayList<Integer>(); 

For (Integer I = list) { Â…. } 


The compiler will take care of generating the code to traverse the list. 


Enumerated Types 

-------------------------------- 

This is a convenient feature borrowed from the C language, so one can define a more meaningful type with built in range checking by the compiler. For example: 


public enum MyColor { Red, Green, White, Blue }; 


Static Import 

-------------------------------- 

This is another convenient feature and I really like this one because it allows a class to refer to static constants that are defined in another class or interface with having to extend/implement it. The current practice is to define a set of constants in an interface and the class that would like to use these constants would implements this interface or use fully qualified name. 

With this new feature one can just do this: 


import static java.awt.BorderLayout.*; 


getContentPane().add(new JPanel(), CENTER); 


C Style Formatted Input/Output 

-------------------------------- 

The Formatted Output feature which allow Java developers to have access to the printf-type functionality as in C language to generate formatted output. For example: 


System.out.printf("%s, %5d%n", user, total); 


Output would look something like this: "John Smith, 30.0"; 


The Formatted Input feature will make it easier to read data from the system console or any data stream using the new API from Scanner class. 


Variable Arguments 

-------------------------------- 

Another feature that is borrowed from C language, which will allow a method to accept a variable number of arguments, syntaxttact looks something like this: 


public void myMethod(Object ... args) { 

for (int i = 0; i < args.length; i++) { 



myMethod("one", "two"); 


Concurrency Utilities 

-------------------------------- 

This will be really nice for folks that are really into thread programming, a set of powerful, high level thread construts are being introduced into the Java language. These constructs include executors, thread safe queues, Timers, locks, and others. 


A lot of these are carried over from work that Doug Lea did in his concurrency utility library. 


Simpler RMI Interface Generation 

-------------------------------- 

The dynamica proxyies introduced in JDK 1.3 will obsolete the rmi compiler tool to generate remove interface stubs. 


Scalability and Performance 

================================ 

Some of the work will improve the startup time, memory footprint and make it easier to deploy applications. For a large Java desktop application or application server, this will improve developer productivity. 


Core JVM classes are pre-packed to help improve startup time. 


Much of the work in this feature are behind the scenes, all developers will just feel the different w/o having to do much, which is awesome. 



Monitoring and Manageability 

================================ 

This iniative will try to improve the RAS (Reliability, Availability, Serviceability) the Java platform. 


Using JMX framework, tools will be able to tap into the JVM to do instumentation. MBean can be accessed locally with the same JVM or remotely. 

One can use MBean to detect low memory and notify listeners. 


Remote mamangement of the JVM will available out-of-the-box using jconsole. 


New profiling APIs called JVMTI will added to allow do bytecode instrumentation which is a lot lighter than the existing JVMPI. The will add the flexibility in terms of where and when to perform the instrumentation, for example at runtime, class loading time and pre-processed as class files. 


Diagnostic Ability 

-------------------------------- 

Stack trace can be obtained programmatically using two new APIs, getStrackTrace() and getAllStackTraces() from the current thread. 


Thread.currentThread().getStackTrace() and Thread.getAllStackTraces() 


Desktop Client 

================================ 

A new theme called Ocean has been added to the Swing toolkit. Not sure how nice it is yet, but I am planning to check it out. 


Miscellaneous Features 

================================ 


XML Related 

-------------------------------- 

XML 1.1 with Namespaces and XML schema. Hmmm, wonder what is new in XML schema 1.1? SAX 2.0.2, DOM Level 3 Support and XSLT with a fast compiler. How fast? 

Will have do another blog for this :) 


JDBC RowSets 

-------------------------------- 

Wow, 5 new JDBC RowSet implementations are being added: 


1) JdbcRowSet - encapsulate a result set 

2) CachedRowSet - in-memory and disconnected result set, which can be 

synchronized at a later point. Very cool. 

3) WebRowSet - extends CachedRowSet and can be used to write or read 

the RowSet in XML format. Developers now don't have to write 

custom code generation to generate XML from an application object 

model. 

4) FilteredRowSet - extends CachedRowSet with filtering capabilities 

5) JoinRowSet - extends CachedRowSet that has join capabilities from multiple 

RowSet objects. 


Summary 

================================ 

Wow, that was a long blog. It looks like a bunch of exciting features are being added J2SE1.5, which will improve developer productivity as well as the RAS of the Java platform. I am looking forward to try some of these new features out. Stay tuned for more blogs on Java topic.