@Aran-Fey Just wanted to let you know: We are likely going to push from sockets + homegrown protocol to websockets – once I'm back in the office and can scheme a little. Yes there are all sorts of reasons to stick with sockets, no they do not practically apply.
I have list say marks = [2,5,8,4,6,7,8,34,6,7] and I want to get every alternate value from the list in {2 : '2' , 8:'8', 6:'6' , 8:'8' , 6:'6'} as output. Can someone help me here please?
another thing is that using the Source() class and writing the big string, the order of the nodes displayed are reversed. What to do to get the order preserved? Writing in reverse doesn't seem to be a good idea.
@VisheshMangla open and .read() functions are working. Im trying to read and compare two rtf files, also i wanted ignore some string values while comparing (i dont knw whether i can do that).
df[df["Condition"].str.lower().contains("utility" )] Can someone tell what would be the right code for getting the following? Basically find all rows where a column has "utilility" in it.
df["utility" in df["Condition"].str.lower()], This too gve KeyError
that was obvious after you told me but I couldn't think of debugging it this way. Also jupyter if it is good on one hand at visualizations, it's neither a text editor or ide
Yeah, it's a bit cumbersome. It's like gdb. I prefer pudb, which is a bit like gdb --tui, just with a few more bells and whistles. But if you use an IDE it will have a debugger of its own.
Hey all, I'm trying to improve the MoviePy API and I've got a question about API naming/conventions: Currently the central objects are various types of Clip. Clip has several methods such as .set_fps(), .set_layer() etc. Currently these methods work 'outplace' i.e. they don't modify the object, they return a new Clip with that modification done to it. This causes a lot of confusion because they don't act like you'd expect a 'setter' to.
Is there a better standard that we should switch to? I was planning on renaming them to .with_fps() and .with_layer() etc, but perhaps it would be better to make them inplace? What are the advantages and disadvantages with that?
yeah, there's an interesting talk by Erich Gamma on it, one of the co-authors of the GoF book. He says that it's not an ide and some language server is implemented.
@TomBurrows Yeah I 'll continue to use it atleast as long as it w'd be possible. Getting comfortable to a new ide is difficult
Is there any way to number these as Hot1 , Hot2 and Cold1, Cold2 here-> dpaste.org/jxzu without iterrows? The clipboard has broken the indents
@inspectorG4dget and others: following the room chat, could you take a look through the existing Q&A on [python] _name_ _main_ multiprocessing and tell us which is good/best? Some of those Q&A are Windows-specific, some aren't. Which is best?
@AndrasDeak Thx for janitorial. It was too old to delete
@nerd It's just an unofficial meet of a handful of people from this room, whoever wants to say hello. Today we got 7 people. Last month, 4.
For inspectorG4dget and others looking for a more advanced terminal-handling package e.g. with overwrite, overlay, refresh on a subwindow with arbitrary coordinates: try curses
@VisheshMangla there's no gap. They work very differently. Trying to apply a mental model of one onto the other language will only confuse you. Understand how each works independently.
@AndrasDeak It's entirely a sequitur, and we've discussed it at least 5+ times over the last year. Most new SO users arrive via Google, and the SEO battles from tutorial and other Q&A sites, and worse still often they plagiarize good content from SO and use gray-hat SEO for higher Google listing. So when we find worthy SO content that should be or isn't in the top-10 Google hits for a question, it's worth improving/curating. Or in this case a non-SO site with a canonical that did not exist on SO.
@AndrasDeak I said "Ok but..." to your response to VisheshMangla. (Which obviously means I was saying your response was partially correct but IMO there was something wider you were missing.)
@VisheshMangla please say 'parser' or 'REPL'. ('FSM' means 'Finite State Machine', CS people say 'automaton' instead', CS parser-theory people say 'LR1' or 'LL1' or 'LR0').
sorry mb, but indeed parser's are implemented using FSM
CS and physics has taken maths to unimaginable boundaries that it has almost become impossible to decide what to understand to understand what. These terminologies are mix of various domains
@VisheshMangla I'm not here to argue semantic equivalency, I'm recommending you use the terms that are standard in Python if you actually want to get answers. e.g. to "How does the Python REPL interpret [[1]*5]*5?" (I'm an electronic engineer btw, and I know FSMs very well. But I have no interest in debating the terms.)
@VisheshMangla 'parser'. You can safely assume everyone in this knows what a parser is, what they do, and how they're implemented. This is the Python room, not CS or EE theory site/room.
@VisheshMangla Are you studying CS, CE, EE or what? Dependin on what you're asking exactly, you might be asking about multithreading and synchronization primitives, or how database commits are atomic, or clocks and flipflops in hardware, or lots of other things. (Please give specific example of 'software'). But that's mostly offtopic to the Python room.
@VisheshMangla But what's your actual question? How do CPUs work, in the sense how do we prevent race conditions wrt clock skew in flipflops(/registers) on chips?? How do Operating Systems work in allowing concurrency (multiple programs and multiple threads, some accessing the same data)? etc. All those are offtopic for Python room plus extremely broad, but please see any of the excellent videos/tutorials/blogs/Coursera etc.
The one-line answer is "This stuff is seriously complicated, look at a view from 100,000ft into CPU design, Operating Systems, threads, concurrency etc."
@MattDMo But can you type us some more about your "canonical comment" suggestion? For the second month running, didn't get to hear about your idea...
@smci sorry, my wifi died near the end and I couldn't connect again for another hour
The idea is pretty straightforward. I (like probably a bunch of people) have a markdown file filled with canned comments and useful links. Somebody posts a question with code in an image, I have a comment for that. Homework help? There's a comment for that, etc.
I have about 45 comments for Stack Overflow in general and Python in particular, plus a bunch more for some other sites I'm active on. I have another 20 or so good links as well.
My idea is to make a wiki page that trusted users can use to post their own collections and collaborate on common ones so they have the right tone, content, spelling, and whatever.
For each comment, there'd be the formatted comment first, then the raw Markdown under it so you can copy and paste. You could even have one of those handy copy buttons :)
That looks good, and I may contribute some, but it's meant for use with the auto-comment system, which not everyone may have. I'm thinking more of a direct copy-paste thing.
@smci yes I know it's complicated, how these drivers work and each operating system has its own code so it's difficult to understand them.
I 'm interested in stuff which tells how these small logic gates built up the drivers, how sensors send signal to computers, how is memory stored in magnetic domains, all that stuff . Talking about coursera, I have tried a few physics courses there from University of Michigan, which I didn't feel comfortable with. If you have read some good book, which talks like a human, plz do tell.
@MattDMo Ok, except that isn't straightforward though :) Are those a) open-ended, constructive comments intended to get the OP to edit/improve their question? Or b) politely pushing back on the user like "This seems to be homework(/a code spec), you need to show code and identify an actual specific question" or c) dog-whistle type comments like "This question is VLQ and should be closed, downvoted and possibly deleted?" Many users will assume intent c) or b) and not a)...
...if you look at my history posting on here + Meta, esp. in the last 2 years, a distinct portion of power users regard posting comments as a total waste of time, and another portion think the only point in posting a comment is to get a question closed, often as dupe. They're simply not interested in a question where you have to go to-and-fro with the OP, sometimes over a period of hours or days, to elicit a (specific, answerable, on-topic) question. Disincentivized by SO site changes since 2018
...I'm not starting a foodfight about who is "right" and who is "wrong", I am alerting you that there's enormous fundamental disagreement about why/when SO users should ever even bother posting a comment,a nd their expectation. So, you'll need a longer preamble about what "canned comments" are for and what they're not for.
My reservation is that as it is now you can do clip.set_fps(20).set_duration(10).set_layer(1).subclip(2, 20) all in one line. That wouldn't be possible if the methods are inplace?
I don't think commenting is a waste of time, as it sometime/often elicits responses. Yes, there are going to be those dump-and-run OPs that don't care, but others do. That's why I keep using SO and SE in general.
@TomBurrows For one thing, I wouldn't even want to do that in one line. But I wouldn't mind a method that lets you set multiple attributes at once via keyword arguments
clip.set(fps=20, duration=10, layer=1, start=2, end=20) or whatever
@MattDMo "useful comments.md": it's near-impossible to read with that formatting, isn't rendered by DropBox, and the first paragraph isn't even English. But honestly paragraph 1 line 1 needs to start with "Here is a list of suggested 'canonical comments' for use on StackOverflow, typically in posting on questions asked by new or inexperienced users. Our intent is threefold: 1) for questions which are unclear/ borderline/ irreproducible/ no MCVE, to guide the OP to fix those issues ...
@smci sorry, I didn't realize Dropbox would butcher it like that. Open it in Sublime or VSCode or whatever with Markdown formatting and it'll look a lot better. The doc is just my personal collection of stuff, not a mockup of what the page would look like or say...
... 2) for questions which are off-topic/subjective/too broad, to guide the OP to reformulate them, or at least understand why they're likely to get closed, so OPs know wat edits they need to make to get them reopened 3) for questions which have serious issues and are unfixable, to constructively explain why to the OP"
@MattDMo I don't have Sublime or VSCode. Assume most users's browsers/editors don't have Markdown formatting, or it won't trigger by default, so your list is unviewable for many of us. Can't you just generate HTML? and keep this list in github?
I guess one thing to consider is how you want to handle the start/end time. I believe the current implementation with .subclip() only lets you make clips shorter. So the question is, should there be a way to shift the start/end point in arbitrary directions? And should that return a new clip or also be in-place? And if it's a subclip of a longer clip, what happens if the original clip changes?
Indeed. There is also currently set_start and set_end methods that allow you to set where the clip should go if you are about to put it together into a CompositeVideoClip
We were also planning on using the object slicing methods to map to .subclip calls as well (so clip[2:10:-1] would play between t = 2 and t = 10, but backwards)
Haha, well I've never done this before (and I didn't design the original moviepy api either), so I just want to check that what I'm planning makes sense!
@MattDMo But I still can't make any head or tail of it, it's not a list of 'canonical comments'(?!) Can you totally delete the 'Common Symbols' part, add a two-para preamble of what this is and what it's for, as the first thing in the document; and within the 'Stack Overflow' section add headings, hierarchical section headings....
@smci Yes, that would be the goal if we actually go ahead with the idea. Like I said, this is just my personal file that I keep handy for cutting and pasting if needed. It'll need a lot of work to get it ready for public consumption. I just wanted to give you an idea of the type of comments I was talking about.
...also your choice of comments seems very selective, 20% of what I was expecting to see comments for is (regrettably) irreproducible/"no MCVE"/"your MCVE is a wall-of-code, but the 'M' in 'MCVE' is supposed to be 'Minimal'". Sometimes, generating a short but representative example is nontrivial.
@MattDMo But honestly I think you could make some quick edits like I suggest above in 5-10min. I'll be happy to take another look if you can just do that.
Perhaps one good step would be poll (Python) people on what their "top-3" canned comment list would contain, then write drafts for those 3? Irreproducible/MCVE is definitely in my top-3. I wouldn't even look at anything else until I had a decent (Python) draft for that - which the current, overly language-agnostic SO wording is failing for.
@AndrasDeak You know if you have to ask, it probably isn't. Chuck Norris references are very US-TV-centric, also kinda 80s/90s, people outside in general won't know who he is. Until I moved to the US, I didn't know who on earth he was, but people kept constantly sending me annoying programmery joke emails about some guy attacking water and not getting wet.
...what are other cultures' answers to Chuck Norris: Singham, Jackie Chan, ...
@MattDMo and all: not that our only intent is close-voting, but does anyone have an SEDE query for "All SO questions in Python tag which received close votes in the last 365 days, rolled up both by close-reason and rep of OP (<90, <110, <150, <200, <500, ...)"?
Is there a way to pull a list of custom "Other..." close reasons that users have typed from SEDE, preferably including deleting posts?
I'm looking to propose a new close reason on Hardware Recommendations but can't seem to find the data I'm looking for in the data explorer that I need to proper...
I feel there has been a recent rise in people closing questions they don't like using the "off topic" closure reason. I saw an example today where the closure reason was:
This question appears to be off-topic because this isn't a code-writing service
(emphasis mine)
It received four other...
I am confused. Earlier I could easily determine the reasons, but looking at this question (timeline) I am not able to figure it out.
Which of those below off-topic reasons it was? I am curious and someone else may want to improve his SO-voting skills.
Cabbage! I'm intermediate python coder with possibly some knowledge in advanced topics. I want to toughen and broaden my skills. I know there are uncountable amount of resources out there, but are there any tutorials you can recommend? Bonus if it's interactive or hands-on.