![]()
|
These are mainly quick little tips about Vim, latex and Matlab, since I use all three of these on a daily basis.
IEEEabrv.bib which is available at ctan.org's IEEEtran directory. If you include this bib file, then, for example, the string IEEE_J_IT will expand to "{IEEE} Trans. Inf. Theory" in the bib file.
\succsim (which I can never remember).
N = 1000000; a = randn(N,1); b = randn(N,1); tic s = 0; for k = 1:N s = s + a(k)*b(k); end toc |
N = 1000000; a = randn(N,1); b = randn(N,1); tic s = 0; for k = 1:N s = s + a(k)*b(k); end toc k = 19; % line "A" |
N = 1000000; a = randn(N,1); b = randn(N,1); tic s = 0; for k = 1:N s = s + a(k)*b(k); end toc k = [4,5]; % line "B" |
feature accel off N = 1000000; a = randn(N,1); b = randn(N,1); tic s = 0; for k = 1:N s = s + a(k)*b(k); end toc feature accel on |
| variant | R2006a, Windows XP, Pentium 4 3 GHz | R2008a, Windows XP, Pentium 4 3 GHz | R2006a, Redhat RHEL4, Pentium 4 3 GHz | R2007a, Debian, Pentium 4 3 GHz | R2010a, Redhat RHEL5, Pentium i7 2.7 GHz |
| normal, cell mode | 2.04 s | 0.04 s | 1.73 s | 1.80 s | 0.87 s |
| normal, F5 | .019 s | .014 s | .011 s | .011 s | .007 s |
| line "A", F5 | .042 s | .0435 s | .038 s | .018 s | .038 s |
| line "B", F5 | 2.447 s | 1.87 s | 2.90 s | 1.90 s | 1.03 s |
| no JIT, cell mode | NA | NA | 1.76 s | 1.79 s | 0.81 s |
| no JIT, F5 | NA | NA | 2.20 s | 2.40 s | 1.30 s |
After my fix (see below), it looks like this:
To do this automatically, on Unix/Linux, edit the file ~/.vim/after/syntax (not all of those directories exist by default, so you may need to make them), and make a file tex.vim containing the following:
set spell syn spell toplevel setlocal spell spelllang=en_us syn cluster texCommentGroup contains=texTodo,@NoSpell hi def link texBlockComment texCommentand that's it. (to get syntax highlight in html, see this blog comment).
figure from the Matlab command, and then after the figure is open, change focus back to the editor (but don't close the figure). If you can still type, type close. After this, if your system has the bug, you shouldn't be able to type.
127.0.0.1 is just localhost (that is, your own computer). Of course, change the path to Matlab if you've installed somewhere other than /opt/matlab/bin.
I use an ssh keyserver so this doesn't require me to enter a password, but if you don't use that kind of system, then you may need to enter a password or reconfigure it.
Statement...
~/.backup on my Linux laptop). Then, in your Vimrc file, add a link like
/usr/share/backgrounds.
I then make a subfolder and put whatever background pictures I want in the slideshow into this folder.
Run the script (you may need root privileges) in this subfolder, and it makes out.xml,
which is what gnome needs to run the slideshow.
$VIMRUNTIME/after/syntax
(you may need to make this directory), where $VIMRUNTIME is often something like ~/.vim; the original syntax highlighting files, which you probably shouldn't touch (and may not even have write access to) are in $VIM/syntax, and you can use these as examples. Vim is pretty smart, and if you edit a C language file, it will look for syntax files called c.vim. So, some useful files:
matlab.vim When editing a MATLAB source file,
this lets Vim recognize block comments (these comments start with %{ and end with %},
much like /* and */ in C ).
c.vim This adds support for highlighting keywords
from the pthreads and MPI libraries. You can use it as a template for whenever you are using
a new API frequently. I find that syntax highlighting greatly reduces the number of typos
in my code (and if you find a typo in this file, please let me know).
cpp.vim Same thing, but for C++ instead
of C (there's not much difference).
Page last modified Jul 06, 2011