At Menu -> Options -> Execution Modes, Click 'BATCH' Button
or
Menu -> Options -> Configuration Wizard -> Start -> Tex Configuration Wizard -> 'BATCH Execution Mode'
Sunday, August 07, 2005
Thursday, August 04, 2005
Extract wav from wmv using Windows Media Format SDK
Modify the AudioPlayer example in the Media Format SDK 9.
There are several things needed to be done:
1. Call IWMReaderAdvanced::SetUserProvidedClock(TRUE) so that the program can use IWMReaderAdvanced::DeliverTime to request the reader to process the stream as fast as possible (ignore actual time)
2. Call IWMReaderAdvanced::DeliverTime in OnTime call back to request the reader process more data
3. Select the audio stream. Get IWMProfile interface by QueryInterface on IWMReader interface. Get the number of streams by IWMProfile::GetStreamCount. Get config (IWMStreamConfig) of each stream by IWMProfile::GetStream. Get the stream type by IWMStreamConfig::GetStreamType. Look for stream with type WMMEDIATYPE_Audio. Get stream number using IWMStreamConfig::GetStreamNumber. Use IWMReaderAdvanced::SetManualStreamsSelection(TRUE) to enable manual stream selection. Use IWMReaderAdvanced::SetStreamsSelected to select the audio stream.
4. Modify OnSample function to write the wav samples to a file.
5. Remove unnecessary part of the program
Note: AudioPlayer sample use asynchronous reader (IWMReader). It might be easier to use the synchronous reader (IWMSyncReader) obtained by WMCreateSyncReader.
There are several things needed to be done:
1. Call IWMReaderAdvanced::SetUserProvidedClock(TRUE) so that the program can use IWMReaderAdvanced::DeliverTime to request the reader to process the stream as fast as possible (ignore actual time)
2. Call IWMReaderAdvanced::DeliverTime in OnTime call back to request the reader process more data
3. Select the audio stream. Get IWMProfile interface by QueryInterface on IWMReader interface. Get the number of streams by IWMProfile::GetStreamCount. Get config (IWMStreamConfig) of each stream by IWMProfile::GetStream. Get the stream type by IWMStreamConfig::GetStreamType. Look for stream with type WMMEDIATYPE_Audio. Get stream number using IWMStreamConfig::GetStreamNumber. Use IWMReaderAdvanced::SetManualStreamsSelection(TRUE) to enable manual stream selection. Use IWMReaderAdvanced::SetStreamsSelected to select the audio stream.
4. Modify OnSample function to write the wav samples to a file.
5. Remove unnecessary part of the program
Note: AudioPlayer sample use asynchronous reader (IWMReader). It might be easier to use the synchronous reader (IWMSyncReader) obtained by WMCreateSyncReader.
Wednesday, July 20, 2005
Adding JDK Javadoc to NetBeans IDE
Download JDK documentation from http://java.sun.com/j2se/1.5.0/download.jsp
Unzip the zip file to the JDK directory
In NetBeans IDE
1. Choose Tools > Java Platform Manager from the main window.
2. Select the platform to which you want to add Javadoc in the left panel of the dialog box.
3. In the Javadoc tab, click Add ZIP/Folder and specify the location of the Javadoc files.
4. Click Close.
Unzip the zip file to the JDK directory
In NetBeans IDE
1. Choose Tools > Java Platform Manager from the main window.
2. Select the platform to which you want to add Javadoc in the left panel of the dialog box.
3. In the Javadoc tab, click Add ZIP/Folder and specify the location of the Javadoc files.
4. Click Close.
Adding CLASSPATH in NetBeans
In the Projects window, right-click the project node and choose Properties.
Click Libraries in the left panel of the Project Properties dialog box.
Adding library path in the right panel.
Click Libraries in the left panel of the Project Properties dialog box.
Adding library path in the right panel.
Wednesday, July 13, 2005
Setup Tomcat with Apache
Requires following steps
1. install JDK ,
j2se 5.0 http://java.sun.com/j2se/1.5.0/index.jsp
2. install Apache http server
Apache 2.0 http://httpd.apache.org/download.cgi
3. install Tomcat
Tomcat 5.x http://jakarta.apache.org/tomcat/index.html
Be sure to use j2se 5.0 for Tomcat 5. Otherwise a compatibility package needs to be installed.
Without compatibility package, tomcat 5 will not run with earlier version of j2se.
Compatibility package:
http://ftp.wayne.edu/apache/jakarta/tomcat-5/v5.5.9/bin/jakarta-tomcat-5.5.9-compat.zip
unzip it can copy to Tomcat directory
After installation, if everything is right, following pages can be viewed:
http://localhost:8080/
http://localhost:8080/jsp-examples/
4. install a connector, in this case JK
http://jakarta.apache.org/site/downloads/downloads_tomcat-connectors.cgi
copy mod_jk-1.2.14-apache-2.0.54.so to the ${apache_home}/modules, rename it to mod_jk.so.
5. configure and test
Add following line to ${tomcat_home}/conf/server.xml, in the <Engine> section,
<Listener className="org.apache.jk.config.ApacheConfig" modjk="C:/Program Files/Apache Group/Apache2/modules/mod_jk.so" />
Create a file ${tomcat_home}/conf/jk/workers.properties
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
Add a line to the end of ${apache_home}/conf/httpd.conf
Include "C:/Program Files/Apache Software Foundation/Tomcat 5.5/conf/auto/mod_jk.conf"
Reference:
Using Apache HTTP with Apache Tomcat(http://johnturner.com/howto/apache-tomcat-howto.html)
Server Configuration Reference
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/index.html
For application deployment (Application directory structure setup)
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/host.html#Automatic%20Application%20Deployment
Jakarta Tomcat Connector - Apache HowTo
http://jakarta.apache.org/tomcat/connectors-doc/howto/apache.html
Jakarta Tomcat Connector - Workers HowTo
http://jakarta.apache.org/tomcat/connectors-doc/howto/workers.html
1. install JDK ,
j2se 5.0 http://java.sun.com/j2se/1.5.0/index.jsp
2. install Apache http server
Apache 2.0 http://httpd.apache.org/download.cgi
3. install Tomcat
Tomcat 5.x http://jakarta.apache.org/tomcat/index.html
Be sure to use j2se 5.0 for Tomcat 5. Otherwise a compatibility package needs to be installed.
Without compatibility package, tomcat 5 will not run with earlier version of j2se.
Compatibility package:
http://ftp.wayne.edu/apache/jakarta/tomcat-5/v5.5.9/bin/jakarta-tomcat-5.5.9-compat.zip
unzip it can copy to Tomcat directory
After installation, if everything is right, following pages can be viewed:
http://localhost:8080/
http://localhost:8080/jsp-examples/
4. install a connector, in this case JK
http://jakarta.apache.org/site/downloads/downloads_tomcat-connectors.cgi
copy mod_jk-1.2.14-apache-2.0.54.so to the ${apache_home}/modules, rename it to mod_jk.so.
5. configure and test
Add following line to ${tomcat_home}/conf/server.xml, in the <Engine> section,
<Listener className="org.apache.jk.config.ApacheConfig" modjk="C:/Program Files/Apache Group/Apache2/modules/mod_jk.so" />
Create a file ${tomcat_home}/conf/jk/workers.properties
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
Add a line to the end of ${apache_home}/conf/httpd.conf
Include "C:/Program Files/Apache Software Foundation/Tomcat 5.5/conf/auto/mod_jk.conf"
Reference:
Using Apache HTTP with Apache Tomcat(http://johnturner.com/howto/apache-tomcat-howto.html)
Server Configuration Reference
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/index.html
For application deployment (Application directory structure setup)
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/host.html#Automatic%20Application%20Deployment
Jakarta Tomcat Connector - Apache HowTo
http://jakarta.apache.org/tomcat/connectors-doc/howto/apache.html
Jakarta Tomcat Connector - Workers HowTo
http://jakarta.apache.org/tomcat/connectors-doc/howto/workers.html
Wednesday, May 18, 2005
USB-400 Wireless Adapter
I finally get my USB Wireless Adapter working properly without the original installation disk and documentation.
The adapter has a model name USB-400. There is no manufacturer name.
Finally, I found the manual, driver & utility can be download from
http://www.syntaxgroups.com/support/downloads.php
The adapter has a model name USB-400. There is no manufacturer name.
Finally, I found the manual, driver & utility can be download from
http://www.syntaxgroups.com/support/downloads.php
Wednesday, April 06, 2005
Install TAO
Prerequirement:
PETSC must be installed
edit : include/tao_sys.h
search for the line: extern int PetscLogInfo(void *,const char*,...);
change to: extern int PetscLogInfo(void *,const char[],...);
This is because the prototype in tao_sys.h is different from that in
petsclog.h of PETSC
Run the following commands
export TAO_DIR=`pwd`
export BOPT=O_c++
export PETSC_ARCH=cygwin-intel
make all
make tao_testexamples >& examples.log
check for errors in examples.log
PETSC must be installed
edit : include/tao_sys.h
search for the line: extern int PetscLogInfo(void *,const char*,...);
change to: extern int PetscLogInfo(void *,const char[],...);
This is because the prototype in tao_sys.h is different from that in
petsclog.h of PETSC
Run the following commands
export TAO_DIR=`pwd`
export BOPT=O_c++
export PETSC_ARCH=cygwin-intel
make all
make tao_testexamples >& examples.log
check for errors in examples.log
Install PETSC on Intel Microsoft Windows 2000
This note describes how to install PETSC on a machine with following specs:
CPU: Pentium 4
OS: Windows 2000
Compiler : Intel Compiler
Math : Intel MKL
MPI : MPICH
Shell: cygwin
Prerequirement:
install MKL: MKL should be in C:\Program Files\intel, with directory name MKL70, MKL61 or MKL, make sure ia32/mkl_c_dll.lib should be the only one library needed
install MPICH: MPICH should be in C:\Program Files\MPICH
edit :
search in *.py for 'C:\Program' and 'cygdrive', change drive letter for your pre-installed software
edit : ${PETSC_DIR}/makefile
search for the FIRST "MINFO_", change MINFO_ to ${MINFO}
remove the next few lines until line: -@$(RM) MINFO MINFO_
change this line to: -@$(RM) MINFO
This is because unknown problem with sed
environment:
adding the MKL DLL directorty to PATH
before entering cygwin, run vcvars32 first to set the environment
entering cygwin
go to root of PETSC
run following commands:
PETSC_DIR=`pwd`; export PETSC_DIR
config/configure.py --with-fc=0 -with-vendor-compilers=intel
make BOPT=O_c++ all
make BOPT=O_c++ test
NOTE: configure.py will use flag -TP for compiling both .c and .cpp files.
If everything is right, configure.py should automatically locate pre-installed
MKL and MPICH. The end of ${PETSC_DIR}/configure.log should look like
following:
Compilers:
C Compiler: /cygdrive/c/users/xw/work/petsc-2.2.1/bin/win32fe/win32fe icl --nodetect -MT
C++ Compiler: /cygdrive/c/users/xw/work/petsc-2.2.1/bin/win32fe/win32fe icl --nodetect -MT -GX -GR -TP
PETSc:
**
** Configure has determined that your PETSC_ARCH must be specified as:
** ** PETSC_ARCH: cygwin-intel
**
**
** Configure has determined that your PETSC_DIR must be specified as:
** ** PETSC_DIR: /cygdrive/c/users/xw/work/petsc-2.2.1
**
** Please make the above changes to your environment or on the command line for make.
**
BLAS/LAPACK: /cygdrive/c/Program\ Files/Intel/MKL70/ia32/lib/mkl_c_dll.lib
MPI:
Type: Default MPICH install location (C:\Program Files\MPICH with MS compatible SDK
Version: 1.2
Includes: ['/cygdrive/c/Program\\ Files/MPICH/SDK/include']
Library: ['/cygdrive/c/Program\\ Files/MPICH/SDK/lib/mpich.lib', 'ws2_32.lib']
Python Configure Actions
These are the actions performed by configure on the filesystem
-----------------------------------------------------------------
PETSc:
Build : Set default architecture to cygwin-intel in bmake/variables
Build : Set default optimization to g in bmake/common/bopt_
File creation : Generated list of jobs for testing in bmake/cygwin-intel/jobs
File creation : Generated list of jobs for testing in bmake/cygwin-intel/ejobs
File creation : Generated list of jobs for testing in bmake/cygwin-intel/rjobs
File creation : Created bmake/cygwin-intel/configure.py for automatic reconfiguration
Framework:
Substitution : bmake/config/rules.in was substituted to produce bmake/cygwin-intel/rules
Substitution : bmake/config/packages.in was substituted to produce bmake/cygwin-intel/packages
Substitution : bmake/config/variables.in was substituted to produce bmake/cygwin-intel/variables
File creation : Created configure header bmake/cygwin-intel/petscconf.h
File creation : Created C specific configure header bmake/cygwin-intel/petscfix.h
CPU: Pentium 4
OS: Windows 2000
Compiler : Intel Compiler
Math : Intel MKL
MPI : MPICH
Shell: cygwin
Prerequirement:
install MKL: MKL should be in C:\Program Files\intel, with directory name MKL70, MKL61 or MKL, make sure ia32/mkl_c_dll.lib should be the only one library needed
install MPICH: MPICH should be in C:\Program Files\MPICH
edit :
search in *.py for 'C:\Program' and 'cygdrive', change drive letter for your pre-installed software
edit : ${PETSC_DIR}/makefile
search for the FIRST "MINFO_", change MINFO_ to ${MINFO}
remove the next few lines until line: -@$(RM) MINFO MINFO_
change this line to: -@$(RM) MINFO
This is because unknown problem with sed
environment:
adding the MKL DLL directorty to PATH
before entering cygwin, run vcvars32 first to set the environment
entering cygwin
go to root of PETSC
run following commands:
PETSC_DIR=`pwd`; export PETSC_DIR
config/configure.py --with-fc=0 -with-vendor-compilers=intel
make BOPT=O_c++ all
make BOPT=O_c++ test
NOTE: configure.py will use flag -TP for compiling both .c and .cpp files.
If everything is right, configure.py should automatically locate pre-installed
MKL and MPICH. The end of ${PETSC_DIR}/configure.log should look like
following:
Compilers:
C Compiler: /cygdrive/c/users/xw/work/petsc-2.2.1/bin/win32fe/win32fe icl --nodetect -MT
C++ Compiler: /cygdrive/c/users/xw/work/petsc-2.2.1/bin/win32fe/win32fe icl --nodetect -MT -GX -GR -TP
PETSc:
**
** Configure has determined that your PETSC_ARCH must be specified as:
** ** PETSC_ARCH: cygwin-intel
**
**
** Configure has determined that your PETSC_DIR must be specified as:
** ** PETSC_DIR: /cygdrive/c/users/xw/work/petsc-2.2.1
**
** Please make the above changes to your environment or on the command line for make.
**
BLAS/LAPACK: /cygdrive/c/Program\ Files/Intel/MKL70/ia32/lib/mkl_c_dll.lib
MPI:
Type: Default MPICH install location (C:\Program Files\MPICH with MS compatible SDK
Version: 1.2
Includes: ['/cygdrive/c/Program\\ Files/MPICH/SDK/include']
Library: ['/cygdrive/c/Program\\ Files/MPICH/SDK/lib/mpich.lib', 'ws2_32.lib']
Python Configure Actions
These are the actions performed by configure on the filesystem
-----------------------------------------------------------------
PETSc:
Build : Set default architecture to cygwin-intel in bmake/variables
Build : Set default optimization to g in bmake/common/bopt_
File creation : Generated list of jobs for testing in bmake/cygwin-intel/jobs
File creation : Generated list of jobs for testing in bmake/cygwin-intel/ejobs
File creation : Generated list of jobs for testing in bmake/cygwin-intel/rjobs
File creation : Created bmake/cygwin-intel/configure.py for automatic reconfiguration
Framework:
Substitution : bmake/config/rules.in was substituted to produce bmake/cygwin-intel/rules
Substitution : bmake/config/packages.in was substituted to produce bmake/cygwin-intel/packages
Substitution : bmake/config/variables.in was substituted to produce bmake/cygwin-intel/variables
File creation : Created configure header bmake/cygwin-intel/petscconf.h
File creation : Created C specific configure header bmake/cygwin-intel/petscfix.h
How to show tootips of a toolbar in a dialog window?
It is easy to add a toolbar to a dialog window. However, it takes some effort to make the tooltips of the toolbar to work. Here are the steps needed to be taken.
1. Add the following line to the message map in the header file of the dialog box
afx_msg BOOL OnToolTipText(UINT nID, NMHDR* pNMHDR, LRESULT* pResult);
2. Add the following line to the cpp file of the dialog box
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipText )
BOOL CConfBrowser_MFCDlg::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult)
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
UINT nID =pNMHDR->idFrom;
if (pTTT->uFlags & TTF_IDISHWND)
{
// idFrom is actually the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
}
if (nID)
{
pTTT->lpszText = MAKEINTRESOURCE(nID);
pTTT->hinst = AfxGetResourceHandle();
return(TRUE);
}
return(FALSE);
}
1. Add the following line to the message map in the header file of the dialog box
afx_msg BOOL OnToolTipText(UINT nID, NMHDR* pNMHDR, LRESULT* pResult);
2. Add the following line to the cpp file of the dialog box
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipText )
3. Add following line to InitDialog()
EnableTooltips();
4. Add the following function
BOOL CConfBrowser_MFCDlg::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult)
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
UINT nID =pNMHDR->idFrom;
if (pTTT->uFlags & TTF_IDISHWND)
{
// idFrom is actually the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
}
if (nID)
{
pTTT->lpszText = MAKEINTRESOURCE(nID);
pTTT->hinst = AfxGetResourceHandle();
return(TRUE);
}
return(FALSE);
}
Subscribe to:
Posts (Atom)