Posts RSS Comments RSS 129 Posts and 246 Comments till now

Archive for June, 2007

Sodeve’s WP-Translate 2.2 Released

Hi all. I have managed to patch the WP-Translate and tested it on Wordpress 2.2.

Current Version: 2.2

Overview

WP-Translate is a simple drop in way for users to view your blog in their language. Its easy for any most users to add this functionality to their site.

WP-Translate utilizes the following Online translation services:

  1. Alta Vista’s Babel Fish (for translation from English to : French, German, Italian, Dutch, Spanish, Greek, Russian, Portuguese, Japanese, Korean, Simplified/Traditional Chinese)
  2. IBM’s Websphere Translation (for translation from English to: Brazilian Portuguese)
  3. Interpret (for translation from English to: Bahasa Indonesia, Swedish, Norwegian, Afrikaans)

WP-Translate 2.2 Release Notes

Added the following language for translation:

  1. Swedish
  2. Norwegian
  3. Bahasa Indonesia
  4. Afrikaans
  5. Chinese Traditional
  6. Brazilian Portuguese

Requirements

WP-Translate works with Wordpress 1.5 up to Wordpress 2.2 (Tested on Wordpress 2.2)

Your web server should able to execute PHP.

Installation instructions

  1. Upload the wp-translate directory to your plugins folder, usually wp-content/plugins/
  2. Activate the plugin on the plugin screen.
  3. Add <?php wptranslate(n); ?> to your template where you want the list. n can be either 1 or 2. 1 is for a vertical display. 2 makes it horizontal.

Special Installation instructions for non-Wordpress users

As I mentioned before, as long as your Web server supports PHP you should be able to use this plugin. Please follow this steps:

  1. Extract the zip file
  2. Edit wp-translate.php which is located in wp-translate directory
  3. At line 103, replace $img_loc = get_settings(’siteurl’) . ‘/wp-content/plugins/wp-translate’; with $img_loc = ‘/wp-translate’;
  4. Save the file
  5. Upload the wp-translate directory to your root folder.
  6. In the page you want the flags to be displayed, put <?php include_once(realpath($_SERVER[’DOCUMENT_ROOT’]).’/wp-translate/wp-translate.php’); ?> in the first line of the file.
  7. Add <?php wptranslate(n); ?> anywhere you want the flags to be displayed. n can be either 1 or 2. 1 is for a vertical display. 2 makes it horizontal.

 

Download Sodeve’s WP-Translate 2.2

The previous version can be found here:Sodeve’s WP-Translate 2.1

 

If you like this plugin, please link-back to this post, or add me to your blog-roll. Would be greatly appreciated. Thank you.

Having problem with installing the plugin? You have ideas for the plugin? Post a comment and I will try my best to help you.

Update: 5 June 2007

Users of this plugin:

  1. Myself (^_^)v
  2. Founders Cafe
  3. Your Blog?

So You Like MS Paint? Here is the Free and Much much better Replacement

I like MS Paint for its simplicity. It’s small, fast, and quite handy for creating a simple button/banner (Like the one you see below Capt. Jack Sparrow’s picture on the sidebar).

Until I found Paint.NET. This program’s loading time is slower to MS Paint by less than 1 second. So it’s nothing to complain. The interface is almost similar to MS Paint

Some feature comparison between MS Paint and Paint.NET:

Features MS Paint Paint.NET
Tabbed document interface no yes
Layers no yes
Live thumbnail no yes
Number of Colors Supported 28 (although you can select other colors by going through the menu: Colors - Edit Colors - Define Custom Colors) alot :P
Special Effects (sharp, blur, emboss, distortion, etc.) no yes

 

And a lot more features …

And the best part, it’s open source. The online community is very active. So you can expect many plugins written by the community.

Paint.NET Minimum System Requirements:

  • Windows XP (SP2 or later), or Windows Vista, or Windows Server 2003 (SP1 or later)
  • .NET Framework 2.0
  • 500 MHz processor (Recommended: 800 MHz or faster)
  • 256 MB of RAM (Recommended: 512 MB or more)
  • 1024 x 768 screen resolution
  • 200+ MB hard drive space
  • 64-bit support requires a 64-bit CPU that is running a 64-bit version of Windows XP, Windows Vista, or Windows Server 2003, and an additional 128 MB of RAM

Get Paint.NET Now!!!

GUI Threading: A Beginner’s Help

GUI Programming used to be one of my nightmare in programming. I had a hard time understanding the concept and implemented it in my Windows Application. The good news is, I now know a little bit about it (^_^)/. Now by writing it into a blog post, I actually helping myself to understand the concept better, and hopefully, it might help others in one way or another. :-)

In this project, we will create a stopwatch (might be useful to track-down how long you need to create a blog post (^_^)/ ). OK, now please open your Visual Studio, and create a Windows Application. Name the project ‘ThreadingGUI_02′. After that, design the form to look something like this:
threading_02_form.png

So the idea is to create a process that will have a counter, increase the counter value and update the GUI every 0.1 seconds. In order to keep the GUI responsive to user’s actions, the actual processing should be done in different Thread. We also need to create a delegate, this way the the worker thread will be able to access the GUI thread and updates the corresponding labels.

Form1.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace ThreadingGUI_02
{
   public delegate void RefreshGUI(int i);

   public partial class Form1 : Form
   {
      Worker w;
      RefreshGUI myUpdateCounter;
      Thread t;
      public void UpdateCounter(int c)
      {
         if (this.InvokeRequired)
         {
            this.Invoke(myUpdateCounter, c);
         }
         else
         {
            int ms = c % 10;
            int second = (c / 10) % 60;
            int minute = (c / 600) % 60;
            int hour = (c / 36000) % 24;
            this.lblHour.Text = hour.ToString("00");
            this.lblMinute.Text = minute.ToString("00");
            this.lblSecond.Text = second.ToString("00");
            this.lblMiliSecond.Text = ms.ToString("0");
         }
      }
      public Form1()
      {
         InitializeComponent();
         myUpdateCounter = new RefreshGUI(UpdateCounter);
         w = new Worker(myUpdateCounter);
         t = new Thread(new ThreadStart(w.Counting));
         t.Start();
      }

      private void button1_Click(object sender, EventArgs e)
      {
         Button b = (Button)sender;
         b.Text = b.Text == "Start" ? "Stop" : "Start";
         w.isCounting = b.Text == "Stop";
         this.button2.Enabled = b.Text == "Start";
      }

      private void button2_Click(object sender, EventArgs e)
      {
         w.count = 0;
         int c = 0;
         int ms = c % 10;
         int second = (c / 10) % 60;
         int minute = (c / 600) % 60;
         int hour = (c / 36000) % 24;
         this.lblHour.Text = hour.ToString("00");
         this.lblMinute.Text = minute.ToString("00");
         this.lblSecond.Text = second.ToString("00");
         this.lblMiliSecond.Text = ms.ToString("0");
      }

      private void Form1_FormClosed(
         object sender,
         FormClosedEventArgs e)
      {
         t.Abort();
         t = null;
      }

      private void label5_Click(
         object sender,
         EventArgs e)
      {

      }
   }
}

 

Add a new class, and name it Worker.cs:

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace ThreadingGUI_02
{
   class Worker
   {
      RefreshGUI update;
      public bool isCounting;
      public int count = 0;
      public Worker(RefreshGUI d)
      {
         update = d;
         isCounting = false;
      }
      public void Counting()
      {
         while (true)
         {
            if (isCounting)
            {
               ++count;
               if (update != null)
                  update(count);
            }
            Thread.Sleep(100);
         }

      }
   }
}

So as you see in the codes above, the logic of program would be:

  1. the main thread (a.k.a the GUI thread) instantiates the delegate
  2. GUI thread instantiates the worker thread, and pass the delegate object to worker thread object
  3. GUI thread starts the worker thread object
  4. the worker thread updates the GUI thread object using delegate
  5. the worker thread sleeps for a 0.1 seconds (If you do not need the 0.1 seconds delay, you could comment the Thread.Sleep(100); line)

 

This is example is not really a good example in threading since we never protect the ‘Critical Section‘ of the program with Mutex/Semaphore. Maybe in the future we will discuss how to prevent deadlock using Mutex/Semaphore.

For those who are lazy to copy and paste (^_^) into their Visual Studio, you can download the project solution: Threading GUI - Stopwatch

Pirates of Caribbean 3: Back at Square Zero


I watched the movie last Friday two weeks ago (25/05/2007) together with Artha. We watched it at Golden Village, Jurong Point. The show started at 1 AM. There were around 20 people that watched the movie. I guess not many people in Jurong West area were willing to watch the movie after midnight. (T_T)

Generally, I think the movie is mediocre great. Captain Jack Sparrow is still partially drunk. Although now he starts to hallucinate. Elizabeth Swann might won Oscar for ‘Heroine with the biggest shotgun hidden in her pants‘. As for William Turner, a surprising end is waiting for him. Not going to be a spoiler post here (^_^)/

Favorite scenes:

  1. Elizabeth Swann disarmed herself. That scene is hilarious
  2. Jack Sparrow talked to Capt. Teageu ( Jack’s father, a cameo by Keith Richards).
  3. Jack Sparrow talked to Giselle and Scarlett. Jack’s words basically sum up all the lies that most men ever committed to their partner. Classic!!!
  4. The battle scene Between Black Pearl v.s. Flying Dutchman. I think this battle is the pinnacle of the movie.

A few days later, Artha mentioned that after the credits there is an easter-egg scene. And we missed it. That night I was somehow quite disappointed with the movie and rushed out of the theatre.

And last Wednesday (30/05/2007), Yoga asked me whether I have watched Pirates of Caribbean 3. I answered ‘No’ because I was thinking to repay him back his treat (He bought me the ticket for Pirates of Caribbean 2). Also, I just recently receive my first pay check from NTUC Income. So a small treat to a friend shouldn’t be a harm, right?

We watched the movie at The Cathay. To my surprise, I enjoy the movie better than the first time. No more conundrums after watching the movie. So if you think Pirates of Caribbean 3 is confusing, watch it again :-) And make sure you are not watching the after midnight show time.

So what’s with the title of this post? Back at Square Zero? Well, only those who have watched the movie know what it means =P So go get your movie ticket! (^_^)

8 Random Facts

I was tagged by Pieter Marbun yesterday.

The Rules:

* Players start with 8 random facts about themselves.
* Those who are tagged should post these rules and their 8 random facts.
* Players should tag eight other people and notify them that they have been tagged.

Eight random facts about me:

  1. Born in a village called Mojowarno. Mojowarno is a combination of two words, Mojo = is a kind of unedible fruit. Warno=Colour. The naming might be related to Mojopahit, a historical kingdom which was located relatively near to my village.
  2. Frequently mistaken as Filipino (^_^) In reality, I am a pure breed Indonesian Javanese (Well I can’t really say I’m pure breed since I never test my DNSA. Although I know exactly my lineage up to my great grandparents. All of them are Java programmer nese. (^_^)/ )
  3. Loves spicy foods
  4. Wanted to become a pirate. But turned off by Pirates of Malacca Straits. These pirates are neither cool nor savvy. They are just purely violent criminals.
  5. Lamb Chop with Black pepper sauce is probably the most frequent food I ordered in any food court
  6. The eldest of 4 brothers. That movie very unlikely to be inspired by me and my brothers :D
  7. Believes in afterlife. Although I am in constant fight between good and evil (T_T)
  8. Procrastinates frequently =P

I shall continue to pass the tags to:

  1. Made Adi
  2. Gede Artha
  3. Adhi Wibowo
  4. Haqi
  5. Brett Mckay
  6. Culture Shiok!
  7. Lisa
  8. Karen

Keep it going …..

Close
E-mail It
Socialized through Gregarious 42