assorted-commits Mailing List for Assorted projects (Page 5)
Brought to you by:
yangzhang
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(9) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(86) |
Feb
(265) |
Mar
(96) |
Apr
(47) |
May
(136) |
Jun
(28) |
Jul
(57) |
Aug
(42) |
Sep
(20) |
Oct
(67) |
Nov
(37) |
Dec
(34) |
2009 |
Jan
(39) |
Feb
(85) |
Mar
(96) |
Apr
(24) |
May
(82) |
Jun
(13) |
Jul
(10) |
Aug
(8) |
Sep
(2) |
Oct
(20) |
Nov
(31) |
Dec
(17) |
2010 |
Jan
(16) |
Feb
(11) |
Mar
(17) |
Apr
(53) |
May
(31) |
Jun
(13) |
Jul
(3) |
Aug
(6) |
Sep
(11) |
Oct
(4) |
Nov
(17) |
Dec
(17) |
2011 |
Jan
(3) |
Feb
(19) |
Mar
(5) |
Apr
(17) |
May
(3) |
Jun
(4) |
Jul
(14) |
Aug
(3) |
Sep
(2) |
Oct
(1) |
Nov
(3) |
Dec
(2) |
2012 |
Jan
(3) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
(4) |
Aug
(5) |
Sep
(2) |
Oct
(3) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(9) |
Apr
(5) |
May
|
Jun
(2) |
Jul
(1) |
Aug
(10) |
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
2014 |
Jan
(1) |
Feb
(3) |
Mar
(3) |
Apr
(1) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2016 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <yan...@us...> - 2011-07-21 05:00:20
|
Revision: 1802 http://assorted.svn.sourceforge.net/assorted/?rev=1802&view=rev Author: yangzhang Date: 2011-07-21 05:00:12 +0000 (Thu, 21 Jul 2011) Log Message: ----------- Add pandoc vim support Modified Paths: -------------- configs/trunk/src/vim/syntax/pdc.vim Modified: configs/trunk/src/vim/syntax/pdc.vim =================================================================== --- configs/trunk/src/vim/syntax/pdc.vim 2011-07-21 04:50:40 UTC (rev 1801) +++ configs/trunk/src/vim/syntax/pdc.vim 2011-07-21 05:00:12 UTC (rev 1802) @@ -86,7 +86,7 @@ " Indent with at least 4 space or 1 tab " This rule must appear for pdcListItem, or highlighting gets messed up -syn match pdcCodeBlock /\(\s\{2,}\|\t\{1,}\).*\n/ contained nextgroup=pdcCodeBlock +syn match pdcCodeBlock /\(\s\{4,}\|\t\{1,}\).*\n/ contained nextgroup=pdcCodeBlock " HTML code blocks, pre and code syn match pdcCodeStartPre /<pre>/ nextgroup=pdcCodeHTMLPre skipnl transparent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-07-21 04:50:47
|
Revision: 1801 http://assorted.svn.sourceforge.net/assorted/?rev=1801&view=rev Author: yangzhang Date: 2011-07-21 04:50:40 +0000 (Thu, 21 Jul 2011) Log Message: ----------- Add coffeescript vim support Added Paths: ----------- configs/trunk/src/vim/after/syntax/ configs/trunk/src/vim/after/syntax/html.vim configs/trunk/src/vim/ftdetect/coffee.vim configs/trunk/src/vim/ftdetect/eco.vim configs/trunk/src/vim/ftplugin/coffee.vim configs/trunk/src/vim/indent/coffee.vim configs/trunk/src/vim/syntax/coffee.vim configs/trunk/src/vim/syntax/eco.vim Added: configs/trunk/src/vim/after/syntax/html.vim =================================================================== --- configs/trunk/src/vim/after/syntax/html.vim (rev 0) +++ configs/trunk/src/vim/after/syntax/html.vim 2011-07-21 04:50:40 UTC (rev 1801) @@ -0,0 +1,19 @@ +" Language: CoffeeScript +" Maintainer: Mick Koch <kc...@gm...> +" URL: http://github.com/kchmck/vim-coffee-script +" License: WTFPL + +if !exists("main_syntax") + let main_syntax = 'html' +endif + +" Syntax highlighting for text/coffeescript script tags +unlet b:current_syntax +syn include @htmlCoffeeScript syntax/coffee.vim +unlet b:current_syntax +syn region javaScript start=+<script [^>]*type *=[^>]*text/coffeescript[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc +let b:current_syntax = "html" + +if main_syntax == 'html' + unlet main_syntax +endif Added: configs/trunk/src/vim/ftdetect/coffee.vim =================================================================== --- configs/trunk/src/vim/ftdetect/coffee.vim (rev 0) +++ configs/trunk/src/vim/ftdetect/coffee.vim 2011-07-21 04:50:40 UTC (rev 1801) @@ -0,0 +1,7 @@ +" Language: CoffeeScript +" Maintainer: Mick Koch <kc...@gm...> +" URL: http://github.com/kchmck/vim-coffee-script +" License: WTFPL + +autocmd BufNewFile,BufRead *.coffee set filetype=coffee +autocmd BufNewFile,BufRead *Cakefile set filetype=coffee Added: configs/trunk/src/vim/ftdetect/eco.vim =================================================================== --- configs/trunk/src/vim/ftdetect/eco.vim (rev 0) +++ configs/trunk/src/vim/ftdetect/eco.vim 2011-07-21 04:50:40 UTC (rev 1801) @@ -0,0 +1 @@ +autocmd BufNewFile,BufRead *.eco set filetype=eco Added: configs/trunk/src/vim/ftplugin/coffee.vim =================================================================== --- configs/trunk/src/vim/ftplugin/coffee.vim (rev 0) +++ configs/trunk/src/vim/ftplugin/coffee.vim 2011-07-21 04:50:40 UTC (rev 1801) @@ -0,0 +1,137 @@ +" Language: CoffeeScript +" Maintainer: Mick Koch <kc...@gm...> +" URL: http://github.com/kchmck/vim-coffee-script +" License: WTFPL + +if exists("b:did_ftplugin") + finish +endif + +let b:did_ftplugin = 1 + +" Don't let new windows overwrite these. +if !exists("s:coffee_compile_prev_buf") + " Buffer and cursor position before the `CoffeeCompile` buffer was opened + let s:coffee_compile_prev_buf = -1 + let s:coffee_compile_prev_pos = [] + " Previously-opened `CoffeeCompile` buffer + let s:coffee_compile_buf = -1 +endif + +setlocal formatoptions-=t formatoptions+=croql +setlocal comments=:# +setlocal commentstring=#\ %s + +setlocal errorformat=Error:\ In\ %f\\,\ %m\ on\ line\ %l, + \Error:\ In\ %f\\,\ Parse\ error\ on\ line\ %l:\ %m, + \SyntaxError:\ In\ %f\\,\ %m, + \%-G%.%# + +" Fold by indentation, but only if enabled. +setlocal foldmethod=indent + +if !exists("coffee_folding") + setlocal nofoldenable +endif + +" Extra options passed to `CoffeeMake` +if !exists("coffee_make_options") + let coffee_make_options = "" +endif + +" Update `makeprg` for the current filename. This is needed to support filenames +" with spaces and quotes while also supporting generic `make`. +function! s:SetMakePrg() + let &l:makeprg = "coffee -c " . g:coffee_make_options . ' $* ' + \ . fnameescape(expand('%')) +endfunction + +" Set `makeprg` initially. +call s:SetMakePrg() +" Reset `makeprg` on rename. +autocmd BufFilePost,BufWritePost,FileWritePost <buffer> call s:SetMakePrg() + +" Save the cursor position. +function! s:CoffeeCompileSavePos() + let buf = bufnr('%') + + if buf != s:coffee_compile_buf + let s:coffee_compile_prev_buf = buf + let s:coffee_compile_prev_pos = getpos('.') + endif +endfunction + +" Try to reset the cursor position. +function! s:CoffeeCompileResetPos() + let win = bufwinnr(s:coffee_compile_prev_buf) + + if win != -1 + exec win 'wincmd w' + call setpos('.', s:coffee_compile_prev_pos) + endif + + autocmd! CoffeeCompileSavePos +endfunction + +" Compile some CoffeeScript and show it in a scratch buffer. We handle ranges +" like this to stop the cursor from being moved before the function is called. +function! s:CoffeeCompile(startline, endline) + " Store the current buffer and cursor. + call s:CoffeeCompileSavePos() + + " Build stdin lines. + let lines = join(getline(a:startline, a:endline), "\n") + " Get compiler output. + let output = system('coffee -scb 2>&1', lines) + + " Use at most half of the screen. + let max_height = winheight('%') / 2 + " Try to get the old window. + let win = bufwinnr(s:coffee_compile_buf) + + if win == -1 + " Make a new window and store its ID. + botright new + let s:coffee_compile_buf = bufnr('%') + + setlocal bufhidden=wipe buftype=nofile + setlocal nobuflisted noswapfile nowrap + + autocmd BufWipeout <buffer> call s:CoffeeCompileResetPos() + nnoremap <buffer> <silent> q :hide<CR> + + " Save the cursor position on each buffer switch. + augroup CoffeeCompileSavePos + autocmd BufEnter,BufLeave * call s:CoffeeCompileSavePos() + augroup END + else + " Move to the old window and clear the buffer. + exec win 'wincmd w' + setlocal modifiable + exec '% delete _' + endif + + " Paste in the output and delete the last empty line. + put! =output + exec '$ delete _' + + exec 'resize' min([max_height, line('$') + 1]) + call cursor(1, 1) + + if v:shell_error + " A compile error occurred. + setlocal filetype= + else + " Coffee was compiled successfully. + setlocal filetype=javascript + endif + + setlocal nomodifiable +endfunction + +" Peek at compiled CoffeeScript. +command! -range=% -bar CoffeeCompile call s:CoffeeCompile(<line1>, <line2>) +" Compile the current file. +command! -bang -bar -nargs=* CoffeeMake make<bang> <args> +" Run some CoffeeScript. +command! -range=% -bar CoffeeRun <line1>,<line2>:w !coffee -s Added: configs/trunk/src/vim/indent/coffee.vim =================================================================== --- configs/trunk/src/vim/indent/coffee.vim (rev 0) +++ configs/trunk/src/vim/indent/coffee.vim 2011-07-21 04:50:40 UTC (rev 1801) @@ -0,0 +1,322 @@ +" Language: CoffeeScript +" Maintainer: Mick Koch <kc...@gm...> +" URL: http://github.com/kchmck/vim-coffee-script +" License: WTFPL + +if exists("b:did_indent") + finish +endif + +let b:did_indent = 1 + +setlocal autoindent +setlocal indentexpr=GetCoffeeIndent(v:lnum) +" Make sure GetCoffeeIndent is run when these are typed so they can be +" indented or outdented. +setlocal indentkeys+=0],0),0.,=else,=when,=catch,=finally + +" Only define the function once. +if exists("*GetCoffeeIndent") + finish +endif + +" Keywords to indent after +let s:INDENT_AFTER_KEYWORD = '^\%(if\|unless\|else\|for\|while\|until\|' +\ . 'loop\|switch\|when\|try\|catch\|finally\|' +\ . 'class\)\>' + +" Operators to indent after +let s:INDENT_AFTER_OPERATOR = '\%([([{:=]\|[-=]>\)$' + +" Keywords and operators that continue a line +let s:CONTINUATION = '\<\%(is\|isnt\|and\|or\)\>$' +\ . '\|' +\ . '\%(-\@<!-\|+\@<!+\|<\|[-=]\@<!>\|\*\|/\@<!/\|%\||\|' +\ . '&\|,\|\.\@<!\.\)$' + +" Operators that block continuation indenting +let s:CONTINUATION_BLOCK = '[([{:=]$' + +" A continuation dot access +let s:DOT_ACCESS = '^\.' + +" Keywords to outdent after +let s:OUTDENT_AFTER = '^\%(return\|break\|continue\|throw\)\>' + +" A compound assignment like `... = if ...` +let s:COMPOUND_ASSIGNMENT = '[:=]\s*\%(if\|unless\|for\|while\|until\|' +\ . 'switch\|try\|class\)\>' + +" A postfix condition like `return ... if ...`. +let s:POSTFIX_CONDITION = '\S\s\+\zs\<\%(if\|unless\)\>' + +" A single-line else statement like `else ...` but not `else if ... +let s:SINGLE_LINE_ELSE = '^else\s\+\%(\<\%(if\|unless\)\>\)\@!' + +" Max lines to look back for a match +let s:MAX_LOOKBACK = 50 + +" Syntax names for strings +let s:SYNTAX_STRING = 'coffee\%(String\|AssignString\|Embed\|Regex\|Heregex\|' +\ . 'Heredoc\)' + +" Syntax names for comments +let s:SYNTAX_COMMENT = 'coffee\%(Comment\|BlockComment\|HeregexComment\)' + +" Syntax names for strings and comments +let s:SYNTAX_STRING_COMMENT = s:SYNTAX_STRING . '\|' . s:SYNTAX_COMMENT + +" Get the linked syntax name of a character. +function! s:SyntaxName(linenum, col) + return synIDattr(synID(a:linenum, a:col, 1), 'name') +endfunction + +" Check if a character is in a comment. +function! s:IsComment(linenum, col) + return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_COMMENT +endfunction + +" Check if a character is in a string. +function! s:IsString(linenum, col) + return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_STRING +endfunction + +" Check if a character is in a comment or string. +function! s:IsCommentOrString(linenum, col) + return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_STRING_COMMENT +endfunction + +" Check if a whole line is a comment. +function! s:IsCommentLine(linenum) + " Check the first non-whitespace character. + return s:IsComment(a:linenum, indent(a:linenum) + 1) +endfunction + +" Repeatedly search a line for a regex until one is found outside a string or +" comment. +function! s:SmartSearch(linenum, regex) + " Start at the first column. + let col = 0 + + " Search until there are no more matches, unless a good match is found. + while 1 + call cursor(a:linenum, col + 1) + let [_, col] = searchpos(a:regex, 'cn', a:linenum) + + " No more matches. + if !col + break + endif + + if !s:IsCommentOrString(a:linenum, col) + return 1 + endif + endwhile + + " No good match found. + return 0 +endfunction + +" Skip a match if it's in a comment or string, is a single-line statement that +" isn't adjacent, or is a postfix condition. +function! s:ShouldSkip(startlinenum, linenum, col) + if s:IsCommentOrString(a:linenum, a:col) + return 1 + endif + + " Check for a single-line statement that isn't adjacent. + if s:SmartSearch(a:linenum, '\<then\>') && a:startlinenum - a:linenum > 1 + return 1 + endif + + if s:SmartSearch(a:linenum, s:POSTFIX_CONDITION) && + \ !s:SmartSearch(a:linenum, s:COMPOUND_ASSIGNMENT) + return 1 + endif + + return 0 +endfunction + +" Find the farthest line to look back to, capped to line 1 (zero and negative +" numbers cause bad things). +function! s:MaxLookback(startlinenum) + return max([1, a:startlinenum - s:MAX_LOOKBACK]) +endfunction + +" Get the skip expression for searchpair(). +function! s:SkipExpr(startlinenum) + return "s:ShouldSkip(" . a:startlinenum . ", line('.'), col('.'))" +endfunction + +" Search for pairs of text. +function! s:SearchPair(start, end) + " The cursor must be in the first column for regexes to match. + call cursor(0, 1) + + let startlinenum = line('.') + + " Don't need the W flag since MaxLookback caps the search to line 1. + return searchpair(a:start, '', a:end, 'bcn', + \ s:SkipExpr(startlinenum), + \ s:MaxLookback(startlinenum)) +endfunction + +" Try to find a previous matching line. +function! s:GetMatch(curline) + let firstchar = a:curline[0] + + if firstchar == '}' + return s:SearchPair('{', '}') + elseif firstchar == ')' + return s:SearchPair('(', ')') + elseif firstchar == ']' + return s:SearchPair('\[', '\]') + elseif a:curline =~ '^else\>' + return s:SearchPair('\<\%(if\|unless\|when\)\>', '\<else\>') + elseif a:curline =~ '^catch\>' + return s:SearchPair('\<try\>', '\<catch\>') + elseif a:curline =~ '^finally\>' + return s:SearchPair('\<try\>', '\<finally\>') + endif + + return 0 +endfunction + +" Get the nearest previous line that isn't a comment. +function! s:GetPrevNormalLine(startlinenum) + let curlinenum = a:startlinenum + + while curlinenum > 0 + let curlinenum = prevnonblank(curlinenum - 1) + + if !s:IsCommentLine(curlinenum) + return curlinenum + endif + endwhile + + return 0 +endfunction + +" Try to find a comment in a line. +function! s:FindComment(linenum) + let col = 0 + + while 1 + call cursor(a:linenum, col + 1) + let [_, col] = searchpos('#', 'cn', a:linenum) + + if !col + break + endif + + if s:IsComment(a:linenum, col) + return col + endif + endwhile + + return 0 +endfunction + +" Get a line without comments or surrounding whitespace. +function! s:GetTrimmedLine(linenum) + let comment = s:FindComment(a:linenum) + let line = getline(a:linenum) + + if comment + " Subtract 1 to get to the column before the comment and another 1 for + " zero-based indexing. + let line = line[:comment - 2] + endif + + return substitute(substitute(line, '^\s\+', '', ''), + \ '\s\+$', '', '') +endfunction + +function! s:GetCoffeeIndent(curlinenum) + let prevlinenum = s:GetPrevNormalLine(a:curlinenum) + + " Don't do anything if there's no previous line. + if !prevlinenum + return -1 + endif + + let curline = s:GetTrimmedLine(a:curlinenum) + + " Try to find a previous matching statement. This handles outdenting. + let matchlinenum = s:GetMatch(curline) + + if matchlinenum + return indent(matchlinenum) + endif + + " Try to find a matching `when`. + if curline =~ '^when\>' && !s:SmartSearch(prevlinenum, '\<switch\>') + let linenum = a:curlinenum + + while linenum > 0 + let linenum = s:GetPrevNormalLine(linenum) + + if getline(linenum) =~ '^\s*when\>' + return indent(linenum) + endif + endwhile + + return -1 + endif + + let prevline = s:GetTrimmedLine(prevlinenum) + let previndent = indent(prevlinenum) + + " Always indent after these operators. + if prevline =~ s:INDENT_AFTER_OPERATOR + return previndent + &shiftwidth + endif + + " Indent after a continuation if it's the first. + if prevline =~ s:CONTINUATION + let prevprevlinenum = s:GetPrevNormalLine(prevlinenum) + let prevprevline = s:GetTrimmedLine(prevprevlinenum) + + if prevprevline !~ s:CONTINUATION && prevprevline !~ s:CONTINUATION_BLOCK + return previndent + &shiftwidth + endif + + return -1 + endif + + " Indent after these keywords and compound assignments if they aren't a + " single-line statement. + if prevline =~ s:INDENT_AFTER_KEYWORD || prevline =~ s:COMPOUND_ASSIGNMENT + if !s:SmartSearch(prevlinenum, '\<then\>') && prevline !~ s:SINGLE_LINE_ELSE + return previndent + &shiftwidth + endif + + return -1 + endif + + " Indent a dot access if it's the first. + if curline =~ s:DOT_ACCESS && prevline !~ s:DOT_ACCESS + return previndent + &shiftwidth + endif + + " Outdent after these keywords if they don't have a postfix condition or are + " a single-line statement. + if prevline =~ s:OUTDENT_AFTER + if !s:SmartSearch(prevlinenum, s:POSTFIX_CONDITION) || + \ s:SmartSearch(prevlinenum, '\<then\>') + return previndent - &shiftwidth + endif + endif + + " No indenting or outdenting is needed. + return -1 +endfunction + +" Wrap s:GetCoffeeIndent to keep the cursor position. +function! GetCoffeeIndent(curlinenum) + let oldcursor = getpos('.') + let indent = s:GetCoffeeIndent(a:curlinenum) + call setpos('.', oldcursor) + + return indent +endfunction Added: configs/trunk/src/vim/syntax/coffee.vim =================================================================== --- configs/trunk/src/vim/syntax/coffee.vim (rev 0) +++ configs/trunk/src/vim/syntax/coffee.vim 2011-07-21 04:50:40 UTC (rev 1801) @@ -0,0 +1,214 @@ +" Language: CoffeeScript +" Maintainer: Mick Koch <kc...@gm...> +" URL: http://github.com/kchmck/vim-coffee-script +" License: WTFPL + +if exists("b:current_syntax") + finish +endif + +if version < 600 + syn clear +endif + +" Include JavaScript for coffeeEmbed. +syn include @coffeeJS syntax/javascript.vim + +" Highlight long strings. +syn sync minlines=100 + +" CoffeeScript allows dollar signs in identifiers. +setlocal isident+=$ + +" These are `matches` instead of `keywords` because vim's highlighting +" priority for keywords is higher than matches. This causes keywords to be +" highlighted inside matches, even if a match says it shouldn't contain them -- +" like with coffeeAssign and coffeeDot. +syn match coffeeStatement /\<\%(return\|break\|continue\|throw\)\>/ +hi def link coffeeStatement Statement + +syn match coffeeRepeat /\<\%(for\|while\|until\|loop\)\>/ +hi def link coffeeRepeat Repeat + +syn match coffeeConditional /\<\%(if\|else\|unless\|switch\|when\|then\)\>/ +hi def link coffeeConditional Conditional + +syn match coffeeException /\<\%(try\|catch\|finally\)\>/ +hi def link coffeeException Exception + +syntax match coffeeOperator /\<\%(instanceof\|typeof\|delete\)\>/ +hi def link coffeeOperator Operator + +syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|own\|do\)\>/ +hi def link coffeeKeyword Keyword + +syn match coffeeBoolean /\<\%(true\|on\|yes\|false\|off\|no\)\>/ +hi def link coffeeBoolean Boolean + +syn match coffeeGlobal /\<\%(null\|undefined\)\>/ +hi def link coffeeGlobal Type + +" Keywords reserved by the language +syn cluster coffeeReserved contains=coffeeStatement,coffeeRepeat, +\ coffeeConditional,coffeeException, +\ coffeeOperator,coffeeKeyword, +\ coffeeBoolean,coffeeGlobal + +" A special variable +syn match coffeeSpecialVar /\<\%(this\|prototype\|arguments\)\>/ +" An @-variable +syn match coffeeSpecialVar /@\%(\I\i*\)\?/ +hi def link coffeeSpecialVar Type + +" A class-like name that starts with a capital letter +syn match coffeeObject /\<\u\w*\>/ +hi def link coffeeObject Structure + +" A constant-like name in SCREAMING_CAPS +syn match coffeeConstant /\<\u[A-Z0-9_]\+\>/ +hi def link coffeeConstant Constant + +" A variable name +syn cluster coffeeIdentifier contains=coffeeSpecialVar,coffeeObject, +\ coffeeConstant,coffeePrototype + +" A non-interpolated string +syn cluster coffeeBasicString contains=@Spell,coffeeEscape +" An interpolated string +syn cluster coffeeInterpString contains=@coffeeBasicString,coffeeInterp + +" Regular strings +syn region coffeeString start=/"/ skip=/\\\\\|\\"/ end=/"/ +\ contains=@coffeeInterpString +syn region coffeeString start=/'/ skip=/\\\\\|\\'/ end=/'/ +\ contains=@coffeeBasicString +hi def link coffeeString String + +" A integer, including a leading plus or minus +syn match coffeeNumber /\i\@<![-+]\?\d\+\%([eE][+-]\?\d\+\)\?/ +" A hex number +syn match coffeeNumber /\<0[xX]\x\+\>/ +hi def link coffeeNumber Number + +" A floating-point number, including a leading plus or minus +syn match coffeeFloat /\i\@<![-+]\?\d*\.\@<!\.\d\+\%([eE][+-]\?\d\+\)\?/ +hi def link coffeeFloat Float + +syn match coffeeAssignSymbols /:\@<!::\@!\|++\|--\|\%(\s\zs\%(and\|or\)\|&&\|||\|?\|+\|-\|\/\|\*\|%\|<<\|>>\|>>>\|&\||\|\^\)\?=\@<!==\@!>\@!/ +\ contained +hi def link coffeeAssignSymbols SpecialChar + +syn match coffeeAssignBrackets /\[.\+\]/ contained contains=TOP,coffeeAssign + +" A destructuring assignment +syn match coffeeAssign /[}\]]\@<=\s*==\@!>\@!/ contains=coffeeAssignSymbols +" A pre-increment or pre-decrement assignment +syn match coffeeAssign /\%(++\|--\)\s*\%(@\|@\?\I\)\%(\i\|::\|\.\|?\|\[.\+\]\)*/ +\ contains=@coffeeIdentifier,coffeeAssignSymbols, +\ coffeeAssignBrackets +" A normal assignment, or a post-increment or post-decrement assignment +syn match coffeeAssign /\%(@\|@\?\I\)\%(\i\|::\|\.\|?\|\[.\+\]\)*\%(++\|--\|\s*\%(and\|or\|&&\|||\|?\|+\|-\|\/\|\*\|%\|<<\|>>\|>>>\|&\||\|\^\)\?=\@<!==\@!>\@!\)/ +\ contains=@coffeeIdentifier,coffeeAssignSymbols, +\ coffeeAssignBrackets +hi def link coffeeAssign Identifier + +" An error for reserved keywords +if !exists("coffee_no_reserved_words_error") + syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\)\>/ + hi def link coffeeReservedError Error +endif + +" A normal object assignment +syn match coffeeObjAssign /@\?\I\i*\s*:\@<!::\@!/ +\ contains=@coffeeIdentifier,coffeeAssignSymbols +hi def link coffeeObjAssign coffeeAssign + +" Strings used in string assignments, which can't have interpolations +syn region coffeeAssignString start=/"/ skip=/\\\\\|\\"/ end=/"/ +\ contained contains=@coffeeBasicString +syn region coffeeAssignString start=/'/ skip=/\\\\\|\\'/ end=/'/ +\ contained contains=@coffeeBasicString +hi def link coffeeAssignString String + +" An object-string assignment +syn match coffeeObjStringAssign /\("\|'\)[^\1]*\1\s*;\@<!::\@!'\@!/ +\ contains=coffeeAssignString,coffeeAssignSymbols +" An object-integer assignment +syn match coffeeObjNumberAssign /\d\+\%(\.\d\+\)\?\s*:\@<!::\@!/ +\ contains=coffeeNumber,coffeeAssignSymbols + +syn match coffeePrototype /::/ +hi def link coffeePrototype SpecialChar + +syn match coffeeFunction /[-=]>/ +hi def link coffeeFunction Function + +syn keyword coffeeTodo TODO FIXME XXX contained +hi def link coffeeTodo Todo + +syn match coffeeComment /#.*/ contains=@Spell,coffeeTodo +hi def link coffeeComment Comment + +syn region coffeeBlockComment start=/####\@!/ end=/###/ +\ contains=@Spell,coffeeTodo +hi def link coffeeBlockComment coffeeComment + +" A comment in a heregex +syn region coffeeHeregexComment start=/#/ end=/\ze\/\/\/\|$/ +\ contained contains=@Spell,coffeeTodo +hi def link coffeeHeregexComment coffeeComment + +" Embedded JavaScript +syn region coffeeEmbed matchgroup=coffeeEmbedDelim +\ start=/`/ skip=/\\\\\|\\`/ end=/`/ +\ contains=@coffeeJS +hi def link coffeeEmbedDelim Delimiter + +syn region coffeeInterp matchgroup=coffeeInterpDelim +\ start=/\#{/ end=/}/ +\ contained contains=TOP +hi def link coffeeInterpDelim Delimiter + +" A string escape sequence +syn match coffeeEscape /\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\./ contained +hi def link coffeeEscape SpecialChar + +" A regex -- must not follow a parenthesis, number, or identifier, and must not +" be followed by a number +syn region coffeeRegex start=/\%(\%()\|\i\@<!\d\)\s*\|\i\)\@<!\/\s\@!/ +\ skip=/\[[^\]]\{-}\/[^\]]\{-}\]/ +\ end=/\/[gimy]\{,4}\d\@!/ +\ oneline contains=@coffeeBasicString +hi def link coffeeRegex String + +" A heregex +syn region coffeeHeregex start=/\/\/\// end=/\/\/\/[gimy]\{,4}/ +\ contains=@coffeeInterpString,coffeeHeregexComment +\ fold +hi def link coffeeHeregex coffeeRegex + +" Heredoc strings +syn region coffeeHeredoc start=/"""/ end=/"""/ contains=@coffeeInterpString +\ fold +syn region coffeeHeredoc start=/'''/ end=/'''/ contains=@coffeeBasicString +\ fold +hi def link coffeeHeredoc String + +" An error for trailing whitespace, as long as the line isn't just whitespace +if !exists("coffee_no_trailing_space_error") + syn match coffeeSpaceError /\S\@<=\s\+$/ display + hi def link coffeeSpaceError Error +endif + +" An error for trailing semicolons, for help transitioning from JavaScript +if !exists("coffee_no_trailing_semicolon_error") + syn match coffeeSemicolonError /;$/ display + hi def link coffeeSemicolonError Error +endif + +" Ignore reserved words in dot-properties. +syn match coffeeDot /\.\@<!\.\i\+/ contains=ALLBUT,@coffeeReserved, +\ coffeeReservedError +\ transparent + +let b:current_syntax = "coffee" Property changes on: configs/trunk/src/vim/syntax/coffee.vim ___________________________________________________________________ Added: svn:executable + * Added: configs/trunk/src/vim/syntax/eco.vim =================================================================== --- configs/trunk/src/vim/syntax/eco.vim (rev 0) +++ configs/trunk/src/vim/syntax/eco.vim 2011-07-21 04:50:40 UTC (rev 1801) @@ -0,0 +1,62 @@ +" Vim syntax file +" Language: eco +" Maintainer: Jay Adkisson +" Mostly stolen from eruby.vim + +if !exists("g:eco_default_subtype") + let g:eco_default_subtype = "html" +endif + +if !exists("b:eco_subtype") + let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") + let b:eco_subtype = matchstr(s:lines,'eco_subtype=\zs\w\+') + if b:eco_subtype == '' + let b:eco_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eco\)\+$','',''),'\.\zs\w\+$') + endif + if b:eco_subtype == 'rhtml' + let b:eco_subtype = 'html' + elseif b:eco_subtype == 'rb' + let b:eco_subtype = 'ruby' + elseif b:eco_subtype == 'yml' + let b:eco_subtype = 'yaml' + elseif b:eco_subtype == 'js' || b:eco_subtype == 'json' + let b:eco_subtype = 'javascript' + elseif b:eco_subtype == 'txt' + " Conventional; not a real file type + let b:eco_subtype = 'text' + elseif b:eco_subtype == '' + if exists('b:current_syntax') && b:current_syntax != '' + let b:eco_subtype = b:current_syntax + else + let b:eco_subtype = g:eco_default_subtype + endif + endif +endif + +if exists("b:eco_subtype") && b:eco_subtype != '' && b:eco_subtype != 'eco' + exec "runtime! syntax/".b:eco_subtype.".vim" + let b:current_syntax = "eco" +endif + +syn include @coffeeTop syntax/coffee.vim + +syn cluster ecoRegions contains=ecoBlock,ecoExpression,ecoComment + +syn region ecoBlock matchgroup=ecoDelimiter start=/<%/ end=/%>/ contains=@coffeeTop containedin=ALLBUT,@ecoRegions keepend +syn region ecoExpression matchgroup=ecoDelimiter start=/<%[=\-]/ end=/%>/ contains=@coffeeTop containedin=ALLBUT,@ecoRegions keepend +syn region ecoComment matchgroup=ecoComment start=/<%#/ end=/%>/ contains=@coffeeTodo,@Spell containedin=ALLBUT,@ecoRegions keepend + +" eco features not in coffeescript proper +syn keyword ecoEnd end containedin=@ecoRegions +syn match ecoIndentColon /\s+\w+:/ containedin=@ecoRegions + +" Define the default highlighting. + +hi def link ecoDelimiter Delimiter +hi def link ecoComment Comment +hi def link ecoEnd coffeeConditional +hi def link ecoIndentColon None + +let b:current_syntax = 'eco' + +" vim: nowrap sw=2 sts=2 ts=8: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-07-21 03:52:26
|
Revision: 1800 http://assorted.svn.sourceforge.net/assorted/?rev=1800&view=rev Author: yangzhang Date: 2011-07-21 03:52:20 +0000 (Thu, 21 Jul 2011) Log Message: ----------- Document twentyeleven theme Modified Paths: -------------- personal-site/trunk/README Modified: personal-site/trunk/README =================================================================== --- personal-site/trunk/README 2011-07-20 06:45:10 UTC (rev 1799) +++ personal-site/trunk/README 2011-07-21 03:52:20 UTC (rev 1800) @@ -71,7 +71,8 @@ [mysqld] default-storage-engine=innodb -In WP, edit twentyten's style.css, header.php. Working on a better solution. +In WP, make sure twentyeleven's style.css has the pandoc syntax highlighting +CSS. Also edit easyfilter.php, adding this line before `return $filtered;`: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-07-20 06:45:18
|
Revision: 1799 http://assorted.svn.sourceforge.net/assorted/?rev=1799&view=rev Author: yangzhang Date: 2011-07-20 06:45:10 +0000 (Wed, 20 Jul 2011) Log Message: ----------- Add Jepp demo Added Paths: ----------- sandbox/trunk/src/scala/PyTest.scala Added: sandbox/trunk/src/scala/PyTest.scala =================================================================== --- sandbox/trunk/src/scala/PyTest.scala (rev 0) +++ sandbox/trunk/src/scala/PyTest.scala 2011-07-20 06:45:10 UTC (rev 1799) @@ -0,0 +1,10 @@ +package com.partyondata +import jep.Jep + +object PyTest { + def main(args : Array[String]) : Unit = { + val jep = new Jep + jep.set("query", "hello world") + jep.eval("import scipy.stats") + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-07-14 21:53:55
|
Revision: 1798 http://assorted.svn.sourceforge.net/assorted/?rev=1798&view=rev Author: yangzhang Date: 2011-07-14 21:53:49 +0000 (Thu, 14 Jul 2011) Log Message: ----------- Add FlatMap exploration Added Paths: ----------- sandbox/trunk/src/scala/FlatMap.scala Added: sandbox/trunk/src/scala/FlatMap.scala =================================================================== --- sandbox/trunk/src/scala/FlatMap.scala (rev 0) +++ sandbox/trunk/src/scala/FlatMap.scala 2011-07-14 21:53:49 UTC (rev 1798) @@ -0,0 +1,40 @@ +// for deconstructing flatMap +// try scala -Xprint:typer -Ytyper-debug + +object FlatMap extends App { + class XIterable[A](xs: TraversableOnce[A]) { + def izip[B](ys: TraversableOnce[B]) = xs.toIterator zip ys.toIterator + } + implicit def Iterable2XIterable[A](xs: TraversableOnce[A]) = new XIterable(xs) + implicit def Array2XIterable[A](xs: Array[A]) = new XIterable(xs) + + { + val xss = Array(Array(0,1,2),Array(3,4,5)) + val ys = Array(6,7,8) + for (xs <- xss.iterator; (x,y) <- xs.iterator zip ys.iterator) { + println((x,y)) + } + } + /* desugars into: + xss.iterator.foreach( xs => + xs.iterator.zip(ys.iterator).filter( pair => + pair match { + case scala.Tuple2((x @ _), (y @ _)) => true + case _ => false + } + ).foreach( x => + x match { + case scala.Tuple2((x @ _), (y @ _)) => println((x, y)) + } + ) + ) + */ + + { + val xss = Array(Array(0,1,2),Array(3,4,5)) + val ys = Array(6,7,8) + for (xs <- xss.iterator; (x,y) <- xs izip ys) { + println((x,y)) + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-07-11 09:05:01
|
Revision: 1797 http://assorted.svn.sourceforge.net/assorted/?rev=1797&view=rev Author: yangzhang Date: 2011-07-11 09:04:55 +0000 (Mon, 11 Jul 2011) Log Message: ----------- Add footer hack Modified Paths: -------------- personal-site/trunk/README Modified: personal-site/trunk/README =================================================================== --- personal-site/trunk/README 2011-07-09 20:32:45 UTC (rev 1796) +++ personal-site/trunk/README 2011-07-11 09:04:55 UTC (rev 1797) @@ -73,6 +73,10 @@ In WP, edit twentyten's style.css, header.php. Working on a better solution. +Also edit easyfilter.php, adding this line before `return $filtered;`: + + $filtered = $filtered . '<p><em><a href="http://twitter.com/yaaang">Follow me on Twitter</a> for stuff far more interesting than what I blog.</em></p>'; + Apache ------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-07-09 20:32:51
|
Revision: 1796 http://assorted.svn.sourceforge.net/assorted/?rev=1796&view=rev Author: yangzhang Date: 2011-07-09 20:32:45 +0000 (Sat, 09 Jul 2011) Log Message: ----------- Add extractor demo to Scala sandbox Added Paths: ----------- sandbox/trunk/src/scala/Unapply.scala Added: sandbox/trunk/src/scala/Unapply.scala =================================================================== --- sandbox/trunk/src/scala/Unapply.scala (rev 0) +++ sandbox/trunk/src/scala/Unapply.scala 2011-07-09 20:32:45 UTC (rev 1796) @@ -0,0 +1,16 @@ +object Unapply { + implicit def int2rint(x: Int) = RInt(x) + case class RInt(x: Int) { def /(xs: List[Int]) = x :: xs } + object / { + def unapply(xs: List[Int]) = xs match { + case y :: ys => Some(y, ys) + case _ => None + } + } + def main(args: Array[String]) { + List(1,2) match { + case x / xs => println(x / xs) + case _ => println("fail") + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-07-06 21:54:37
|
Revision: 1795 http://assorted.svn.sourceforge.net/assorted/?rev=1795&view=rev Author: yangzhang Date: 2011-07-06 21:54:31 +0000 (Wed, 06 Jul 2011) Log Message: ----------- Add circular bisect problem Added Paths: ----------- problems/other/circular-bisect/ problems/other/circular-bisect/go.py Added: problems/other/circular-bisect/go.py =================================================================== --- problems/other/circular-bisect/go.py (rev 0) +++ problems/other/circular-bisect/go.py 2011-07-06 21:54:31 UTC (rev 1795) @@ -0,0 +1,49 @@ +def coerce(f): + def wrap(*args): + try: return f(*args) + except: return -1 + return wrap + +def f(xs): + if xs == []: raise Exception() + m = len(xs) / 2 + left = xs[0] + mid = xs[m] + right = xs[-1] + if left <= mid <= right: return 0 + if left > mid: return f(xs[1:m+1]) + 1 + if mid > right: return f(xs[m+1:]) + m+1 + +def b(x, xs): + if xs == []: raise Exception() + m = len(xs) / 2 + if xs[m] == x: return m + if x < xs[m]: return b(x, xs[:m]) + if x > xs[m]: return b(x, xs[m+1:]) + m+1 + +def g(x, xs): + if xs == []: raise Exception() + if xs == [x]: return 0 + m = len(xs) / 2 + left = xs[0] + mid = xs[m] + right = xs[-1] + if left <= mid <= right: + if left <= x < mid: return g(x, xs[:m]) + if mid <= x <= right: return g(x, xs[m:]) + m + raise Exception() + if left > mid: + if mid <= x <= right: return g(x, xs[m:]) + m + else: return g(x, xs[:m]) + if mid > right: + if left <= x < mid: return g(x, xs[:m]) + else: return g(x, xs[m:]) + m + +def rot(i, xs): return xs[i:] + xs[:i] + +for n in xrange(6): + for i in xrange(n): + xs = rot(i, range(n)) + print 'n=%s n/2=%s i=%s xs=%s f=%s g=%s b=%s G=%s B=%s' % \ + (n, n/2, i, xs, f(xs), g(n/2, xs), b(n/2, range(n)), + coerce(g)(n/2-.5, xs), coerce(b)(n/2-.5, range(n))) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-07-04 07:55:17
|
Revision: 1794 http://assorted.svn.sourceforge.net/assorted/?rev=1794&view=rev Author: yangzhang Date: 2011-07-04 07:55:11 +0000 (Mon, 04 Jul 2011) Log Message: ----------- Add npm paths Modified Paths: -------------- shell-tools/trunk/src/bash-commons/bashrc.bash Modified: shell-tools/trunk/src/bash-commons/bashrc.bash =================================================================== --- shell-tools/trunk/src/bash-commons/bashrc.bash 2011-07-04 07:54:05 UTC (rev 1793) +++ shell-tools/trunk/src/bash-commons/bashrc.bash 2011-07-04 07:55:11 UTC (rev 1794) @@ -89,7 +89,7 @@ if [[ "${subdir:0:1}" == / || "$subdir" == '' ]] ; then pieces=( "${pieces[@]}" "$subdir" ) else - pieces=( "${pieces[@]}" {"$USER_PREFIX","$USER_TOAST_PREFIX","$USER_CABAL_PREFIX","$USER_GEM_PREFIX","$GLOBAL_PREFIX","$GLOBAL_TOAST_PREFIX","$GLOBAL_GEM_PREFIX"}/"$subdir" ) + pieces=( "${pieces[@]}" {"$USER_PREFIX","$USER_TOAST_PREFIX","$USER_CABAL_PREFIX","$USER_GEM_PREFIX","$USER_NPM_PREFIX","$GLOBAL_PREFIX","$GLOBAL_TOAST_PREFIX","$GLOBAL_GEM_PREFIX"}/"$subdir" ) fi done prepend_var "$var" "${pieces[@]}" @@ -121,6 +121,7 @@ export USER_TOAST_PREFIX="$HOME/.toast/armed" export USER_CABAL_PREFIX="$HOME/.cabal" export USER_GEM_PREFIX="$HOME/.gem/ruby/$RUBYVERSION" +export USER_NPM_PREFIX="$HOME/.node/node_modules" export GLOBAL_PREFIX="/opt/armed" export GLOBAL_PKG="/opt" export GLOBAL_TOAST_PREFIX="/usr/local" @@ -139,7 +140,7 @@ # TODO export PAGER=special less-like vim # TODO fix this to not use an explicit ruby version -prepend_std PATH bin sbin /sbin /usr/sbin +prepend_std PATH bin sbin .bin /sbin /usr/sbin # TODO fix this, things like /usr/local/ should get precedence over default # locations prepend_std MANPATH man '' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-07-04 07:54:11
|
Revision: 1793 http://assorted.svn.sourceforge.net/assorted/?rev=1793&view=rev Author: yangzhang Date: 2011-07-04 07:54:05 +0000 (Mon, 04 Jul 2011) Log Message: ----------- Add nuthouse Modified Paths: -------------- configs/trunk/src/ssh/config Modified: configs/trunk/src/ssh/config =================================================================== --- configs/trunk/src/ssh/config 2011-06-25 02:58:59 UTC (rev 1792) +++ configs/trunk/src/ssh/config 2011-07-04 07:54:05 UTC (rev 1793) @@ -24,6 +24,7 @@ Host dev.partyondata.com Host workping.com Host partycat.partyondata.com +Host nuthouse.partyondata.com # # MIT/SIPB/CSAIL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-06-25 02:59:05
|
Revision: 1792 http://assorted.svn.sourceforge.net/assorted/?rev=1792&view=rev Author: yangzhang Date: 2011-06-25 02:58:59 +0000 (Sat, 25 Jun 2011) Log Message: ----------- Add R arguments demo Added Paths: ----------- sandbox/trunk/src/r/ sandbox/trunk/src/r/args.R Added: sandbox/trunk/src/r/args.R =================================================================== --- sandbox/trunk/src/r/args.R (rev 0) +++ sandbox/trunk/src/r/args.R 2011-06-25 02:58:59 UTC (rev 1792) @@ -0,0 +1,14 @@ +# http://blog.moertel.com/articles/2006/01/20/wondrous-oddities-rs-function-call-semantics + +# lazy args +f = function(a=print('a'), b={print('b');3}) { print('c'); b } +f() # prints c, b, 3 +f(b=3) # prints c, 3 +f = function(a=print('a'), b=print('b')) b +f() # prints b (just once) + +# can refer to each other or even locals +f = function(a=1, b=a+1) b +f(5) # prints 6 +f = function(b=a+1) { a=3; b } +f() # prints 4 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-06-08 22:22:05
|
Revision: 1791 http://assorted.svn.sourceforge.net/assorted/?rev=1791&view=rev Author: yangzhang Date: 2011-06-08 22:21:59 +0000 (Wed, 08 Jun 2011) Log Message: ----------- Demo of using ctypes to malloc Added Paths: ----------- sandbox/trunk/src/py/malloc.py Added: sandbox/trunk/src/py/malloc.py =================================================================== --- sandbox/trunk/src/py/malloc.py (rev 0) +++ sandbox/trunk/src/py/malloc.py 2011-06-08 22:21:59 UTC (rev 1791) @@ -0,0 +1,5 @@ +from ctypes import * +# instantaneous/overcommitted; 'a'*(1<<33) doesn't work +x = CDLL('libc.so.6').malloc(1<<33) +# uninitialized garbage +print repr(cast(x, POINTER(c_char))[:10]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-06-08 20:47:55
|
Revision: 1790 http://assorted.svn.sourceforge.net/assorted/?rev=1790&view=rev Author: yangzhang Date: 2011-06-08 20:47:49 +0000 (Wed, 08 Jun 2011) Log Message: ----------- Fix m-bar shortcut in LyX Modified Paths: -------------- configs/trunk/src/lyx/bind/user.bind Modified: configs/trunk/src/lyx/bind/user.bind =================================================================== --- configs/trunk/src/lyx/bind/user.bind 2011-06-08 20:47:22 UTC (rev 1789) +++ configs/trunk/src/lyx/bind/user.bind 2011-06-08 20:47:49 UTC (rev 1790) @@ -2,5 +2,5 @@ ## All modifications will be lost -\bind "M-m M-m ~C-~M-~S-bar" "math-delim Vert Vert" +\bind "M-m M-m Bar" "math-delim Vert Vert" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-06-08 20:47:29
|
Revision: 1789 http://assorted.svn.sourceforge.net/assorted/?rev=1789&view=rev Author: yangzhang Date: 2011-06-08 20:47:22 +0000 (Wed, 08 Jun 2011) Log Message: ----------- Add boxbackup config and idle script Added Paths: ----------- configs/trunk/src/boxbackup/ configs/trunk/src/boxbackup/bbackupd.conf configs/trunk/src/boxbackup/is-idle.bash Added: configs/trunk/src/boxbackup/bbackupd.conf =================================================================== --- configs/trunk/src/boxbackup/bbackupd.conf (rev 0) +++ configs/trunk/src/boxbackup/bbackupd.conf 2011-06-08 20:47:22 UTC (rev 1789) @@ -0,0 +1,227 @@ + +StoreHostname = partycat.partyondata.com +AccountNumber = 0x1 +KeysFile = /etc/boxbackup//bbackupd/1-FileEncKeys.raw + +CertificateFile = /etc/boxbackup//bbackupd/1-cert.pem +PrivateKeyFile = /etc/boxbackup//bbackupd/1-key.pem +TrustedCAsFile = /etc/boxbackup//bbackupd/serverCA.pem + +DataDirectory = /var/lib/bbackupd + + +# This script is run whenever bbackupd changes state or encounters a +# problem which requires the system administrator to assist: +# +# 1) The store is full, and no more data can be uploaded. +# 2) Some files or directories were not readable. +# 3) A backup run starts or finishes. +# +# The default script emails the system administrator, except for backups +# starting and stopping, where it does nothing. + +NotifyScript = /etc/boxbackup//bbackupd/NotifySysadmin.sh + + +# The number of seconds between backup runs under normal conditions. To avoid +# cycles of load on the server, this time is randomly adjusted by a small +# percentage as the daemon runs. + +UpdateStoreInterval = 3600 + + +# The minimum age of a file, in seconds, that will be uploaded. Avoids +# repeated uploads of a file which is constantly being modified. + +MinimumFileAge = 21600 + + +# If a file is modified repeated, it won't be uploaded immediately in case +# it's modified again, due to the MinimumFileAge specified above. However, it +# should be uploaded eventually even if it is being modified repeatedly. This +# is how long we should wait, in seconds, after first noticing a change. +# (86400 seconds = 1 day) + +MaxUploadWait = 86400 + +# If the connection is idle for some time (e.g. over 10 minutes or 600 +# seconds, not sure exactly how long) then the server will give up and +# disconnect the client, resulting in Connection Protocol_Timeout errors +# on the server and TLSReadFailed or TLSWriteFailed errors on the client. +# Also, some firewalls and NAT gateways will kill idle connections after +# similar lengths of time. +# +# This can happen for example when most files are backed up already and +# don't need to be sent to the store again, while scanning a large +# directory, or while calculating diffs of a large file. To avoid this, +# KeepAliveTime specifies that special keep-alive messages should be sent +# when the connection is otherwise idle for a certain length of time, +# specified here in seconds. +# +# The default is that these messages are never sent, equivalent to setting +# this option to zero, but we recommend that all users enable this. + +KeepAliveTime = 120 + + +# Files above this size (in bytes) are tracked, and if they are renamed they will simply be +# renamed on the server, rather than being uploaded again. (64k - 1) + +FileTrackingSizeThreshold = 65535 + + +# The daemon does "changes only" uploads for files above this size (in bytes). +# Files less than it are uploaded whole without this extra processing. + +DiffingUploadSizeThreshold = 8192 + + +# The limit on how much time is spent diffing files, in seconds. Most files +# shouldn't take very long, but if you have really big files you can use this +# to limit the time spent diffing them. +# +# * Reduce if you are having problems with processor usage. +# +# * Increase if you have large files, and think the upload of changes is too +# large and you want bbackupd to spend more time searching for unchanged +# blocks. + +MaximumDiffingTime = 120 + + +# Uncomment this line to see exactly what the daemon is going when it's connected to the server. + +# ExtendedLogging = yes + + +# This specifies a program or script script which is run just before each +# sync, and ideally the full path to the interpreter. It will be run as the +# same user bbackupd is running as, usually root. +# +# The script must output (print) either "now" or a number to STDOUT (and a +# terminating newline, no quotes). +# +# If the result was "now", then the sync will happen. If it's a number, then +# no backup will happen for that number of seconds (bbackupd will pause) and +# then the script will be run again. +# +# Use this to temporarily stop bbackupd from syncronising or connecting to the +# store. For example, you could use this on a laptop to only backup when on a +# specific network, or when it has a working Internet connection. + +SyncAllowScript = /etc/boxbackup/is-idle.bash + + +# Where the command socket is created in the filesystem. + +CommandSocket = /var/lib/bbackupd/bbackupd.sock + +# Uncomment the StoreObjectInfoFile to enable the experimental archiving +# of the daemon's state (including client store marker and configuration) +# between backup runs. This saves time and increases efficiency when +# bbackupd is frequently stopped and started, since it removes the need +# to rescan all directories on the remote server. However, it is new and +# not yet heavily tested, so use with caution. + +# StoreObjectInfoFile = /var/lib/bbackupd/bbackupd.state + +Server +{ + PidFile = /var/lib/bbackupd/bbackupd.pid +} + + +# BackupLocations specifies which locations on disc should be backed up. Each +# directory is in the format +# +# name +# { +# Path = /path/of/directory +# (optional exclude directives) +# } +# +# 'name' is derived from the Path by the config script, but should merely be +# unique. +# +# The exclude directives are of the form +# +# [Exclude|AlwaysInclude][File|Dir][|sRegex] = regex or full pathname +# +# (The regex suffix is shown as 'sRegex' to make File or Dir plural) +# +# For example: +# +# ExcludeDir = /home/guest-user +# ExcludeFilesRegex = .(mp3|MP3)$ +# AlwaysIncludeFile = /home/username/veryimportant.mp3 +# +# This excludes the directory /home/guest-user from the backup along with all mp3 +# files, except one MP3 file in particular. +# +# In general, Exclude excludes a file or directory, unless the directory is +# explicitly mentioned in a AlwaysInclude directive. However, Box Backup +# does NOT scan inside excluded directories and will never back up an +# AlwaysIncluded file or directory inside an excluded directory or any +# subdirectory thereof. +# +# To back up a directory inside an excluded directory, use a configuration +# like this, to ensure that each directory in the path to the important +# files is included, but none of their contents will be backed up except +# the directories further down that path to the important one. +# +# ExcludeDirsRegex = ^/home/user/bigfiles/ +# ExcludeFilesRegex = ^/home/user/bigfiles/ +# AlwaysIncludeDir = /home/user/bigfiles/path +# AlwaysIncludeDir = /home/user/bigfiles/path/to +# AlwaysIncludeDir = /home/user/bigfiles/path/important +# AlwaysIncludeDir = /home/user/bigfiles/path/important/files +# AlwaysIncludeDirsRegex = ^/home/user/bigfiles/path/important/files/ +# AlwaysIncludeFilesRegex = ^/home/user/bigfiles/path/important/files/ +# +# If a directive ends in Regex, then it is a regular expression rather than a +# explicit full pathname. See +# +# man 7 re_format +# +# for the regex syntax on your platform. + +BackupLocations +{ + home-yang + { + Path = /home/yang + } + media-yang_-personal + { + Path = /media/yang_/personal + } + media-yang_-tmp + { + Path = /media/yang_/tmp + } + media-yang_-testdisk-6.11.3 + { + Path = /media/yang_/testdisk-6.11.3 + } + media-yang_-testdisk-deskstar-164 + { + Path = /media/yang_/testdisk-deskstar-164 + } + media-yang_-shared-archive + { + Path = /media/yang_/shared/archive + } + media-yang_-shared-work + { + Path = /media/yang_/shared/work + } + media-yang_-nonshared-archive + { + Path = /media/yang_/nonshared/archive + } + media-yang_-nonshared-projects + { + Path = /media/yang_/nonshared/projects + } +} + Added: configs/trunk/src/boxbackup/is-idle.bash =================================================================== --- configs/trunk/src/boxbackup/is-idle.bash (rev 0) +++ configs/trunk/src/boxbackup/is-idle.bash 2011-06-08 20:47:22 UTC (rev 1789) @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +export DISPLAY=:0.0 +if sudo -u yang gnome-screensaver-command -q | fgrep -q 'The screensaver is active' && + ! w | tail -n +3 | perl -ane 'print $F[4],"\n"' | egrep -qv '(days|m)$' +then echo now +else echo 3600 +fi Property changes on: configs/trunk/src/boxbackup/is-idle.bash ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-05-06 06:53:57
|
Revision: 1788 http://assorted.svn.sourceforge.net/assorted/?rev=1788&view=rev Author: yangzhang Date: 2011-05-06 06:53:51 +0000 (Fri, 06 May 2011) Log Message: ----------- Add wait-idle Modified Paths: -------------- shell-tools/trunk/src/bash-commons/common.bash Modified: shell-tools/trunk/src/bash-commons/common.bash =================================================================== --- shell-tools/trunk/src/bash-commons/common.bash 2011-05-06 01:51:20 UTC (rev 1787) +++ shell-tools/trunk/src/bash-commons/common.bash 2011-05-06 06:53:51 UTC (rev 1788) @@ -778,6 +778,13 @@ eval "$(keychain --eval --timeout $minutes id_rsa)" } +wait-idle() { + while (( $( top -b -n 2 | grep ^Cpu | tail -1 | + sed 's/.* \([[:digit:]]*\)\.[[:digit:]]*%id.*/\1/g' ) < 50 )) + do sleep ${sleep:-60} + done +} + #if ! is_declared indent ; then # noindent #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-05-06 01:51:26
|
Revision: 1787 http://assorted.svn.sourceforge.net/assorted/?rev=1787&view=rev Author: yangzhang Date: 2011-05-06 01:51:20 +0000 (Fri, 06 May 2011) Log Message: ----------- Update the sqlalchemy pickle demo Modified Paths: -------------- sandbox/trunk/src/py/sqlalchpickle.py Modified: sandbox/trunk/src/py/sqlalchpickle.py =================================================================== --- sandbox/trunk/src/py/sqlalchpickle.py 2011-05-06 00:50:23 UTC (rev 1786) +++ sandbox/trunk/src/py/sqlalchpickle.py 2011-05-06 01:51:20 UTC (rev 1787) @@ -9,8 +9,8 @@ id = Column(Integer, primary_key=True) # if you omit mutable=False then sqlalchemy will always compare the current # blob value with the original blob value to see if it's equal - # blob = Column(PickleType(mutable=False)) blob = Column(PickleType) + iblob = Column(PickleType(mutable=False)) eng = create_engine('postgresql:///yang', echo=False) Session = sessionmaker(bind=eng, autocommit=True) @@ -22,18 +22,37 @@ with session.begin(): # the object, after unpickling, will not be equal - session.add(Item(blob=object())) - session.add(Item(blob=object())) - session.add(Item(blob=object())) + session.add(Item(blob=object(), iblob=object())) + session.add(Item(blob='blah', iblob=object())) + session.add(Item(iblob={})) + +# This will fail because sqlalchemy will deserialize multiple times (deep-copy) +# obj, causing __eq__ to return False. +try: + with session.begin(): + session.execute('set transaction read only;') + obj = session.query(Item).get(1) + print obj + # Note that the before and after images of blob are distinct objects. + print attributes.get_history(obj, 'blob') +except Exception as ex: + print ex +# You might see the spurious UPDATE outputted somewhere after the exception, +# oddly. + +# But this won't fail, since strs have "smarter" __eq__ methods, and iblob does +# not get processed in the same way. with session.begin(): session.execute('set transaction read only;') - obj = session.query(Item).get(1) + obj = session.query(Item).get(2) print obj + # Note that the before and after images of blob are distinct objects. print attributes.get_history(obj, 'blob') - import IPython, sys - IPython.Shell.IPShell(argv=sys.argv[:1], user_ns=dict(globals(), **locals())).mainloop() - print session.query(Item).get(2) + +# Be careful updating an iblob: make sure you don't actually mutate the +# original blob such that the final comparison with the new value comes out +# equal! with session.begin(): - session.query(Item).get(1).blob='holleo' -with session.begin(): - print session.query(Item).get(1).blob + x = session.query(Item).get(3) + x.iblob[0]=0 + x.iblob = x.iblob.copy() # Try to trigger an update, but doesn't happen! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-05-06 00:50:29
|
Revision: 1786 http://assorted.svn.sourceforge.net/assorted/?rev=1786&view=rev Author: yangzhang Date: 2011-05-06 00:50:23 +0000 (Fri, 06 May 2011) Log Message: ----------- Add sqlalchemy pickletype demo Added Paths: ----------- sandbox/trunk/src/py/sqlalchpickle.py Added: sandbox/trunk/src/py/sqlalchpickle.py =================================================================== --- sandbox/trunk/src/py/sqlalchpickle.py (rev 0) +++ sandbox/trunk/src/py/sqlalchpickle.py 2011-05-06 00:50:23 UTC (rev 1786) @@ -0,0 +1,39 @@ +from sqlalchemy import * +from sqlalchemy.orm import sessionmaker, attributes +from sqlalchemy.ext.declarative import declarative_base + +Base = declarative_base() + +class Item(Base): + __tablename__ = 'items' + id = Column(Integer, primary_key=True) + # if you omit mutable=False then sqlalchemy will always compare the current + # blob value with the original blob value to see if it's equal + # blob = Column(PickleType(mutable=False)) + blob = Column(PickleType) + +eng = create_engine('postgresql:///yang', echo=False) +Session = sessionmaker(bind=eng, autocommit=True) + +Base.metadata.drop_all(bind=eng) +Base.metadata.create_all(bind=eng) + +session = Session() + +with session.begin(): + # the object, after unpickling, will not be equal + session.add(Item(blob=object())) + session.add(Item(blob=object())) + session.add(Item(blob=object())) +with session.begin(): + session.execute('set transaction read only;') + obj = session.query(Item).get(1) + print obj + print attributes.get_history(obj, 'blob') + import IPython, sys + IPython.Shell.IPShell(argv=sys.argv[:1], user_ns=dict(globals(), **locals())).mainloop() + print session.query(Item).get(2) +with session.begin(): + session.query(Item).get(1).blob='holleo' +with session.begin(): + print session.query(Item).get(1).blob This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-04-29 00:32:41
|
Revision: 1785 http://assorted.svn.sourceforge.net/assorted/?rev=1785&view=rev Author: yangzhang Date: 2011-04-29 00:32:34 +0000 (Fri, 29 Apr 2011) Log Message: ----------- Tweak git colors Modified Paths: -------------- configs/trunk/src/gitconfig Modified: configs/trunk/src/gitconfig =================================================================== --- configs/trunk/src/gitconfig 2011-04-27 01:04:12 UTC (rev 1784) +++ configs/trunk/src/gitconfig 2011-04-29 00:32:34 UTC (rev 1785) @@ -23,10 +23,22 @@ email = ya...@gm... [merge] conflictstyle = diff3 -[color] - ui = auto [branch] autosetuprebase = always [giggle] main-window-maximized = true main-window-geometry = 700x550+660+444 +[color] + ui = auto +[color "branch"] + current = yellow reverse + local = yellow + remote = green +[color "diff"] + meta = yellow bold + frag = magenta bold + old = red bold + new = green bold +[color "status"] + added = green bold + changed = red bold This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-04-27 01:04:18
|
Revision: 1784 http://assorted.svn.sourceforge.net/assorted/?rev=1784&view=rev Author: yangzhang Date: 2011-04-27 01:04:12 +0000 (Wed, 27 Apr 2011) Log Message: ----------- Demo that pickle does not call init Added Paths: ----------- sandbox/trunk/src/py/pickleinit.py Added: sandbox/trunk/src/py/pickleinit.py =================================================================== --- sandbox/trunk/src/py/pickleinit.py (rev 0) +++ sandbox/trunk/src/py/pickleinit.py 2011-04-27 01:04:12 UTC (rev 1784) @@ -0,0 +1,6 @@ +from cPickle import * +class foo(object): + def __init__(self): + print 'hello' +# Only prints 'hello' once +loads(dumps(foo())) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-04-24 19:26:41
|
Revision: 1783 http://assorted.svn.sourceforge.net/assorted/?rev=1783&view=rev Author: yangzhang Date: 2011-04-24 19:26:35 +0000 (Sun, 24 Apr 2011) Log Message: ----------- Fix pg-space to use pg_total_relation_size Modified Paths: -------------- shell-tools/trunk/src/bash-commons/common.bash Modified: shell-tools/trunk/src/bash-commons/common.bash =================================================================== --- shell-tools/trunk/src/bash-commons/common.bash 2011-04-21 01:48:07 UTC (rev 1782) +++ shell-tools/trunk/src/bash-commons/common.bash 2011-04-24 19:26:35 UTC (rev 1783) @@ -705,23 +705,24 @@ } pg-space() { - local schema=${schema:-${1:-}} + local schema=${schema:-${1:-}} flags= case ${schema:-} in + total ) local query='select sum(bytes) from schemas' flags=-At ;; '*' ) local query='select * from tables' ;; '' ) local query='select * from schemas' ;; * ) local query="select * from tables where _schema = '$schema'" ;; esac - psql -c " + psql $flags -c " with total as ( - select sum(pg_relation_size(oid)) from pg_class where relkind = 'r' + select sum(pg_total_relation_size(oid)) from pg_class where relkind = 'r' ), - basic as ( + base as ( select n.nspname as _schema, relname as _table, - pg_relation_size(r.oid) as bytes, - (100*pg_relation_size(r.oid)/(select * from total))::numeric(4,1) as pct + pg_total_relation_size(r.oid) as bytes, + (100*pg_total_relation_size(r.oid)/(select * from total))::numeric(4,1) as pct from pg_class r inner join pg_namespace n on (n.oid = relnamespace) where relkind = 'r' ), @@ -732,7 +733,7 @@ bytes, lpad(pg_size_pretty(bytes), 9) as size, pct - from basic + from base order by bytes desc ), schemas as ( @@ -741,7 +742,7 @@ sum(bytes) as bytes, lpad(pg_size_pretty(sum(bytes)::int), 9) as size, sum(pct) as pct - from basic + from base group by _schema order by bytes desc ) @@ -749,6 +750,12 @@ " } +pg-dbspace() { + for db in $(psql -Atc 'select datname from pg_database') + do printf '%12d %s\n' "$(PGDATABASE=$db pg-space total)" "$db" + done | sort -rn +} + pg-stat() { psql -c " select This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-04-21 01:48:13
|
Revision: 1782 http://assorted.svn.sourceforge.net/assorted/?rev=1782&view=rev Author: yangzhang Date: 2011-04-21 01:48:07 +0000 (Thu, 21 Apr 2011) Log Message: ----------- Added thread-local/process-local demo Added Paths: ----------- sandbox/trunk/src/py/tlsfork.py Added: sandbox/trunk/src/py/tlsfork.py =================================================================== --- sandbox/trunk/src/py/tlsfork.py (rev 0) +++ sandbox/trunk/src/py/tlsfork.py 2011-04-21 01:48:07 UTC (rev 1782) @@ -0,0 +1,6 @@ +# Thread-local does not imply process-local. +import threading as th, os +x = th.local() +x.a = 0 +os.fork() +assert x.a == 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-04-14 05:30:05
|
Revision: 1781 http://assorted.svn.sourceforge.net/assorted/?rev=1781&view=rev Author: yangzhang Date: 2011-04-14 05:29:59 +0000 (Thu, 14 Apr 2011) Log Message: ----------- Add .Rprofile Modified Paths: -------------- configs/trunk/setup-yang.bash Added Paths: ----------- configs/trunk/src/Rprofile Modified: configs/trunk/setup-yang.bash =================================================================== --- configs/trunk/setup-yang.bash 2011-04-14 05:01:14 UTC (rev 1780) +++ configs/trunk/setup-yang.bash 2011-04-14 05:29:59 UTC (rev 1781) @@ -8,6 +8,7 @@ . simple-setup.bash cd src +install .Rprofile Rprofile install .Xdefaults Xdefaults install .abcde.conf abcde.conf install .anyone zephyr/anyone Added: configs/trunk/src/Rprofile =================================================================== --- configs/trunk/src/Rprofile (rev 0) +++ configs/trunk/src/Rprofile 2011-04-14 05:29:59 UTC (rev 1781) @@ -0,0 +1 @@ +options(repos='http://cran.cnr.Berkeley.edu') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-04-14 05:01:20
|
Revision: 1780 http://assorted.svn.sourceforge.net/assorted/?rev=1780&view=rev Author: yangzhang Date: 2011-04-14 05:01:14 +0000 (Thu, 14 Apr 2011) Log Message: ----------- Tweak ls functions Modified Paths: -------------- shell-tools/trunk/src/bash-commons/bashrc.bash Modified: shell-tools/trunk/src/bash-commons/bashrc.bash =================================================================== --- shell-tools/trunk/src/bash-commons/bashrc.bash 2011-04-13 20:15:43 UTC (rev 1779) +++ shell-tools/trunk/src/bash-commons/bashrc.bash 2011-04-14 05:01:14 UTC (rev 1780) @@ -246,9 +246,13 @@ } function ll { - l -Ahl "$@" + l -Fhl "$@" } +function lla { + ll -A "$@" +} + function wgr { wget -np -m -p -k -nH "$@" } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-04-13 20:15:49
|
Revision: 1779 http://assorted.svn.sourceforge.net/assorted/?rev=1779&view=rev Author: yangzhang Date: 2011-04-13 20:15:43 +0000 (Wed, 13 Apr 2011) Log Message: ----------- Add lyx bindings Modified Paths: -------------- configs/trunk/setup-yang.bash Added Paths: ----------- configs/trunk/src/lyx/ configs/trunk/src/lyx/bind/ configs/trunk/src/lyx/bind/user.bind Modified: configs/trunk/setup-yang.bash =================================================================== --- configs/trunk/setup-yang.bash 2011-04-12 00:41:03 UTC (rev 1778) +++ configs/trunk/setup-yang.bash 2011-04-13 20:15:43 UTC (rev 1779) @@ -22,6 +22,7 @@ install .gitignore gitignore install .hgrc hgrc install .inputrc inputrc +install .lyx/bind/ lyx/bind/user.bind install .matplotlib/matplotlibrc matplotlib/matplotlibrc install .owl owl install .pythonrc.py pythonrc.py Added: configs/trunk/src/lyx/bind/user.bind =================================================================== --- configs/trunk/src/lyx/bind/user.bind (rev 0) +++ configs/trunk/src/lyx/bind/user.bind 2011-04-13 20:15:43 UTC (rev 1779) @@ -0,0 +1,6 @@ +## This file is automatically generated by lyx +## All modifications will be lost + + +\bind "M-m M-m ~C-~M-~S-bar" "math-delim Vert Vert" + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2011-04-12 00:41:10
|
Revision: 1778 http://assorted.svn.sourceforge.net/assorted/?rev=1778&view=rev Author: yangzhang Date: 2011-04-12 00:41:03 +0000 (Tue, 12 Apr 2011) Log Message: ----------- Add xlwt demo Added Paths: ----------- sandbox/trunk/src/py/xlwtdemo.py Added: sandbox/trunk/src/py/xlwtdemo.py =================================================================== --- sandbox/trunk/src/py/xlwtdemo.py (rev 0) +++ sandbox/trunk/src/py/xlwtdemo.py 2011-04-12 00:41:03 UTC (rev 1778) @@ -0,0 +1,15 @@ +from xlwt import * + +f = Font() +f.underline = Font.UNDERLINE_SINGLE +f.colour_index = 4 + +h_style = XFStyle() +h_style.font = f + +w = Workbook() +ws = w.add_sheet('Main Sheet') +ws.write(1, 1, Formula('HYPERLINK("http://www.irs.gov/pub/irs-pdf/f1000.pdf";"f1000.pdf")'), h_style) +ws.write(2, 2, Formula('HYPERLINK("mailto:rom...@gm...?subject=pyExcelerator-feedback&Body=Hello,%20Roman!";"pyExcelerator-feedback")'), h_style) + +w.save("hyperlinks.xls") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |