Posts RSS Comments RSS 129 Posts and 246 Comments till now

Archive for May, 2007

BUG FIX: How To Kill MS Excel Process Started by ASP.NET

On 18th May 2007, Tanmoy commented on “How To Kill MS Excel Process Started by ASP.NET”.

Initially on denial (^_^)/, I finally have time to investigate the issue. Tanmoy actually got it correctly. So I created a new GUI demo on how to correctly kill a particular Excel process.

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

namespace ThreadingGUI_01
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            ApplicationClass app = new ApplicationClass();
            if (app == null)
            {
                MessageBox.Show("Unable to Open Excel");
            }

            app.Visible = true;
            _Workbook wb = app.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);
            this.listBox1.Items.Add(app.Hwnd);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (this.listBox1.SelectedIndex >= 0)
            {
                Process[] procs = Process.GetProcessesByName("EXCEL");
                int selectedExcel = (Int32)this.listBox1.SelectedItem;
                foreach (Process p in procs)
                {
                    if (p.MainWindowHandle.ToInt32() == selectedExcel )
                    {
                        p.Kill();
                        this.listBox1.Items.Remove(selectedExcel);
                    }
                }
            }
        }
    }
}

Thanks to Tanmoy (^_^)/

Download the Project here.

SODEVE’s WP-Translate, Blogger Edition

Larry Keiler asked me whether the Sodeve’s WP-Translate works on Blogger. The answer is no. This is because Blogger doesn’t use PHP (frankly, I’m don’t know. My hunch tells me it’s running on Python.)

I actually have written the JavaScript version of the plugin. You could see it running here.

Basically it consists of two parts, the JavaScript, and HTML. You could host the images in your own blogs, but it would be tedious to add the flags one by one. So I put them up at PhotoBucket. This way you can just copy and paste into your Blogger layout.

Javascript Part:


HTML Part:

Back to English English to German English to Spanish English to French English to Italian English to Portuguese
English to Dutch English to Greek English to Nippon English to Korean English to Russian English to Simplified Chinese

So now how to add it to Blogger? Please follow this steps:

  1. Login to Blogger
  2. Go to Dashboard, then click Layout
    Blogger's Dashboard
  3. At the sidebar location. Click “Add a Page Element”
     Blogger - Add a Page Element
  4. A new window will pop-up. Select ‘HTML/Javascript’, click ‘Add to Blog’
  5. You now will have a text box and a text area. Leave the title blank. Copy the code described in the ‘Javascript Part’, then paste it in the text area. Then copy the code from ‘HTML Part’, and paste it also in the text area. Inside the text area, separate the Javascript and the HTML with one line.

You are good to go. If you like this tips, I would be grateful if you link-back to this blog. Thanks.

Good luck with your Blogger (^_^)/

List of Bloggers that use Sodeve’s WP-Translate, Blogger Edition:

  1. My Demo Site
  2. Your Blog?

How To Translate Your Blog Into Multiple Languages

A few days back, Dorota asked me to share the trick of those flags under this blog title. So here you are the Wordpress plugin.

This plugin initially developed by Scott Hough. The original translation service used was Google Translate. But I was disappointed by the frequent errors thrown by Google Translate. Another bug was, you cannot translate more than once. To translate into other language, you need to go back to the original page and click different flag.

Requirements:

  1. Your blog must be written in English. This is because only this language can be translated into many languages by Babel Fish.
  2. You are using Wordpress 1.5 and above. It’s tested in Wordpress 2.1 (this blog (^_^)v )
  3. You have access to install the plugin

Installation and Usage Guide:

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

For non Wordpress user, you can still use this plugin provided your Web Server supports PHP. To do so, 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.

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.

Download:
Sodeve’s WP-Translate 2.1

Update: 19 May 2007

Users of this plugin:

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

How Deus Ex Machina Ruined Spider-Man 3

black spidey

Deus ex machina describes an unexpected, artificial, or improbable character, device, or event introduced suddenly in a work of fiction or drama to resolve a situation or untangle a plot (e.g. having the protagonist wake up and realize it was all a dream, or an angel suddenly appearing to solve problems).

So how did Deus ex Machina ruined Spider-Man 3? Well, the most obvious one is Bernard, the servant in Osborn’s penthouse. Why he finally informed Harry Osborn the story that make him forgive Peter Parker and helped Spidey to fight Venom and Sandman now? Why not in Spider-Man 2? Did you spot other deus ex machina in the movie?

The overall movie is quite a disappointment for me. The CGI offers nothing new, the plot is weaker than the first and the second instalment of the Trilogy. I am really sure Tobey Maguire will not win Oscar for his crying act (^_^)v. Pff.. enough with the disappointment, I’ll hyped up myself for Pirates of Caribbean 3. Hopefully dear old Jack will make a blast ending to the trilogy.

Heck, at least I’m not the only one thinking that Spider-Man 3 sucks.

Working in A Niche Industry

I received a call from Mr. Karthy today few days back. He was telling me that there is a new job opening for Coldfusion programmer. I politely declined the invitation and promised him that I will refer to him in case any friend of mine is looking for job as Coldfusion programmer.

From my very limited and narrow point of view, it seems there is a scarcity of Coldfusion programmers in Singapore. It seems that not many people are banking their option on Coldfusion. I guess everyone here are jumping bandwagon to become either .NET developer, or Java developer.

Although I can’t really say that Coldfusion is old technology since the underlaying technology is Java. But I can make a case where Coldfusion as a niche technology (at least here in Singapore ^_^). Do you think it’s OK to jump bandwagon?

I think it’s quite humane. Java and .NET combined, provide bigger number of jobs. So people would assume that .NET and Java are the safest bet to get employed. And it’s normal human behaviour to be afraid of uncertainty, and pursue something with more certain possibility.

On the other hand, looking at JobsDB.com, actually many positions are offered for RPG programmers, COBOL, and the offered salary is always above the mainstream programmer. In a discussion over lunch, a senior colleague advises me that the back-end processing of banking/financial industry is still using RPG on AS400. I argued that they are just contemplating between the costs and the benefits of upgrading to more modern system. I told him the story from my previous work place which uses COBOL on AS/400 for their purchasing system. During my tenure there, at one time, there was a team from head-quarter visiting the office, evaluating the infrastructure. When I queried the team leader, he said that starting on June next year (it means this year), all system will be replaced with .NET Smart Application. The application will connect all aspects of the company, purchasing, operation, finance, and human resource. All in one package. So it seems everyone sooner or later will move on to the new technology.

Now, my questions are, if you are working in those niche industry, will you stay and keep on receiving higher salary than the average .NET/Java programmers? Do you have any backup plan once your company decided to move on? I believe it would be interesting experience to share.

Pages (3): [1] 2 3 »

Close
E-mail It
Socialized through Gregarious 42