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.
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!)
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.
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.
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).
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).
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)".
(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
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:
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.
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.