<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Where I keep my short notes of any topic.</description><title>My notes bin</title><generator>Tumblr (3.0; @truongnotes)</generator><link>http://truongnotes.tumblr.com/</link><item><title>BibTeX - Make one author's name bold every time it shows up in the bibliography</title><description>&lt;a href="http://tex.stackexchange.com/questions/33330/make-one-authors-name-bold-every-time-it-shows-up-in-the-bibliography"&gt;BibTeX - Make one author's name bold every time it shows up in the bibliography&lt;/a&gt;: &lt;p&gt;This can be super useful when writing academic CVs.&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/48307201493</link><guid>http://truongnotes.tumblr.com/post/48307201493</guid><pubDate>Thu, 18 Apr 2013 18:15:14 -0400</pubDate><category>latex</category><category>bibtex</category></item><item><title>How to present using Org-mode in Emacs</title><description>&lt;a href="http://sachachua.com/blog/2013/04/how-to-present-using-org-mode-in-emacs/"&gt;How to present using Org-mode in Emacs&lt;/a&gt;: &lt;p&gt;A nice summary of presentation options in org-mode/Emacs by Sacha Chua.&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/48212319304</link><guid>http://truongnotes.tumblr.com/post/48212319304</guid><pubDate>Wed, 17 Apr 2013 14:29:46 -0400</pubDate><category>emacs</category><category>orgmode</category></item><item><title>Effective programming practices for economists</title><description>&lt;a href="http://www.uni-bonn.de/~hmg308/teaching/prog_econ_2011.html"&gt;Effective programming practices for economists&lt;/a&gt;: &lt;p&gt;A course on programming tools and practices for economists, but it is also useful for scientists in general. Check out the slides, especially the ones on version control and project workflow with Waf.&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/35437902937</link><guid>http://truongnotes.tumblr.com/post/35437902937</guid><pubDate>Sat, 10 Nov 2012 17:40:56 -0500</pubDate><category>research</category><category>python</category><category>computer</category></item><item><title>Enforce LaTeX to respect margins</title><description>&lt;p&gt;Generally LaTeX tries to respect the margin settings. However, it may still violate the settings and overrun the margins, especially when there are inline equations in the text. To make LaTeX strictly follow the margin settings, put command &lt;code&gt;\sloppy&lt;/code&gt; at the beginning of the document (right after begin document).&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/31741241591</link><guid>http://truongnotes.tumblr.com/post/31741241591</guid><pubDate>Mon, 17 Sep 2012 14:51:07 -0400</pubDate><category>latex</category></item><item><title>LaTeX: table columns with equal widths (or any specified width)</title><description>&lt;p&gt;When writing my thesis, I created a table. However, some columns have unequal widths, which looks awful. So I used the paragraph column type (p) to specify their widths. The problem is that they are left-aligned while I want them centered.  I then used the &lt;code&gt;array&lt;/code&gt; package and use the prefix specs &lt;code&gt;&amp;gt;{\centering}&lt;/code&gt;, but it caused error due to the new line command (&amp;#92;) being changed. To fix this, you need to specify &lt;code&gt;&amp;gt;{\centering\arraybackslash}&lt;/code&gt;. The final code is:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;  \begin{tabular}{lc*{3}{&amp;gt;{\centering\arraybackslash}p{5em}}}&lt;br/&gt;    \toprule&lt;br/&gt;    &amp;amp; Total No. &amp;amp; \multicolumn{3}{c}{Interval between switchings of $u_{1}$ (min)} \\&lt;br/&gt;    \cmidrule(l){3-5}&lt;br/&gt;    &amp;amp; of switchings &amp;amp; Max &amp;amp; Min &amp;amp; Average \\&lt;br/&gt;    \midrule&lt;br/&gt;    Uncoordinated &amp;amp; 20 &amp;amp; 122.00 &amp;amp; 98.01 &amp;amp; 106.16 \\&lt;br/&gt;    Robust &amp;amp; 127 &amp;amp; 16.75 &amp;amp; 16.75 &amp;amp; 16.75 \\&lt;br/&gt;    Event-triggered &amp;amp; 92 &amp;amp; 46.23&amp;amp;19.65 &amp;amp; 22.99 \\&lt;br/&gt;    Self-triggered &amp;amp; 95 &amp;amp; 40.28 &amp;amp; 19.43 &amp;amp; 22.65 \\&lt;br/&gt;    \bottomrule&lt;br/&gt;  \end{tabular}&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://truongnotes.tumblr.com/post/29476635444</link><guid>http://truongnotes.tumblr.com/post/29476635444</guid><pubDate>Wed, 15 Aug 2012 08:14:19 -0400</pubDate><category>latex</category></item><item><title>Wink - good free software for capturing screens and audio</title><description>&lt;a href="http://www.debugmode.com/wink/"&gt;Wink - good free software for capturing screens and audio&lt;/a&gt;: &lt;p&gt;Instead of capturing a full motion video, it captures the movement of the cursor, the audio, and the screen only when it is changed/updated. This way, the file size is small and of high quality. It is suitable for creating tutorials, guide of GUI…&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/29093656257</link><guid>http://truongnotes.tumblr.com/post/29093656257</guid><pubDate>Thu, 09 Aug 2012 21:53:22 -0400</pubDate><category>free</category><category>software</category><category>screen capture</category></item><item><title>Sharing LaTeX definitions with IPE pictures</title><description>&lt;p&gt;This manual &lt;a href="http://ipe7.sourceforge.net/manual/manual_35.html" target="_blank"&gt;page&lt;/a&gt; instructs how to share LaTeX definitions (e.g. in your paper) with pictures created in IPE. However, that solution did not work for me. I figured out a simpler solution:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;In IPE, use menu &amp;#8220;Help/Show Configuration&amp;#8221; to see which directory is used for temporary LaTeX files; in my case, it is ~/.ipe/latexrun.&lt;/li&gt;
&lt;li&gt;Copy the LaTeX definition files that you want to use to that directory.&lt;/li&gt;
&lt;li&gt;In IPE, use menu &amp;#8220;Edit/Document Properties&amp;#8221; to edit the preamble to input these files.&lt;/li&gt;
&lt;li&gt;That&amp;#8217;s it. Now re-LaTeX your IPE figures.&lt;/li&gt;
&lt;/ul&gt;</description><link>http://truongnotes.tumblr.com/post/27147777246</link><guid>http://truongnotes.tumblr.com/post/27147777246</guid><pubDate>Fri, 13 Jul 2012 17:27:20 -0400</pubDate><category>ipe</category><category>latex</category></item><item><title>Fine-tune volume and brightness in OS X</title><description>&lt;a href="http://www.macworld.com/article/1167595/fine_tune_volume_and_brightness_in_os_x.html#lsrc.nl_mwhints_h_crawl"&gt;Fine-tune volume and brightness in OS X&lt;/a&gt;: &lt;p&gt;Useful trick for fine-tune the volume and brightness in OS X. In short: pressing buttons to change volume/brightness only changes in whole steps of increment; but holding down Shift-Option will change in quarter steps of increment.&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/26918270247</link><guid>http://truongnotes.tumblr.com/post/26918270247</guid><pubDate>Tue, 10 Jul 2012 14:45:35 -0400</pubDate><category>mac</category></item><item><title>LaTeX's delimiters are way too complicated</title><description>&lt;p&gt;I&amp;#8217;ve just discovered today that the way LaTeX handles delimiters, like (, ), [, ], is very very complicated.&lt;/p&gt;
&lt;p&gt;Basically, those delimiters can be treated in two ways (or two types):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Ordinary atoms: as the name suggests, they are just ordinary atoms and there is no special handling taken.&lt;/li&gt;
&lt;li&gt;Open and close atoms: they open and close some inner atoms, for example in cos(x), the delimiters ( and ) open and close the inner atom x OF the operator cos.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The visual difference may not be too obvious. In the first case (ordinary atoms), there is often some thin space before/after the delimiters. In the second case, there is none (space = 0). So, using the same example cos(x):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Ordinary atoms: there is some thin space between &amp;#8216;cos&amp;#8217; and &amp;#8216;(&amp;#8217; and between &amp;#8216;)&amp;#8217; and what follows. This is undesirable because it detaches the operator cos and its parameter.&lt;/li&gt;
&lt;li&gt;Open and close atoms: there is no space between &amp;#8216;cos&amp;#8217; and &amp;#8216;(&amp;#8217; and between &amp;#8216;)&amp;#8217; and what follows. This is desirable because the contents inside the parentheses is the parameter of the operator cos.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Surprisingly, \left and \right produce ordinary atoms instead of open/close atoms.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;\left, \right, \big, \bigg, &amp;#8230; produce ordinary atoms.&lt;/li&gt;
&lt;li&gt;(, ), [, ], \lvert, \rvert, \lVert, \rVert, \bigl, \bigr, \biggl, \biggr, &amp;#8230; produce open/close atoms.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;So, to summarize:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Avoid using \left, \right after operators.&lt;/li&gt;
&lt;li&gt;After an operator (such as cos, sin, log, sum,&amp;#8230;) whose parameters are the inner contents of the delimiters, use the plain delimiters or their &amp;#60;size&amp;gt;l, &amp;#60;size&amp;gt;r friends, so that open/close atoms are produced correctly.&lt;/li&gt;
&lt;li&gt;Note that the matrix environments (bmatrix, pmatrix,&amp;#8230;) use \left, \right (producing ordinary atoms).&lt;/li&gt;
&lt;li&gt;The package &lt;a href="http://ctan.org/pkg/mleftright" target="_blank"&gt;mleftright&lt;/a&gt; might be of interest. It defines \mleft and \mright to produce open/close delimiters for \left and \right. It provides a command to re-define all \left and \right to \mleft and \mright.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;References:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://tex.stackexchange.com/questions/2607/spacing-around-left-and-right" target="_blank"&gt;http://tex.stackexchange.com/questions/2607/spacing-around-left-and-right&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://tex.stackexchange.com/questions/19480/why-the-control-sequences-bigl-biggl-bigr-or-biggr-as-i-can-always-use-b" target="_blank"&gt;http://tex.stackexchange.com/questions/19480/why-the-control-sequences-bigl-biggl-bigr-or-biggr-as-i-can-always-use-b&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://tex.stackexchange.com/questions/23640/how-to-input-open-intervals" target="_blank"&gt;http://tex.stackexchange.com/questions/23640/how-to-input-open-intervals&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><link>http://truongnotes.tumblr.com/post/25222260839</link><guid>http://truongnotes.tumblr.com/post/25222260839</guid><pubDate>Sat, 16 Jun 2012 08:53:00 -0400</pubDate><category>latex</category></item><item><title>tikz pgf - todonotes and tikzexternalize</title><description>&lt;a href="http://tex.stackexchange.com/questions/42486/todonotes-and-tikzexternalize"&gt;tikz pgf - todonotes and tikzexternalize&lt;/a&gt;: &lt;p&gt;Fix a conflict between todonotes and TikZ’s externalization.&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/25091388936</link><guid>http://truongnotes.tumblr.com/post/25091388936</guid><pubDate>Thu, 14 Jun 2012 10:38:45 -0400</pubDate><category>latex</category><category>tikz</category></item><item><title>Automatically set file name of externalized graphics equal to the file name of the tikz/PGF file</title><description>&lt;a href="http://tex.stackexchange.com/questions/57737/automatically-set-file-name-of-externalized-graphics-equal-to-the-file-name-of-t"&gt;Automatically set file name of externalized graphics equal to the file name of the tikz/PGF file&lt;/a&gt;: &lt;p&gt;Useful for writing LaTeX documents with TikZ’s externalization, where the TikZ code is input from external code files.&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/25091361277</link><guid>http://truongnotes.tumblr.com/post/25091361277</guid><pubDate>Thu, 14 Jun 2012 10:37:58 -0400</pubDate><category>latex</category><category>tikz</category></item><item><title>Matlab's xmlread causes error because DTD file not found</title><description>&lt;p&gt;Recent versions of Matlab include several functions, based on Java, for reading and writing XML files. However, there is an annoying error reported by xmlread when reading XML files with a DTD file which cannot be found. Even if the location of the DTD file is known, specifying its path requires implementing a Java interface (EntityResolver), which is impossible in Matlab. So, a (hacking) solution is to instruct the XML parser to ignore all DTD features.&lt;/p&gt;
&lt;p&gt;According to the xmlread.m function (edit xmlread in Matlab):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Advanced use:&lt;br/&gt;Note that FILENAME can also be an InputSource, File, or InputStream object&lt;br/&gt;DOMNODE = XMLREAD(FILENAME,&amp;#8230;,P,&amp;#8230;) where P is a DocumentBuilder object&lt;br/&gt;DOMNODE = XMLREAD(FILENAME,&amp;#8230;,&amp;#8217;-validating&amp;#8217;,&amp;#8230;) will create a validating parser if one was not provided.&lt;br/&gt;DOMNODE = XMLREAD(FILENAME,&amp;#8230;,ER,&amp;#8230;) where ER is an EntityResolver will set the EntityResolver before parsing&lt;br/&gt;DOMNODE = XMLREAD(FILENAME,&amp;#8230;,EH,&amp;#8230;) where EH is an ErrorHandler will set the ErrorHandler before parsing&lt;br/&gt;[DOMNODE,P] = XMLREAD(FILENAME,&amp;#8230;) will return a parser suitable for passing back to XMLREAD for future parses.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We will create our own DocumentBuilderFactory object, disable its DTD feature, and pass it to xmlread function. The steps are as follows:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;dbf = javaMethod(&amp;#8216;newInstance&amp;#8217;, &amp;#8216;javax.xml.parsers.DocumentBuilderFactory&amp;#8217;);&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s1"&gt;dbf.setFeature(&lt;/span&gt;&amp;#8216;http://apache.org/xml/features/nonvalidating/load-external-dtd&amp;#8217;&lt;span class="s1"&gt;, false);&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s1"&gt;doc = xmlread(&amp;#8216;myfile.xml&amp;#8217;, dbf);&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://truongnotes.tumblr.com/post/23620877365</link><guid>http://truongnotes.tumblr.com/post/23620877365</guid><pubDate>Wed, 23 May 2012 15:26:01 -0400</pubDate><category>matlab</category><category>java</category><category>xml</category></item><item><title>MATLAB Plot Gallery</title><description>&lt;a href="http://www.mathworks.com/discovery/gallery.html"&gt;MATLAB Plot Gallery&lt;/a&gt;</description><link>http://truongnotes.tumblr.com/post/23526243978</link><guid>http://truongnotes.tumblr.com/post/23526243978</guid><pubDate>Mon, 21 May 2012 23:44:04 -0400</pubDate><category>matlab</category></item><item><title>Guidelines for writing clean and fast code in MATLAB</title><description>&lt;a href="http://www.mathworks.com/matlabcentral/fileexchange/22943-guidelines-for-writing-clean-and-fast-code-in-matlab"&gt;Guidelines for writing clean and fast code in MATLAB&lt;/a&gt;: &lt;p&gt;Great document.&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/23019871832</link><guid>http://truongnotes.tumblr.com/post/23019871832</guid><pubDate>Sun, 13 May 2012 23:32:24 -0400</pubDate><category>matlab</category></item><item><title>List of incomplete proofs - Wikipedia, the free encyclopedia</title><description>&lt;a href="http://en.wikipedia.org/wiki/List_of_incomplete_proofs"&gt;List of incomplete proofs - Wikipedia, the free encyclopedia&lt;/a&gt;: &lt;p&gt;Very interesting list. One thing I learned from this list is that there exist continuous functions that are not differentiable anywhere.&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/22561297913</link><guid>http://truongnotes.tumblr.com/post/22561297913</guid><pubDate>Sun, 06 May 2012 21:46:44 -0400</pubDate><category>math</category></item><item><title>Reduce the size of Google Chrome - Mac OS X Hints</title><description>&lt;a href="http://hints.macworld.com/article.php?story=20120426095831578#lsrc.nl_mwhints_h"&gt;Reduce the size of Google Chrome - Mac OS X Hints&lt;/a&gt;: &lt;p&gt;This hint is very helpful. I don’t know why Google keeps all previous versions of Google Chrome on the hard disk. Mine is 1.7Gb. Crazy!&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/22238163025</link><guid>http://truongnotes.tumblr.com/post/22238163025</guid><pubDate>Tue, 01 May 2012 22:31:48 -0400</pubDate></item><item><title>Create Matlab's Namespace with Packages</title><description>&lt;a href="http://www.mathworks.com/help/techdoc/matlab_oop/brfynt_-1.html"&gt;Create Matlab's Namespace with Packages&lt;/a&gt;: &lt;p&gt;In recent versions of Matlab, you can organize your functions and classes into packages, so that you can have separate namespaces for these functions and classes. Although the implementation is not ideal (I think implementations in Python and other languages are better), it is a good step in the right direction for Matlab. The global-only namespace is convenient but quickly becomes very messy when you have many toolboxes. You can also &lt;a href="http://www.mathworks.com/help/techdoc/matlab_oop/bru76yt-1.html" target="_blank"&gt;import&lt;/a&gt; packages into the current function.&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/21724287585</link><guid>http://truongnotes.tumblr.com/post/21724287585</guid><pubDate>Tue, 24 Apr 2012 14:18:02 -0400</pubDate><category>matlab</category></item><item><title>Create cell array of SDP variables in YALMIP</title><description>&lt;p&gt;This feature of YALMIP is not documented (at least in the online help) but is used &lt;a href="http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Examples.DP" target="_blank"&gt;here&lt;/a&gt;. To create an SDP variable of dimensions n-by-m, we use:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;x = sdpvar(n, m);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;However, if &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;m&lt;/code&gt; are vectors then a cell array of SDP variables of corresponding dimensions will be created. For example:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;x = sdpvar([2 3 4], [1 3 2]);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;will create x as a cell array: x{1} is an SDP variable of dimensions 2-by-1, x{2} of dimensions 3-by-3, and x{3} of dimensions 4-by-2. This can be useful for Dynamic Programming, Model Predictive Control, and any optimization involving multiple steps.&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/21621836470</link><guid>http://truongnotes.tumblr.com/post/21621836470</guid><pubDate>Sun, 22 Apr 2012 22:02:39 -0400</pubDate><category>matlab</category><category>optimization</category><category>yalmip</category></item><item><title>Vietnam Cooking Experience – Nice website about Vietnamese Cuisine</title><description>&lt;a href="http://vietnam-cooking-experience.com/en/"&gt;Vietnam Cooking Experience – Nice website about Vietnamese Cuisine&lt;/a&gt;</description><link>http://truongnotes.tumblr.com/post/21509778060</link><guid>http://truongnotes.tumblr.com/post/21509778060</guid><pubDate>Sat, 21 Apr 2012 13:54:37 -0400</pubDate><category>vietnam</category></item><item><title>CVXGEN: Code Generation for Convex Optimization</title><description>&lt;a href="http://cvxgen.com/"&gt;CVXGEN: Code Generation for Convex Optimization&lt;/a&gt;: &lt;p&gt;A tool that generates a C-code solver for a specific fixed-size QP optimization problem (that includes LP). It can be very useful for implementation in real applications, deployment, and even in simulation where you have to solve repeatedly a specific optimization problem many times.&lt;/p&gt;</description><link>http://truongnotes.tumblr.com/post/21448376029</link><guid>http://truongnotes.tumblr.com/post/21448376029</guid><pubDate>Fri, 20 Apr 2012 16:05:58 -0400</pubDate><category>optimization</category><category>matlab</category></item></channel></rss>
