Home

Article about metrics and code analysis published

kinow @ Sep 03, 2010 11:25:45 ()

I wrote an article about a quality analysis job done for a client of Sysmap Solutions and it was published by TestingExperience Magazine on its issue of September, number 11.

You can check the full article in TestingExperience site. It is available in PDF format for members, the registration if free though.

Happy reading.

CafePress Hudson Store

kinow @ May 28, 2010 14:38:22 ()

If you use Hudson as build trigger, continuous integration system or crontab replacement, you can contribute to Hudson buying from CafePress Hudson Store. I bought a polo shirt few months ago. It was my first acquisition from CafePress and I was worried about quality and the difference in sizes from US and Brazil.

However the quality was very good and it fitted perfectly. I wear P in Brazil and bought a S white polo shirt. I believe that after the currency conversion, I paid like R$ 30 plus post.

CCM Hudson Plugin

kinow @ Apr 07, 2010 16:59:24 ()

CCM is a tool developed by Jonas Blunck (http://www.blunck.se). It’s able to calculate the cyclomatic complexity (McCabe) of a .NET Project or Solution.

I developed TestLink Hudson Plug-in, a Hudson Plug-in that lets you invoke CCM from hudson and have the results displayed in the console output. I chose CCM as CC tool for .NET instead of SourceMonitor after it gave me a CC value of 4 for a method I was sure was supposed to have 5.

Cheers

Code to change your message in MSN messenger

kinow @ Mar 22, 2009 14:31:18 ()

I’ve always wanted to know how does the code to show what was I listening to looked like. I found it after installing XMPlay and XMPlay MSN Plug-in. The plug-in zip had the plug-in itself and its source code. And what a neat source code (-:.

Basically, you just send a message to the MSN UI API with a defined data structure. And to remove the message, just send again with an empty string.

/*
Bruno de Paula Kinoshita
original src code:
XMPlay MSN Plugin (c) 2005-2006 Elliott Sales de Andrade
*/

#include <cstdlib>
#include <iostream>
#include <windows.h>

using namespace std;

typedef struct {
BOOL showCues;
BOOL keepOnClose;
} MSNStuff;
static MSNStuff msnConf;

void setNowPlaying( char *title)
{
    wchar_t *lpMsn;
    int strLen = 20;
    HWND xmpwin;
    HWND msnui=0;

    lpMsn = (wchar_t*)calloc(1024,1024);
    // stuff for MSN before...
    memcpy(lpMsn, L"\\0Music\\01\\0{0}\\0", 17*2);
    // actual title...
    strLen=MultiByteToWideChar(false?CP_UTF8:CP_ACP,0,title,-1,lpMsn+17,492)-1;  /* 1024/2 - 20 */
    // stuff for MSN after...
    memcpy(lpMsn + 17 + strLen, L"\\0", 3*2);
    strLen += 20;

    COPYDATASTRUCT msndata;
    msndata.dwData = 0x547;
    msndata.lpData = (void*)lpMsn;
    msndata.cbData = strLen * 2;

    while ( msnui = FindWindowEx(NULL, msnui, "MsnMsgrUIManager", NULL) )
        SendMessage(msnui, WM_COPYDATA, (WPARAM)xmpwin, (LPARAM)&msndata);
}

int main(int argc, char *argv[])
{
    char *title;

    if ( argc == 1 )
        title = "";
    else
        title = argv[1];

    setNowPlaying ( title );

    return EXIT_SUCCESS;
}

Displaying Japanese characters in Java Swing

kinow @ Mar 06, 2009 12:10:07 ()

It’s not as complicated as I first thought.

Had to use this technique to develop an Swing application for the JLPT certification exam.

public static void main(String[] args) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container container = frame.getContentPane();
    JLabel japanese = new JLabel( "Kino\u304D\u306E" );
    japanese.setToolTipText( "This is Japanese" );
    Font f = new Font("Arial Unicode MS", Font.BOLD, 16);
    japanese.setFont(f);
    container.add( japanese );
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
}

All you have to do is to use the hexadecimal representation of the characters instead of using plain text. And here is the result.

Banzai!