« first day (1530 days earlier)      last day (3419 days later) » 

12:52 AM
Stupid question about SQLAlchemy polymorphic inheritance: "Currently, only one discriminator column may be set, typically on the base-most class in the hierarchy." So this means you can't get multiple levels of polymorphism with joined-table inheritance? i.e., Pastry -> Pie(Pastry), Cake(Pastry) -> ApplePie(Pie), CherryPie(Pie) -- you can't do that? Not in a way that would allow you both query(Pastry) and query(Pie) to return ApplePie and CherryPie objects?
 
any critics for those reg expression needed to do make a little css parser
#CSS regular expressions

anything_start = re.compile("[^:{\s]+")
selector_word = re.compile("[^{]+")
atrule_word = re.compile("@[^{:]+")
comment_long = re.compile(r"/\*[^(\*/)]*\*/")

#w3.org/TR/css3-selectors/#whitespace
valid_whitespace = re.compile("[\b\t\r\n\f]")#not %100 sure
brace_start = re.compile("{")
property_word = re.compile("([a-z]+[-]?)*")
property_value_separator = re.compile(":")
#value_word = re.compile("[^;]+") #this ends too soon in e.g content: "Ok; not ok";
value_word = re.compile(r"""[^";]+""")
 
1:13 AM
Cabbage humans
 
cranberries
 
@WalleCyril use a CSS parser instead? :p
cbg puppy!
 
@JonClements yes I use the one I m doing
 
Yay, we should play the puppy brothers union song now :)
 
@JonClements what would you do ?
 
1:25 AM
@thefourtheye we have a song!? is the first line "woof!" ?
 
We can write a song, with the first line full of "woof" ;)
 
@WalleCyril what exactly are you trying to do?
 
write a css parser
 
well, using regex is not a good starting point
either use an existing one, or use a parser library such as pyparsing, ply, or parsley
 
@JonClements why is regex not a god starting point ?
 
1:32 AM
it might well be for CSS stuff, but you need to put rules in, and it's far simpler to use a parser than trying to parse yourself
 
@JonClements I do not seek simplicity but knowledge. What rules ?
 
have you read the CSS spec.?
 
@JonClements yes, also the html spec
 
html really has nothing to do with css :)
 
I understand what you mean
 
1:41 AM
but good... you've done some reading :)
 
1:55 AM
@WalleCyril Really? Which ones? I read the HTML 4.01 and CSS 2.1 specs cover to cover a long time ago, and neither are exactly gripping ... I can't imagine HTML5 is either shorter or more interesting, and CSS3 doesn't even have a single document that can be called its specification.
 
@Zero cbg
 
Also: parsing CSS. Good times :-)
cbg @Jon :-)
 
@Zero dentistry all complete?
 
Yeah, been a while now actually. I got teeth and I'm not afraid to use 'em ;-)
 
@thefourtheye I've done the first - "woof! woof woof woof woof!"... but it needs more I think :)
@Zero that's either a threat or an indication that your food doesn't stand a chance anymore :p
 
2:08 AM
... as the Korean-style barbecue chicken earlier today found out to its cost.
 
don't make me hungry at 2am please :)
 
Also: dating is so much easier when you don't look like a pensioner who forgot to put their dentures in.
 
I so want to star that :)
just having a small glass of whisky I treated myself to for xmas - it's absolutely delicious
cbg @davidism
 
cbg
 
You bought yourself a small glass of whisky for xmas? You're a frugaller man than I ...
 
2:13 AM
@grayshirt you can do that, you just need one discriminator column per level of inheritance
you could also get clever and encode multiple levels into unique integer ids or something so that you only need one column
 
@davidism: Thanks for the attention! That's what I figured, I had a simple example working, tried to do it in my real application and it failed, and now I can't get the simple example working again: pastebin.com/SVbzffnM
 
@Zero yes - whisky specialists sell single glasses now :p
 
That code returns [<Pie(id=1)>, <Pastry(id=2)>, <Pastry(id=3)>], i.e., it
 
I've been trying to book a $200-$300 per night cabin in the mountains for New Year (without a great deal of success).
 
's casting the Cake children into Pastries
 
2:15 AM
Go on then, what's the whisky?
 
ah, hmm, now that I look at it, it's not as simple as changing the polymorphic_on property, since that overwrites the higher level prop
probably easier to go with my second idea
but then that probably won't work perfectly either
ultimately, this inheritance just seems over engineered
 
Thing is I swear I had that example working at some point
 
might be better off making a "food" model, with a relationship to a "type" model, or something like that
 
I went for this one @zero
 
there probably is a way to get it working, I just can't sit down and figure it out right now
 
2:20 AM
wb @iCodez
 
I hear you, thanks for the response
 
user2555451
cbg @JonClements. :)
 
In my use case I'm pretty OK with not having the top-level ancestor ('Pastry') really; I'll only ever have two classes on the second level ('Cake' and 'Pie') and I don't really need any relationship that covers both of those types. I do want to access them both at the same time but that query doesn't appear very often in my code so it's not real trouble to just do two separate ones. I guess the full inheritance scheme was more about conceptual elegance than anything.
 
Perhaps one of the generic association examples would help?
 
@JonClements Ooh, that does look rather pleasant. My parents brought me a bottle of Lagavulin when they visited earlier this year ... not in the same class, obviously, but still better than anything available here.
Goddamn Johnnie Walker everywhere you look ...
 
2:25 AM
@Zero ouch... JW can barely be called a whisky :(
 
Yeah, don't I know it ...
Feel free to courier a bottle of Laphroaig over if the mood strikes you ;-)
 
haha... if you come to England in 2015, I'm sure I can arrange better than that :)
 
If I come to England in 2005 I'll buy my own and hide it somewhere :-)
 
@Zero yay, I edited, and was typing "just pretend I didn't somehow think the year was 10 years ago!"
 
I might also leave a note to friends regarding something called bitcoin, and a date on which to sell it.
 
2:29 AM
@Zero well - you're well behind my local council on time travelling
next bin collection is January 1st, 1900 according to their site
 
Hmm ... fingers crossed they're working on Mayan cosmology rather than Hindu ...
 
hoping that's a technical glitch rather than a real collection date... cos although I feel old... darn sure I wasn't around in the 1890's
 
@davidism I came across generic associations working out a similar thing before I even knew about polymorphic inheritance (and ultimately didn't need them there). I don't think they're necessary in my case -- I don't need to go further than that third level of inheritance; I don't need relationships from another class toward both Cake and Pie types
I don't think there's any problem I can't actually solve by just doing query(Cake).all() + query(Pie).all() instead of a more elegant query(Pastry).all(), this was mostly about modeling the classes like they are in my head and learning. If it tur
 
I can see your avatar in a cape and top hat ... might have trouble finding a monocle the right size though.
 
@Zero ?
 
2:34 AM
Ah yuh?
Oh, was that not an obvious association? 1890s → Victorian Era → Top hat, cape & monocle.
has, admittedly, drunk most of a bottle of cheap and cheerful carmenere, so synapses may be firing in unusual ways
 
2:52 AM
ahhh... was just worried you were outside my bedroom window sighs in relief
mind you - that'd be astonishing - you've have to cross the moat or get my peasents to lower the draw-bridge, then navigate your way through my pheasent farm then climb you way up 19 floors to my tower... :p
never mind fending off the flying unicorns on the way :p
 
3:39 AM
:-D
 
 
3 hours later…
abc
6:18 AM
Cbg
 
6:40 AM
cbg
 
Dan
cbg
 
 
3 hours later…
9:24 AM
Cbg
 
10:16 AM
Cbg :)
 
can any one help me in reading till end of file in python
am new to python
 
abc
list(file_obj)
file_obj.read()
 
is it possible to change the django admin panel to some other responsive one /
?
 
Cabbage
 
10:27 AM
Cbg
stackoverflow.com/q/27632293/3005188 I think this should be closed as it doesn't have code or detail. In any case, linkedin support request.
 
I don't understand, what do you mean by "linkedin support request"?
 
Linkedin have closed their own support forums and are telling people to post on SO. These people then post either terrible questions, or questions that can only be answered by a Linkedin employee.
 
Shouldn't they open their own stack exchange site then?
 
No, it doesn't work that way.
You can't just open a SE site.
 
I know the process.
 
abc
10:41 AM
I don't think it'd be supported on Area51
 
Why not?
 
Exactly, there's not enough users to get an Area51 proposal through. Plus I think SE have said they're not interesting on allowing such 3rd party sites through [needs citation].
 
I see, thanks for explanation.
 
The idea of a general customersupport.se as a migration target is nice though ;-)
 
You have my sword!
 
10:48 AM
It's a nice thought for us, but it wouldn't be nice for the users :P
 
Also cbg :-)
 
It would effectively be a Recycling Bin.
 
abc
Cbg @Zero
 
@Ffisegydd If you can't have a slightly evil idea on Christmas Eve, when can you?
3
 
Voted. One more. I tried to help the user at the time but they haven't come back :/
 
Yeah, noticed your name in the comments :-)
 
abc
Done
 
cbg(all)
 
cbg @Peter :-)
too broad / opinion-based ... take your pick.
 
11:32 AM
Hi what is there any 3rd party library for python to use threads without GIL ?
 
I'm not familiar with one
I use multiprocessing often enough, any reason you can't?
 
yes, I use it for vim plugin and vim fails to do make process fork on Windows. Another one is that multiprocessing consumes a lot of memory for each spawning process (noticed to be on Linux).
 
What do you mean "vim fails to make a process". You use multiprocessing in python, not in vim. You'll have a main python thread spawning processes (shouldn't be too ehavy, depends on what you're doing though....) and not vim.
 
Yes and this main python thread is a vim process.
The vim error is "Unknown option argument: "--multiprocessing-fork""
 
What are you trying to do exactly? Can you share some code to help me figure out where this goes wrong?
 
11:43 AM
If the code is >12 lines, post it in a pastebin.com please.
 
are you using pymode?
 
No I dont
This is global search function (globalFind)
It takes command consists of a pattern to look and pattern to check files against and file list
 
I use vimfiler plugin to mark necessary directories files to look at, then the function takes the file pathes and start to searching the pattern. It could be a lot of files (they are not necessary opened in vim) and all this job is done in several thread to speed up the search.
 
11:48 AM
I don't think you need multiprocessing here, since the bottleneck is porbably IO. You could use a mixture of mutliprocessing and multithreading if you see it's still too slow for you.
havign said that, where are the errors in the code? what lines?
 
There is no errors in the code it is just vim failes to create new processes required by multiprocessing module.
on Windows
 
I understand. So you fire up vim try the plugin and then get the error? I'm not sure how vim and python connect here...
 
12:29 PM
Merry Cabbage!
 
Cabbage Christmas!
 
12:40 PM
 
bad
 
grumble stupid import error.
Getting an ImportError when I run my tests, but not one when I install with pip :/
 
cbg pup
 
how goes it?
 
12:54 PM
Getting annoying by a stupid ImportError, you?
Something to do with tox not installing it properly.
 
I'm fine... just trying to find some music to play
VERY LOUDLY SO I CAN DROWN OUT MY NEXT DEAR NEIGHBOURS SHITE MUSIC - DID YOU HEAR ME NEXT DOOR - SHUT THE F* UP
 
Well unless they're in chat reading, chances are they didn't get that :3
 
OH WAIT - YOU CAN'T HEAR ME BECAUSE YOU'RE PLAYING YOUR MUSIC TOO F*ING LOUD
ahh... I feel better now
typing in bold and capital letters appears to be a wonderful stress relief :p
@Ffisegydd so nearly xmas - nidaba done yet? ;p
 
Finished it last week, just been waiting for someone to ask.
 
1:09 PM
thought you were due to have done it by 1891 - that's a very late project delivery - I'm disappointed :p
 
You're still using the Gregorian calendar then? Ah, that's your mistake then! I use the Cabbage calendar! It'll be ready 1891 AC.
Fixed my error >.<
If I seed a RNG with a seed, say 1234. Will it return the same RNG sequence on different computers?
 
1:30 PM
@Ffisegydd You don't have the SE chat "convert BOLD ALL CAPS to speech" plugin?
Great for annoying neighbours:
 
user559633
1:42 PM
@ZeroPiraeus or this youtube.com/watch?v=VbZMnF1VNlE
 
Yeah, that'd work ... except that you'd have to leave the house yourself rather than moshing in your living room.
Finally managed to book somewhere for new year. That was painful ... must remember to be at the "lets go away for new year" stage of a relationship a couple of weeks earlier next time.
 
user559633
Where are you headed for new year?
 
user559633
this is in some sort of elvish language
 
user559633
just kidding, i know it's french
 
user559633
;) looks nice
 
Looks lovely mate
 
cbg again
just spent a couple of hours looking at a problem that doesn't exist in an email that contained "URGENT" in the subject
 
Yeah, it does look pretty good - surprising really as so much in the area was fully booked.
 
TL;DR "It's not changing anything"... "Did you click 'Save Changes'"... "No"... "Try doing it again and clicking that..."... "Oh wow... thanks it works"
 
user559633
1:59 PM
 
it's also from the same woman that was harping on about "When I click delete - I can't access it anymore - why is that!?"
I'd thought she'd been dismissed but apparently not
 
o.o
 
I'm not sure how much more obvious I could have made "Delete"
 
I've got a friend who is a bloody good programmer, but is struggling to find a job. Meanwhile people like her are kept on. And "celebrities" are complaining about having to go into Celebrity Big Brother. The world ain't fair.
 
you get a big modal warning "This operation will remove the client, disconnect all numbers and disable all portal access associated with the account.. If you wish to do this, please confirm by typing the 6-digit random number below, and press delete. If you don't wish to do this - please press cancel"
How she managed that by accident more than three times in a row astounds me
 
2:05 PM
Pfft, everyone knows dialogs are just put there to annoy you, and the appropriate response is to click random buttons until they go away.
 
@Zero even a BIG RED ONE with effectively a captcha to complete the operation? :p
 
user559633
@JonClements random digit confirmation AND 80 words? alright there, herman melville webform
 
I did "hey Zero you know about computers" volunteer tech support for a friend back in Bolivia throughout the six years I was there, and in all that time I could never convince her to actually read a dialog.
A big red button might have helped ...
 
"Do you accept the terms of our licence" - "Yeah whatever, just f*ing install please" - is slightly different :)
not sure I've ever read an EULA come to think of it
 
@ZeroPiraeus I read a almost the entire html5 spec , half on w3.org and then the other half on whatwg.org when I discovered it. Sometimes not reading some sentences entirely because I knew some obvious stuff already
 
2:09 PM
could well have sold my soul a few times over by now
@Ffisegydd nice meta post btw - good job mate
 
Ta @Jon. Need to get the voting ring going so I can get some meta gold.
 
well... it only 11 more votes for gold I think
 
10 now
 
Fair enough. Actually, conflating the two subjects ...
SO feature idea: when you choose a tag for your question the first time, you're presented with a EULA-style clickthrough containing a dump of the entire official documentation, and a "I have read and understood ..." button.
 
@zero put that on meta and I'll upvote it for sheer bravery :p
@Ffisegydd thinking about it - you're not allowed a gold on meta - that'll mean you'll over take me :(
 
user559633
2:17 PM
I've written more EULA than I've read
 
Someone just suggested burninating the tag, I think that's going too far.
@Jon we should start feeding all our meta questions to you, so it looks like you're more active for the elections...
 
2:32 PM
@Ffisegydd thanks for the thought :p
cbg @thefourtheye my evil twin
 
PUPPPPPPPPPPPPY
 
cbg Puppy A.
 
@Ffisegydd It means that Puppy Awesome, right? ;)
 
You're Puppy A, and @Jon is Puppy 1.
 
Christmas cbg!
 
2:35 PM
Yay, I am the Awesome Puppy and my evil twin is the smallest positive integer numbered Puppy :)
 
cbg @Martijn :)
 
Hunting hats.
Shhhhh
 
@MartijnPieters Happy Cabbage, little Ninja :-)
 
stalking around with a hat gun.
 
You are topping the list and I am somewhere at the top of the second page :)
 
2:38 PM
Unfortunately, until this answer gets voted up or I can find another post to answer with the phone, the Got a Tablet hat will still evade me.
 
can always fake headers surely? :(
 
Thanks, anonymous voter, whomever you may be :-)
Ick, Rofl got all the hats (bar the two Christmas day hats I just got)
So he got the Red Baron and everything else.
Hrmz.
Right, candidate post located: stackoverflow.com/questions/27550785/…
Goal: add answer, edit post into shape, get it to +3 and the answer to +5.
 
Now, this is a thoroughly researched question.
 
2:53 PM
@thefourtheye Yup, unfortunately the OP has already discovered the only method by which eval() can create closures.
 
Yay, Christmas cabbage, all. Here's to a happy holiday
 
I'm not certain how to best approach that question; I'd have to write a full treatise on Python scoping rules, I think.
@holdenweb Christmas Cabbage to you too!
 
@holdenweb same in return Steve - best wishes
 
user559633
@MartijnPieters interesting choice to offer a bounty on an unguarded try/except -- needed for a hat?
 
I either need to head-desk or punch someone
 
2:58 PM
Punch head!
Desk someone!
 
user559633
hulk out and throw a bus at something
 
@tristan a massive green puppy would be terrifying I guess.... run or I'll lick you to death!
 
user559633
O_O just like that old gypsy lady said
 
Crimbus day approaches, and I need to wrap my gifts. But that's a lot of work.
 
user559633
It took me ~1 hour for a dozen or so
 
3:00 PM
@Kevin you actually wrap presents? :p
 
Surely I could just leave them in their brown amazon delivery boxes...?
 
Use Al foil. Much easier. Just wrap and scrunch.
 
user559633
If you need some sort of thing as a baseline -- weird shapes though because most people got whiskey
 
user559633
Okay, if I focus and really work, I can take Friday off.
 
I didn't do many "physical" presents... more Amazon/etc online credit things - that took no wrapping at all
 
3:01 PM
If I really lie in bed well today, I'll take Friday off.
Looking good so far.
 
user559633
So boring though -- getting a PHP codebase that no one wants to touch in shape
 
@Kevin so what're you going to lie about in your bed? :p
 
Friends, $20 has been donated in your collective names to The Human Fund. The Human Fund: money, for people.
 
Interesting, I saw one of those on my coworker's desk yesterday. I was wondering what it was.
Must be a hot ticket item.
 
user559633
3:04 PM
I saw one of those that was converted into a bong at a party
 
Post upvoted, I'll edit the answer some more.
When that post reaches +3 and my answer +5, I have a shot at the Red Baron.
Hopefully.
(not a chance)
 
user559633
I don't mind helping to make that happen. Should I vote up now or wait?
 
@tristan Voting now would be awesome!
 
user559633
And now you're one away @MartijnPieters.
 
Wowsers.
That went fast, thanks!
 
user559633
3:13 PM
(it's a christmas miracle)
 
One more vote for the answer and we are there.
 
user559633
Do you want me to use one of my bots? Haha nevermind.
 
3:30 PM
@Ffisegydd: 9 more votes to gold on Meta!
 
@MartijnPieters We are there.
Cabbage.
 
And now we find out if my initial downvote was allowed for the hat..
(the question was at -2 when I found it)
I am pretty sure the hat won't fit, unless you count a scarf around the Ninja feet as fitting. But that's neither here nor there.
 
anyone remember a TV series (think it was Gerry Anderson) - submarine based...
 
user559633
hunt for bread in october?
 
Can't say I've consumed much submarine based media.
 
3:35 PM
Stingray?
 
ahhh... it was called "Stingray"
 
Hah, beat you to it by 2 seconds.
 
either well remembered, or just my google-fu failing me for a moment
 
Underwater Thunderbirds you mean?
 
@JonClements ... mariiiiinaaaa ...
 
3:36 PM
@MartijnPieters Seems it is...
 
Yay!
That's all the hats I could earn to date.
 
@Ffisegydd could never remember if it was TB 2 or 4 that was the underwater one :(
 
It was 4. 2 was the one that could drop like a tanker thing which contained other vehicles.
 
Okay, that does look kinda cute.
 
1 was the rocket, 5 was the space station
 
3:38 PM
3 was the other rocket that went to the station
 
I want to answer that number layer question, but he didn't provide sample input and I don't want to transcribe his image.
Clearly this OP underestimates my laziness.
 
I'm also looking at the same one.
I've just made some random data.
 
Hmm, numpy sure has interesting slicing capabilities.
 
Gah 2 people already answered!
And yeah I'd generate some data using
N = 10
arr = np.arange(N*N).reshape((N,N))
 
3:48 PM
The OP's self-answer isn't terribly comprehensive, so you're really only competing with the one other guy.
 
I like Frxstrem's sample data: # let x be a 10 * 10 array
 
Hmm, or does his answer actually answer the post entirely? His "maybe there's a better way" is throwing me off
 
user559633
I love sending out "yeah, i'll do this if you eat the blame" emails before breaks
 
user559633
"If it breaks something, that something will stay broken for at least 24 hours."
 
@Martijn that is a pretty great hat you got there :-)
 
3:55 PM
I've got an okay solution, basically doing what they already have.
 
@ZeroPiraeus It great how the ... kilt? fits perfectly.
 
@Kevin I think his idea did answer the post, but I've answered anyway with some working code.
I think the code is also more extendable, to N*N as long as N is even.
 
@Ffisegydd (2N)*(2N)!
 
Hard mode: write a solution that works on arbitrary n*m arrays
 
@Kevin Or multidimensional... m*n*o, m*n*o*p.
 
4:06 PM
@matsjoyce not sure if you're using factorial there or just shouting? :P In any case, I checked it using an N=9 array and it works.
 
and it has to work on vanilla Python lists, no numpy allowed. And you can't use the letter 'e'.
 
Oh I see what you mean by 2n*2n now.
I can't believe a web host only supports 2.6. Not even 2.7!
 
I know, right?
 
Yeah, I saw that question. Its tempting to just say "Use a different host".
 
Me and Kevin both suggested that :P
 
4:17 PM
:-D
 
Look's like I looked at it too early...
 
Only having 2.6 isn't a truly huge deal by itself, but I feel like it indicates their general level of care.
If you can't upgrade your Python install once per decade, what else are you letting slip?
 
At least is not 2.5...
@Kevin OpenSSL, I'm sure.
 
(devil's advocate: "we'd love to upgrade from 2.6, but that will cause incompatibilities in already-running scripts that belong to our other users")
 
(skip straight to 3.x then)
 
4:20 PM
Devil's advocate advocate: Webfaction has lots of different Python installs, you use whichever is applicable.
Sure, keep python pointed to an old if you have to, but make python2.7 available too.
...I should give that guy my WF affiliate link...
 
user559633
WF?
 
From context, WF appears to mean WebFaction.
 
user559633
(i was hoping to create another referral chain like last time it was mentioned)
 
DSM
Brief morning cabbage for all.
 
Greetings
 
I don't have an affiliate link, but if you could mail me a dollar the next time you buy web hosting, I would greatly appreciate it anyway.
 
user2555451
cbg all!
 
aww, can't make images into links
 
4:39 PM
That image was amazing.
 
user559633
i missed it
 
user559633
describe it to me using haiku (the dane cook of poetry)
 

WebFaction Evangelism

Jun 25 at 14:44, 21 minutes total – 23 messages, 10 users, 4 stars

Bookmarked Jun 26 at 15:02 by davidism

Wow, that was only six months ago. I wasn't even an RO yet.
 
More unrest in St Louis :/
 
user559633
@Ffisegydd yeah, this time it's inarguably unwarranted though.
 
user559633
4:51 PM
It's not like pointing a gun at a police officer has unknown consequences
 
Yeah seems to be. Teenager draws gun on police officer, police officer shoots him dead. Pretty simple really. People on the news were slating the police for "always using lethal force". F**k that noise. If someone draws a damn gun on a copper, I'd expect him to shoot.
The other day in New York, two coppers shot in their car. Where were the protests and celebrities then? It's all getting ridiculous.
 
user559633
Yeah, the media is trying really hard to push the "teenager" angle, but that's stupid because guns don't care about age.
 
user559633
@Ffisegydd because that doesn't feed their narcissism. addressing the reasons why we have so many idiot criminals doesn't selfie or facebook post as well
 
Don't get me wrong, it's terrible that someone has been shot, it's terrible that a teenager is dead. American's love of guns is ridiculous (to me, as an outsider). But if you pull a gun on a copper...
 

« first day (1530 days earlier)      last day (3419 days later) »