HNHacker News
TopNewBestAskShowJobs

drothlis

720 karma · joined February 15, 2009

https://stb-tester.com/ | https://david.rothlis.net/ | david@rothlis.net
submissionscomments
drothlis··on What was the strangest coding standard rule that you were forced to follow?
"A language should be designed in terms of an abstract syntax and it should have, perhaps, several forms of concrete syntax: One which is easy to write and maybe quite abbreviated; another which is good to look at and maybe quite fancy, but after all, the computer is going to produce it; and another, which is easy to make computers manipulate."

--John McCarthy, http://www.infoq.com/interviews/Steele-Interviews-John-McCar...

drothlis··on GNU grep is 10x faster than Mac grep
The article has an answer to that. I'm not sure if you're challenging the article's answer or if you just missed it...
drothlis··on Color schemes for Sublime Text 2 and Textmate
> context, failed experiments, shortcuts, optimizations, and so on.

I think commit messages are the appropriate place for this stuff; I use `git annotate` etc. to find the information when I need it. I often have a 50-line commit message accompanying a one-line code change -- a ratio that would obviously make the code unreadable if all the comments were in-line with the code itself.

drothlis··on Elon Musk and the Hyperloop
Have you checked your calculations against David MacKay's? His conclusion was that "International shipping is a surprisingly efficient user of fossil fuels; so getting road transport off fossil fuels is a higher priority than getting ships off fossil fuels."

http://www.inference.phy.cam.ac.uk/withouthotair/c15/page_95...

http://www.inference.phy.cam.ac.uk/withouthotair/c20/page_13...

drothlis··on :syntax Off
> in Emacs, both Haskell and OCaml [...] can also be highlighted with symbols

And not just Haskell and OCaml: See for example https://github.com/drothlis/pretty-symbols

(though of course Haskell and OCaml might be much more suited to this kind of visualisation -- in python, say, you just get λ ≠ ≥ ≤).

drothlis··on :syntax Off
> Variable-scoping-level highlighting—variables in the same scope highlighted the same color.

I played with this idea in the syntax highlighting of the code samples in this article: http://david.rothlis.net/c/compilation_model/#chapter005

but would you want all variables at the same scope in the same colour? Different colours for each variable, with the darkness/lightness indicating the scope?

> grep-only highlighting—define a set of things to grep for quickly and highlight them.

Emacs has this with the "highlight-regexp" command. To be honest I don't use it that much. What I do like is highlighting all matches whenever you're doing a "find in file" (though unlike highlight-regexp, the highlighting disappears as soon as you exit the search). I probably use this more because I use search all the time (who doesn't), whereas I tend to forget that "highlight-regexp" even exists.

> block-focused—highlight code blocks so you get an idea of the overall structure of your program.

A few examples of how this might look: http://web.archive.org/web/20080723220126/http://lemonodor.c...

> No-highlighting

In Emacs the "font-lock-mode" command will toggle all highlighting; and you can specify the "level" of highlighting you want by setting the "font-lock-maximum-decoration" variable (you could set up a specific key to toggle this variable). I think these levels were originally intended for performance reasons, so they're cumulative (enabling level 3 also brings in all the highlighting from levels 1 & 2) rather than individually-toggleable features.

I only bring up Emacs because that's what I'm familiar with, and because I'd like more people to experiment with these types of things in Emacs. But perhaps Sublime Text would be a better platform for such experiments, for some people; I don't know.

drothlis··on :syntax Off
Something I've found useful is to highlight (in bold) the definitions of variables & types, but not their uses; and to otherwise have very little highlighting: http://david.rothlis.net/code_presentation/distracting_synta...
drothlis··on Ask HN: Who Is Hiring? (November 2012)
London UK: Junior test automation engineer. Permanent, full-time, on-site.

At YouView we are automating the testing of our product (a set-top box) using stb-tester[1], a tool that we developed and open-sourced which captures video from the set-top box and analyses it in real time.

These are early days for the project, so you can have a large impact on its direction and success. One week you might be writing a python module to control a network-controllable power supply; another week it might be a script to generate comprehensive test coverage of a menu tree. There will be tedious work too, but we want the kind of person who hates tedious work so much that they automate it away.

Unix shell scripting and administration experience is highly desirable. The test scripts themselves are written in python.

[1] http://stb-tester.com

drothlis··on Ask HN: What are some practical applications of computer vision?
stb-tester[1] captures video from a set-top box or smart tv or similar appliance, and runs automated tests against it by sending infrared signals and analysing the captured video. It uses python and OpenCV. It is open-source software (LGPL).

Currently stb-tester's image processing is very simple: It looks for specific, previously-captured images, accounting for some noise. But there is plenty of scope for much smarter processing: Identifying areas with text within the image, then doing OCR; or measuring some aspect of image or video quality.

[1] http://stb-tester.com

drothlis··on What C/C++ repo do you work on (github/bitbucket/etc)?
Thanks! :-)
drothlis··on What C/C++ repo do you work on (github/bitbucket/etc)?
Well, since you're volunteering... this is C rather than C++, but if you're interested in GStreamer (media processing library) and OpenCV (computer vision / image processing) then you could have a go at improving the motion-detection visualisation of our "stbt-motiondetect" gstreamer element.

If you're interested send me an email for help getting started, and see the 2 latest commits on https://github.com/drothlis/stb-tester/commits/motiondetect_...

drothlis··on Sphinxtr: Creating a Portable PhD Thesis
Did you find it easy to extend with your own formats? Or to modify an existing format, say html, to produce slightly different output?

I usually use perl/sed/awk + markdown for generating html from my own made-up mini-formats. I'd love to keep the sources in org-mode instead, but I wonder whether elisp is the right language for the type of text munging I want to do.

drothlis··on Sphinxtr: Creating a Portable PhD Thesis
What did you use to convert to pdf / html?
drothlis··on Software on Steam
I would recommend: When you want to customise the behaviour of some command, don't google for the answer. Instead do `C-h f` or `C-h k` to read the built-in documentation for that function or key. From the help screen, click the link to view the function's source code -- if you don't see that link install the "emacs-el" package (using your system's package manager). See what variables that function uses. Do `C-h v` to read the documentation for each variable.

If you like this approach, I've written a guide (http://david.rothlis.net/emacs/customize_c.html) which, at 3,000 words, is half the length of the Emacs manual table of contents.

drothlis··on [Critique wanted on Resume/CV] I want to apply for any programming-job.
Interesting CV. It's very different from most (in a good way).

Games is not a problem. It's expected for a new graduate that most experience will be projects such as those. You have more projects to show than most graduate CVs I see; this is a strong plus.

I'd like to see links to your code; the screenshots don't tell me much. (I look for tidy, well-documented code; it shows conscientiousness.)

On the first page I would like to see clickable links to the website for each project/product you worked on (and to source code if possible). Perhaps the whole CV would work better as a single page (or two) with links to your website for each project.

I don't know the official meanings of the words, but to me "Resume" and "CV" are the same thing.

Nitpicks: Some slightly awkward grammar & hyphenation on the first page. The formatting in the "Skills" section is a bit weird. Include a country code in your phone number.

If you're interested in a permanent position in London, send me an email (see my profile).

drothlis··on Ask HN: Who Is Hiring? (September 2012)
P.S. The polipo task is a representative example of the work you'd be doing after you had passed the interview and been hired -- not part of the interview process! :-)
drothlis··on Ask HN: Who Is Hiring? (September 2012)
London, UK -- graduate or junior developer -- full time

My team writes middleware (i.e. software that interfaces with OEMs' software and with the GUI team's software) for set-top boxes. We use a bit of C, a bit of C++, a bit of shell, a bit of Python. We have a great team and you will learn a lot.

As your first task we'll probably get you to do some bug-fixes and feature work on Polipo (an open source HTTP proxy) and you would be pushing your patches upstream.

drothlis··on Show HN: A multi-touch document manipulation system
* Smallest federated wiki: http://wardcunningham.github.com
drothlis··on Show HN: A fix for the .bash_profile .bashrc .profile madness
Ah, I understand now: The sentence I quoted from the bash man page refers to ssh only when run with a command ("ssh hostname command"). Thanks!
drothlis··on Show HN: A fix for the .bash_profile .bashrc .profile madness

  > 'interactive' is when called with -i flag (which sshd does when reached by
  > ssh with no command passed, i.e if you do 'ssh ls' it should not call
  > bashrc, but should call bash_profile)
Do you mean that an interactive shell should load .bash_profile? Because the bash man page says: "When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc".

Re. ssh, the bash man page says (at least on my system, with bash 4.2.37): "Bash attempts to determine when it is being run with its standard input connected to a network connection, as when executed by the remote shell daemon, usually rshd, or the secure shell daemon sshd. If bash determines it is being run in this fashion, it reads and executes commands from ~/.bashrc".

That last quote from the bash man page contradict my own experiments. Logging into my OS X system with ssh loads .profile, not .bashrc. The same is true logging into my Fedora 17 system with ssh. Perhaps sshd uses --login instead of -i (or, on my systems, happens to be configured in that way).

Running a command via ssh ("ssh hostname somecommand") loads nothing when the remote system is OS X, and loads .bashrc when the remote system is Fedora 17.

All in all, I will respectfully disagree that "there is no madness". Normally I completely relate to the RTFM sentiment, and I have spent plenty of time in the bash manual myself.

I remain unconvinced that there is a better solution than putting everything into .bashrc (with the $- guard around stuff specific to interactive shells) and doing nothing in .profile other than unconditionally sourcing .bashrc.

  >  [[ $- == *i* ]]
Thanks for the sane test syntax: It's much clearer than my ugly mess of almost every symbol character I could find. :-)
drothlis··on Show HN: A fix for the .bash_profile .bashrc .profile madness
Ignoring .bash_profile vs .bash_login vs .profile, the bash man page essentially says:

  login shell                     .profile
  interactive non-login shell     .bashrc
  run by the remote shell daemon  .bashrc
I wasn't sure exactly what counted as a "login" shell so I got each of my .profile and .bashrc printing into a logfile. These are my observations on OS X:

  log into OS X user account      (nothing)
  new terminal                    .profile
  run "bash" from that terminal   .bashrc
  run a shell script              (nothing)
  ssh hostname                    .profile
  ssh hostname somecommand        .bashrc
The behaviour of ssh seems (to me, at least) to contradict the bash man page. Anyway this was all so complicated that I'll never remember it, so what I ended up doing was:

* .profile does nothing other than source .bashrc

* In .bashrc anything that should be specific to interactive shells goes inside:

  if [ -n "${-//[^i]}" ]; then
    ...
  fi
drothlis··on Does anyone use comments any more?
I've cloned a few GitHub projects and, I have to say, I am absolutely amazed when I look at the source files. Project after project without comments.

I wish people would add a one-line comment to the top of every source file saying what it's for. ONE LINE is all I ask.

drothlis··on Actually using Ed
Thanks for that link. 1987! Where's my structural-regexp-enabled awk!?
drothlis··on GNU Emacs 24.1 released
If you modify the default font, you also have to change the default "fontset", because merely changing the default font doesn't install it as the font for unicode characters.

I use:

    (set-face-attribute 'default nil :family "Menlo" :height 120)
    (set-fontset-font "fontset-default" 'unicode "Menlo")
drothlis··on GNU Emacs 24.1 released
And pushing improvements (like saner defaults, and documentation for some of the under-documented built-in packages) upstream to Emacs itself.

For those reasonably comfortable with Emacs, I think you should build it from source, and get into the habit of fixing tiny documentation problems as soon as you come across them. Mind you, I have submitted a couple such patches to the ido built-in help and they have languished un-noticed for 2 months.

P.S. Another thank-you here for the starter kit -- I no longer use it, but I did for a year or so and it did teach me several features I wouldn't have known about otherwise.

drothlis··on Ask HN: Where is the source file for the Paredit Cheatsheet?
No idea sorry... the user who uploaded it to emacswiki didn't leave any contact details. And it's not part of the paredit source repo: http://mumble.net/~campbell/emacs/paredit/

:-(

drothlis··on Linus Torvalds won't do github pull requests
According to http://tbaggery.com/2008/04/19/a-note-about-git-commit-messa... (linked in one of the comments in the github discussion) it is for consistency with the commit message generated by 'git merge' and the like.
drothlis··on Classic maths books reset with LaTeX on Project Gutenberg
Intentionally, I think:

    This PDF file is optimized for screen viewing, but may 
    easily be recompiled for printing. Please see the
    preamble of the LATEX source file for instructions.
Shows a great attention to detail!
drothlis··on Ninja, a small build system with a focus on speed
I don't know the design goals of premake but ninja is very very fast at deciding what to build (a no-op build of a large project that might take a traditional make system several seconds, is almost instantaneous with ninja, allegedly).

For those already using CMake--ninja will slot right in.

Are there any large projects using premake? Ninja+gyp is used by Chromium.

drothlis··on Learning GNU Emacs while reading a manual
The GNU manuals are extremely comprehensive... far too comprehensive to read as an introductory text. The Emacs manual's table of contents alone is over 6000 words[1].

I recommend my own guide http://david.rothlis.net/emacs/howtolearn.html which teaches you how to use the Emacs built-in help, the elisp source code, and the built-in access to these very manuals.

[1] lynx --dump http://www.gnu.org/software/emacs/manual/html_node/emacs/ind... | sed '/^References/,$ d' | wc -w

← PreviousPage 6 of 9Next →