Arc Forumnew | comments | leaders | submitlogin
2 points by Pauan 5150 days ago | link | parent

It must have balked at the 126 comments. :)


1 point by waterhouse 5150 days ago | link

Yeah, I think I've noticed stuff get taken off the front page when the number of comments exceeded 20.

-----

1 point by akkartik 5149 days ago | link

Ah, that explains why http://arclanguage.org/item?id=14187 isn't on either.

I wonder how the number of comments is calculated. HN certainly permits more. Perhaps news.arc normalizes hotness by the number of comments.. Hmm. I'm not sure this is a good idea.

-----

3 points by rocketnia 5149 days ago | link

Maybe it's a way to keep discussions between a few people (Pauan and myself) from spoiling everyone else's ability to view the forum:

In http://arclanguage.org/item?id=14187, Pauan and I are responsible for 27 of the 32 comments (84%).

In http://arclanguage.org/item?id=14219, Pauan and I are responsible for 82 of the 127 comments (65%).

Disclaimer: I counted on my fingers.

-----

3 points by waterhouse 5149 days ago | link

If you'd like another way to do it, Chrome's "find" function displays the number of occurrences on the page, (and highlights them in yellow, and indicates with yellow where they are in the scrollbar), which I find extremely nice. And it is useful here; it says 18 instances of "by pauan" (case-insensitive) and 9 "by rocketnia". This counts the original post, by Pauan, so it would be a total of 17+9=26 (perhaps you accidentally counted that too). Similar tactics yield 63 instances of "by pauan" (including OP) and 22 "by rocketnia" on the second thread, for a total of 84 (not including OP). This actually matches with what you said, because now there are 129 comments; probably you and/or Pauan made two comments in between this comment and my writing this. (If you were actually counting on your fingers, that's pretty good.)

In the absence of this find thing, I'd probably use some Unix tools.

  $ pbpaste | egrep -c 'by (Pauan|rocketnia)'
  85
The drawback of these methods is that if someone actually says the phrase "by rocketnia" in a post, then that'll screw this up. This could be remedied by counting instances of actual links to names in the page source:

  <a href="user?id=waterhouse">waterhouse</a>
Actually, that works perfectly, because you can't put such things in comments (if you type <> characters, they show up as &#<whatever>;, and a comment can't make a link to something but have the text be different (except perhaps in a submission... pretty ridiculous to submit someone's user page, though). Only drawback is that your own username shows up in the upper right corner, too, which isn't a comment (and, again, it counts the OP too). Still, it works pretty well otherwise.

  $ pbpaste | sed -nE 's:.*<a href="user\?id=([^"]+)">.*:\1:p' | sort | uniq -c
  63 Pauan
  35 akkartik
   5 aw
  22 rocketnia
   4 thaddeus
   1 waterhouse
If we subtract my name because it's an extra that shows up just because I'm logged in as me, then the rest of the numbers add to 129, which is the number of comments on the page. So it doesn't include the OP. This is because, in the HTML of these pages, the top of the page and the original post are on the same line of HTML; and I am not yet strong enough with the Force to make sed a) perform more than one substitution in a line while b) printing only the substituted part. (I have .* on both sides of the above to make it consume the rest of the line; the 'p' command prints the whole resulting line.)

Incidentally, stuff like this would be made easier by something that parsed HTML (can you tell that I like making my computer do these things for me?), that was insensitive to how stuff was broken up into lines. I've considered writing an HTML parser in Arc, but these Unix tools are good enough most of the time, and I haven't really felt the need.[1] (Perhaps I could take a look at that multi-line editing stuff... it seems it'd suck to enter that into a terminal, on separate lines. Maybe the semicolons would work. Probably something better would be better, though.) Any thoughts or experiences? (I can derail this thread all the way back into Arc!)

[1] Perhaps these "90% solutions" are an insidious evil that should be stamped out, though. See Olin Shivers's thoughts: http://www.ccs.neu.edu/home/shivers/papers/sre.txt

-----

2 points by aw 5149 days ago | link

Racket has an XML parser http://docs.racket-lang.org/xml/index.html which is easy to call from Arc: http://awwx.posterous.com/how-to-call-racket-code-from-arc

I should update that post to show how to use dynamic-require though, it's a lot shorter.

-----

1 point by waterhouse 5149 days ago | link

Oh, nice, you have addressed exactly what I was asking for. Hmm, but question... Why not do this? I mean, you mention that it's not the only way, but this seems to work and doesn't require anything like gensymming.

  arc> ($:require xml)
  #<void>
  ;then
  (= parse-xml ($:lambda (s) (xml->xexpr
            (document-element
              (read-xml (open-input-string s))))))
I guess the advantage of your approach is that you can choose to only import the functions you want. If that's particularly important for some reason, then, sure, do it. But I suspect it might actually be useful to import the entire module, especially at the REPL when you're just starting out using it. Particularly if you have a "scheme apropos" function.

  (def scheme-apropos (x)
    (sort < (keep [findsubseq x string._] ($.namespace-mapped-symbols))))
  (mac saps (x)
    `(scheme-apropos (string ',x)))
  arc> saps.xml
  (_parse-xml _xml-clean display-xml display-xml/content exn:xml? read-xml
  read-xml/document read-xml/element syntax:read-xml syntax:read-xml/element
  write-xml write-xml/content xexpr->xml xml->xexpr)
I added the "sort <" part just now, by the way. Can't believe I didn't think to do that originally (though I did at least add it to the "aps" thing somewhat earlier).

-----

1 point by aw 5149 days ago | link

There was something or other that wasn't working when using $ directly because it was Racket-specific and it didn't work in Arc's mzscheme module. I forget now what it was though. (Clearly parse-xml is a bad example as it does work with a simple require).

-----

1 point by rocketnia 5149 days ago | link

Thanks. :) I was hoping for a response like this. And hey, look, Akkartik has more posts in there than I do.

I actually did use Chrome, but I both overthought and underthought things: Since I knew Pauan and I had a majority, I tried to search for every non-Pauan, non-rocketnia post. XD I ended up stepping over every occurrence of "point", which was even worse than searching for the majority.

Once I had typed out "point", what I really wanted was to continue with "s? by (?!Pauan|rocketnia)".

-----

1 point by thaddeus 5149 days ago | link

> Maybe it's a way to keep discussions between a few people (Pauan and myself) from spoiling everyone else's ability to view the forum

My guess is that he doesn't want to wedge the server with many long page load requests.

-----

1 point by aw 5148 days ago | link

(for future reference, that is, without speculating on why or why not someone may have made decisions in the past, but if someone runs into a similar problem in the future)

If:

a) you're running a web application on top of Arc, and

b) you have some very long pages that are taking a long time to render, and

c) it's a page that you actually want to be able display to your users

...then there are less drastic alternatives to kicking the page off the front page:

- you can increase caching (at the cost of the displayed page being a bit more out of date)

- break the page up into parts and add "next" and "prev" links

- provide a runnable example (http://awwx.posterous.com/share-your-problems-with-runnable-...) of your problem on the forum and get help

-----

1 point by thaddeus 5148 days ago | link

Knowing the code was written with a news site in mind, you could also theorize (or speculate, which ever makes you happier) that the author (aka pg) would value both the quality and currency of the content over pouring coding efforts into handling of overly active, and by that time, older posts.

All speculation of course. I'm just suggesting that, often, there are simple reasons for the choices made behind these kinds of decisions.

All the ideas you list are great ideas. It's funny though, even I spent a bunch of time writing a blogging platform and I still have not bothered to put paging into the listings. I figure at my current rate of posts, it will take me a year before I'll need to worry about it. There are things we should do, in our ideal world, and then there's what we need to do relative to all other things. So, again, I suggest that maybe the reasons for these kinds decisions can often be much simpler than we think. There's not always some elusive statistical computation with all kinds attention and detail poured into them.

[edit1] ignore the below point... point format tricked me up reading on my ultra small screen :)

I don't fully understand what this point has to do with anything:

- provide a runnable example (http://awwx.posterous.com/share-your-problems-with-runnable-...) of your problem on the forum and get help

I like the work you did, but how does this fit into the discussion or your comment? It seems out of place.

[edit2] Also I used to like the fact that this forum allowed for editing within the first hour. I could correct my mistakes before, I figured, anyone had time to even read them, lol... but, that's not working anymore and trying to respond to changing posts kinda sucks.

I wish this forum had a "save as draft" feature! Maybe I'll just write it somewhere else first.

-----

1 point by aw 5148 days ago | link

I don't fully understand what this point has to do with anything: - provide a runnable example

If you have a web application that is running too slowly and you want help, then you make it possible for other people to help you if you provide a runnable example that demonstrates it running too slowly.

-----