Wednesday, July 18, 2012

The alphabet soup of fried chicken places

There is a wide variety of fried chicken restaurants in Dhaka, Bangladesh. There's so many that someone mentioned trying to find for each letter of the alphabet. So here's a list of "_FC".

A: American,
B: Best
C: Cripsy, California, CP (unsure what CP stands for)
D: Dhaka
F: Fortuna
G: Golden, Good
H: Happy
K: Kentucky, Kok Kok
L: Lime's
M: Macdanald?
N: (in Mohakhali, but unsure what N stands for)
S: Southern (not sure they still exist...)
T: Taitan
V: Vhoot (means "ghost" in Bengali)
W: (in Banani but unsure what W it stands for)

Not bad at over 50% of the letters!

Tuesday, July 17, 2012

DC metro station interior information

On my normal WMATA routes, I (like many other commuters) know where to get on the train so that I end up next to the exit at my destination (this is possible because the trains almost always stop at the front of the platform). But if I'm going to an unfamiliar station I can't shorten the walk at the destination station by walking a bit at my departure station. Knowing the location on the platform of the escalators/stairs/elevators could save time at those stations which only have a single exit on one end. I imagine this type of information would be especially useful for those with impaired mobility. WMATA comes close to providing this info by allowing one to find out about the status of escalators/elevators. It provides and accompanying description (e.g. "Escalator between street and mezzanine") but it's sadly not specific enough.

I've been told that WMATA does have this information digitally so hopefully they'd be able to provide it. Otherwise, the information could be user-gathered. The Washington Post did that with their Metro cell phone service map which had a publicly-editable custom map on Google Maps. Another option would be to have user edit OpenStreetMap. Or possibly one of the smartphone apps (which would benefit from this info) could provide and option for user submitted information). Anyone want to champion one of these options?

(And for the smartphone app developers out there, could you integrate the direction of station exits like StationMasters does? It's a small point but kind of nice.)

Sunday, July 15, 2012

Crowdsourcing journal/data information

In academia, researchers often work with and learn from data and methods that have been used before. I think are new projects that could fill existing gaps in this process and therefore speedup the learning and research process by reducing redundancy. I'll highlight three here. If they already exist, please let me know. If they don't, hopefully someone could start the project and allow crowd-sourcing of this information (could be as simple as setting up a wiki and collecting links to places where some of this data already exists):

  1. Data scripts: Publicly available datasets are often not in the best of shape. They often need to cleaned-up, labeled, linked to other data sources, or processed in standard ways. Additionally, there may be external information about the quality or other facts that should be documented and understood by researchers. Documentation and scripts (in multiple languages) would be the goal here. See for example
  2. Study replication: Researchers over try to replicate existing studies in order to understand a method, for a class project, or to see conduct extensions. As many authors do not contribute accompanying code for working with the data, there is a lot of reverse-engineering that has to be done. This would not only save time, but disseminate important information about the implicit assumptions in papers.
  3. Typo corrections: Ever puzzled over an equation in a journal article and gone through the trouble of finding that there is a type in it? Published material is never perfect, and unless it is a large mistake, authors normally don't post corrections. But noting small (non-controversial) corrections could still save a lot of time. Obvious spelling mistakes are not worth the time to correct, but even if conclusions aren't overturned it is still helpful to correct intermediate steps.
    Edit: PubPeer seems to provide this function.

Saturday, July 14, 2012

Smartphone app for verbal confidential agreements

A professor recently cautioned a graduate-student class not to share research ideas too liberally as sometimes professors steal the ideas of students. It is helpful to get input on ideas, however, so using a mechanism such as an NDA would seem appropriate in preventing this. I would imagine that most of the most vulnerable type of interaction is face-to-face meetings. In this case what would be nice is to audio-record a quick declaration of confidentiality and then the subsequent conversation. If an IP lawyer made a short script that could be read and recorded then a smart-phone could be created that would play the "this a confidential conversation" audio and then start recording. Any takers?

Wednesday, July 11, 2012

StatWeave in LyX

While it's pretty easy to integrate R into LyX documents (using Sweave or knitr) I hadn't found any native way of integrating Stata code. I've hacked StatWeave (which allows Stata, R, and a bunch of other stat languages) to work in my LyX (in Windows 7 with LyX 2.0.4) and thought that others might like this as well. Here's the steps:

  1. Copy statweave.module to the "Resources/layouts" of your user directory (See HelpAbout LyX).
  2. Open LyX and go to  Tools→Reconfigure
  3. Restart LyX and go to  Tools→Preferences
  4. On the left choose File HandlingFile Formats.
  5. Click the New... button and then fill in  Format: StatWeave, check Document format, Short Name: statweave, Extension: swv. Then Apply.
  6. On the left choose File HandlingConverters
  7. Using the drop-down menus, create a new one from "StatWeave" to "LaTeX (pdflatex)" with the command "statweave --target tex $$i" (make the changes and then click "Add" in the upper right). Then Save.
Once you get that setup you should be able to compile: stata-test-bq.lyx. Notes:
  • LyX disables the enter key from inserting a line-break in insets (anyone who knows about this please let me know why or a work around). You can paste them, though, so copying several lines of code into a Stata Code Chunk insert works fine (if you are writing it in LyX then just copy a line break from somewhere and paste as needed). 
  • If you don't want to use the custom insets you can always just use plain TeX code (e.g. You can always just use TeX code inserts \begin{Statacode} ... \end{Statacode} or \Stataexpr{...})
  • The StatWeave manual is helpful for the non LyX part.
  • When configuring your Stata executable do not include "do " before "%codefile%".
  • You may need to edit the MiKTex path given the default ones are for version 2.6.
  • If you want to use relative paths for input files then you can pass the directory of the LyX file to Stata as an environment variable. In the converter replace the statweave command with "set orig_PWD=$$r && statweave --target tex $$i" (then ModifySave). Then in Stata you can change do that directory with -global orig_PWD =trim("`:environment orig_PWD'")"- (it will have the final slash). Don't cd around in the program or StatWeave wont' know where it's graphics files are for conversion.
Suggestions very appreciated.

Update: I've made a newer version the just focuses on Stata and allows for code block options. You can easily show figures now right-clicking in the block, choosing opts, and then putting in a string like fig, height=4.5in, width=9in, dispw=4in