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
find -type f -regex '[^~]*' -exec dos2unix -b -v -U {} 2>&1 \;\ | |
| grep Unix \ | |
| sed -e "s/..Unix .*//" | cut -b 16-300 | xargs fossil add |
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 'pp' | |
require 'win32ole' | |
require 'yaml' | |
require 'set' | |
@access = WIN32OLE.new('Access.Application') | |
@filename = 'D:\dev\dashboard.accdb' | |
@access.OpenCurrentDatabase @filename | |
@prefix = "D:\\dev\\dump\\" | |
@db = @access.CurrentDb() |
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 'win32ole' | |
def convert_to_access2007(srcdir) | |
Dir.chdir(srcdir) | |
access = WIN32OLE.new('Access.Application') | |
Dir.glob('*.mdb').map do |mdb| | |
src = File.expand_path(mdb).gsub /\//, "\\" | |
dst = src.sub /.mdb$/i , '.accdb' | |
print "Converting ",src,"to", dst | |
# 12 for access 2007 | |
access.ConvertAccessProject src , dst , 12 |
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 get_all_sql(srcdir) | |
Dir.chdir(srcdir) | |
fullname = File.expand_path('query.sql', srcdir) | |
access = WIN32OLE.new('Access.Application') | |
File.open(fullname,'w' ) do |o| | |
Dir.glob('*.accdb').each do |f| | |
access.OpenCurrentDatabase(File.expand_path(f)) | |
db = access.CurrentDb() | |
if !db.nil? then | |
db.QueryDefs.each{ |q| |
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 'win32ole' | |
def get_all_sql(srcdir) | |
Dir.chdir(srcdir) | |
access = WIN32OLE.new('Access.Application') | |
Dir.glob('*.accdb').each do |f| | |
src = File.expand_path(f).gsub /\//, "\\" | |
access.OpenCurrentDatabase src | |
if db = access.CurrentDb then | |
puts "processing #{src}" | |
sql_buffer = " -- #{src}" |
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 'pp' | |
require 'win32ole' | |
require 'yaml' | |
require 'set' | |
class String ; def is_valid?; self.strip != "" ; end ; end | |
class Integer; def is_valid?; self > 0 ; end ; end | |
class FalseClass; def is_valid?; self ; end; end |
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 'pp' | |
require 'win32ole' | |
require 'yaml' | |
require 'set' | |
class String ; def is_valid?; self.strip != "" ; end ; end | |
class Integer; def is_valid?; self > 0 ; end ; end | |
class FalseClass; def is_valid?; self ; end; end |
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 'pp' | |
require 'win32ole' | |
path = 'D:/dev/access/tmp/*.sql' | |
tablist =[] | |
Dir.glob(path).map do |f| | |
File.open(f,"r:CP863") do |i| | |
tablist << i.read.scan(/\W[Rr]_\w{5,9}/) | |
end | |
end |
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
class Partition | |
def initialize | |
@sum = 0 | |
@names = [] | |
end | |
attr_reader :sum,:names | |
def add(name,size) | |
@names << name | |
@sum=@sum+size | |
end |
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
function Add-Prop([string]$name,$value){ | |
$input |add-member -memberType Noteproperty -name $name -value $value -passThru | |
} | |
function Get-Partitions($no_partitions=4){ | |
$sums = @() | |
$indexes = (0..($no_partitions-1)) | |
$indexes |% { $sums+= 0 } | |
$sortedBySize = $input | Sort Length -Descending | |
foreach($file in $sortedBySize){ |
OlderNewer