« first day (1844 days earlier)      last day (2985 days later) » 

10:00 AM
:) yay
 
you should write a tip
 
Ahaha, if you think it's useful enough to be used relatively often then sure, will do :)
 
@xnor it's not specific to python, you can have this in a lot of languages ^^
 
@Katenkyo Is argument unpacking a common feature?
 
@xnor It exists in my most used languages, so I think it is
I know that it at least exists in Java/Lua/C++
 
10:07 AM
But does it save chars there? :P
 
Lua -> function f(a,b,c,d,e,f,g)becomes function f(...)
:)
 
@Sp3000 Is there a way to initialize the empty tuple in the args if you're using an optional arg for recursing?
I'm not really clear what's possible with 3.5.
 
Hmmm like f(n,a=0,b=[])? Might be tricky
 
Can you do f(n,a=0,*l)?
 
Hmm that works fine actually - f(5) makes n,a,l=5,0,()
 
10:13 AM
And it works in Python 2 too
 
>>> f(5)
5 0 ()
>>> f(1,2)
1 2 ()
>>> f(1,2,3,4)
1 2 (3, 4)
The sad part is you can't do f(n,*l,a) from my attempt earlier :/
Wish it worked like n,*l,a=range(10) and took a to be the last element
 
i'm surprised that doesn't work
you can do a,*b,c=range(5), right?
 
Yeah
 
but functions don't have lookahead when unpacking?
 
But with def f(n,*L,a):print(n, a, L), f(1,2,3,4,5) says missing argument a
 
10:15 AM
@sp3000 it is to limit unexpected behaviour
 
Doesn't look like it, with 3.5 at least (new feature after all, I guess)
 
if you had a function f(a,*numbers,*strings) it couldn't know how to act
 
But that's only if you have two unpacks
 
i'd expect function arg unpacks to work the same as assignment unpacks
 
@sp3000 what about f(a,*l,b)with 2 parameters?
 
10:17 AM
I'd expect a,b to be assigned, and l to be empty
It's what a,*l,b=[0,1] would do
 
it's a pretty strange behaviour in itself, it shouldn't Oo
 
>>> a,*l,b=[0,1]
>>> a
0
>>> b
1
>>> l
[]
Why not? Having b at the end is a perfectly readable way of saying "I want b to be the end of the list"
 
and what if you call it like f(0,1)?
 
You mean for f(a,*l,b)? I'd expect a=0, l=(), b=1 similar to above
 
I'd expect a=0,l=1,b=nil personally
 
10:20 AM
There's no nil in Python, or at least it's not called that
 
Replace it by any null value signifying it isn't set
 
*b=None
 
Considering that * unpacks to a sequence, I'd expect the result to be a sequence rather than a single value like that, so empty list/tuple makes more sense to me IMO
 
@Sp3000 it is the same if I call it with 3 values, your sequence will have only one value, no matter if you write it f(a,b,*l)orf(a,l*,b)
 
If you call f(1,2,3), I'd expect f(a,b,*l) to mean a=1, b=2, l=(3,) and f(a,*l,b) to mean a=1, l=(2,), b=3
 
10:26 AM
so it still makes sense to assign it this way
 
The exact problem here is that it looks like Python's doing, for f(a,*l,b), a=1, l=(2,3), b=??? then complaining, which is not what I'd expect
(based on the behaviour of a,*l,b=[1,2,3])
 
@sp3000 it's because the list will take all the remaining parameters, that's what it is created for
consider your parameters as slots
 
So why can't *l take all remaining parameters in f(a,*l,b)?
 
when the program will pass datas to your function from the left most, to the right most
a is a 1-sized slot, it will tkae the first one
l is an infinite hole, it will fill it with all it have
and b will never be considered an option
it makes even more sense if you look at it from a dev's POV
why would your commands be at the end and the start, and all the datas in the middle
If you want to do that, you could do it like a bash's script : with one big array
 
10:45 AM
this guys approach is to print every possible answer and it will print it eventually
Actually. I have no clue what it is doing
Ah, the goal was to do the minimum it can. This is a bit cheaty though
 
@quartata still on my radar, sorry for the delay. I'll try to sort out the prizes one of these days.
@somebody that could be anyone
 
*any bot
 
11:01 AM
that's not the first time someone has tried/thought about doing that
 
 
2 hours later…
1:24 PM
♫ the chatroom's dead and here we are ♫
oh hi
 
♫ Heeeeeeeere we are .... born to be kings ... ♫
 
1:42 PM
hi
 
@Quill Hi !
 
@CᴏɴᴏʀO'Bʀɪᴇɴ looks like you have a hell lot of energy !
 
YEAAAAAA
:3
Do you come to chat often?
 
5 days a week for 8 hours (a)
 
1:46 PM
Huh.
 
(i'm usually reading it while waiting some datas to process ^^')
 
Any suggestions for this?
0
A: Shortest infinite loop producing no output

LegionMammal978Sally, 20 + 4 = 24 bytes void a a void main a Why the extra four bytes? First, I pipe it to sally2c, which transpiles it to C: #include "sally.h" /* {void -> void}: */ void apply_a(void) { apply_a(); } /* {void -> void}: */ int main(int argc, char ** argv) { if(argc <= 0) { fprintf(std...

Might be able to reduce the four extra bytes for the compiler flags
 
@Katenkyo oh, I see.
@LegionMammal978 Each flag is one byte iirc
 
Wasn't the consensus that flags cost the number of extra characters?
 
I'm actually implementing some tools to update a SQL DB with datas extracted from .xlxs. So.... it can be loooong.
 
1:51 PM
@LegionMammal978 ugh I don't remember. That sounds right though >_>
 
Let me check
 
@LegionMammal978 actually, flags are the numbers of characters, yes, except for languages where the flag is mandatory to run it
 
What if the flag is necessary to make the language fall under our criteria?
 
But the language can still run otherwise
 
1:53 PM
for instance gcc -std=c99 foo.c doesn't cost extra bytes
 
But what about -O2?
It adds tail-recursion
 
@LegionMammal978 hum... I think it doesn't count
 
And recursion seems to be the only way to loop
 
it doesn't make your code shorter to use it, and is mandatory to every program that will loop, right?
 
1:55 PM
Any program that will loop beyond the stack limit, that is
Prime-checking seems to require O(n) loops
 
So it should be free :)
 
So I guess that it's necessary?
There, updated
 
@Quill Wow. Just... wow.
 
This is really weird. I just started gettin HTTP 400 for any request on PPCG. Disabling HTTPS allowed me through (but enabling HTTPS got the problem back), other sites worked even with HTTPS. Problem disappeared by clearing cookies. o.O
 
2:03 PM
Does the self-graduation userscript use a lot of cookies? I noticed there were a lot of them and I think sending a too long cookie string can be a Bad Request.
 
It might; that would explain why some online applications "run out of memory".
@Downgoat does the userscript use (a lot of) cookies?
 
Well, I checked the source and there's a lot of cookies (one per question or something). Could you use GM_setValue? (basically localStorage, but for userscripts)
 
o_O
@Downgoat ^^ IMPORTANT
 
I feel stupid...
 
2:07 PM
instead of simply opening a file in ../foo/script.ps1 I've gone all the way \\COMPUTER_NAME\c$\Documents and settings\user\foo\script.ps1
 
There's not really a difference between GM_setValue and localStorage
 
He should probably just change how he is doing the data storage
 
(Is there a Y programming language?)
 
Why?
(that was a good pun isn't it?)
 
2:09 PM
indeed :3
I'm looking to name another esoteric language of mine
 
@Quill localStorage can interfere with the page's JS. GM_setValue is restricted to the userscript. Works about the same, though.
 
you should be using custom storage keys anyway, but yeah
 
@CᴏɴᴏʀO'Bʀɪᴇɴ My friend named one of his languages Y̋y̋
 
an edge case, but you're right
 
@Pietu1998 o_o Y̋y̋ is just evil brilliant
 
2:14 PM
Huh. My browse apparently really doesn't like that character -- it displays more like Y"y" as four characters
 
Mine too o_o
 
It works well in mine ^^
 
Mine sort of halfway gets it right. The accents are really misplaced with this font though
Works in Telegram Web
 
But mine is set for French encoding, so accentuation marks are already present ^^
 
2:16 PM
Whoa, creepy
 
(There's a space in between them FYI)
 
So more like Y″y″?
So Y″ y″
 
If I copy-paste those characters into the text box, arrowing between them, there are only two characters ... but I can backspace the " individually
 
Here's how it looks for me; Telegram Web on the left, SE chat on the right
 
2:17 PM
U+2033 DOUBLE PRIME
That's what I used
 
Which combining character?
 
¯\_(ツ)_/¯
 
0
Q: Sandbox Answer Template

GamrCorpsWhat format is recommended for asking questions in the Sandbox? Or, should we make an attempt to standardize this at all?

 
just came across a glowing deathclaw. turns out that's a really easy way to die
 
2:22 PM
a what? o_o
 
wat is that o_O
 
@Pietu1998 That's horrible...
 
2:30 PM
Has there been some change to something? This is vanilla IE, no extra plugins, no userscripts, not used at all really. Also happens on Chrome.
 
Might be my PC's problem, but can't prove it
 
hum... did you mess with some config files?
 
None that I know of
Nothing weird in CSS either
 
"Helvetica Neue"?
 
2:34 PM
I think I found it. I have Helvetica Compressed on my PC (downloaded for some graphics project at some point). Apparently IE and Chrome think it's "Good Enough™"
Firefox doesn't do that
 
Firefox is the best.
 
^
 
^^
 
> "Eh, good enough." - Microsoft
4
 
Slow to open, but eat the least RAM and works perfectly fine
 
2:35 PM
user image
2
 
hey
Y.prototype.getTop = function(N){
	var s = [];
	while(N --> 0){
		s.push(this.stack.pop());
	}
	return s
}
The fabled "leads to" operator
 
grc
2:50 PM
 
11
Q: How to fill CAPTCHA using automation?

Tom J MuthirenthiHow can I automate, 'Enter CAPTCHA' using Selenium Web Driver ?

ಠ_ಠ
 
TIL CAPTCHA = Completely Automated Public Turing test to tell Computers and Humans Apart
 
 
grc
I just checked and chrome is actually using 8.5 GB of memory on my computer
 
grc
2:58 PM
not sure how it can be using 238 GB of virtual memory though...
 
grc
that figure seems wrong
 
@grc How many tabs open? Oo
 
grc
umm
how do you count them?
 
you have so much tab that you can't count them?
 
3:00 PM
^ ???
 
grc
maybe...
 
Maybe it's time to learn about bookmarks ^^'
 
grc
55 tabs in my main window
 
o_________________________ಠ
 
grc
3:02 PM
:S
 
For what purpose...?
 
And how many useful tabs...?
 
@CᴏɴᴏʀO'Bʀɪᴇɴ I can't decide what (if anything) that face is trying to say.
 
I've had more than 55 tabs open for hours with facebook albums page in each tab (200+ images per tab) with less than 2GB memory usage in firefox
 
@Geobits "Trying to stay calm, but disapproval is leaking out."
 
grc
3:03 PM
most of the tabs are things I started looking at but got distracted and will come back to "soon"
 
that sounds like my coding projects ^^"
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Same here, I should continue this esoteric language...
 
@Katenkyo Which one?
 
grc
^ this chat uses >600MB
 
@grc How is it using more memory than chrome is?!
 
grc
3:06 PM
different process
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Basically a golfing language using a tape made out of a lua table(which can contains anything)
 
well, I have 6 tabs open including main site, fb, this page, gmail etc and my total usage is 600 MB right now
 
@Katenkyo So, like brainf*** with a 2d tape?
 
of course firefox does not give exact per tab memory usage
as per the memory tool and about:memory, this tab is taking around 7 MB
 
875 MB with this, two CG tabs, four of my schools portal's, and pandora
(firefox)
 
3:08 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ it's a 1D tape as the table is the tape, but you could store an matrix in cell 1, a string in cell 2, a table in cell 3 etc
 
Ohhh I see!
tableception
 
500 Mo for 9 tabs with firefox here
@CᴏɴᴏʀO'Bʀɪᴇɴ I though it could be fun to use and isn't already done (or not done in many languages)
 
grc
in my case I think chrome is just making use of otherwise free memory to speed things up
 
^ I think I've read something about it doing this. The more available, the more used, but it works "fine" without as much.
 
@Katenkyo Yeah, sounds cool! Take a look here for languages that are BF-like.
 
3:11 PM
also, as Lua uses pointers, you could do some self-references, use direct index instead of moving the tape head and some things more
 
That sounds really legit actually
 
Then again, I have a single process using over 5GB right now, so Chrome is the least of my worries.
 
@Geobits Marky's process?
 
Yep, his learning, that is. The talking bit is much less intensive.
 
Unless he learns to shout.
 
3:13 PM
@grc lol no.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Thanks! I already checked out some of this languages, but there's too much language to read all of them
 
@Katenkyo That is true .-.
 
I should probably take a look into tensorflow's C API. While it probably wouldn't help with resource use, I can't imagine it would be slower than the python I'm using.
 
Also, I only take the tape notion from BF, nothing else :p
 
@Geobits either one isn't helping
 
3:14 PM
Either what?
 
grc
@Optimizer no?
 
@Geobits learning vs talking.
 
@Geobits Python can easily be translated to lua, which is only about 20-30% slower than c for difficult sorting tasks, may help out
 
@grc yeah, i mean, there is nothing really much there in js parsing that can benefit from extra memory
unless of course you skip on GC (or reduce the frequency a lot ) if memory is available
 
grc
images and rendering?
 
3:16 PM
@Optimizer Oh, his current chatbot-talking-brain isn't still learning. I started him on a new dataset last night. Hoping for something usable tonight or tomorrow, so hopefully he'll get "better".
 
so, lets say rendering, firefox curently renders the tab as you switch to it and removes it from memory once you switch away. this process takes less than a ms
images can add a little to speed scrolling, but otherwise nothing much in general performance
were you constantly scrolling images heavy websites?
 
can confirm, just rapidly switched tabs
 
Right, but there's no harm in keeping it in memory until it's getting close to full, so why waste time freeing/redoing it? Android works much the same way.
 
@Optimizer Firefox still keeps a big part of the generated DOM in memory, it doesn't erase the tab completely :)
 
@Katenkyo "render memory"
@Geobits because other processes might need it.. and removing it and reloading is much faster than you think it to be.
 
3:18 PM
Right, and if other processes do need it, it can be freed...
 
@Optimizer I'll shut my mouth, carelessly read what you said ^^'
 
@CᴏɴᴏʀO'Bʀɪᴇɴ rapidly is not doing what i said. you have to leave a tab untouched and then switch to it after say 5 minutes
 
But if not, you're freeing and reallocating for no reason at all.
 
@Geobits the problem is deciding when other processes need it
 
3:19 PM
Can confirm, just touched my school tabs I haven't touched for ~an hour :P
 
and i am pretty sure even chrome doesnt get it right
 
@Optimizer Not really. Like I said, Android does this just fine (for battery consumption purposes, ostensibly).
 
how do a single process know that my intellij is going to hit a 4 gb spike in less than 2 seconds
@Geobits dude, android manages the whole system. it knows when other processes need memory
 
So does any other OS, no?
 
so you are trying to say that OS knows it and it tells chrome and then chrome frees things?
 
3:22 PM
The OS knows what? That memory is getting low? Yes. Can Chrome ask the OS how much memory is available? Yes.
 
also, do keep in mind, since each tab is its own process (almost) in chrome, much of the memory in each process is duplicated which can be other wise shared if it were a single process (like in firefox).. This is true for extensions as well, so each extension is loaded once in each tab ..
@Geobits the question was.. how does chrome figure out that available memory is enough or not for other processes.
 
grc
multiple processes has its advantages
 
@Optimizer Yea, that's one of the things I like about it. Having an extension/tab crash doesn't even remotely bother others. Last I used firefox (I don't know if it's true now) that wasn't the case.
 
@Geobits It still is as firefox is a single process
 
@Optimizer Chrome itself doesn't need to know. The OS should handle that. Chrome can poll the total available and drop some if needed.
 
3:25 PM
But firefox crash once in a year, at most
 
Try writing programs in your web browser. :P
 
> if some needed
 
"if the total is below some threshold" if that makes it clearer.
 
@Dennis I usually use an other instance of it when working on a program/site :)
 
I'm not saying that Chrome is polling other processes to see what they need, just that if there is a ton of free RAM, there's no reason not to use it (to a point).
 
3:27 PM
> some threshold
 
@Dennis That's the #1 cause of browser crashes for me: infinite loops made by bad programmers. (By which I mean me.)
 
Yes. Some threshold. Whatever the developers decided.
 
@Katenkyo its on the way™
 
@ETHproductions Firefox doesn't crash on infinite loop iirc
 
@Katenkyo 1. Click permalink on PPCG. 2. Permalink crashes. 3. Lose all your work. (4. Curse the day you chose Firefox over Chrome.)
 
3:28 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ Doesn't crash, I guess, just freezes until I force-shut it.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ That depends. If the loop is leaking memory, it will.
 
@ETHproductions Huh. mine freezes for maybe four seconds then says a process is busy, and if I want to end the process
@Dennis 5. curse the faulty permalink system.
 
6. Click permalink again to confirm.
2
 
@Dennis reopen firefox, everything restored
3
 
Chrome restores, too ;)
Hell, IIRC even IE does nowadays.
 
3:30 PM
Except IE, every browser can restore
Oh, really?
 
Maybe. I don't use it often, but I thought 10 did.
 
Everyone should switch to Microsoft Edge it is great and does all things
 
grc
good news: I'm down to 30 tabs in my primary window and 6.5 GB of memory
 
how about we test all the assumptions about chrome being wise about memory
 
3:31 PM
For some reason though, the site I use to test JS never restores the code I spent 3 hours writing :(
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Edge is still IE ^^
 
@CᴏɴᴏʀO'Bʀɪᴇɴ That would require downgrading my OS.
2
 
@grc can you start another memory intensive process and see if chrome frees up some?
 
@Katenkyo wait really? XD
 
@Dennis w in CJam is throwing an error for me:
 
3:31 PM
@ETHproductions Host a web server on your computer, and work in notepad :)
 
0{1}w
    ^
RuntimeException: Long Block w not implemented
Java exception:
java.lang.RuntimeException: Long Block w not implemented
	at net.aditsu.cjam.Op.fail(Op.java:22)
	at net.aditsu.cjam.Ops$31.calc(Ops.java:921)
	at net.aditsu.cjam.Op2.run(Op2.java:12)
	at net.aditsu.cjam.Block.run(Block.java:302)
	at net.aditsu.cjam.CJam.runCode(CJam.java:206)
	at net.aditsu.cjam.CJam.main(CJam.java:236)
why dis be
 
@Optimizer I have a couple large processes going, and Chrome is under 500MB right now.
 
grc
@Optimizer okay - does python have a memory limit?
 
@Dennis I head it's buggy because it doesn't have MS edge
 
@grc no idea.
@Geobits how many tabs?
 
3:32 PM
@quartata Because w takes two blocks: a condition and a body.
 
@Dennis Oh.
 
@Optimizer Seven: gmail, four various SEs, two youtubes.
 
@quartata If you want a do-while loop, use g or h.
 
I was using g originally but then I realized that it was do-while and not while
I'm working on the powers of 2 challenge
q~1{_2T#sew__|={T):T}{0}?}gT
oh wait it wants the indices too?
 
@quartata this challenge maked me rage quit when I saw I had to handle overlapping matches...
 
3:36 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ yeah :/ That's how the QOD widget works.
 
Overlapping matches is the easy part.
 
But outputting the indices is just an annoying extra.
 
And now I'm sad because I figured out how to do eat, after losing what I've done...
 
grc
@Optimizer chrome went from 6.5GB to under 3GB when I started using up memory
 
3:37 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ question of the day widget
 
Oh. Is that changeable?
 
@CᴏɴᴏʀO'Bʀɪᴇɴ it could be disabled for now until it's fixed
 
Jakube's Pyth answer doesn't do the indices either.
That's a really annoying extra
 
Do we have a quine polyglot challenge?
 
3:43 PM
Yes.
 
17
Q: Write a Polyquine

Martin BüttnerA polyquine is both quine and polyglot.1 You are to write a quine which is valid in at least two different languages. This is code golf, so the shortest answer (in bytes) wins. 1 I made that up. Or rather, Geobits did. Apparently, he wasn't the first one either, though. Rules for Quines Only t...

 
It would be nice if there was a while version of g.
Having to use blocks will make this many bytes longer...
 
How would a while version of g work? How would you separate condition from body?
 
I meant more that it checks at the beginning of the block and not the end
But other than that it works exactly alike
Does Invalid slice size mean that the slice size is larger than the array?
 
3:47 PM
Just a check if the topmost stack item is non-zero?
 
@Dennis Yes.
 
@quartata It means that either the slice size isn't positive or you're not using TIO.
 
I'm running it locally.
I'm not sure how I ended up with a negative slice size...
Oh maybe it's 0
 
If you run it locally, 2,3ew will still say invalid slice size.
Unless you downloaded the latest source code and built it yourself. Which is what I did for TIO.
 
0
A: 1-up your average quine

Cᴏɴᴏʀ O'BʀɪᴇɴY, noncompeting, 6 bytes UCn*px Y is a headcannon that I've had for a while, and this inspired me to write it. It is made for challenges in which sequencing is key, such as this. The code is divided into links by "node" characters. In this case, our code is put into two chains (originally), w...

 
3:57 PM
Links? Chains? That syntax sounds vaguely familiar...
 
I got the word "link" from Jelly explanations, and chains from my original idea.
 

« first day (1844 days earlier)      last day (2985 days later) »