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

Thx, i had found this [1], but what i really need is a toptable/topic like https://news.ycombinator.com/show (which is diff from 'about' page. (A story whose title begins with "Show HN" goes to /show. FYI [2]))

BTW,it would be nice if Arc Forum got a ask table/topic like https://news.ycombinator.com/ask

[1] https://github.com/arclanguage/anarki/compare/master...flami...

[2] https://news.ycombinator.com/showhn.html

-----

1 point by tvvocold 3643 days ago | link | parent | on: How does HN use firebase?

will arc forum update in future? just like hackernews.

-----

1 point by tvvocold 3653 days ago | link | parent | on: How does HN use firebase?

could they github(opensource) that?

-----

2 points by tvvocold 3692 days ago | link | parent | on: After i changed something

Openshift gear will goes idle after 24 hours of inactivity,so i use uptimerobot.com to ping the server every 5 min,it will make other apps (i created) goes well ,but the arc.news always goes down every 2 or 3 days.

btw, here is akkartik's way: http://arclanguage.org/item?id=18910

-----

2 points by tvvocold 3698 days ago | link | parent | on: After i changed something

1,https://github.com/shader/arc-openshift is what i use in openshift

2,http://arclanguage.org/item?id=18840 i followed this and server works.

3,i only got openshift's log http://p.fdzh.org/paste/9jBPxB14

4,i donnot really know,after some days (maybe 5 or less) the server broken and could loaded,i think maybe the ab test from somebody?

ps:when server goes down i need to kill -9 the 80 port's pid and then restart app,but few days later it will happen again.

thx btw.

-----

1 point by akkartik 3697 days ago | link

Back when I ran an arc service I noticed it ran out of memory every few days. So I'd run the server in a loop on my shell, immediately restarting it if it died.

-----

1 point by tvvocold 3696 days ago | link

nice! but how to add a loop bash in openshift?

-----

1 point by akkartik 3696 days ago | link

Can you login to the server?

-----

1 point by tvvocold 3696 days ago | link

the reason maybe too much people came in , when i post a arc link to other website then i cannnot open arc site.

-----

1 point by tvvocold 3696 days ago | link

sure,then?

-----

1 point by akkartik 3696 days ago | link

First create a way to have arc automatically run (nsv) on startup. Then you can say this (assuming your shell is bash):

  $ while true; do arc server.arc; done
Now anytime your server dies it'll just come back up.

-----

3 points by akkartik 3695 days ago | link

I've updated the repository to make this easier. There's now a script called run-news to bring up the HN server.

  $ git pull
Now you should be able to run your server in a loop like this:

  $ while true; do ./run-news; sleep 5; done
Let me know if you run into trouble with this. I'll be around and more responsive for the next few days.

More notes, just for future reference:

1. run-news provides an interactive prompt, so you can make changes to the server without needing to restart it. Just remember to also modify news.arc otherwise your changes will be lost when the server dies next.

2. The sleep above is to help exit the server. If you quit the server as usual it'll just come up again. To bring it down, hit ctrl-c twice in succession.

3. I also fixed up the readme, which was abysmally out of date. Sorry about that.

-----

1 point by tvvocold 3692 days ago | link

thx,cool!

btw,i use https://github.com/shader/arc-openshift for openshift env,(not the https://github.com/arclanguage/anarki) how could i update it?

-----

1 point by akkartik 3692 days ago | link

arc-openshift installs anarki: https://github.com/shader/arc-openshift/blob/fa9def061/.open...

Just cd into the arc directory ($OPENSHIFT_DATA_DIR/arc, but I'm not sure how to deduce OPENSHIFT_DATA_DIR) and run:

  $ git pull

-----

1 point by tvvocold 3692 days ago | link

when i git pull i got

  error: Your local changes to the following files would be overwritten by merge:
    lib/news.arc
  Please, commit your changes or stash them before you can merge.
  Aborting

-----

1 point by akkartik 3692 days ago | link

Have you made any changes to news.arc? Mail me the output of this command, and I'll help you with the merge.

  $ git diff lib/news.arc

-----

2 points by tvvocold 3732 days ago | link | parent | on: How to install racket in fedora20?

but Fedora isn't based on Debian

-----

2 points by rocketnia 3732 days ago | link

When you're on http://racket-lang.org/download/ and you select a Linux version to download, this note appears at the bottom of the page:

  Note about the Linux installers: if you don't see an option for your
  particular platform, try other Linux installers, starting from similar
  ones. Very often, a build on one Linux variant will work on others
  too.
It's too bad this note doesn't appear before you choose one, huh? :) For what it's worth, I've installed Racket on other versions of Linux two or three times, and I haven't noticed any problems.

-----

1 point by tvvocold 3733 days ago | link | parent | on: Shader:plz help

Thx, shader,that works.another question is how can i add something like about or copyright in app?like the bottom of http://news.dbanotes.net/ or hacker news?

-----

1 point by tvvocold 3733 days ago | link | parent | on: Shader:plz help

and anybody know how to set open links in new window?

-----

1 point by akkartik 3733 days ago | link

http://www.w3schools.com/tags/att_base_target.asp

Does that help? I can give more detailed instructions in a bit.

-----

1 point by tvvocold 3733 days ago | link

Thank you very much.and how can i add something like 'about' or copyright in app?like the bottom of http://news.dbanotes.net/ or hacker news?

-----

2 points by akkartik 3733 days ago | link

It's in the same place. Try adding some text outside the table tag. For example:

  (mac npage (title . body)
    `(tag html
       (tag head
         (gen-css-url)
         (prn "<link rel=\"shortcut icon\" href=\"" favicon-url* "\">")
         (prn "<meta name=\"viewport\" content=\"width=device-width\">")
         (prn "<base target=\"_blank\">")
         (tag script (pr votejs*))
         (tag title (pr ,title)))
       (tag body
         (center
           (tag (table border 0 cellpadding 0 cellspacing 0 width "85%"
                       bgcolor sand)
             ,@body)
           (prn "Copyright blah blah")))))

-----

2 points by tvvocold 3733 days ago | link

yes,it works but the copyright is out of page and don't looks good,check this https://fdnews-tvvocold.rhcloud.com/news how to fix?

-----

1 point by akkartik 3733 days ago | link

Then you'll need to learn about html tables, I think. You need to create a row in the table that spans both columns. See if this helps: http://www.w3schools.com/html/html_tables.asp. Don't be afraid to experiment, and come ask more questions when you get stuck.

-----

1 point by tvvocold 3733 days ago | link

well, when i git push a png file and edit then restart, my app goes down and 8080 port is used.so i kill -9 the pid and (load "lib/news.arc") (nsv '("my ip" 8080)) , then i got a blank hacker news clone..so i app-force-stop it and start again then got a full-blank page...what happeded?

i just got it right :it seems force-stop will drop the repo/www file and those would got lost!!bazinga!

-----

1 point by shader 3733 days ago | link

Force-stop shouldn't be what drops the www. The repo reset should only happen during the git push process. Otherwise I don't think it touches what's in the repo dir.

In any case, I think all of the stuff in the www folder should probably be moved to the data directory, so it doesn't get wiped regularly. I just haven't done it yet; partly because I didn't know exactly where I would put it.

Feel free to make a change to put it where you want it, and then send a pull request.

-----

1 point by tvvocold 3733 days ago | link

also i noticed that there is a Downvote feature in arc but cannot see it in the page?

-----

1 point by akkartik 3730 days ago | link

https://news.ycombinator.com/item?id=4007232

-----

1 point by tvvocold 3732 days ago | link

i noticed that there is a blog feature in anarki, how to run it on openshift? (bsv)?

-----

1 point by akkartik 3730 days ago | link

Yup. Does that work?

-----

1 point by tvvocold 3733 days ago | link

it will open every link include the head of page like "new | threads | comments | leaders | submit" but i dont like these also be open in the new tab,(so many tabs then), any idea?

-----

2 points by akkartik 3733 days ago | link

Do you want to just open stories in new tabs? I think this will do it. Try it and let me know.

   (def titlelink (s url user)
     (let toself (blank url)
       (tag (a href (if toself
                         (item-url s!id)
                        (or (live s) (author user s) (editor user))
                         url)
               rel  (unless (or toself (> (realscore s) follow-threshold*))
  -                   'nofollow))
  +                   'nofollow)
  +            target '_blank)
         (pr s!title))))
The way to read that is to delete the line that starts with a '-', and to replace it with the lines that start with a '+'. Don't include the '+' itself.

-----

1 point by tvvocold 3733 days ago | link

ok,but how should i edit this in my app? i wanna user click url and open it in the new tab. need more detailes..

plz paste here. thx

-----

1 point by akkartik 3733 days ago | link

Add one line to lib/news.arc:

  (mac npage (title . body)
    `(tag html
       (tag head
         (gen-css-url)
         (prn "<link rel=\"shortcut icon\" href=\"" favicon-url* "\">")
         (prn "<meta name=\"viewport\" content=\"width=device-width\">")
         (prn "<base target=\"_blank\">")  ;; <--- add this line
         (tag script (pr votejs*))
         (tag title (pr ,title)))
       (tag body
         (center
           (tag (table border 0 cellpadding 0 cellspacing 0 width "85%"
                       bgcolor sand)
             ,@body)))))

-----

1 point by tvvocold 3733 days ago | link | parent | on: Shader:plz help

my hacked way is change the admin'auth to 1 or 2 in /app-root/repo/www/news/profile,and admin got the right to edit other's submit.but still donnot have all the right it should have..should i change it to 100 or something?

-----

2 points by tvvocold 3734 days ago | link | parent | on: Shader:plz help

yes

-----

1 point by akkartik 3734 days ago | link

Hmm.

Can you show me the output of:

  $ cat repo/arc/admins
and a screenshot of the clone when logged in as 'admin'?

Also, what version of arc are you using?

-----

2 points by tvvocold 3734 days ago | link

well, i use https://github.com/shader/arc-openshift ,and the echo of my admins is admin.(not "admin") ...when log as admin, i only have 'discuss' rights,and do not see the other rights.( sry, cannot upload photo here) >i try to edit site's color in news.arc then restart app and it loaded the color, but i edit the welcome message it didnot work, so do admins,,, something wrong?

-----

1 point by rocketnia 3733 days ago | link

"the echo of my admins is admin.(not "admin") ...when log as admin, i only have 'discuss' rights,and do not see the other rights.( sry, cannot upload photo here)"

Now that you've made a GitHub issue (https://github.com/shader/arc-openshift/issues/2), could you upload a screenshot there?

Please also paste the contents of your "www/admins" file there. I'm not sure what you mean by 'admin.(not "admin")'.

-----

2 points by tvvocold 3733 days ago | link

here is the page:

    1.Test
    2 points by tvvocold 19 hours ago | discuss | edit
    2.*Hello Fedora (fedoraproject.org)
    1 point by admin 19 hours ago | discuss | edit
when i cd app-root/repo/arc/ and vi admins

    >"admin"

-----

2 points by rocketnia 3733 days ago | link

But is there a similar file under app-root/data/?

I think that's where the Arc code is actually supposed to be installed, at least according to the openshift-arc readme. Maybe the readme is out of date.... :/

-----

2 points by shader 3733 days ago | link

The arc git repo is cloned under app-root/data, but it's not used as the root directory for the web application in case the user has other files they want to load.

I'll admit, the readme isn't the best. I mostly copied it from the original and changed the relevant bits.

Unfortunately, certain files like adminfile* should probably not be relative to the repo directory, because it's likely to get wiped. I'm not sure where the right place to put it would be though. Maybe data/config?

-----

1 point by rocketnia 3733 days ago | link

When you're logged in as admin, can you see anything on the page http://....../newsadmin (replacing ...... as needed)?

-----

1 point by akkartik 3733 days ago | link

Maybe you need to drop the quotes in the file?

-----

1 point by tvvocold 3733 days ago | link

i pasted all the step here http://paste.scratchbook.ch/view/915fbd57

-----

1 point by tvvocold 3733 days ago | link

i drop and drop out , all didnot work.

-----

2 points by tvvocold 3734 days ago | link

just saw this https://www.openshift.com/forums/openshift/app-root-and-runt... so i think the problem maybe be here, well, in my repo i only got "diy main.arc misc README.md static www arc", right?

-----

1 point by rocketnia 3733 days ago | link

"in my repo i only got "diy main.arc misc README.md static www arc""

Hmm, that looks weird, actually. I haven't used openshift-arc myself, but it supposedly installs Arc in the data/ directory. Is that really your repo/ directory? What does your data/ directory look like?

Here's the OpenShift directory structure if it helps:

http://openshift.github.io/documentation/oo_system_architect...

---

By the way, you can type code on the Arc forum by indenting it by two spaces:

  abc
  def
  
  By the way, you can format code here on Arc Forum by indenting it by two spaces:
  
    abc
    def
You can also write multiple paragraphs by putting a blank line in between. For instance, in the code above, "abc def" would be a single paragraph, but "By the way" would start a new one.

The official formatting instructions are here: http://arclanguage.org/formatdoc

---

Unfortunately, I'm going to sleep right now, and akkartik is in the same time zone as I am, so you might have to wait a while. Sorry.

-----

1 point by tvvocold 3733 days ago | link

Thx,rocketnia.i pasted all the step here http://paste.scratchbook.ch/view/915fbd57 but i still cannot use admin's rights.which step was wrong?

-----

1 point by tvvocold 3733 days ago | link

i try "rhc app-force-stop appname" and the welcome message changed but admin still that ,any idea?

-----

More