« first day (1292 days earlier)      last day (3880 days later) » 

19:00
We'll get through this...as a random group of assorted python programmers...
dinnertime
But actually, what really pissed me off today, were all the MS fanboys... seriously, those guys are like a cult.
@Crow My guess is "no".
@martijn rbrb!
19:01
@JonClements Oh, well I plan on using distutils
lol, Yamming by bob marley now has a whole new meaning
@Alexander but bananas you're now enlightened, right? ;-)
err I am using distutils
its yam bananas! :-D
19:04
When someone tells you "Python is like Ruby, Perl and Bash", you know that you are talking to a blockhead.
cabbage pears, potato?
Sab
Sab
peach, pears, plums oranges, vroom vroom
:O
I migrated from Perl to Python, originally. They're like distant cousins.
Note, the mentioned guy has NEVER seen Bash or even Linux in his entire career.
I don't know bash or ruby, so I have no comment there
19:06
Yeah, Python, Ruby and Perl can be considered to be in the same category. Bash on the other hand... that's like saying that Javascript is like Batch.
I'm failing hard :\
@Crow, ahh the last stage of denial
Pull yourself up by your bootstraps
@Crow, can i assist you in your troubles?
@AlexanderMeesters it would be nice, but it is a quite big problem so feel free to quit if it's too big
19:10
well, your in luck, i'm a big guy
oh baby
:o
:P
What is your problem Crow? Apart from opening inappropriate files in youtube videos?
the problem seems to be that the PCB isn't made quite right, because it never finds one
if you wish to try it, clone it locally and run mtops.py, then use 1 as the first input, and then type in homework3
cabbage again
Sab
Sab
cabbage
19:21
What do you call in English the state after lunch, when all your blood is working in your gastro-intestinal tract and no blood is left for operating the brain?
I'm not sure it has a name but I know what you mean.
Hrmph, I believe I've found a regression
And I still dream about a python with TCO and argument pattern matching... sigh... The expressive strength of recursion coupled with the syntactic beauty of python... sigh...
And I dream of anonymous function expressions... Not that there's any good way to implement them in a whitespace-significant language.
While we're at it, I want truly parallel threading, and a pony
a tail-recursive, anonymous pony
DSM
DSM
19:27
cbg, all.
Greetings
DSM
DSM
@Kevin: are they implemented in KevinScript?
salutations
anonymous function expressions? Yeah, actually.
Ponies? No, not until KevinScript 3000
DSM
DSM
.. aka lisp.
Lisp already has ponies.
19:31
@Kevin I hope you're not prioritising your magic language over fixing the orbital tea cannon... :p
Well, you can't separate one from the other. The LOTC is all done in KevinScript
Guys i am trying to setup arelle by going to the directory and typing python setup.py and i get this error...(BIG PIC COMIN)
Can anyone help i am lost for some hours on this
@ExoticBirdsMerchant 1. Please copy code, not images. 2. I'd imagine "No module named cx_Freeze" means that you're missing cx_Freeze...
Is cx_Freeze on your path?
no
it is not you mean on env variables?
no and it says i am missing cx_Freeze what can this be?
19:35
It's a python library.
Which you could Google...
Which obviously does not reside inside your python path
Ohhhhh jesus i will FIND HER
are you sure it's a lib
?
It is a module to be precise
Most probably part of a lib
oh so how can i know in what lib it resides ?
Google.
19:36
Maybe even this one: cx-freeze.sourceforge.net
i'll give it a go.
(EPIC HINT: it is that one...:P)
it has an installer i am currently putting her on my computer
@Ffisegydd steady Stewie... you may be introducing @ExoticBirdsMerchant to radical new concepts by throwing around that "Google" word... where'd we be with more spare time not pointing these things out!? :p
Sab
Sab
19:38
I'm Bugged!
now i will retry
Sab
Sab
I'm trying to merge 4 rows of a list in the first list
ohhhhh something new happened this must be studied
@Sab sounds like the term you're looking for is "flatten a list"... there's various bits on sopython.com for that
Sab
Sab
@JonClements Ya, basically what I'm trying to do, but I'm trying to make a function.
DSM
DSM
19:40
@ExoticBirdsMerchant: FYI, it's a little unusual to use "her" to refer to libraries or modules. Not unheard of (I do it sometimes when explaining how a piece of mathematical software is behaving: "She then tries X..") but relatively rare.
Sab
Sab
So it will have to "flatten" left right up or down depending on what I need.
@Sab then you still use the same thing, but transpose the list depending
@DSM well emotions are running high here
Sab
Sab
But it's not exactly what's on sopython
@JonClements The one on Sopython just "merges" the list
Let's say I got this:
([[1,2,3,4],[3,2,4,5],[1,32,4,5],[3,2,4,2]])
1,2,3,4 should be turned to (8,38,15,16)
and the final result should be
You want to sum along an axis then?
Sab
Sab
19:43
[8.38.15.16],[0,0,0,0],[0,0,0,0],[0,0,0,0]
You're still not using numpy?
Sab
Sab
Nop
I don't want to use numpy for now.
@Kevin remember that function to check if values are equal :)
I can think of a way to do this... But if your follow up question is going to be, "now how do I combine only values that are neighbors and are equal to one another?", the technique will be totally unsuitable
There is no weakness/fault in using a module or library.
They are tools and learning to use them is valuable.
Sab
Sab
I wonder why my chat appeared in an edit
19:44
[sum(x) for x in zip(*a)] returns 8, 37, 15, 16
a being your list
8, 38, 15, 16
Sab
Sab
Hmm
I'm trying to use a for loop but it's a disaster
I had been to a pet shop last week. Was surprised to learn that a puppy Rottweiler retails upwards of $1200.00
TIL about this nifty python function called .title(). How do they think of all these little things and implement them?
Sab
Sab
:O
a.sum(axis=0) returns what you want using numpy (just sayin' :P)
Sab
Sab
19:45
lol
but do they have a function a.2048(axis=0)?
And axis=1 will return the sum in the other direction
Sab
Sab
lol
@Sab not using numpy is less readable for instance.... data = [map(sum, zip(*data))] + [[0, 0, 0, 0]] * 3
Sab
Sab
@JonClements I know.
I just want to find a way of just using loops and lists to make it
DSM
DSM
19:47
To be fair, if you wanted to get the extra zeros you'd need to do more work in numpy too.
Sab
Sab
well, the extra zeros is not a problem.
By the way, the code for 2048 is publicly available. You might find some inspiration there.
Sab
Sab
It's how to get the sum which is the hard part, since everything I'm trying to do is simply concatenating them
@DSM well yeah, but creating a new zeroed array, then updating the first row with the sum of the other is far more intuitive
DSM
DSM
How can you concatenate numbers?
Sab
Sab
19:48
@DSM in a list the numbers are treated as string I guess. I'm not sure why it's happening
@DSM easy: 2 + 2 = 22 :P
Duurrrrr
DSM
DSM
Numbers aren't treated as strings. If they're concatenating when you add them, they're almost certainly strings, not numbers.
or ponies
Sab
Sab
hmm
@DSM b + a*10**(int(math.ceil(math.log(b,10)))) :-D
Or, for the lazy, int(str(a)+str(b))
DSM
DSM
19:51
@Kevin: :P
Or you just hack away at the CPython implementation...
Sab
Sab
I guess I was using a loop
It wasn't concatenating actually, it was doing some random weird addition a repeated umber of times
But what's I'm doing it not practical
Let's say I had a 10x10 what would have happened
basically here's what I did: pastebin.com/QNP9mRzC
I got some appreciation at least
d'awwwwwwwwww
Aren't you good Jon clement.
:P
DSM
DSM
@JonClements: congratulations. :^) I've decided that I don't even look at questions with indentation problems any more..
19:56
@Sab Then it would look like this: pastebin.com/v7ZX58Jg
I'll write the 100x100 version for fifty bucks ;-)
Sab
Sab
@Kevin then
4 mins ago, by Sab
But what's I'm doing it not practical
I'll write it for 49!
DSM
DSM
@Sab: if you don't want to use zip for some reason, then loop over every row and column by index. And don't trust Kevin, he's trying to rip you off. I'll do it for 48.
47 and a puppy!
@DSM wasn't any code to start with, then there was just poorly copied from a linked answer... but - we got there.... as least it's not now viewed by me as a complete vampire anyway...
19:57
Get back, you vultures, this one's mine
Sab
Sab
Talking about dollars. A guy hired me to put his logos on different t-shirt(2000)
I'll pay you each five dollars not to underbid me
DSM
DSM
@Kevin: done and done.
Done.
Sab
Sab
Opened photoshop created an autoscript. 10 minutes $200
How good is that
?
19:58
If only you were so practical in your python coding :P
My good-ometer is reading record levels
Sab
Sab
lol
I'll be that good in a month or 2
gimme 100 hours of practice :P
And I'll be good
But seriously now. Why are you writing each line individually? It makes my eyes bleed.
Because you just can't trust those tricksy for loopses
DSM
DSM
Every now and then I've manually unrolled a loop for performance reasons. Never in Python, though.
20:01
Sab
Sab
@Kevin But seriously, how can I find a simple way to do it?
@Sab I believe you've already been given 2, maybe 3, solutions.
Numpy is the Devil's work! Stick with sum and zip! No seriously, use numpy.
Sab
Sab
@Ffisegydd Yup but I really want to not use outer functions. I want to make a function which acts like one of them.
First you say, hey, these lines all looks similar except for one number, I can replace them with a loop:
def sum_up (grid):
    for i in range(4):
        grid[0][i] += grid[1][i] + grid[2][i]+grid[3][i]
print(grid)
Then you say, hey, those grid terms all look similar except for one number, I can replace them with a loop:
def sum_up (grid):
    for i in range(4):
        grid[0][i] += sum(grid[j][i] for j in range(1,4))
print(grid)
Sab
Sab
20:03
I see my mistake
Then you say, hey, now it's easy to make this work for 10x10 arrays, I only need to change two numbers
Sab
Sab
Here's what I was doing:
def push_up (grid):
   for i in range(len(grid)):
      grid[i][i] += grid[i+1][i] + grid[i+2][i]+grid[i+3][i]
   print(grid)
sum(grid[j][i] for j in range(1,4)) << This is the kind of code I want to write. It's really simple but my codes look more complex than that
There's nothing wrong with complex code, and similarly there's nothing holy with simple code. Code should be as simple as it needs to be and no simpler.
Sab
Sab
sum(grid[j][i] for j in range(1,4)) << I actually don't understand a lot from this
That line uses a generator expression as the argument to sum.
20:07
@Sab If you want to work without numpy, what's wrong with [sum(x) for x in zip(*a)] (columns) and [sum(x) for x in a] (rows)? As long as the matrix is not ragged, you don't even need to know its size...
The best way to learn about those is probably to read up on list comprehensions first. They're very similar concepts.
Sab
Sab
@Hyperboreus sum(grid[j][i] for j in range(1,4)) I'll use that but I need to understand it you know?
Thanks @Kevin reading that now.
Oooo, 1717 answers... how cool
DSM
DSM
I'm only at 1413.
Well, one more for 1414 - also cool :)
DSM
DSM
20:09
Hey, true! I wonder if I should have stopped at 1234 or 1123 or some other cool number.
Mine's 376, a highly significant number. It, uh is the year China was divided between the Former Qin in the north and the Eastern Jin in the south.
(good save, Wikipedia)
DSM
DSM
376 is a great number. It's pentagonal, one different from a Fibonacci number, and the number of collinear point-triples in the 4x4x4 cube.
96. And 150 short of 3k. Need to get 150 rep with 4 answers...
690: Wu Zetian ascends to the throne of the Tang Dynasty and proclaims herself ruler of the Chinese Empire as "Holy and Divine Emperor".
Every number is interesting, if you look hard enough :-)
Let's not get into the debate about "isn't the smallest uninteresting number actually interesting because it's the smallest uninteresting number?"
DSM
DSM
20:16
Reminds me of those "you'll be shot one day this week, and it's going to be a surprise" paradox puzzles..
Logically working out that I can't be shot and still be surprised, so I smugly go about my business... Only to be shot on Tuesday, much to my surprise
Not sure my first emotion would be surprised. Were I still alive, it'd pretty much be one of pain and murderous thoughts...
Haha, the interesting number paradox article actually links to the unexpected hanging paradox article... I guess DSM isn't the first person to be reminded of one by the other :-)
DSM
DSM
Hah! When I was young I used to be disappointed when someone else drew a connection before me. Now I find it reassuring..
grrrrr. I can't find where this problem is happening
20:20
@Crow I'm gonna guess it's happening in your computer.
Sometimes I enter phrases into google to see how long it takes for autocorrect to guess what I'm thinking. I smile when it happens in like three letters
... OH I GET IT!
"I aw" completes to "I award you no points, and may god have mercy on your soul". Good job Google, that's oddly specific to get with four letters
@JonClements okay, I think I'm going crazy.. I created a summary, I hope every important thing is in HERE which produces this OUTPUT
DSM
DSM
20:23
I've never seen the film, but I've seen that one scene lots of times.
@Ffisegydd Somehow I got the first close vote on that, despite someone upvoting your comment
@Kevin I hope (beg) you take a look at the two files I posted (pls)
Maybe he (and you) ran out of close votes for the day?
I can't close vote yet, so I only flagged.
@PeterVaro Ok, let's see what I can do in my last few minutes... It's a race against the clock!
20:25
@Peter gimme a bit - let me put my "omg! why is C so much hard work" hat on...
thank you guys, I really appreciate it!
@Kevin sounds ominous... :p
3 MINUTES REMAIN [insert angry moon from Zelda here]
DSM
DSM
Now I have the theme from Ocarina of Time going through my head. Thanks for that.
You're off by one game
Picture instead the frantic clock town music
DSM
DSM
20:28
How can I be off by a game in terms of what it sparked in my head? I remember having a conversation with a student once and I was telling him that I liked the colourful gems more so than diamonds. He insisted that I was wrong. I replied, "Wait, what? How can I be wrong about what I like?"
Um... We'll have to continue this conversation tomorrow :-) until then
DSM
DSM
D'oh. Sorry to use up your three minutes. :^)
rhubarb!
Guys another thing happened in the trenches: i type python setup.py and i take this message in the cmd : Documentation production by Sphinx is not available: No module named sphinx.setup_command so i located this module ( code.google.com/p/sphinx/source/browse/trunk/sphinx/…) but my i cannot figure out if i need to put it inside the arelle file (the prgram i am trying to install/setup ) or not....any ideas?
so @Kevin any last words?
I mean do i need to put this module in ..Desktop\a where arelle is or as a standalone?
20:34
A computer glitch is causing problems at air ports.... interesting...
Oh, at the UK Border Force....
impacts doing checks apparently.... don't think they even bothered when they had the systems working anyway :p
Guys this is confusing i have downloaded the raw code(sphinx.googlecode.com/svn-history/r7/trunk/sphinx/…) as stored it with a py suffix and then i put that inside arelle on the Sphinx file but it is still telling me that : Documentation production by Sphinx is not available: No module named sphinx.setup_command what mistake have i made?
maybe if i put it on the arelle file only
i'll give that a go
DSM
DSM
I'm not in a good position to complain about other people doing insufficient testing of code.. too often there's only a short turnaround between the moment I finish something and the moment it has to go out. I really need to do something about that.
Well I am always getting confused and feel lost when i try to understand code
not always always but many times i tell you
Ohhh damm still it gives me pain that dinkbat module
@ExoticBirdsMerchant typically you don't just download the .py file and stick it in a directory, typically you have to actually install the package
20:45
That is one python file for a package
I would be very surprised if it worked on its own
well it says No module named sphinx.setup_command
so googled
What version of Python are you using?
and found that
2.7 version
Yes but that's one python file in the whole sphinx package!
@JonClements umm.. have you put on your hat?
20:46
maybe if i check for Sphinx documentation...
@Peter I've grabbed a bottle of scotch....? :p
i'll give that a go
I think you need to google and read some tutorials on installing packages and such.
Do you know if you have pip installed?
@JonClements ... if that will help..?
20:47
try to install it with pip then
pip install sphinx will do it
@PeterVaro Doubt it, but might ease the pain :p
hmmm yes i'll give that a go...and search also for sphinx documentation as a whole
That is the sphinx documentation
Sab
Sab
#size of matrix
width = 4
height = 4

def in_range(x,y):
    if x < 0 or x >= width: return False
    if y < 0 or y >= height: return False
    return True

#returns True if any element of the matrix is equal to its neighbor.
def any_neighbors_are_equal(matrix):
    for i in range(width):
        for j in range(height):
            value = matrix[j][i]
            if in_range(i+1,j) and matrix[j][i+1] == value: return True
            if in_range(i-1,j) and matrix[j][i-1] == value: return True
            if in_range(i,j+1) and matrix[j+1][i] == value: return True
So @Kevin posted this before and I'm not sure but it's not really working.
20:49
Wow Sphinx is a python documentation generator.....
YES ! i found it / hope it works hehe
Sab
Sab
I get this when I run <function any_neighbors_are_equal at 0x0000000002CA1378>
How did you run it?
Sab
Sab
Using IDE
did you do print(any_neighbors_are_equal)?
Sab
Sab
Yup
20:50
@JonClements I probably do something very basic wrong, but I just can't figure it out, I thought I tried everything but nope.. and the funny thing it is still very nondeterministic: it is a true mystery when and why ID jumps (like in the example output I posted where between 128 and 256 there is only one number..)
You haven't given it any arguments @Sab
You've literally just printed the function object.
@Peter okay... let's delve into this...
Sab
Sab
@Ffisegydd Actually I didn't use print
I used print just above it for some test and I confused myself lol
cabbagë́
oho
Wow holly molly error: no commands supplied I AM GOING TO CRACK THIS ERROR
Sab
Sab
20:51
I was literally doing any_neighbors_are_equal(matrix)
And you gave it matrix as an argument?
In fact, let's forget about pulling teeth, what did you do?
Sab
Sab
matrix = [[1,2,3,4],[3,2,4,5],[1,32,4,5],[3,2,4,2]]
if __name__ == __main__:
     print(any_numbers_are_equal(matrix))
You're missing a bracket
Sab
Sab
That works basically. I actually forgot the print()
I did it yeeeeeeeeeeeeeeeeeeeeeeeeaaaaaaaaaaaaahhhhhhhhhhhhhh!!!1
20:56
horatiocaine.mp3.png
Also you need __main__ in a string
@Peter I can't remember the precedence of *, but sizeof(void*)*resources->instances_len) even if it doesn't make a difference, is probably better written as sizeof(void*) * (resources->instances_len))
Sab
Sab
Yup I literally type the code in the box here lol
Guys? Just a question of curiosity purely what is the difference between python setup.py which was WRONG and python setup.py install which was right? I read the solution in this post in SO (stackoverflow.com/questions/12324601/…)
@JonClements to make it easier to read? okay, I see what the difference is
20:58
python setup.py runs the setup.py file. python setup.py install runs the setup.py file with the install option
That's as simple as it is
Ohhhh @Ffisegydd thanks!!!
@petervaro makes it more clear you don't indeed *resources->instances_len and depending on precedence it might be fine, or an error... as (*resources)->instancs_len isn't what you want

« first day (1292 days earlier)      last day (3880 days later) »