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
Get-ChildItem . -include *.txt -Recurse | Select-String -Context 0,1 ABCD |
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
proc _restore_grab_window {w} { | |
if {![winfo exists $w] || [grab status $w] eq "none"} { | |
return | |
} else { | |
if {![winfo viewable $w]} { | |
wm deiconify $w | |
} | |
after 2000 [list _restore_grab_window $w] | |
} | |
} |
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
console show | |
package require BLT | |
namespace import blt::* | |
set graph [graph .graph] | |
pack $graph -fill both -expand yes | |
set gindex "Element A" |
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
proc breakable {script} { | |
uplevel [list foreach __BLOCK__ {1} $script] | |
} | |
if {[info exists ::argv0] && $::argv0 eq [info script]} { | |
set str "line" | |
puts "enter breakable" | |
breakable { | |
puts "1st $str" | |
break |
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
package require unicode | |
proc to_unicode_literal {str} { | |
set cs [lmap c [unicode::fromstring $str] {format \\u%04x $c}] | |
join $cs "" | |
} | |
if {[namespace exists ::tk]} { | |
proc copy_to_clipboard {str} { | |
clipboard clear |
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
150,152c150,157 | |
< set now [clock seconds] | |
< set x [clock format $now -format "%d/%m%/%Y"] | |
< set rawDate [clock scan "$x 00:00:00" -format "%d/%m%/%Y %H:%M:%S"] | |
--- | |
> if {[info exists $options(-textvariable)]} { | |
> set x [set $options(-textvariable)] | |
> set rawDate [clock scan "$x" -format $options(-dateformat)] | |
> } else { | |
> set now [clock seconds] |
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
package require Ffidl | |
if {$::tcl_platform(osVersion) >= 6.3} { | |
namespace eval USER32 { | |
set MONITOR_DEFAULTTONULL 0x00 | |
set MONITOR_DEFAULTTOPRIMARY 0x01 | |
set MONITOR_DEFAULTTONEAREST 0x02 | |
ffidl::callout MonitorFromWindow {int int} int [ffidl::symbol user32.dll MonitorFromWindow] |
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
diff -r C:\src\sqlite-extension\tclsqlite3-org.c C:\src\sqlite-extension\tclsqlite3-mod.c | |
1871a1872 | |
> "extended_errorcode", | |
1887c1888,1889 | |
< DB_UPDATE_HOOK, DB_VERSION, DB_WAL_HOOK | |
--- | |
> DB_UPDATE_HOOK, DB_VERSION, DB_WAL_HOOK, | |
> DB_EXTENDED_ERRORCODE | |
2508a2511,2521 | |
> ** $db extended_errorcode |
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
package require sqlite3 | |
set dbfile ./example.db | |
set extfile ./exterrcode.dll | |
file delete $dbfile | |
sqlite3 db $dbfile | |
db enable_load_extension 1 | |
db eval [format {SELECT load_extension('%s');} $extfile] |
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
package require Mpexpr | |
if {[info commands tclexpr] eq {}} { | |
rename expr tclexpr | |
proc expr {args} {uplevel mpexpr $args} | |
} | |
# set PI [expr {4*atan(1)}]; #=> 3.14159265358979324 |
NewerOlder