This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim objWord ' As Word.Application | |
Dim objDoc ' As Word.Document | |
Dim fso, fResult | |
Dim objShell | |
strResultFilePath = "c:/wordsStat.txt" | |
'On Error Goto CleanObjs: 'WScript不支持goto label语法? | |
On Error Resume Next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def do_batch_convert(from_reldir, to_reldir) | |
Dir.new(from_reldir).entries.each { |subpath| | |
from_path = File.join(from_reldir, subpath) | |
to_path = File.join(to_reldir, subpath) | |
if File.file?(from_path) and /\.(jpg|png)$/.match(from_path.downcase) then | |
if not File.exist?(to_reldir) then | |
Dir.mkdir(to_reldir) | |
end | |
puts "convert from #{from_path} to #{to_path}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
# | |
import os | |
import os.path | |
import sys | |
import time | |
def do_convert(from_path, to_dir, to_filename): | |
to_path = os.path.join(to_dir, to_filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Recursive scan a dir, & perform each-file rename operation: | |
def batch_files_from_dir(basepath) | |
sub_dirs = Array.new | |
Dir.new(basepath).entries.each { |subpath| | |
path = File.join(basepath, subpath) | |
if File.file?(path) then | |
if /0000[0-9]{3}$/.match(path) then | |
puts "#{path}" | |
new_path = path.gsub(/0000[0-9]{3}$/, '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def comp(_A, _R, _G, _B) | |
_A<<24 | _R<<16 | _G<<8 | _B; | |
end | |
def decomp( num ) | |
_A = (num >> 24) & 0xFF; | |
_R = (num >> 16) & 0xFF; | |
_G = (num >> 8) & 0xFF; | |
_B = (num >> 0) & 0xFF; | |
[_A,_R,_G,_B] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<style> | |
#c{ | |
position: absolute; | |
left: 1200px; | |
top: 100px; | |
width: 80px; | |
height: 25px; | |
color: blue; | |
border: 2px solid red; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: GBK -*- | |
#----------------------------------------------------------- | |
#TCP 数据服务器,当客户端连接上时,不断写入数据 | |
# 用于测试TCP连接吞吐量 | |
import os,sys,time | |
from socket import socket, AF_INET, AF_INET6, SOCK_STREAM | |
#----------------------------------------------------------- | |
#常量定义: | |
PROGRAM = 'TCP Data Server' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pathname' | |
require 'rexml/document' | |
include REXML | |
BUILD_CONFIG = 'Debug' # to switch between different config; | |
vcproj_filename = ARGV.shift | |
vcproj_filename = Pathname.new(vcproj_filename).cleanpath | |
vcproj_libname = vcproj_filename.sub(/\.vcproj/, '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# | |
#Usage: ruby findCppFilePathCaseConflicts.rb <hFilePathLists.txt> <sourceFilePathLists.txt> | |
#首先,加载全部.h头文件的清单: | |
hFilePaths = [] | |
File.open(ARGV[0]).each { |line| | |
hFilePaths.push(line) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# | |
#Usage: ruby findAndCorrectFilePathCaseConflicts.rb <hFilePathLists.txt> <sourceFilePathLists.txt> | |
#首先,加载全部.h头文件的清单: | |
hFilePaths = [] | |
File.open(ARGV[0]).each { |line| | |
hFilePaths.push(line) | |
} |
OlderNewer