Wednesday, June 23, 2010

TClock2ch-081012

Changelog:
- [100622] update sources to TClock2ch-081012.
- [100622] add ToolbarWindow32 task switch class detection.
- [080624] A bit modified about the removal of top black line of transparent taskbar.

Download: TClock2ch-081012x.7z

Sunday, March 21, 2010

HTTPing-1.4.1 (Win32)

Quite heavily hacked for MinGW build environment. OpenSSL is not enabled in this build and OpenSSL support is untested.
Download: httping-1.4.1-win32.7z (source and binary)

Recommended usage:
httping -r -g http://address/
[Ctrl]+[C] to abort.

Saturday, March 6, 2010

Fix breakage on current Firefox trunk in cygwin build environment

Today's update in Firefox trunk breaks in my cygwin build environment, following modifications applied and fix building breakage.

  • cygwin_wrapper: escape <xxx> to \<xxx\>, new cygwin_wrapper look like this:
    #!/usr/bin/perl
    $prog=$ARGV[0];
    shift;
    exit 1 if(!length($prog));
    
    # If $CYGDRIVE_MOUNT was not set in configure, give $mountpoint the results of mount -p
    $mountpoint=$ENV{'CYGDRIVE_MOUNT'};
    if(!length($mountpoint)) {
     $mountpoint=`mount -p`;
     if(!length($mountpoint)) {
      print "Cannot determine cygwin mount points. Exiting";
      exit 1;
     }
    }
    
    # Delete everything but "/cygdrive" (or other mountpoint) from mount=`mount -p`
    ($dummy,$mountpoint) = split(/\//,$mountpoint);
    ($mountpoint,$dummy) = split(/\s/,$mountpoint);
    
    $args="";
    $up="";
    $process=1;
    
    if($prog eq "-up") {
     $up=1;
     $prog=$ARGV[0];
     shift;
    }
    
    foreach my $arg (@ARGV) {
     if($arg eq "-wrap") {
      $process=1;
     } elsif($arg eq "-nowrap") {
       $process=0;
     } else {
       if($up) {
        $arg =~ s|-I([a-zA-Z]):/|-I/${mountpoint}/\1/|g;
       } else {
        $arg =~ s|/${mountpoint}/([a-zA-Z])/|\1:/|g;
       }
       $arg =~ s/\\/\\\\/g;
       $arg =~ s/"/\\"/g;
    
    # replace <xxx> to \<xxx\> only
       $arg =~ s/<([^\s]+)>/\\<\1\\>/g;
    
    #   $arg =~ s/</\\</g;
    #   $arg =~ s/>/\\>/g;
    #   $arg =~ s/\(/\\(/g;
    #   $arg =~ s/\)/\\)/g;
       $args.=($arg =~ / /)?" \"".$arg."\"":" ".$arg;
     }
    }
    
    #print "$prog $args";
    exec "$prog $args";
    
  • configure.in: add $CYGWIN_WRAPPER to libffi configure command, configure.in diff:
    diff -r c05d0ac56307 configure.in
    --- a/configure.in      Fri Mar 05 14:19:30 2010 -0800
    +++ b/configure.in      Sat Mar 06 12:28:24 2010 +0800
    @@ -2292,7 +2292,7 @@
             AC_MSG_ERROR([MOZ_TOOLS is not set])
         fi
    
    -    MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
    +    MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd`
         if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
             AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
         fi
    @@ -2303,7 +2303,7 @@
         MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
    
         if test -n "$GLIB_PREFIX"; then
    -        _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd -W`
    +        _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd`
             if test "$?" = "0"; then
                 if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
                     AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
    @@ -2328,7 +2328,7 @@
         fi
    
         if test -n "$LIBIDL_PREFIX"; then
    -        _LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd -W`
    +        _LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd`
             if test "$?" = "0"; then
                 if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
                     AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
    @@ -6890,8 +6890,12 @@
         if test ! -d "$WIN32_CRT_SRC_DIR"; then
           AC_MSG_ERROR([Invalid Win32 CRT source directory: ${WIN32_CRT_SRC_DIR}])
         fi
    -    WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
    -    _objdir_win=`pwd -W`
    +#    WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
    +#    _objdir_win=`pwd -W`
    +
    +    WIN32_CRT_SRC_DIR=`$CYGPATH_W "$WIN32_CRT_SRC_DIR" | $CYGPATH_S`
    +    _objdir_win=`$CYGPATH_W . | $CYGPATH_S`
    +
         WIN32_CUSTOM_CRT_DIR="$_objdir_win/memory/jemalloc/crtsrc/build/$_WIN32_CRT_CPU"
         MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt19 -DEFAULTLIB:mozcpp19"
         dnl Also pass this to NSPR/NSS
    @@ -8496,8 +8500,8 @@
         WIN_TOP_SRC=`cd $srcdir; pwd -W`
         ;;
     cygwin*|msvc*|mks*)
    -    HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
    -    HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
    +#    HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
    +#    HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
         CC="\$(CYGWIN_WRAPPER) $CC"
         CXX="\$(CYGWIN_WRAPPER) $CXX"
         CPP="\$(CYGWIN_WRAPPER) $CPP"
    @@ -8738,7 +8742,7 @@
       if test "$_MSC_VER"; then
         # Use a wrapper script for cl and ml that looks more like gcc.
         # autotools can't quite handle an MSVC build environment yet.
    -    ac_configure_args="$ac_configure_args CC=$_topsrcdir/js/ctypes/libffi/msvcc.sh LD=link CPP=\"cl -nologo -EP\""
    +    ac_configure_args="$ac_configure_args CC=\"$CYGWIN_WRAPPER $_topsrcdir/js/ctypes/libffi/msvcc.sh\" LD=\"$CYGWIN_WRAPPER link\" CPP=\"$CYGWIN_WRAPPER cl -nologo -EP\""
       fi
       if test "$SOLARIS_SUNPRO_CC"; then
         # Always use gcc for libffi on Solaris
  • cygwin/bin/ln: rename ln.exe to cygln.exe (prevert libffi's configure from using ln and break the build process)
  • cygwin/bin/arch: create a program/script to print "i686" to STDOUT and name it "arch" in cygwin's bin directory
  • msvcc.sh: add "-wd4826" in nowarn (for Platform SDK 2003)

Wednesday, February 10, 2010

Find Duplicate Files Suite (Initial)

FindDup Suite

FindDup Suite contains 3 parts:
- finddup.pl
- dupselect.php
- unlink.pl

finddup.pl is the duplicate file finder which will search duplicate files in
current directory or specified directory. Progress will print to STDERR and
duplicate file list will print to STDOUT.

Usage:
$ perl finddup.pl [Path] > [duplicate-files.txt]


dupselect.php is a PHP web application for helping user to select duplicate
files. Copy/move [duplicate-files.txt] to same directory as dupselect.php in
the web server. For example, creating a web server with PHP in localhost, then
copy dupselect.php and duplicate-files.txt to /var/www/html, and then fire up
a web browser(such as Firefox) and go to http://localhost/dupselect.php and
you will have a screen like this:

duplicate-files.txt DupSelect CalcTotal

The DupSelect link will go to selecting duplicate files using
duplicate-files.txt duplicate file list.
The CalcTotal link show you a list and calculate Total size of all files in the
file.

In DupSelect mode, you will see a group seperated by horizontal line like this:

[generate]
_________________________________________________________________

[ ] ./20080428/kaberen22204.jpg (f66f689f)
[X] ./20080427/kaberen22204.jpg (f66f689f)
_________________________________________________________________

[ ] ./20080105/T2AW_WP_3/T2AW_10/T2AW_10z.psd (274a3199) (*)
[X] ./20080910/Al_4575/T2AW_10/T2AW_10z.psd (274a3199) (**)
[X] ./20071124/T2AW_WP_2/T2AW_10.psd (274a3199)
_________________________________________________________________

[ ] ./20080506/moeura26162.png (37645a01)
[X] ./20081228/moeura46760.png (37645a01)
_________________________________________________________________

The first file in each group is kept by default. dupselect.php will think
the file in deeper directory is more important.
There is two marks, (*) and (**). (*) repersents there is a file in deeper
directory in this group while (**) means there is more than one file in
deeper directory.
The selected files will generate a duplicate-files-delete.txt and
duplicate-files-delete.lst file in server after pressing [generate] button.
duplicate-files-delete.txt is for you to view a report using CalcTotal mode.
duplicate-files-delete.lst is for deleting using unlink.pl.

Inside dupselect.php:
There is some variables in dupselect.php for the sorting and selecting
strategy.

$excludes_order = array('detail');
$includes_order = array('waren','kaberen','moeren','kabeura','moeura');
$deselects = array('this-one-needs-duplicate');
$normal_depth = 2;

The $excludes_order variable controls which file should place in the back.
The $includes_order variable controls which file should place in the fronter,
but the file in deeper directory still have higher priority.
The $deselects variable controls which file should not be selected in
DupSelect mode.
The $normal_depth variable controls which file become more important.


unlink.pl is an utility for deleting files using a .lst list file.
Usage:
$ perl unlink.pl [duplicate-files-delete.lst]


Download:

vnc2flv-20100207 Win32

Compiled with Py2Exe/Python 2.6 with a modified setup.py.
Download: vnc2flv-20100207.7z

setup.py:
#!/usr/bin/env python
import psyco
psyco.full()

import os, sys
from distutils.command.build_ext import build_ext

try:
 # load py2exe distutils extension, if available
 import py2exe
except ImportError:
 pass

from distutils.core import setup, Extension
from vnc2flv import __version__

py2exe_options = dict(includes=['flvscreen'], # Include
                      excludes=['_ssl',  # Exclude _ssl
                                '_hashlib',"bz2", "_ctypes",
                                'doctest',"pywin", "pywin.debugger", "pywin.debugger.dbgcon",
                                "pywin.dialogs", "pywin.dialogs.list",
                                "Tkconstants","Tkinter","tcl",
                                "compiler","email","ctypes","logging","unicodedata",
                                "pydoc_topics","pydoc","httplib","cookielib","cookielib","urllib",
                                'pickle', 'calendar'],  # Exclude standard library
                      dll_excludes=['msvcr71.dll'],  # Exclude msvcr71
                      ascii=1,
                      compressed=1,
                      optimize=2,
                      bundle_files=2
                      )

setup(
  name='vnc2flv',
  version=__version__,
  description='Screen recording tool that captures a VNC session and saves as FLV',
  long_description='Vnc2flv is a screen recorder. It captures a VNC desktop session '
  'and saves it as a Flash Video (FLV) file.',
  license='MIT/X',
  author='Yusuke Shinyama',
  author_email='yusuke at cs dot nyu dot edu',
  url='http://www.unixuser.org/~euske/python/vnc2flv/index.html',
  packages=[
    'vnc2flv'
    ],
  scripts=[
    'tools/flvrec.py',
    'tools/flvcat.py',
    'tools/flvdump.py',
    'tools/flvaddmp3.py',
    'tools/flvsplit.py',
    'tools/recordwin.sh'
    ],
  keywords=['vnc', 'flv', 'video', 'screen recorder'],
  classifiers=[
    'Development Status :: 4 - Beta',
    'Environment :: Console',
    'Intended Audience :: Developers',
    'Intended Audience :: Science/Research',
    'License :: OSI Approved :: MIT License',
  ],
  ext_modules=[Extension('flvscreen',
                         ['flvscreen/flvscreen.c'],
                         #define_macros=[],
                         #include_dirs=[],
                         #library_dirs=[],
                         #libraries=[],
                         )],
  options={'py2exe': py2exe_options},
  console=['tools/flvrec.py', 'tools/flvcat.py', 'tools/flvdump.py', 'tools/flvaddmp3.py', 'tools/flvsplit.py'],
  zipfile = "vnc2flv.lib",
  )

Thursday, December 17, 2009

Historic Web browser reborn trial: midasWWW, violaWWW

Thanks www.mmmt.ru ftp search engine, I got midasWWW-2.1 and violaWWW 3.3(viola-3.3) from ftp archives.

progress:
violaWWW, the first browser having scripting and style sheet capabilities. latest version is 3.3.

Hacks: using rs6000 config and follow gcc error messages to fix.
Status: double free/pointer corrupt, munmap_chunk(): invalid pointer when exit, HTFWriter_put_character segfaults when connecting Google, almost no online capability.

Screen shot:
viola (pure Xlib version):


vw (viola motif version):


midasWWW, an early browser which runs in VMX system.

Hacks: follow gcc error messages to fix.
Status:
- It builds, and it dies in startup with buffer overflow of libMrm(MrmOpenHierarchy-->Urm__OpenHierarchy-->UrmIdbOpenFileRead-->Idb__HDR_GetHeader-->__strcpy_chk) when reading /usr/local/lib/midas.uid. libmotif uil generates midas.uid and midaswww.uid correctly.
- (18/12/2009 12:00 GMT+8) open motif 2.2.3-4 in utuntu 9.10 seems buggy and I had to rebuilt open motif 2.3.2 from sources with "--enable-xft --enable-jpeg --enable-png", but Midas only popups "Error Dialog Label" and stalls.
Log:
Error: No converter declared for String to DynamicPixmap
Error: Illegal command
Error: Error interpreting command: Set Value .^ iconPixmap MidasWWWIcon
from widget WWWMain (class XmMainWindow)
Error: Illegal command
Error: Error interpreting command: Popup WWWMain
from widget WWWMain (class XmMainWindow)
Cannot convert string "If FontSize=="Small" For All ....WWWHyper...default Set Value . fontSize 12
Else If FontSize=="Medium" For All ....WWWHyper...default Set Value . fontSize 14
Else If FontSize=="Large" For All ....WWWHyper...default Set Value . fontSize 17
If FontSize=="Small" For All ....WWWHyper...h2 Set Value . fontSize 14
Else If FontSize=="Medium" For All ....WWWHyper...h2 Set Value . fontSize 17
Else If FontSize=="Large" For All ....WWWHyper...h2 Set Value . fontSize 20
If FontSize=="Small" For All ....WWWHyper...h1 Set Value . fontSize 17
Else If FontSize=="Medium" For All ....WWWHyper...h1 Set Value . fontSize 20
Else If FontSize=="Large" For All ....WWWHyper...h1 Set Value . fontSize 24
If FontSize=="Small" Update Named Resource . "midaswww*WWWHyper*default.fontSize" 12
Else If FontSize=="Medium" Update Named Resource . "midaswww*WWWHyper*default.fontSize" 14
Else If FontSize=="Large" Update Named Resource . "midaswww*WWWHyper*default.fontSize" 17
If FontSize=="Small" Update Named Resource . "m 
Error: Could not follow path ....WWWHyper
Error: Illegal command
Error: Error interpreting command: Set value ....WWWHyper naturalWidth 0++(GetValue(..WWWMain,width)-40)
from widget WWWMain (class XmMainWindow)
Error: Could not follow path ..WWWMain
Error: Illegal command
Error: Error interpreting command: Set Ingot ..WWWMain PSState 0
from widget WWWMain (class XmMainWindow)
Error: Could not follow path ....Home_Page
Error: Illegal command
Error: Error interpreting command: Invoke Callback ....Home_Page activateCallback
from widget WWWMain (class XmMainWindow)
Cannot find callback list in XtAddCallback 
Cannot find callback list in XtAddCallback 
Cannot find callback list in XtAddCallback 
Cannot find callback list in XtAddCallback 
Cannot find callback list in XtAddCallback 
Cannot find callback list in XtAddCallback 
Cannot find callback list in XtAddCallback 
Cannot find callback list in XtAddCallback 
Cannot find callback list in XtAddCallback 
Cannot find callback list in XtAddCallback 
Cannot find callback list in XtAddCallback 
^C

[29/12/2009]
tested in RedHat Linux 6.2 with Open Motif 2.1.32:
Cannot convert string "If FontSize=="Small" For All ....WWWHyper...default Set Value . fontSize 12
Else If FontSize=="Medium" For All ....WWWHyper...default Set Value . fontSize 14
Else If FontSize=="Large" For All ....WWWHyper...default Set Value . fontSize 17
If FontSize=="Small" For All ....WWWHyper...h2 Set Value . fontSize 14
Else If FontSize=="Medium" For All ....WWWHyper...h2 Set Value . fontSize 17
Else If FontSize=="Large" For All ....WWWHyper...h2 Set Value . fontSize 20
If FontSize=="Small" For All ....WWWHyper...h1 Set Value . fontSize 17
Else If FontSize=="Medium" For All ....WWWHyper...h1 Set Value . fontSize 20
Else If FontSize=="Large" For All ....WWWHyper...h1 Set Value . fontSize 24
If FontSize=="Small" Update Named Resource . "midaswww*WWWHyper*default.fontSize" 12
Else If FontSize=="Medium" Update Named Resource . "midaswww*WWWHyper*default.fontSize" 14
Else If FontSize=="Large" Update Named Resource . "midaswww*WWWHyper*default.fontSize" 17
If FontSize=="Small" Update Named Resource . "m 
Error: Could not follow path ....WWWHyper
Error: Illegal command
Error: Error interpreting command: Set value ....WWWHyper naturalWidth 0++(GetValue(..WWWMain,width)-40)
       from widget WWWMain (class XmMainWindow)
Error: Could not follow path ..WWWMain
Error: Illegal command
Error: Error interpreting command: Set Ingot ..WWWMain PSState 0
       from widget WWWMain (class XmMainWindow)
Error: Could not follow path ....Home_Page
Error: Illegal command
Error: Error interpreting command: Invoke Callback ....Home_Page activateCallback
       from widget WWWMain (class XmMainWindow)

for midasWWW-1.0, it popups an empty dialog and stalls.
Log:
Error: Could not open customization file for CUSTOM
Error: Illegal command
Error: Error interpreting command: Custom Create CUSTOM .
from widget Midas_Main (class XmMainWindow)
Error: Illegal command
Error: Error interpreting command: Popup Midas_Main
from widget Midas_Main (class XmMainWindow)
Error: Illegal command
Error: Error interpreting command: Midas Popup Midas_Main
from widget Midas_Main (class XmMainWindow)
^C

P.S.: I created a project site of early Web browser reborn in Google Code:
http://code.google.com/p/earlybrowserreborn/

ErwisE: first X11 World Wide Web browser

My fixed source works in ubuntu 9.10.
You can download here:
erwise-0.1-src.tar.gz

For playing it in ubuntu 9.10 wihout compiling yourself, you can greb the prebuilt checkinstall-generated deb package here:
erwise_0.1-1_i386.deb

Screenshot:
Free Image Hosting at www.ImageShack.us

P.S.: I created deb package of Mosaic-CK too, and Cameron had it mirrored to his site.