« first day (3905 days earlier)      last day (1034 days later) » 

12:02 AM
It's weird how if you use a debugger and set a breakpoint, a run will fail on an indention error that occurs after the breakpoint. I should know this, but I guess any script is instantly parsed in its entirety when run and checked for syntax errors right off the top. I guess I know that but not the inner workings of what actually occurs.
 
12:50 AM
cbg
 
cbg
 
 
3 hours later…
4:14 AM
My jupyter can't seem to detect the environment even with this python -m ipykernel install --user --name="data_science"
 
4:30 AM
Realized I messed up something with the path variable
 
 
1 hour later…
5:34 AM
hello
I found a Question..

Jazzy is good with bowling but is not good with studies. His mom wants him to focus on studies too and for this she has found an interesting way. She has brought N packets of balls which may or may not have the same number of balls in them. The balls in a packet are arranged in a linear manner and Jazzy wants to play with the balls.


She will give the balls to Jazzy only if he can tell the maximum number of moves required in which he can get to play with all the balls. There are few conditions though:
I was trying it Like this.....

packets = int(input())
balls = list(map(int,input().split()))
# print(balls)
move = 0
res = 0
for i in balls:
    if i == 1:
        move += i
        # print(move)
    elif i % 2 == 0:
        move += 1
        res = i//2
        move += res+i
        # print(move)
    # elif i % 2 !=0:
    #     i = i-1
    #     move +=2
    #     res = i//2
    #     # print(move)
    #     move += res+i
    #     # print(move)
print(move)
but How can i break it for Odd Numbers? thats a Confusion.. Can anyone help?
 
6:14 AM
@erotavlas No you don't need to infact it works better together using jwt tokens to keep track of everything and on the react side ensuring that it refreshes whenever needed and removes said token once needed... personally I found it best when using react with flask to keep them completely separated where possible and just use flask to serve json back to react when called on
 
@Kwsswart can you tell me How can i break the odd numbers in equal group for the above question
 
6:30 AM
surely one you have them down to all ones you don't need too break it more? in which case within odd take the first one as a first more and then follow the steps to separate into equals until you have all 1s and then you count all the steps required to get to that point along with the amount of 1s you have and thats the maximum moves?
unless I misunderstood
 
yes , i have to Break it down until 1 ,, for each break it will count 1<< I have to calculate the Move..
like if user give 2 input as a packet of ball
and the 1st Packet has 6 ball and 2nd packet has 1 ball,,,

then for the 1st Packet :

move 1 = 6 is broken into 2 + 2 + 2
move 2,3,4 = each 2 is broken into 1
move 5,6,7,8,9,10 = then each one

So for 6 balls total move = 10

and for the second packet Move = 1

so the output is = 11
 
 
3 hours later…
9:22 AM
Style question: do I put argument parsing right inside if __name__ == "__main__", or do I define a main() or something just for this purpose?
 
I usually have main take proper arguments; the CLI is parsed either inside the __main__ guard or a separate helper if it's too lengthy.
 
Excellent, thanks. I want to put it directly in the guard and it's not too much code. I just didn't want to Do It Wrong.
 
 
4 hours later…
12:55 PM
Moderate success: I have access to all six tables that I was trying to extract from this data file. The result is human-readable, albeit weirdly structured. dictionaries with sequential integer keys starting from 0, that kind of thing.
To use this data for actual practical purposes, I must now shave one hundred yaks.
 
That sounds like a pretty lame sidequest.
 
1:13 PM
I feel like the world will soon run out of unshaved yaks if you keep going at this rate
 
Sustainable yak wool farming today!
 
On a global scale my actions are yak-neutral, because a shaven yak gains a 10% efficiency boost to all activities, including producing more yaks.
Unfortunately Lamarckian evolution turned out to be bunk, so their offspring will be hairy
 
1:32 PM
morning cabbages, folks!
 
1:53 PM
cbg
 
 
2 hours later…
3:52 PM
Thinking about a reverse-compiler that could turn low level languages into high level ones... But what Python statement should goto translate to?
 
Dynamic code rewriting + exec
 
@Kevin sys.exit
There also python-goto
 
What about comefrom?
 
Can always do it with coroutines...
 
4:17 PM
Maybe something like,
"""
0. set x to 10
1. display "x bottles of beer"
2. decrement x
3. if x > 0, goto 1, otherwise proceed
4. display "we're out of beer!"
"""
#objective: translate the pseudocode in the above block into valid Python.

i = 0
while True:
    if i == 0: x = 10
    elif i == 1: print(f"{x} bottle(s) of beer on the wall")
    elif i == 2: x -= 1
    elif i == 3: i = 0 if x > 0 else i
    elif i == 4: print("We're out of beer!")
    else: break
    i += 1
Finally a good use for pattern matching
Bonus: you can rearrange the order of the elif blocks for maximum obfuscation
Like alphabetization? 3-4-1-2-0 is your guy
 
What am I missing? That would be valid python without pattern matching?
 
Yeah :-D
 
That's one feature that I really haven't paid any attention to, but I'm not seeing anything odd in the code
Ah, sorry, I guess your point was that you could make it more concise if you used pattern matching?
 
Yeah. But not that much more concise. I found it amusing to damn it with faint praise
 
5:12 PM
My apologies for ruining your humorous take on the feature :/
 
That, too, is part of the performance art that encompasses all my lesser works
I make a low effort joke, the audience doesn't get it. It is an allegory for the mortifying ordeal of being known. The meta-audience goes wild.
I imagine the meta-audience is a group of aliens watching me and my peers from their flying saucer. Or perhaps they're extradimensional tourists standing a foot away from us in the Qth direction. Or they're historians in the far future, observing with a time-looker-backwards tube.
 
i.e. web.archive.org
the tubes are the internet
 
archive.org will be a very important part of the past extrapolation engine. It will also derive all universal constants by measuring a piece of fairy cake
 
5:32 PM
Especially important from when kevin.archive.org launched in 2035
 
I feel that aliens will look down on my performance in all of this :'(
(I also really want to make a stupid joke about how they'd always be looking "down" on Earth because they're in space, but then the concept of down doesn't even exist. I have the component parts, but I can't fit the lego together)
 
Founded in 2033; Engulfed the planet in grey goo in 2034 Dec 31 23:59:59; launched itself into space 2035 Jan 1 00:00:00, leaving creatures and objects unharmed save for "one very uncomfortable second"
Like seaweed getting caught on your toe, extrapolated to every nerve in your body
@roganjosh The aliens round all of us down to "primitive apes" regardless of our personal ability, so don't worry too much about impressing them
 
I don't want to be a rounding error :(
 
The future historians, on the other hand, like to select a single human as their fave, and tend to have a very sympathetic view towards them
 
You never know, I might be the one on Independence Day that just manages to overflow their unit of measurement and save the world. No need for this spaceship silliness
 
5:45 PM
Your superfan never looks down on you because they have seen all the extenuating circumstances in your whole life that led to this moment, and every moment
 
I wonder if aliens still have Agile, Scrum and code reviews...
 
"Well obviously he wouldn't parse Kevin's lame joke right away, if you take into consideration the burrito he had in 2018 that altered his gut flora, reducing his magnesium intake efficiency by 0.001%"
 
"I just tried to launch the plasma cannon to obliterate this.... Earth. But I got this weird error <that they don't bother to post>"
 
Darn you AlphaCentauriCoder9
 
Quite the rascal. At least their incompetence spares us for another day
 
5:53 PM
What are we planning to do here, build an intergalactic highway?
 
Pray that a super-intelligent alien race shares our societal deficiencies in understanding and fixing problems, so they don't blow us up? I'm not really sure. But I could probably package the theory and become a Futurist and get on TV or something
 
My plan is to engulf the earth in gray goo so I can scan a backup of everything, in preparation for when AlphaCentauriCoder9 fixes his plasma cannon driver issue.
His plan is "obliterate this 'Earth'". It may or may not be part of a larger plan, such as "build an intergalactic highway", or "obliterate things that I simply don't like", etc
 
Well that's just rude. It clearly states in the Galactic T&Cs that we need fair eviction warning and compensation first. AlphaCentauriCoder9 just doesn't respect boundaries. They're on my watch list.
 
Loose cannon for sure
 
I'm now gutted that "I just tried to launch the plasma cannon to obliterate this" wasn't "I tried to scrap this planet, but..." :( I missed a trick
 
6:05 PM
ACC9: "I'm trying to scrap this planet..."
Galactic SO: "Surely you mean 'scrape'"
ACC9: "Nope :^)"
"Oh, too bad, we have a nice dupe target for scraping: 'how to I scan the Earth with gray goo?' by primitiveApe953482"
 
To be fair scraping would affect us similarly
"I scraped off a few kilometers of crust and now my apes are gone, help"
 
@ParitoshSingh kevin is elon musk 2.0 :)
 
But I would go down with a marginally wittier comment to my name. Perspective, Andras
 
Musk wishes he were Kevin Private Alpha
 
^ mhm
 
6:08 PM
It's a gentle scrape, like a pore strip you can get for your nose. Just, on every part of your skin at once, and also your inside surfaces
Your lungs will never feel as clean as right afterwards
 
I hope it scratches that itch that's been in there for 12 years
 
When I was a teen, I stole a blackhead strip and put it on my nose. I think it's the only time that I've really laughed and cried at the same time. It went horribly wrong and started taking skin off my nostrils when I removed it, so I had tears flowing but couldn't help but laugh at my own stupidity. That's when I really turned away from scraping
Count me out of the alien scape, plz
 
"stole"? Sounds like just deserts then :P
 
From my mother? Does that make it better or worse?!
 
hmmmmm
you got me there
 
6:31 PM
If my memory serves, that's around the time I cauterised my lip, too. We always had open fires and in winter, we'd buy coke instead of coal. When that's hot enough, I could leave the poker in the fire to the point I could actually bend it. That was great fun. Until the time the dog walked past me while I was crouching and I fell backwards, and it hit my lip. There was a lot of smoke as it hit my face and I'm lucky to not be branded by it!
On reflection, I'm not sure how I made it to be an adult.
 
Life, uh, finds a way
 
The meta-audience demands your continued presence
I wrote a quine that runs in both Python and JS, but I'm disappointed that I had to resort to eval in order to avoid NameErrors from e.g. Python trying to resolve console.log.
 
you beautiful crazy person
 
If only the two languages shared a common syntax for short-circuited ternaries, I could have just done print = console.log if is_js else print. But alas.
 
Genuine question; that's Python? How does the JS run? I've tried to de-minify it
 
6:40 PM
If anyone can figure out how to make Python and JS both print "Hello world!" using the same source code, and without using eval, then you will have surpassed me
 
@roganjosh its js! or python! just squint as you see fit
 
there's probably a corresponding challenge over at Code Golf
 
If by "how does the js run" you mean "what are you using to run the JS?", I'm using Firefox's web developer tools' Console panel.
 
@roganjosh it's a polyglot quine
look up the is_js = assignment: python and JS will give you a different result there
 
I... didn't know this was possible. At all.
 
6:43 PM
Well I've seen dozens of single-language quines and I still don't believe they are possible.
 
5 mins ago, by Andras Deak
you beautiful crazy person
this applies.
 
If you're asking "how can running this in Python cause it to open a javascript environment and run it there too? I don't see subprocess or anything in here", then I may have described the program's behavior poorly
 
That's what I'm asking
 
It's like airplanes to me. I know they can fly (I've seen it), and I understand some of the physics. It's still impossible.
Floating is allowed, though. Ships and blimps are OK in my book.
(sorry guys for reinforcing "primitive ape" prejudice in the aliens)
 
Neither programming environment runs the other one. The program just does simple operations on a string and produces some output. The output is the same whether you run it from Python or from javascript. The output also happens to be identical to the code.
I am still like a little babby compared to github.com/mame/quine-relay
 
6:47 PM
I think my mind is a bit blown atm
 
@Kevin It doesn't have to be a quine? Easy.
 
The more I look at it, I think it's just because it's minified that's confusing me, so it's more akin to a golf problem
 
@Aran-Fey Nicely done. I award you the gold medal of excellence. Now, the diamond medal of excellence awaits whoever can do it without eval or comments.
 
oh thats brilliant
 
And we'll progress up the "medals made of rare materials" ladder until we run out of cool tricks. Diamond, emerald, unobtanium, printer ink...
 
7:03 PM
Here's a slightly less minified version, now with newlines. ideone.com/yfyXOE
 
this was where had ended up, though i took a lot longer than aran and disqualified myself from the diamond medal :(
 
I also award you the gold medal. I brought multiples.
 
yay. this is where i mention i thought i had done it with the // operator, and it took me a while to realise that was just a comment in js.
i.. suppose i shouldn't be doing this without knowing much of js at all :P
 
Hehe, I ran into that when I was trying to find a good arithmetical expression for is_js. "what the... 1//2 in JS evaluates to 1? Is it rounding up?"
After trying 4//4 I determined that it was not rounding up.
 
It says a lot about JS that you'd have believed if it were rounding up.
 
7:16 PM
In JS, (-3)%2 gives -1, so I'm willing to believe that it does all manner of weirdness with integer operations
I believe that's also how it works in C, so I will at least concede JS is not a lone crackpot in this regard
 
JS doesn't even have integers
 
js is weird in some aspects, like, why 3 equal signs instead of two like other languages? but to each their own i suppose
 
@Aran-Fey I try not to think about that too often.
 
@Jminding I think they also have 2 and it means something else. Difference between is an == in python, or close, I think.
 
@Jminding because they dont have an is really. they have a two equals, and a 3 equals because they have a two equals.
 
7:20 PM
lmao
 
i guess someone thought more equals better...(har har har)
 
== does do implicit type casting, === doesn't. At least, I think
 
=== is approximately as weird as our is, although they do somewhat different things
 
i think youre right
 
@ParitoshSingh -_- lmao
 
7:22 PM
Hmm, 1 == 0 == f() is short-circuited in Python, but not JS... Maybe I can use this
Now, if I can find an operation that's short-circuited in JS but not Python, I will become all powerful
 
The NameError would prevent the message anyway in python :P
 
If I could try-catch in both languages, I would be happy to do code path control using NameErrors. But alas.
 
yeah, im struggling with try catch as we speak
 
Anything that involves indenting or colons is going to be quite an obstacle, possibly impassible
 
i tend to agree. python uses colons just about everywhere though, which makes this surprisingly tricky
 
7:33 PM
I have a feeling that, even if we figure out how to write this quine without eval, we still won't have turing completeness. You can do string manipulation without loops and branching, but arbitrary computations? Perhaps not.
 
you really should look at the tag on codegolf
although most challenges (especially quines) probably don't involve polyglots
 
though we're not even after quines anymore, just as simple as possible, but polyglot
 
Well, I usually like to reinvent the wheel myself, but I feel like I've put in the old college try here, so it couldn't hurt to give a peek
 
there's no guarantee that you'll find anything anyway
 
aye. also kevin false == test gives a referenceerror in js.
which puts a real wrench in things. even if you used a short circuit logic, apparently js isn't cool with just about anything
but anyways, here's an expression for the shortcircuit. (""!=(1==0)) you may ..ahem..recognize it somewhat :P
 
7:39 PM
No such thing as plagiarism in code golf
 
ooh, theres a polyglot tag in codegolf also
ah ofcourse yikes, they'd all end up using comments :/
 
one of the most epic PPCG answers I've seen is codegolf.stackexchange.com/a/65643/45297
 
I don't begrudge them using comments, as my own rules are arbitrary and always changing
@AndrasDeak Reminds me of codegolf.stackexchange.com/questions/11880/…. Ironic that the highly upvoted answers in code golf tend to be super long. What happened to their appreciation of concision? ;-)
 
@Kevin so much content and no gameplay video :'(
 
i think i'll take a break from this, but that was definitely fun to try and explore
for now, i admit defeat
 
7:50 PM
I award you the gold-plus-one medal of valor
Not as good as diamond, but one better than gold
 
8:00 PM
Main is back to not remembering that I clicked their pointless banner on another tab so it won't go away even after a refresh :/
 
1 == 0 == Object.defineProperty(window, 'print', {value: console.log, writable:true}); is a no-op in Python, but assigns console.log to the name print in JS. Useful, but I'm not sure how sporting it is to touch the window object, which isn't necessarily present in non-browser JS environments.
 
Ah, I was completely wrong about the NameError earlier; short-circuiting tripped me up even though we talked about it.
 
Perhaps you were thinking of JS' permissive attitude towards missing attributes. In Python (1).blah crashes with AttributeError. In JS, it evaluates to undefined and continues as normal.
 
no, I merely forgot about short-circuiting entirely
 
Unfortunately you still can't do (1).foo.bar. I guess the undefined singleton(?) goes out of its way to raise a TypeError when it is getattr'd
@AndrasDeak Ok, makes sense
 
8:11 PM
for a certain value of sense :P
 
The historian watching you from the far future, thinks it's perfectly rational behavior
 
The MisterMiyagi who just wandered into the room wouldn't go so far as to think that.
Transpiling to JS?
 
 
2 hours later…
10:10 PM
Hey guys, I am developing a password encryptor and wondering how it is flawed security wise. The idea is you keep your original passwords, "Dog, Cat..." on your device and keep the password encryptor on a USB. A hacker would need both your device and the USB to get your password. How can this be hacked?
 
Why do they need access to the USB? Unless you implemented your own encryption algorithm, having access to the source code hardly makes a difference
 
"keep your original passwords on your device" already sounds scary
Or you mean encrypted passwords on your device, and decryptor on a USB?
 
I'm not an expert, but I think "all" an attacker can do is attempt to brute-force the correct key you used for encryption. The difficulty of this can range anywhere from "super easy" to "nearly impossible" depending on the algorithm(s) you used and how many rookie mistakes you made
 
@CalebHaywood why would they? What if your USB device just did Rot13 on the password?
Presumably you have something more sophisticated... but what is that method?
 
anyone willing to help answer a quick question on multiprocessing module?
 
10:19 PM
@Elysiumplain hello. Just ask your question and we'll see.
 
yeah i just read through the rules and messed up already :D sorry all.
 
No problem
 
no worries, you're already ahead of most of our visitors
 
I have the same codebase - using multithreading module. running as a packaged binary (pyinstaller) executed without issue. launching from terminal pulls up the very well discussed pickle error (due to auth string as part of multiprocessing.Manager object).
launching "from terminal" is not interactive terminal - but python doit.py
 
Is this windows?
 
10:24 PM
*nix
although,
 
OK, go on
 
I got here by trying to convert codebase to work on Windows more strict Processes
but we'll exclude that for now as out of scope
 
But it doesn't work on *nix, apparently
 
binary on nix works
compiled into a single exe
 
I find it curious that the same code works as a binary but doesn't work when directly executed.
especially for something like an unpickleable object with multiprocessing
 
10:26 PM
question is what is happening in the bin package process that would make the otherwise "can't pickle" objects... suddenly picklable?
 
Any chance the binary version is actually running on 1 CPU core?
 
Can anyone help me out in flask here
 
like multiprocessing magically being replaced by multiprocessing.dummy
 
@jerrizzy Possibly. What is your question?
 
@jerrizzy assuming this is about your new question, please don't ask about it here for 2 days as per our rules
 
10:28 PM
If it's the question you asked recently on main, then no
 
@AndrasDeak EG: it's actually the same, just never hit's the fault that pickle is trying to prevent?
 
I have to wait 2 days until I can ask about it? Is that a general rule for stackoverflow chat?
 
No, each room has its own rules
 
You are free to read our rules. In any case, I can answer your question and it has nothing to do with flask
@app.route("/")
def main():
    return render_template('app.html')
That's it - game over. You hit a return. Nothing under that will even be run
 
@jerrizzy specifically our local rules if you read the link I edited into my last message
@Elysiumplain "EG"?
sorry, I guess I don't understand the rest of the message either. Can you explain?
 
10:32 PM
@AndrasDeak for example (EG:)...sorry first time in chat. Looks like i accidentally edited instead of appended to existing message.
 
Copy was unaware of the rules
 
The passwords you use are the encrypted versions of "Dog, Cat...". The "passwords" you save on your device are "Dog, Cat...".
 
@jerrizzy no worries
 
@CalebHaywood I asked you how they were encrypted, though maybe not directly enough
 
10:34 PM
@roganjosh I’m aware of the issue and couldn’t figure out how to bypass it but I’ll come in 2 days then
 
So if multiprocessing is actually threading in the binary then there's no problem: multiprocessing's pickle issues are there because independent processes can only generally communicate using serialization. If there's no interprocess communication, there's no pickle.
 
A randomly generated list of 2-3 character long letters
 
@jerrizzy move the return?
 
@jerrizzy the idea is that you'll probably have gotten an answer by then. If you don't, you're welcome to ask :)
 
Here is an example...
 
10:35 PM
@AndrasDeak if indeed this is only executing on a single processor - I've wasted my life programming multiprocessing modules that in practice aren't being utilized...hahah!
 
Input: Dog
 
Makes sense @AndrasDeak thanks for clarifying
 
Output: 6NL?qN
 
@Elysiumplain sounds easy enough to find out. Change the code to something CPU heavy (like a while True: pass loop) and see how many cores spin up on your computer.
 
@jerrizzyour rules state that you should wait 48 hours, but I'm just going to vote to close that question btw. It's nothing to do with flask. You're misunderstanding python itself
 
10:36 PM
@CalebHaywood Examples are pointless. Just tell us which encryption algorithm you're using.
 
So I'd rather tell you that here @jerrizzy
 
D = 6N, o = L?, g = qN
 
actually, I can't get my CPU to work with while True: pass... hold on
 
hmm, now I have an answer to review too
 
@CalebHaywood What, really? A substitution cipher? People figured out how to crack those ages ago
 
10:38 PM
@AndrasDeak i'm running on a Pi3b+. Looks like specs are quad core, so I doubt only quarantined to single core. Let me research a way to confirm which core a pid is executing on.
 
Rule #1 of crypto: Never roll your own crypto.
 
@Elysiumplain yeah, checking pids works too. If there's no other python running then just ps auwx |grep python or the like should only give you n > 1 pythons executing your project if there's multiprocessing going on.
(assuming raspbian)
 
never said I was an expert @roganjosh Is it a bad thing to not understand and ask questions?
 
printing os.getpid() for each worker could work too
@Elysiumplain but don't let my proactiveness fool you: I barely know what I'm doing. I just know that your premise sounds fishy.
 
@jerrizzy I never said I expected you to be. Asking questions is exactly the right thing to do, but you've mis-attributed your issue to Flask when it's really just the way python works. I've broken our rules and made an exception to try and help you because it's clear to me that you're putting in effort
Once you "hit" a return, that's it. The function is over. By "hit" I mean, think about how that request flows through your code; as soon as you get to return well, that's what the frontend gets. If you follow your code through, you'll see that it immediately ends with a return
 
10:49 PM
@AndrasDeak htop tree mode is my usual go-to...but not certain if any way to check WHICH core it's running on. (I'm executing within tmux, fyi...not sure if tmux forces child-processes only to same processor?) Looks like only a single pid per ps auwx
 
@roganjosh This is a trickier version of the same problem: unconditional return in a loop. I don't know if this would help @jerrizzy realize why this won't work.
 
Reminds me of the good ol' times when I was writing a Quake 3 mod in C++ without having a clue how pointers or function parameters worked
 
@Elysiumplain doesn't matter. Either it's threading (in which case there's only 1 process) or it's multiprocessing (in which case there are multiple processes).
the fact that it runs on multiple CPUs is just a combination of multiple processes plus OS load balancing
 
@AndrasDeak it looks like the grep is why - there's only one with python returning - but htop has many pid as child processes
 
hmm
I don't understand the underlying technology to be convinced either way. But I am pretty sure that objects don't magically become pickleable due to pyinstaller, so I still suspect shenanigans.
 
10:54 PM
I wouldn't be all too suprised if PyInstaller automatically rewrote multiprocessing code a bit. Maybe selects a different spawn method or something
 
http://i.stack.imgur.com/49TcN.png
PID963 is parent Module. below them are all spawns
 
@roganjosh and I’m respecting the rules. By closing the question thought you meant closing my post with the question so that’s misunderstanding. Thanks for your help either way
 
that seems like way too many child processes for a pi, but again I'm not familiar enough with any of this
 
@AndrasDeak there's about 11 on avg. isolated sensor integration with parent class managers to handle dynamic spawning of modules which pass up-stream to multiprocessing.queue()'s
 
Are these tasks CPU heavy?
 
10:58 PM
@jerrizzy the question, as is, should be closed (and the answer you got is somewhat odd). SO is really to try make a Q/A that will be useful to others. The rules in chat are enforced by room owners, and I've waived them here (to an extent). Are you ok with the idea that return will break out of your function?
 
@AndrasDeak cpu avg ~5-15% so no. mostly memory based.
 
Are you sure you need multiprocessing, then?
OK, 15% x 11 would be too much I guess
 
@AndrasDeak hey....it was handed off to me :D
@AndrasDeak multiproc is more for handling queue overload delays.
to prevent single queue "lockout".
 
Sorry, I don't understand that either. But that's probably my fault.
 
@AndrasDeak tldr; they have their use case...under the assumption multiprocessing is being utilized as I understood it to be (unlikely, haha)
 
11:02 PM
Just so we're on the same page, I'm contrasting threading and multiprocessing
#from multiprocessing.dummy import Pool
from multiprocessing import Pool
from os import getpid

def printpid(*args):
    print(getpid())

def pool_pids():
    n = 4
    pool = Pool(n)
    pool.map(printpid, range(n))

if __name__ == "__main__":
    pool_pids()
MCVE ^ to test in situ that pids are different
(just because I wanted to follow up on my own suggestion)
 
I'm only seeing this one on problem class...which is leading me to believe that this is more likely some miscategorized error resp
 
Well you can always try making the unpickleable object pickleable. But I'd still want to figure out why it "works" through pyinstaller.
 
@AndrasDeak I've been trying...making it pickleable basically means rework architecture since from testing the source of pickle failure is the AuthenticationString object (built-in from multiprocessing.Queue() ) :(
@AndrasDeak running creates distinct sequential PIDs. let me add a delay before they die and check what it looks like on htop also
 
@Elysiumplain if you mean your real code, that's enough for me. If you mean my code, yes, it does. And if you use multiprocessing.dummy instead, you get 4 times the same PID. Hence proof.
@Elysiumplain I'm a bit surprised that a multiprocessing built-in doesn't support multiprocessing. Are you sure you're not doing something weird, like trying to pass on something to workers that's not supposed to be passed on? Something in the global namespace that should not be there, perhaps?
 
oh - so that's what multiprocessing.dummy module does...thanks!
 
11:09 PM
(I'm running out of vague ideas which is probably a good thing)
@Elysiumplain multiprocessing.dummy keeps the multiprocessing API but switches to a threading backend.
If I believe your error and if I believe that the binary works without the error, then there are two main explanations I can think of:
1. pyinstaller magically makes your class pickleable
2. pyinstaller magically replaces multiprocessing with threading.

We can probably agree that the first one is not too likely.
I don't know your code and I don't know pyinstaller to be able to tell whether the child processes you see in htop are what they seem. If there are exactly as many as you'd expect from your code then that's also enough proof I guess.
 
@AndrasDeak yeah i'll run your test code in tmux and check everything looks kosher first before digging some more and coming back
 
2. would be pretty disturbing too
 
@roganjosh well what Elysiumplain sees is disturbing to begin with
 
I have little certainty that I wouldn't be at fault here - but I too have run out of ideas for testing what's truly going on here.
 
@Elysiumplain sure thing. I just figured it's easy to inject such a print or PID logging into your real application. I don't know how much of a hassle it is to build a new binary.
 
11:15 PM
Occam's Razor tells me there's a mistake on that side
I can't think of any example, or, more importantly why multiprocessing should become threading. This is last-resort conjecture, surely
 
100%
 
@roganjosh Not threading. multiprocessing.dummy :P Conjecture for sure. And last-resort in the sense that things usually break when you package them as binaries, not the other way around, so the weird is a given.
 
but I do like the idea of dumping the PIDs, or writing to a map to distinguish which modules spawn what processes...for debugging at least this is good idea
 
There's always a possibility that Elysiumplain did something dumb during the pyinstallerification, but that's hardly something anyone else would be able to tell without knowing any details
 
I spent a very long time finding out how to utilize that utility in the first place...what gives me confidence, is the binary successfully writing results to DB.
 
11:20 PM
Plus I wouldn't be able to help with the pyinstaller misuse... I'm kind of the lamp post here.
 
I can't really help with binaries either, but I'm gonna go with a stray comma as the safe fallback. 3 quatloos on a stray comma
 
How?
 
<no idea what I'm talking about>
 
ah :P
bold move, Cotton
 
It'll pay off... some day
Mostly in the "BAM, suddenly a tuple" case. But I'll try...
 
11:29 PM
@roganjosh return statement is where my function ends or where the code flow stops is understood
 
In which case, you'll know that if request.method == 'POST': doesn't run?
 

« first day (3905 days earlier)      last day (1034 days later) »