« first day (13 days earlier)      last day (621 days later) » 

01:00
here are my thoughts on what the perfect codegolf site would look like (with the potential to expand to other sorts of competitive programming): pastebin.com/raw/G5rhFrhw
2
of course, it's possible/probable that not everyone will agree with me, but I'm willing to discuss my reasons for the decisions
Anonymous
01:22
@ais523 I like several of your suggestions. I'm a bit iffy on some parts (like using tags for everything), but they're very well thought out, and definitely merit consideration and discussion. Thank you for sharing that.
Anonymous
It's difficult to break free of the SE model when we're so accustomed to it, so it's good to get the perspective of someone who is strongly opposed to the SE model for PPCG - it helps us think outside of the SE "box"
right
strangely enough, the "tags for everything" model is mostly inspired by things like Stack Exchange's close votes
and red flags
but I thought I'd put all the suggestions out there; quite probably other people will be able to improve them
Anonymous
I still like the idea of awarding privileges to users at certain rep thresholds, but having almost all privs being moderation-related (like on SE) is a recipe for disaster. The gamification aspect seems to work well, so I want to find some replacement privs to be earned.
symbolic privileges might be a good idea
Anonymous
Some sort of badge, maybe?
01:25
you could do it like free to play computer games and let people put their username in a fancier font
apparently people pay real money for that sort of privilege on some sites
I just had this idea: When you edit a challenge, you can mark your edit as potentially breaking existing answers, making existing answers suboptimal, or both. That way, the poster of every existing answer gets a notification that they might consider revising their answer, and the answers can get a mark saying that they were posted before a rules revision with a link to the last version before the breaking change.
Anonymous
I'm not a huge fan of having applications for gaining moderation privileges, though. Stuff like editing, creating new tags, closing, etc. could safely be awarded based on reputation, but the thresholds would need to be reworked. Maybe the top X% of users by reputation get access to "soft" moderation tools?
editing and closing can't safely be awarded by reputation on PPCG; maybe they could be but the thresholds are wrong, it's easy to gain access to them before you know what you do
@Pavel I like that, but in my construction, the challenge is split into two parts (the program that determines validity of answers, and the notes that give the specification in natural language); the first part can't be edited, the second part can be edited freely (and obviously doesn't change validity)
we could do that for challenges where we don't have a machine-readable validity criterion, I guess
Anonymous
@ais523 I agree that it's far too easy to get edit and CV privs on PPCG. Higher rep thresholds will only help so much - the core problem is how easy it is to gain rep on PPCG.
right
Anonymous
01:32
Also: no rep cap. I'm very against users not receiving reputation that they've earned just because of when they posted.
in my account deletion message to SE, I explained how I once repcapped for an entire week through choice, then stopped because it wasn't very fun and was probably reducing the average quality of the site
the rep cap is a bandaid over the reputation system not being balanced at all
@ais523 I don't particularly like that automated validity testing scheme, what if I want to answer in SmileBASIC (which only works on the Nintendo 3DS)?
there are already reasons why an answer might not be testable automatically, so I assume you could use a tag for "test manually" and have people vote the answer as incorrect if it's wrong
Anonymous
@Pavel As unfortunate as it would be for very obscure languages, it would probably be best to enforce that a language has a freely-available implementation somewhere (preferably TIO).
I'd like to avoid that as much as possible though because it makes a golfing site much less usable
and if you submit a SmileBASIC answer and it's wrong, there's a decent chance nobody will ever find out :-P
01:34
@Mego IDK, a huge part of the PPCG culture is in designing and using programming languages.
I'm envisioning that the site has a list of languages but it's easy to add to
(it's pretty easy to add languages to TIO at the moment, for example)
Anonymous
@Pavel Sure, and those could be added to TIO
Anonymous
@ais523 Exactly
Anonymous
Especially since we'd probably be hosting our own TIO instance
@Mego There are some rather popular languages that don't work on TIO, Batch, Swift, Hack.
Anonymous
01:37
@Pavel Sure, but we could make them work on our private instance
Anonymous
Via Wine and emulators and such
BlitzBasic, B
Just of the ones that I've personally asked Dennis to add
Anonymous
For nonfree languages, we could say that the user has to pay for the license :P
@Mego Wine doesn't work on TIO, we'd have to write support for that ourselves. And it's been on Dennis' to-do list for a while now
Anonymous
@Pavel We're writing a whole new site for competitive programming. What's a little Wine compatibility hacking layer, compared to that? :P
01:41
huh, why doesn't Swift work on TIO? I thought it had a Linux version, maybe not?
yep, there's an official Linux version
@ais523 It's probably because building it causes TIO to run out of memory, since that's the number one cause of languages not working on TIO, but I'll check.
in talk.tryitonline.net, Jun 13 at 20:26, by Dennis
@Downgoat Tried to build it from source and failed. Miserably. After running from ~30 minutes, something ran out of memory. Maybe when I migrate TIO to better servers.
fair enough
Anonymous
Benefit of using Ubuntu: there's a binary package available from the Swift website :D
01:57
I seem to remember a similar issue with Incident
(the dependencies it needed weren't in the repos but were in Ubuntu's)
although that got fixed in the end by simply copying the source code of the dependency
@Mego At the same time, outdated software.
Like Python 35
So we'll probably be building Python 37 from source
Debian unstable might be a good tradeoff for something like this
most of the same packages as Ubuntu, but with no restrictions on how quickly they can be updated
Anonymous
02:41
@Pavel I built GCC 7.2.0 and Python 3.6.2 from source earlier :P
@Mego Why not Python 37
@Mego do you have this issue locally or only on your server?
I can't reproduce it
Anonymous
@Pavel Because 3.6 was the minimum version necessary for inline format strings
Anonymous
@Downgoat On the server. I have other issues locally (no Windows implementation of Redis)
@Mego btw what is the error message python is outputting?
Anonymous
02:47
Just added it to the issue
@Mego 3.7.0a2 > 3.6.2
Stable software is for wimps
@Mego do you have nodejs installed? Is the command node or nodejs
Anonymous
Apparently it's nodejs, not node
@Mego Wat
Since when is it not node
@Mego aha yeah, ubuntu does that
for now you can symlink
but I'll push a fix
Anonymous
02:49
I've symlinked it
Anonymous
Anonymous
Hooray!
yay! :D
:( viewing post causes 500
but still yay :D
Sign in
Nothing works but it looks beautiful
oh, for google api key you need to add the IP+port in dev portal
actually light blue looks good
Anonymous
02:53
@Downgoat Fixed that. It should work now.
Anonymous
And if it doesn't, it's not my fault :P
Anonymous
I suppose I should set up LetsEncrypt
can you give a screenshot of the portal page, it still complains that the IP is not a authorized JS origin
Anonymous
weeiiirdd
maybe caching
Anonymous
03:01
It's always caching :P
:| apparently google doesn't support numerical IP
brb trying solution
can you try to add http://codegolf.vihan.org:5000 as an authorized origin
Anonymous
Done
:O auth worked
Anonymous
Hooray!
Anonymous
Next step: I need to set up https
03:10
I suppose I'll try to see why celery is 500ing
Anonymous
celery.backends.base.AttributeError: 'NoneType' object has no attribute 'stdin'
Anonymous
Looks like the Popen pipe failed
oh huh
Anonymous
celery.backends.base.BrokenPipeError: [Errno 32] Broken pipe
Anonymous
Huh
Anonymous
03:15
I'll have to debug it later
huh, that is generally caused by node.js process crashing but weirdly I see no STDERR
oh, celery might be hiding it
Anonymous
Probably
Anonymous
Wait do I have celery workers running?
not sure how to do this, but we might want to check if stdout is open/proc has not exited so we can restart if needed
03:35
@Mego why was from app.server import server changed to import app.server?
Anonymous
@Downgoat To avoid circular import headaches
oh ok
03:51
@Mego can I add server = app.server.server to the start.py then. Flask debug needs it
Anonymous
Sure
Anonymous
from x import y causes issues with circular import. import x everywhere allows circular imports to be resolved.
is it OK if I commit that directly to the celery-tasks branch?
 
1 hour later…
04:55
I am going to work on adding unit tests
Anonymous
Excellent
First time doing python unit tests so I'll add a few and we can see if I am doing correctly
Anonymous
They're pretty simple
not sure on optimal structuring though
Are all test files run independently?
05:19
weird, from the tests/ dir, Flask cannot be imported:
ImportError: Failed to import test module: flask.test_static
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/loader.py", line 428, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "/Users/vihan/Documents/Code/PPCG-v2/tests/flask/test_static.py", line 1, in <module>
there is no file named Flask for there to be be naming conflict
Anonymous
Odd
Anonymous
@Downgoat Each test function is run independently. Within the function, state is preserved.
Anonymous
You can look at the tests I wrote for Seriously for an example
Anonymous
Maybe it's because you have a module named flask in the tests? Try renaming it to flask_tests or something like that.
ok >_< yeah I have a dir
I am blind goat apparently
:D unit test is working
Anonymous
Hooray
05:53
can I do this:
class TestUserSession(TestBase.TestFlask):
    def setUp(self):
        super().setUp()
like is the super() part correct
Anonymous
06:04
Looks to be
06:15
not sure how to test front-end
hm, problem: travis does not have a config.py
we can use travis private env vars for things like google api key I guess but I don't have that so I'll leave that empty
@Mego two PRs: unit tests and js tweak
 
7 hours later…
Anonymous
13:10
@Downgoat Yep, it's already using one for the deployment key
19:04
@Mego what uses the create_user celery task
Anonymous
@Downgoat I'm not sure if anything does yet
19:22
I get celery.backends.base.NotRegistered, with @celery_app.task idk why
Anonymous
Debugging it now
Anonymous
Looks like some old workers were never killed
Anonymous
Try now
everything I run from the celery CLI just hangs, not sure how to fix
the app isn't running
The full contents of the message body was:
b'[["This post tests error in math rendering:\\r\\n\\r\\n$$ \\\\badtag $$\\r\\n\\r\\n```js\\r\\nlet $\\\\pi$ = \\"$$ \\\\pi $$\\"\\r\\n```"], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]' (192b)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 561, in on_task_received
    strategy = strategies[type_]
KeyError: 'app.helpers.tasks.render_markdown'
[2017-11-16 19:32:13,821: ERROR/MainProcess] Received unregistered task of type 'app.helpers.tasks.rend
huh
no clue on how to test though
Anonymous
Oh I think I just realized the issue
19:39
> celery_app.tasks.register(init_celery)
> celery.backends.base.NotRegistered
water u doin celery
@Mego why does the init code need to be in a celery_app.task if it should be run w/ default event loop
Anonymous
@Downgoat Because I set it up wrong. I'm changing it to use @celeryd_init.connect, which runs it on each worker when it is ready
Anonymous
20:00
celery.backends.base.error: unpack requires a buffer of 4 bytes
Anonymous
Hey look now we're getting somewhere
Anonymous
It loaded for me (after refreshing a few times)
keeps 500ing for me
Anonymous
20:06
Well now I'm getting a broken pipe error
Anonymous
So it can successfully establish a pipe to node, but it breaks for some reason
does node emit any errors?
that happens when node crashes
Anonymous
I don't see any errors
Anonymous
Of course, I'm not reading its stderr
@Mego even in the celery log files?
could you maybe push to GH and I can see if node is doing any error
Anonymous
20:13
Nothing terribly useful in Celery's logs - just broken pipe errors over and over
Anonymous
There, everything is stopped
Anonymous
Also server shut down for now
> AttributeError: module 'celery_server' has no attribute 'celery'
weird
trace not helpful either
Anonymous
What are you trying to do?
hm, looks like I needed to add celery = app.helpers.tasks.celery_app to celery_server.py to silence error
came from running celery multi start w1 -A celery_server
Anonymous
20:20
That's strange. I have no issues with calling it without that change.
weird, I still get celery.backends.base.NotRegistered: 'app.helpers.tasks.render_markdown'
Anonymous
Oh wait, I modified celery_server.py and didn't sync it with the server
maybe I should restart celery
Anonymous
Yeah, celery needs restarting any time you tinker with any celery task-related file
Anonymous
Unlike Flask, it doesn't auto-reload
20:22
@Mego oohhhhh
restarting celery and still gives the: AttributeError: module 'celery_server' has no attribute 'celery' error
Anonymous
#!/usr/bin/env python3

import app.helpers.tasks

celery = app.helpers.tasks.celery_app

if __name__ == '__main__':
    app.helpers.tasks.celery_app.start()
Anonymous
^ that works for me
Anonymous
Pushed a fix
:OOOO :DDDD rendering worked! hooray!
Anonymous
Now wait for it to crash for no reason :D
20:35
I just hope node.js doesn't die on larger posts
@Mego does server.py still need the import app.helpers.tasks
Anonymous
@Downgoat Nope
21:04
@Mego btw PR: github.com/Mego/PPCG-v2/pull/32 (also I think the celery PR #31 is ready to merge now)
Anonymous
@Downgoat Merged it. Did you have any instability issues when running?
no worked fine
Anonymous
Ok, I'm going to wait for the unit tests PR before merging the Celery PR
should I change unit tests PR to merge into celery PR
Anonymous
Nah, just merge into master
Anonymous
21:11
I'll then merge master into celery, and then merge celery when/if the tests pass
am I not doing multiple inehritance right:?
class TestUserAPI(TestBase.TestFlask, TestBase.TestDB):
    def setUp(self):
        super().setUp()
it's not calling TestBase.TestDB 's setUp
Anonymous
You have to call them individually
Anonymous
super(TestBase.TestDB).setUp(); super(TestBase.TestFlask).setUp()
Anonymous
You can't call two functions simultaneously with one call
oh
brb downvoting misleading SO post
I addeD:
class TestUserAPI(TestBase.TestFlask, TestBase.TestDB):
    def setUp(self):
        super(TestBase.TestFlask, self).setUp()
        super(TestBase.TestDB, self).setUp()
where:
class TestBase:
    class TestFlask(unittest.TestCase):
        def setUp(self):
            self.app = server.test_client()
            self.app.testing = True
and then the next call says self.app does not exist
the above is correct, no?
aha
21:47
should I use url_for in the tests or just directly enter URL
 
1 hour later…
Anonymous
22:48
@Downgoat Probably url_for
23:24
@Mego is it OK if I merge the tests branch?
Anonymous
Sure
Anonymous
I already gave it my approval
Anonymous
23:41
Hooray no more PRs open
Anonymous
@Downgoat The sign in with Google button doesn't seem to work
@Mego Appears that the static/lib folder has been cached. Remove it and the JS will be re-compiled
Anonymous
So just rm it on the server?
yeah
Anonymous
Still no good
23:50
try rm -r static/lib static/css static/.webassets-cache to clear all the caches
Anonymous
webassets.exceptions.FilterError: browserify: subprocess returned a non-success result code: 1, stdout=b'', stderr=b"Error: Cannot find module 'envify' from '/home/ryan/PPCG-v2'\n at /home/ryan/PPCG-v2/node_modules/resolve/lib/async.js:48:31...
Anonymous
What have you done
oh you need to npm install to install some new modules
run above in project root dir
there we go :D
Anonymous
Successful signin :D
Anonymous
Now I can work on the /post endpoint

« first day (13 days earlier)      last day (621 days later) »