« first day (1433 days earlier)      last day (3498 days later) » 

12:10 AM
The famous metaclass conflict: is there a Python 3 solution I'm missing? The ActiveState recipe is only Python 2. The simpler solution avoids the exception but doesn't seem to be doing the trick in my case -- a class that inherits from both a PySide.QCore.QObject and an abstract base class. This example code shows my problem.
It's no big deal -- there's nothing concrete in the ABC and that non-solution is good enough to get PyCharm's inspection to recognize when an abstract method isn't implemented but I was still curious if there's a workable solution.
 
 
3 hours later…
3:40 AM
Having massive trouble simply replacing line breaks with <p> tags in a textarea submission. I get `u't\r\r\nt\r\r\n\r\r\nt'`, but if I do `.strip('\r\r\n')` I get the same string back..

Even doing `repr(string).strip('\\r\\r\\n')` gives the same back.. what stupid mistake am I making?
Uh - obviously I don't expect this to put <p> tags in, that's just me trying to break down what the issue is when replace didn't work
 
It's poorly asked, but seems to just be an issue with "a" matching for "abc", which is not desired
 
@OllieFord .strip() just replaces from the ends. Use u't\r\r\nt\r\r\n\r\r\nt'.replace('\r\r\n','<p>') instead
 
@MattDMo D'Oh! I discovered the pattern was \r\r\n after I stopped using replace. Dammit. So much time wasted. (I'd been doing replace('\n\n','</p><p>'))
Any idea why it is POSTing \r\r\n for a single line break though? Questions I've found on SO indicated spec says \r\n.
 
so what's the deal with "Kuch kuch hota hai"? Never heard of it, and I've seen a lot of movies...
 
3:49 AM
It's a Bollywood flick
 
oh
I'm 'Murican :)
 
haha
I'm 'Ritish, but enjoy them time to time :)
 
no, I don't know why POSTing is returning double carriage returns. I've managed to stay away from web stuff so far, but I'm in the process of migrating my blog from Wordpress (yuck) to Django, so I'm about to start learning.
 
@KDEx The edit I made to your answer was to use a positional argument named RandomSeed, rather than an option named --RandomString
 
so positional arguments are required, and - indicates optional?
 
4:02 AM
Yeah; usually it's a style thing ("required option" is an oxymoron), but here, I don't know of any other way to allow a value to start with a "-", as J.F. Sebastian is pointing out.
main.py -- -arg-with-hyphen will work; I don't know how to do something like main.py --RandomString -foo and have "-foo" be the argument to the "--RandomString" option.
 
I see. The required option thing was throwing me off too then, I appreciate your help.
 
4:26 AM
@OllieFord you watched the english version(or english subtitles) or you know hindi?
 
4:47 AM
Any anime fans here?
 
I have watched Death Note, does it count?
 
Yeah!
@thefourtheye Do you know Studio Ghibi
 
is there any open source application like picasa Concept...
 
@Wally Nope, sorry :(
 
Studio ghibi movies literally touch your heart. They are pretty famous in the anime world
Spirited away is my favourite
 
I don't like Death Note because I can't relate to the protagonist. He is too perfect. Especially at studies.
 
WHAAAAAAAAAAT? He is the best
When a human gets a lot of power, what would he do? That was cleverly shown in that
 
5:15 AM
hi anybody here who can help me in python daemon
i need to call a python script from daemon while passing a parameter(random) too along with the script
this is what i tried but it seems not working
os.system("XYZ.py 5416ce0eac3")
 
6:11 AM
@Swordy English subs, but learning/want to learn :)
 
hindi kitna samajh aata hai @OllieFord :D
 
cbg()
 
cbg()
 
cbg
 
Jeeva is using python 2.x i guess
 
6:19 AM
Function calls are the same in 2.x and 3.x
 
ha ha.. nope.. cbg()
python3.4
 
that's better
:)
i assumed cbg to be an encoded form for print.
 
 
1 hour later…
7:26 AM
Got an invitation to keybase.io/ffisegydd. Seems pretty cool. Allows you to search for people and get their public keys. Also allows you to verify that various online accounts are your own.
 
Sounds interesting :)
@Ffisegydd STEWIE!!!!!!!!!!!!!!!!!!
 
@Jon BRIIIIIIIAN! It's only in Alpha at the mo and I don't have any invitations to send but if I get one I'll ping it to you.
 
cbg
ah queueeueueueueued
 
Always fun when there's no conistency beteen pence per second/minute and duration in seconds/minutes... makes calculating stuff Very annoying
cbg @Martijn!
 
7:32 AM
Yeah I signed up for it ages ago, forgot I'd even signed up. I assume they're opening the alpha up a bit more now to the common fools such as myself.
 
@AnttiHaapala: I just had to push for you pushing back on that comment...
 
No you didn't!
 
@Ffisegydd you're not that common :)
 
@AnttiHaapala I am so tempted to quote the lines from room 12 now..
 
Cbg!
 
7:35 AM
cbg @Ian :)
 
Cbg!
 
@MartijnPieters Look, I came here for an argument, I'm not going to just stand...!!
 
I want to complain!
 
You want to complain! Look at these shoes. Oh you can't see in the SO chat, look I wanted to complain about my shoes but this stupid chat does not support webcam.
 
It's a fair cop.
had to skip to the end, out of time for this morning. :-P
 
7:41 AM
Cbg
 
rbrb again, gotta go.
cheers!
 
And you tosh!
 
8:08 AM
@AnttiHaapala Is it possible to have 'set' as a key for dictionary?
 
a frozenset
 
cool.
 
>>> d = {}
>>> d[set([1,2])] = 5
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'set'
>>> d[frozenset([1,2])] = 5
>>> d[frozenset([2,1])]
5
 
yes i did that just now.. :)
and it works with frozenset
thanks
 
8:13 AM
cbg @Peter we're taking to hyperlinking the salad references now are we? :)
 
@JonClements it wasn't my idea..
IIRC it was DSM or Zero who did this first
and I kinda like it
 
Oh wow.... 50,001... yay me...
 
congrats!
 
8:24 AM
@JonClements congratulations!
I still have to pick my swag for the 200K milestone
 
The diamond encrusted life-size unicorn... I'd go with that
 
8:56 AM
Hi. how to parallelize this using multiprocessing?
combs = set()
for L in range(0,len(attributes)+1):
combs.add(itertools.combinations(attributes,L))
 
9:09 AM
First thesis chapter submitted to supervisor o.o
 
congrats.. :)
 
oh my.. god bless GvR!
 
@Ffisegydd if you were concerned about writing code in C is just "ouch, no, please!" compared to python, then clearly you haven't developed anything in JavaScript
then may have similar syntax (which could be scary for people coming from python)
 
@Peter my first programming language was FORTRAN...
 
9:18 AM
but at least C is super strict, has a nice standard and works without any confusion
although you can't tell the same about JS
 
you even have to be aware of the implementation details -- who fucked up is that?
@Ffisegydd :)
FORTRAN may seem scary true -- but believe me, it is also a very consistent and coherent language compared to JS
 
I agree.
I've used JS a bit.
 
so god bless GvR!
 
The idea of 's' + 2 makes my teeth itch.
 
9:21 AM
only when you developed in several different languages you will release the simplicity and clarity and holiness of python
 
@Ffisegydd I guess that's the least unexpected thing => I mean, it work everywhere like that since JS 1.1
but things like: var list = [,,,,]; causes different things based on the implementation in browsers
@Ffisegydd where did I saw that before?
 
@Peter in a dream?
 
nope I saw that somewhere
on a blog in a post I don't know
 
9:40 AM
what would be the regex for 'don't match a period' "." if it is preceded by "Mr"
i tried
(?!mr)(\.)
 
Sorry I swore a blood oath to avoid any contact with regexes.
 
actually i tried a lot many expressions.. but none work..
@Ffisegydd don't u think u should condition your oath on the fact of using Regexes with Html tags??
Your blood oath would be justified then..
 
@Swordy what?
you don't want to match a period after "mr"?
that would be: r'mr(?!\.)'
it is called the negative lookahead (if you are interested in it)
 
@Swordy no I've sworn to avoid all regexes in all cases. They are the Devil's work.
 
they are magic -- I'm in love with regexes! :)
 
@Swordy you need lookbehind
 
I see Peter has been taken by the Devil. Someone fetch me my Holy Cabbage.
 
ofc you stated your problem wrong:
your problem is "match a period if not preceded by Mr"
and then you do "a zero width string not followed by mr (lowercase) but followed by a ."
 
in that case it would be r'(?<!mr)\.'
 
@PeterVaro thanks , actually i'm splitting sentences using re.split() and i dont need to split sentence by a period if it comes with abbreviations. ({}).format(words) will do that..
 
9:53 AM
which will catch all dots which has not 'mr' before them
 
the problem with regexes is if one cannot formulate in English / insert your native language here correctly what one wants then most probably not in regexes either
 
@Swordy why not use something like NLTK with a suitable corpus then? :)
 
@Swordy the problem with lookbehind is it needs to be fixed width (for some inexplicable reason)
and nltk seconded
 
used nltk.sentence_tokenize but you know..
 
@Swordy I don't think it is a good idea what you are doing
I mean there are several exceptions
 
9:54 AM
It wasn't spliiting them right..
 
not only Mr.
 
.... I know what? :) LOL
 
but there is Dr. for example or floating point numbers, etc.
 
yeah ..
 
or (x, y, etc.)
just to name a few
you need a way more complex thing than a few characters of regex
 
9:56 AM
cbg
 
I support @JonClements's suggestion about NLTK
 
best bet?? rules set created manually?
 
cbg(@PaoloCasciello)
 
thanks :)
@AnttiHaapala is there anything that you don't know??
:P
 
9:57 AM
Ah, I am not sure, if there is something I do not know, then that is what I do not know.
 
Regex for html tags??
 
ZALGO!
 
bbias
 
Cabbage all
 
cbg @Intrepid, voted yet?
 
10:09 AM
One of the first in the polling station
 
What should you do if someone rolls up and answers with (pretty much but not identical) the same code that you've already answered with?
And I mean like 30 minutes after you've answered.
 
Comment saying that the code looks awfully familiar....
 
Hi. Can some one help with multiprocessing error?
 
@Jeeva please don't bring your recently asked questions into chat.
Anyone who is interested in answering it will already be paying attention to the questions.
 
okies sure.. :)
 
10:19 AM
See sopython.com/pages/chatroom for the chatroom rules
1 message moved to Trash
 
10:35 AM
As requested, your Amazon Prime membership has been cancelled. Since you haven't used your Prime membership benefits, you'll get a full refund of £79.00. - Interesting... clicked the cancel button so I didn't end up paying for it, but apparently I'm due a refund, even though I don't recall making a payment for it... hi...
 
@Jon fancy another race, you to 60,000 and me to 6,000.
Double or nothing?
Also congratulations on hitting 50,001 :D
 
My confidence is somewhat destroyed by my last attempt (and I had less than 10k to go last time)
 
You have less than 10,000 to go this time, 9999 to be exact :)
 
Umm... but I only had a couple of thousands last time :)
 
10:55 AM
stackoverflow.com/q/25910380/3005188 what started off as a simple question could quite quickly turn into black magic.
Ah semptic went there, he went for the black magic.
 
@Ffisegydd looks like they're after .format(**locals()) or similar
 
Similar, but they also don'y want 'a = {a}' they just want 'a = {}'
 
Have you guys heard of WAMP (not the stack)? It looks quite cool, but also looks as though it all leads back to one company, tavendo.de
 
@Ffisegydd To me it looks like they want to remove the = sign altogether and just use the variable name wrapped in braces. So a function would probably the way to do it.
no idea what kind of function though, I don't know python that well yet :)
 
@Jerry the new edit seems to imply that **locals() is suitable
 
11:01 AM
print 'blah blah: {a}, {b}, {c}, {d}, {e}, {f}'.format(c,e,a,f,d,b)
blah blah: a=3, b=5, c=7, d=22, e=2, f=532
so I guess something like **locals() and something else to put the = signs and the variable names
 
11:19 AM
@Ffisegydd @Jerry well - I've had a go at the function - although I feel like vomiting
 
12:05 PM
Should get Python silver tomorrow once the re-count is done :D
 
@JonClements hmm, what do you think of semptic's answer?
 
@Ffisegydd Woohoo!
Nice and readable? But... I just deleted mine ages ago, as I was letting myself in for something that could well end up nasty there :) (plus when you've got that point - it becomes harder to read than what the OP wasn't that keen on anyway... :) )
 
I'm not at the level to understand any of those anyway xD And yes, I saw your function.
and yea, true :)
 
I wish to avoid typing this letter multiple times by writing some obscure code than no one's going to understand a month down the line instead... :p
 
I am fighting with a file of 188M lines here, no fun with the deadlines :(
I know how to import a file to sqlite.. not export a table to a file lol. Gonna be fun...
SQLServer crashes over the volume of the data
 
12:18 PM
@Jerry what's the deadline?
 
the end of the week
and it's going to take ages to then get into the firm's software
 
So it's already in SQLServer but you're trying to export it?
 
I tried to put it in SQLServer, but it complained that the file was too big for the allowed memory. So I used Tcl and imported it into sqlite
currently running a simple select query and 30 mins has passed...
had 2 updates earlier each taking about 2 hrs
 
Sqlite isn't really meant for that... :)
 
I'm out of options Jon :( And I don't know enough python to write something dirty that works on the spot
 
12:22 PM
I guess you're using the "free" version of SQLServer? (so it has a total 2gb/4gb total DB size or whatever)
 
Jon has some tricks up his sleeve and they're dirty..
 
@JonClements I think there's a 4 gb limit, so I guess yea
 
@Jerry install postgresql and upload it to that?
 
I don't understand why the company won't get a decent version grr
postgresql, ok, I'll google that.
 
@Jerry 'cos it costs money
postgresql won't have that size limitation, but is basically (imho better than SQL server and is open source anyway)
 
12:24 PM
and they get lots of money too, but of course...
 
it is obvious they're planning a vacation somewhere..
 
java 8 is starting to rock :D
self.suppressed = [ExceptionJsonifier(x) for x in suppressed]
vs this.suppressed = list(stream(suppressed).map(ExceptionJsonifier::new));
 
self?
oh, sorry
 
that is python, the other is java 8
starting to almost look with usable, though ofc list and stream are "import static"s
 
12:45 PM
Before I start reading ten pages of configuration option documentation, does anyone happen to know how to get sqlplus to not clip off the end of column names when you do a select statement? My COUNTRY column contains strings of length two, but I don't want the header to show just CO.
 
what is sqlplus
 
SQL*Plus is an interactive and batch query tool that is installed with every Oracle Database installation.
 
finally something that AnttiHaapala doesn't know about
 
sorry, I do not do masochism
 
12:58 PM
Ooh, I found a message board post with the same problem as me.
"There's no way to fix this unless you manually specify the width of each column"
:-(
You've ruined my day, Oracle corporation. I hate you forever.
 
wow, that's messed up IMO
the headers should be able to display completely regardless of the datatype of the column, yes?
 
That's what I want.
Ok, backup plan... Install the cx_Oracle python module and hope it gives less shitty results
And also hope I can get it working at all within my already tight time constraints
aaand we've faceplanted on the starting line: pip install cx_Oracle gives error: Unable to find vcvarsall.bat
 
u guys should have a look at my empire
 
user559633
*you.
 
Oh good, the first google result for that error has a SO post with 900 upvotes. Let's just try that, and -- fatal error LNK1120: 84 unresolved externals
 
user559633
1:11 PM
Oh, yeah. You need to get your Venture Capitalist Value at Risks in check @Kevin
 
Programming is so much fun, you guys.
 
user559633
It's definitely okay.
 
user559633
I don't know why you're showing this to us @Swordy
 
Same reason I talk about Magic: The Gathering even when no one replies, I expect
 
ohk..
:D
@Kevin lol
 
user559633
1:13 PM
Why does every dumb web service think that you want to get spammed? Does that really help engagement?
 
@tristan YES. Exactly. Blazemeter and SendGrid are terrible
Pingdom are good
 
user559633
whenever i get something i feel is spam, i immediately go and tweak my communication settings and typically end up either closing the account or reducing my involvement with the site
 
Perhaps it lowers engagement among Tristan-type users, but raises engagement among users very dissimilar to you. This would explain why companies do it, even though it annoys you 100% of the time.
 
@Kevin IIRC you are interested in hacking.. check this:
in C, 1 hour ago, by Kamiccolo
@Mints97 heh, You might find this simple RE job interesting: http://erenyagdiran.github.io/I-was-just-asked-to-crack-a-program-Part-1/ xP
 
1:30 PM
Everyone's reverse engineering sophisticated tamper-resistant executables, and I'm just sitting here trying to get my SQL query to display right :-(
 
@Kevin poor poor Kevin..
 
I guess I could extract the column names from the query itself... But what if a future query is like select * from mytable...
 
I guess I could check for * in the query, and if it's present, look at the oracle table that contains all table column names... But what if the query is select * from custom_temporary_table_not_appearing_in_the_column_names_table...
I guess I could write a sql query parser and reverse engineer the temporary table structure... But that seems like one of those "ten years, twenty million dollar" projects
I guess I could tear apart one of the legacy projects at work, which I know can query results from Oracle and get untruncated column names... But that project is a hundred pages large and has a decade's worth of special build options that falls apart to a stiff breeze, so reducing it to a simple database query app would take many many hours...
I guess I could quit my job and go watch cartoons... But... Actually that sounds pretty good right now.
3
 
@Kevin umm.. are you serious right now -- or is that starbait?
(because I definitely loved to star the last one.. but I have no idea if it is inappropriate in this situation like this or not)
 
1:42 PM
cbg
 
cbg(@isedev)
 
No, I'm not serious about that. I've faced worse frustrations at this job, so this isn't going to break me.
 
I hope not.. a broken Kevin is a sad Kevin, and we all need the happy Kevin in this room to produce more starbaits
 
@Kevin just replace oracle with psotgresql, it is not as if 99.9 % would need oracle nayways
 
btw @Kevin have you watched Edge of Tomorrow -- if not, don't read anything about it, just watch it
 
1:46 PM
ok
 
+1
and it is the movie to watch when need to watch something funny :P
 
I've seen it last night, and I expected something like Oblivion (which was a total crap IMHO)
 
I liked it too though
 
it was a super nice surprise -- nothing serious though -- but it was nice
 
though it is more straightforward
I mean seriously there are crappier movies than oblivion :D
 
1:48 PM
@AnttiHaapala yepp -- but right now, until @Kevin watching it, let's order spoiler free discussion about EoT -- starting from now!
@AnttiHaapala yeah, I said Oblivion, because Tom Cruise was the "hero" in both movies
and because the visuals of Oblivion (and the original concept) was so good => it deserved a way better plot
 
I have watched oblivion twice :D
a truly bad movie is such that you cant bother to watch it twice
or finish the first time
I think Lucy will fall into that category... despite the visuals
 
hmm.. I guess we have completely different expectations about movies :)
@AnttiHaapala I did not watch that one yet -- so no spoilers pls
 
will be setting foot in England again on Tuesday for the first time in 7 years... home sweet home.
 
the tagline is "A woman, accidentally caught in a dark deal, turns the tables on her captors and transforms into a merciless warrior evolved beyond human logic", the movie certainly evolves beyond all human logic. I went to see in theatre and well could have wasted that money in beer.
@isedev england but UK? ;)
 
lol
 
1:59 PM
good morning friends
 
Tool/tutorial recommendation request
 
Chuck Norris can parse HTML with regex. – THX-1138
how do i print generator objects like these
<nltk.tokenize.punkt.PunktSentenceTokenizer at 0x42569e8>
 
calling list on a generator usually displays the goodies within. I don't know if that's a generator, though
since it doesn't say "generator" on it anywhere
 
sent_detector = nltk.data.load('tokenizers/punkt/english.pickle')
this is the line defining the variable
 
I'd probably check dir(sent_detector) to see if it has any useful attributes/functions like text or printable_version or something
 
2:24 PM
doc1_sentences = ('\n'.join(sent_detector.tokenize(doc1.strip())))
this joins sentences defined by delimiters in "sent_detector" . How could i have a list instead?
 
calling list on a generator usually creates a list of the goodies within.
 
Eg: 'hey there. how are you ?'
this gives 'hey there. \nhow are you?'
are these goodies worth looking at?
 
>>> def f():
...     yield "Hey there. "
...     yield "how are you?"
...
>>> "\n".join(f())
'Hey there. \nhow are you?'
>>> list(f())
['Hey there. ', 'how are you?']
I don't know what you mean by "worth looking at". Clearly they must be worth looking at, or you wouldn't be trying to print them.
 
calling a list() directly on doc1_sentences gives ['H','E','Y','','t','h'....
actually i have a huge text , so i cant possibly yield all of them..
 
No, I wanted you to do list(sent_detector.tokenize(doc1.strip()))
Not list(doc1_sentences)
 
2:31 PM
ohhh
yeah that worked...
:)
 
And the yield thing isn't something I'm suggesting you do. f is just a placeholder function that creates a generator, because I can't be bothered to install nltk just so I can use tokenize in an example
 
cool...
how do i upvote?? :P
 
To restore karmic balance, you yourself must provide assistance to 3 other question askers.
 
if u need tips on clash of clans , you can count on me :)
@DSM good morning
 
No hard deadline on that. Preferably before you die. But I suppose you could become some kind of crime solving ghost.
That sounds pretty cool, in fact. I suggest doing that.
 
DSM
2:37 PM
Cabbage, all. Even for the future crime-solving ghosts among us.
 
install clash of clans from respective stores , plz be advised that pip or easy_install won't work here.. Proceed with caution..
 
(no hurry though. Kids, please don't kill yourselves just to become a spectral detective)
 
DSM
"Spectral" isn't a bad name for the series.
 
Like "Columbo" or "Sherlock". One name detective shows are hot right now. And also in the past.
 
gtg , rhubarb , cya tomm comrades..
night here..
 
2:39 PM
@kevin can you run a query through some ORM code in dummy mode and parse the output tables?
 
DSM
I don't have time to work on screenplays, I have data to align. The intro sequence to Spectral is playing in my head, though, which is distracting.
 
@Kevin oh dear... I've just ingested large amounts of chocolate and paracetamol...
 
Induce vomiting, then resist the urge to eat the vomit.
 
but it's a natural response... ooo.... I've been sick... better clean that up by eating it again!
 
@RobertGrant I bet that would work. I don't have anything set up like that, though. I'll put it in the "long term fix" pile
 
2:55 PM
I just can't get enough of this video -- it is genius:
 
user559633
he speaks so slowly that it stresses me out
 
it's because mac users are pretty slow
remember, they listened to their users
 
user559633
yes, especially compared to windows users that give money to a corporation that tries to extinguish innovation and gives its users an operating about as secure as a paper door
 
user559633
osx is really the best commercial OS and if you're not using it, you really don't know what you're missing
 

« first day (1433 days earlier)      last day (3498 days later) »