Friday, November 28, 2014

matlab fix bad ticks, fix plot print preview,

%%% nice tick format %%%%%%%%%%%%%%%%%%
% Query xTick numerical values.
yTick = get(gca,'yTick');
% Create strings out of yTick numerical values with a prescribed precision.
% The format string '%a.bf' means to present the values within a field that
% is wide enough to fit 'a' digits with 'b' digits after the decimal point
% in the format of a 'f'loating point number.
yTickLabel = arrayfun( @(y) sprintf('%1.3f',y), yTick, 'uniformoutput', false);
% Use xTickLabel on the plot.
set(gca, 'yTickLabel', yTickLabel);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
src: http://www.mathworks.com/matlabcentral/answers/103188-how-do-i-format-tick-labels

To prevent Matlab from messing it once again at the print level:


Thursday, November 27, 2014

latex invisible section

Something like this:
\newcommand\invisiblesection[1]{%
  \refstepcounter{section}%
  \addcontentsline{toc}{section}{\protect\numberline{\thesection}#1}%
  \sectionmark{#1}}
...

\invisiblesection{Blah}
 
http://tex.stackexchange.com/questions/68272/make-section-headings-invisible 

Tuesday, November 25, 2014

makebst bst dbj file modify by hand

During the makebst-session:
COLLECTION/PROCEEDINGS TITLES (if quoted title)
(*) Quote collection and proceedings titles too
(x) Collection and proceedings titles not in quotes
Choose x.
It's unnecessary to redo the whole session (like I did four times), just open up the dbj-file and comment out the wrong answers, and remove the comment-sign (%) at the correct answers. Just remove one comment-sign at the relevant answer, sometimes there's a purpose to have a second comment-sign at some answers.
Then open up your terminal and call on the edited dbj-file that generates the bst-file.
latex foo.dbj
Where foo is the name you choose in the beginning of the session.

http://tex.stackexchange.com/questions/22902/adjusting-booktitle-in-inproceedings-in-a-makebst-file

Saturday, November 8, 2014

Beep in shell script

SRC: http://askubuntu.com/questions/19906/beep-in-shell-script-not-working

Solution 1)
First run sudo modprobe pcspkr and then beep should work.
The reason this doesn't is because by default Ubuntu no longer loads the hardware driver that produce beeps.
If this works for you then to enable the loading of pcspkr permanently edit the /etc/modprobe.d/blacklist.conf file (using gksudo gedit perhaps) and comment out line that says blacklist pcspkr so it looks like this:
# ugly and loud noise, getting on everyone's nerves; this should be done by a
# nice pulseaudio bing (Ubuntu: #77010)
# blacklist pcspkr
 
Solution 2) 
Not being a fan of the pcspkr beep, I use a beep from one of the system sounds with the installed pulseaudio server's paplay command.
First find a sound you like (you can browse /usr/share/sounds for some available ones for example) and create a reference to it
export BEEP=/usr/share/sounds/KDE-Im-Message-In.ogg
Then have it available as a command
alias beep='paplay $BEEP'
Now just run beep whenever you need it. For example, to alert you when a command is finished:
find . | grep treasure ; beep