« first day (2231 days earlier)      last day (2717 days later) » 

1:07 AM
cbg
How can this possibly work!?
 
1:18 AM
Phyiscs!
that's really all it is
 
Everything is physics at some level.
 
Except art
though it uses physics
But maybe it is physics. Or chemistry. Or both \o/
 
Not sure how much of the machine's complexity is necessary and how much is accidental or just for show.
 
1:34 AM
I don't think there's anything on there that is non-functional, if that's what you mean
none of it's necessary
but all of it is awesome
FWIW
 
Nowhere near as impressive, but this reminds me of a project that was done by a group of students in my same year of university
RoboKeith
 
yo, what was the site with python books?
 
@WayneWerner Necessary in the sense of necessary for it to be able to do its job.
 
@Aaron I think there was one article on sopython.com ..
 
2:17 AM
Angelfire, eh?
haha. When you actually download the videos you want to watch
 
keepin' it real with angelfire
 
@WayneWerner nice!
 
DSM
Guess who just decided to toss several hundred lines of ctypes to switch to JSON because life is short?
 
2:34 AM
Data Science Man
 
DSM
I should know better than to do premature optimisation. My first approach worked really well for the easy cases, but the data format this vendor uses is really twisty, and I can't bring myself to (basically) reimplement their weird logic in Python when if I just jsonify from within c++ I can reuse their internal processing code. And since this is just the proof-of-concept, I could replace it by a custom binary or msgpack approach if needed for the target version.
I want to punch former me in the face.
 
3:08 AM
alright...I'm giving Black Mirror a try
I'm watching the Netflix one
haven't seen anything before that
 
3:42 AM
morning everyone
 
morning vaultah
 
Flume is going to release the Skin Companion EP tomorrow
listening to it now
 
4:02 AM
oh awesome
 
yeah
4 tracks, 3 of which are my favorites from the Skin preview
 
Will have to add it to my playlist for my drive to work tomorrow 😀
 
4:21 AM
:)
 
so much anger
 
DSM
Seems to be confused about the difference between questions and comments as well.
 
frustrated OP is frustrated.
 
DSM
if number is place.getNumericValue(): print "Why is this not printing" makes me think it might just be an is vs. == problem..
I wonder if a video link would help newbies? "You seem to be having trouble. Please take five minutes to watch this video tutorial.."
@idjaw: why an error?
 
SO-clippy?
@DSM that's why I deleted it. I realized I was wrong 😀
 
4:40 AM
Who is the computer geek's favourite porn star?
Sony Lenovo
Why did the Python programmer use only python?
Because he thought "Code should work the way he indented it to be"
I made these two on my own
 
so that first episode of Black Mirror was quite fantastic
 
 
2 hours later…
6:28 AM
cabbage
 
6:52 AM
cbg @BhargavRao
 
cbg @Ilja
 
7:30 AM
Hi @davidism Are you here ?
@davidism Is flask-channel project still work in progress ?
I want to contribute
 
 
1 hour later…
8:52 AM
Good grief, Shaw is not helping his case by harping on about Turing Completeness and conflating that with virtual machine implementations. His ignorance on the subject speaks volumes.
(Only reading Zed's words through Poke's rebuttal).
 
cabbage @Martijn \o
 
@BhargavRao cbg!
 
cbg, all. Tweeted this morning in response to friends that his article "showed incomplete understanding of fundamentals"
Then wondered if the real reason for it was to justify the lack of apparent progress on LP3THW
 
good grief, how did his LPTHW book ever get popular? His ignorance on type systems is shocking. That's a pretty fundamental flaw in his understanding.
@holdenweb I'm pretty sure it is. I'm sure sales of LPTHW are falling, as Python 3 is seeing adoption.
 
The blind leading the blind in a clear demonstration that if you shout irrationalities loud enough for long enough you can create a small but uncritically devoted following
@DSM That's how you know you are learning!
 
9:21 AM
cbg
 
hey
 
@BhargavRao congrats!!!
 
@AndyK cbg
@AndyK Thanks :)
@Pisti \o
 
hey @Pisti
I don't know much about the other chap, Deceze
 
wazzup guys? (and girls)
 
9:22 AM
but you were my first choice
then Aaron
 
So 2/3?
 
and then Cerbrus
Aaron, he said one thing, that conforted me he would be a good mod
He said at one point, that there were things he did not know
If you were truly arrogant, you would say nothing about the things you don't know
For Cerbrus, it was a close call between him and @vaultah
 
Mornin'
 
@IntrepidBrit Mornin
 
But Cerbrus, he came once out of nowhere to help me for things he was not even supposed to help ... and when you have that kind of care, that does say a lot about your character
\o @IntrepidBrit
 
9:30 AM
Cerbrus is a good guy
 
He is
 
I remember having an arguemnt with cerbrus
 
The guy is not perfect
 
it was about administrative stuff
I don't remember exactly
 
He said that himself that he can be strongwilled and very direct
 
9:34 AM
other news, I stepped on a dog crap, now my car smells terrible
 
@BhargavRao you'll be definitely a good mod. Anyway, I ttyl , works to do, again -_-'
 
Cya, Thanks
 
@AnttiHaapala Uhm, no, we don't store binaries in the monorepo.
Source code all the way.
 
of the tools?
 
9:39 AM
Perhaps you misunderstood me? It stores the source of just about all our mobile apps.
 
ahh :D
 
I know of one exception, where a version of a tool used is in there but that's being moved out soon (they are switching to a different tool to do the same job, and that'll be handled properly).
 
we are actually storing wheels in repos in many projects. easiest to deploy and test, and can be certain of the version and its availability
 
We have separate storage for build artefacts. Keyed on tag, repository and revision. So give me artifact foo from repo bar, at revision abcdef1234567890fedcba
 
Hello everyone!
I'm a bit stuck on some numpy/pyplot business, anyone here good with that?
 
9:45 AM
You never need to know how the binary compressed data changed from version to version, you don't care who built that artefact (it's built by the CI tools in our case), you don't even care what came directly before or after.
 
@AlexMitan welcome to the py room, see our rules sopython.com/chatroom ... TL;DR, Don't ask if anyone knows the tool, Ask directly.
 
So why put that binary blob into a source control system, which is invariably inefficient at storing large binary blobs?
 
Hello everybody!
 
Gotcha. Okay, so I have this system, that takes an array of 2 elements and spits out a result. It can also take batches of 2 elements and spit out a result, and it's easy to make an array like this:
[ [x_coord_0, y_coord_0, z_coord_0]....[...]]
so basically a 2d array of valid 3D coords
I'm having a lot of trouble graphing them in contours or 3D
I managed to make that meshgrid with X and Y, it's just a range
 
I need some help. Does anyone know how to read specified cell in an excel (.xlsx) document in python?
 
9:47 AM
But I'm stuck as to how to map Z onto that mesh
 
@TheOneWhoLikesToKnow xlrd or use pandas.
 
@MartijnPieters ah :D so that's why I was confused
 
@Withnail Do i have to import them
 
@TheOneWhoLikesToKnow xlrd is for xls if I am not mistaken
ah no
it works for xlsx
@TheOneWhoLikesToKnow it is a 3rd-party module so you need to install it from pypi, say, pip install xlrd
 
Ah, congrats @BhargavRao first time the candidate I've voted for's won in about 6 years.
:D
 
9:50 AM
Ok
 
@Withnail You didn't vote for Martijn? ;)
Thanks :)
 
is there anything i can use which is self-contained in python?
 
@Withnail Usually when my candidate hasn't won in an election it's been because I've voted for myself.
@TheOneWhoLikesToKnow yes, you can rewrite all of the code of xlrd yourself.
 
How do I do that?
 
@TheOneWhoLikesToKnow should take only a couple months to years. Good Luck.
 
9:51 AM
I have 10 minutes
 
Then use xlrd.
 
exactly.
or if you just need to read one sheet, store it as CSV instead
and read it using the csv module...
 
@TheOneWhoLikesToKnow are you on interview now?
 
lol
 
but it doesn't understand different datatypes, so you need to convert them by hand... and so, all in all just faster to install xlrd.
 
9:53 AM
@marxin no
 
@TheOneWhoLikesToKnow or in an exam...
 
@AnttiHaapala I'll try that
@AnttiHaapala kind of
 
In Martijn's interview (pinned on the wall), he tells about a question on stack overflow where there is a photo of an exam paper and "quick, I need an answer in 10 minutes".
@TheOneWhoLikesToKnow if it doesn't work, I will be happy to help tomorrow ;)
 
I will probably be next online on tuesday
 
9:55 AM
:D
 
about 13:00-15:00
 
@TheOneWhoLikesToKnow lol
 
@AnttiHaapala I look goood
 
@MartijnPieters Just listening to your Talk Python interview, good job. :)
 
What is this interview that everyone is talking about
 
10:03 AM
@TheOneWhoLikesToKnow see the star board on the starboard side..
It's the one with 6 stars, top of the list ;-)
 
@MartijnPieters ok
 
so much sticky stars worth of stuff last 2 days
 
In numpy, how do I quickly make a 2D array from a function by elements of other arrays?
as in, I have two 5x5 arrays with all sorts of values, and I need to make another array where each element is f(elem0, elem1)
without two for-loops, which are a bit ugly
 
@AlexMitan first google result for elementwise function numpy
7
Q: Array elementwise operations

user1764386I have two input arrays x and y of the same shape. I need to run each of their elements with matching indices through a function, then store the result at those indices in a third array z. What is the most pythonic way to accomplish this? Right now I have four four loops - I'm sure there is an...

 
10:16 AM
@AlexMitan or define your function so that it accepts numpy arrays readily... thus working elementwise.
 
It kind of does already, that's why I got a bit confused, but I appreciate it very much
 
if you do def func(a, b): return a + b - then that is naturally an elementwise function
 
I thought elementwise was just for basic operations
 
you need that approach only for some sh*t that you cannot express in terms of numpy operations
 
Lets assume that the user inputs a string.
How do i get python to search for that string inside a csv file
 
10:20 AM
google search string inside a csv file python
 
in python?
 
if this is an interview, then I'd fail you double time and put a ban for hiring you :D
 
its not an interview
 
you have a problem, you go to the google first: "search string inside a csv file python" open the first link
I don't know what it is
but ask google first.
 
i tried that already
didnt understand anything
 
10:22 AM
while knowledge < complete:
    try:
         NewThing()
    except KnowledgeFail:
        stackoverflow.open()
But really all we're going to do is point you at SO questions that answer this. It's a very well defined question with lots of answers.
I can see 6 answers on the first page of SO results. If you don't understand them, then i'd suggest maybe going through a tutorial may be more the sort of thing you're looking for - not to be rude, but as a matter of practicality; it's a very standard syntax and use case in python, so if you're not familiar with that, tutorial resources might be more the thing you need.
 
@TheOneWhoLikesToKnow have you tried the python tutorial.
they all assume that you have basic skills yes.
 
@AnttiHaapala not sure
@AnttiHaapala I learnt python in school
 
Gah my indentation is off on that try/except loop. That's going to bug me.
 
@Withnail want me to trash it?
 
10:27 AM
Nah, it's a minor irritation.
 
@khajvah my head
@khajvah I have absolutely no idea what the OP is trying to achieve with distinct
 
@AnttiHaapala neither do I. Maybe a unique output?
but why does it work like he expects with a loop?
welp, this is misleading
@AnttiHaapala how would sqlalchemy deal with this?
 
@khajvah no, the question is how is it sensible at all
 
@AnttiHaapala yeah I guess it isn't
now that I thought abou tit
 
@khajvah distinct on column is an extension to SQL and select
but it is rather stupid usually, and especially in this case because they expect it to do something sensible in a simple query like that
 
10:43 AM
plus, why would you update such a result
I can't think of a usecase
but still, it is weird, when you have a set of results and when you apply a method, it effects some other set
> I am writing code to get rows from a sql table in either csv or excel format programmatically which is then to be parsed using a Python code.
 
@khajvah because there is no way to apply distinct to an update
 
@Withnail there, fixed
 
\o/
 
because while it makes 0.0001 % sense with selects,
 
@AnttiHaapala i understand
 
10:46 AM
it makes 0 % sense with updates.
sql doesn't support it, and I guess django doesn't care.
 
I thought Django could write a different query (without using distinct)
but I can't think of a way to generate such sql
maybe first get the results and then apply UPDATE with primary keys? But that's not consistent
 
Why are python callbacks sorted first to last?
 
11:05 AM
what callbacks?
 
@TheOneWhoLikesToKnow I hadn't realised you were a student at that level, I assumed it was a uni/job thing. Definitely have a look at the tutorial Antti linked, it'll help a lot. GCSE CompSci is very patchily taught in my experience.
 
@BartekBanachewicz your question sense make does not.
 
Is it okay to ask on SO for someone to squeeze my code or?
 
Cabbage!
 
Hello
 
11:17 AM
@BlueMonday What do you mean with “squeeze my code”?
 
Multiple lines, I want them as 1-2 comprehension
 
Just post it here instead of opening a question
 
path = path + [name1]
    if name1 == name2:
        return path
    if name1 not in network:
        return None
    shortest = None
    for chain in network[name1]:
        if chain not in path:
            newpath = find_path(network, chain, name2, path)
            if newpath:
                if not shortest or len(newpath) < len(shortest):
                    shortest = newpath
    return shortest
 
Hmm
path = path + [name1]
if name1 == name2:
    return path
if name1 not in network:
    return None
return min(find_path(network, chain, name2, path for chain in network[name1] if chain not in path)
Maybe?
 
Let me see
 
11:21 AM
Oh, should be min(…, key=len)
 
is that for code-golf type purposes?
 
Code-golf?
 
Trying to create shortest possible code for a task in competetive manner, or so
 
Yeah
 
since we're doing code-golf now, is it possible to shorten this
barcode=input('Enter the GTIN-8 code of the product you wish to purchase: ')
quantity=int(input('Enter the quantity you wish to purchase: '))
        if barcode=='24937597':
            price=quantity*20
            total=total+price
            receipt.append('24937597   '+'Basic Hatchet   '+str(quantity)+'    '+'20    '+str(price))
            numberofitems=numberofitems+1
        if barcode=='49673494':
            price=quantity*100
            total=total+price
            receipt.append('49673494   '+'Hardened Axe    '+str(quantity)+'    '+'100   '+str(price))
sorry for it being so long
 
11:31 AM
@TheOneWhoLikesToKnow use a dictionary of barcode to article data:
 
@AnttiHaapala how do i do that?
 
Dude seriously, go have a look at the python tutorial.
 
@Withnail yeah, ill go do that
 
you'd notice that your barcode is a key to a dictionary, where the corresponding value is the article data including name and item price.
 
Many of these questions will be answered, and hopefully you'll get a few AHHHHH I SEEE moments
And we can help if you get stuck on specific stuff.
 
11:34 AM
pycharm is so cool
I can connect its debugger to celery worker and debug workers
 
@khajvah compared with what
 
@AnttiHaapala would it work if im trying to add all of those variables to an array to print them out in line like a receipt?
 
@AnttiHaapala I am in the process of adopting emacs as my religion
but it takes time
 
@TheOneWhoLikesToKnow yes, but that's not the problem you're facing.
 
Yes
 
11:36 AM
@AnttiHaapala ok
 
you're doing it now already, you'd do it then, but to make it into a program and not a shopping list, you need to do as I said :D
 
@TheOneWhoLikesToKnow when it gets to output, that's just a matter of creating a string with the right data in it - a fairly simple matter once you have located the data
 
@holdenweb ok, i get it
 
anyway, you should read the tutorial at least until the end of chapter 8 preferably
 
@AnttiHaapala The aim of the program is to have the user input GTIN-8 codes and quantities of a product that he/she wishes to purchase. The code has to then be able to print out a receipt.
 
11:39 AM
products = {
    '24937597': { price: 20, label: 'Basic Hatchet' },
    '49673494': { price: 100, label: 'Hardened Axe' },
    '73165248': { price: 500, label: 'Steel Axe' },
    '26492186': { price: 2000, label: 'Utility Truck' },
    '54963726': { price: 600, label: 'Small Trailer' },
    '17667593': { price: 200, label: 'Shabby Sawmill' },
    '76249648': { price: 5000, label: 'SawMax 01' },
    '34865729': { price: 70, label: 'Basic Hammer' },
    '46827616': { price: 0.10, label: '50mm Nails' },
@TheOneWhoLikesToKnow ^ There.
 
@AnttiHaapala Should I send the full code?
 
@poke thanks, now they didn't read the tutorial
 
lol, i was just thinking that. "DON'T DO IT FOR THEM!!"
 
sorry, I started before you all started tutoring :o
 
@poke you should ask this on stack overflow
we can close all subsequent queries as a duplicate of that :D
 
11:41 AM
@poke It also needs to have quantities and total price per quantity selected. Those are saved as variables. Would it still work with the dictionary?
 
how much internets do I need to close vote?
 
@Antti Should I expand this into a full cash register system..? :D
 
@AnttiHaapala I actually did read the tutorial
 
I am starting to answer questions
 
goes away to get more coffee before i headdesk and break my keyboard
 
11:42 AM
@TheOneWhoLikesToKnow perhaps you should read instead of writing...
@TheOneWhoLikesToKnow there is a scroll bar in that code...
@poke missing global total
you didn't even try it now did you :D
 
@TheOneWhoLikesToKnow Not sure what you are referring to with that… My code does pretty much the same as your code did (except that I don’t add lines to the receipt for invalid items)
@AnttiHaapala total += price? :o
But no, I didn’t run that code.
I rarely run code I post on SO.........
 
it needs global total
 
I'll send the specification
 
@poke remember
@TheOneWhoLikesToKnow NEGATIVE.
 
@AnttiHaapala OH GOD
 
11:44 AM
we don't need your specification. it is your assignment
we're not the ones having problem with it, you are.
 
Your specification was “Make this code shorter/less repetitive”. That’s what I did.
 
sorry, i should have said clearer
i have an example of what the 'receipt' is meant to look like
 
yes, so you will do that.
good.
your assignment is to find out yourself how to do that.
 
i already finished it
 
@Antti I also forgot to put the dictionary keys inside quotes.
 
11:46 AM
im just finding out ways of making it shorter
 
@poke too much js, slap.
 
Sorry. I’m too spoilt :<
 
@TheOneWhoLikesToKnow poke just did
above
less the syntax errors
fix it and it will work.
 
The syntax errors are deliberate to make you think about the solution before you use it to submit your assignment!
 
or even better, append to the receipt unformatted records, and then format them elsewhere
 
11:47 AM
(*wishful thinking*)
 
34512340   plain brackets          4    0.50   2.00
98981236   product not found
56756777   100 mm bolts         32  0.20   6.40
90673412   L-shaped brackets   6    1.20   7.20
Total cost of order 15.60
 
@Antti My original solution was just registering barcodes and quantities, but that was moving away from the source too much.
 
that was the example
but more in line
 
cbg
I just read that this is greeting.........
 
Enter the GTIN-8 code of the product you wish to purchase: 73165248
Enter the quantity you wish to purchase: 2
Enter the GTIN-8 code of the product you wish to purchase: 17667593
Enter the quantity you wish to purchase: 3
Enter the GTIN-8 code of the product you wish to purchase: 46827616
Enter the quantity you wish to purchase: 5
Enter the GTIN-8 code of the product you wish to purchase: 17667593
Enter the quantity you wish to purchase: 1
Enter the GTIN-8 code of the product you wish to purchase: 49673494
^ Output from my code (with added loop + print)
@BlueMonday It is! Cabbage to you!
 
11:51 AM
Potato?@poke
 
I’m banana, Melon. Potato?
 
no one remembers those
we just use cbg and rbrb
 
(pshht!)
 
yeah sorry now I revealed the other part of the shibboleth :D
 
:D
I am banana as well :D
 
DSM
11:54 AM
I remember "pineapple" because people around here often achieve goals worthy of congratulation.
(Woke up before alarm cabbage for all!)
 
@AnttiHaapala you can just check what they mean
 
Laurel :D
cbg @DSM
 
@TheOneWhoLikesToKnow I can, but the point is that we can recognize newcomers who didn't read room rules by "what's cbg?" and the newcomers who did read the room rules by that they throw some salad language that is not in general use :D
 
@AnttiHaapala ok
@AnttiHaapala i understand
 
so we don't need to even know who didn't read room rules. A person who asks "what's a cbg" didn't.
 
11:57 AM
The other day, I saw some people using cbg,rhubarb..So I googled that, got some salad..hindi language? I was like what the... And yesterday I decided to read the stuff sopython.com , then I realized haha
 
salad language rather fits this room because a) it is rather silly, and b) this is the (Monty) Python room.
 
Can I send a funny picture here?
 
yes. if it is not vulgar
 
Does it have a rabbit, a cat, a puppy or another cute animal?
 

« first day (2231 days earlier)      last day (2717 days later) »