« first day (2443 days earlier)      last day (2488 days later) » 

12:07 AM
@Rawing you can do that kind of thing in Py3
Use lambda : next(expression_using_temp_var for temp_var in [expression_defining_temp_var])
I was writing a crappy little converter for datetime -> Excel timestamp (fractional days since 12/30/1899), and I needed now-epoch in 3 places
 
oh man this is such a heated debate.....They are extremely popular, and a "staple" in Montreal because it's been around forever. It's a good fast burger place to get yourself something before a hockey game. It's close to the Bell Centre.

Personally, I would rather go to Five Guys :)
If I'm going for a greasy burger...I'm going for a greasy burger
 
Lean burgers sound as useful as the nipples on Batman's breastplate
 
seriously
thank you! Someone had to say it
 
I got u fam
 
12:25 AM
<3
 
 
2 hours later…
2:39 AM
 
 
2 hours later…
4:35 AM
CBG
5
A: Django cannot find my media files (on development server)

Bobworks with django 1.8: from django.conf import settings from django.conf.urls.static import static urlpatterns = [ # ... the rest of your URLconf goes here ... ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

may i know why they configured the static url for only development?
what's wrong with using the same in production server..
 
 
1 hour later…
5:42 AM
In Python how remove extra space elements from a two-dimensional array?
For eg.

list = [['2', '2', '', ''], ['3', '3', '', ''], ['4', '4', '', '']]
and i want as

newlist = [['2','2'],['3','3'],['4','4']]
 
have you tried this out already?
I'm leaving, but read this answer to help inspire you to figure out how to apply it to a list of lists: stackoverflow.com/questions/3845423/…
 
 
2 hours later…
7:44 AM
cbg. How do I check if tkinter window is resizable?
 
 
1 hour later…
8:48 AM
@MaxLunar root.resizable()
 
9:07 AM
0
Q: WinError 10013 - An attempt was made to access a socket in a way forbidden by its access permissions

KaleabWhile trying to login in my Django Web App, i encounter OSError at /accounts/login/.I am able to login in 127.0.0.1:8000/admin, but not in the /accounts/login which produces the Error Code: OSError at /accounts/login/ [WinError 10013] An attempt was made to access a socket in a way forbidden by...

 
 
2 hours later…
10:53 AM
I've been seeing 50k rep Willem answer all sorts of basic questions eagerly, and yesterday he encouraged an OP to edit their question "with a follow-up"
(complete with spoon-feeding)
 
11:10 AM
well, that is how you get a lot of rep
 
11:35 AM
alright! For the first time in my life, I regret not having used a versioning system. I just discovered some month old code I wrote for an SO answer in a file where my project's GUI code should've been. Lesson learned.
 
11:48 AM
Hey!

import numpy as np
import matplotlib.pyplot as plt

def Fx(t):
a=5.0
b=10.0
if t<a:
return 0
#elif a<=t<=b:
# return 0.5 #(t-a)/(b-a)
elif t>b:
return 1
else:
return 0.5
vFx = np.vectorize(Fx)
y = vFx(t)
plt.plot(t, y, 'bo')
But the plot looks wrong. What am I missing here?
y = [Fx(x) for x in t] generates the correct results.
 
"plot looks wrong" how?
and you can practice code formatting with the "fixed font" button in the Sandbox
and you can vectorize that function properly
 
i found what I did wrong. I had to make it output floats like this:
vFx = np.vectorize(Fx, otypes=[np.float])

Sorry for bothering and not formating the code nicely.
 
def vFx(t):
    a = 5
    b = 10
    F = zeros_like(t)
    F[(a<=t) & (t<=b)] = 0.5
    F[b<t] = 1
    return F
 
awesome, thank you! :)
 
or something like that ^
@BorisMonth it's OK, it really needs some practice
with python it's quite helpful if whitespace is preserved, for which you need a code block
 
12:03 PM
@AndrasDeak I'll use it next time ;)
 
Thanks :)
 
 
2 hours later…
1:42 PM
morning cbg
 
2:17 PM
Cbg
 
OK...the last few days there has been a surge of eval answers that have been welcomed.
It is really frustrating
@idjaw In my context (see question edit), eval is not dangerous. I know the inputs and it's not in production. Am I missing something? — foosion 2 mins ago
these answers get upvotes and are getting accepted.
I don't know if I'm overreacting here...but this is seriously ridiculous.
 
It's completely unnecessary in that context, but is it actually dangerous there?
 
How should I be looking at this? I'm all for changing my perspective here too.
Is the idea really just for the question asker here, and all is well and safe?
Or is there a level of overall "good solution" that should be accepted that benefits the rest of the community?
 
I like how both answers copied the incorrect ['func_%s' % range(1,5)]
 
:)
 
2:25 PM
Don't get me wrong; I absolutely agree that eval shouldn't be used there. I'm just curious what's the worst thing is that could happen in that scenario
 
oh, yeah, if we are going that direction, absolutely nothing.
 
@idjaw you would be if it weren't for the hordes of clueless noobs copy-pasting whatever they can find on SO
it explicitly isn't only about the asker
 
Because it happened again here -> stackoverflow.com/a/44737238/1832539
like...people wander in and see already established answers and go...hey...how can I add to this? Oh I know.. EVAL BRO!
 
@idjaw you'll be eval-rich
go for that gold badge, hammer everything :P
 
That's the plan....the golden doom hammer
 
2:33 PM
But really, I'll downvote anything evaly if there's a safe alternative. Zen of Python addendum: Idiomatic is better than idiotic.
 
haha
\o/
guys, i have not tried in my code editor. its about brackets misplacing. editiing now. it will work now. — Jay Parikh 3 mins ago
lol
 
I've been less than 200 rep away from 10k for the past four days. I think for the last push I'm gonna post some eval answers, that oughta get me to 10k real fast
 
let me know so I can help bump you up. I'm all about eval promotion
 
will do, thanks for the support man
 
one love
good god. Boston is destroying the beauty of poutine. These are abominations
 
3:03 PM
silently googles "poutine"
 
it's a magical Quebec staple
that several US cities started trying to adopt by giving their own spin on it
and it turned out to be fraken-food that makes no sense....hey...maybe it tastes good...but it should not have the poutine in the title.
that's like me making shrimp and grits and not using grits, and still calling it shrimp and grits
 
Hmm, sounds like you have a valid reason to be upset about that. But personally I don't feel very strongly about such things - when it comes to food, I prefer to just eat it without questioning much.
 
Food is too important to me to mess around with like that.
 
3:43 PM
I never understood why we were taught De Morgan's Laws in school and uni, but thanks to the people on SO I now understand
"Why is while not text.isdigit() or not text.isalpha(): an endless loop??"
 
With WTFForms, can you initialize a form with a parameter?
 
recbg
 
o/
 
3:59 PM
does that look authentic enough?
 
not quite
missing the gravy, and those don't look like cheese curds
 
yes. that.
that is a poutine
 
they do their own cheese there
I've yet to enter there...
 
oh that's awesome!
 
4:03 PM
... because they couldn't buy it anywhere :D
 
lol haha
 
they have this "mixed grill", with gravy + curds, but then pulled beef, pulled chicken, sausage, bacon, jalapeños, onion, bell pepper... would it be a total abomination? :D
 
at its base, if it has the main components, then it is still a poutine. So adding like pulled pork on top is fine.
For example. Here is a popular place in Montreal -> labanquise.com
they have all kinds of different styles.
 
nice prices compared to this skwiiki, regular is 9 € here, there La Classique reg. ~5 €
so basically if you bought döner anywhere in Finland at that price it would be a rip-off
 
yeah...poutine is everywhere, so no point charging ridiculous prices for something so simple and so common.
 
4:10 PM
so, maybe I will go in there and buy the 12 € mixed grill with all that stuff from above
they're branding themselves "authentic" like they make their fries themselves and the cheese too
 
take a picture
😀
I'll tell you
 
Can you help out us yokels on how one would pronounce "poutine"? Looks like 'poo-teen', but I"m pretty sure that's not right
 
it is how you're supposed to pronounce Mr. Putin...
(but you don't)
because English-speakers tend to pronounce Putin as Pyoot'n
 
Hmm? Poutine with a soft t'?
 
puddin'?
 
4:20 PM
@AndrasDeak well not quite :D but closer :D
 
Don't lie then :P
 
but it is closer to the correct pronunciation than the English ~pyoot'n
 
Alright. So, anglophone pronunciation is usually always said as "poo-teen"
so Paul, you are correct. 😀
 
@idjaw do you approve of this video: youtube.com/watch?v=SDJcnpUfnQo
 
100%
especially the Quebec way of saying it
I was looking for something. That is fine. You get the green checkmark
 
4:25 PM
so quebec pronunciation is closer to ~put in, and french -> vladimir putin
 
yeah
French from France and French from Quebec really split away from each other
 
I really couldn't tell them apart.
 
@idjaw You're gonna like this question stackoverflow.com/questions/44738500/…
(I'm sorry, please don't kill me)
 
they're much closer to each other than Norwegian/Swedish/Finland Swedish to my ear
 
@Rawing good lord lol haha....you can have this one. I insist 😛
I'm actually about to head out for a bit....so... dou dou...I see nothing
 
 
2 hours later…
6:02 PM
TFW your name is up with Martijn's when he mod-closes a question.
 
@idjaw For a small fee, I can spread that cheer. Just let me know how much you want to offer, and I'll let you cut in on posts I'm closing. :-P
 
@MartijnPieters I'm a very easy negotiator. I'm sure we can come up with a very fair fee. Might I suggest payment in some fine single malt?
Surely we can make this work very well for the both of us.
 
@idjaw oh damn, now you made it interesting.
 
LOL!
 
Any Islay malt, plus Talisker.
 
6:08 PM
Noted down. This is the start of a very good partnership.
I have a fine Ardbeg sitting here with your name on it.
 
6:32 PM
how about salmiakki
 
woah woah....find your own Martijn. We struck a deal first.
 
6:59 PM
cbg
 
cbg
 
7:14 PM
How are you this fine Saturday morning, @idjaw?
 
@AnttiHaapala I can do both.
@idjaw ooooohhhh.
 
I can't tell if Martijn is a tough negotiator or just easy to bribe.
 
easy to bribe? You obviously haven't had yourself a fine Ardbeg, and a fresh bowl of salmiakki.
 
Hi @all , just read ""SOAP and REST can't be compared directly, since the first is a protocol (or at least tries to be) and the second is an architectural style". Can any one tell with which should I compare soap ( except xmlrpc ).
 
Focus....must focus. Have two or three projects to work on today, but I won't get any done if I keep jumping back and forth between them...arg!
 
7:22 PM
@prakash that's.. an unclear and broad question. Why do you need to compare SOAP to something else? And why is XML-RPC specifically excluded?
Just pick any RPC tech. CORBA, Thrift, what-have-you.
 
CORBA, perhaps? It included an Interface Definition Language (compare to WSDL) that would compile to various languages for client and server implementations. It used a binary transport over TCP vs. SOAP's XML over HTTP. CORBA object references compare with HTTP URL's. CORBA also defined a series of standard services interfaces, including Naming, Trader, and Event.
 
@MartijnPieters I am not able to draw exact boundary b/w. Http(GET/POST) ,REST and SOAP.
 
@prakash - with SOAP, the HTTP layer was largely hidden from the developer. IIRC, almost all the calls used HTTP POST methods to send XML payloads to/from the SOAP server. With REST, the HTTP methods GET/PUT/POST/etc. and the corresponding HTTP return status codes are very important, as are the URL forms that define the diferent services.
 
@prakash HTTP is a communication protocol. REST narrows down how that protocol is used to form an API. SOAP is an RPC standard built on top of HTTP using XML. So HTTP is related to both REST and SOAP, but that is where the similarities between REST and SOAP end.
 
@MartijnPieters - I get the feeling you and I are doing someone's homework for them...
 
7:32 PM
:) no it's my curiosity
 
@PaulMcGuire meh, I have some time today ;-)
I did a lot of work with XML-RPC back in the day, with Dave Winer, and worked with some of the people behind SOAP as well (which came from XML-RPC, but was over-engineered to a fault).
The first digital photo taken of me was by Dave, IIRC.
(the linked photo no longer works, pity)
Oh, my giddy aunt, thank you archive.org: scripting.com/static/680/DSCN1793.JPG
 
7:47 PM
17 years? D:
 
@MartijnPieters Hippy!
 
@MartijnPieters. I am actually developing API for a ecommece application ,it's my first time . I have just created controllers(mapped URL) those support GET/POST. I am not able to figure how should I ensure it's as restful . I know REST is broad , now next what should i do
 
Martijn is the Deckard Cain of the room. It's time to stay a while and listen.
(Don't let me hanging here...someone must know that reference....)
 
8:08 PM
I have not played Diablo for a long time. I still haven't played D3 ;-(
It is on my list of PC games when I get back into gaming.
 
I hadn't my fun with D3 especially when some friends played too
We met up to tackle some of the harder bosses
 
I've got a Flask issue (I think?). Trying to get github.com/VRGhost/PyPush to run, getting this error:
just a sec, trying to get Ubuntu VM clipboard to work
BuildError: Could not build url for endpoint 'bower.static' with values ['filename']. Did you mean 'static' instead?
... nevermind. Changing it to 'static' works
Nothing like some good old rubber duck debugging :)
Actually, that breaks other things
 
@idjaw "Deckard" was Harrison Ford's character in Blade Runner, no?
@MartijnPieters - are you the source of the xmlrpc module in the Py stdlib?
 
@idjaw "hadn't"?
 
Don't play D3, you'll waste your time.
 
8:23 PM
Isn't that the point of gaming?
 
You have Torchlight, which is cheapier in my opinion, and has (minimun) the same playable essence. And also, is from those guys from Blizzard that left D3 in the imiddle on the proccess
Just let you know that it catch up D3 in their first week (I think) of sales
 
I still want to play it ;-)
 
Then you can
 
I might check out Torchlight, too. Thanks for the suggestion.
 
Altough T1 doens't have multi, and T2 multi don't know if still lives. But both are very playable
 
8:44 PM
@Code-Apprentice oh...smartphone autocorrect disaster. "had" :)
@Paul Yeah, but my reference was Diablo.
Yeah. Torchlight got a huge following and is an incredible dungeon loot game.
My only issue is I like a bit of a story to follow, which Diablo gave me.
Torchlight, granted had endless dungeon insanity 😀
\o/ just got the enlightened badge!
 
@idjaw Blizzard is definitely very good at crafting a compelling story line.
@idjaw \o/
 
+1 to both, also for cinematics that enlightens the story
At least Torchlight has mods
 
9:05 PM
didn't know about the mods
 
@idjaw Then what're you doing here still?
@idjaw THe first mod is for stackeable potions, more than 99 instead of the default 20. WHat a pain without it
 
lol heheh
 
9:28 PM
I'm having a hard time figuring out what this should be closed as.
 
I find it unclear
 
vote to close as duplicate of an introductory python tutorial
 
rejected migrations are the best
 
@idjaw Maybe you should put out the reason that it doens't have anything to do with being a dict, but a list.
 
What @Rawing said
 
9:34 PM
one can use custom reasons...
 
omg
they used a default header key, with its default value to ask if they can get custom keys by not even showing a good example of a custom header
then the answer comes...wth
ugh.....alksjfalsdjf
 
10:19 PM
@prakash I'd avoid SOAP here altogether, it is nothing but a pain. I can't help you design an API, sorry.
@Paul I'm not. I was working at Zope Corp at the time, and we built in XML-RPC support into that server (the whole API was exposed via XML-RPC, and later added WebDAV; this is all pre-REST).
 

« first day (2443 days earlier)      last day (2488 days later) »