select translate(<column>,
'ABCDEFGHIJKLMNOPQRSTUVWXY0123456789',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ') from dual;

select translate(<column>,
'ABCDEFGHIJKLMNOPQRSTUVWXY0123456789',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ') from dual;
Ketentuan by Ramlah Ram
Tak semudah kau sangka
Melepaskan kau pergi
Continue reading ‘My favourite song ever’
Just went back from visiting and checking our house progress. So far so good, can’t wait to see the finishing
You might encounter this error
Parse error: syntax error, unexpected $end in C:\Program Files\Apache Group\Apache2\htdocs\wordpress\wp-content\themes\hemingway\functions.php on line 647
when installing new themes for WordPress. I did encounter this when i have
running on my server.
Continue reading ‘PHP Parse Error: syntax error, unexpected $end on wordpress’
At last i found a library to untar / tar files using JAVA. Here i provide an example how to use the library. Some of the codes have been taken from other users in forums to enhance the code.
import com.ice.tar.TarInputStream;
import java.io.File;
import java.util.zip.GZIPInputStream;
import com.ice.tar.TarEntry;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.io.*;
//————–
public void execute() {
TarInputStream tin = null;
try {
tin = new TarInputStream(new GZIPInputStream(new
FileInputStream(new File(tf.getTarFileName()))));
TarEntry tarEntry = tin.getNextEntry();
while (tarEntry != null) {
File destPath = new File( +
File.separatorChar +
tarEntry.getName());
if (!tarEntry.isDirectory()) {
// start of new code
String pathStr = destPath.getPath();
int idx = pathStr.lastIndexOf(File.separatorChar);
if (idx > 0) {
File destDir = new File(pathStr.substring(0, idx));
destDir.mkdirs();
}
// end of new code
FileOutputStream fout = new FileOutputStream(destPath);
tin.copyEntryContents(fout);
fout.close();
}
else {
destPath.mkdir();
}
tarEntry = tin.getNextEntry();
}
tin.close();
}
catch (IOException ex) {
ex.printStackTrace();
}
}
Basically JDK1.4 has provided a library call java.util.zip for compressing and uncompressing gzip files.
try {
// Open the compressed file
String inFilename = “infile.gz”;
GZIPInputStream in = new GZIPInputStream(new FileInputStream(inFilename));
// Open the output file
String outFilename = “outfile”;
OutputStream out = new FileOutputStream(outFilename);
// Transfer bytes from the compressed file to the output file
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
// Close the file and stream
in.close();
out.close();
} catch (IOException e) {
}
You may using Windows as your database server, but don’t know how to backup it, and some of you may use tools. You can actually do it by running this command
“C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqldump.exe” –host=localhost -uroot -ppassword –opt mydatabase > “C:\helmy\backup\%date:~10,4%_%date:~4,2%_%date:~7,2%_backup.sql”
It will create a file 2008_04_04_backup.sql
If you want to schedule it, put it on a backup_db.bat and ask Windows Task Scheduler to run it
Don’t know how to get yesterdays date in linux
$ date –date=’2 year ago’ # past
$ date –date=’3 years’ # go into future
$ date –date=’2 days’ # future
$ date –date=’1 month ago’ # past
$ date –date=’2 months’ # future
Use it in your shell script
Please refer to this article , it is to complex for me to explain back
http://articles.techrepublic.com.com/5100-9592-5259821.html
Below example explains, 1 way to remove duplicate data. tmp_data table contains 6millions of record, but with duplicate. Table tmp_duplicate contains all duplicates data that exists in tmp_data.
create or replace procedure delete_duplicate is
cursor c is select sn from tmp_data a where a.sn in (select sn from tmp_duplicate);
type c1_type is table of c%rowtype;
l_c1 c1_type;
begin
open c;
loop
fetch c bulk collect into l_c1 LIMIT 1000;
for i in 1 .. l_c1.count
loop
–Expecting to do the delete
dbms_output.put_line(‘Delete this ‘ || l_c1(i).sn);
end loop;
dbms_output.put_line(‘———————-’);
exit when c%notfound;
end loop;
close c;
end delete_duplicate;