<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>A Stata Mind</title>
	<atom:link href="http://enoriver.net/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://enoriver.net</link>
	<description>my notes on computing</description>
	<lastBuildDate>Wed, 17 Mar 2010 02:55:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Count missing observations</title>
		<link>http://enoriver.net/index.php/2010/03/16/count-missing-observations/</link>
		<comments>http://enoriver.net/index.php/2010/03/16/count-missing-observations/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 02:54:59 +0000</pubDate>
		<dc:creator>Gabi Huiber</dc:creator>
				<category><![CDATA[Stata]]></category>
		<category><![CDATA[missing()]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://enoriver.net/?p=1144</guid>
		<description><![CDATA[With one variable, that's easy enough: count if missing(variable-name). If you have several variables, you can put them in a foreach loop. But if you have to do this for arbitrary lists of variables in several files, it may be interesting to package that foreach loop inside a quick command that might handle special display [...]]]></description>
			<content:encoded><![CDATA[<p>With one variable, that's easy enough: <code>count if missing(<em>variable-name</em>)</code>. If you have several variables, you can put them in a foreach loop. But if you have to do this for arbitrary lists of variables in several files, it may be interesting to package that foreach loop inside a quick command that might handle special display instructions as well. </p>
<p>Here is one suggestion:</p>
<p><code>
<pre>
// countIfMissing: display the total count of observations, then
// any counts of missing observations for each variable in a list.
capture prog drop countIfMissing
program countIfMissing

version 11
syntax varlist

quietly count
local count=r(N)

// now make things align nicely
local sum=`count'
local tens=1
while `sum'/10>1 {
   local sum=`sum'/10
   local tens=`tens'+1
}
local width=`tens'+int(`tens'/3)
local varct: list sizeof varlist

di ""
di "Observations:"
di %`width'.0fc `count'
di ""
di "Missing:"
foreach varble in `varlist' {
   qui count if missing(`varble')
   local ct=r(N)
   local pct: di %4.2fc 100*`ct'/`count'
   if `pct'>0 {
      di %`width'.0fc `ct' " `varble' (`pct'%)"
   }
   else {
      local varct=`varct'-1
   }
}
if `varct'==0 {
   local offset=`width'+2
   di _column(`offset') "none of `varlist'"
}
di ""

end
</pre>
<p></code></p>
<p>For an example of usage, you can try this:</p>
<p><code>
<pre>
sysuse auto
local myvars "make price foreign"
countIfMissing `myvars'
countIfMissing m*       // (1)
countIfMissing _all     // (2)
</pre>
<p></code></p>
<p>As you can see in (1) and (2), the usual varlist conveniences apply here. </p>
]]></content:encoded>
			<wfw:commentRss>http://enoriver.net/index.php/2010/03/16/count-missing-observations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Vim run Stata and clean up after itself</title>
		<link>http://enoriver.net/index.php/2010/03/02/making-vim-run-stata-and-clean-up-after-itself/</link>
		<comments>http://enoriver.net/index.php/2010/03/02/making-vim-run-stata-and-clean-up-after-itself/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 06:04:11 +0000</pubDate>
		<dc:creator>Gabi Huiber</dc:creator>
				<category><![CDATA[Stata]]></category>
		<category><![CDATA[text editors]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://enoriver.net/?p=1071</guid>
		<description><![CDATA[Last week I mentioned that in the course of switching from Notepad++ to Vim I lost the ability to run Stata do-files or selected lines from within the text editor, and I asked my readers for help if they had a solution. What do you know, one of them did, and wrote to me all [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I mentioned that in the course of switching from Notepad++ to Vim I lost the ability to run Stata do-files or selected lines from within the text editor, and I asked my readers for help if they had a solution. What do you know, one of them did, and wrote to me all the way from China with a Vim script that solves both problems. I won't repeat it here because it is almost identical to <a href="http://www.stata.com/statalist/archive/2006-06/msg00905.html">this one</a>. Clearly, I need to remember to always look into the Statalist archive first. </p>
<p>There was one line that I had to change, where Vim is ordered to clean up after itself. Every time you runDoLines() you produce a bunch of .tmp.do files in your %temp% directory, which Vim knows as $TEMP. Though this<br />
<code><br />
au VimLeave * exe "!del -y " temp<br />
</code><br />
should have deleted them, on my computer it did not. This one did:<br />
<code><br />
au VimLeave * silent exe '!del /Q "'.$TEMP.'\*.tmp.do"'<br />
</code><br />
Another thing I tinkered with was the way Vim handles these backup files that end in a tilde. You can disable them entirely, by adding<br />
<code><br />
set nobackup nowritebackup<br />
</code><br />
to _vimrc as explained <a href="http://www.faqs.org/faqs/editor-faq/vim/">here</a>. You can also have Vim keep them somewhere you can delete them explicitly, in bulk, as explained <a href="http://vimdoc.sourceforge.net/cgi-bin/vimfaq2html3.pl#7.2">here</a>. Finally, you can use a combination of both: you save backup files while Vim is working, but then you make it delete them all when it starts next time. That is explained <a href="http://vim.wikia.com/wiki/Remove_swap_and_backup_files_from_your_working_directory">here</a>. I went with it, so after I created a temp folder in $VIMRUNTIME, I added this to my _vimrc file:<br />
<code><br />
" Keeps backups in $VIMRUNTIME\temp folder, cleans them up<br />
silent execute '!mkdir "'.$VIMRUNTIME.'\temp"'<br />
silent execute '!del /Q "'.$VIMRUNTIME.'\temp\*~"'<br />
set backupdir=$VIMRUNTIME\\temp\\<br />
set directory=$VIMRUNTIME\\temp\\<br />
</code><br />
In the process of figuring this out, I also discovered that there's a quick way to clean up %temp% thoroughly, as shown <a href="http://www.css-networks.com/2008/08/how-to-clear-the-temp-directory.html">here</a>. Good to know. One of these days I might add that to _vimrc too. Now I'm on a roll.</p>
]]></content:encoded>
			<wfw:commentRss>http://enoriver.net/index.php/2010/03/02/making-vim-run-stata-and-clean-up-after-itself/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Program vs. include smackdown</title>
		<link>http://enoriver.net/index.php/2010/02/28/program-vs-include-smackdown/</link>
		<comments>http://enoriver.net/index.php/2010/02/28/program-vs-include-smackdown/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 02:25:11 +0000</pubDate>
		<dc:creator>Gabi Huiber</dc:creator>
				<category><![CDATA[Stata]]></category>

		<guid isPermaLink="false">http://enoriver.net/?p=1054</guid>
		<description><![CDATA[When it comes to defining local macros in a different place from where you use them, you have two options: a do-file you include as needed or an r-class program that you call as needed. I talked about it here and said that a program is a better choice, without any evidence to back up [...]]]></description>
			<content:encoded><![CDATA[<p>When it comes to defining local macros in a different place from where you use them, you have two options: a do-file you <code>include</code> as needed or an r-class program that you call as needed. I talked about it <a href="http://enoriver.net/index.php/2010/02/18/define-local-macros-in-one-place-use-them-everywhere/">here</a> and said that a program is a better choice, without any evidence to back up that claim. A reader called me on it, so I went and checked. Turns out he's right. Below is how I went about it:</p>
<p>I wrote a do-file, called work.do, that just uses a dataset, nothing more. That data set's name is handled by a local macro, defined in a separate do-file, called locals.do, which work.do includes. Then I wrote locals_program.do which does the same job via a program, which then work_program.do calls by name. Finally, I wrote a profiler.do file that called all four files a few times, and measured the time they all took doing their thing. According to profiler.do, an include is usually faster than a program. Below is the code:</p>
<p><code>
<pre>
// work.do starts here:
include locals.do
use "`my_file'"
</pre>
<p></code><br />
<code>
<pre>
// locals.do starts here
local file_path "C:/work/romanian papers circulation figures/data/"
local file_name "file_combined.dta"
local my_file   "`file_path'`file_name'"
</pre>
<p></code><br />
<code>
<pre>
// this is locals_program.do
capture prog drop defineMyLocals
program defineMyLocals, rclass

local file_path "C:/work/romanian papers circulation figures/data/"
local file_name "file_combined.dta"
local my_file   "`file_path'`file_name'"

local things "file_path file_name my_file"
foreach thing in `things' {
   return local `thing' ``thing''
}

end
</pre>
<p></code><br />
<code>
<pre>
// this is work_program.do
defineMyLocals
local my_file `r(my_file)'
use "`my_file'"
</pre>
<p></code><br />
<code>
<pre>
// and finally, this is profiler.do

set more off

cd "c:/work/programming/putterin/profiler"

// SECTION 1: OVERVIEW
/*
   1. What's going on:
   "program" vs. "include" profiler. this do-file defines
   two programs that will measure the performance difference
   in defining locals separately using two alternate ways
   (1) locals are defined in a do-file called with include
   (2) they are defined in a program called by name

   The exercise is to "use" a file. This file is called via
   a handle defined as a local macro. That definition can be
   either in a do-file included (1) or in a program called
   by name (2).

   2. Programs defined here and their dependencies:
   runProfile1
      defineMyLocals // defined in locals_program.do
   runProfile2
*/

// SECTION 2: GLOBALS

// SECTION 3: PROGRAM DEFINITIONS

// ### programs defined elsewhere and called via "run"
// ### locals_program.do defines the program named
// ### defineMyLocals, which returns a file handle
// ### as an r() local.
run locals_program.do

// ### work_program.do uses a file whose handle
// ### comes from calling defineMyLocals and
// ### retrieving an r() local.
capture prog drop runProfile1
program runProfile1

args counter

local time_start=tc("`c(current_date)'" "`c(current_time)'")
forvalues i=1/`counter' {
	run work_program.do
}
drop _all
local time_end=tc("`c(current_date)'" "`c(current_time)'")
di ""
di "Profile 1 (program), `counter' reps"
di "Time elapsed (ms): "`time_end'-`time_start'

end

// ### work.do includes locals.do, which
// ### defines a file handle as a local.
// ### work.do uses that file by calling
// ### that local.
capture prog drop runProfile2
program runProfile2

args counter

local time_start=tc("`c(current_date)'" "`c(current_time)'")
forvalues i=1/`counter' {
	run work.do
}
drop _all
local time_end=tc("`c(current_date)'" "`c(current_time)'")
di ""
di "Profile 2 (include), `counter' reps"
di "Time elapsed (ms): "`time_end'-`time_start'

end

// SECTION 4: PROGRAM CALLS

local cycles "100 200 500 1000 1500"
foreach cycle in `cycles' {
	forvalues i=1/2 {
   		runProfile`i' `cycle'
	}
}
</pre>
<p></code><br />
And that's it. Put all five files into the same directory, make the profiler <code>cd</code> to it, change the path and name locals to your own data set, and see what you get on your machine. Below is my output:<br />
<code>
<pre>
Profile 1 (program), 100 reps
Time elapsed (ms): 2000

Profile 2 (include), 100 reps
Time elapsed (ms): 2000

Profile 1 (program), 200 reps
Time elapsed (ms): 4000

Profile 2 (include), 200 reps
Time elapsed (ms): 3000

Profile 1 (program), 500 reps
Time elapsed (ms): 9000

Profile 2 (include), 500 reps
Time elapsed (ms): 8000

Profile 1 (program), 1000 reps
Time elapsed (ms): 18000

Profile 2 (include), 1000 reps
Time elapsed (ms): 17000

Profile 1 (program), 1500 reps
Time elapsed (ms): 26000

Profile 2 (include), 1500 reps
Time elapsed (ms): 26000
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://enoriver.net/index.php/2010/02/28/program-vs-include-smackdown/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>I switched to Vim</title>
		<link>http://enoriver.net/index.php/2010/02/26/i-switched-to-vim/</link>
		<comments>http://enoriver.net/index.php/2010/02/26/i-switched-to-vim/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 17:08:34 +0000</pubDate>
		<dc:creator>Gabi Huiber</dc:creator>
				<category><![CDATA[Stata]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[text editors]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://enoriver.net/?p=1040</guid>
		<description><![CDATA[I was looking for an excuse to try something new and I decided to pick on one Notepad++ shortcoming that was handy: the Stata syntax highlighting gets utterly mangled after compound quotes -- `"`like so'"' -- which do sometimes arise, usually in the process of file open/file write. 
Vim does not get confused by compound quotes and [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking for an excuse to try something new and I decided to pick on one <a href="http://notepad-plus.sourceforge.net/uk/site.htm">Notepad++</a> shortcoming that was handy: the Stata syntax highlighting gets utterly mangled after compound quotes -- `"`like so'"' -- which do sometimes arise, usually in the process of file open/file write. </p>
<p><a href="http://www.vim.org/">Vim</a> does not get confused by compound quotes and it comes with Stata syntax highlighting out of the box. Integrating it with Stata is not hard at all, either. There are some general directions by Nick Cox <a href="http://fmwww.bc.edu/repec/bocode/t/textEditors.html#vim">here</a>, but on my Windows XP machine I just had to do two things.</p>
<p>First, I had to edit the PERSONAL/e/editors.ado file to make Vim replace Notepad++ entry in the Editors... sub-menu of the User menu:</p>
<p><code>
<pre>
program define editors
	version 10
	window menu append submenu "stUser" "Editors"
	window menu append item "Editors" "Vim" "winexec gvim.exe"
end
</pre>
<p></code></p>
<p>Next, I wrote a PERSONAL/v/vim.ado file like so:</p>
<p><code>
<pre>
program vim
	version 10
	syntax anything
	winexec gvim.exe `anything'
end
</pre>
<p></code></p>
<p>This is based on Nick Cox's recipe, slightly altered so you can launch Vim from the Stata command line to edit an existing do-file that say has spaces in it, as in <code>vim "my dofile.do"</code>. There's a little more on this "syntax anything" solution in my<a href="http://enoriver.net/index.php/2010/02/23/calling-irregular-arguments-with-syntax-anything/"> previous Stata post</a>.</p>
<p>One thing I did give up -- for now -- is the ability to launch a Stata instance from within Vim after I'm done editing a do-file, either for running the entire do-file or some select lines, the way I used to be able to do in Notepad++. There's got to be a way for that, though. If you know it, please drop me a line.</p>
<p>That said, I'd never knock Notepad++. It is still a fine text editor that has served me well. The people at <a href="http://mathereconomics.com/">Mather Economics</a>, who adopted it a while back at my instigation, are sticking with it -- and I recommend it to anybody who does not insist on a modal editor.</p>
]]></content:encoded>
			<wfw:commentRss>http://enoriver.net/index.php/2010/02/26/i-switched-to-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calling irregular arguments with syntax anything</title>
		<link>http://enoriver.net/index.php/2010/02/23/calling-irregular-arguments-with-syntax-anything/</link>
		<comments>http://enoriver.net/index.php/2010/02/23/calling-irregular-arguments-with-syntax-anything/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 17:04:39 +0000</pubDate>
		<dc:creator>Gabi Huiber</dc:creator>
				<category><![CDATA[Stata]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://enoriver.net/?p=1031</guid>
		<description><![CDATA[The other day I wrote a program that needed to call a file as an argument -- with the full file path. My first pass at it was to capture the argument as usual, with say args input_file. But that would not have worked with file paths that have spaces in them. What might have [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I wrote a program that needed to call a file as an argument -- with the full file path. My first pass at it was to capture the argument as usual, with say <code>args input_file</code>. But that would not have worked with file paths that have spaces in them. What might have worked, I guessed, was to use something like this:<br />
<code><br />
syntax namelist<br />
local input_file `namelist'<br />
</code><br />
That, however, choked on a Windows-style file path, because the colon in C:\ is an illegal name. Trial and error (and the [I] book) led me to <code>syntax anything</code>. Here's my scratchpad:<br />
<code>
<pre>
capture prog drop myHello
program myHello

syntax namelist
local names `namelist'
di "Hello `names'"

end

myHello Eenie: Meenie
</pre>
<p></code><br />
OK, so "illegal name" it is. Now let's see if "anything" might work better than "namelist":<br />
<code>
<pre>
capture prog drop myHello
program myHello

syntax anything
local names `anything'
di "Hello `names'"

end

myHello c:\my file path here\my file name here.txt
</pre>
<p></code><br />
Success. This may look trivial, but everything is after the fact. We have a long-standing policy at the Eno River Analytics worldwide headquarters that we should write toy programs for sketching things out before we go ahead and actually break something.</p>
]]></content:encoded>
			<wfw:commentRss>http://enoriver.net/index.php/2010/02/23/calling-irregular-arguments-with-syntax-anything/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Define local macros in one place, use them everywhere</title>
		<link>http://enoriver.net/index.php/2010/02/18/define-local-macros-in-one-place-use-them-everywhere/</link>
		<comments>http://enoriver.net/index.php/2010/02/18/define-local-macros-in-one-place-use-them-everywhere/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 22:06:10 +0000</pubDate>
		<dc:creator>Gabi Huiber</dc:creator>
				<category><![CDATA[Stata]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[local macros]]></category>
		<category><![CDATA[program]]></category>

		<guid isPermaLink="false">http://enoriver.net/?p=1028</guid>
		<description><![CDATA[In The Stata Journal Vol. 9, No. 3, 2009 there's a Stata tip (# 77) on re-using macros in multiple do-files, by Jeph Herrin. His solution is to define any local macros in a separate do-file, say locals.do. You can call that do-file with the include command at the top of any do-file that might [...]]]></description>
			<content:encoded><![CDATA[<p>In The Stata Journal Vol. 9, No. 3, 2009 there's a Stata tip (# 77) on re-using macros in multiple do-files, by Jeph Herrin. His solution is to define any local macros in a separate do-file, say locals.do. You can call that do-file with the <code>include</code> command at the top of any do-file that might refer to some of those macros. This is useful, as the author explains, when you want to keep all your macro definitions in one easily editable place, and make them available to whatever projects can use them without having to duplicate the definitions. This is similar to how you would <code>#include</code> header files in C or C++. </p>
<p>Unfortunately, <code>include</code> does not work well with programs. You can invoke it inside a program but <code>include</code> itself cannot be compiled, so the do-file it refers to will have to be interpreted all over again every time you call that program: see <code>help include</code> for the original reference. This negates the speed advantage that you expect when you package your Stata work into programs as opposed to simple do-files. It does not negate all the other advantages -- such as better code portability and the possibility of unit testing -- but still, speed matters. My own solution is to define locals inside an r-class program. Then other programs that need some of these locals call that program, and recover only the locals they need. Below is one example, worked first with <code>include</code> and then with my proposed alternative:</p>
<pre>
<code>
// locals.do starts here
local file_path "c:/data/my_path/"
local file_name "file_name.dta"
local my_file    "`file_path'`file_name'"
// and ends here.
</code>
</pre>
<p>OK, now let's put these locals to work:</p>
<pre>
<code>
// work.do starts here:
include locals.do
use "`my_file'"
</code>
</pre>
<p>Alright. This is not bad and it does the job that your locals are neatly separated from the rest of the work. If you use do-files to split a big job into smaller pieces, this is all you need. If, on the other hand, you want to chop the job into pieces smaller still, and encapsulate those pieces into programs, then this is inadequate, as explained above. </p>
<p>The workaround might look like a bit more overhead, but then that's the usual cost of writing programs instead of plain do-files. Some of us, sometimes, find that overhead acceptable:</p>
<pre><code>
capture prog drop defineMyLocals
program defineMyLocals, rclass

local file_path "c:/data/my_path/"
local file_name "file_name.dta"
local my_file    "`file_path'`file_name'"

local things "file_path file_name my_file"
foreach thing in `things' {
   return local `thing' ``thing''
}

end
</code></pre>
<p>And now let's recover the local `my_file':</p>
<pre><code>
defineMyLocals
local my_file `r(my_file)'
use "`my_file'"
</code></pre>
<p>That's it. Your locals.do consists of the definition of the program defineMyLocals. The overhead is obvious. First, adding new locals inside this definition requires the extra step of adding their names to the things list, so that defineMyLocals can return them. Second, using defineMyLocals is also slightly more complicated than a simple <code>include</code>, because you need to recover the locals you need explicitly, via `r()'.</p>
<p>That said, now your locals are defined inside a program, and you can move them around faster. If you're like me and you favor programs over do-files and this isn't your solution, then I'd be curious to see your preferred alternative.</p>
]]></content:encoded>
			<wfw:commentRss>http://enoriver.net/index.php/2010/02/18/define-local-macros-in-one-place-use-them-everywhere/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Terminal server client somehow woke up</title>
		<link>http://enoriver.net/index.php/2010/01/15/terminal-server-client-somehow-woke-up/</link>
		<comments>http://enoriver.net/index.php/2010/01/15/terminal-server-client-somehow-woke-up/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 17:29:00 +0000</pubDate>
		<dc:creator>Gabi Huiber</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://enoriver.net/?p=1018</guid>
		<description><![CDATA[This is a revision of my earlier assessment that tsclient is so slow it's useless. The thing came back to life somehow and it looks like it's thanks to either Dell or Microsoft. I upgraded to Karmic over Christmas with some hope that it might fix tsclient, but nothing changed. Then the server in Atlanta [...]]]></description>
			<content:encoded><![CDATA[<p>This is a revision of my earlier assessment that tsclient is so slow it's useless. The thing came back to life somehow and it looks like it's thanks to either Dell or Microsoft. I upgraded to Karmic over Christmas with some hope that it might fix tsclient, but nothing changed. Then the server in Atlanta that I log in to was replaced with a brand-new monster of a machine running Windows 2008 Server. That did it. The terminal server client is again a functional piece of software, and my attempt to migrate entirely to Ubuntu is back on track.</p>
<p>There was one small hiccup: one of the recent updates to rdesktop must have overwritten the /usr/share/rdesktop/keymaps/common file, because all of a sudden I could not use the Caps Lock key on the remote desktop. That's OK. I googled it as usual, and I found help <a href="http://ubuntuforums.org/showthread.php?p=8188847">here</a>. Also as usual, those lively Ubuntu forums will send you all sorts of places before you hit something useful. You're happy when you find it, then the next moment you appreciate paid customer support. Then the moment after that you think OK, but it didn't take that long, and it didn't cost a dime. There's room for all of us, it seems. I wish Microsoft the best of luck. I wish Canonical the same.</p>
<p>Next up: fix the "Connect to Server..." item on the Places menu in Gnome. I can't SSH into the home server from there anymore. I can do so from a terminal window, and I can still auto-mount my home folder on the server via NFS, as documented earlier <a href="http://enoriver.net/index.php/2009/05/19/setting-up-nfs-freebsd-server-ubuntu-client/">here</a> and <a href="http://enoriver.net/index.php/2009/06/07/auto-mount-the-nfs-share/">here</a>. Auto-mounted NFS shares are best anyway, because that way my stuff on the server is available on the client automatically at start-up.</p>
]]></content:encoded>
			<wfw:commentRss>http://enoriver.net/index.php/2010/01/15/terminal-server-client-somehow-woke-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New piece in my FreeBSD kit: psearch</title>
		<link>http://enoriver.net/index.php/2010/01/07/new-piece-in-my-freebsd-kit-psearch/</link>
		<comments>http://enoriver.net/index.php/2010/01/07/new-piece-in-my-freebsd-kit-psearch/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 18:58:02 +0000</pubDate>
		<dc:creator>Gabi Huiber</dc:creator>
				<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://enoriver.net/?p=1008</guid>
		<description><![CDATA[On December 11, 2009 portaudit turned up a problem in a package called libtool-2.2.6a_1. So, as usual, I figured I'd go to whatever port that is, and do a portupgrade. Unfortunately, whereis libtool turned up no such port. What's the rookie accidental admin to do?
Take good notes, for one. While dabbling in an unrelated topic -- [...]]]></description>
			<content:encoded><![CDATA[<p>On December 11, 2009 <code>portaudit</code> turned up a problem in a package called libtool-2.2.6a_1. So, as usual, I figured I'd go to whatever port that is, and do a <code>portupgrade</code>. Unfortunately, <code>whereis libtool</code> turned up no such port. What's the rookie accidental admin to do?</p>
<p>Take good notes, for one. While dabbling in an unrelated topic -- I was investigating how to enable wake-on-LAN for this machine -- I found <a href="http://forums.freebsd.org/showthread.php?t=6664">a reference</a> to a command I never knew existed: <code>psearch</code>. It's a port and I didn't have it installed, but <code>whereis psearch</code> led me to it quickly enough, and then it was just a matter of <code>make install clean</code>. Now, back to the portaudit problem: <code>psearch libtool</code> found the buggy port immediately: devel/libtool22.</p>
<p>I wasn't sure that this quick note was worth a post, so I left it in the drafts folder. But today's <code>portaudit</code> revealed multiple vulnerabilities in php5. Fixing that is in progress. Meanwhile I thought I'd post this thing after all, so I'll have a quick way to jog my memory next time I go looking for a well-hidden port.</p>
<p>One annoying thing is that I'm still unclear on when to use portupgrade -r, portupgrade -R, or portupgrade -rR. My default is the latter because I find it comforting that these recursive upgrades take care of all sorts of dependencies for me, both up and down stream. But man does it take a long time. That Pentium III is showing its age. It'd be good if I could safely cut some corners. So, dear readers, please comment away. I am curious.</p>
]]></content:encoded>
			<wfw:commentRss>http://enoriver.net/index.php/2010/01/07/new-piece-in-my-freebsd-kit-psearch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slow terminal server client in Ubuntu Jaunty</title>
		<link>http://enoriver.net/index.php/2009/12/02/slow-terminal-server-client-in-ubuntu-jaunty/</link>
		<comments>http://enoriver.net/index.php/2009/12/02/slow-terminal-server-client-in-ubuntu-jaunty/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 04:31:55 +0000</pubDate>
		<dc:creator>Gabi Huiber</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://enoriver.net/?p=1005</guid>
		<description><![CDATA[My migration to Ubuntu has just hit a major snag.
I spend most of my work day connected to a Windows Server 2003 machine sitting in a colocation facility in Atlanta. I write and run Stata code on it, use the MS Office products, a bit of Gmail -- the usual stuff. As it turns out, [...]]]></description>
			<content:encoded><![CDATA[<p>My migration to Ubuntu has just hit a major snag.</p>
<p>I spend most of my work day connected to a Windows Server 2003 machine sitting in a colocation facility in Atlanta. I write and run Stata code on it, use the MS Office products, a bit of Gmail -- the usual stuff. As it turns out, the Ubuntu half of my computer has a much slower connection to this thing than its Win XP Pro sister does. It's so bad it's heart-breaking. I like Ubuntu, but I can't type very well with a two to three second lag. This should not have happened. Before I turned my main machine (a Dell Latitude D630) into a dual-boot system I had puttered around with a Dell Latitude D400 running Hardy LTS. I was pretty happy. I certainly don't remember the VPN connection on that computer being this slow.</p>
<p>Google didn't help much. There is some consensus that tsclient with RDPv5 is slower than mstsc.exe (the program behind the Remote Desktop Connection on Windows XP), but it doesn't sound like the difference is as painful as I'm feeling it. I have not found any working guidance to maybe fire up rdesktop without tsclient, which I was hoping might speed things up a bit, under the hypothesis that fewer apps in the chain are better than more. So I am not sure if the standard-issue Ubuntu solution -- tsclient+rdesktop -- has suffered some performance decrease between Hardy and Jaunty, or getting a remote desktop in a bigger full screen is going to be that much slower. I have no other ideas.</p>
<p>Has anybody seen this before? One thing that might still save this migration project is that the server in Atlanta is on its last leg, to be replaced soon by a far better system, running 64-bit Windows Server 2008. That should come with a Remote Desktop server with RDP version 7 according to <a href="http://en.wikipedia.org/wiki/Remote_Desktop_Protocol">Wikipedia</a>. Maybe that will speed things up a bit on my end too -- if not right away, maybe another month or two into Karmic.</p>
]]></content:encoded>
			<wfw:commentRss>http://enoriver.net/index.php/2009/12/02/slow-terminal-server-client-in-ubuntu-jaunty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improv FreeBSD system administration</title>
		<link>http://enoriver.net/index.php/2009/11/12/improv-freebsd-system-administration/</link>
		<comments>http://enoriver.net/index.php/2009/11/12/improv-freebsd-system-administration/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 15:34:37 +0000</pubDate>
		<dc:creator>Gabi Huiber</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[portaudit]]></category>
		<category><![CDATA[portupgrade]]></category>

		<guid isPermaLink="false">http://enoriver.net/?p=994</guid>
		<description><![CDATA[One drawback of a system that's giving you very little trouble is that between bouts of fixing whatever does occasionally go wrong you forget what you're supposed to do. We should all be this lucky, but it's still an annoyance.
FreeBSD, for example, will sometimes turn up a damaged package or two in response to #portaudit. [...]]]></description>
			<content:encoded><![CDATA[<p>One drawback of a system that's giving you very little trouble is that between bouts of fixing whatever does occasionally go wrong you forget what you're supposed to do. We should all be this lucky, but it's still an annoyance.</p>
<p>FreeBSD, for example, will sometimes turn up a damaged package or two in response to <code>#portaudit</code>. The procedure for that, according to the <a href="http://www.freebsd.org/doc/en/books/handbook/ports-using.html">relevant chunk</a> of the FreeBSD Handbook is that you <em>only need</em> <code>#portsnap extract</code> when you run <code>#portsnap fetch</code> <em>for the first time</em>. After that, you already have a ports tree on your system, and all you need is <code>#portsnap update</code>.</p>
<p>Had I remembered that, I wouldn't be sitting here writing this post while my ports tree is rebuilding itself for no good reason. On the same topic (of things to remember): according to the same FreeBSD Handbook, I should run <code>#pkgdb -F</code> once in a while, pretty much before every <code>#portupgrade</code>. An overview of what that does is <a href="http://www.math.colostate.edu/~reinholz/freebsd/pkgdb_F.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://enoriver.net/index.php/2009/11/12/improv-freebsd-system-administration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
