« first day (2919 days earlier)      last day (2012 days later) » 

12:01 AM
I guess you've seen this trick for slicing a sequence into equal sized chunks: zip(*[iter(seq)]*size). If the last chunk is too small it gets lost, but you can use itertools.zip_longest instead of zip to pad it to size.
 
12:32 AM
@user2357112 I hammered stackoverflow.com/questions/52788324/… But feel free to add better targets, if you can find ones that don't have misleading stuff about mutability.
 
@PM2Ring stackoverflow.com/q/52786871/10255652 this was 2nd attempt incorporating iter
 
12:54 AM
@vash_the_stampede I'm a bit too sleepy to figure out exactly what the 2nd half of that code's doing (and I'm on my phone, so I can't run it ATM).
 
@PM2Ring no worries
 
The top half works, but doing a brute-force check of every subset is pretty slow if there are a lot of items.
 
@vash_the_stampede The OP's question is pretty unclear, they need to clarify it. See my comment there are about the value 1, many-to-one, binary-search etc.
 
In the worst case, you may not have a choice but to do that brute-force search. But usually there are shortcuts.
Check out the Wikipedia article on Bin Packing, and The Knapsack problem.
 
Values 1,2,5 all have multiple matches to words. >5 are distinct words.
 
1:00 AM
each one represents a different item
 
In that question you have various shortcuts, eg that huge 1st item that must be in every subset with a valid sum. And you have multiple items with the same number, eg 1, so you can save time there.
 
@smci to me it seemed clear they were poisitionally linked where each item is linked to the item in the second list by position
the fact that so 1 at this index is different than 1 at that index
just doesnt work for a dictionary
 
Eg if there are 5 items of weight 1, and you have a solution that uses 3 ones, then you instantly have 20 combinations of those 5 items that will give you those 3 ones,
 
not its like this from how he describes [1, 2, 1] [a, b,c ] the one at index 1 is a the 1 at index 2 is c
they are positionally linked tbh now i should have just paired them by index to avoid much issues and used the indexes to correspond them smh
i could have zipped the idx' sfrom list one with items from lsit two then when i convert tthem back use the idx from that tuple oh gosh could hvae saved a ton of time
 
@vash_the_stampede That's reasonable, but didn't you say there's a mismatch in the list lengths? I guess the final 1 could be a typo. And a minor typo doesn't stop you from writing code that illustrates an algorithm that finds the solution(s).
 
1:07 AM
@vash_the_stampede Clearly they're associated by position. What's unclear like I noted in comment is whether/how OP expects solutions to handle the many-to-one association. Do they want code to generate all possible combinations for the value 1, ditto 2, ditto 5? only the first match? The OP never said. Needs to specify.
 
he generates the combinations himself in his code
his demo code creates all the combinations he just needed them converted back from the 1, 51, 1 to the linked words
if you print new you will see all the combinations he wants converted they are similar to (10170028, 1, 51, 5, 1 etc)
 
"change the values in the new list to its corresponding value" suggests there's one value (which is wrong). They didn't say "yield/generate the (list/set/...) of all possible values"
 
so he has a list of all these combinations but he wants to change the numbers out for the words they correspond to, I didnt see much issue interpretting that
but each one does have one value
 
@vash_the_stampede Ok well please help retitling the question to whatever captures the OP's intent... it's much more than "matching a value to a list". That title will mislead people. This question is much more specific use-case.
 
for instance in (1, 51, 2, 14) the values appear in order they fall in suff so that 1 is the 1 before 51 if it was 51, 1 it would be the first 1 after 51
yeah i can do that
Match items in generated combinations from one list to corresponding item in another list @smci sound better?
 
1:14 AM
Because several numbers correspond to multiple strings, each group of numbers can correspond to multiple groups of strings. And we aren't sure if the OP just wants one of those or all of them.
 
actually lets just wait
im sure Op will be back soon and he has a ton to answer to
@PM2Ring actually I take back my comments on zipping idx's it wouldnt work , still with original solution
 
@vash_the_stampede "Generate set(/list) of all combinations which sum to specific value"? It's not simple (one-to-one, or even one-to-many) "matching" of elements in a list. We're exploring the sum of all possible combinations.
 
look at how he generates new
he creates these combinations using the total 10170090
so he is creating these list already they are combinations of items from stuff that total 10170090
then he has a list of these combinations and he says My questions is: How can I change the values in the new list to its corresponding value in the list words?
@smci
 
@vash_the_stampede I've been looking at how he generates new for 15 min. It is not ok to write cryptic or plain wrong titles whose meaning can only be decoded by rereading the attached code and mining its apparent intent. Title needs fixing.
 
yeah he should have just said I need to convert my generated list into correlated items in words
Convert items in list to positionally correlated items in another list @smci you think I change to this and fix the description a bit ?
 
1:25 AM
@vash_the_stampede I retitled "Generate all combinations of list elements whose summed value matches given value" but you might be able to do better. Just anything not "Matching values in lists(!)"
 
@smci Look now ? clearer?
 
@vash_the_stampede It's more descriptive, but it's got a couple of grammar errors. And ideally it should be shorter. But as Einstein said, things should be simplified as much as possible, but no further. ;)
 
ahha Einsteins grammar appears not to be his strong point either, @PM2Ring :) heh
 
Muphry's law strikes again. :) My excuse is I'm falling asleep here, and I can barely see this tiny font. Or type correctly.
 
1:41 AM
@PM2Ring Yea, I felt the questions were different, but noticed you basically constructed what the new user was asking for. Either way, thanks for the link to that one answer, bookmarked it for future reference
 
@user3483203 No worries. Between that answer and its linked siblings I think I've covered a fair amount of territory. So hopefully I'll be able to hammer new questions with at least one of them. ;) OTOH, I guess there's still room for subtle variations that deserve a fresh answer.
 
2:22 AM
@vash_the_stampede I can't understand title #6, "Redefine items in generate combinations..." isn't grammatical English, also I don't see what "redefine" is needed for. I suggest rollback to my #5
 
oops should have generated
the only problem with 5 is we arent generating the sublits at all
they are already generated for us
his questions already incorporates generating those list by a sum he solved that part
so it just is renaming those items , I used the word redefine
this post going to most likely get lost in the depths of SO I figure we can wait on OP as it is not of utmost importance
 
2:38 AM
duplicate, what is the target for converting pandas Timestamp to datetime.date?
 
2:54 AM
@smci I'll have to trust you that it's a good target, since I don't know Pandas.
 
 
2 hours later…
4:43 AM
cbg
 
I was just gonna say
check you out @roganjosh quick with the error resolution
 
Not sure what you're referring to?
Also, it's not even 6am here, I just can't sleep so it's totally possible that you're being sarcastic and I'm talking nonsense somewhere :P
 
haah no the youtube question
he provided nothing wanted everything
 
Oh, he's getting a close vote soon
 
and you were quick with the possible reason I was like hey its josh whats he doing here
lolol
im bringing the banhammer down next week
 
4:50 AM
The banhammer?
oyyy, it's too early for Django tracebacks :P
 
video game lingo for getting banned etc, just stretching its use for me closing a post
 
Oh man, Saturday morning is not a good time for answers. I've a feeling I'm gonna lose some rep today :/
 
you tell this cat rogan ahah im dying sort aint sorted slam dunk
and whats up with OP says takes 2 strings from command line easily interpretted as sys.argv which did happen but OP is just using input
oh but actually i think that is what he wants his example just is that far off i suppose
 
5:20 AM
@vash_the_stampede thankfully that nonsense got deleted
 
that was very misleading by OP
 
The question is still there, but the answer from a 1 rep guy saying that Python doesn't even run the code... wut
 
ha what time zone are you ?
 
I'm in Manchester, UK
 
damn I was wondering when you said morning its only 130 am here
im gonna clock out at 2 haha
 
5:24 AM
6:30 here and I'm on my second brew
Brew being a cup of tea
And not the iced kind, which dares to even call itself "tea"
 
rogan you see that json question you are on right now with the indent suggestion
 
yes
 
lol look at OP's for loop where we loops through and remakes the dictionary every time
hahahah
good thing whoever presented that solution killed two birds in one stone, I dont even think Op realized it
and how the hell did he get that print result because no print(dic) prints a sinlge dictionary
 
This is what the OP was trying to conform to
I'm kinda half tempted to have a go at making a library to deal with it
 
5:46 AM
I swear no matter how many times I read about imports in Python, I still don't understand it 5 mins after closing the documentation.
I think there's some kinda intuition in my head that just crushes whatever I did come to understand and puts me back into confusion
 
6:01 AM
Looking at stackoverflow.com/questions/52789644/… and I believe an argparse approach would be better than an sys.argv approach, as argparse has built-in help and is all around more verbose. Opinions?
 
@Scott I think you're probably right.
 
sys.argv is essentially just dealing with a list
 
The question isn't particularly great so you're having to plug some holes in what they're actually trying to do
 
Yeah, the re-input is what threw me as I had to check and make sure. It's certainly homework, and it's very basic at that.
 
That was me :P
 
6:04 AM
Yeah, definitely made me go "Wait, did I miss something?"
I was somewhat expecting a response from OP saying they were unsure what a for loop was. :s
 
It's such a common part of tasks on SO that a canonical was written
The fact that they have the input validation at the end is just baffling but hey ho
 
/me shrugs
 
im outta here see you later everyone
 
3rd cup of tea. Hopefully this will allow me to human again. Hate not being able to sleep and SO can feel like a waking nightmare at the best of times :P
@vash_the_stampede night. Rbrb
 
Hello
 
6:14 AM
Hello
 
Hello
 
1 short of a barbershop quartet :/
 
Ha, I legitimately chuckled.
 
 
3 hours later…
9:45 AM
@vash_the_stampede 1. I told you not to post crap questions here for finger-pointing. I'm getting fed up with all the garbage that regulars discuss here these days, it's unhealthy and depressing. I've yet to reprimand long-time regulars for this, but you're new and you don't get the luxury of my extended patience. 2. please avoid using expletives in the room.
this is also mentioned in our room rules which you should revise.
cbg
 
wim
New emojis in iOS 12.1 .. '\N{BADGER}' was approved as part of Unicode 11.0 in 2018, heck yeah!
 
 
4 hours later…
1:50 PM
please elaborate
 
thats my response to your dictating reprimand :)
 
2:15 PM
:)
 
 
1 hour later…
3:37 PM
The discussion after 25:00 immediately reminded me of some SO exchanges: youtube.com/watch?v=NBVuoe-ZDNo
@AndrasDeak huh, I genuinely missed the swearing during that exchange you've kicked from earlier, sorry. 6am I guess I wasn't paying enough attention :/
 
I trashed it because of the fingerpointing
 
That's a fair call
The swearing was not on my part but I should probably have worked harder to shut the discussion down
 
@IljaEverilä From what I understand, the issue is fixed for the OP now?
 
It'd seem so.
Oh and cbg
 
cbg :)
 
cbg
> The only kind of "too localised" questions we close are typos and syntax errors, since those are of no use whatsoever typically.
I never thought of it that way (source)
 
Really? Why do we explicitly allow typos to have cv-pls tags before the 10 min watershed? (IIRC from what you've said to me in the past)
It makes sense, they can't be of any use
 
4:04 PM
I mean I never thought of them as being modern subclasses of "too localized"
 
Ah
 
weekend cabbage
 
@AndrasDeak coming at me for using sht one time, you have 8 uses of f** 128 uses of sh** and 5 uses of b**** , interesting
youd make a good politician
 
I'm sure that was before we started enforcing that rule.
 
afternoon
 
4:20 PM
@vaultah enforcement just began this year or in September, there seems to be a greenlight for ass in Aug so is that word still on the table?
and countless instances of him ripping on OP I can pull up, not the biggest fan of hypocrisy :)
yet we must filter ourselves to adhere to his source of depression 'I'm getting fed up with all the garbage that regulars discuss here these days, it's unhealthy and depressing'
 
@vash_the_stampede For what it's worth, I've found him to be among the most reasonable of the mods that's also interacting with the room a lot
 
hmm not sure I can agree, that is first time I see such a personal statement when it comes to addressing upholding rules
 
You haven't been here as long as me
You are not the first. I also had messages kicked out of chat from this morning.
 
I never seen a mod or other use garbage and depressing while condescending regulars based on actions that they themselves duplicate
but oh well Im good on this one
i wokup to +100 rep , im in a good mood
 
Then there's no need to sour the day having this discussion :) I can understand your point, but I think it would be better for things between you two to de-escalate a bit. I'm sure we'll survive without swearing and the ability to mock other users for now (I swear a lot in real life, never on SO)
 
4:26 PM
stackoverflow.com/q/52790236/10255652 @roganjosh is this clear to you? I can't tell if he looking for something like a static method or what do you think
 
@vash_the_stampede Not really. The answer by onno isn't great because it's creating an attribute on the Apple class that doesn't exist previously, and the other answer is completely broken. I think the OP may have an XY problem.
 
check out my answer do you think im adressing the question properly
actually i dont even need teh staticdecorator for that
 
Sorry mate,was getting ready to head out and came back to see it deleted :)
 
I wasnt so proud of it, I don't like posting things I myself am not 100% okay wiht saying it represents me
 
@vash_the_stampede I'm informing you about the clean-language policy here (as stated in the rules) so that you may adjust your behaviour assuming good faith in all parties. When I was told about these policies I was pointed to Carlin's Seven Dirty Words as a first reference. Also the fact of complaining about trash questions and lazy askers is fine. To an extent. It becomes a problem when there's more talk about garbage than interesting content.
Hence my original request to you concerning "extensive 'look, low-quality content' sessions". Just to get the terminology clear, I'm not a site moderator, I'm a room owner of this room. The same guys who came up with the rules in the first place. We prefer to discuss suboptimal behaviour with discussions first, before resorting to hard moderation. Hence my warnings to you.
 
4:39 PM
@roganjosh this was my approach, I know he wanted to avoid passing self so I went something like this but overall it seems dumb idea to me so I passed on answering
class Apple:

    def print_my_tree_name(x):
        print(f'Hanging on {x} tree.')


class Tree:
    def __init__(self, name):
        self.name = name
        self.apple = Apple()


a = Tree('test')
Apple.print_my_tree_name(a.name)
 
I'm trying to decide what to work on. I have 3 different projects bouncing around my head: Android, django, and reactjs.
 
@AndrasDeak thats fine no hard feelings
 
@Code-Apprentice Flask :P
 
I do django at my day job so know it in much more detail than flask. And this project gives me a reason to learn about the parts that I don't know so well.
 
How about Pyramid? :p
 
4:42 PM
Ah, fair enough. Well, if my wildcard isn't an option, then I can't pick out of the remaining list :)
I didn't realise there's a Chalice framework until stumbling over a question this morning
 
The chalice from the pyramid has the pallet with the tox
 
@roganjosh I gave it another shot , not sure if the answer is adequate still subject to deletion
 
5:01 PM
Are f-strings evaluated immediately? For example, with format(), I can declare a string foo = 'foo {}' anywhere in my code and the substitution doesn't occur until I call foo.format(42). Do f-strings provide this kind of delayed evaluation?
 
As far as I know, no
 
user6718998
Hi @AndrasDeak . Just wanted to let you know I solved the problem by myself. Thank you.
 
I haven't used f-strings much yet, so I probably should read a tutorial about them to learn what features they provide.
 
@Thewise awesome, glad to hear that :)
 
user6718998
:)
 
5:07 PM
@Code-Apprentice I think the early execution is part of their point, they are fast exactly because they are somehow magicked during compile time
 
@AndrasDeak which is great for many use cases
but not all
 
that is correct
if you use a single format string many times you should probably use .format
 
thanks for the info ;-)
yah, that's kind of what I have in mind. Where the format string can have different values substituted into it depending on how it is used.
Part of the string is constant, but another part of it varies
 
speaking of f'strings
>>> x = [1, 2, 3]
>>> print('this list contains ', *(f'{i}' for i in x))
this list contains  1 2 3
 
yup, I'd probably use .format there rather than build a bunch of f-strings inside many if branches; lot of repetition that way
 
5:09 PM
are there other ways to go about unpacking a list into a string
 
@vash_the_stampede list(map(str,x))
 
@vash_the_stampede do you care about brackets or commas?
 
>>> print('this list contains {}'.format(' '.join(list(map(str, x)))))
this list contains 1 2 3
@AndrasDeak works but maybe a little more work than the f string
@Code-Apprentice printing the unpacked contents into the string with no brackets
@Code-Apprentice >>> print('this list contains {} {} {}'.format(*x))
this list contains 1 2 3
anything similar to this but without using a fixed amount of {} so far the f string method seems like the best option
 
yesterday, by vaultah
print('Example', *i)
like the last time you asked the same thing
 
duh wow these are times where my extra curricular activities reflect on my intelligence
@AndrasDeak again your memory impeccable haha
 
5:16 PM
I reached back into the distant memory of yesterday
 
user6718998
5:54 PM
Has anyone encountered this error before when trying to run a slurm on HPC ? : mpirun was unable to find the specified executable file, and therefore
did not launch the job. This error was first reported for process
rank 0; it may have occurred for other processes as well.
 
sounds clear enough
check whatever is after "mpirun" in your job file and see if it exists and is executable
you may want to invoke python explicitly rather than running the .py file
 
user6718998
hmm it it normal to run within less than a second ?
 
the real question is whether it ran successfully
 
user6718998
yes, checking now
 
on 4 nodes it should be at most 4 times faster
 
user6718998
6:09 PM
It was too fast to be true.. apparently if I use 'mpirun python problem1.py' in my batch file, my image will be generate, but blank
 
sounds like a bug
 
user6718998
well, I will check this with teacher since I deployed it on server and locally runs fine
 
user6718998
thanks btw
 
no problem
 
6:23 PM
please be more constructive
 
7:02 PM
After 2 hours of fighting with GreaseMonkey, I'm glad that this new bug I've been hunting for 10 minutes is only a product of my own stupidity
 
Aren't all bugs? :D
 
No, some of them are caused by GreaseMonkey
bugs love greasy monkeys
 
Ah, I see
 
When I don't know the answer and a user with crazy rep comments something I just upvote his comment and act like I concur... smooth criminal
I think I upvote every comment someone in here writes if im clueless to whats going on ha
the smart people exclusively
 
7:26 PM
what would crazy rep entail? o.o
 
@Jerry the likes of you :)
 
lol, fair enough. I guess though it's due to the amount of time I've been around x3
though I did recently give myself a bit more of a push to learn python, so I'm really a beginner there
 
 
1 hour later…
8:48 PM
@wim apparently that's already available in python 3.7
 
9:22 PM
3K :)
 
wim
9:56 PM
@AndrasDeak yes the unicode data is at 11.0 in python 3.7, but I don't have the glyphs to display them yet.. do you?!
 
@Code-Apprentice I was going to say that was worthy of a question, but: Can I postpone the evaluation of f-strings? although they don't use the term 'deferred'
 
yup
user image
7
 
Shurely `print(f'\N{snake}')`
🐍
 
Ah I see. But still, is the 🐍 mightier than the 🐪...
New user repeatedly crossposts, doesn't provide MCVEs when asked How welcoming should be? Do we explain not to crosspost, and close-as-dupe? What about the MCVEs?
 
10:12 PM
welcoming and educating users are orthogonal properties; you can do both
and yes, self-dupes are even handles specially by the system
I'm not sure what "crosspost" means in that sentence, though
 
@AndrasDeak "self-dupe", then. Anyway I'm not sure how much energy to spend writing comments to them, and knowing I'm likely to be criticized if not welcoming enough.
 
Be nice and then you don't have to worry about being criticized. There will always be people who disagree with you or just dislike you. If you make sure you do things right you don't have to justify yourself to others.
 

« first day (2919 days earlier)      last day (2012 days later) »