« first day (1870 days earlier)      last day (3302 days later) » 

00:01
I have about one page left to write in a twenty page paper - and I've got writer's block
ergh
00:13
@davidism I'm fairly certain my suggested approach is maintainable, but I was just wondering if there was a better way :) I just want to make it as robust as possible
I don't know what you consider bad about this way, and you've only vaguely described what you're doing, so I have no way to suggest anything "better". If it works for you, use it.
00:33
I'm building a test automation framework on a site that's likely to change in design, but the xpath elements I'm searching for through the pages should stay the same. If they change, I can just modify the xpath associated with say the login button and my tests should still work properly
 
3 hours later…
04:00
Morning!
cbg!
is there a shorthand for list.append() ?
is golfing
list += [something]
that fails a lot right?
What do you mean?
not sure, last time i tried that, it errored smth
04:28
Nope, it should work just like list.append
Assuming list is a list object, not the built-in list
04:50
> TypeError: can only concatenate list (not "int") to list
You're probably doing something like my_list += my_int
You need to add brackets: my_list += [my_int]
i'm doing list += [x for x in y]
y = list if ints
Hmm. I don't know, it works for me
0
A: The unique multiplication spiral

CSᵠPython, 99 bytes n=range(1,int(raw_input())+1);m=set() for x in n:l=[x*y*(x*y not in m)for y in n];print l;m|=set(l)

that is the deal, but ended up working with a set
shorter in the end
instead of flattening a list of lists
any ideas how to bring size down even more?
int(raw_input())+1 can be just input()+1
05:06
ty
05:16
input() is equivalent to eval(raw_input()), I see no need to call int...
ohh
credited in comments, bytecount went down
damn, only one byte with this hack... l=[len({x*y}-m)*x*y for y in n]
 
5 hours later…
09:59
cbg
Is zip a class or function, in Python3?
AFAIK, it is a function.
It's a class
AFAIK
@vaultah But it's mentioned in Built-in functions
Some of the built-in types are also mentioned there e.g. str
Oh yeah. However in Py2, it's a function.
Correct?
10:08
$ python
>>> zip
<built-in function zip>
$ python3.5
>>> zip
<class 'zip'>
Simplest way to check
:D
10:53
I want a simple python function which should read a text file and remove any filepath from it and return the result. I have already written a function. but waiting for optimized solution. — Bastin Robin 3 mins ago
^ ot/tb/code review
is it correct to say variables in modules (which are set by calling functions, e.g. datetime.now()) are instantiated when the module is first used/called and then persisted until the program exits, or does it happen when the program starts running?
How do we send SMS in Python without incurring charges? Are there API that can be used for this problem unlike Ozeki gateway which requires purchase?
11:40
is python.org 503-ing for you guys also?
 
2 hours later…
DSM
DSM
13:23
@MartijnPieters: you about?
@DSM: it's your lucky time slice!
DSM
DSM
:-) Problem's already resolved. Found a weirdly off-topic answer which had been plagiarized from another, and then noticed the poster had done it again, and then noticed that the site was currently being spammed with the one-line non-answer by a "different" user. But your lot must have already been on it for other reasons, because the probable "real" account was suspended only a few minutes after I flagged.
Yup, one of our freshly-minted mods just cleaned out a whole nest.
DSM
DSM
13:41
Good to see they're getting a chance to exercise their mod skillz early. ;-) Okay, then, back to bed for me -- this sore throat isn't going to heal itself. Cheers!
14:03
Hello Everyone
Hi Martijin
Hi Sana
I m stuck into prob, where it you expert can easily nail down
I'm new to multi-process programming
15:03
cbg
@Sana your question is yet unclear
which of the operations do you want to run in parallel
also it does not really make sense to just do 1 or even 5 simple sums in a thread, the overhead of threading is much larger
15:40
Hi Antti Haapala
My application looks something like dat
Its too big code to upload
cbg all
@AnttiHaapala I want run 5 sums to run in parallel
cbg
@JGreenwell could you give me an hint how do I achieve this
2
Q: Call function in 5 different thread and execute in parallel in Python 2.7

SanaThis is the first time I am using the multithreading in python. I found many documents in related to multithread and multi-processing in python 2.7.9 and researched also multi-threading link. But I didn't get clue how to implement my application. I am having application based on self.count, whic...

I saw the earlier link, you do not need to spam it....and actually I already commented on the answer before I entered chat
Yes, but I didn't get any clue related to my app
15:59
@Sana Please do not specifically target new users looking for help as they enter the room. It's extremely rude and you'll just be kicked out.
@Sana If you posted a question, chances are that it will be seen by many more people than if you "pimp it" in here.
I would suggest reading through that linked answer he provided and trying some of the things it suggested and updating your question with this (for instance actually using the threading module and/or Queue)
16:36
do you have to use 2.7?
if not, I would suggest using 3.4+ with concurrent.futures
Other than that, twisted is a pretty good framework for event-driven and async programming
<frustrated-from-pep8-question>
I have got a long url that I want to put in a comment, and it exceeds 80 chars. What to do?
</frustration-not-yet-over>
16:59
@AwalGarg Accept that it's not an absolute rule, but instead a collection of suggestions?
It's really not something to get frustrated over.
But if PEP-8 check is part of the build process?
Then you have a stupid build process.
Which is taking a collection of suggestions and making them absolute rules - that's fine but then you have to pay the consequences and follow your self-imposed absolute rules.
Lets say we have a open-source project and when people contribute, we try to enforce common best practices.
17:03
Ok
Wouldn't it be better if PEP-8 check is part of the build process?
Yeah that's fair enough, but then follow the rules.
It's fine to self-impose PEP8 as a set of rules, but you then have the consequences of that.
I personally take parts of PEP8 and aim to follow them, but if I don't/can't then I don't get upset. One of the parts I absolutely ignore is the 80 char limit FYI.
Yeah, I do 120 on all of my projects.
@Ffisegydd I try to follow it
Yup, I agree. With wide monitors, having 80 chars limit is kinda restrictive.
17:06
I have a big enough monitor where I can fit two 120 line files next to each other and still have some space.
Even with smaller monitors I just use line wrapping (or whatever it's called).
I can't do line wrapping. It throws me off.
@MorganThrapp Vim does that for me these days :D
But back to the original issue: If you want to follow PEP8 to the letter then you need to hack together some smaller url (either by breaking the url or by using tinyurl or similar)). I personally suggest you just abandon the 80-char limit, your life will be so much better for it.
@thefourtheye I've had to learn vim recently so I can do git rebase -i. I finally got to the point where I don't do anything by accident.
17:09
git accidents are the worst :(
I should add a caveat to this: be sensible in your ignoring the 80-char limit. Don't make a line 400 characters long. Common sense prevails.
Yup, 120 seems a reasonable number these days.
17:20
@Ffisegydd I am getting frustrated over the tooling, actually. my editor be like "Y U NO 80 CHAR NOW GO DIE"
@AwalGarg PyCharm?
PyCharm defaults to 120
@Ffisegydd I used Pycharm for a while, but figured it doesn't help me much so switched back to sublime text. Pycharm must have had the ability to switch that warning off, but I am using "Anaconda" for sublime text, and its docs are pretty scarce.
So I need to figure out how to turn that warning off, or expand the limit to something better.
I know with sublime you just set the user preferences "rulers", "word_wrap", and "wrap_width" but I've never used the Anaconda plugin
I think my bigger problem with the 80 char limit is that numbers are absolute, and procuring them out of thin air causes havoc. If my line is 82 chars or so, it is still as good as a 75 char line which your editor/IDE will let through, but not the 82 char one and I have deal with ugly warnings which harm readability.
18:08
@AwalGarg Have you found the Anaconda docs here? The default .sublime-settings file is fairly well commented, and there's more info on the website. You can look up the docs for pylint, pep8, pyflakes, and pep257 to see which codes to enable and disable.
18:51
Hi everyone, I have a Django question... my form isn't rendering so I'm wondering what I'm doing wrong here: gist.github.com/Flobin/79599ccb7ec1d6bbd9ff starting from line 42
19:50
cbg all!
cbg shuttle
did you end up getting past that writers block from the other day?
yes/no, mostly done with it now just editing and adding test cases
yep, easy (mind you tedious) work is all that's left. Then I get to look forward to the other two papers due next week ;)
are the help vampires especially bad on Sunday or is it just me?
20:04
cbg
@JGreenwell got an example?
cbg Antti
which is probably my fault for answering a non-python question
yeah that's fairly brutal
HI, I have a bug with multiple inheritence
pastie.org/10590072 => stacktrace
testNetwork.py pastie.org/10590072
I would like to use multiple inheritence, I try to use the synthax parentclass.method(self, atributes) but I have an AttreibuteError exception
20:23
It seems that the file that you think is a stacktrace is not actually a stacktrace.
Incidentally io is the name of a Python builtin, so please avoid naming your files that.
pastie.org/10590077 witrh proper link
user559633
20:51
can someone sanity check my python RQ usage? gist.github.com/tristanfisher/39af9b7f77e8e3cac10a the tl;dr is "jobs get enqueued, but my worker process isn't pulling the tasks off the queue afaik"
sometimes I win and sometimes my code wins
9

« first day (1870 days earlier)      last day (3302 days later) »