« first day (3188 days earlier)      last day (1775 days later) » 

1:03 PM
here is my actual use-case. I may be polishing a turd here, but oh well.
(Yes, I know asserts can be disabled and I should implement my argument validation with regular exceptions)
 
Dec 14 '18 at 10:44, by Martijn Pieters
@Arne never mind the boilerplate, holy mother of if..elif..else switching! :-D
 
/me going back to bed
 
I need at least seven if/elifs unless I overkill this problem via a symbolic math solving library. I could probably do it in less than fourteen, though, since the math for the x dimension is identical to the math for the y dimension, modulo variable names.
 
What am I going to brush my teeth with now?
 
For this question, specifically on the second part, what makes more sense here? My guess was to use isinstance to check for the different data structures and check whether or not the values are numeric in one way or another depending on the kind of structure. Any thoughts?
 
1:13 PM
that sounds fine to me. that'd be my first instinct too
regardless, i imagine this can get pretty complicated as you keep adding weird datastructures from external libraries. trying to solve this problem "open ended" seems like more trouble than worth
 
Yeah, but have you noticed the question would like to include [1, 2, 3] and np.eye(3) as "numeric" elements. I left a comment and voted to close.
 
So this is what I went with. Not very nice but I think covers most cases. Wondering if this is a bit of an overkill, or indeed as you point out paritosh more trouble than worth
def check_numeric(l):
    for i in l:
        try:
            iter(i)
            if isinstance(i, (list, set, tuple)):
                try:
                    list(map(float, i))
                    yield i
                except:
                    pass
            elif isinstance(i, np.ndarray):
                try:
                    i.astype(float)
                    yield i
                except:
                    pass
        except:
            try:
                float(i)
                yield i
 
Here is the seven conditional version. Surprisingly less horrible than I thought it would be. Even without namespace hijinks, it looks a lot cleaner without the inline string literals.
 
couple of bare excepts to fix i suppose, but on the whole this seems decent enough as anything. since you've still kept the problem "close ended" by making some assumptions against nesting, or dicts, etc etc.
 
Actually realised the initial for should be included in the first try/except
 
1:20 PM
which, in this context, is a good thing imo.
 
actually no, should be ok I think
thanks for the feedback @ParitoshSingh
 
no worries
 
1:35 PM
cbg
 
I think it would actually be easier to validate that a data structure contains only numbers or collection types, nested to an arbitrary* depth, than to validate exactly and only the examples that the OP gave
 
user10984358
this is not really a python related question but if I am moving all my local function variables into the init function is there a way I can easily add self. to everywhere the variables are used?
 
(*... As long as you can reach the deepest level without exceeding the maximum recursion depth)
 
user10984358
say I have moved 5 variables a,b,c,d,e from three functions to the init, any convenient way to add self.a self.b in all places they appear?? regex replace or something?
 
old school ctrl+F ? i usually am scared to blanket replace without watching each instance one by one in any text editor or the like
 
1:40 PM
I don't think regex is powerful enough to match all variables named "a" without falsely matching "a" in other contexts, for example inside a string literal such as "I have a coconut"
You don't want that to become "I have self.a coconut"
 
user10984358
that is what I am doing but I have so many button references used and these are now a pain, I have like 50+ occurrences totally
 
@yatu Bare except is rarely a good idea. But except: pass is the Python equivalent of sticking your fingers in your ears & yelling "La la la, I can't hear you!"
 
that sounds more like perhaps you could have used a dict/list to hold all buttons maybe?
 
user10984358
well I meant 'a' as an example in my code I have legit names like 'knnBtn, kmeansBtn and so on'
 
user10984358
@ParitoshSingh I am pretty sure I am doing something messy here, I have a couple of lists to hold the radio and check boxes
 
user10984358
1:42 PM
but buttons are standalone as of now
 
if you're confident that nothing will go wrong, you could always go with a replace via code. but you should be careful that youre sure the names will never mis-replace something else.
 
I'd just do a regex replace \b(knnBtn|kmeansBtn)\b with self.\1
 
user10984358
@ParitoshSingh my paranoid self has already saved the code in a new file :)
 
for any and all names that are uniquely named, i don't see any issues.
perfect!
 
haha yes @PM2Ring this is a little simplified though, indeed this should include the appropriate exceptions and perhaps raise warnings accordingly
 
user10984358
1:43 PM
@Aran-Fey I guess this is what I will be doing
 
user10984358
what's the \b?
 
word boundary. avoids matching things within a word
essentially atleast you wont turn a cat into a cself.at
 
user10984358
ohh makes sense
 
user10984358
thanks for the assist everyone
 
user10984358
see ya
 
1:47 PM
On second thought, maybe regex can distinguish between string and non-string contexts. You can't arbitrarily nest string literals, so the usual roadblock of "regex can't recurse" doesn't matter
 
user10984358
well that worked peachy
 
user10984358
on a python related note, would you suggest I have like 20 objects, buttons, text label under the init function ?
 
user10984358
these buttons are used across 3 or 4 functions for the most part
 
From a software engineering standpoint I don't see a problem, but I doubt a widget with 20 buttons is good UX
 
better than the 400 tickboxes someone had recently ;)
 
user10984358
1:56 PM
not 20 buttons are displayed at the same time, I guess like 5 tops at a time?
 
doesn't even have to be python related. it's good to have objects initialized in the constructors in just about any language. The only issue again is 20 individual variables, perhaps a logical grouping in a dict/list?
 
user10984358
how'd you do that in a dict? never tired that
 
:D 480 something iirc
fwiw, they're all inside a list!
 
oh, much better than :PP ;)
 
1:58 PM
and have a text filter to boot! :P
but yeah, that's just about one of the worst must-have ideas you can have in our use case. there's just that many values to choose from. to make life easy, we also added a preset default for them.
so essentially, no one really would have to change them...until the day someone does. i feel for that poor guy.
 
hehe
 
user10984358
so he wasn't exaggerating when he said you had 400 of those, thought that was a hyperbole
 
@AndrasDeak bah, s/than/then/
 
@TheNamesAlc oh, it's nothing special, its just that self.some_container is the defined attribute, and you use your variables normally as key value pairs inside this container.
the idea being, if you know that self.screen_one_buttons is the dict being used, all the buttons belong in screen 1, or something like that. Just nice to group things that belong together
 
user10984358
so my button object would be the deafultdict argument?
 
2:01 PM
c:\Users\Kevin\Desktop>type data.txt
a = 23
x = a + 2
s = "I've got a lovely bunch of coconuts"
q = 'It\'s a beautiful day' + str(a)
c:\Users\Kevin\Desktop>type test.py
import re
pattern = re.compile(r'''(\ba\b)|[^'"]|"((\\.)|[^"])*"|'((\\.)|[^"])*\'''')
with open("data.txt") as file:
    s = file.read()

result = pattern.sub(lambda m: "self." + m.group(1) if m.group(1) else m.group(), s)
print(result)
c:\Users\Kevin\Desktop>test.py
self.a = 23
x = self.a + 2
s = "I've got a lovely bunch of coconuts"
Ugh
Todo: make the pattern ten times longer by supporting triple-quoted strings and f strings
 
@TheNamesAlc doesn't even have to be a defaultdict, but sure if you want it to. that would depend on you really.
 
>>> np.array(list('1234')).astype(float)
array([1., 2., 3., 4.])
 
and doesn't even have to be a dict either. if a list makes sense, a list works too. or a class, or some other container. named tuples? who knows, knock yourself out.
 
user10984358
its just grouping for the convenience then, if people here see my code then I am sure they'd go nuts, I am refactoring all the variables as of now, after the assessment is done I will go with your idea, thanks!
 
no worries.
 
2:05 PM
Devil's advocate: sometimes UI code really does require fifty different variables referencing fifty different window elements.
 
user10984358
I am surprised how a simple question from me made someone here code a full fledged code
 
don't be. Alc, meet Kevin. Kevin, uh, carry on
 
user10984358
@Kevin sometimes I think I can getaway with using some object I used for the login button
 
If you're writing a calculator, then absolutely you can turn your button_0 through button_9 variables into a single digit_buttons list. But if all of your buttons do different things and have no logical way to be grouped, then do you really gain anything by sticking everything in an all_my_window_elements dict?
 
user10984358
twas a nice way to greet :p
 
2:07 PM
@Kevin funnily enough, i don't think that's much of a devil's advocate kind of statement. If they really don't belong together, then it is okay to keep them separated really.
Though i will say im having a hard time imagining a usable UI that would need such a thing
 
user10984358
well I for now I am making a simple GUI that can browse a csv or excel and then it gives the user a choice to select which columns he needs for training the model and then I display buttons for like 7 algorithms
 
oh gosh, you've just made me remember a UI interface from hell that was actually a really useful tool.
 
@Kevin \b(a)\b|("""|\'\'\'|["\'])(?:(?!\2)(?:\\.|[^\\]))*\2 not 10 times longer
 
Don't get me wrong -- if a UI displays fifty different elements at once, it's probably not that good of a UI. But let's distinguish between bad requirements and bad fulfillment of those requirements
 
user10984358
I guess I can group buttons on the basis of supervised or unsupervised model
 
user10984358
2:09 PM
I personally would be against clicking 50 buttons, pretty much why I don't like DoTA
 
bask in all its glory!
 
If your boss says you need to display fifty elements and you have no say, then it may be that the best way to fulfill that requirement is to have fifty variables.
 
@ParitoshSingh ah yes, the "help, we don't have bash" tool
 
guilty as charged :P
 
user10984358
but still I must learn to minimize the use of variables, anything can be grouped under something
 
2:11 PM
@TheNamesAlc they are all grouped under globals() or locals(). You're welcome.
 
laurel
 
user10984358
the last time I was interning, the 'boss' had no idea what he was expecting
 
that's not unique to interning.
and much more common than it should be. :P
 
@Aran-Fey I think f strings specifically might be impossible since it would be hard to turn f"I have a coconut and {a} apples" into f"I have a coconut and {self.a} apples"
 
@ParitoshSingh trade you for a "than"
 
2:12 PM
deal! or no deal? ;)
 
user10984358
I have to learn what it actually means, I have stumbled across them, also decorators is next in my study list
 
@TheNamesAlc what is "it"?
@ParitoshSingh the deal's off
 
user10984358
@ParitoshSingh its not worse as in media companies, buying coffees is actually a thing, I thought they were making it up for the comedic effect
 
You can't just try to detect starting and ending curly brackets, because then you'll choke on f" I have a coconut and {{a} + {{{{b}}}}} apples"
 
user10984358
@AndrasDeak locals() and globals()
 
2:13 PM
ah
 
@Kevin Oh. Yeah, regex can't do that by itself, I don't think
 
with the power of Tony the Pony perhaps
 
he comes!
 
user10984358
as a gratitude for what I learnt to any gamers here the steam summer sale ends today so you might want to get anything if you have on your wishlist
 
E̵̱̎͌̇é̵̫̚e̵̝͖͋͗͆k̸̖͐̓̉!̶͓̫̈̕
 
2:17 PM
Hi everyone
 
user10984358
@RobertGrant its mumbo jumbo for me, font issue or ?
 
It's supposed to look like text with random lines drawn on top of it. It's a reference to the Dread God Zalgo, who corrupts reality whenever anyone tries to parse HTML (or any other language with nested elements) with regex.
 
@ParitoshSingh btw you could consider using one of these things instead of 400 individual check boxes
 
user10984358
ohh I was warned of that once when I was asking something about scrapping here
 
2:20 PM
I want to create a link to values within a pandas column
 
user10984358
I am surprised an answer like that actually is an answer
 
The link should be to google maps but the value should be as it is
Example:
	address_lines	                       city
0	31 Stuart Road Highcliffe	      CHRISTCHURCH
1	33 WEST STREET	              RINGWOOD
2	66 PINE ROAD	                     BOURNEMOUTH
3	37 PRIESTLEY ROAD	            BOURNEMOUTH
4	9 MAYFORD ROAD	                POOLE
 
user10984358
@Aran-Fey what are those things called? I wanted them in my UI but I didn't know that name, shame on me
 
It's a great gag but the kernel of truth lying within is: it's impossible to write a regex that matches the language "any number of instances of the letter A, followed by the same number of instances of the letter B", and by extension any language with nested matching brackets/parens/whatever.
 
user10984358
I knew something like that existed but for the life of me I couldn't name it
 
2:22 PM
@TheNamesAlc I don't know either :(
 
For some funny reason I am unable to align the values within city
 
@Aran-Fey ours is technically a multiselect dropdown. but that's a pretty good suggestion too.
 
I want to make all the values in that address_lines column as hyperlink to google maps
 
user10984358
I tried :/
 
@RaphX so do that
 
2:23 PM
@RaphX Sounds like you have two problems: how to take an address/city and create a url that goes to a google map of that address; and how to add a new column to a dataframe. Which of those are you having trouble with?
 
although I'm not sure why you'd want to put URLs in a dataframe
Jul 4 at 11:59, by Andras Deak
Jun 27 at 11:26, by Andras Deak
Jun 6 at 11:37, by Andras Deak
@RaphX Please try harder. And read how not to be a help vampire. You are seriously depleting patience of the users here, which is a non-renewable resource.
@Raphx you are not asking a clear question. So please stop and work on this more.
 
I am not going to add a new column @Kevin
I want to make all the values in that as hyperlinks which should directly open on Google Maps
 
Ok, fine. Then the second problem is "how to update each value in an existing column in a dataframe". You still have two problems and you still need to tackle only one of them at a time.
 
2 mins ago, by Andras Deak
@RaphX so do that
 
I tried @AndrasDeak and failed miserably
 
2:26 PM
Then you have to try harder. You're not yet in a state where asking for help here is worth our time measured in signal-to-noise ratio.
 
If you tried and failed, then your code and stack trace should have been in the problem statement in your first message.
We should not have to tease this information out of you.
 
I will create a MCVE
 
I fear it
 
You should have constructed your MCVE before submitting your first message. We should not have to ask for it.
 
There is no error message, just that I am not getting as I want
 
2:37 PM
you don't need to import numpy
@anky_91 read the context please
 
i cant access the pastebin, guessed it :)
never mind
 
import pandas as pd
from IPython.display import HTML
a = pd.DataFrame({'address_lines':['31 Stuart Road Highcliffe', '33 WEST STREET', '66 PINE ROAD', '37 PRIESTLEY ROAD', '9 MAYFORD ROAD'], 'city':['CHRISTCHURCH', 'RINGWOOD', 'BOURNEMOUTH', 'BOURNEMOUTH', 'POOLE']})
def make_clickable(val):
    return '<a href="{}">{}</a>'.format('www.google.com/maps/place/' + val, val)
a.style.format({'address_lines':make_clickable})
# This is not giving the required data as hyperlinks
a.to_excel('test.xlsx')
that's the pastebin's contents ^
 
I don't think that IPython.display import is needed either
 
@Kevin it might do magic
 
@AndrasDeak Thank you
 
2:40 PM
I'm unclear whether the question is "how do I make it so that the excel document created by to_excel has clickable urls when I open the file in excel?" or "how do I make it so that this data structure has clickable urls when I print it in IPython?"
 
Yeah excel is the final thing @Kevin
 
@RaphX again, not an answer to Kevin's doubts
 
googling for the answer comes up with this
this assumes something that you failed to clarify to Kevin so far: that you want the urls to be clickable in excel.
 
You mean googling for the actual problem gives us an actual solution? WOW
 
2:42 PM
I'm not sure whether "excel is the final thing" means "I only care about whether the url is clickable in excel, and I don't care what IPython does" or "Ultimately I care about excel, but making them clickable in IPython would be nice to have too"
 
(not snarking at you, Paritosh)
 
( i know. hang in there )
 
@Kevin "Ultimately I care about excel, but making them clickable in IPython would be nice to have too" > yeah this one
 
Ok, progress is being made. IPython gives me a headache so I'll leave that to someone else.
 
I will look through that @ParitoshSingh thanks!
I actually came up with this while googling: stackoverflow.com/questions/42263946/…
I need to work on my googling skills
 
2:45 PM
no worries. be more careful with how you explain problems, that will help both with google searches and with other folks
 
this was the last strike
 
especially considering you never said "Excel", but said "pandas" when talking about hyperlinks. if you're curious, this is what i googled. "pandas to excel how to add hyperlinks"
add what you want to do in the right context, and usually google does a pretty good job throwing useful results. add function names and usually you're good to go.
 
3:10 PM
Thanks@ParitoshSingh@Kevin , I found out the solution
 
OP: How do I convert a nested JSON to a csv file? ME: Change the name of the file.
 
laurel
 
:D
 
Man, state machines are a pain in the butt when time doesn't elapse in discrete units
 
as in a continuous-time simulation of something?
 
3:20 PM
Yeah. Rather than progressing simulation state by abstract "ticks" every sixtieth of a second, I'm measuring the difference in wall clock time between frames and progressing simulation state by delta seconds.
 
@Kevin I was away at a meeting, so I missed the earlier discussion. Here is an if-else-less version using a pre-defined dict of lambdas to be selected by the provided keys, each lambda computing the 2 primary values for each dimension: pastebin.com/KsLPCu3k
 
@Kevin these often call for event-based engines
 
This gets tricky around "piecewise" behavior such as "move forward for 10 ms, then turn right, then move forward for 4 ms". If the first delta happens to be 12 ms, then you have to notice that it's larger than the duration of the first state, and the remainder is halfway through the final state.
If your bookkeeping is sloppy, then you might move forward for 12 ms and turn right
@PaulMcG I considered a dict-based approach and I do think there is merit to that design. I never got around to actually writing it though.
I wish I could have my cake and eat it too by creating a dict of callables without using lambda or def
 
class?
 
3:39 PM
@AndrasDeak I used simpy for something like this a while back, it looks like it is still active (last commit was last month)
@Kevin It cleans up considerably if you pass kwargs->d as a namespace instead of a dict
 
I could also do the "for loop over each dimension" thing I did earlier, which largely makes namespaces unnecessary since the dict-based approach looks better when there are no inlined string literals
 
4:04 PM
cbg
 
hello
 
user10984358
4:17 PM
I have a PyQt window in which at the click of a 'Browse' button an excel or csv file is read and its columns are displayed as checkboxes allowing the user to select, but when I click browse again for the second time and select the same or different file, the old checkboxes are deleted but I get an error
 
user10984358
once these checkboxes are generated I get to select them and click another button which checks which checkboxes are checked using
 
user10984358
colFeature=[x.text() for x in checkBoxes if x.isChecked()==True]
 
user10984358
it is at this like am getting an error
 
user10984358
RuntimeError: wrapped C/C++ object of type QCheckBox has been deleted
 
user10984358
every time the "browse" button is clicked I delete the older checkboxes using
 
user10984358
4:20 PM
[x.deleteLater() for x in self.checkBoxGroup]
 
user10984358
and I also do self.checkBoxGroup=[] to ensure the list is empty each time
 
Sounds like the underlying resources that the QCheckBoxes require are being deallocated prematurely, and/or you're retaining references to old QCheckBoxes instead of the new ones. It's an interesting problem, but there's not much I can do without an MCVE.
 
user10984358
well I tried hide instead of delete but I am getting an index out of error
 
I'm going to go to lunch, and if there's runnable code waiting for me by the time I get back, I will inspect it with great enthusiasm.
 
user10984358
alright I will make a small example with an excel file and link a pastebin
 
user10984358
4:23 PM
thank you!
 
user10984358
4:40 PM
Well this schmucks :/ my dorm room ran outta power and so is my laptop. Will it be okay if you can look into it the next time you’re free after I upload the code. Everything in my possession is now clinging to the last bit of charge.
 
Yeah, I'm in no hurry.
 
user10984358
Main Code : https://pastebin.com/5ip7g71J

Necessary Import : https://pastebin.com/h6r7BLem
 
user10984358
alrighty done, had to go into a different room but I hope that is enough its kinda big I reduced it from 400 lines to 160, the other file is just 10 lines
 
user10984358
please make sure you select any one excel or csv file at the start and then select the another excel or csv file and then click the KNN button
 
user10984358
it doesn't matter what I have checked or selected
 
user10984358
the error is reproducible there
 
5:04 PM
I need everyone to clap their hands and believe in my router or else it won't stay alive long enough to download pyqt5
 
just ended up rewatching Forrest Gump
 
user10984358
@Kevin sending postive vibes to your router
 
Some movies are worth watching, or rewatching. Such a masterpiece. There's so many things that i can appreciate about it even more now.
 
user10984358
@ParitoshSingh well I was about to binge watch the final destination series until my laptop decided to sleep
 
@ParitoshSingh my leave seems wasted. Will start binge watch something after 20 min
 
5:07 PM
Ah, sorry for the rains. :/
 
user10984358
idk if you guys know about this German show
 
user10984358
its called Dark
 
user10984358
season 2 came out last week iirc
 
oh i've heard really good things about it
 
don't be,, its not you ;)
 
user10984358
5:08 PM
I watched season 1 earlier this year and being a fan of the genre it is I ended up liking it
 
user10984358
won't say much, people have different spoiler tolerances, some even hate to know the genre
 
aye, knowing and avoiding potential spoilers is always appreciated. :)
 
user10984358
well if you have time I suggest you give it a shot, I watched the English dub but the original is the best or so they say
 
I'm 6 episodes into Stranger Things 3 and, spoilers: there are some strange things going on
 
user10984358
now you ruined it for me
 
user10984358
5:10 PM
I thought you were helping me with PyQt
 
user10984358
bummer
 
My main thing acting as a barrier is the language.
I find it very hard to watch dubbed or subbed shows
 
My attempt to install Pyqt5 failed with 23 seconds left on the download. I need everyone to clap and believe about 15% harder
 
user10984358
English dub isn't bad bad
 
The mismatch between words and the motions just keeps distracting me
 
user10984358
5:11 PM
@Kevin doesn't it come preinstalled? I have the anaconda version
 
user10984358
@ParitoshSingh yeah I know a lot like you, attention to detail !
 
Dang, timed out a 1:01 left. I guess everyone's arms are tired
 
user10984358
everybody put your hands up
 
user10984358
funny enough thats a line from a anime opening (not a weeb)
 
Maybe I can download a wheel... I usually have better luck using Firefox's download manager compared to pip's, when my connection is spotty
 
5:12 PM
oh sorry, i wasn't participating. hands ready to be spared now
 
user10984358
I used to go with whl when pip was blocked in my college
 
user10984358
they just straight up block terminal internet access
 
riverbankcomputing.com/software/pyqt/download5 helpfully indicates that I can download a wheel via pip install. No help there.
 
user10984358
I heard installing PyQt on your own is a pain
 
user10984358
thats why this YouTuber (Sentdex) suggested he did videos with PyQt4
 
5:15 PM
it started raining again in Manchester (sobbs)
 
installing a lot of things on its own* gets painful honestly.
its for that reason that conda impresses me many times with how easy it makes things seem.
 
user10984358
the last time I had trouble installing was Hadoop for a course I would later drop
 
user10984358
never knew Hadoop was a java nightmare
 
Hmm, maybe if I put a huge number into pip's default-timeout option...
 
user10984358
no offense but dont you guys have like corporate level internet speeds?
 
user10984358
5:17 PM
makes my uni the size of my pinky
 
hahahahahahahahahaha.
 
if i had to take a guess, i'd say Kevin does not at the moment. :P
just call it a hunch
 
user10984358
I always assumed the people here are at jobs and hence had good internet
 
Blanket assumptions always go wrong. And it's also a question of where someone is at a given moment.
 
user10984358
timelines !
 
5:19 PM
Even if someone has a job, they may not be at work at that time. People from all timezones :)
timelines would be... too fancy even for room6 i'd imagine
though i shouldn't put it past Kevin i suppose.
 
user10984358
I just wanted to say that word :p its not every day you get to use that and not look like a comic nerd
 
user10984358
can I stop clapping my hands now?
 
I'll just say that not all workplaces have good internet and leave it at that.
 
user10984358
fair enough, dont ask a man about his internet speed
 
user10984358
or his paycheck or his age and a gazillion other things :p
 
5:22 PM
@Kevin agreed. ;)
 
Setting a huge timeout has caused the installation process to not crash during the last four half-minute internet outages I've experienced. Only eight or ten more and I should be good
 
if you're allowed to add some browser plugins or whatnot, you can try something that buffers downloads.
i think there were download managers that could do that
But i'd imagine you probably would need permissions to install extensions, so meh
 
user10984358
is PyQt installed on Colab?
 
user10984358
I mean its easier that way if it is
 
i'd imagine not.
 
user10984358
5:24 PM
let me just take a look
 
I can install extensions. But I don't think there's any extension that alters pip install's behavior.
 
@ParitoshSingh applied leave for tomorrow too.. :P
 
haha. Is tomorrow the rescheduled match day?
 
user10984358
even wheels are failing?
 
yep.. :D
 
5:26 PM
cool
 
user10984358
ohh cricket?
 
yep.. :)
 
user10984358
hope whoever you support wins
 
@ParitoshSingh my mgr is a fan too, it helps that way :D
@TheNamesAlc thank you :)
 
If you're saying "are you even unable to download the wheels from a web browser because of your spotty connection?", it's more that I'm unable to download the wheels from a web browser because pyqt's website does not offer any way to download wheels other than by using pip install
 
user10984358
5:28 PM
no no that aint what I meant, sorry if that came off as rude
 
I didn't find it rude. I just don't know how to interpret the question. I'm hard to offend and easy to befuddle
 
user10984358
well if its of any use
 
user10984358
pip install PyQt5
 
user10984358
at least it downlaods
 
user10984358
works in colab
 
5:30 PM
That is the command I've been using. It's currently running, but quite slowly.
 
user10984358
you could try Colab if you want
 
@Kevin I ended up just binging it on release even after pinky-promising myself that I wouldn't
 
There, it's done. --default-timeout=1000 really helped.
 
user10984358
lovely!
 
woohoo
 
5:31 PM
@roganjosh I watched four episodes yesterday despite my self-imposed two episode per day embargo. Such is life.
 
user10984358
well @ParitoshSingh think of Dark as a darker stranger things
 
user10984358
thats what people on the inter web say
 
stranger things is something i've been told to watch too, but as of now, i have a pending list of movies/shows to go through first. im focusing on movies atm
 
I really like the main story arc. The one-on-one dialogues became signals for a cig/toilet break by the end. I still preferred the 1st Season by a long way
 
Following up to yesterday's question, when linux users do a pip install xyz, does it install the package as root even when sudo not supplied?
 
user10984358
5:33 PM
it installs wherever your python is set up? I guess thats my belief
 
what does "install" mean in this context? because it's as simple as just placing files in a place.
 
user10984358
pretty much why pip fails at times without sudo
 
Stranger Things is fun. Someone told me Dark >> Stranger Things but I've just watched 2 eps and not feeling it so far
 
user10984358
I haven't watched Stranger Things, but from what I've been told by people who did both is that Dark has stories for all main characters
 
user10984358
not just the important ones, pretty much everyone in Dark has a story though not focused much in all episodes
 
5:35 PM
That is probably less true for season 3.
 
I don't use linux primarily, so if someone installs my package globally via a sudo pip install xyz. Then calls it normally w/o sudo then it would give an error, right? (I'll link to yesterdays q)
 
(And no, I'm not at risk of blurring out spoilers, I will limit discussion there)
 
user10984358
haha may be I will start binging stranger things after I am done with dark
 
yesterday, by aadibajpai
I have a file named unsupported.txt in my python package that gets exported when a user pip installs it. That file is supposed to update from the server on first run. However, a new unsupported.txt gets created in the directory from where the user runs the package instead of the one in site-packages being updated.
 
@Kevin +1
 
5:37 PM
Now running @TheNamesAlc's program... After I select a csv file, I get "Python has stopped working". That's not good.
 
In general I don't think any package readme says to use pip with the --user flag, in that case do you generally add it on your own or use sudo?
 
user10984358
@Kevin well it should work, are you at least getting the box?
 
I'm getting a window that takes up my entire monitor. It contains two buttons labeled "browse" and "quit", and one empty text box.
 
user10984358
correct
 
user10984358
well I guess the positioning might have an effect?
 
user10984358
5:39 PM
I used absolute coordinates
 
Right before it crashes, this gets printed to stderr: QCheckBox(parent: QWidget = None): argument 1 has unexpected type 'int'. I suspect this is because the csv I chose contains only ints.
 
user10984358
how to post an image here?
 
I figured I could just type whatever nonsense I wanted into the csv as long as it was valid csv, since you didn't specify. Is there some particular format I should adhere to?
 
user10984358
as long as it is an excel or csv it is fine
 
user10984358
even if there are multiple sheets
 
user10984358
5:42 PM
did you get the other file as well??
 
user10984358
the getColNames one
 
So if you create a file a.csv with the text 1,2,3 and open it on your machine using your program, it works? Because it doesn't on mine.
 
user10984358
let me try
 
user10984358
it fails O_0
 
user10984358
the first column must be header
 
user10984358
5:43 PM
put some strings
 
user10984358
a,b,c
1,2,3
 
user10984358
this works
 
Ok, I'll use that data... Once I load the second file and press k-nn, I get RuntimeError: wrapped C/C++ object of type QCheckBox has been deleted. Now we're getting somewhere.
 
user10984358
yes
 
user10984358
thats the error
 
5:50 PM
I have a theory. Stand by...
 
user10984358
alrighty
 
cabbage
 
Cbg
 
A QPushButton can have multiple signals hooked up to its click event. Every time browseFunc executes, you add a new signal, but you never remove the old ones. So when you finally click k-nn, it will execute all the partial self.setupData calls you established, starting with the oldest one. This is why setupData is trying to access the old check boxes.
One possible solution is to disconnect all signals from the button before adding the new one.
try:
    self.knnBtn.clicked.disconnect()
except TypeError:
    pass
self.knnBtn.clicked.connect(partial(self.setupData,fileName,self.checkBoxGroup,self.radioButtonGroup,self.checkBoxGroupCat,self.toPredictLineEdit))
 
user10984358
it is like a stack calls?
 
user10984358
5:58 PM
I mean they are all in a line waiting to be executed ?
 
user10984358
let me try that
 
is a down-vote in such questions not justified?
 
user10984358
I am only clicking the button once aint it? so shouldn't the latest signal be used?
 
@anky_91 what do you think?
 
No. Clicking the button once will trigger every signal event.
 

« first day (3188 days earlier)      last day (1775 days later) »