Jul 23, 2007

Location of flashlog

Since I changed my computer from XP to Vista, today is first time to use trace function of AS3. First, I created file named mm.cfg and wrote these lines.

TraceOutputFileName=D:\Users\\Documents\AS3\trace.txt
ErrorReportingEnable=1
TraceOutputFileEnable=1


But this did not work. I changed all the backslashes into slashes, but nothing has changed. I removed the first line to put the output file in default location, then it worked. Even TraceOutputFileName is not an necessary option, this behavior is strange.

I found the answer of this problem in the LiveDocs.

Note: Beginning with the Flash Player 9 Update, Flash Player ignores the TraceOutputFileName property.


TraceOutputFileName no longer works.

Jul 18, 2007

Poor Japanese VS2005 Express

Playing with Orcus is something exciting, but VS2005 Express Edition is still good choice for indie programmers. You can get it by pushing 'Go' button at here.

Japanese version is somehow complicated. When you click 'Web からインストール', you will be requested to log into msn. Moreover, an annoying form will appear that must be filled out. Your name, email address, address of work location, and some questionnaires will be needed. But you can download Japanese version from English site. Of course, a key to activate Visual Studio is needed.

Jul 15, 2007

Use macro for dynamic linking of DLL

Dynamic linking of DLL needs more code than static linking. We have to use GetProcAddress() API for each functions. It may cause bug if we make typo.
m_fnSetCommInfo =
  reinterpret_cast< FnSetCommInfo >(
  ::GetProcAddress( m_hLibrary, "SetCommInfo" ) );
m_fnGetCommInfo =
  reinterpret_cast< FnGetCommInfo >(
  ::GetProcAddress( m_hLibrary, "GetComInfo" ) ); // <-- Ahh !!
Define statement prevents such bug.
#define LOAD_FUNCTION(name) \
  m_fn##name = reinterpret_cast< Fn##name >( \
  ::GetProcAddress( m_hLibrary, #name ) );

LOAD_FUNCTION( SetCommInfo );
LOAD_FUNCTION( GetCommInfo );
This is easier to read. Macro sometimes prevents bug.

Jul 9, 2007

Adding feed subscriber to Firefox



There is RSS button on the address bar of Firefox when a web site is providing feed. You can add any feed subscriber by doing follows:
  1. Input about:config into address bar.
  2. See there are some browser.contentHandlers.types.N.(title|type|uri) entries.
  3. Add subscribers after them.
For example, I add Fastladder by adding these entries.
  • browser.contentHandlers.types.6.title = Fastladder
  • browser.contentHandlers.types.6.type = application/vnd.mozilla.maybe.feed
  • browser.contentHandlers.types.6.uri = http://fastladder.com/subscribe/%s

running svk

Running svk is not hard, however some terms are different from svn's ones. commit is push and update is pull. These may be more intuitive terms than svn's. As I said, svk can reduce revision number of repository. To do this, use -l option for push that means merge everythins into a single commit log.
svk push -l //local/YourProject
Then you can commit your source files after changing few lines without worrying about revision number. I think this is most important thing for refactoring.

Another first step guide of svk. Simple and easy to understand. I do not need boring text but really need sample code or command. When there is something unclear, I will search official document that is more accurate, reliable one than somebody's blog.

Jul 8, 2007

install svk

I know Mercurial is a great SCM system which is called distributed one. I am using svn and commiting my code many times when I made changes. It may disturb others because revision number changes frequently. Distributed SCM systems are different, however they do not have integrated GUI like TortoiseSVN. Even if Mercurial got such interface, repositories I am working on are still svn's one. svk is a solution to use svn as distributed one. I refered these sites to install svk. At the moment, I made a copy of remote repository and checked out files from there. Revision number had been smaller. It seems that revisions are skipped which are not related to files I got from remote repository. This may be a problem when I use svn:keyword like $Id$ or $Rev$. Later, I will write about it.

template typedef

Last week I knew this code is possible to compile.
typedef CWindowImpl<Hoge> CWindowImpl;
I felt it is a little strange. I could not understand how the compiler interpret these two symbols are different ones. Today, I replaced strtok by boost::tokenizer for better security and readability. Some code fragments I've found via Google used typedef like above. Perhaps it is possible because their namespaces are different, boost and other. I will continue to use this idiom for readability especially code using boost and WTL.

Jul 5, 2007

First post

MUDAI, no title, aucun titre, kein Titel, ...