« first day (1584 days earlier)      last day (3363 days later) » 

5:12 AM
probably a stupid question but I cant seem to figure out if django-cms is available for django 1.7.. more like I do not know where to look for.
Cabbage Pythonauts!
got it Hopefully this year.
 
secret agent 15007
that was fast
@AvinashRaj WOWOW
 
I do not understand the reference of secret agent
 
my rep
but avinash got more than 350 rep since last night :D
 
Oh..
: ) Congrats!
 
I can now protect questions
yay
 
5:29 AM
trying to reset root mysql password
 
@Antti just wait until you get to 20k - deletion privileges!
 
@AnttiHaapala ???
congrats for passing 15k.
 
cbg
@AnttiHaapala You're welcome. :)
 
5:43 AM
Is there better solution to avoid error when I try to remove items not existing on list than try -> except: pass?
 
5:55 AM
use d.get function with none as an second argument.
 
@AvinashRaj XnIcRaM is removing from a list not a dict, lsit doesn't have a .get() method.
 
oh, i thought it's a dictionary.
 
@XnIcRaM try: ... except ValueError: is efficient and Pythonic. But be careful if you're trying to remove list elements from a list that you're iterating over; in general, it's not a good idea to do that.
 
if I have list ("a,b,c", "d,f,h","w,e,t") is there a way to fast add 1 element to all elements in list to get list("a,b,c,H",d,f,h,H","w,e,t,H")?
 
6:11 AM
[item + ",H" for item in lst]
 
[item + ",H" for item MyListName] and I have no error and no effect, nothing was added, problem is because my list is set() object?
 
@AvinashRaj how many accepts do you get each day:D
0
A: Optimized regular expression search in a text corpus in Python

Antti HaapalaYour algorithm runs in O(n) time. This seems so wrong, when a simple binary search could do O(lg n). If your regex does not contain special characters, why not: import bisect with open('dictionary') as f: dictionary = f.read().split() dictionary.sort() def in_dictionary(key): i = bi...

 
@XnIcRaM You originally called it a list, but you wrote it like a tuple, but now you're saying it's a set! Please try to communicate more clearly!
Anyway Matt's code will work, whether lst is a list, tuple, or set but it doesn't update the original container. It creates a new list. So in older versions of Python you can do myset = set([item + ",H" for item in myset]), in newer versions you can do myset = {item + ",H" for item in myset}
 
6:27 AM
sorry I'm new for python and I don't know that set is not list
it's work when I write MyListName = [item + ",H" for item MyListName], i event don't know that I need "MyListName =" :), thanks for help
 
In Python, a set is similar to a list but it is an unordered collection, so you can't get elements from it by indexing. Also, each element in a set is unique, so if you have a set {'a', 'b', 'c'} and you try to add another 'a' to it, nothing happens. See 4.9. Set Types — set, frozenset
 
@AnttiHaapala minimum 8
two days before, i get a maximum of 20 accepts. That was my highest.
 
6:43 AM
@AnttiHaapala After reading the comments on that question & on Padraic's answer, it's pretty clear that the dictionary file that the OP's using is already sorted.
 
ofc I do nt get any upvotes for that
bc it is a good solution
unlike the "shortcircuiting-does-nothing"
 
@AnttiHaapala Don't speak too soon. :)
 
7:12 AM
hey, installing python package using subprocess is correct way? like

`subprocess.call('sudo apt-get install python2.7')` though, this gives error
I am just trying to install packages in python script, rather on command line terminal
 
@user123 , shell=True
 
Hello. JayJay123 here. You wanted to know what I am using variable variables for. Still wondering?
 
>>> subprocess.call('sudo apt-get install firefox', shell=True)
1
but there isn't any installation going on.
 
>>> subprocess.call('sudo apt-get install firefox', shell=True)
[sudo] password for ztane:
Sorry, try again.
[sudo] password for ztane:
Reading package lists... Done
Building dependency tree
Reading state information... Done
firefox is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 35 not upgraded.
0
@JayJay123 variable variables = dictionary.
 
@AnttiHaapala how it works for you?
 
7:21 AM
what shell are you using?
 
bash
 
if you're using say idle or something else, sudo needs to have a terminal to ask for password
 
idle
 
that's a bingo
use terminal
 
yep,
 
7:24 AM
@AnttiHaapala thanks, but importing it like subprocess.call('import subprocess') is required for me
 
@AnttiHaapala A user @Zero Piraeus wanted to know how I was using them. Being new to chat, I just blurted out my question there. Now I see he is not here. Oops.
 
@ZeroPiraeus ^
not all the ppl are 24/7 in the chat
zero is in somewhere in south america, can't remember, not the most optimal time to try to reach at midnight
 
@AnttiHaapala Thanks. I figured that out. I got a bit ahead of myself.
 
santiago
so that would be 04:26 am
 
7:39 AM
cbg
 
Cbg
 
7:56 AM
Cbg
 
8:44 AM
@MartijnPieters need to override a readonly property in subclass to readwrite, I am at loss
or aonyone else with advanced level black magic
tried SuperClass.property.getter and
doing both again...
but neither seems to work
 
@Antti it comes down to getting the underlying decorated object...
 
no, there has to be something more fishy here
 
I've seen it done, but can't remember off the top of my head
 
I get Can't set attribute
and...
 
(probably by Martijn), but I've had a client screaming at me for the last few days, so I can't exactly concentrate of remembering that right now :(
 
8:49 AM
the getter seems to still be the superlass one
>>> Request.GET.fget(request)
DOING GET
GET([])
>>> Request.GET.fset
the getter seems to be my getter, but the setter is not set?!?
wrong name
 
Cabbage!
 
asdfasdf
cbg
 
poke has added an event to this room's schedule.
 
@Feeds To quote the agenda: “Make use of the “events” feature.”
 
why does the name need to match the setter name?
 
8:55 AM
Umm.. fatal: could not open '.git/COMMIT_EDITMSG': Permission denied @poke - ever seen that - when the files are owned by the current user and are all 777 (although not sure) anyway?
 
@Jon maybe it’s stil write-locked?
 
Is that just a file that needs deleting or something?
 
The file is where the commit message is saved to when you are committing
You can force-delete it, and see if the problem disappears
 
Well, there's an SO post with I solved it by deleting .git/COMMIT_EDITMSG. Weird, I know. in it... so... here goes
yup - that works
 
It’s recreated with every commit
 
8:59 AM
ummm.... weird... under what conditions could that happen - that's a rhetorical question... I'll worry about why later - don't have time right now ;)
 
Not sure but it shouldn’t be a major problem. The commit process recreates it every time, and it is only used to finalize the commit. It exists so the commit message editor has something to edit.
 
cheers
@poke Is it me or does the way the event is displayed on chat.stackoverflow.com looks a little "General" - sounds a bit official...
 
What does it say? Can't see it as on my phone.
 
Upcoming events: 9 hours ago Stack Overflow 歡迎參與/欢迎参与, tomorrow Stack Overflow Winter 2015 General Me…, in 3 days Stack Overflow A reunion of friends
Okay... the "Stack Overflow" isn't included - it's an icon - that's a side-effect of the copy/paste
 
Cbg :)
Nice birthday @Jon?
 
9:11 AM
@Ian nothing special - was working... thanks for asking though :p
 
Ah OK :p it is a general meeting though. And it is kinda official. As official as we get anyway :p
 
@Ffisegydd yeah... just worried it sounds like it's a General Chat system meeting... :p
Mind you - when you click on it, it shows Python and stuff, so it should be obvious :)
 
Happy belated birthdays @Jon & @davidism… Sorry I missed it :(
 
@poke it's okay... I've stopped crying now...
 
hello everyone :)
 
9:50 AM
@AnttiHaapala: Using @ParentClass.propertyname.setter is enough to add a setter.
If you are overriding the getter as well, use
@ParentClass.propertyname.getter
def propertyname(self): ...

@propertyname.setter
def propertyname(self, value): ....
The per-property-instance decorators return a new property instance.
 
@MartijnPieters yeah, I was confused,
i didnt name my setter function "propertyname"
anw, needed it for this: github.com/ztane/pyramid_django I have a perverted project goin on, getting django to run with pyramid and sqlalchemy without code modifications to django apps
 
@AnttiHaapala At which point you are not overriding the base class property :-)
 
ah, I made a subclass of Pyramid and Django request that works like them both
but django .GET needs to be overwritable, whereas webob considers them readonly
but it works now
 
Can't promise I'll have much bandwidth to pay attention to tomorrows meeting, but I'll try to be there.
 
yesterday there was 1 user asking for quite some time about writing battleship AI
I suggested they should first make a human playable battleship game
they said that "Not yet, first need to do AI, after that how to allow two players to play in turns"
*singular they
 
10:04 AM
greetings, programs! don't mind me, just lurking a bit to absorb python knowledge from you folks. :)
 
absolutely no info (mpegs are concatenable)
 
@Ant
ack
 
@JimmPratt and cabbage to you :D
 
@Antti - I get that on occasion in the PHP classes I teach. Students wanting to run before they can walk. :P
 
thanks @AnttiHaapala - do I need prior vegetable or farming knowledge here? :D
 
döne
nope but knowledge of the salad language is plus
 
understood! clicks link and wanders offtopic
 
I love the smell of closed linkedin questions in the morning. Smells like... democracy...
3
 
@JimmPratt Just a little room culture.
 
10:09 AM
@Ffisegydd hemm, smells like meritocracy to me
 
@Ffisegydd: this is where LinkedIn really is falling down. They changed their API policy in a major way, affecting a lot of developers. Where are the LinkedIn devs monitoring the fall-out?
 
Melon @MartijnPieters
and melon for the links @AnttiHaapala
 
@MartijnPieters wrong timezone
 
@Martijn I really get the feeling (no proof, just a feeling) that Linkedin's shift to SO was a business decision by some group of managers somewhere, rather than by the actual developers. In that sense, I feel sorry for the developers who are probably not happy about it all. But when it comes to Linkedin as a whole, they have certainly messed it up.
 
they will soon wake up :D
 
10:14 AM
I agree with @Ffisegydd they won't wake up because they are not allowed to by upper management. :(
 
no I mean that
 
@Ffisegydd I'm talking about LI as a whole. Yes, this was a management decision and the devs are probably not given the resources to handle the fallout, and I do feel sorry for them. Management first decided to dump their forums and shift to Stack Overflow, and now this. They are totally botching it.
 
they are physically sleeping.
 
right! the upper management keeps them drugged. :D
 
Yeah LI as a whole have dropped the ball. I don't think the SO team ever mentioned whether they got into contact with them or not. I wonder if I should comment on the SO community manager's answer and ask if LI ever responded :/
 
10:19 AM
@Ffisegydd why not - no harm in a concerned member of the community checking on any progress...
 
@MartijnPieters read your VLQ answer, of course the problem with VLQ is that the 'very low quality' does not match that what the queue should contain
 
1679
A: What is your best programmer joke?

Gulzar NazimA man flying in a hot air balloon suddenly realizes he’s lost. He reduces height and spots a man down below. He lowers the balloon further and shouts to get directions, "Excuse me, can you tell me where I am?" The man below says: "Yes. You're in a hot air balloon, hovering 30 feet above this f...

 
the severe content problems, like the answer is wrong from beginning until end...
 
Hi Ana. Did the community team manage to get in touch with LinkedIn about this issue? Did LI respond? The questions are still coming, and with Linkedin's recent changes to their API usage they're coming in even worse. It's gotten to the point now that a lot of the people who were previously helping to monitor/moderate the questions have given up in desperation, and so poor questions are just being left open. — Ffisegydd 7 secs ago
 
@AnttiHaapala so why is downvoting that not enough?
Why put the burden on the reviewers to then judge the post on the technical merits?
The whole issue here is that people feel the answers are crap and wrong and shouldn't have been posted in the first place. Fine, but that is what downvoting is for.
 
10:30 AM
the question is "what is very low quality"
if you read the description, surely they have severe content problems
now everyone needs to go to meta to read what are the severe content problems
49
A: Is the Very Low Quality flag too ambiguous?

Jeff AtwoodVLQ means the flagger thinks this post is beyond saving -- no amount of editing or polishing will turn this particular turd into gold. It is a call for a pooper-scooper. To clarify this, we are making the language a bit stronger: very low quality This question/answer has severe formattin...

the downvote is for case that "Ok doing this is dangerous, and wrong and so on"
the VLQ I think is for the cases like "wtf does this have to do with the question or any of its tags"
if question is about and the answer is in without any indication to that, answers the problem Y vaguely related to X asked by OP then surely such an answer can be "very low quality"
 
10:49 AM
to me, if the question is about python and the answer is in javascript, doesn't that count as 'wrong' ? it is not 'very low quality' - it's not even a level of quality that equates to the OP's question. it is simply 'wrong'.
 
the problem is that there are 2 kinds of "bad answers": "not an answer" = "NAA", and "very low quality" = "VLQ"
now the problem is that I am not even sure that what is the set "VLQ - NAA"
 
NAA is when something is not an answer, so not even an attempt at answering. If it's a terrible, terrible post, but still an attempting at answering, then NAA doesn't count.
But yeah it can be difficult to distinguish.
 
yes, but VLQ?
the question is "how do I print the first letter of each string in Python"
the answer is "for (int $i; i < 0x42) { <?php echo str[$i] ?>)"
so it clearly is an answer
but it is not very low quality because it has code tags
 
Hmm that is a tricky one.
 
nope, according to martijn, such answers do not have "content problems"
because they are written in english or sth...
stackoverflow.com/questions/2193009/… flagged this as "very low quality" -disputed
 
11:04 AM
cbg
Bad day yesterday - 190
 
:D
I know the feeling
 
Damn. I upv was all it needed. 190 is just too bad
 
cbg(all)
 
11:07 AM
Hey Antti. Are you interested in another bisect question? Or maybe this one needs a binary tree... stackoverflow.com/q/28539716/4014959
 
cbg Peter
 
in Flask's development server how can I modify the default socket address to something different?
 
@AnttiHaapala Thanks, got 530 already
 
(in case I want to run two server at the same time)
@Ffisegydd have you read my comment on The Theory of Everything?
 
@PM2Ring if you have an idea, go ahead, I have to do some work too
so how is theory of everything?
 
11:09 AM
2 days ago, by Peter Varo
@Ffisegydd it was a wonderful story about some guy who had a disease, and a girl who loved him and wanted to help him. about their extraordinary fights in their marriage. and we can watch how that worked out.. but it wasn't about a great physicist, who happened to have a disease, and who met a girl who loved him and wanted to help him to become one of the greatest minds.
2 days ago, by Peter Varo
it was an amazing performance from the guy who played stephen nonetheless, but it wasn't enough for me.
2 days ago, by Peter Varo
other important characters were 2 dimensional, they were introduced too late -- for no good reason at all
haha :) it looks like I cannot guess the permlink
 
@Peter yes I did, I'll reply just now. But first, you can pass port=blah to app.run() I think for the Flask port :P
 
2 days ago, by Peter Varo
other important characters were 2 dimensional, they were introduced too late -- for no good reason at all
@Ffisegydd nice, will try it in a mo'
 
yeah enough of those movies... :D
so hows the imitation game?
 
and umm.. one more thing: what is the range of the socket numbers?
0000 => 9999 ?
 
11:12 AM
1-65535 but <1024 are root only on linux
 
@AnttiHaapala haven't watched it yet, so please no spoilers :)
 
how can I spoil
 
And now onto TOE :P I thought it was very good and I understand your points, though don't necessarily agree with them. I thought the film was good in that they didn't just say "Oh he's a scientist", they showed the human behind the scientist.
 
@AnttiHaapala kiitos
 
cannot spoil on IG as it opens 20th day here
 
11:13 AM
Imitation Game was good, though I had reservations about it. It was a dramatisation. Some parts of it weren't true to reality.
 
friday is the premiere
 
My today's target is 500 reps.
 
@Ffisegydd is it non-nerd-watchable? :D
 
Yes definitely.
 
My today's target is 190 helpful flags.
 
11:13 AM
@Unihedro I know how to get helpful flags fast:
 
In fact there's hardly any crypto speak in it (which was disappointing for me personally :P)
 
go through the queue, and then on each bad answer, go and flag the post instead of doing queue action
 
That's "just in case" flagging, it's kind of slow. :p
 
stupid that it is broken that way
yeah but it will get helpful flags
 
I've already exhausted my comment flags, currently flagging spam.
 
11:15 AM
LOL
So much for such an easy job
(For those below 3k)
 
@Ffisegydd I think the fact that show the "human" part is okay.. but look at whiplash or even beautiful mind => they both have the "human" part, BUT they show the "profession" part way more deeply
and those two are not even close to the achievement stephen have
 
that's why I think it was a waste of effort/energy
 
I haven't seen Whiplash, I should really. Beautiful Mind was good.
 
@AnttiHaapala Then CV that
 
11:18 AM
@eanjo7 No, Stack Overflow is a question and answer site for professional and enthusiast programmers. We're working together to build a library of detailed answers to every question about programming. Take a tour and "Don't ask about anything not directly related to writing computer programs". — Unihedro 6 secs ago
uv plz
 
Mornin' cabbage
 
Morning sunshine.
 
Morning rainclouds.
is grumpy. It's Monday.
 
Morning implausibly bland British weather?
 
Monday is bad for us students!
:(
 
11:21 AM
@BhargavRao It doesn't get any better once you graduate.
 
@MartijnPieters stackoverflow.com/questions/28535988/… delete possibly
 
@MartijnPieters Hopefully when we retire :)
 
Question: SVN doesn't read my mind when I delete a file from the harddisk; svn update reinstates it. Why does it do that and what is the work-around?, Answer: It is annoyoing that SVN doesn't read your mind. 13 people agreed and upvoted that..
 
11:30 AM
@Ffisegydd I got the unable to connect message when I set port other than 5000
any idea, why?
 
I assume you're connecting to localhost:port_number?
 
yepp
 
(Or 127.0.0.1)
 
again yepp
 
Hmmm, no idea sorry.
 
11:31 AM
although the server is running:
 
1 port other than 5000?
 
 * Running on 127.0.0.1:3296
 * Restarting with reloader
 
it might be that that other port is taken
hmm ah no
not in this case
 
nope, I created this for development:
# Try to run app on random, but free ports
while True:
    try:
        app.run(port=choice(range(1024, 65000)))
        break
    except OSError as exception:
        if exception.errno == 98:
            raise exception
 
so what is wrong with 5000?
 
11:34 AM
it is busy with another server
*exception.errno != 98
 
i just give them 5000, 5001 and so
 
5001 is working
strange..
so there is a limit I guess..
strange.. if I write app(port=<int>) it is working
if I do it with random it is not
(a minute later I tried the same value that didn't work for random)
 
2
A: How to check if an object is created with `with` statement?

laike9mAll answers so far do not provide what (I think) OP wants directly. (I think) OP wants something like this: >>> with X() as x: ... # ok >>> x = X() # ERROR Traceback (most recent call last): File "run.py", line 18, in <module> x = X() File "run.py", line 9, in __init__ raise Ex...

OMG that was accepted :D
@tristan ^ @thefourtheye ^
 
LOL....
Can't stop laughing
 
11:51 AM
@AnttiHaapala The moral of the story: never trust an OP. :)
 
@AnttiHaapala this is working as I expect it:
# Try to run app on random, but free ports
for port in range(5000, 65000):
    try:
        print(' * Get new port:', port)
        app.run(port=port)
        break
    except OSError as exception:
        # [Errno 98] Address already in use
        if exception.errno != 98:
            raise exception
however the random idea is still a mystery why it can't make it
 
@AnttiHaapala What an incredibly dumb use-case.
 
@MartijnPieters ah just realized :P
startswith('with ')
so works only at module level :D
 
@AnttiHaapala easily fixed with a str.lstrip() call, of course.
 
12:18 PM
1
A: Optimized regular expression search in a text corpus in Python

Antti HaapalaYour algorithm runs in O(n) time with large constants. This seems so wrong, when a simple binary search could do O(lg n). If your regex does not contain special characters, why not: import bisect with open('dictionary') as f: dictionary = f.read().split() # .sort is slow, so better to s...

I wonder why ppl always go for the wrong algorithm, is it because it is so "intuitive?"
 
@AnttiHaapala I'm somewhat surprised that Padraic is recommending a linear search. To me, this question is clearly a job for some form of bisection search.
 
@PM2Ring I think I should write to python dev that these docs.python.org/3/library/bisect.html#searching-sorted-lists should be moved into the stdlib
along with search_prefix
or something
I have never needed the insertion but it is really PITA that whenever I use this module I need to go to the documentation and copy paste the relevant function :D
(also should have done in the 'python 3` the grand renaming of things: bisect and heapq into algorithm/ package or so)
 
12:33 PM
I ❤ bisection search, but I doubt they'd make it a built-in. :) As for the insertion, I'm not sure if I've ever used it in Python, but I guess it's bound to be pretty slow on big lists since it needs to rebuild the whole list.
 
Ah, you meant those sample functions. Meh.
 
@PM2Ring no need to make builtin, just make it in the module instead of documentation
@PM2Ring it fits in the rounding error of the .py moduel
that is lib/python3.4/bisect.py
 
I guess a lot of kids get into programming these days with a very hands-on approach, and solve individual coding problems as they encounter them (mostly by finding canned solutions on the Net) without bothering to learn "traditional" data structure and algorithm theory.
 
/usr/lib/python3.4/bisect.py 2595 bytes, 500 bytes more and it still does not take any more disk space
same for the itertools recipes
 
@AnttiHaapala Ah, right. They're so tiny that it's a little surprising that they aren't in the module itself. OTOH, documenting them clearly would take up more room than the functions themselves. :)
 
12:44 PM
dog is so annoying
 
@corvid hey, no bad-mouthing @Jon behind his back.
 
I'd go for slightly annoying? :p
 
re-cbg
 
@MartijnPieters did you see this:
by bhargav
 
@AnttiHaapala :-P I saw the Meta post, if that's what you mean.
It is a Ninja doll, it does operate at the margins. From the shadows it leaps forth.
4
I didn't see the doctored image before, though.
 

« first day (1584 days earlier)      last day (3363 days later) »