Skip to content

Instantly share code, notes, and snippets.

"pythoncomplete.vim - Omni Completion for python
" Maintainer: Aaron Griffin <[email protected]>
" Version: 0.9
" Last Updated: 18 Jun 2009
"
" Changes
" TODO:
" 'info' item output can use some formatting work
" Add an "unsafe eval" mode, to allow for return type evaluation
" Complete basic syntax along with import statements
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function Send_to_Screen(text)
if !exists("g:screen_sessionname") || !exists("g:screen_windowname")
call Screen_Vars()
end
execute "python send_with_strip()"
endfunction
" BufPos: Activate a buffer by its position number in the buffers
" list
" Author: Michele Campeotto <[email protected]>
" Date: 2007-04-25
" Version: 1.0
"
" This script provides a function to activate a vim buffer by passing it the
" position in the buffers list and maps it to <M-number> to easily switch
" between open buffers.
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" buftabs (C) 2006 Ico Doornekamp
"
" This program is free software; you can redistribute it and/or modify it
" under the terms of the GNU General Public License as published by the Free
" Software Foundation; either version 2 of the License, or (at your option)
" any later version.
"
" This program is distributed in the hope that it will be useful, but WITHOUT
" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
filetype plugin on
set grepprg=grep\ -nH\ $*
filetype indent on
let g:Tex_ViewRule_pdf = 'Skim'
let g:Tex_CompileRule_pdf = 'pdflatex -interaction=nonstopmode -enable-write18 -file-line-error-style $*'
"let g:Tex_CompileRule_pdf = 'xelatex -interaction=nonstopmode -file-line-error-style $*'
let g:Tex_Leader = ';'
"let g:Tex_Folding = 0
let g:Tex_AutoFolding = 0
autocmd FileType tex imap <C-L> <Plug>Tex_LeftRight
@robince
robince / setup_cluster_sharedmatrix.m
Last active December 14, 2015 21:29
setup_cluster_sharedmatrix.m
% Start your pool!
% matlabpool open
%%
% this cell gets details about the pool to find a single worker on
% each physical machine
% get all hosts and workers
spmd
t = getCurrentWorker();
@robince
robince / clonesharedmemory.m
Created March 13, 2013 14:02
clonesharedmemory.m : This function should be modified to load the required data and copy it to shared memory. It will be run once per physical machine.
function clonesharedmemory(shmkey)
% load your data here
x = rand(1000,1000);
sharedmatrix('clone', shmkey, x);
@robince
robince / savefaststruct.m
Created July 11, 2013 09:59
savefaststruct.m : savefast a structure (works inside parfor)
function savefaststruct(filename, savestruct)
% savefaststruct: fast saves of large arrays to .mat files
%
% Matlab's 'save' command can be very slow when saving large arrays,
% because by default Matlab attempts to use compression. This function
% provides a much faster alternative, at the cost of larger files.
%
% 'savefaststruct' version saves variables from a structure
% this avoids the need for evalin which does not work inside
% parfor etc.
@robince
robince / numdec2base.m
Created August 11, 2013 09:07
numdec2base.m: optimized numerical dec2base
function x = numdec2base(d,b,m)
%NUMDEC2BASE Convert decimal univariate integer to base B multivariate vector.
% NUMDEC2BASE(D,B,M) returns the representation of D as a length-M base-B
% word.
%
% Examples
% numdec2base(23,3) returns [2;1;2]
% numdec2base(23,3,5) returns [0;0;2;1;2]
%
% See also NUMBASE2DEC
@robince
robince / numbase2dec.m
Created August 11, 2013 09:08
numbase2dec.m : Optimised numerical base2dec
function d = numbase2dec(x,b)
%NUMBASE2DEC Convert base B numerical multivariate array to decimal integer.
% NUMBASE2DEC(x,B) converts the multivarate array of base B into its
% univariate decimal (base 10) equivalent.
%
% X should be M x Nt representing Nt different length-M base B words.
%
% Example
% numbase2dec([2; 1; 2],3) returns 23
%