Mar 22, 2011

Simple CSS TAB


border-radius: 5px 5px 0 0;
-moz-border-radius: 15px 5px 0 0;
-webkit-border-top-left-radius: 15px;
-webkit-border-top-right-radius: 5px


Orginal page

Feb 2, 2011

Java - Absolute path

Tricks here is first create a temporary and get the absolute path.

package com.mkyong.file;

import java.io.File;
import java.io.IOException;

public class GetTempFilePathExample
{
public static void main(String[] args)
{
try{
//create a temp file
File temp = File.createTempFile("temp-file-name", ".tmp");

System.out.println("Temp file : " + temp.getAbsolutePath());

//Get tempropary file path
String absolutePath = temp.getAbsolutePath();
String tempFilePath = absolutePath.
substring(0,absolutePath.lastIndexOf(File.separator));

System.out.println("Temp file path : " + tempFilePath);
}catch(IOException e){
e.printStackTrace();
}
}
}

Jan 25, 2011

Java Simple Code

PHp var_dump for Java Equivalent



import java.lang.reflect.*;
....
//o Object..
Field[] fields = o.getClass().getDeclaredFields();
for (int i = 1; i < fields.length; i++
try {
System.out.println(fields[i].getName() + " - " + fields[i].get(o));
} catch (java.lang.IllegalAccessException e) {
System.out.println(e);
}

Jan 23, 2011

Setting Up WikiPedia

Download: http://www.mediawiki.org/wiki/Download

Extract the file.

Set the config dir to writable.

Access the site

Configure the database setting

Set to private data


edit the includes/DefaultSetting.php

$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['read'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['createpage'] = true;
$wgGroupPermissions['*']['createtalk'] = true;
$wgGroupPermissions['*']['writeapi'] = true;

to

$wgGroupPermissions['user']['createaccount'] = true;
$wgGroupPermissions['user']['read'] = true;
$wgGroupPermissions['user']['edit'] = true;
$wgGroupPermissions['user']['createpage'] = true;
$wgGroupPermissions['user']['createtalk'] = true;
$wgGroupPermissions['user']['writeapi'] = true;