Arc Forumnew | comments | leaders | submit | darjeeling's commentslogin

I managed to run arc-news, thanks to all your help.

After running it, I have a few more questions, I hope you aren't frustrated with me yet :)

1. What is the difference between "racket -m -f" (this one doesn't work, but used to work with mzscheme) and just "racket -f"? The manpage asks to visit the webpage and i went to this page to look for help, but I dont seem to be able to locate it: http://docs.racket-lang.org/guide/racket.html

2. In the arc prompt, after loading "news.arc", I would like to run the news server on a different thread, eg: "(= app (thread (nsv)))" (read on the web), but it doesnt return me the arc prompt.

3. Just to test what happens under increased load, I went to localhost:8080 and repeatedly hit the refresh button on my browser. After many repeated refreshes, the news page was no longer served. Here's what was happening in the arc screen: http://pastebin.com/TcBa2SuM and here's the tail of logs/srv-* file: http://pastebin.com/Xiym77sR (i wonder who the strange user 0PgEaESj is :))

How can I configure arc to continue working under heavy load (maybe by denying requests only from the client that's flooding)?

-----

2 points by akkartik 4492 days ago | link

1. Yes, -m is meaningless in racket (which is why it's not mentioned on that page you linked to). It's one of several incompatible changes with mzscheme.

2. Hmm, it works for me. Are you sure there's no prompt? Here's how it looks for me:

  $ racket -f as.scm  
  Use (quit) or ^D to quit, (tl) to return here after an interrupt. 
  arc> (load "news.arc") 
  nil 
  arc> (thread (nsv)) 
  #<thread> 
  arc> rm: cannot remove `arc/news/story/*.tmp': No such file or directory 
  load items:  
  ranking stories. 
  ready to serve port 8080 
It's hidden, but there's a 'arc> ' prompt after it returns #<thread>. Threads still continue to print to the terminal, so that makes the prompt a little hard to find. In these situations I just type in a new expression (say 'nil') and hit <Enter>. If I get a response, I was at the prompt :)

3. Check out the third bullet at http://sites.google.com/site/arclanguagewiki/arc-3_1/known-b... about srv throttling connections :)

-----

1 point by rocketnia 4492 days ago | link

"-m is meaningless in Racket"

Only if it's meaningless to invoke a procedure called 'main automatically. :-p

These are the command-line args: http://docs.racket-lang.org/reference/running-sa.html

The old -m option appearing in the instructions at arclanguage.org/install meant "don't show the 'Welcome to PLT Scheme' message."

-----

1 point by darjeeling 4492 days ago | link

Yes, you're right, the prompt was being returned- I wasn't careful enough :)

It came as a surprise that HN serves directly off port 80- wonder how to they manage ssl from arc. I plan to serve via apache rewrite rules (reverse proxy)- and yes, sadly all ips in the arc logs show the local address. Thanks for this link. Also, who is that strange user on my logs (there are different names on different hosts)? :)

One OT question: Is there someway I can make comments on a story's page appear sorted by time- let's say- by pressing some button "show oldest/newest first" ? I have not yet started to hack the code- wanted to be a little comfortable with the system first. I assume working with news.arc would be enough for the news page?

-----


I see some changes in in as.scm and ac.scm (esp the one that is being reported in the error message).

The debian package description of racket (http://packages.debian.org/sid/racket) says that the package was previously plt-scheme. So, I seem to be using it :(

-----

2 points by rocketnia 4493 days ago | link

"I see some changes in in as.scm and ac.scm (esp the one that is being reported in the error message)."

If you're seeing those changes in the diff akkartik linked to, take a closer look. It's just whitespace. ^_^;

Pauan pointed out the "(require racket/unsafe/ops)" line in ac.scm. According to https://github.com/nex3/arc/blame/master/ac.scm, the line was added in this February 2011 commit (well before October!): https://github.com/nex3/arc/commit/cea8a4c5e9d1eb42f54b6c333...

The main point is that you want something that works, right? :) If updating Racket isn't working for you, maybe for now you can revert to an older version of Anarki. The commit before the racket/unsafe/ops one is https://github.com/nex3/arc/commit/b36f223bfba2e12e518fff955..., which you can get to like this:

  $ git checkout b36f223b
If you want to get back to the Anarki tip, do this:

  $ git checkout master
Be careful if you have changes in your working copy.

-----

1 point by darjeeling 4493 days ago | link

I must have done some mistake then. I admit that I didnt see akkartik's link before posting that reply. I think my downloaded files are older than October- the directory has a timestamp from October and the ac.scm file has a timestamp from August 2009. The diff is here: http://pastebin.com/BLp6p69v

Yes, I would like to use something that works, and something that is as latest as possible :) I seem to be using Racket (in the form of plt-scheme) and it seems to work for an older version of arc. The point of my question was if I needed to do something to keep up with the changes made in Arc.

Thanks a lot for your reply :)

-----

2 points by rocketnia 4493 days ago | link

Looks like you originally had a version from somewhere between https://github.com/nex3/arc/commit/3201b34f3ed89e6305b0d9906... (October 14, 2010) and https://github.com/nex3/arc/commit/e05b3ef2aa9e4d298c7703a3b... (December 29, 2010). So "October" may be right! :-p

---

"The point of my question was if I needed to do something to keep up with the changes made in Arc."

Then making sure Racket is up-to-date is the answer you're looking for, as you already know. :-p Have you been successful running the latest Anarki on your Racket install yet? What do "racket --version" and "mzscheme --version" say now?

-----

2 points by darjeeling 4493 days ago | link

Hi, Thanks a lot to your earlier comment, about running "racket -f as.scm"- I found out that racket couldnt be located by the system. Something must be unclear with the description of Ubuntu/Debian packages- I got an impression that "plt-scheme" contained racket. I manually installed racket by downloading from here: http://racket-lang.org/download/ .

Now it works :) Thanks again !

-----

1 point by akkartik 4493 days ago | link

Great. racket is the new PLT scheme. So it provides plt-scheme, but the opposite is not true.

-----

1 point by darjeeling 4493 days ago | link

Hi, I posted a new reply (not nested in this one): http://arclanguage.org/item?id=15561

-----


The debian package description of racket (http://packages.debian.org/sid/racket) says that the package was previously plt-scheme. So, I seem to be using it :(

which package provides racket in Ubuntu/Debian systems? I am running the October version on a Debian 6 system and it is running fine. apt-cache search racket returns no relevant package.

-----

2 points by rocketnia 4493 days ago | link

You mentioned you used the command "mzscheme -f as.scm". If you change that to "racket -f as.scm", does it make any difference?

-----


Sorry if I'm hijacking the discussion. Also sorry if i am asking too many questions.

I am also working on creating a discussion forum based on arc news. I have programming and web development experience but none with arc or list-like languages. I saw hubski's site and liked it a lot. I have some specific questions:

- like the OP asked, how difficult would it be to add open-id, facebook, twitter, g+ integration?

- how does hubski distinguish text submissions vs videos and so on? How do I group/categorize all of them?

- how do I add tags to submissions or allow admins to add tags?

- how do i decrease the karma required to downvote?

- how do i mimic HN's job page, ie: no name of the poster and no comment field- just link and text. How to group all such posts?

thanks :)

-----

4 points by markkat 4494 days ago | link

Hi darjeeling. I run http://hubski.com Glad you like it! Unfortunately, I don't think there are any quick answers to your questions. Most of this requires writing new code. I'll take a shot at them, to get you started, however:

how difficult would it be to add open-id, facebook, twitter, g+ integration?

That depends on how integrated you want to get. It's fairly trivial to be able to add a 'like' or '+1' button, but if you want deeper integration, you'd have to be specific about what you want to do. I haven't tried open-id. I'm sure it's doable.

how does hubski distinguish text submissions vs videos and so on? How do I group/categorize all of them?

For videos, it is a matter of identifying the url as a video url, etc. For example with findsubseq, you can pick out if contains "youtube" "youtu.be", etc. Text submissions are those that lack a url, and don't have an empty text field, etc. No quick fix here. news.arc wasn't made to sort them that way, I had to do that.

how do I add tags to submissions or allow admins to add tags?

There are a number of ways you might go about that. I added the tag as an additional story key/value pair. Depending on your tagging structure, you might want to make each tag it's own template, containing the ids of stories carrying that tag.

how do i decrease the karma required to downvote?

I think there is downvote-threshold* in news.arc, -just change the value. I don't use karma or downvotes with Hubski. So I don't have that code anymore. :)

how do i mimic HN's job page, ie: no name of the poster and no comment field- just link and text. How to group all such posts?

Shouldn't be too difficult. Each story could have a 'job' key with a value of nil or t. If it is t, then opt not to show the comment tree, name, etc.

From the range of your questions, it seems that you haven't messed with the code too much yet. If you really want to use news.arc, just get in there and start tweaking. I was totally green to Arc when I started. Good luck!

-----

1 point by darjeeling 4493 days ago | link

Hi Markkat, thank you very much for your detailed reply. If you don't mind, I'd like to ask more questions.

- If I want to start hacking into the news code, is news.arc the only file I start with? I would also like to change the css, make email field compulsory, send email confirmation and so on. If you could show me some direction, it would be very helpful.

- by integration with other services, I mean allowing likes, +1, commenting, log-in etc. I think I will have to look into the code to start understanding this more, so it is related to the above point.

- about identifying video URLs- how would you recommend expanding something like, say a bit.ly link?

- Yes, I haven't done anything with the code yet because it looks a little unfamiliar at this point. But I'd love to.

Thank you very much for your help.

-----