« first day (4317 days earlier)      last day (632 days later) » 

 
2 hours later…
2:35 AM
Hi, I've been trying to use github.com/Mondego/SourcererCC to detect duplicate code between two code snippets.
When I tried running command python controller.py inside clone-detector folder, it throws following error
search will be carried out with 2 nodes
loading previous run state
../Desktop/sourcerercc/clone-detector/scriptinator_metadata.scc doesn't exist, creating one with state EXECUTE_1
previous run state 0
running new command ../Desktop/sourcerercc/clone-detector/execute.sh 1
Traceback (most recent call last):
File "controller.py", line 179, in <module>
controller.execute()
File "controller.py", line 145, in execute
raise ScriptControllerException(
__main__.ScriptControllerException: error in execute.sh script while preparing for init step.
Does anyone have any idea on how to fix? Thank you for your help
 
 
2 hours later…
4:28 AM
stackoverflow.com/questions/11914472/… Someone please do something to fix this question. As asked, it wasn't about either numpy or stringio at all; it isn't reproducible from the example, and appears to have actually been about understanding bytes vs str types. Everyone, of course, ignored this in the answers.
Oh no, wait. Apparently some old versions of Numpy required an input in binary mode for .genfromtxt, despite the name????
 
4:44 AM
Man, a lot of highly voted questions about importing stuff in Python are the blind leading the blind. e.g. stackoverflow.com/questions/20853474 which basically tells OP to try the same thing again
 
5:04 AM
all of them should really be nuked from orbit
as mentioned, I reported that "answer" which was a comment about chromebooks and of course denied
 
We should just have a canonical about making sure that you install whatever it is to the python installation you are using, and redirect all of them there
(I am currently in the middle of writing a QA pair for a "master" question on how to make sure importing will work)
 
5:44 AM
@dhiaagr timedelta is the answer.
 
6:16 AM
stackoverflow.com/questions/32417338 wow, we actually have this! I am pleased.
 
a lot of the time the OP just need to fire up the debugger and literally step through the code
 
To OP's defense, he did provide an MVC along with a clear question.
 
6:35 AM
the debugger is bad at teaching concepts you don't already understand.
 
 
1 hour later…
7:41 AM
stackoverflow.com/questions/4211209 I know we have a lot of overlap, even on highly voted questions, for stuff like this
 
8:17 AM
Okay.
There should no longer be any questions that come up in a search for IndexError, aren't closed, have a score of -5 or lower, that I haven't at least tried to do something about.
There are still 12 that I couldn't close as duplicate, but they're all definitely closable for other reasons.
- oh, hmm, this isn't a static list (even for old questions). x.x
 
8:44 AM
stackoverflow.com/questions/54974579 Is this really the best we have for writing back to a list while iterating over it?
 
8:54 AM
stackoverflow.com/questions/23307154 do we have an award for creative titles :)
 
9:13 AM
@KarlKnechtel I'm not a fan of the idea of iterating and modifying a list. That being said, if you have a better alternative, I would be happy to learn it.
 
Cabbage
 
Cabbage
 
the problem with python list iterators are that their invariants cannot be held solid, i.e. modifications to the underlying list will violate it and thus unsound
saner languages outright forbid it
 
Pretty sure the only guarantee you get from the iterator protocol is that once you received a StopIteration, all subsequent calls to __next__ will also raise StopIteration. And list iterators do that correctly
 
@KarlKnechtel generally, the correct answer is, dont do it this way. having said that, yeah, if you want to modify list contents inplace while looping, then doing it via index is pretty much the way to go.
 
9:24 AM
I only use it as a response from a db orm. Otherwise dicts are my goto.
In fact, I consider dicts to be the best thing I discovered in my whole life. Second only to porn.
 
Cabbage. It's great to see you again, @JRichardSnape!
 
@PM2Ring Hello!!! Good to see you too. I've got a new job, more python, less admin :)
So I've returned
 
@Aran-Fey What I meant was modifying the list while it has any live iterator references to it, all bets are off as to whether the iterator returns correct data or not
remove an item suddenly things get skipped
 
I spotted you in the transcripts, but I have a weird sleeping pattern, so this is the 1st time we're both here at the same time.
 
@PM2Ring P.S. I saw your links to the pages on (legal) time the other day. Still doing your thing and introducing incredibly tempting rabbit holes I see
 
9:29 AM
if the function using the iterator pushes items into the list, the iterator may never terminate
 
Yeah, but as long as the iterator's behavior is well-defined I don't really see a problem
 
aside from it being a huge footgun for newbies because they don't know any better
 
@metatoaster this, sure. any operation that modifies the size of the iterator during iteration will be "fun".
 
@PM2Ring With the current "heat wave" in the UK, I'm no stranger to weird sleeping patterns unfortunately.
 
yeah that's why in sane languages they stop that behavior as that's unsound
 
9:31 AM
@JRichardSnape :) Timekeeping is arguably the oldest scientific activity. You'd think we'd be able to do it right by now...
 
@KarlKnechtel I guess the first answer is OK, although I'd preface it with a big "Don't do this" at the top.
 
@metatoaster Does this mean that in what you call sane languages, you can only iterate over immutable objects?
 
@PM2Ring What do they say, something like "The two biggest challenges are datetime and naming". Probably no coincidence that Jon Skeet has the most reputation points on SO.
<muses> The comment on the top answer to that question changing a list in a loop opens a much more interesting point.
 
missed opportunity there Richard (also hello!). "The two biggest challenges are datetime and naming and off by one errors."
 
@dhiaagr no, there would be mechanism that would check to see whether the list is being used in an immutable way (e.g. have an iterator referencing it), during which it can't be mutated
 
9:34 AM
@IvoMerchiers So I have uneven row values, and if I go from pandas, where we are validating the output, the empty values are just string of commas which we don't prefer
 
which can literally not be done in Python as Python doesn't have any of those concepts
 
@ParitoshSingh I'm obviously out of practice!! (Hi!)
 
Modifying an iterable that you're iterating over is tempting fate. Of course, sometimes it's perfectly safe, and far more efficient than creating a new list. But really, if you can afford to make a new list, you'll save yourself a lot of potential headaches.
 
@roganjosh I am on Mac OS, and prod env is linux based. So when they are running validation over there, it's showing carriage value at the end of line for every row. I can not use pandas because I have uneven rows, and missing values are showing up as commas in final file
 
9:36 AM
sure, but Python does not easily provide a way to keep track of the loop invariants to do that safely
 
@metatoaster Sounds like a tuple, to me.
 
@dhiaagr .... no. In rust, it is impossible to cause this situation by writing naively stackoverflow.com/questions/56500654/…
the borrow checker will have complained already
 
@metatoaster I'm..conflicted. Big part of python philosophy of consenting adults/keep it simple means that i can see why this was probably deemed not necessary to address. At the same time, I dont see why a list shouldnt be allowed to mutate it's items if the need really arises (though being my own devil's advocate: if performance is that critical that this makes an impact, you probably arent using python at that point, and certainly not python lists).
having said all that, mutating container sizes during iteration is a definite footgun
 
there's a whole slew of things that got closed with this thread stackoverflow.com/questions/1207406/…
newbie Python programmers often trip themselves over it
as I said, sure, but make it hard to use the footgun would be a good start
 
9:40 AM
@metatoaster What OP was doing is crazy bananas. As for Rust, I'm increasingly tempted to dive into.
Especially since I learned that it doesn't have classes.
 
@JackDaniels I reckon you need to make a really simple test case with your own made up ragged CSV (maybe three rows long?), run your code on Mac OS, check it's working. If not, post the sample data and the code (an MCVE meta.stackoverflow.com/questions/366988/what-does-mcve-mean ) and people will try it on their machines and help you work it out. Without the MCVE, there's a lot of guessing and time.
 
@JRichardSnape Sure. I'll put couple of rows and update here.
 
I remember giving you the same advice last time. Welp, got kevin'd
 
@JackDaniels Good. If it's more than a few lines - use a dpaste dpaste.org
 
@NordineLotfi If that was for me, I might have missed it. Apologies for that.
 
9:44 AM
No worries :)
@dhiaagr yeah, dicts are great. I only ever use list and dict though, never found a use for tuple (yet). Although I did use bytearray once or so, but that's it
 
@metatoaster I somehow doubt that trading mutability footguns for the borrow checker is a net gain for newbies.
 
Let me cross-check once more with newline = ''. If it produces the same error, I'll update the code here.
 
It's not exactly mutability
0
Q: How can I mutably borrow a vector while iterating over it?

CoolElectronicsI have a vector of Objs, and I need the do_something method to be able to mutate that vector. fn main() { let mut vect: Vec<Box<dyn Obj>> = vec![]; vect.push(Box::new(ExampleObject { my_value: 1 })); for e in &mut vect { e.do_something(&mut vect); } } struct ExampleObject ...

... answer is, you don't
 
"borrow"?
(also, why are we looking at a Rust question?)
 
We were talking about mutability footguns in Python
 
9:48 AM
probably to compare the language semantics to python I presume
 
@NordineLotfi I hear you. The only case where I use a tuple is when one of my functions returns several datatypes. e.g : A boolean value, and a string for redirection*.
 
@ParitoshSingh I understand the material quite well. I am trying to find good canonical questions to use, when closing other questions as a duplicate.
 
Makes sense. then i'd say that a material that points out "don't do it this way" would be better
or even better, shows an alternative
 
@AndrasDeak--СлаваУкраїні I was hoping for something that's phrased explicitly along the lines of "Q. I tried pip install foo and now I still can't import foo; why? A. You installed it for a different Python installation from the one you're using to run the code"; and ideally also gives hints on how to check which installation is which
 
@MisterMiyagi but really, I guess I am just too jaded about my gold hammer repeatedly on newbies trying to do for a in some_list and then call some_list.append() or some_list.remove() in it and wondering why nothing works
 
9:52 AM
@metatoaster I see.
 
@dhiaagr ah, guess I'd have to do that at some point then, since I recall some packages use tuple a lot. Let's hope it'll be a breeze like dicts and lists
 
Rust's syntax scares me.
 
me too
 
(I have good canonicals for those kinds of questions. The problematic question is "Q. why doesn't a = 3 change the list? A. Because Python's variables are just names for things, and a doesn't have any connection to the list from which the for loop sourced it")
 
@NordineLotfi Oh yeah! As long as you're responsible for both endpoints, it's the freaking best.
 
9:53 AM
nice, good to know :o
 
@KarlKnechtel most of that would still be covered by dupe closing with what's in the canon
You can still leave a comment to point out the issue
 
@metatoaster On 2nd thought, you're probably right. It does more harm than good
 
The question you wish to find is no repro...
 
Yeah, I've seen way too many Python newbies being bitten by that, and typically that's the first footgun they successfully shot at their feet
assuming they never ran into issues with pip or getting their environment (virtualenv or whatever) set up
 
pardon, which one?
 
10:01 AM
@KarlKnechtel this one
We can't really know for sure why import fails. They could've missed an error during install for instance.
 
@metatoaster Meh, in my book it's enough if they realise somehow that this doesn't work. Fundamentally, they're attempting to square a circle – there's little way to automatically find out what they should be doing instead.
 
well, if only the newbie could be told by the compiler that what they are doing would lead to unexpected/unsound behavior...
 
@metatoaster Haha, so true. And I believe the garbage tutorials to be responsible.
for loops shouldn't be taught along with datatypes and built-in methods.
 
@metatoaster sorry, I meant pardon, which footgun?
 
@MisterMiyagi you could keep a reference to iterators and invalidate them when the size changes
 
10:13 AM
@KarlKnechtel it's not directly in the question you shared. the footgun where you mutate specifically the size of the list, ie. len while iterating over it, by adding or dropping items.
 
@AndrasDeak--СлаваУкраїні would you also track size-same changes such as pop-insert pairs?
 
I wouldn't.
arguably this might leave only the subtle footguns to deal with
(funny statement that, subtle footgun)
If you do* track this, i suppose you have to have a slight overhead on each iteration maybe. or how would you even establish such a change occured if we talk in terms of pairs of add/removals
 
dict has modification/generation counter, IIRC.
 
Yep. You get a RuntimeError if a dict changes size while you iterate over it.
 
10:17 AM
I assume a dict immediately complains the moment you change it
not giving the opportunity for paired operations to begin with
 
@KarlKnechtel mutating list/dict while iterating, like this this this this
at least Python 3 fixed that dict issue
 
so perhaps this RuntimeError can be introduced to lists too
 
i was mistaken, they opt for the simpler check, with the subtle footgun
can we make subtle footgun an official term now?
 
10:23 AM
@metatoaster re the dictionary infinite loop one, I could have sworn I saw a different version where the output stops at 16 or so.
 
well, in Python 3 it is now RuntimeError: dictionary keys changed during iteration
 
I'm also not entirely sure what is canonical for the dict version of the question
 
fortunately it is now a RuntimeError with a somewhat clear message
 
@ParitoshSingh Right. You can do sneaky stuff like that because the error is raised by the iterator, not the dict itself.
 
@metatoaster what version?
 
10:27 AM
Wait, not all Python 3, this was introduced in Python 3.8
Python3.2 goes up to 7, 3.6 and 3.7 goes up to 5
 
Hey y'all.. I have a model in python. Do anyone know how can I run it on multiple processors without changing the code itself?
 
What kind of model?
 
@ParitoshSingh Well, the .items() method returns a list. I thought that it was conceived especially for that case. Where you need that particular instance of the dict to be modified.
If that causes trouble, it would be because of negligence.
 
@vaultah well it's an environmental model written in python. It takes its parameters from a .cfg file. I can call it form command line but I would like to speed things up! Does it matter what kind of model it is?
 
@dhiaagr not a list, it may look similar though.
 
10:31 AM
@NischalKarki Like @vaultah asked (hi Vaultah!), might depend on type of model. multiprocessing is a good place to start looking.
 
(hi!)
 
@dhiaagr Welcome to Python 3. :) dict.items() returns an iterator, not a list.
 
@MisterMiyagi no, that would not be thread-safe :>
 
@PM2Ring @PM2Ring Right, my bad; A dict items object.
 
10:33 AM
@JRichardSnape Yes this was what I stumbled upon a quick google search. But this would require me to change the source code. Is there a way I could just run the .py file on multiple processors? idk i may sound delusional here.
 
@PM2Ring i was just checking it out. Thank you for the precision.
 
@NischalKarki If you literally want to change not a line of code, you're probably looking at a command line multiprocess handler. Or you could write a wrapper in Python, using multiprocessing to dispatch jobs to a pool each of which calls a wrapper function that dispatches a system call with your command line in it.
 
Was this since the earliest versions of Python 3. I could swear that I used .items() as new instance of a list with no reference to the dict it came from.
 
@JRichardSnape Thanks. I will have a look and come back!
 
10:41 AM
@dhiaagr It was pretty early. Possibly from the beginning of Python 3. The view objects were present in Python 2 (2.6 or maybe 2.5). docs.python.org/2/library/stdtypes.html#dictionary-view-objects
 
@PM2Ring I see. Well thankfully, I never had to change a dict's key.
There was a great talk mentioning the benefits of treating all your data as immutable objects, regardless of their underlying implementation that changed my perception of how to code but I can't find it.
Most likely a DOP talk.
 
@NischalKarki I'm thinking something like this : dpaste.org/BzCaT
All kinds of potential corners to check (e.g. don't overwrite the same results file from every run...). But if it's a very simple use case, this might work.
If it's a heavy model, you might well be best setting your number of workers in the pool to the number of physical cores you have available, rather than virtual cores.
 
@dhiaagr When you need to update a mutable object, you create a new instance, must I add.
 
oops - just noticed in my hacked example - you want to return retval if you really want exit_codes to contain the exit codes. <note to self - don't write code on dpaste>
 
11:09 AM
@JRichardSnape Here's some music you might like, from an Americana / Bluegrass band, Molly Tuttle & Golden Highway Crooked Tree.
 
12:05 PM
@JRichardSnape interesting example. That remind me of some SO post I saw once that benchmarked multiprocess + multithreading, multithreading vs multiprocess etc: stackoverflow.com/a/70235442/12349101
 
12:17 PM
God, it bothered me so much that I didn't know about view objects and was convinced they just returned lists. I went to my old solutions in codewars, and every time it was inside a list or a dict comprehension.
I can't help but think that I could've be one of those who believe in the mandela effect if this false memory was about something not related to Python.
So Rust can suck on that.
 
12:46 PM
@NordineLotfi the first person to reply to their question said the same thing chat.stackoverflow.com/transcript/message/55044047#55044047
 
Hi guys, I just came across a tricky problem I encounted while doing a programming project, anyone able to help? stackoverflow.com/questions/73320921/…
 
Hmm, needs an MCVE
 
And more than 3 minutes on the main site
 
@Kevin Was that to me or someone else? :P
@AndrasDeak--СлаваУкраїні Ah ok I'll wait :3 Just rushing because it's due soon unfortunately
@AndrasDeak--СлаваУкраїні actually it's been 5minutes XD
 
@DialFrost To you. But it is good advice for everyone else too.
 
12:54 PM
@Kevin What's an MCVE? Sorry
 
Ah I see
Nevermind, MisterMiyagi managed to solve the problem quickly!
 
1:10 PM
@NordineLotfi Nice linked Q, thanks
@PM2Ring Lovely - thanks!
 
1:55 PM
Let's say I need certain variables that are used (but not directly output by return) in a function to persist after the function is done running. I need this because the variables value in the previous run of the function determine to some extent the value of the variable on the next run through. Is there any way to encapsulate this kind of functionality without using global?
 
A database?
 
You can store it on some other object, e.g. the function itself or an argument.
However, at that point you're emulating instance data and might just as well use one – i.e. create a class for it.
 
Why can't you just return the values?
 
explicitly return what you need, explicitly input all dependencies.
 
@Catyre can you use a generator?
 
1:58 PM
there's ofcourse an option to return "something" that has these variables attached onto them, or return a dictionary as you see fit, or just return a tuple with everything. the concern isn't about how the return itself should look, but if you need something out of a function, it needs to be returned. if you need something to run a function, it should be passed
 
But yeah, sounds like a use case for a class
 
It doesn't sound like something that should be returned from the function to me, more like a stateful object. Like a random number generator, it doesn't return a seed, it has that as its state
 
I guess I can work my logic such that it returns the last value as well, then pass that back into the function on the next run. That seems to be the most straightforward approach in my use case. Thanks for the speedy replies everyone
 
2:23 PM
@AndrasDeak--СлаваУкраїні ah, you're right. Guess I should have scrolled up before saying anything :)
 
When I have globals I want to get rid of, Plan A is always "try making a class"
 
I don't know why, but I don't like creating class as much as function.
 
Generator it is, then. Want some fries with that?
 
@Kevin I feel like making a class just so I can make one variable persist out of one function's scope is a little overkill, but I see where you're coming from
 
#initial design.

_total = 0
def cumulative_sum(x):
    global _total
    _total += x
    return _total

print(cumulative_sum(2)) #2
print(cumulative_sum(3)) #5
print(cumulative_sum(5)) #10
print(cumulative_sum(7)) #17

#revised design using a class.

def CumulativeSummer:
    def __init__(self):
        self.total = 0
    def add(self, x):
        self.total += x
        return self.total

summer = CumulativeSummer()
print(summer.add(2)) #2
print(summer.add(3)) #5
print(summer.add(5)) #10
print(summer.add(7)) #17
For example.
I understand your concern about overkill. But in terms of line count, you're only adding about two lines. You can decide on a case-by-case basis whether this kind of tradeoff is worthwhile
Alternative approach: rewrite your code using functional design paradigm. Then you won't need to keep track of mutable state, because mutable state doesn't exist in a functional-paradigm program.
To solve the problem, simply stop having the problem
 
2:44 PM
Well, you could store the state as a function closure.
 
We mustn't talk about closures in front of outsiders
 
@Catyre if you have state classes are merited
 
@Kevin First rule of the closure club?
 
Not necessarily necessary, but nobody should frown at you
 
The N+1th rule of closure club is successor(the Nth rule of closure club)
 
2:57 PM
f = (lambda a: a(a))(lambda a: lambda b: lambda c: (c + b, a(a)(c + b)))(0)
total, f = f(2); print(total) #2
total, f = f(3); print(total) #5
total, f = f(5); print(total) #10
total, f = f(7); print(total) #17
There, now it's shorter and therefore better
 
this is getting closer to golf territory. Not like it's a bad thing
 
Oh we're playing code golf in production now? Sweet.
 
 
2 hours later…
user18313765
4:33 PM
I would like to ask you a question that needs a short answer only YES or NO. Using Tkinter, can I add icons to each combobox item? For example, the country flag icons next to each country name. So: essentialobjects.com/doc/web/combobox/combobox_with_icon.gif
 
I will consult my notes and return with a YES or NO
 
user18313765
My knowing yes or no was just a way of saying that I don't want HOW it is done, but I would only like to know if it is possible to do it. Thank you :)
 
I will take the lazy route and say that the answer to "can i do this" is almost always Yes
 
user18313765
On the web I read that it CANNOT be done. I would like to ask you to confirm that you are experts
 
I have consulted my notes. My assessment is NO
tcl.tk/man/tcl8.6/TkCmd/ttk_combobox.html describes everything that ttk.combobox was intended to do, and it doesn't mention icons or embedded images at any point
Paritosh has a point. In principle, you can control the color of every individual pixel of a tkinter window by using the Canvas object. If you wanted to, you could create your own widgets that look and behave any way that you want. But this is a big pain in the butt, so I don't recommend it.
Not that you would necessarily need to control every individual pixel... You can put an image next to text using a Text widget. You can put several of those in a Frame, along with a Scroll widget, to create a listbox-like widget that allows icons-plus-text. You can hook that listbox-like widget up to a button that makes it visible or invisible. Put the button next to an icon-plus-text widget that displays the current selection, and you're done.
For certain definitions of "done"
 
4:48 PM
@SantiagoE.98 not with combobox, but seems like it can work with listbox: stackoverflow.com/questions/66622157/…
mind you, you could somehow port that to work with combobox, but I'm not too deep into tkinter yet, so just guessing here
 
tkinter has some undocumented methods to tinker with its low level state. I think you'd need to know a fair amount of Tcl to change how ComboBox works.
 
I mean the cheat is to just put the icon in the text the thing displays e.g. "🇺🇸 United States" ...? Of course then your icons are limited to unicode...
 
The answer on that linked post doesn't actually use ListBox at any point, so you wouldn't so much be "porting" it as you would be changing its observable behavior to whatever suits your needs. Like having a button that toggles its visibility, for instance.
I think composition beats inheritance here
 
user18313765
5:10 PM
Thanks everyone for the answers. You have been very kind and helpful. Thank you
 
user18313765
@0x263A Interesting. Do you mean the emoticon? How can I do? Thank you
 
I'm not super familiar with tkinter, but I'd imagine you can just change whatever the text the combobox item displays to include the emoji.
If your use case is actually displaying countries with their flags I'd probably try and find a mapping of emoji->country on the web somewhere, or maybe some library that's done that already.
 
5:35 PM
hello, i have some trouble getting mime type of file using FileField in DRF,
https://stackoverflow.com/questions/73321846/how-to-get-mime-type-of-filefield-in-drf-and-send-to-parameters
how to get the solution to this?
 
5:56 PM
@Kevin I did say I was just guessing :P
 
Don't pay me much mind, I'm just quibbling about semantics for the fun of it
 
6:09 PM
the funny thing is that you can actually do it with PyQT5
 
That is why alot of people prefer PyQt5 even for small builds
@SantiagoE.98 I'm gonna say NO too, but the answer is almost always that you can. Like Kevin said, it would be a "pain in the butt"
You will have to create your own Combobox, sounds interesting. I'd say difficulty medium
 
Probably higher if you end up needing to use Tcl. I remember once thinking I could make a tkinter app that could support every keycode on my keyboard but...if you want to do certain combo you'd need to use Tcl to explicitly bind the key to certain event.
 
I made the mistake of buying an RGB mouse... I can never use linux again until I get a new mouse
(not that I use linux a lot these days)
 
wait, you were using Linux? I always thought you used Windows, unless that was because of work
 
I used to use linux, but it's been causing problems for the last couple of years, so I turned into a Windows user (against my will)
 
6:23 PM
i thought linux was the land of folks who scoff at mice, so win win
 
@Aran-Fey I see. I can relate to the problems part...not that I would switch completely though since I had problems on windows side too
 
Maybe I should feed the mouse to python
 
that's an idea
@ParitoshSingh you know, the first time I used linux, I could probably have come up with a dozen of these jokes, but now the inspiration isn't there for that. I should have noted them down
 
I've been wondering, what's the proper way to install multiple python versions on linux? I used to add a special repository or install it from the AUR, but those solutions always end up causing problems in the long run (i.e. weird dependency conflicts that break your software manager)
 
this was posted once here I think, but I've been using this: github.com/pyenv/pyenv
 
6:32 PM
im surprised that this is an issue
 
a reminder that it will compile from source, just FYI
 
@Aran-Fey I love RGB mouses
@NordineLotfi Oh I see, which keys were you trying to access
 
@DelriusEuphoria hmm, memory's fuzzy but, I recall talking about that limitation with Kevin here a while back. Now to find that convo again...
 
@NordineLotfi As long as it works, I don't care :D
 
as long as you don't install packages in some global environment, is there any other reason that linux would have issues with multiple installs?
 
6:34 PM
@Aran-Fey nice, then yeah it works :) just thought you might not have wanted it to compile, since I know some don't
 
@Aran-Fey I was just dealing with this, there's a separate make command github.com/python/cpython/blob/main/…
 
@ParitoshSingh hmm, by default, depending on your package manager (the app that install your apps) it will do some weird stuff, such as symlinking/replacing libraries of other apps or even it's own but from different versions, conflict of dependencies, etc
 
in terms of things that can manage python, i've had a great time with miniconda on windows. i believe it exists on linux too
 
it's not really like on Windows where you can just "choose alternate directory"
(sadly)
 
From personal experience, it's surprisingly easy to compile Python and install multiple version of it on Linux
 
6:36 PM
@NordineLotfi Ah, its a pain also because all those tcl methods are under-documented
 
@ParitoshSingh yeah, they use a self extractable bash script, where they just concatenated the compressed archive of their release inside of it. It's pretty cool (I don't know if they do this for the mac version, but they do it for Linux from what I recall)
@DelriusEuphoria yep :/
 
@ParitoshSingh As far as I can tell, the problem is that the official software repos and the unofficial python repo have conflicting dependencies. For example, python3.10 depends on python-devel 1.12 while python3.9 depends on python-devel 1.09 or something like that
 
@vaultah yeah, although I recall I had to chase some OpenSSL dependencies once but once you figure it out, it's pretty easy to do
 
i see, and the linux package manager tries to manage those dependencies themselves and runs into issues i presume?
out of curiousity, what distro/package manager is this?
 
Yeah. So then you have to disable the unofficial repo, update, then re-enable it and pray it works
 
6:41 PM
not sure if other managers will do a better job or not, just curious. i dont really know much about these things
 
@ParitoshSingh Let me think... it's actually been a while. I think it was Manjaro (pacman), but I'm pretty sure I've also had these issues on Ubuntu
Anyway, seems like the consensus is to avoid messing with software repos and instead compile it manually (or use some tool that does the compiling for you)
That's another win for Windows I guess
 
I don't know about that -- last time I tried to compile under Windows (used a mix of msys and cygwin) it was much more of a pain, both for hunting down dependencies, and making it work, compared to doing it on Linux (where I also have to do the same thing, but at least it's somehow easier? and I can't exactly pinpoint why)
Although I say this, I still use Windows on vms or a separate device, which feels kind of weird
 
But on Windows you don't have to compile it, you just install it
 
hmm, I guess it depends on the app. I usually try some stuff I find on github so maybe I'm biased
 
7:10 PM
@Aran-Fey make install and make altinstall aren't that complicated.
But I hear you. Linux has a horrendous ways for package organisation.
 
And we're just gonna assume that it won't fail with some cryptic error? :P
 
lol, I retract what I say based on I used them only once in my whole life.
 
I've used make a half dozen times. I'd say it's about as reliable as pip install. And as cryptic too.
 
7:49 PM
Do u know about the language ENSO? ETL tool.
what if python had a similar editor?
 
@discoMonkey tried it when I just started python. It's decent but there (at least at the time when I tried it, which should be a bit more than a year ago) 1. too many bugs (it wasn't stable enough even from their readme on the github at the time), 2. doesn't really work on other language? I recall someone planned to make it work with some compiled lang but I forgot which one. 3. they force their design choice on you. That one is mostly my preferences but, I don't really like their arrow styles.
 
8:34 PM
@Aran-Fey fun fact, on MacOS the only way to properly get python-devel is to use homebrew to install python. It's a vague memory now but there's PEP 500 something that just screws up pretty much everything. I don't know whether I wanna relive that nightmare to find out
Still, for whatever was going on there, chalk up a win for the Windows setup vs. MacOS where is was a bin fire
 
@AndrasDeak--СлаваУкраїні Hahaaa
 
Hmm, looks like it was PEP 517. If you want to see a package so utterly broken on building, it's hdbscan. I ended up back on it today again for a few hours trying to fix it. Awful
 
I remember buying a Macbook pro I could barely afford in 2009 or 10. Funny thing is, the first time I felt like an idiot being taken advantage of is when I drag-dropped an app pack into the application icon to "install" it.
 
Maximum borkage where things just come from every angle. Thankfully, you can just unpin releases from requirements.txt and it works... for now. But it's so ridiculously brittle it's awful
@dhiaagr I still don't understand what that's about, but it's only high on the "WTF" scale and really low in the "WTF" scale
 
8:44 PM
@roganjosh I believe it's Apple hammering down the: Aren't you glad you aren't one of them PC losers? They click next/next/next to install their apps.
 
Could be. Nice they extended that approach with the M1 chip that was so easy to move to
 
@roganjosh I'm interested to learn how they extended that behavior.
 
@roganjosh not really related, but you can use homebrew on linux: docs.brew.sh/Homebrew-on-Linux Although I think it's mostly in name only, since it usually compile everything you install
 
@dhiaagr I was being sarcastic. It was awful on release
 
I sensed the sarcasm, but I'm not familiar with the issue.
Or your joke just swooshed over my head, in which case I apologise.
 
8:54 PM
don't have a mac but I think the issue was compatibility issues and apps not working with the new M1 chip
 
Oh! That I can relate to, since my Macbook pro was among the first generations that switched to Intel from PowerPC.
And Apple just telling developers to get sticked and deal with it.
 
@dhiaagr It wasn't really a joke, it was just "Apple being Apple"
Combine that with compiled libraries and it's just not fun.
 
That, I can imagine.
 
I guess it'll be fun to do a proper benchmark of M1 vs my pentium. I was very lucky to get one of the last pentium Mac Pros before the market dried up. I just don't have much time for building non-artificial benchmarks
 
I guess it boils down to the user having to choose between throwing money or throwing time at the issue. In my experience, throwing time has better ROI than money.
 
9:01 PM
That presupposes that their aim is to make you more productive vs just locking you in
My gut tells me that the M1 doesn't do anything useful, and it just pushed the onus of that on all the library devs. It took them time to respond. But Apple knows that it's already cornered the market to know that developers have to use Mac to be sure that they're building stuff cross-platform because there's no other way to test
 
We all know Apple's aim, am I right. By throwing time I meant Linux, actually. Apple will ask you to throw money, and it's up to you if you want add time with that.
 
Every time my Mac wants to update - literally every time - it's 15GB to download. This is ridiculous
 
That's insane, rofl.
 
that's one way to spin "exclusive"
 
If you don't mind me asking, why do you use Apple computers?
 
9:07 PM
i have no choice
This is my work laptop. But the fact that every OS change means you have to download the entire OS for even minor releases just give them the "Oh, soz, we broke that API because reasons" excuse. "Guess you'll need a Mac to keep up"
 
We're past the ridiculous territory to that of dangerous.
I guess they did familiarize their users with the concept of: if it isn't in the cloud, you're to blame for losing it.
 
Hmm the OS updates I've personally seen were always less than 3GB in size
 
I'm already on Monterey
And even 3 GB. For a release?
 
Dear god those tabs
 
What tabs? I have no tabs. Don't look for tabs
 
9:16 PM
The max tabs I ever had were 400, and that was on an old Firefox release.
 
I encourage you to look into tab groups support.apple.com/guide/safari/group-tabs-ibrwa2d73908/mac
 
Hahaha, other updates are available.
 
<cough> there is one among us that trumps 400 tabs. I never meaningfully exceed the displayed tab limit. 400 is weaksauce in this game
 
I guess now I know who use more tabs than I ever did :P (btw, paused/non-loaded tabs doesn't count!)
 
@0x263A I encourage you to develop your photographic memory and prioritisation of tabs. I know where most of them point to
 
9:19 PM
chaotic-order is still order, yeah
 
Also, the RAM is to blame.
 
I don't know, I want to say the browser is, mostly. On an old, and I mean really old firefox release, you can get 300-400 tabs on less than 4GB used, maybe more if you throw swap space
 
Chrome (chromium) scales it down. It can be CPU-intensive but it backs off quite politely
 
Multiple tabs is bad for my stress levels induced by my guilt emanating from my awareness of my tendencies to procrastinate.
 
on linux, I think I never managed anything more than 100 ish tabs with Chromium without using all my ram (on active tabs only)
 
9:22 PM
@roganjosh That may have come across a bit terse because... ya know, internet, but I meant it as a jest. I don't really have a problem with a gillion tabs functionally— it's just the display that I find ugly. Another valid solution in my mind is to buy a bigger monitor XD
 
@dhiaagr I know the feeling.
@roganjosh btw, don't think it's gonna make you feel better, but Android devs are also doing this kind of thing on google play (not all but a lot them are). Basically, one app that come to mind is PokemonGo where they always force you to update and also bundle update + whole game, without preemptively uninstalling older version.
so you're left with deleting it and reinstalling just to get the update
 
Only Miguel Grinberg is capable to make Javascript appealing.{React Mega Tutorial] (courses.miguelgrinberg.com/p/react-mega-tutorial) <- Top notch.
 
@0x263A bigger monitor works but it's enough work for me to keep up with the 80 (?) tabs that then start overspilling. You won't offend me about tabs, but I need to jump between projects every 5-10 mins so I keep tabs around
@NordineLotfi I'm glad we're tackling the. big issues like PokemonGo and we can look at that as a lighthouse :of dev cycles P
 
Yeah I'd just have 4 groups with 20 tabs (or whatever). Different strokes for different folks =).
 
9:39 PM
Sure. I've never been able to bucket things properly. I'm jumping from "WTF, this person is smashing up PEP 8 in the library I handed over to "why are we routing vehicles this way?" in a cycle. I need lots of tabs
And netflix in the middle for when I throw a towel in :P
 
@roganjosh They're allowed to modify the library?
 
Sure. I give starter solutions that address the problem and then hand it over
They're not centralised solvers. There's no way you're gonna get a free pass to change those. But customer-specific heuristic solvers - I pass them on the the other data scinetists
 
Oh I see what you mean.
Speaking of PEP8, do you enforce they 80 char column guideline?
 
Yes, but not with a commit hook for black or something
(not to say that that is a bad thing. black and I just disagree with pandas)
 
I understand very well.
 
10:19 PM
I don't usually use conda, but when I do it's the bane of my existence. See "Missing --no-site-packages option".
 
For a very long time I used python IDLE , and it taught me more.
 
since there were no suggestion or auto complete
 
So, more than a proper IDE?
 
Yes
 
But over the time I became lazier and started using VSCode
 
11:14 PM
Is there a way to tell when an answer was accepted? I've tried looking through the timeline but can't find anything.
 
huh, I never noticed that
 
Hover over the green check on the answer
 
Nice. And here I was about to suggest trawling through the asker's "accepted" tab in the profile.
I did hover over the checkmark in the timeline, but I didn't think to do that on the main checkmark
 
@vaultah yeah, I just discovered that. Thanks!
It's weird it's not on the timeline, though
 
yeah
the timeline, like many other features, was just an afterthought
 

« first day (4317 days earlier)      last day (632 days later) »