« first day (2498 days earlier)      last day (2454 days later) » 
00:00 - 15:0015:00 - 00:00

12:59 AM
Hey, can someone help me out with Cx_freeze i have a problem excluding libs from my build.
 
Hey, can anyone help me with tkinter frame change?
 
1:22 AM
Sorry and Sorry @Mike.G and @MD.FazlaRabby. I don't know what are you talking about!
 
@EnderLook thanks, i will manage, some how.
 
Anyone knows (and want to tell me) why functions inside class always have self like first argument.
(revomed)?
 
@Mike.G @EnderLook I have managed to solve it . thanks
 
@EnderLook because functions inside classes are methods, so they need a reference to the object they're being called on,
if you call foo.dosomething(), dosomething needs access to foo; it gets it through the first argument
 
Ok, thanks.
 
1:35 AM
some other languages have the `this` keyword which serves the same purpose,
but is kind of 'automatic', whereas in python you have to explicitly define the `self` param
 
Ok
I'll maybe ask absurde question, but... What is exactly a method? I am reading a guide and I see that word a lot of times but I think I am no getting the concept......
 
@EnderLook no that's a very valid question, but i'm not sure if i can explain it well…
 
Thanks, that make me feel a bit less bad :).
 
a method is a function that kind of 'belongs' to an object,
if you run dog.eat(dogfood), the dog object has an eat method,
compare with: eat(dog, dogfood)
 
ahh
I like more the first, I don't know why but seems... better.
 
1:42 AM
in the second case eat could be anything; a function that doesn't belong to the dog object; it could have nothing to do with dogs
 
ok
Do you know why some "commands" (I don't know another name for this, for now) like append or pop are like methods (something.append()) but others like random.shuffle() not? Both affect exactly the object with they are working, one add an item to the list, the another delete one item from the list but before return it and the last shuffle the list. All of them work "around" the list and nothing more.
 
i think the reason is that python doesn't really have a way to extend objects with extra methods,
the random library can't go and add a shuffle method to the list class
 
You have right, it would be something strange.
 
and Python doesn't want to include shuffle in the list library for whatever reason
 
Interesting
 
1:51 AM
disclaimer: i'm kinda guessing here, since i don't know python very well
but i know other languages that *do* support extension-methods
 
I don't know why I just remember this, but did you read this PEP?
 
well i was only 14 years old at the time, so probably not
 
I 8!
I read that the last month.
I was searching "easter eggs" of python.
 
those python guys, they think they're hilarious
 
2:09 AM
class Mapping:
    def __init__(self, iterable):
        self.items_list = []
        self.__update(iterable)

    def update(self, iterable):
        for item in iterable:
            self.items_list.append(item)

    __update = update
__update is used before been assignated, that would work?
 
@EnderLook what makes you think __update is used before being assigned?
 
---> __update = update
That is 5 lines after not before.
 
@EnderLook but self.__update(iterable) is inside the __init__ function,
__init__ doesn't run until you instantiate the class
whereas __update = update will happen straight away, since it's not inside a function
 
@Cauterite First are read the whole code and then function are executed?
 
yeah, i guess the whole code is 'read' first,
then when you create a `Mapping` object, the `__init__` function will execute
 
2:20 AM
Ok, thanks!
It's late for me, I've to go to bed because tomorrow I have to go to school, but could I make you a last question? (I'll read it tomorrow). This question is foolish: What is the plural of class? Classes? English isn't my main language so I am not sure. Thanks in advance.
 
@EnderLook you're right, it's "classes"
 
Great! Thanks.
But now I'll go to bed... bye!!!
 
cya
 
 
3 hours later…
5:42 AM
cbg ya'll
 
bedtime rhubarb
 
6:00 AM
Am I dense, or is this a bit over engineered: stackoverflow.com/questions/45742318/…
 
6:50 AM
@IljaEverilä Just a simple typo after all.
 
cbg or whatever the mandatory greetings are today. Can anyone for me check my edit here. I was a bit annoyed by the laziness of the OP so set out to make the improvement edit myself. But I'm not a Python/Django dev at all so I basically googled and tried to piece together what was going on in that snippet but I could have easily missed the complete point. Feel free to edit if I screwed up (or even rollback if it is useless).
 
Cabbage
@Rawing. Not quite, Justin's trying to do type testing, but he's comparing the type object with the repr of a type object, which is obviously not going to work. (This is in reference to stackoverflow.com/questions/45750282/int-function-not-working )
 
@rene was wondering what room I was in there...
 
7:06 AM
@PM2Ring Isn't that exactly what I said? number(4) gives him a number, which he compares to a string.
 
oh I love my golden hammer
 
@Rawing No, number(4) gives him a type, and due to the division it will return float if you pass it an int or a float.
 
I wish we could have rep for that
 
Ooooh, you're right. I must still be sleepy.
 
the OP could accept the duplicate...
 
7:12 AM
@AnttiHaapala Being able to hammer dupes is its own reward. ;)
But I agree there should be rep & badge incentives to encourage people to search for good dupe targets.
 
cbg-mo'
 
@AnttiHaapala Often, the OP will be the person least qualified to judge the relative merits of a proposed dupe targets, but I guess it wouldn't hurt to give them the ability to reward people who direct them to good dupes. And if the OP has enough rep I expect them to cast upvotes on the good answers (and possibly the question) at the dupe target.
 
cbg
 
hmm
actually I am not sure again if it is a typo @IljaEverilä :D
how wasit :D
prolly unclear :D
well, it doesn't matter :D cv is a cv :d
 
7:20 AM
@AnttiHaapala Depends. It is the 2nd time I've seen people forget to write the Column part, effectively having foo = (Integer) or such. But that question would not be something you'd find if you'd search for "Why is my model object attribute returning the type instead?"
 
Good but no good, you could have googled something like "typedef declaration ordering". — Antti Haapala 12 secs ago
sigh
5 upvotes
@IljaEverilä but there was a question beyond that..
 
You mean the "not returning columns with NULL values"? :P
Which actually meant "These 2 columns of my model objects just return the type", if you read the comments. The whole a, b, c example is not even related as far as I know.
So it is both convoluted and a typo...
 
The thing that confused me the most was that they have query = session.query(UPREFERENCE), where UPREFERENCE is a model class, but were saying that it doesn't return individual columns.
As if querying for tuples of (a, b, c), but receiving only (a, b).
 
I marked the Q as a dupe 12 minutes ago, first answer 20 seconds later and second 4 minutes later...
 
7:34 AM
@AnttiHaapala Huh? I knew there was a grace period, but that's ridiculous.
 
and the authors are now relearning the stuff that they themselves could have read from the dupe target.
and ... sourav has 8k score in
felix is a mjölnir-wielder too
 
And neither of them have mentioned that although syntactically typedef is parsed as a storage class specifier, that's really a quirk of the syntax, and semantically typedef does a different thing to the actual storage class specifiers like global and static. But this isn't really a topic for the Python room. ;)
 
and I am not talking about specifically but the phenomenon
that is kind of past now in
 
@AnttiHaapala Understood. And you didn't start talking about C syntax & semantics, I did. I just wanted to mention that those answers don't mention that point (which I think is reasonably important), but I also wanted to make it clear that I wasn't trying to start a discussion about that topic here. ;)
 
7:53 AM
no worries @jon I won't make an habit out of it...
 
Yeah... please don't... Puppy gets easily enough confused as it is @rene :p
 
wow Rene is here
 
8:07 AM
@AnttiHaapala Oh dear. Surely someone with that much rep knows what with does? OTOH, his Q/A ratio is 166 / 61...
 
@PM2Ring yesterday I saw a quite socratic guy...
he had 800 questions and 1 answer...
20k rep
23.2k 88 205 312
Calendar day @Tim... As explained in the meta post you were linked to in the comments on your question. Starting to see why you're hitting the question limit :-P — Jon Clements ♦ Jul 6 at 14:05
 
Ahh... yeah... had forgotten about that...
 
813 questions ...
 
Wow. 23.2k & 88 goldies. All from questions...
I guess this OP tried to post multiline code in a comment: @PM2Ring here's the code import random – kislay1812 6 mins ago
 
8:24 AM
@PM2Ring and bad questions too ... like "does \d mean a digit..."
 
cabbage!
good question doesn't equate to famous question. Good question to me means something that is well prepared and ready to be answered. Good question for votes means maximizing google traffic (obviously not that simple, but...). Still, 80 famous questions. I've got 200 questions and none even close to gold famous.
 
8:41 AM
cbg
@rene I see that now you don't polish poo but instead sculpt from it ;)
@Ffisegydd ha!
 
9:30 AM
rbrb... last thing i read b4 sleep is sculpting poo... my dreams are going to stink
 
rhubarb
 
@piRSquared fair point
 
@SaravananN \o
 
i have upgraded django 1.6 to 1.8 . when run test getting these warning Model class sms_credit.models.SmsCredit doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9. i tried these solutiuons stackoverflow.com/questions/31179459/…
20
Q: RuntimeError: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS

Tahmid Khan NafeeI am building an application with Django Rest Framework and AngularJs. I am using Django-rest-auth for my authentication purposes, although, I have not been able to set it up. Anyway, I am trying to set up this app with my project. I realized I need to install django-rest-auth-registration to get...

 
9:46 AM
Hey @AnttiHaapala "We have a very large service that has nearly 10 million Python lines. Now we want to port it on Python3." At first, I thought: "That's excellent!"
See stackoverflow.com/questions/45753466/… It sounds like his Python 2 code is full of bad Unicode handling, and so now he wants to modify the Python 3 interpreter so that it will ignore the garbage. :( I realise that fixing it is probably a huge task, but still...
 
Why does he want to upgrade if he wants to break the interpreter instead of fixing the errors then? o.O
 
"we want to port it" != "I want to port it" ;)
 
@ByteCommander Well, they know that Python 2 won't be supported in a couple of years, so they need to migrate to Python 3. But they've discovered that their Unicode handling is borked, and perhaps they don't understand why, or how to fix it properly. But even if they do understand the problem, it's probably a massive task to fix it in a codebase of that size.
Even when Unicode stuff is done correctly it's not easy to automate its conversion using 2to3, and when it's broken, well, you just have to kill it with fire and re-write it from scratch.
 
Yes, but... isn't it better in that case to stay with a standardized Python 2 than to write a customized ("broken") Python 3 interpreter on which it can run, but nowhere else?
 
Always a bad idea to write your own modified interpreter if there's any other way out of your problem. I've had clients who did it (for example, the one who modified floats so only one copy of each value was saved), but their needs were extreme.
 
10:05 AM
@ByteCommander Indeed. Modifying the interpreter so it will ignore the problem isn't a good plan, but I guess it's a useful stop-gap measure while you migrate your code. That way, you get the other benefits of Python 3, and have some time to fix the Unicode problem correctly.
 
But then it "works" on something labelled "Python 3", which is a good excuse to leave it as it is...
 
I find it a bit strange that they have Unicode problems. People who normally only deal with ASCII may not test their code properly to ensure that it does the right thing with Unicode. But from the OP's English & his name, I assume that his main language needs non-ASCII chars, so I don't know how they managed to make the code work correctly on Python 2 without at least a basic understanding of how to do Unicode.
Sure, it's possible to get it half-right if you only need stuff in Latin-1, but I'd expect big problems if you don't do it properly if you're working with, say, Arabic.
 
Cabbage!
 
10:33 AM
@PM2Ring my thought too...
What you want to find out is where these unicode exceptions are being raised. For example, if your locale is not set correctly on Unix, there can be Unicode errors when writing to stdout - this can be fixed by setting locale correctly. Google for the exact error message with site:stackoverflow.comAntti Haapala 1 min ago
@poke cbg
 
11:02 AM
halp, where do I tell python where to look for shared object files? And will googling this question give me an answer?:D
 
LD_LIBRARY_PATH
probably
 
thanks
 
but python would look for so's in all the right places usually?
 
yes, that's what I'd expect (but I'm trying to install vtk manually)
I don't want it to mess with the rest of my vtk stuff so after building it I copied the libs manually to /usr/lib/python3/dist-packages
but now it doesn't find my .sos there:/
if I cwd there I can import it, but not from elsewhere
 
11:06 AM
I know this is bad but vtk started it and it deserves to be in pain
$ cd /usr/lib/python3/dist-packages/
$ python3 -c 'import vtk'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/vtk/vtkCommonCore.py", line 5, in <module>
    from .vtkCommonCorePython import *
ImportError: libvtkCommonCorePython35D-8.0.so.1: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/vtk/__init__.py", line 41, in <module>
it might or might not be related to the local imports..
 
yea
LD_LIBRARY_PATH=/usr/lib/python3/dist-packages/ python3 -c 'import vtk'
but wtx you're putting them in dist-packages
dist-packages is for ubuntu/debian/etc to put its apt-get garbage into
 
11:20 AM
it was already there:D
I don't want to mess with pip, I want to mess with debian
@AnttiHaapala same error
and the dir had already been in my sys.path
 
LD_LIBRARY_PATH=/usr/lib/python3/dist-packages/vtk python3 -c 'import vtk'
typoed
@AndrasDeak
 
11:39 AM
Is this true? shutil.copyfile('FileToCopy', 'NewFile').
 
@EnderLook What do mean "is this true"? What do the docs say about that function?
 
@EnderLook copyfile returns None so copyfile(…) is True is false.
 
@poke In Python 2 it returns None, but I just discovered in Python 3.6 that it returns the destination filename, although the docs don't mention that.
 
I ask if ` shutil.copyfile()` would copy the first file and create a second file with the second name.
 
cbg
Why are you asking a question that you can answer for yourself by reading the docs docs.python.org/3/library/…
 
11:53 AM
@EnderLook And I asked you: what do the docs say about that function? Why ask us when you can read what the function does in the docs?
Imagine that you won a programming contest and the prize was $1000 worth of the time of a think-tank consisting of some of the best Python programmers in the world. Would you waste your prize asking them basic questions like that?
We don't charge money for our expertise, but we expect people to not waste our time, and to "pay" for our knowledge by asking good, well-formulated questions that will give us some satisfaction in answering.
 
@EnderLook - perhaps you are new to Python and were not aware of the depth of detail in the online docs? Or the docs are written in a way you have a hard time following? Or you are reading someone else's code and found something surprising? (If you don't respond soon, I'll have to keep guessing, but the guesses will start to get ridiculous.)
 
He must be having a hard time escaping the vast sea of information in the docs.
 
Answer of the day:
0
A: Spaces in file output in Python

Omri ShayoAlso, you can try \t for tab: f.write("\thallo") I find it more elegant using tabs.

 
I think ~ is the most elegant ASCII character
 
12:12 PM
it's also the sign for home, sweet home
 
I guess we scared off poor EnderLook - on his profile he's just a high school kid. Still, you have to be able to ask a decent question.
 
He's doing a lot better than I did at that age. Takes new programmers a while to figure out that you should read stuff even if looks like a lot of text.
 
@PaulMcG without reading the transcript I'm pretty sure they had it coming
@AnttiHaapala hehe I completely missed that
it's magic, and it's working
thanks
I'm afraid I'll have to let this crap install itself :/
gotta go for a while, rhubarb
 
I wasn't intending to drive EnderLook away, but I did intend to chastise him for not doing basic research. OTOH, English is not his mother tongue, and maybe he did check the docs first, and was just asking us to verify that his understanding is correct. I was expecting him to respond to my "what do the docs say" questions, but maybe he got confused due to the language barrier.
 
@PM2Ring crazy shit
@PM2Ring That’s not a lot of time actually.
 
12:35 PM
@poke Agreed. Lots of people don't realize what a valuable resource we're giving away here.
 
12:45 PM
@PM2Ring I was reading the Spanish guide and it only says shutil.copyfile('datos.db', 'archivo.db'), no explanation, only "It is useful". Now I have checked the English one and it's more complete. Sorry it wasn't my intention waste your time.
 
@PM2Ring now it is easy to submit a pr :D
 
@PaulMcG Yes I am new. The Spanish guide was incomplete I didn't want to search in the English but now I understand. Sorry for take so long time, I am in school and our teacher gave us some work.
 
@EnderLook No worries. I forgot you're using the incomplete Spanish docs. Maybe you can become a Python expert and improve those docs. ;)
 
The most strangle thing is they are partially translated. Sometimes the code is half-English. I now that codes weren't tested because they can't work half and half...
 
cbg
 
imgFrame = np.array(imgFrame, dtype = np.uint8)
TypeError: long() argument must be a string or a number, not 'NoneType'
 
    def getRep(self, imgFrame, multiple=False):
        bgrImg = imgFrame.copy()
        #imgFrame = cv2.cvtColor(imgFrame, cv2.CV_32F)

        imgFrame = np.array(imgFrame, dtype = np.uint8)
Does anybody see what I am doing incorrectly?
bgrImg is not empty I can display the image in question
 
Looks like imgFrame is None?
 
I guess that's not yet supported. @ThiefMaster do you happen to have a patch for that, or did you drop dbcli?
 
I never started using it that much. PyCharm's database integration is very nice :)
 
@Rawing problem solved :)
 
\o cbg
I got an email from a project manager I'm working on asking with a technical term in their question. I ask them for a clarification on what they mean with the term since the dev team never uses that term. PM tells me to ask a dev because they can't answer for the devs... I am a dev.... and I have no idea what they are talking about .... why would someone ask a question when they don't understand their own question? /end rant
 
1:30 PM
@PM2Ring I should look into the officialness of those docs. IIRC it belonged to an "Argentinian python community" or something
if it wants to seem official and it's broken, that's not good
 
Last day before my 4 day weekend :( oh god 8 hours needs to hurry up :d
 
@Antti the penny finally dropped that this has little to do with python stackoverflow.com/questions/1099981/…
so I might just set the library path in my bashrc/profile
 
1:49 PM
@AndrasDeak Is there a way to update it? I want to fix some translation errors.
 
cabbage all
 
\o cbg, how goe sit
 
I'm already sitting.
Oh, how? You just need a chair.
 
And a pair of the bum stuff.
 
oh lord my thumb is to eager to hit the spacebar, his alcoholism is out of this world.
 
1:58 PM
@EnderLook I suspect you're even better equipped than me to find out
 
Was there a post announcing the mentor chat rooms?
 
It's "invite for applicants"
 
Oh, there's a "sign up here" link.
Seeing those rooms so far, I don't think I'm signing up.
 
Yeah.
 
This week marks 1 year at my latest job, doing internal Python development for automated network hardware testing. (Still) having a great time!
 
sounds awesome:)
 
Is pass the equivalent of Javascript's return when I want to just abort execution of the function?
or would it continue executing the code below in the function?
 
No - it is more likely equivalent to a bare ';'
It will continue executing the following code
 
Ok. So I should use a return then?
 
2:20 PM
sounds like it, yes
 
"abort execution" - perhaps you want to raise an exception?
 
or that ^
Paul'ed by Kevin Kevin'ed by Paul
 
Yes, maybe. I'm too use to JS to be thinking about exceptions :) Thanks guys
 
I thought JS has exceptions too
perhaps the culture is different
 
Yeah it does but it's not widely used, at least not in the same way as in Java or Python
 
2:22 PM
I see
 
If a method fails it's more likely to return undefined than throw anything
 
this might be useful then for idiomatic exception handling
 
Nice, I'll take a look at that
 
(it's just the official tutorial but it's both short and informative)
it's also python 3, change the url if you need 2
 
I don't like the example on that page with the bare 'except:' though. I would prefer to see 'except Exception:'
 
2:24 PM
hmm, I specifically remembered that it says "don't do that" in one place
guess I should've checked (considering how that was my main motivation for linking it...)
 
I see more except Exception than without the Exception in the examples
 
My thoughts also - for someone new to exceptions, it is tempting to just wrap try: except: around things
 
@simeg yeah, definitely; only catch exceptions that you know how to handle
I should be using more try-except-else blocks
 
To me exceptions are a bit confusing, like when to throw, catch etc.
It feels like a very context based decision
 
Ah, the example is prefaced with the "use bare except: with extreme caution" paragraph, and also reraises, which is tolerable
 
2:26 PM
@PaulMcG there really should be a warning about that in the tutorial
@PaulMcG ah, tricky, I was looking for the warning after the block
cue Dr. Strange gif
@simeg in most cases it's really simple: "hmm, this file might not exist -> try/except, and do something relevant in the except block, like raise another exception with a more informative message"
or "hmm, this might not be convertable to a numpy array -> try/except, and tell the user how they're being dumb if the input is wrong"
 
@PaulMcG Well, it does say to use bare except: with extreme caution, and to only use it at the end of a chain of named exceptions. It also suggests that you should re-raise the exception, I'd probably make that suggestion a lot more forceful.
 
then again I'm not a professional, so maybe I'm speaking garbage here :D
 
@PM2Ring - yeah, I saw that, and already admitted my shame ^^ - and I agree, boldface+larger font is not too much to emphasize this
 
@AndrasDeak Yes, you're right. Those examples are pretty straight forward since they are IO related. But there are other cases (I tried coming up with any but I failed) that are not as simple. Maybe I just haven't understood Exceptions fully yet.
 
Jul 17 '15 at 12:55, by PM 2Ring
In accordance with the ancient programmer proverb: Never test for an error condition that you don't know how to handle.
 
2:32 PM
Time to learn Flask...
 
@PM2Ring "Never test for an error condition that you don't know how to handle", not sure if I understand that. What is "test" in this context? And how would you "handle" this error condition?
 
@simeg - in general, thinking about exceptions gets you more on the path of exception-proofing your code. Exceptions will happen. While learning exceptions, also learn about context managers and the with statement.
 
In 2017, I think FGITW has been replaced with FFGITW...
(fastest fast)
 
Thanks guys for the advice, love coming here asking questions. Always such helpful people :)
 
Or maybe I have just grown / growing old...
 
wim
2:36 PM
Why flask? There are a lot more modern microframeworks avail now
 
@simeg for instance, you know your line can raise an OSError, but you didn't realize that it can also throw something else. If you catch more than what you expect, you can end up with a case that you're supposed to handle an exception and you're just ignoring it
 
wim
unless you need py 2 support ...
 
@wim It's part of the project requirement for Udacity Full Stack Nano Degree
 
wim
oh :(
 
I believe it to be the simplest to start out with, hence they put it up. I myself use Django for most projects.
 
2:37 PM
@AndrasDeak Oh I think I got it now, cool thx
 
for instance, open(dirname/filename,'r') might throw an OSError if the file doesn't exist, but it can also raise different exceptions if you forget to convert your strings to pathlib objects
 
Ok back to the return vs. pass thing I was asking about, here's the specific case I have
 
well do you want to end up with an exception, or do you want regular execution to continue?
if it's OK to just bail out from the function, return would be fine
 
when auto generating classes from other code is there a good reason why using metaclass=ABCMeta for all classes, even non-abstract ones would be silly? It saves a whole load of special casing
 
if something went wrong and that's why you're returning early, it might make sense to raise an exception that you can catch outside
 
2:42 PM
This is the main function, so I would just want the script to stop running. If I threw there would be nothing catching it
 
@simeg Here's the basic principle is. Let's say you're writing a function named my_func. And there's code inmy_func that could raise an exception. If it makes sense for my_func to intercept that exception and deal with it on the spot so that the rest of your program isn't affected by the exception, then it should do so.
 
@simeg ah. Well, if you raise, the user will see the unhandled exception in its full glory
 
Eg, my_func tries to read some parameter from a file, but that file might not exist, or that parameter might not be assigned a value in the file. So my_func could catch that exception and return a sensible default value. But if there's no way for my_func to supply a sensible default value then it should not try to catch the exception. Instead, it should let it bubble up, and hopefully code that called my_func, or that caller's caller (etc) knows how to deal with it.
If there's no logic anywhere in the chain of calls that knows how to deal with a particular exception, then the program should terminate with an appropriate error message, rather than continue silently, churning out erroneous results.
 
wim
presumably you have some code that does for price_change in price_changes:
if that's all that's there, it's ok to let it also just work with empty list
 
word
 
2:44 PM
@AndrasDeak But it's expected to not have any price changes most of the time. Is an exception to be expected most of the time? Feels weird
 
no, it's not
AFAIK it's also inefficient to keep raising stuff all the time
 
@idjaw \o cbg how goes it
 
if the function is supposed to work as "do thing, unless there's nothing to do", it's fine to just return
 
Exceptions should be, well, exceptional. If they aren't, that's generally a sign that you need to redesign your logic.
 
@wim That would work, but I'm passing in price_changes as a whole array to another function so I can't use that
 
2:45 PM
For some weird reason bash errs with venv when parent directories have spaces in them
 
but you also need to consider if there are different return values for the two cases, and test for None return value in the no-op case (in case it matters whether the function did anything)
@AshishNitinPatil double-quote?
 
ok I'll stick with the return then.
 
@AndrasDeak No no, not that
 
OK, just making sure
your remark wasn't enough of an MCVE for me to be sure ;)
 
yep, just a sec
(venv) ashish@Proness-Aura-2:/media/ashish/Storage/Study/Full_Stack_Nano_Degree/projects/4_item_catalog_application$ flask --version
bash: /media/ashish/Storage/Study/Full Stack Nano Degree/projects/4_item_catalog_application/venv/bin/flask: No such file or directory
 
2:47 PM
@PM2Ring Great explanation, I understand now. Thanks!
 
@AshishNitinPatil but those are underscores vs spaces
 
@MooingRawr great! hockey was wonderful last night. But I was damn exhausted...had a hard time last night on a few shifts.
 
are you a fan of bubbling up errors rather than just raise one detail error? Personally I prefer to error all the way back up.... ie if we have a chain of function call, in the inner most function call there's an error, and we raise an exception, should the other outer function calls raise any errors? personally I say yes.
 
bah, that's a bad mcve, I pasted stuff after I did the renaming. Just assume spaces there :-p
 
@idjaw use caps lock
@AshishNitinPatil OK:)
 
2:47 PM
@idjaw did you let anyone pass (you) :D ?
I find it weird you like to go for hockey on Thrusdays... seems like Friday would be tiring at work...
 
Also, that's not just for flask, but anything in the virtual env that I run
 
@MooingRawr ugh....I blocked a few shots, and one of them I blocked pretty well but it bounced right to the stick of someone waiting right in front of the goalie and they just put it in
 
even pip --version
 
@AndrasDeak you.....god dammit Andras.
 
wim
0
Q: Subclass timedelta within Django model field

n0rman0I have extended datetime.timedelta for some previous work to add the division operator. Having started using a DurationField in one of my models I would like to create a custom version which uses my extended timedelta class so that objects returned after a query include my custom timedelta class....

 
2:49 PM
@idjaw hockey gods weren't on your side for that goal I suppose...
 
Got resolved after I replaced spaces with underscores and reactivated venv
 
wim
WTF question of the day ^
 
the title alone. I'm not clicking that
 
Oh while on the topic of hockey, thoughts on the oiler's top 2 young gun making 21 mill a year?
 
good for them. we'll see what happens.
pretty crazy
 
2:50 PM
@AshishNitinPatil can confirm
 
mcdavid and draisaitl .... makes more than the penguin's top 2 .... but then again the pens has more talent I suppose.
 
it's a bit weird, but then again it's a crime against humanity to put whitespace in paths
 
yes, exactly why I resolved first before even diving into the research :-p
 
personally I rather my star players make under 10 mill a year, so I have more cash to get decent players to back em up... :\ hopefully Leafs' young guns won't cost so much and they recognize what it takes to win rather than cashing out.
 
nevermind
 
2:52 PM
I used python3 -m virtualenv :(
 
forgot to activate the env *facepalm*
 
XD
I had a good laugh, thanks
 
wim
put this in your bashrc
function ve() {
    if [ ! -d ./venv ]; then
        echo "creating venv..."
        if ! python3.6 -m venv venv --prompt=$(basename $PWD); then
            echo "ERROR: Problem creating venv" >&2
            return 1
        fi
    fi
    source venv/bin/activate
}
 
00:00 - 15:0015:00 - 00:00

« first day (2498 days earlier)      last day (2454 days later) »