« first day (1431 days earlier)      last day (3520 days later) » 
00:00 - 17:0017:00 - 00:00

12:10 AM
Actually, scratch that ... didn't look carefully enough at the question.
 
12:47 AM
Somebody please cheer me up, i'm depressed now.
I had this idea that was going to "change the world" and "revolutionize", blah blah blah.
Until i discovered it was called "the actor model with coroutines"...
So much for my entire summer.
 
 
1 hour later…
2:13 AM
@NoobSaibot you will understand that model better then
 
2:33 AM
@AlexV.: A consolation prize, i suppose.
 
2:52 AM
@JonClements I see I was the topic of some hilarity earlier. You never know where you'll find my eyeballs :)
 
 
1 hour later…
4:07 AM
@Jon you're having a lot of early mornings lately ...
 
 
2 hours later…
6:52 AM
@Zero in regards to your uncertainties question from 1am :p yes I think there is a module called uncertainties
I'll search for it when I'm not on my phone
I realise this is 8 hours late and so possibly not needed anymore :P
 
cbg
 
cbg
 
7:29 AM
cbg
 
cbg
 
cbg
 
Do we know what was the main reason against the overloadable assignment expression in python? I mean, sure, we have some sort, we call them properties, but that's not entirely the same. So?
 
8:00 AM
What do you mean by "overloadable assignment expression"?
 
@thefourtheye like you can overload == with __eq__ there is no overloading for = as __assign__ or something
(I almost wrote __ass__ but then I thought.. hey, it would be inappropriate..;))
it would change the whole structure of the language, and how we use it.. so I have a feeling, why we don't have this option
however I'm still pretty curious, if there is a rational behind it from GvR, or something
*feeling = hunch
 
cbg
@PeterVaro you can overload almost everything else...
 
I know, literally everything
 
but... just go see php on how fsckd up things get when you can overload assignment...
 
but I'm just curious -- I didn't say I need this feature ;)
 
8:14 AM
only PHP does it like you think... and it is so deep that omg.
 
@AnttiHaapala btw have you got the message I linked you about hebrew PHP errors?
 
@AnttiHaapala anyway, even if PHP screwed this, that doesn't mean it has to be screwed
 
unexpected t_paamayim_nedukotocaktusotusim wtf?
 
I mean, I'm pretty sure it could be designed as a handy and nice feature..
@AnttiHaapala that's the one ;D
 
8:16 AM
only 2 alnguages come to mind that fsck wiht assignment operators
the other is C++,
where it is understandable...
 
that's the one, yes, I thought about the cpp way
 
the other is PHP where it leads to unbelievable fscking
for example the & operator...
in php it is magic, black magic and actually a curse cast upon the programmers
@PeterVaro there is very good reason on why python does NOT work that way
bc in python the names are references to objects, in C++ they are blocks of memory with starting address as linked by the linker.
 
@AnttiHaapala and that's exactly what I was asking: what that very good reason is?
 
the very good reason is that a = 5
a is not an object, 5 is.
so why would 5 influence how a behaves
in C++ a IS the object.
and if in C++ you do NOT allow overriding the operator=, then you will be fscked up :D
 
yepp, I thought about this, that's why I wrote "it would change the whole structure of the language"
 
8:22 AM
it is like: "can we change python into a language where we need operator= overloading so that we can overload operator=" :D
 
fair enough
 
"I want my language to be more like C++ or PHP"... why? isn't there enough misfortune with those 2 ;)
 
I don't know why, but somehow, this question makes me feel deeply uncomfortable. — ComicSansMS Sep 5 at 15:17
 
@AnttiHaapala you know me for like.. 1.5 years now? my attempt to avoid PHP and C++ is just as strong as yours..
I mean, I like python as it is, right now -- but still, I could be curious about the reason, couldn't I?
 
:D
but not too curious
 
8:24 AM
oh I see :D
 
I mean, if you just wonder, it is ok, but if you think you might want to try having a language like that then ... :D maybe patching CPython
 
@PeterVaro Related discussion in the mailgroup
 
nope, I don't want to change python -- and reason for that, is anytime, I have doubts, I just have to read some PEPs and the responses for that PEP and the world makes sense again. I think there is very of languages out there which is as straightforward as python in accepting and denying features
(which I like very very much, I think it is a good FOSS role model comes from GvR)
 
ah there are some stupidities in python, but they are not this fundamental :D
 
although there is one thing I thought it would be nice, and when we got it, it turned out, it is not that useful as we thought in the first place and those are function annotations..
@thefourtheye magical, thank you!
 
8:28 AM
and when I mean about overloading = in php i mean, that php allows one to change the behaviour of names by storing a reference in there...
 
*there are very few languages out there which are..
 
hmm
by the way, if a is undefined, a = 5 would call the assign method of which class exactly?
 
ahh, @AnttiHaapala, that is a very good observation!
since we have no forward declaration nor static types.. it makes absolutely no sense to assign to something which we don't know anything about..
that's a nice observation -- ofc we could create an "empty" object (type/PyObject)
but I think that would make things very very dirty at the end..
and will totally mess up the GC
 
@thefourtheye Good read :)
 
8:43 AM
The page was stuck on the Loading Python bit, so I had to ctrl-f5 it
Staring at ellipsis is maddening
 
8:58 AM
I do love PBF
 
9:27 AM
Hi
Can anyone help me with this error - _Environ instance has no call method
 
@Jeeva cbg
 
I am trying to execute a piece of code in command prompt through python
for line in sys.stdin:
    # obtain filename from file list
    filename = line.rstrip('\n')
    localfilename = ntpath.basename(filename)
    os.environ("hadoop dfs -get"+line+ " " + localfilename)
and this is my code
 
isn't os.environ a map, not a method?
 
its just creating a file from hdfs filesystem to my local file system
 
so os.environ["HOME"] will output the value of an environment variable called HOME
equivalent to echo $HOME in linux or echo %HOME% in windows
Maybe you want:
 
9:38 AM
but if i want to run this command hadoop dfs -get"+line+ " " + localfilename in command prompt through python, what should i use
?
 
@Jeeva you want to use subprocess to execute commands
 
from subprocess import call
call(["hadoop dfs", "-get"+line+ " " + localfilename])
 
cool.. thanks.. let me try this..
 
Possibly the quotation marks aren't right there, but you get the idea. just google call external command from python, there'll be a million examples
 
subprocess.call(['hadoop', 'dfs', '-get' + line, localfilename], shell=False)
ifff the cmdline by itself is right
(which I doubt)
 
9:41 AM
Wait, what is that line thing. Are you trying to execute a second command using \n?
 
that should be filename variable.. my mistake
not line..
 
what's the actual command you're trying to run? as though you were typing it into the shell
 
actually what i am trying to do is to find an equivalent for this ruby code
STDIN.each_line do |line|
# obtain filename from file list
filename = line.chop!
if /\A.*\/(.*?)\z/i.match(filename)
localfilename = $1
else
exit
end
# copy file from HDFS to local disk
system("hadoop dfs -get /user/your_hadoop_username/" + filename + " " + localfilename)
This is what i have written from my knowledge..
for line in sys.stdin:
# obtain filename from file list
filename = line.rstrip('\n')
localfilename = ntpath.basename(filename)
os.environ("hadoop dfs -get /user/hduser/"+ filename + " " + localfilename)
 
Please stop pasting so much code bud
Antti
 
oh am sorry
 
9:47 AM
Antti's given you a way to call the command; have you tried making that work?
so as we were saying, don't use os.environ, that's to get values of environment variables
 
ok sure. i am trying with antti's one now
 
cool, let us know how it goes
 
cbg
 
10:10 AM
hi. Anything wrong in this execution?
./newmapper.py -i /home/hduser/temptransfer/final.txt
its not giving any erro, but running for long time
 
@Jeeva That bash command looks okay to me. Whatever newmapper is doing to final.txt is taking a long time
 
@IntrepidBrit did you see cameron's speech?
 
@RobertGrant Nope. I've got my nose pretty close to the grindstone. Some of the recent events are whooshing over my head
 
@IntrepidBrit I'm not a fan of his but it was a good speech. Not sure how pursuasive it is if people have already made up their minds, but worth a look
 
10:26 AM
@IntrepidBrit Then i think something is wrong, because, i am just copying file in that code. it should not take much time
 
But in factual terms there was a carrot: "if you vote NO then we will still give more power to the Scottish parliament" and a stick: "if you vote YES then there will be closed borders, no more link to the pound" etc
 
@Jeeva Unfortunately, I've not looked at the code and don't have time to look at the code to find out why it's taking a long time to do what it's doing :(
 
naah.. its ok. let me check.. :)
 
@Jeeva chuck the code on pastebin, if you're happy to share it, and maybe that'll show something
 
@RobertGrant The problem is, some folks will see the carrot as "THEY'RE DESPERATE TO KEEP US. WE MUST BE DOING SOMETHING RIGHT". And the stick as "SCAREMONGERING"
 
10:29 AM
You're a carrot.
 
The bit that annoys me a little bit is that Westminster and Holyrood were still devolving (and re-attaining) powers here and there before the whole referendum. And now BOTH sides seem to have problems with how it was done.
 
@IntrepidBrit yeah, I think that was pretty much the response
from whatshisname
 
and this is the code guys - dpaste.com/0SZE0P1
and the file this code reading contains this - dpaste.com/0TE2QJT
 
@RobertGrant Alex Salmond?
@Ffisegydd Thanks fizzy
 
@IntrepidBrit <3
Writing some thesis up and listening to some funky tunes.
I love me dat LaTeX.
 
10:40 AM
Mmm LaTeX
 
Project suggestion: jinja2->LaTeX converter
:)
Extra credit: bidirectional
 
@RobertGrant you can already do it.
You have to redefine some things in Jinja as {} are used so much in LaTeX.
But Jinja will template anything, not just HTML.
 
Stupid firefox e10s crashes on view source, muttermutter
 
@Ffisegydd I make it a habit to vote to close any question tagged python-2.x, so good call
 
11:13 AM
cbg
 
@thefourtheye finally -- someone ;)
 
I had no idea that MS had bought Mojang
(even though @Ffisegydd had linked the entry on the starred list about notch)
 
11:54 AM
People who try to unnecessarily format their floats make me sangry.
 
is "sangry" a cross between angry and wanting to drink sangria?
 
sangry = sad + angry?
 
+1 for @Peter.
 
Fine - I'll keep the sangria for myself then
 
was it really?
@JonClements oh, man, okay, +1 for you too ;) I liked it.
 
11:59 AM
-1
Q: Can I change Python's Decimal default formatting?

LudoI'm working with Python Decimal types, up to 8 decimal places, and for very small numbers, by default, they are displayed using exponential notation. I would prefer them to be displayed in non exponential notation. Example follows: >>> from decimal import Decimal >>> d1 = Decimal('0.00000100') >>>...

 
@Peter lol... I'll take your +1 and hand it back to @Ffisegydd so he can hand it out again next time :)
 
:D:D:D:D
how generous we are.. amazing..
this makes this community sooooo strong :D
 
ALL THE +1 ARE MINE! runs away
 
ALL THE SCOOBY SNACKS ARE MINE! sits in the corner and starts munching on them
 
@JonClements Gives Jon a snarly look
 
12:06 PM
@Peter you've probably not heard of this but there's a British show called "Great British Bake Off" where people bake cakes in a competition. This week the theme was European cakes and as one of the challenges they had to bake a Hungarian cake.
They had to make a contemporary version of a dobos torte
 
okay okay! hands @thefourtheye some snacks
greetings Farmer @Kevin
 
Yo
 
@Kevin Still not getting used to the salad, huh?
 
@Ffisegydd torta -- but wow, thanks, I'll check it in a minute
cabbage(@Kevin)
 
I'm a counterculture revolutionary ;-)
 
12:08 PM
@thefourtheye he is the ultimate rebel, you know that
 
@Kevin No, admit it.. You hate vegetables... :D
 
Perhaps it is so.
 
@Ffisegydd grrr
> a showstopping finale that puts the hungry into Hungary...
I've never heard this joke before :P
 
bahahahahahahahaha. Gotta love the Beeb.
 
mmm, we should work on the non-veg counterparts of the salad...
 
12:11 PM
@Ffisegydd oh snap, I can't watch it..
> BBC iPlayer TV programmes are available to play in the UK only.
 
I will search for it on YT.. maybe.. we'll see
 
(There is an FF version too)
 
FF => FlashFree, FireFox, FoodFight?
 
12:13 PM
@JonClements hmm.. hmm...
 
@JonClements Ah, its about time the world learnt something from us....
Anybody here in mood to learn Haskell?
 
I keep meaning to get back to more Haskell... never the time... can do a few bits though :)
only really used it for euler though
 
12:30 PM
Lets start with this?
 
I tried to learn Haskell few times but, I don't remember why I didn't complete it :)
 
You don't complete Haskell. It completes you.
 
12:59 PM
@JonClements does it mean the world is only a bunch of mirrors and i'm completely alone??? or i am mirror too! thank you jon-the-mirror, you ruined my day... :(
 
1:09 PM
@Paolo but there is no mirror... instead, you reflect yourself
 
@jon even worse... ;_;
 
cbg @Daniel and @Ahmad
@Paolo it could be worse, but then did you think that, or was it just your reflection's thought?
 
cbg @JonClements
 
I don't much care for that passage, since it comes fairly close to the "bad things only happen to bad people" fallacy. So, what, it's impossible to be a cheerful person that happens to be surrounded by actual grumps?
(expected response: "found the grump: ^^^")
 
@Daniel I was going to pick your brain the other day on something I'm certain is simple in Django, but alas, couldn't find suitable search terms... so I just ignored it... so if I remember what I was supposed to be doing, I might be cheeky and try picking your brain for what terms to use
 
1:16 PM
@JonClements sure, ping me whenever you remember
 
@Daniel cheers... it can't have been that important if I just side-lined it and did something else, but I just know it'll nag at me later...
 
haskell always gives me headache
 
cbg @jon!
 
2:05 PM
@JonClements if you want to ask me first and take the chance it's one of the three things I know about Django, also feel free :)
 
And if you want to ask me about django, please don't because I don't know anything about it.
There, we've covered the complete spectrum of expertise.
 
@Robert thanks... good to know I've got a 1 in 3 chance of when remembering what it was I was trying to do that obviously wasn't that important that you know about django :)
 
Yesterday I had an idea for a feature for R.A.B.B.I.T. When any user writes "anyone here know [whatever]?", the bot lists the top ten most knowledgeable users in the room, ordered by the number of answers they have made on SO under the [whatever] tag.
 
If there was a - we just list you alone, right? :p
3
 
I'm on the fence about whether this feature is actually a good idea, though. Once all help seekers can effortlessly locate the most qualified person, will they feel entitled to ping them directly without prompting?
 
user559633
2:21 PM
I forgot, how do you do the tag?
 
@JonClements No, my star getting procedure is a closely guarded secret, so I would have 0 answers in that tag.
 
@tristan [tag:<stuff>]
 
Starred as well
 
ew, tag boxes look a bit weird on the star list. The bottom of the box is flush with the J and C in Jon's name.
 
very weird indeed
 
user559633
2:22 PM
[tag:danke!] [tag:@PeterVaro]
 
user559633
@Kevin that would be amazing because it would lead to martijn getting messages constantly by unhinged newbies
 
what is the name of the tool, where you can examine what happens under the hood of the evaluation of a python expression? (you know, when it decompresses and lists the components.. I just forgot the name..)
 
@tristan I think a tag could only contain word-like characters
 
2:24 PM
"I only get 25 results" "You have limit 25 in your query"
 
Yeah, maybe it should be an opt-in service...
 
@davidism that is awesome
 
@PeterVaro the dis module?
 
@Kevin thank you.. that's the one, yes..
I've been searching for it with various terms.. for at least 15 minutes now
 
Yeah, it's not the most descriptive name they could have given it
 
user559633
2:29 PM
dis? disassembly
 
@Kevin I guess the problem is I don;t use it too often
 
I bet they didn't call it disassembly because when you're in hour 19 of debugging, you don't have the presence of mind to remember which bits have the single s and which bits have the double s
 
and I just totally forgot the name..
 
user559633
255 bytes and a bit aint one
 
>>> import dissasembly
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named dissasembly
>>> #damn you pythoooooon
...
import ddissassemmbblly
 
2:31 PM
@davidism I'm going for the rep
Playing the role of kindly old advisor to young whippersnapper, when I should be finding out where he works and shorting their stock
 
That's a rational choice because rep is more valuable than money.
 
He's got 6 rep. Can he even upvote me?
 
@RobertGrant nope
 
user559633
ugh. went out and had a night yesterday and now my desk looks like a bird tried to make a nest using $1 bills
 
user559633
or i took up employ as a stripper. one or the other.
 
2:45 PM
@RobertGrant fair enough
Peaches, pears, the majority of our stared posts are links. Stop outsourcing.
 
user559633
whenever i log into stack and have messages waiting for me (like now), i know i'm about to lose an hour explaining something to someone that doesn't care
 
user559633
oh neat, an actually helpful comment on one of my answers stackoverflow.com/questions/25806982/pip-version-in-virtualenv/…
 
10 rep. worth it
 
3:13 PM
The Onion has modified their site so that every page has automatically playing audio, unrelated to the content of the article :-I
Is... Is this satire?
 
user559633
3:28 PM
not happening for me @Kevin. edit: I see what you mean with the autoplay video, but it's muted for me by default
 
3:49 PM
There appears to be a forest fire to the northeast.
And someone found a large mushroom waaay out east.
 
:D that's awesome. You can see the start of my mountain retreat there.
My plan is eventually to build both downwards and upwards, gonna have a spiral staircase all the way down to bedrock then maybe a tower above it.
 
I have a newb Python question. Why do they call what looks like an array to me a list in Python?
 
@Phorden we call it a list, since there are no arrays in python
are we talking about [] <-- this one?
 
Yes.
I guess what I mean is what is the technical difference.
 
ls = [1, true, "hello", MyObj()]
 
4:02 PM
array has to be homogenous data?
list can be dynamic?
 
@Phorden I guess the question is, what do you think, what an array is?
 
It is a collection of values as far as I understand.
Not sure if it has to be the same data type though.
 
@davidism That was me. I remember that marshy area from the last night of my pumpkin-seeking expedition.
 
@Phorden There are such things as arrays in Python but they're used very little
 
Python collections rarely care about data type. (exception: objects stored in a set must be hashable. Same for dict keys.)
 
4:04 PM
The renderer is written in Python too. :) github.com/overviewer/Minecraft-Overviewer
 
Generally people use lists, or if they're doing intensive numerical work they'll use numpy
 
@Phorden this is the best I could find:
1
Q: Difference between List and Array

andrussk Possible Duplicate: Primitive Array vs ArrayList What is the difference between List and Array in java? or the difference between Array and Vector!

 
I should add a world border so the size doesn't get out of hand.
 
I wonder if there is a better stackoverflow explanation than this..
 
@PeterVaro Seems almost identical to how C# differentiates them.
 
4:06 PM
Might be a good idea to ask as a canonical (before Zero does :P)
 
@Phorden well, anyway, if you compare for example C arrays to Python lists there are several differences there
 
Have at it :-)
@Ffisegydd thanks for the pointer to uncertainties btw ...
 
first of all, Python is an OO language => and everything is an object in it => all of the objects has a base-type
uh.. I just realised I have to type in a novel to explain this.
umm.. maybe I started from the wrong way ;)
114
Q: Python List vs. Array - when to use?

Corey GoldbergIf you are creating a 1d array, you can implement it as a List, or else use the 'array' module in the STDLIB. I have always used Lists for 1d arrays. What is the reason or circumstance where I would want to use the array module instead? Is it for performance and memory optimization, or am I mi...

 
@PeterVaro Maybe I should start with how I understand the difference and you can correct my misunderstandings?
 
@Ffisegydd look what I found
@Phorden umm.. okay
 
4:12 PM
@PeterVaro Nevermind, the answer to that question explains the difference well enough.
 
@Phorden yay ;)
 
The answer to "why are they called lists in Python?" could be something as simple as "People use lists in real life almost every day, but usually don't know what an array is. For simplicity, we chose the first term"
 
@Kevin :D:D that's a very deep explanation
the problem is, when you have to talk about arrays, you have to talk about memory, and bits, and bytes, and boundaries and types, and type-sizes, etc.
 
@Kevin there is a lot of little subtleties in programming that are slight but big enough to warrant a different name. One I always thought was interesting is function vs method.
@PeterVaro That's fine, I know it starts becoming a stack vs heap explanation and there is a lot to it. I am fine with the explanation I have been given for now. =)
 
I guess Python is just more laid back about terminology B-) The glossary says:
> Despite its name it is more akin to an array in other languages than to a linked list since access to elements are O(1).
 
4:15 PM
@Phorden I'm glad :D
 
So the devs are well aware it's more array-like than linked-list-like, they just don't care
 
I thought Python list IS a linked list, not an array (in CPython, under the hood)
 
I always thought it was an array of pointers to PyObjects.
 
hmm..
 
using some clever memory allocation tricks to get a constant amortized time for appending
 
4:17 PM
65
A: How is Python's List Implemented?

larsmansThe C code is pretty simple, actually. Expanding one macro and pruning some irrelevant comments, the basic structure is in listobject.h, which defines a list as: typedef struct { PyObject_HEAD Py_ssize_t ob_size; /* Vector of pointers to list elements. list[0] is ob_item[0], etc. *...

 
That's basically what I had in mind
 
makes sense.. I don't know why I thought they were linked-lists..
 
Of course, what the CPython implementation does, doesn't say anything about the Python language. CPython chooses to implement lists as arrays of pointers. I could write a "KPython" implementation of Python that uses a Game Of Life simulation to store list values, and that would be just as valid.
 
@Kevin Do-It! Do-It! Do-It!
(I really want to see a Game Of Life implementation of Python, it would be AWESOME)
 
In an alternate universe where KPython dominates, We'd be asking "why call them lists? Why not call them Gosper Glider sequences?"
 
4:23 PM
btw @Kevin have you seen the link someone (maybe me?) posted a few weeks ago: the game of life implemented in game of life?
 
Is the standard implementation of python CPython, or am I just confused?
 
@PeterVaro, Yes I have, and I think it's F-ing amazing
 
@Phorden that is the most widely used one, but PyPy or IronPython or Jython are different implementations
 
So is python the language written in C, or just the most used version of it?
 
@Phorden CPython is, while PyPy is written in python
 
4:25 PM
Python the language is a document, cPython the common interpreter is written in C
 
@davidism isn't it a standard?
(I mean it is standardised, isn't it?)
 
Sure, that word makes more sense.
 
@davidism Ah okay.
I just started working with Python, that's why I am asking so many questions. =)
I am really liking the language so far.
 
It's like asking "Is Java written in C?", the question doesn't make sense.
Glad you like it.
 
@Phorden that's okay, and you made a very good choice here
 
4:32 PM
@Phorden working on anything in particular, or just learning?
 
DSM
Cabbage, all.
 
cbg
 
cabbage(@DSM)
 
Hey folks, quick question, does anyone know if when I packaged a python script into an exe, does it package up everything in the standard library, or only the modules I import?
 
user559633
depends on what you're using. py2exe? also, depends on your setup file. edit 2: you'll likely have luck searching google with "include site packages"
 
4:42 PM
@tristan, I'm using Pyinstaller
 
Since modules can be dynamically loaded at runtime with the __import__ function, figuring out exactly what modules to package in all possible situations seems like a tremendous headache. Therefore, I suspect most exe packagers just stick the whole standard library in.
 
Cool, thanks
 
__import__(raw_input("Enter the name of the module you want to import:")) #your move, packagers!
 
DSM
I could imagine a config setup where you chose the bundled modules, some subset of the stdlib, and if the program asked for one you didn't include it just errored out at runtime.
 
On the other hand, the above code is something that no sane developer should ever do, so perhaps exe packagers ignore __import__ and only include modules mentioned in import statements.
 
4:55 PM
cbg() again all
 
user559633
cabbage({"user":@Ffisegydd})
 
Just picked up a magic mouse for my MBA
mouse + touchpad == awesome
 
DSM
Does MBA stand for something different over there?
 
Macbook Air?
What does it stand for there?
 
DSM
Ahh.
 
4:58 PM
@Ffisegydd I have three mouses (mice) as well!
 
user559633
MBA: Masters in Business Assery
 
Ah. It also stands for that here.
 
a magic touchpad, a wacom board and a 3DConnexion mouse
(are you using mouses, when we are talking about computer mouse in plural or mice as the living mouse in plural?)
 
00:00 - 17:0017:00 - 00:00

« first day (1431 days earlier)      last day (3520 days later) »