« first day (1814 days earlier)      last day (3326 days later) » 

06:00
Anyone know Flask here?
@Dennis Ah yes, I know this flask well.
@phase i do
06:04
@phase ask your question!
Maybe that was his only question.
Does this look weird to you guys? view-source:localhost/https://www.github.com
Coming from you, no.
3
06:11
^
In Python 3, I have a string that has a bunch of href="%s" in it, and I want to replace it with href="localhost/" + url + "%s" if it starts with a /, or href="localhost/%s" if it doesn't.
@phase use jinja
this isn't answering your question, but use jinja
@Maltysen What? How? When? Why?
06:15
What is jinja?
@phase this is for flask rite?
@Maltysen yes
and you're filling in your html?
yes
just do like you said!
06:16
flask comes with jinja automatically
@phase He means "Jenga."
3
which is a templating engine
@AlexA. not helping ;_________;
Jenga is a game of physical and mental skill created by Leslie Scott, and currently marketed by Parker Brothers, a division of Hasbro. During the game, players take turns removing one block at a time from a tower constructed of 54 blocks. Each block removed is then balanced on top of the tower, creating a progressively taller but less stable structure. The name jenga is derived from a Swahili word meaning "to build". == Rules == Jenga is played with 54 wooden blocks. Each block is three times as long as its width, and one fifth as thick as its length 1.5 cm × 2.5 cm × 7.5 cm (0.59 in × 0.98 in...
Use this
which is what you should be using to make your html
@AlexA. that works too :P
06:17
@app.route('/<path:url>')
def proxy(url):
    print("Connecting to " + url + "...")
    page = urllib.request.urlopen(url)
    return page.read()
that is what I have right now
+1 for no tabs
read the flask getting started
I know of jinja, and I've used it with formatting html files, but not a normal string
then use it to render your html
Can't you just make a separate string or something?
06:18
@AlexA. I win!
i think I am misunderstanding the question...
@phase btw, I didn't answer your question, I was just telling you to use jinja
@Dennis I don't doubt that you've won but I don't know what the contest in question is.
7 hours ago, by Calvin's Hobbies
Mini-challenge: Make Alex say "ಠ_ಠ".
@phase what is url?
06:20
@Maltysen I don't think it will help me whatsoever because I don't have a literal %s everywhere, but I have a string in that location
3 mins ago, by phase
@app.route('/<path:url>')
def proxy(url):
    print("Connecting to " + url + "...")
    page = urllib.request.urlopen(url)
    return page.read()
and you want to change page.read()?
@Maltysen yesh'
I was just thinking some regex or something but I don't know how to do it in Python
I was about to suggest that
you can probably do it with capture groups
and chaining two replaces
@Dennis I missed some fun times earlier today I guess. :P
What is the question again?
06:22
@Calvin'sHobbies It seems Dennis has won your mini-challenge.
High quality content here in TNB
2
@Maltysen Something like href = re.compile("href=\"(.*)\"") ?
re.sub('href="/(.*?)"', href="localhost/" + url + "\1", page.read())
^ approximately correct
I didn't actually test it
Wouldn't it be \\1 because it's not a raw string?
i dont think so
python lets you have `\`'s if they don't escape anything
Idea: Do your entire webpage in Pyth.
06:28
^
@AlexA. 10/10 very golfy and efficient
Or when my new language comes out, ShortPy, write the page in that!
@Maltysen SyntaxError: positional argument follows keyword argument
put it in a string
around href="localhost
also, this only does you first condition, not your second one
you need another re.sub for that
GTG...bye!
06:31
bai
I think you've got the wrong method, because sub takes .sub(repl, string, count)
gah python3
i was thinking of python2 re.sub
oh snap
to the docs!
Python 3 > Python 2 because 3 > 2.
06:32
uh no, it looks to be the same
Also because it's better.
re.sub(pattern, repl, string, count=0, flags=0)
is that not what you see?
I see Dennis from space
@AlexA. I only have one rule.
@MartinBüttner Don't mind at all
06:33
@AlexA. Wait, what?
does page.read() not return a string?
@Dennis Hi
I'm in space and I see you.
@Dennis What rule is this?
@phase try this: re.sub('href="/(.*?)"', 'href="localhost/"' + url + "\1", page.read())
06:34
@Dennis Well if Neil Patrick Harris says so then it must be accurate.
127.0.0.1 - - [16/Jan/2016 22:34:59] "GET /https://www.github.com HTTP/1.1" 500 -
Traceback (most recent call last):
File "C:\Python35\lib\site-packages\flask\app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "C:\Python35\lib\site-packages\flask\app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "C:\Python35\lib\site-packages\flask\app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Python35\lib\site-packages\flask\_compat.py", line 33, in reraise
@AlexA. That's not why Python 3 is better though. Python 2 is the only language I know where security holes are a feature.
I mean, who on Earth thought auto-evaluating input was a good idea?
@Dennis Hah! You mean input()?
@Dennis code golfers
06:37
^
@Dennis Definitely not a nihilist.
@Maltysen Meh, Python isn't very golfy anway. All those imports. >.<
Dec 31 '15 at 20:11, by Alex A.
meta import importing as import
import ifstatement as if
Python is the only language I know where using the factorial built-in takes more bytes than writing it yourself.
@ProgramFOX Why are you awake? It's the weekend! :P
Because I woke up a few minutes ago, so... :P
06:41
Good night, everybody!
Good night!
Night!
wut happened
@Maltysen str(page.read())
06:44
ah
is the \n's supposed to happen?
@Maltysen ofc not
did my regex do that?
brb testing
no, it's str
@phase Beautiful
06:46
so did you run my regexp on str(page.read())?
maybe page.read isnt a string
page.read is some bytes
re.sub('href="/(.*?)"', 'href="localhost/"' + url + "\1", page.read().decode('utf-8')) works
does it do good replaces?
nope!
there is a better way with function replaces, but i'm lazy
@phase aww
what's the problem
it's not getting the capture'd group
<link rel="apple-touch-icon" sizes="57x57" href="http://localhost/github.com">
<link rel="apple-touch-icon" sizes="114x114" href="http://localhost/github.com">
<link rel="apple-touch-icon" sizes="72x72" href="http://localhost/github.com">
<link rel="apple-touch-icon" sizes="144x144" href="http://localhost/github.com">
06:52
what's it supposed to look like?
"http://localhost/https://www.github.com/whatever-the-link-is"
I KNEW IT
IT WAS \\1
2
oh lel
sorry
rekt
06:56
Apparently there's also a Reddit site for code golf.
How can I improve the question if I can't edit the question while deleted?
You can't edit your own post while it's deleted?
Wait, it seem works. But why I receive that notification.
dafuq now the css isn't being loaded on the page because I'm prefixing it or something
woah my loaded page has a different font in Chrome than the normal site
and PNGs aren't working :\
 
1 hour later…
08:32
@Calvin'sHobbies
Problem solved. Kappa
09:23
0
Q: Dispaly 2d array as ASCII table

jcubicThe task is to display ascii table for a given array, the table should look like this: +---------------------+-------------------+------------+------------+------------+------------+ | License | 2008-05-08 | 2009-03-11 | 2011-11-22 | 2013-08-12 | 2015-11-19 | +----------------...

 
1 hour later…
10:31
0
Q: Find the line guaranteed by Sylvester-Gallai

msh210The Sylvester-Gallai theorem says: Suppose you have a finite list of points in the plane. Suppose further that not all of those points are collinear (lie in a single line). Then there is some line containing precisely two of the points. (That is, there's some line on which two of the points lie, ...

11:11
0
Q: Build an English word syllable counter

CJ DennisWrite a program or function to estimate as closely as possible the number of syllables in English words. The input list is here: 1000 basic English words. There are only 997 words because a few duplicates were removed. For each word, output a line containing the word, a comma (,), and the numbe...

11:38
@NewMainPosts @Dennis someone is copying you! Kappa
11:57
ninja'd
12:12
@phase You know what really grinds my gears about that subreddit? This thread: reddit.com/r/codegolf/comments/2sam5n/…
That subreddit has been around for 5 years and they either haven't standardized the rules for answers or no one can agree on what they should be.
why are they trying to convert a commenting thread based system to a question answer based challenge site ?
oh wait..
Ah wait. I now understand what the problem is. These guys apparently have 34 posts total
and then they started this SE site
12:31
They did?
Huh, then my apologies for badmouthing a fledgling golf site and congratulations on moving somewhere that was better suited for it
dunno
12:48
Does anyone know of a site which has the shortest brainfuck code for any given character? I've been running a brute force python script which does it, but want to know if it has been attempted before
Here are all the possible single character values under 12 brainfuck characters (which my brute force has found so far) pastebin.com/2JU3gLKk
ah, sweet
13:37
mornin
what's happened the last couple days?
judging by alex's comment ... real golf
13:53
@mınxomaτ so far this doesn't seem to have given any previously unknown answers, does it?
14:09
Why do we need objective winning criterion?
its not for the checkmark, as catalog questions did away with those
its an evil plan orchestrated by the SE community in order to prevent us from graduating
no other site has objective winning criterion :P
exactly
so, its definitely this community
that's why those ones graduate
14:12
IMO, the only possibility is that "questions need a goal", but assuming the task isn't trivial, answering the question itself is the goal
@PeterTaylor Out of curiosity, for which input does the code I suggested fail?
14:29
@phase This accurately summarizes all of my Python package manager experiences
@quartata and none of mine
I download "Anaconda" distribution which contains all packages known to man, so then I don't need a package manager.
I literally spent a day downloading packages before I found anaconda and replaced that with 30 mins
Anaconda is love, Anaconda is life
0
Q: Why do we have objective winning criterion?

Nathan Merrill2 years ago, we discussed dropping the objective winning criterion requirement. No consensus was really reached. I'd really like to start that conversation again, as I feel like it is hindering our growth into a more comprehensive site. What advantages/disadvantages are there to having objecti...

@Dennis Empty string. (Ok, I suppose you could argue that since it doesn't write anything to stdout it's ok, but it does dump a mess to stderr).
14:41
@PeterTaylor What challenge?
I'd think that would be OK since we ignore STDERR by default
14
Q: Parse RNA into codons

ZgarbIntroduction RNA is the less famous cousin of DNA. Its main purpose is to control the production of proteins in cells through a process called translation. In this challenge, your task is to implement a part of this process where the RNA is split into codons. This challenge is thematically rela...

I still normally do most of my CJam development on cjam.aditsu.net, and it's impossible to distinguish output to stdout from output to stderr.
Try it on cjam.tryitonline.net. That doesn't show STDERR by default I believe
I know, and it's a pain in the neck when you're debugging.
There is a debug button if you want to see it
Why? It's really a rare seeing!
14:43
It's really an annoying seeing
That's useful to know. Thanks.
ಠ_ಠ
@PeterTaylor I posted the wrong version in my comment. >.< It should be 0+, not S+.
14:45
@Optimizer Don't... even....
Ah, that does seem to work better.
I'll look at the problem again at some point. Right now I'm planning to write an answer for meta.codegolf.stackexchange.com/q/8121/194 and then I have some non-PPCG stuff to do.
@PeterTaylor I'd like to see your answer to that
You've definitely been on the site for a long time
Curious to see what brought you here in the first place
lol what ?
@Optimizer ?
"what brought you here in the first place" - not like he's on chat for the first time
14:47
I mean to PPCG...
context:
13
Q: Who are you? Why are you here? And more introspection

DoorknobWhereas: we are unsure about where exactly we fit into the SE mission others sometimes don't take us seriously the site has been languishing in beta with minimal communication from SE for years we have, after receiving explicit advice to expand our horizons, consistently failed to do so I hav...

oh
not to the chat
I honestly don't even know why I came to PPCG or what I'm doing here so I can't answer that meta question
@quartata You expect me to remember that?!
:c
0
Q: Wifi turns off and refuses to turn back on on MacBook Pro Retina with OSX El Capitan

FlagAsSpamYesterday, my computer developed two worrying problems that occurred simultaneously: My computer began to crash at random times (solved, maybe) My wifi turns off frequently and cannot be turned back on (unsolved) Some useful information that may be of assistance: Network is innaccessable Th...

Life = over. xD
@FlagAsSpam Accepted Answer 1 million upvotes: Bro, do you even Ethernet?
14:50
@quartata There are no natural ethernet ports on a Mac. I'd have to use ThunderBolt.
@FlagAsSpam What?
Wait, what?
They used to have them..
They took out Ethernet ports?
Why on earth would they ever do that
Because it reduced thickness.
I'm just speechless.
Did they take them off desktops too or just laptops?
Wait till you see what they did with the latest laptop.
Just the laptops.
Either way that's literally the stupidest hardware design choice I've ever heard of.
14:53
Only a charging port on the newest ones.
And a headphone jack.
I know. xD
fyi, headphone jacks are going away in the next generation
its all in the cloud man
why would you need ports
your headphones too?
14:54
\o/ I'm so excited (obvious sarcasm is obvious)
So, basically.... if that laptop bricks
There's literally nothing you can do
You're boned?
Yes.
10/10 it's ok
5/7 I approve
don't forget applecare is only $99.99 + your soul
14:55
3/-10 Meh
per week or month?
per second
hope you have a lot of souls
3
you gotta be a cat to use applecare
or asriel
or a fool
14:57
or a bool
or a quilt
funny = False
or an optimized
or a llama
no optimized will choose apple
can't say the same for llama though
or a shamwow
relevant
14:59
@LegionMammal978 This message is a test.
This message isn't.
@LegionMammal978 This message is a test.
Success! App '4020' fully installed.
thx steamcmd

« first day (1814 days earlier)      last day (3326 days later) »