Evan Martin (evan) wrote in evan_tech,
Evan Martin


The algorithm is just this:
void output_order(userid root) {
  queue<userid> roots;
  while (!roots.empty()) {
    const userid u = roots.front();
    const EdgeSet& oe = nodes[u].outedges;
    printf("%s\n", usermap[u].c_str());
    for (EdgeSet::const_iterator i = oe.begin();
         i != oe.end(); i++) {  // \n to fit on lj
      if (--nodes[*i].indegree == 0)

Getting to that place was about 10x more support code.

But more importantly, the results are crap-- I don't have enough of a picture to really get anything out of the LJ data. Oh well, it wasn't really a useful project anyway.

  • no go

    Two friends of mine were pretty enthusiastic about the Go language, so I tried writing a program in it yesterday. It is frustrating because despite…

  • playing with vala

    I actually was toying with making something like Vala back in college. It's pretty cute. Much like using the sane subset of C++, as you write code…

  • chromium.el

    This weekend I wrote some Emacs Lisp to write some utility functions I find useful for hacking on Chromium. It's fun to have a reason to use Lisp!…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 1 comment