« first day (2382 days earlier)      last day (2566 days later) » 
00:00 - 17:0017:00 - 23:00

12:00 AM
@Code-Apprentice the following works out to be True
In [74]: datetime.datetime(1980, 4, 23) < datetime.datetime.now()
Out[74]: True
 
So, comparing same "objects" would always be a good criterion
 
>>> None < None
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unorderable types: NoneType() < NoneType()
 
@AndrasDeak of course, with some exceptions for "None" is always applicable ;)
 
>>> {'a': 1} < {'b': 2}
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unorderable types: dict() < dict()
 
12:06 AM
@AndrasDeak You got me there! Btw, any idea why the set case turns out to be "False"?
In [78]: a = [1, 2, 3, 4]

In [79]: b = [3, 4, 5, 6, 7]

In [80]: a < b
Out[80]: True

In [81]: set(a) < set(b)
Out[81]: False
 
because for sets that's almost certainly subset test
>>> {1,2} < {1,2,3}
True
>>> {1,2} < {1,3}
False
lists/tuples/strings are ordered lexicographically
>>> [1,2,3,4] < [3,4,5,6,7]
True
>>> [3,2,3,4] < [3,4,5,6,7]
True
>>> [4,2,3,4] < [3,4,5,6,7]
False
As it is usual in python, every class defines __lt__ and the rest in a way that's straightforward, and when it's not they usually resist the temptation to guess
 
@AndrasDeak here 3 is clearly not less than 3 but still True. So, is it <=?
I mean, in the second list comparison
 
>>> [3,3] < [3,4]
True
>>> [3,3] < [3,3]
False
I think in case of equality it goes on to the next level, so in the first example it compared [3,2 ...] with [3,4 ...] instead of rejecting it outright
I'm sure there's a good reason for this
wouldn't be the first time that I'm confused by lexicographical ordering
it's consistent:
>>> 'ab' < 'ac'
True
>>> 'ab' < 'ab'
False
 
(y)
Great!
 
 
1 hour later…
1:31 AM
@kmario23 which brings us to the difference between a partial ordering and a total ordering
 
 
1 hour later…
2:42 AM
what are best modules for GUI in python?
what should i learn as a beginner?
in python
 
3:24 AM
You can try learning from the book Python Crash Course.
 
3:36 AM
thank you are there any Video tutorials?
 
3:50 AM
evening cabbage
@saigopi best is pretty subjective. Tkinter is builtin and relatively straightforward to get started. But it's ugly, and you have to build a lot of the fancy bits yourself
 
@saigopi The answer to that question hasn't changed since you asked the other day. ;) If you'd like more opinions, come back in 4 hours or so, when the room is more likely to be busy.
 
grumble grumble silly machines failing to build openssl and halting letsencrypt stuff
 
Have you guys tried any libraries/services to send SMS messages? I want to send myself a reminder when some code is done running...
 
@saigopi Is Python your first programming language? If not, have you done GUI programming in any other languages? If you're totally new to GUI programming I recommend Tkinter because it's relatively easy to learn and it's a good introduction to event-driven programming.
 
+1 to that
I learned all kinds of things by learning Tkinter
I also learned the dangers of mixing threading with Tkinter & its event loop :D
 
4:17 AM
cbg
@Mikhail you can try twilio library
 
4:46 AM
yeah tkinter is ugly and stupid and whatnot, but it's got the most learning resources and should be available without installation, and you could be pretty sure that if something bugs it is your code and not the library.
 
 
1 hour later…
6:15 AM
cbg
 
and recbg
 
6:39 AM
Hi everyone. Can I develop fairly complex OpenCV applications solely with IDLE, or do I need something more advanced?
 
7:05 AM
@konyv12 I don't like IDLE, and I've never been a fan of IDEs, I just use a fairly simple editor with syntax highlighting to do my coding. However, a good IDE is handy when you're writing a project consisting of multiple source files, especially if your're using complex libraries. Many people recommend PyCharm (although it does have some flaws). It's a commercial program, but there's a free Community edition available.
 
Thank you very much.
 
WTF. I just lost my faith in humanity.
 
Also, I have a related question. Why do people use Python for web development (at all?)? I thought its mainly for desktop applications and for the web there are better tools like node.js?
 
@konyv12 seriously, nodejs is horrible
 
Are you kidding me?
 
7:17 AM
I am using python for web development, but I am building applications
no, I am absolutely not kidding you
 
ok, would you mind telling me the reasons?
 
what nodejs does well is javascript
and some stuff that crosses client-server boundary...
like server-side rendering
beyond that, there is nothing it could offer above that of python.
 
but even big companies use node.js?
 
if you're building just a REST API say, then Python has got quite an edge
yes and even big companies use Python
 
cbg'ning folks
 
7:19 AM
aha. Python has the edge in what sense?
 
it is a better language, it's got more libraries than javascript, and the libraries are of better quality
 
can you guide me to a resource that would help me understand that?
 
the only thing where nodejs has any edge at all is sharing the same codebase on server & client
or packaging the client assets
for example I write webapps that need to use SQL databases for quite complicated queries
 
SQLAlchemy is priceless there. There is nothing comparable to nodejs yet as far as I know
docs.sequelizejs.com/en/v3 if this is the best attempt, then we've had this for Python for 10 years (+ more...)
 
7:24 AM
My favourite line from that clip is "All the complexities of assembler with the efficiencies of JavaScript".
 
Interesting perspective. Is the learning curve for web dev steeper for node or Python?
 
"You may recall sequential code. That's the code you can read. --- Your async program is like something from a 19th century Gothic horror story."
@konyv12 no, it is flatter :D
17
Q: What is the opposite of "steep"?

FixeeIn rock-climbing, we describe an incline as "steep" (which is anything from 90 degrees to overhanging) but we don't have a good word to mean "not steep". At least I've never heard anyone use one; instead people use convoluted phrases like "not too steep". I looked at the “opposite for 'steep le...

lol. yes, I had to google for it, but hey I'm not the only one :D
lol
 
How come, I thought Python is a long-standing language or whatever, used by many therefore it wouldn't be as hard to learn as Node.js that was just developed by some guy who left his job?
*would be as hard to learn as
 
*ah sorry I misread
@konyv12 the learning curve for web dev in Python is flatter.
nodejs is good for some bleeding edge stuff, flashy demos and when you need to do some high-performance stuff to optimize the delivery. It is however not the easiest choice for anything - especially for applications that do data processing or such...
 
@konyv12: put it this way: were I work we do not use node.js (but JavaScript is used widely, for client-side code). There is, however, a huge amount of Python. As for web development: I've been using Python for web development for about almost 2 decades now. Python is a general purpose language, so just as suitable for web applications as it is for anything else.
 
7:38 AM
javascript isn't a particularly good programming language either.
it needs to retain backwards-compatibility with much of the language that Brendan designed in 2 weeks in the 90s
 
Try to look at the larger picture; node.js had a great async story. But so does Python now, or C#, or a number of other languages.
 
Thanks for the insight
 
and much of the stuff needed to be reinvented for node that has only the async stuff - I don't want to write that async code most of the time.
my apps often do not need to scale that much - I prefer readable code.
 
 
3 hours later…
10:29 AM
I have been tasked with refactoring some code that uses the pandas library with excel sheets as the tables to use mysql database instead of the excel tables. My question is should I remove all of the pandas code, and start using sql alchmey. Or would it be better to use the pandas mysql code, like mentioned in the answer here? stackoverflow.com/questions/10065051/…
 
 
3 hours later…
1:24 PM
\o cbg
 
Cabbage.
I've just scored rather nicely on math.SE math.stackexchange.com/questions/2249407/…
 
I feel like that would be one of those test questions an instructor comes up with and doesn't quite think through :p
a very nice answer
 
Thanks.
I assume the instructor knew what they were doing. :) So they expected that some people would try to invert the equation (rather than simply plugging the given x value into the equation) and then find that they were stuck, like the OP. The moral of the story: read the question thoroughly, and make sure you understand what you're supposed to do before attempting to answer it. :)
 
PM, may I ask what you do for a living or if you were ever a math teacher?
 
1:43 PM
@MooingRawr I've never been a professional mathematics teacher, but I have tutored people semi-professionally. I haven't been employed for the last few years. I moved back into my elderly parents' home, and have been helping them out.
 
Oh I see.... welp I do hope you find a job that you would enjoy, if that's actually what you want. It seems like you and Marcus has a strong math background, so I was just curious.
 
I wouldn't mind some kind of programming-related job (ideally using Python), but I don't have any formal qualifications - I'm self-taught.
 
I always pictured PM existing in an abstract mathematical dimension a la that one episode of The Simpsons
 
:)
 
1:46 PM
Well you have successfully fooled me....
 
morning cabbage
 
@WayneWerner \o cbg Wayne, long time no see, how have you been
 
 
good, busy, but good
mostly busy :P
 
... But with better-than-90s CGI.
 
1:48 PM
@WayneWerner I'm on 144 for what-if and I'm utterly disgusted by it :D I want to skip it but I also want to finish reading everything.
 
:D
@MooingRawr Here's another hour (or 30 minutes on 2x) if you want some more of the what-if related goodness:
I guess there's also a TED talk that I need to watch sometime
 
Saved for when I get home, thanks :D
I watch a lot of TED talks on philosophy, some interesting poitns gets raised
 
cbg
 
\o cbg idjaw :(
 
cbg idjaw
 
1:53 PM
how we all doing today
 
fan-wise terrible :( Personally great :D
what about you ? did you do anything on the weekend?
 
great. Productive weekend doing a lot of house work. Fixing some things that needed fixing. Kept the kids busy. The weather was great! And all my hockey predictions have worked out so far. So, I'm on a roll.
 
talking about Ted, this is one of the best talk I'd ever listen to
 
Hi guys,
I'm having a surprising problem with the `mock` library.
Basically `mock.ANY` is not matching anything
Is there some special condition in which i can use it?
 
@WayneWerner You can save a couple more bytes:
from turtle import *;up();onscreenclick(lambda *t:goto(t)or dot(1));mainloop()
 
2:00 PM
@Makers_F do you have an example on what you are doing ?
 
lol, that got starred?
ok
 
\o cbg
for future reference, you can post code with proper syntax by high lighting the code and ctrl + k , but the code needs to be it's own msg.
 
So need to fix indents
 
also you can edit your questions within 2-3 minutes of posting.... this includes deleting too :D
 
def foo(a):
    from datetime import datetime
    a.bar(datetime.utcnow())

a = mock.MagicMock()
foo(a)
a.bar.assert_called_once_with(mock.ANY)
 
Please edit your posts instead of posting again
 
@MooingRawr You weren't the only one to find that What-If a bit icky. The forum thread's unusually short.
 
@Makers_F really? it fails? how does it fail o.o I ran that code and no errors came up... if I add an extra foo(a) and check it again for another assert_called_once_with(mock.ANY) it fails
 
user6845426
2:11 PM
cbg :)
 
DSM
Morning cabbage.
 
user6845426
0/
 
@DSM cbg T.T
 
DSM
@MooingRawr: yeah. :-(
 
2:13 PM
@MooingRawr Sorry, part of it was missing. The problem happens when you have it inside a namedtuple. I'll post the code in the next message
def test_datetime():
    from collections import namedtuple
    from datetime import datetime
    A = namedtuple("A", ["a", "b"])

    def foo(a):
        now = datetime.utcnow()

        a.bar([A(datetime.utcnow(), "b")])

    a = mock.MagicMock()
    foo(a)
    a.bar.assert_called_once_with([(mock.ANY, "b")])
 
Man...I am out of milk for my cereal. Guess I have to go to the grocery store.
 
If instead of using a datetime you use a string or int, it works correctly
 
@Code-Apprentice That happened to me recently....but it was my daughter who was asking for the milk...it didn't end well
I think it was that moment she realized the fridge is not a magic food making machine
 
You could try substituting water...okay that sounds terrible :P
 
I have been out of milk for two days
 
2:16 PM
you only have yourself to blame
 
Yeah... been busy
 
well enjoy your water cheerios
hope it was worth it
 
Joe
can I say in english : figures for deep explanation
 
can you explain what you are trying to say? I actually don't understand what you wrote
 
Joe
iam writing report in english and I want to say that i put figures in the report, the reason for that is to make it clear for reader ,, deep explanation
figures give more detail
 
2:19 PM
"Figures for clarification"
 
Joe
thanks
 
So you're asking if "figures for deep explanation" makes sense in English? Not very much
 
Joe
thank you
i will change it
 
There is a little bit of ambiguity here because "figures" can be used as both a noun and a verb but hopefully the reader can determine which is correct from context
 
It's also typically implied that figures are for clarification - you'll just see something like...
"Frobnosticate the widget with the foobar (fig. 1)"
 
2:21 PM
@Joe will you give a few sentences for context?
 
and then you'll have a drawing or chart with a title "fig. 1"
 
I do find it kind of unusual that you need to explain in the report itself that the report contains figures which are used to explain something to the reader. The entire point of a report is to explain things to readers. You don't necessarily need to describe the inherent purpose of a report when you write a report.
 
DSM
@Makers_F: FWIW your new code works for me.
 
Joe
@Code-Apprentice In Ch. 2 the general theory of piezoelectricity and the design of an ultrasound transducer is explained in detail with figures for clarification.
 
For the same reason that you don't often see questions on Stack Overflow asking "I have a question. A question is a sentence designed to elicit information from others that was not previously known to the author"
3
 
2:23 PM
@DSM I second DSM...
 
@Joe That kind of summary would make sense, assuming you're writing a summary :)
 
DSM
Oh, wait. Makers_F might be using some ancient version of python.
 
Joe
yes @WayneWerner
:)
 
@DSM I'm on 3.6.1 so not sure...
 
Perhaps "the general theory of piezoelectricity and the design of an ultrasound transducer is illustrated in chapter 2" would work.
"illustrated" implies that there will be an explanation in the form of pictures, although it can also be taken figuratively
 
Joe
2:24 PM
thank you
 
@Joe you can just leave out "with figures for clarification". Later when you are explaining, give a reference to the figure like Wayne's example
 
Or you could take the advanced college textbook route and leave it out because "the solution is obvious" when it clearly isn't
 
@Makers_F what version of Python are you on
 
@KevinMGranger ++1
love those
 
Joe
I see
thanks
 
2:26 PM
@KevinMGranger left as an exercise for the reader
 
This page intentionally left blank as an exercise for the reader
 
Crayons sold separately.
 
answers provides only to odd numbered questions....hardest problems are all the even numbers. Thanks text book.
 
@MooingRawr python2.7
 
Printed on special paper that is only compatible with proprietary McGraw-Hill crayons, $200 per pack, no resale allowed
 
2:28 PM
Ancient by Antti standards.
My monitor is propped up by textbooks, so I tell people I have the most expensive monitor stand ever seen
 
I tried running and it fails for me

Traceback (most recent call last):
File "t.py", line 15, in <module>
test_datetime()
File "t.py", line 11, in test_datetime
a.bar.assert_called_once_with((mock.ANY, "b"))
File "/opt/bb/lib/python2.7/site-packages/mock/mock.py", line 948, in assert_called_once_with
return self.assert_called_with(*args, **kwargs)
File "/opt/bb/lib/python2.7/site-packages/mock/mock.py", line 937, in assert_called_with
six.raise_from(AssertionError(_error_message(cause)), cause)
 
You called bar(A(<ANY>, b)) and expected bar((<ANY>, "b"))
 
Yeah, i want to match a namedtuple with a normal tuple, which contains an ANY for one field

I tried running with python3 and it works
Did something change in the eq between python 2 and 3?
try:
    import unittest.mock as mock
except:
    import mock
def test_datetime():
    from collections import namedtuple
    from datetime import datetime
    A = namedtuple("A", ["a", "b"])
    now = datetime.utcnow()
    def foo(a):
        a.bar(A(now, "b"))
    a = mock.MagicMock()
    foo(a)
    a.bar.assert_called_once_with((mock.ANY, "b"))

if __name__ == "__main__":
    print("Testing")
    test_datetime()
 
No, namedtuples and tuples should be comparable in python 2. Perhaps the difference is in the mocking code
 
2:37 PM
@KevinMGranger I tried passing a class which defined the __eq__ function and it was never called
 
Wait a minute, you changed your code.
a.bar([A(datetime.utcnow(), "b")]) versus a.bar(A(now, "b"))
 
Yeah, i removed the list to make the example even more minimal
 
Ah, I see you changed it in the assertion too.
You should start going through this with a debugger
 
DSM
Fortunately since I swore off answering Python 2 questions I can leave this in others' capable hands. :-)
 
Joe
is this english sentence ok ???
The thickness of the 5-MHz transducer is less than the thickness of the 1-MHz transducer. Deferent thicknesses give rise to different ultrasonic frequencies of the ultrasonic transducers.
 
2:43 PM
I would leave out the last "the" but otherwise it seems good to me.
 
Joe
thank you all
 
What's the closest close-vote reason to "it's right in the documentation which you obviously didn't read?"
 
Go back in time to when Lacks Minimal Effort was a close option
Those wild frontier days.
 
Why was that removed?
I just said "low quality" for this'n stackoverflow.com/questions/43590946/…
 
2:46 PM
People used it to bludgeon relatively good questions that they just didn't like personally
 
Now that @Makers_F has posted their question on the main SO site, I think all discussion about it should continue over there.
 
Sometimes I'll do "unclear what you're asking" for RTFM questions. In the sense of "I don't understand what part of this question actually needs to be answered by me that isn't already answered by the documentation"
 
@KevinMGranger Some people like "unclear", as in "it's unclear why the hell you're even asking this".
Kevin'd
 
Sometimes I wish there was a really size-limited text box to accompany why you thought it fit that close-reason
 
Yeah it might be nice to editorialize a little.
There's a custom close reason textbox, but if you use it, you can't use the existing close reasons.
 
2:56 PM
Isn't that custom reason only if it needs mod intervention?
That question is evolving too -__-
 
The UI doesn't indicate that "Off Topic -> Other" should only be used for Q's requiring mod intervention. But maybe it does signal a mod to come look at it? I don't know how it works from the back end.
 
Oh, I thought you meant "in need of moderator intervention"
Also, I don't have an "off topic -> other" option
 
@KevinMGranger Really? Right down the bottom: "Other (add a comment explaining what is wrong) "
 
This is what it looks like for me.
 
Must be a rep thing
 
3:05 PM
We might be in different menus. Yours says "flagging" at the top but mine doesn't
 
Oh, mine's flagging and yours is voting
Kevin'd!
 
You don't get "other" until you have 3k I think. Until then it's "blatantly off-topic".
 
@KevinMGranger get that 3K, bro. Start digging up those bottom of the barrel easy to answer questions, and get those internet points.
 
Y'all are too quick for me tho
 
you'll hate yourself for a while, but you get used to the shame.
 
3:14 PM
@KevinMGranger Sure, speed can be helpful, but it's possible to score well with a late but thorough answer.
 
There's 3 kinds of python questions I encounter:
1. Easy, already answered well
2. Should be closed
3. uses numpy / pandas
 
Just stay up at awake hours and hope you get lucky.
 
should be stars since it's you but meh....
 
DSM
To be honest, if I were starting out now, I don't think I'd have the rep I have today. Originally I was one of only a handful of people who could give (IMHO) decent answers to pandas questions. Now there's lots of people who can give workable answers and maybe ten I trust to give good answers. So the motivation's a lot lower.
 
3:17 PM
Stars give me more than just a brief quelling, though.
 
I had a very hard time ramping up to where I am now. I had to answer things I really did not want to.
 
Like DSM, if I were starting out now, I don't think I'd gain rep at the same rate as I did. But I chalk it up more to an internal change than a change in the site ecosystem.
If 2012 Kevin was transported to 2017 and given a new account, I expect he could hit 40k by 2022. But if 2017 Kevin was transported to 2012, he wouldn't get to 40k by 2017.
Even if we assume that he wouldn't ignore the site entirely and play the stock market with his future knowledge.
 
Joe
is this correct :
The acoustic impedance of the sample must be less than the acoustic impedance of the ultrasound gel. When that is applied then the ultrasonic waves penetrate easily through the examined sample
is it ok to say : When that is applied then the
 
I didn't know python in 2012
 
Joe
is applied is the correct word
 
3:21 PM
Actually, I have no idea what I should invest in if I had a five-years-back time machine. Time travel investment schemes usually involve Apple, but they usually take place farther back than the aughts
 
Uh, depending upon when it was in 2012, the only languages I knew were bash and... fortran. Would have been intersting.
 
@idjaw Saw things you didn't want to see, did things you didn't want to do. In short you worked with Python 2....
 
@Kevin you could infinitely loop and reinvest, no? Or does your body keep aging, resulting in diminishing life-returns
 
@MooingRawr No...I answered some pretty bad low quality questions.
 
In this particular scenario, powerful beings send me back in time five years exactly once in order to experiment with rep accumulation. I only get one shot before their funding runs out.
Let's say my body also de-ages five years, so results aren't confounded by my rickety 29 year old body
 
3:26 PM
That SO Meta question, When is it permissible to update other people's answers for Python 3? got me thinking. There are probably tons of old good questions that only have Python 2 answers which could be improved by adding a Python 3 answer.
But how can we encourage people to write such answers? It's not easy to get upvotes on new answers to old questions. And even if you do score a few upvotes your answer may be effectively invisible on ancient questions where the top answers have hundreds of upvotes.
 
Incidentally I started watching ReLIFE yesterday and it's about as wistfully depressing as I thought it would be
 
DSM
I haven't seen the anime but have been enjoying the manga. I didn't think you'd find it too bad though because the problems the two leads have are very different from the problems typical (no-longer-but-now-are) teens have.
 
@PM2Ring We just need five room regulars to answer old questions, and also upvote each other's answers to old questions. And we need a permission slip from the mods to excuse our blatant voting ring, because it's for the greater good.
 
Joe
am I using right verb in my sentence?????????????????????????
 
You could just hope that people are watching the "new answers to old questions" queue
 
3:29 PM
Also Re:LIFE did something most production teams don't do, they delayed the anime for one season so instead of producing and releasing once a week, they pushed it out all at once. :D Made binge watching it so much easier :D
 
@Joe Hmm, maybe "when that constraint is satisfied, then the ultrasonic waves [...]"
@DSM I give it 0.3 Fry's Dogs on the tragedy scale.
 
@Kevin I guess we could make them community wiki answers to get around the voting ring aspect, that rather undermines the motivation to actually write the answers. :) I don't mind spending time & energy doing stuff for the good of the site, but I tend to have more motivation when there's at least a chance of scoring some rep for my efforts. :)
@KevinMGranger And hope that they understand the Python 2 / Python 3 issues.
 
Or, if I need rep fast, there's always... SOD
 
I get my occasional +1 rep for the edit I did on a SOD once upon a time
 
A non-CW voting ring would generate answers and intrinsically incentivize people to participate. The only problem is that it's easier to write garbage answers than good answers, and the usual incentives for not doing that don't apply as strongly in a "let's all upvote one another" pact
One could form a pact to merely look at one another's answers, but not upvote unless it meets the reader's usual stringent criteria. But this reduces the expected upvotes-per-unit-effort ratio, so the incentive isn't as strong
Rational question answerers will still prefer to answer recent questions, which have the same quality criteria, but a wider audience
 
3:40 PM
It's simple: we'll have to kick out half of the regulars, and they'll just watch, and wait... being the heroes we need, but don't deserve
 
Joe
@Kevin thank you very much :) God bless you all
 
@Kevin I think that's a good compromise. We really don't want to be open to accusations of improper voting.
 
I'm only in favor of having an invisible martyr underclass as long as I'm not in it. /s
It's a similar structure to the cv-pls system in here. "Here, look at these questions and see if you think they should be closed, but don't vote blindly just on my recommendation"
Raising viewership without explicitly endorsing any particular action
Maybe a third of the time we can't muster up five close votes from a cv-pls plea, so that should give you an idea of how effective it is
(not that a 2/3rds success rate is bad, or that it would be better if it was higher, or lower)
 
cv-pls is allowable because it doesn't affect your rep though, right?
 
I don't know the official rationale for the cv-pls system, but that explanation fits the data
 
3:53 PM
@KevinMGranger It's tolerated because it doesn't affect your rep, or the rep of the person whose question you close-vote, but you're still expected to exercise your own judgement, and not just vote with the mob. OTOH, asking for actual down-votes or up-votes is a no-no. Even advising people to consider down-voting a particularly bad answer is skating on thin ice.
 
df2 = df[df['Manager']==nan] trying to find blanks in a column of names in pandas. Little help?
 
DSM
NaN by definition isn't equal to itself. You could do df[df["Manager"].isnull()] instead.
Better: df.loc[df["Manager"].isnull()], to make it clear you're selecting on rows.
 
@AndrasDeak @AshishNitinPatil The 100k swag is there only if you opt in to email notifications. If you've not, then you'll need to mail SE explicitly.
 
@DSM aha thank you so much
 
(Got some confo from Chris)
 
4:21 PM
Thanks :)
And brief transit cbg
 
4:39 PM
@BhargavRao where do I set that?
 
@Code-Apprentice https://stackoverflow.com/users/preferences/<userid here>
 
well i no longer have the highest S.O. score at my company
 
@JoranBeasley fight back :D go get your title back
 
welp.... you've tried, time for a drink :D ?
 
4:51 PM
On the bright side, it is written "if you're the smartest person in the room, find a different room". Being second from the top on the totem pole gives you incentive for growth.
 
That's why I hang out in this room :D
 
:P ... unfortunately he gets to work remote, so hes not in the same room, and hes on a different team :P
(well unfortunateatly probably isnt the right word) ...
 
a = [0,0,0,1,1,1]
b = list(permutations(a, 6))
b = set(b)
print(b)

Hi, I have this code to generate permutations, but it's rather slow on large sets of numbers. Is there anyway to speed it up?
 
This looks relevant: permutations with unique values. It's got a good amount of upvotes so I'm optimistic that it will be helpful
 
from itertools import permutations
a = [0,0,0,1,1,1]
print({x for x in permutations(a)})
is that cheating ?
 
4:56 PM
I don't think anything is cheating, I just need it to be faster.
 
or did i miss understand the question like always....
 
@MooingRawr well certainly I'd expect that to be a few cycles faster, but I think Link could really use a reduction in big-O complexity, which isn't easy if we keep using itertools.permutations
 
Well they have to be unique permutations, which is why I put them in a set
 
In SICP course using python, I read a proverb, saying "A language isn't something you learn so much as something you join. --Arika Okrent" How do I understand the meaning?
 
@Kevin hmm I see what you mean now ... see my last comment :D
 
4:58 PM
I interpret that as "a language is intrinsically tied to the culture of the people that use the language. You can't learn the language without also participating in that culture in some way"
 
@Link so you really want combinations, not permutations
 
00:00 - 17:0017:00 - 23:00

« first day (2382 days earlier)      last day (2566 days later) »