« first day (963 days earlier)      last day (3978 days later) » 
00:00 - 14:0014:00 - 23:00

2:00 PM
don't you mean sprouts or something? In case you forgot, the salad language can be found at pastebin.com/z7zQqzCw
O:-)
@Neal -- Then take it back :-)
Do whatever it takes to keep yourself motivated to pump out good answers :-)
 
@mgilson :-( I cannot delete the answer... it is a good answer.
 
nah, don't delete the answer. Keep that :)
I was more talking about the upvote to the question.
 
@mgilson I can't... it was from more than 5 minutes ago
 
I'm a bit confused: I know that dictionary.items() was originally created a list of key-value pairs, and that dictionary.iteritems() was created an iterator generator. And I also know that in Python 3 items is also producing a generator.. But in Python 2.7? I timeit them, and they are pretty much the same..
 
well, im going home
tomorrow is the Swedish National Day - imma do what every selfrespecting swede do that day
stay indoors all day, and barbeque later that evening.
peace out
 
2:16 PM
:):):):)
then rhubarb for you @limelights
and have a nice national day
 
rhubrab @limelights
 
@PeterVaro Have you tried it on a larger dataset?
 
@InbarRose nope, only with a small one
 
There you go.
try it where each dict is `d = dict((x, x*x) for x in range(100000))
 
So that means, in 2.7 items() create list, while iteritems() create generators
 
2:21 PM
yes
 
therefore iteritems are faster
 
Depends what you are trying to do.
If you are trying to ''.join() them then a list is faster.
 
''.join(<list>) is faster then ''.join(<generator>)? Why is that?
 
Join calculates the length and then it adds the items, so ''.join() on a list is essentially 2 times faster than on a generator. Once you already have the list/generators.
But of course, creating the list is also something you need to think about.
But all things being equal, ''.join() is faster on lists.
 
It is not enough for this idiot ''.join() that it has a ridiculous syntax but it is also faster on list...?!?!?! :):):)
shame on it :P
 
2:28 PM
yep... :P
 
I guess you could write a join that doesn't precalculate the resulting string length, and instead just iteratively appends to an initially empty string. That would make generators as fast as lists. But I suspect both would be slower than the implementation we have now.
 
Yep
strings are a tricky business.
 
and it is also slower in py3 too?
 
Is it slower in Python 3 too?
 
2:35 PM
Do you mean, "is [the hypothetical join I mentioned that iterately appends] slower [than the real python 3 implementation]?", or "is [join for generators in python 3] slower [than join for lists in python 3]?"?
 
@Kevin the second
 
I doubt they changed anything about join between 2.7 and 3.x
 
They did
in 3.x "strings" are no longer byte arrays
 
I thought so, because they did a lot of changes around strings
 
and what was once a "string" is now a byte array
"strings" in anything before 3 are collections of characters, a character is one byte.
In 3.x a "string" is still a collection of characters, but characters are more than one byte.
This changes EVERYTHING.
If you want a collection of characters which are one byte, you need a byte array in 3.x
 
2:42 PM
Ok, but would that change the implementation of join? You're still allocating X bytes worth of whatever the data structure for strings is, and then populating it.
 
Yes
because you used to be able to calculate the length of the string by the number of characters
each character can now be variable length because of unicode...
"len" is still number of characters, but the required space on the machine is variable
 
which leads us to the point: they had to rewrite it, so it may be faster with generators, right?
 
Nope
still needs to exhaust the generator first
it converts it to a list
So if you already have a list, it is faster.
 
Oh, OK...
 
Their example is the difference between join on a list and join on a generator.
It is actually SLOWER in 3.x .... mmmm
Interesting.
 
2:57 PM
It's not surprising the 3.X implementation is slower than 2.7. You said yourself that calculating the length of the string is harder now.
 
# offtopic:
@JonClements did you know that Matt Smith is leaving the show?
# ontopic.
 
@PeterVaro yes thank you
 
0
Q: Is "join" slower in 3.x?

Inbar RoseI was just messing around when I came across this quirk. And I wanted to make sure I am not crazy. The following code (works in 2.x and 3.x): from timeit import timeit print ('gen: %s' % timeit('"-".join(str(n) for n in range(1000))', number=10000)) print ('list: %s' % timeit('"-".join([str(n) ...

 
IT IS SOOOOO EXCITING:):):)
 
Lets see what we can find.
 
Zac
3:01 PM
How to I print # in python ?
 
escaping
 
@InbarRose thanks, I'm really curios about this
 
@Zac '\#'
 
Zac
thx
 
@JonClements ..
 
3:18 PM
cabbage folks
 
cabbage.
 
How many Doctors are we up to now, anyway? 13 and a half?
 
Assuming that he used one regeneration during the off-screen time war, and once when Tennant regenerated his disembodied hand into a human clone
That "Introducing John Hurt" teaser at the end of the last episode has ruined my doctor count
 
cabbage
 
3:21 PM
cabbage @CarlosV
 
3:31 PM
Refined my question.
4
Q: Is "join" slower in 3.x?

Inbar RoseI was just messing around when I came across this quirk. And I wanted to make sure I am not crazy. The following code (works in 2.x and 3.x): from timeit import timeit print ('gen: %s' % timeit('"-".join(str(n) for n in range(1000))', number=10000)) print ('list: %s' % timeit('"-".join([str(n) ...

Very interesting.
 
3:46 PM
Either way, @PeterVaro as you can see - lists are MUCH faster then generators when you use join()
 
3:56 PM
hehe..wow, thanks @InbarRose it was an interesting experiment
something completly different:
I saw, that some of the tags hav a small 16*16px icon
 
explosion sounds
tags?
Yes.
 
why aren't we using the python logo
for the python tag in SO?
 
That is an interesting question.
 
Who can add that?
It would be really nice
 
Well - we're using our own logo with SO on it for sopython.com ;)
 
4:02 PM
— i'm sorry whis is... grrr
I mean the logo, not the site
 
(couldn't remember if you were aware of sopython.com yet though... ;))
 
python logo is very well designed. the typeface also, so, why don't you use
<logo>python SO
or python.so
or something like that
 
I was under the impression that tags don't have images unless a corporate sponsor pays for it.
 
as a designer I have to say
 
Which is why only Android, Google, Facebook, etc have imaged tags
 
4:04 PM
@Kevin I think you're right
 
adding somethong over a logo
is absolutely breaking the usage rules of a logo
 
@PeterVaro it took 10 seconds and looked better then the default - if you wish to contribute one - please do so ;)
 
OK, I will
so the name is: python.so or so.python? or pythonso or sopython
or any other thing?
 
98
Q: What do icons on the tags mean?

AndomarWhat does an icon on the tag mean, for example the "rg" before the sql-server tag as pictured below? Return to FAQ index

 
just a domain we decided to get in a spur of the moment thing: sopython.com
 
4:06 PM
that is okay
but designing the logo I need more
for example
we can add StackOverflow Python to the name
even if the website address is different
 
0
Q: Could the Python tag use/have the Python Icon?

Inbar RoseSome of the Tags on StackOverflow have little icons near them. What about the Python tag? I really don't have much else to add to this post, it seems pretty summed up in that first sentence, but here is a short motivational speech on the matter: Not all tags need an icon, I understand that. Som...

 
Well - I'm happy with any suggestions you may have
 
@PeterVaro is on a role today. :)
 
@InbarRose wow - you're going for it ... are you tempting fate though? We shall see...
 
I have no shame.
 
4:10 PM
@JonClements sopython can be a good name, because it is soooo python and also, we do not use the name stackoverflow
which is copyrighted, i guesss
 
Besides, it is only a post on meta, not the end-of-the-world.
I vote that since we have become a community of Python users on SO doesn't mean we need to refer back to this site, we can be PythonSalad
or PythonCabbage
or CabbagePython
PyCabbage
 
10k + users -- Is this really a bad question? stackoverflow.com/questions/16944445/…
(I didn't think so and I'm thinking about casting an undelete vote on it)
 
ham, spam, egg. cabbage. — this is the slogen
;)
 
That would result in some horrible diarrhea
rhubarb folks. I gotta get going.
 
@InbarRose rhubarb to you
 
4:17 PM
@mgilson it's always a tricky one with own deleted questions/answers
 
Yeah, that's why I was hesitant...
@JonClements -- OP ended up un-deleting it anyway
 
4:49 PM
@JonClements is there a place where I can upload an image just like a code on pastebin? I'm ready with the new logo
anyone? how can I embed an image here in the chat room?
 
click on the upload button
 
Boy this question has got me upset:
0
Q: python collision detection not working

user2196555hi im trying to get the collision detection working. I think it has something to do with line 107 import pygame, sys, math, socket, pickle class Shot(object): def __init__(self, x, y, angle): self.x = x self.y = y self.angle = angle class Ship(object): def __ini...

The OP comments, "im sorry what do you mean by your pygame.init". How could he not recognize a line of code from his own problem?
 
Even three seconds of ctrl-f would take him to the line in question... Such a lack of due diligence.
 
@JonClements so?
I changed the gradient of the logo a little bit, tinkered with Flux Regular type -- the original python logo font
-- and added so with 85% gray
It is in SVG format, so RETINA ready:)
 
4:59 PM
Hmm, that's some good logo
Though I think imgur may have "helpfully" converted it from svg to png for you...
 
Oh, I uploaded it in PNG format
I have it SVG on my Mac
@Kevin if I try to upload the SVG I have this message: Failed to upload image, please try again!
 
Hi, got a really weird question that not sure if it's entirely fit for the QA format. Basically, I'm doing some comparisons on A* algorithms of different sizes (working on my thesis, this isn't a hw q). So I have a line of code that goes 'for size in [10,20,30,etc]: astar(problem(size))'.
The really weird part is, I'm getting certain results (iteration-runtimes) when I have certain numbers in SIZE list, and different numbers when it's not. Meaning, the addition of a number to that list is affecting the results from other ones... Anyone have thoughts on fixing that? I'm stumped.
 
If you remove or add a number at the end of a list, does it affect any results derived from numbers earlier in the list?
 
yeah
was going up to 300 before, and now adding 330, it increased the last results by about 40, decreased the ones before that by about 100
 
Most unusual. Do astar or problem rely on any global variables?
 
5:08 PM
(and of course there's no threading/mp involved)
i'm looking at that right now. i am using function that create functions so i'm sorta wondering if it's some python bug >_<
or rather, a scoping issue i'm not understanding
 
Is using type(x) as a constructor bad form / unpythonic: stackoverflow.com/a/16945644/1240268 (it seems easier... but somehow "dirty"... :s)
 
@AndyHayden -- I don't see anything wrong with it.
I've used x.__class__(...) before as well
(It's the same thing basically)
 
hmmm. moving some functions around is indeed changing my results
but they still haven't settled down.. lol
 
Perhaps your code is nondeterministic, and the results change every time you run it, regardless of whether you modified the source or not.
I don't suppose you're measuring the decay rate of radioactive materials, or image capturing television static?
 
@mgilson excellent! I suppose it's just ordinary duck typing... :)
 
5:13 PM
or just using the random module?
 
perhaps pastebin your code? (astar shouldn't use the random module...?)
 
Pastebin would be ideal, if the code is sufficiently small. We promise not to steal your thesis. Heck, I promise not to understand it! ;-)
 
I don't promise anything ... What's the thesis on? Bachelors? Mastors? Ph.D?
:-P
 
haha. it's a bachelors
 
(I could use a Masters ... don't have one of those yet)
 
Promises not worth the paper they're written on...
 
and it's just starting out, so unfortunately not much to steal. just running some tests. i wish there was more to steal. :-D
 
They weren't written on paper ...
 
trying to go through it at the moment and remove all references to global vars
is there any tool that highlights that
any functions that reference stuff not declared within the function?
that'd be awesome
 
I was going to suggest grep global, but that's not what you're looking for here ...
 
5:21 PM
Definitely some nondeterminism going on here, I get 330 options cost: 123 loops: 845 running it once, and then later I get 330 options cost: 126 loops: 736
 
yup. >_<
 
time module, J'accuse! Let's try removing that...
 
i did a bit of refactoring to remove references to globals with no luck on fixing it. i'll pastebin the updates
 
functions with side effects scare me... (heappush)
(it's not a real function unless you return something...)
:p
 
haha
is there a better way to structure that?
i'm all for functional programming. but i feel like a heap is most straightforward way of doing this task.
(slightly updated version here: pastebin.com/3Y8igGDV basically just tried to remove some global refs. still having non-determinism though)
 
5:24 PM
I'm trying to recall how they implemented Astar in Udacity's programming a robotic car. I remember it being incredibly elegant...
 
(to be clear, i do get same results on same runs. it's just whenever i change that list, things change)
 
For me, things change even if I don't change the list. cost 111, cost 119, cost 101...
 
hmm. i don't get that
although here's a fucking weird one
removing the import of time and all associated function calls changed the results as well
(and didn't fix the issue)
 
Interestingly, this has behavior which varies among executions:
for SIZE in [330]:
    themap =  Map(SIZE)
    for cls, tag in [(NormalAgent, 'nooptions'),
            (OptionAgent, 'options')]:
        agent = cls()
        path, i = astar(agent, themap, (0,0), SIZE)
        print SIZE,tag, 'cost:', path.accumulated,'loops:', i
But this one has behavior which remains the same among executions:
SIZE = 330
themap =  Map(SIZE)
for cls, tag in [(NormalAgent, 'nooptions'),
        (OptionAgent, 'options')]:
    agent = cls()
    path, i = astar(agent, themap, (0,0), SIZE)
    print SIZE,tag, 'cost:', path.accumulated,'loops:', i
 
5:30 PM
Hmm, the former's behavior no longer varies if I remove the from collections import deque line... o_o indeed.
 
i actually get consistent results for those two
wat?
did you update to the 2nd pastebin?
i wonder if a change between those fixed consistency for those two results for me
 
I've been working off the first pastebin.
 
confirm that adding/removing deque import changed results for me
and the wild thing is that deque was for dfs/bfs
all code using deque was entirely commented out. in both versions
i'm on Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43)
upgrading python versions to 2.7.5 changed my result
and it changed to yet a 4th thing when i re-uncommented 'from collections import deque'
i suppose heaps could have non-deterministic tie breaking
and if there was a bug in my uniform cost search, that could cause problems
 
Could be. I'm still digging around.
 
okay, i really appreciate it
i just tried having estimator return 0, which should turn this into uniform cost search
had to scale down the problem size by a ton
but the results are... more deterministic
but still not fully, lol
replaced heap with q.append, then finding the min
still has non-determinism.
although i'm more and more thinking that's the reason
 
5:57 PM
Here's my theory.
 
ah. well i found a bug in the astar at the very least
 
heappop takes the smallest cost-path tuple from the priority queue. If more than one tuple are tied for the smallest cost, then heappop chooses the one with the smallest path. Without any __gt__, __lt__, etc, operators, the "smallest" path is the one with the lowest id.
 
For all we know, ids are assigned at random, hence nondeterminism
solution: implement comparison operators for the Path class.
 
although i think uniform cost search should be able to get at the solution anyway
that's the part that troubles me
although, again, i did just find a bug in that impl
so give me a second
but as far as the non-determinism, im pretty sure you're right
actually, i know py3 errors out when you compare on objects without gt / lt
hmm. how did you do the underscores? :-D
 
6:02 PM
I surrounded the bit I wanted formatted with code ticks.
On my keyboard, they share a key with the tilde.
 
ah, right. __gt__, cool, thanks.
okay, yeah i think as far as non-determinism goes you're entirely right
i fixed one bug with UCS and i'm still getting the non-determinism though, so that's exciting..
 
back for a bit - cabbage all
 
Real quick test with the quickest and dirtiest comparators:
def __lt__(self, other):
    return self.hash() < hash(other)
def __gt__(self, other):
    return self.hash() > hash(other)
def __repr__(self):
    return 'Path:{'+str(self.nodes)+"}"
def hash(self):
    return hash((tuple(self.nodes), self.accumulated))
Looks like the behavior no longer varies between runs.
 
yeah, confirmed that as well
thank you a ton for you help!
 
My pleasure, this has been most enlightening. I didn't know 2.7 even allowed comparison without comparison operators.
 
 
2 hours later…
7:57 PM
@JonClements did you see the logo?
 
8:18 PM
Hi anyone here is knowledgable in Pyramid Framework?
I'm trying to see if it is possible to redirect to https if I'm coming in from http?
Usually this is best done in web server layer, however, I am just trying to see if this works.
 
Ell
Hi guys
 
 
1 hour later…
9:33 PM
Cabbage all.
@ericg: You should be able to redirect to HTTPS, yes.
 
9:49 PM
hi all
@PeterVaro no sorry - what have I missed out on ?
 
one moment
 
@JonClements: Cabbage!
 
here it is. what do you think?
 
cabbage
wow - really, really like
 
I'm glad:) I made some modifications on the directions of the gradients of the blue and yellow fills
also tinkered a bit with the Flux Regular typo
 
9:52 PM
@MartijnPieters what do you think ?
I think we need to be weary of some things...
 
-- that is the original python's typo
 
Very nice.
 
and added a 85% gray to "so"
 
We need to keep python.org/psf/trademarks into account here.
 
@PeterVaro sorry for any perceived in-attention - was just very busy today with some personal stuff
 
9:55 PM
no problem
right now I'm in the middle of something, but discuss if it has a green light based on PSF
if not, I have some other ideas too
 
> Use of the word "Python" in the names of user groups and conferences that are free to join or attend (Ex., "Dallas Python Users Group") -- Allowed if for the Python programming language. Other uses require permission.
that is allowed use.
 
well, all other ideas are welcome - I was kind of trying to circumvent any afilliation by the "crap" looking logo with SO on it
 
and
bah, message too long.
> Derived logos must always be sufficiently different from the Python logos to allow the community to tell the difference. For example, if you want to create a derived logo for a local Python user group, you might be able to insert an unaltered Python logo graphic into the local group's name in a way that does not cause confusion.
> But confusingly similar derived logos are not allowed. This includes entwining Python logos with other logos, or connecting them together in a confusing manner. Logos that simply change the colors or fonts are not allowed.
> Use of derived logos for user groups and conferences -- Allowed if used to refer to the Python programming language. Commercial user groups and for-profit conferences require permission from the PSF.
 
this means my version is NOT allowed
OK, then I will think about some new ideas — I have one, a more abstract and more geometric version of the logo
and maybe we can add orange and gray — just like SO has
I will create that tomorrow
But right now: back to work
~
 
@PeterVaro: I think you are in a grey area.
Ask the PSF for explicit permission; it may be that it is indeed insufficiently different.
It asks you to do so explicitly, actually:
> We recommend contacting the PSF for permission for all derived logos to avoid placing a confusing logo into wide-spread use. Contacting us is not a requirement for the specific non-commercial uses listed above, or when using freely distributable derived logos that have already been approved by the PSF. However, obtaining permission from the PSF is required in all other uses of a derived logo.
The Boston Python user group is actually quite prominent.
And I am pretty certain that several east-coast Pythonistas I know (Barry Warsaw, Jeremy Hylton, Tres Seaver) will have been at Python Boston events; if that logo is allowed, so is sopython.
 
10:10 PM
@MartijnPieters bearing in mind we're just attemping to create something around an existing community...
Maybe it's best I contact the PSF as the owner of the domain and explain its intent?
 
I think that's the best course of action, yes.
 
K then, do you have a moment on Skype?
 
Uhm, new machine, give me a sec to install Skype..
 
00:00 - 14:0014:00 - 23:00

« first day (963 days earlier)      last day (3978 days later) »