« first day (1847 days earlier)      last day (3326 days later) » 

00:00
Hey guys, what's up?
cabbage, @AaronHall
hey Aaron...and Adam too! :P
Hey, pizza!
I mean literally!
So I realized my code was borked, so I stayed up late and fixed it.
I was going to publish my talk, and I just realized that it's been up since October 16th, so someone at PyGotham went ahead and released it... youtube.com/watch?v=iGfggZqXmB0
00:16
@Air got my go code working. Ended up just converting to string. It didn't make much sense to compare bytes once I got to thinking about it
user559633
@TigerhawkT3 The right answer is to say "sorry, this is beyond my comfort level for giving free work to a company"
user559633
It won't stop otherwise, trust me
I have the same problem occasionally. My family's business is a performing arts academy (Dance, Theater, Music) where my daughter takes classes after school. Tuition is comped for her because she's family
user559633
If they're taking you out for drinks and they say "hey, we ran into (script name) and we're curious how X works, do you remember writing it," that's one thing, but we're not talking about that
00:26
but they expect me to be their on-call I.T. guy at any given point. "Oh Adam we need you to stop by after work and get this running." Which is all well and good if it's a couple times a month
but if I've already worked 10+ hours for the company that pays the bills and they're expecting me to come work 3+ more hours and it "Has to be done today and I don't have time to muck with it"
sorry.
family is family
user559633
might be time to start paying for your daughter to go somewhere, but then again, family business is a hard setup
It feels different to me. We've all had That Talk. I do any work that needs done for my family's home, but when it comes to the business, I expect to be paid
user559633
back later, if you fine people aren't around, have a good night
good night
00:28
it's different now that my kiddo's taking classes for free, though :P
so I try to make it equitable, but if dance lessons are $60/mo and my contracting rate is $120/hr...
I don't want to go in and say "Well half an hour of my time is worth a month of yours."
lol
Don't think of it as work. Think of it as loving them.
I wish I could spend time with my family. I have no family in NYC.
I put up a codereview question asking if there's a better way to do the comparison. I'm happy with my implementation, but part of learning a language is learning how to do things in other ways
+1 for you
00:50
@Air The penny has just dropped. In order to avoid making @davidism sclerotic, those of us prepared to help other groups should hang out there too [heads for other rooms ...]
@AdamSmith I'm glad we don't have to write "if err != nil" in Python. Doesn't "if err" work in Go, then. [Note for @davidism: I argue that comparative linguistics is an acceptable topic]
Wow Python 3.5 seems seriously interesting.
I mean the types.
Python never really got my interested but with types, it suddenly seems like a realy interesting language.
Yeah, @infix has actually been implemented for a while, but now it's in a release it gives packages like numpy something to use, and can be used for all sorts of other interesting (and non-standard) things.
But all it really represents is the hooking in of another binary operator - they all work pretty much like that
So Python 2.7 will be seriously interesting too, though I personally hope they don't backport the infix @ - that would definitely be a backport too far for me
I doubt they'd risk injecting such a serious syntactic change in a legacy language, though
I don't understand why people keep using python 2...
Zope/Plone
sorry.
There are valuable libraries that haven't been ported to py3 yet.
01:04
it is like 7 years now ?
2.7 won't EOL for another 5 years, was due in a month or so but got extended.
is it so hard to convert those valuable libraries to python3 ?
@ChrisMcDonald
you would be surprised at the amount of technical debt in those systems that has been around since Python 1
don't get me wrong, the writing is on the wall and those people know it, but it actually takes time to port everything over.
When python 2.5 came out and introduced contextmanagers, quite a lot of stuff in 2.4 broke because those libraries used with as a variable name.
I guess it is a problem with popular languages, too many people have been using the old versions, and don't like changes
Porting code from Python 2 to Python 3 doesn't result in any new bullet points for the application's feature list.
it's not a matter of popularity
it's a matter of cost/benefit - if it ain't broke, don't fix it is an adage for a reason.
You mean, they shouldn't have released python3 ? @metatoaster
01:11
basically: are you paying (time, code, money) for maintaining those libraries?
who knows, the original developer could have been dead and dead people can't exactly write code
haha, well, at this moment, I'm not yet even using those libraries
basically, if the library is written for version 2, you want to use the latest shinies, either fix that for them or write your own
or still use their libraries but take into account for migrating to python 3, as I am stuck doing
I have done one Rush Hour solver in python 3 and only used my own libraries. A bit new to Python land.
yeah, new things always on Python 3, but since Python 2 hasn't been EOL yet, to maximize user base it's good to remember to support that, too.
I thought python to suck a bit to be honest, but I was forced by university.. I don't like dynamic languages. Because I'm too dumb/chaotic/forgetfull for dynamic things. I need code code completion, smart IDE. But I was pleasently suprised by the type annotations of Python 3.5
01:16
Python still has strong typing, unlike PHP
in combination with PyCharm. It has the IDE smartness that comes closer to Java. And the sweetness of well, Python.
you can still keep your variables of the same type, just need discipline
what do you mean with that ?
like, if you assigned an int to count, don't turn that into a str later.
ah yeah, I see
I have done much projects in Dart in the past. They recently introduced strong mode. Where you can not do this

var a = 3
a = "3"

anymore
but I guess python devs are tired of breaking changes ;)
01:28
well, that's not so much strong typing but more static typing, which python doesn't do
129
Q: Static/Dynamic vs Strong/Weak

Dan RevellI see these terms bandied around all over the place in programming and I have a vague notion of what they mean. A search shows me that such things have been asked all over stack overflow in fact. As far as I'm aware Static/Dynamic typing in languages is subtly different to Strong/Weak typing but ...

Have a read of that.
well they call that strong mode in dart, I didn't invent that name :P
or for a humorous (and troll) take on that: destroyallsoftware.com/talks/useing-youre-types-good
"Static/Dynamic typing is about when type information is aquired (Either at compiletime or at runtime)"

But what is Dart then? In Dart there are no types at runtime. Not at compile time. Only when you are editing the code, and want to prevent bugs.
apparently feeble typing according to this: blogs.perl.org/users/rafael_garcia-suarez/2011/10/…
Probably a third category Optional Typing
that article is shit, written before even dart 1.0 was released
The type system of Dart is the best you can have.
Python has now something very closely and inspired by what Dart has btw.
> In addition to Python and Alore, the design of mypy has been influenced by Java, C#, Typed Racket, Boo, Dart and the work of Jeremy G. Siek and Walid Taha on gradual typing.
01:47
cbg
cabbage
cbg!
chill black guy
01:49
@holdenweb Sometimes I prefer it to throwing exceptions around. It's definitely not concise though!
The type hinting in Python is largely useless. Also, anecdotally, I can't think of a real problem I've encountered in Python that would have been made easier with types.
@davidism Mostly because there's no standard way to use it (unless I missed that in Python3.5?)
That was the big argument against function annotations as well. The PEP that implemented them didn't say "This is what you should do with them" so they're the red-headed stepchild
Yeah, exactly, it requires everything to conform to it and provide relevant type classes before it will work.
Which will never happen.
@idjaw haha, interpreted that wrongly :p
@davidism are you serious here ?????
01:54
yes, are all those question marks serious?
from which planet do you come? probably editing your stuff in notepad++ or something lol
It's not that they're not useful in your own code, but you'll never convince other people to adopt it without pressure from the BDFL who won't authorize such a sweeping change
honestly, if you want a strongly static-typed language, try Haskell
And it also requires that everyone use it correctly and witht the same type hints.
01:56
yeah
yeah, the staticly typed languages that also figure it out for you are the way to go
or else someone build an incredibly complex (or incredibly fragile!) library that gains widespread adoption that can pull the same information from "This is a string" as str
@davidism part of why I'm enjoying golang
some_var := 1.23 works
so does another_var := "My Name!"
I think if I start looking at another language, rust seems like a cool system. I like its approach to memory management.
to be fair, strongly typed languages will reduce problems, like you can have an HTML type, a SQLSTMT type, and you can't mix the two together without some explicit conversion
this can eliminate a whole class of injection problems
I don't know, I just am working in a python 3 project with 3 other people now

it just makes it easier that I know quickly can see with types they the functions they write accept, and what it returns, and that my editor warns me if I don't something wrong
01:58
isn't that what docstrings are for?
this is where documentation and unittests comes in
anything that makes docstrings easier to screw up is a net loss for Python as a whole.
Yeah, like I said I've never encountered a real problem with duck typing.
also use a version control system so you can blame people on problems
well, because you are a disciplined Python programmer with a lot of experience
I have a lot of respect for Duck typing
01:59
@davidism with dynamic typing I need to run my code constantly, to see if I not screw up
with static types I can write for an hour, and everything still works
I mean -- it's tough with those webbed feet.
@MichaelvanGerwen sounds like an XY problem -- have you tried Unit Testing? :)
@MichaelvanGerwen huh, never had to do that
same thing in Haskell - with their strong/static typing system, rather than "running" the code you "compile" the code to see if you had any type violation
I mean, what sort of functions are you writing that a) aren't pretty obvious about how they're used and b) rely on types rather than interfaces and c) you can't read the documentation on them in case they're not obvious?
it just shifts the problem to a different space
02:02
@metatoaster same with Golang. $ go build; can't use operator == with arguments []byte and [16]byte (or whatever the wording is)
I mean, a strong/static type system merely does the reasoning for you, dynamic typed (strong or weak version) systems gives you more "flexibility" but requires you to deal with any of those issues.
I feel like static typing often causes more programmer problems than it solves, but as a result the compiled code can run MUCH faster.
@davidism well that is something with python maybe as well
python dev write their functions often so that it only excepts strings, integers etc.
if you come from a static typed language, you will come with other solutions
to be fair, strong-static typing does solve a whole bunch of problems by forcing the programmer to deal with them up front.
@MichaelvanGerwen actually, a lot of functions accept other functions and return new functions.
huh, no, we don't do type checking generally, that's pretty much exactly what shouldn't be done
02:05
@MichaelvanGerwen shrug Python lets quacks come from ducks. Type checking should be avoided when possible.
we just make sure the input quacks like a duck
some people have a lot of problem with this, and those people move onto other languages
But this conversation seems to be going in circles
since we're conversing with someone who apparently doesn't know Python very well :)
rhubarb for a bit
rbrb
I mean, in python, if you want to have a function that needs as input a file, you may say that the parameter is "path" a string.
In Dart, you would have as parameter a file, with type File
02:07
yeah, it seems like you don't have a good grasp of python but are trying to make a point about types rather than figure it out
It's all about interface design. Deciding to pass a path rather than a file is fine, if that's how you want your library to work. That doesn't seem like a valid argument about types.
@MichaelvanGerwen in Python I'd probably avoid this whole scenario, but if I didn't for some foolhardy reason: I'd try to read from the argument f, and if f.read() (or whatever) threw an AttributeError, I'd assume f was a string instead. Rename the variable to f_path, and do f = open(f_path).
I just avoid the problem by forcing the user to pass in an object that provides read().
where read() accepts an size that is an int to return a str/bytes up to length size.
... which is how a lot of libraries do it, like lxml.
I still don't see how this is a valid argument about types, but ok. You're making the exact opposite choice, passing a file, but that decision is interface design, not an argument about types.
but as I said before, some people consider this to be a terrible design and they move onto other languages because that effort is better spent learning rather than trying to change something that will never be accepted.
Python took on this design decision and it's best you don't try to waste your time to convince the rest of us that we are wrong, because some of us know we are wrong, while others just don't care because that's what this language offers as a feature
I'm not trying to convince you you're wrong, I'm saying you're not even making the right argument.
EOF, rbrb
02:13
@davidism I am actually talking to @MichaelvanGerwen, I am not really making those arguments that I stated
This is just preference. I like it that MY python code has code completion. That MY python code gives me warnings if I do something that is not possible. I don't care how how you guys write it.
actually, it is possible, but not possible if you use other libraries that embraces ducktyping
OK, but then what discussion are you having? It looks like you just came in to complain that Python wasn't Dart.
No, I was saying that I LOVE python 3.5, because it is more like Dart
Huh, ok.
02:15
> I thought python to suck a bit to be honest, but I was forced by university.. I don't like dynamic languages. Because I'm too dumb/chaotic/forgetfull for dynamic things. I need code code completion, smart IDE. But I was pleasently suprised by the type annotations of Python 3.5
Yeah, I guess if you need types it's a step in that direction. I think what we're trying to say is that when you "get" Python, it starts to matter less.
well, annotations have been around since Python 3.0, just that they only formalized what the things mean in Python 3.5
Yeah, PyCharm's been able to take advantage of annotations since they came out, and it was already using the type information from the docstrings.
That's not type annotations, that's magic methods. You're arguing in favor of duck typing now
02:18
implement __add__ for Position and that goes away :p
also I can't deal with IDEs like that because all these popups
but that's just me.
I disable most of the checks. I like it mostly for the auto import and completion.
pos1 = car.start and start is defined as type Position
flaggy
I like my vim modes
without this type annotation, my IDE wouldn't know that start is of type Position
02:20
sure it would
hello guys
and that I forget to implement the + operator
cabbage @developer
hey @developer
because you'll have at least one other method that uses self.start, which will probably call a method or access an attribute of it
PyCharm's really good at figuring this stuff out. Like I said, it's all about interfaces and how you use the data, not the actual type.
02:22
you say that PyCharm can figure out that Car.start is of type Position, and that I forget to implement the + operator for that type? Without me saying Car.start is a Position?

That sounds like something that can go wrong if you ask me
Nope, never had a problem.
but otherwise, I would still want the other devs on this project to know that I meant the start property of Car to be of type Position
You can "teach" Pycharm what the types are as well. If you write unit tests (which you should even if you're using types), and run the tests in debug mode, it can collect type information about all code that was executed.
I have a question. I have a file structure like this:
country_files [D]
- VAT_adm [D]
- VAT_adm0.cpg
- VAT_adm1.shp
- UZB_admin [D]
- UZB_adm0.cpg
- UZB_adm1.cpg
and so on...

I am trying to get the similar files and construct zip file out of them. For example: VAT_adm0.cpg and UZB_adm0.cpg
can be in one zip file.
So, since when is a question about using pip to install pygame not programming related?
02:25
I succeeded to do this.
But my implementation is rather naive.
I am doing loop and come up with this logic:
if 'adm0' in shp_file:
shape_file.create_organized_zip_file('AUT_adm0.zip', file_path)
@davidism Explicit is better than implicit.
@MattDMo wow, what a weird user
that's funny
check out his latest comment, it's even weirder.
Yo guys
any inputs?
02:42
@developer why not use glob?
do you know what the files are beforehand, or is that dynamic too?
(i.e. can you save ['adm', 'adm0', 'adm1', ...] as a constant)
That guy's comments are gold.
and now that question is +3 for this attention.
I want to use regex to get the similar files. I want program to be dynamic.
Get the similar files and zip them
determine similarity from the name.
so split on the _, split the extension off, and make a set of all the things in there
then do shape_file.create_organized_zip_file(*glob.glob("*_" + endpoint + ".*"))
My former coworker is surprised that I'd rather use TeamViewer than get a free lunch, possibly not realizing that I would spend more in gas money than I would on my usual lunch... plus I would have to do work. People are silly sometimes. :)
02:55
and you might not be able to bill for the travel time
I wouldn't be able to bill for any of it. The guy just wants me to come help him out as a favor, and he'd repay me with lunch.... My usual lunch costs approximately $1.
haha, yeah, in that case.
 
3 hours later…
06:08
So much free gin
@Ffisegydd at 6am? :p
cabbage
heya pups and Jerry :)
06:32
Cabbage Nuppy
and a ninja warrior too..
cbg
grumble grumble 6:30am - grumble grumble...
Almost bedtime, then?
12:03 pm here..
almost lunch time..
I am very hungry
06:35
@thefourtheye I'm fairly peckish - might just have some toast and marmalade - want some pups?
@JonClements I need a lot of rice and chicken curry now puppy :(
Umm... maybe at my lunch time? Bit hefty for nuppy for brekkie :p
lol, yeah... I forgot that its your morning :D
07:14
It's not a good practice to make an edit that invalidate an existing answer. — user3100115 3 mins ago
really???
for the record my edits did not invalidate the answer at all. I added more detail.
On phone so can't check it out properly but I believe in you
ah, they said because I provided a solution also using csv in my edit it invalidated their answer that they posted about csv...that's just silly..I'm not going to pursue further with the individual.
07:39
Thanks @Jerry
np
I just had more fun analyzing a game's combat log with Python than I did with the game's combat.
Not quite sure that'd be considered a positive review the game as such :p
To be fair, I was analyzing the log because I got squashed like a bug and needed to see why.
The game's "what just killed me" log said "No significant damage recorded."
Sounds like you got hit by Avada Kedavra then
07:55
No, that's a different enemy in the game - hits you for 200% of your max health, with non-resistable damage, over and over again until you run out of immunity effects.
This particular one was just photon torpedoes straight to the hull.
But yeah, I got to copy the log into a file, use Notepad++ to strip out the damage I dealt and clean the double newlines, write some regexes, do some file I/O, and play with sorted() and lambdas.
Fun!
It's one way of making a game out of a game...
Inferior graphics, but much more thought-provoking.
08:34
cbg
wow a palindrome score
good job :)
your next palindrome score would be 62926
Sounds like a challenge
cel
cel
08:55
def test():
    x = 0
    y = (1,2,3,4)
   yield x,*y
This does not work. Is there a quick workaround to make this work?
grrr what?
cel
cel
sorry, I messed up the formatting
What is it supposed to do?
What's the error?
cel
cel
invalid syntax
08:58
Well yes... what are you trying to do - yield a 5-tuple?
cel
cel
yep
yield (x,) + y then
It should work in Python 3.5
Maybe...
cel
cel
mom, have to fiddle with my ipython :(
@cel that does not work because of the ambiguity
I guess
yield is also an expression
@cel nope, a, *b does not work
because yield is not naturally in a tuple context
need to be yield (a, *b)
in 3.5
cel
cel
09:14
okay, thanks all
little bit unintuitive, though :)
not really
though a = b, *c works in assignment
I'd rather consider the unparenthesized tuples to be the unintuitive corner case ;)
cel
cel
oh, I somehow assumed that it works with return
but it does not seem like it
works, but not with star
anw, also things that I do not like is that you do (a, *b) = c, then b will be a list
why not a tuple :D
cel
cel
hmh
it could be a list with [a, *b] = c
also, why did they take out the argument unpacking in Python 3 ;)
could have had it and add method/function overloading ;)
09:24
cBg
10:07
Cabbage!
10:23
cbg
10:36
@idjaw At first I thought he was complaining about you editing the question to invalidate others' answers, which (of course) is evil. But he's complaining about you editing your own answer! What the yam?!
Of course, if you were copying bits of his answer to add to yours without giving attribution then that would be bad. But it's not unusual for two or more answers that are being worked on simultaneously to offer similar solutions, and it can be hard to prove / disprove plagiarism in such cases, even when identical variable names are used.
Two questions: 1. How did someone answer this question 12 minutes after I closed it, while it was closed? 2. Does it really need to be reopened?
Sorry, 17 minutes. I cannot math tonight.
10:52
FizzyGirl has been offered a job at FizzyCorp.
@TigerhawkT3 the server allows a bit of a grace period (can't remember how long) for a post that's created but not yet submitted to be submitted - sometimes if the front-end checks fail, it still gets through... happens rarely... there's a meta post on it somewhere :p
Interesting.
11:07
@JonClements You around?
Yes
@TigerhawkT3 ooo - congrats!
I was referring to Fizzy's message...
Oh errr... n/m then
Can you undelete the comment on this question that was auto-deleted when I closed the question?
Errr. how did that get auto-deleted?
11:14
It had a link to the duplicate inside, so when I used that duplicate, the system took it as just a “It’s a duplicate to X” message and deleted it. But the duplicate link was only a short part of it.
Ahhh... yeah... it being deleted loses some info... it's back
Thanks :)
Okay... it's getting to the point now that everytime I see "scrapper" instead of "scaper" I actually physically groan
how sweet and useful this project is:
226
A: Is there a command line utility for rendering github flavored markdown?

JoeA little late to the game, but I wrote a small CLI in Python a few weeks ago and just added GFM support. It's called Grip (Github Readme Instant Preview). Install it with: $ pip install grip And to use it, simply: $ grip Then visit localhost:5000 to view the readme.md file at that location...

11:30
Nice.
Hi,
Any ideas regarding this line?

"n = int(log(abs(x2 - x1)/tol)/log(2.0))"

Float object is not callable
have you named a variable log or abs or int ?
okay - what does type(int), type(log), type(abs) show ?
ahh... hello fellow Jon :p
type(int) = <type ...>
type(log) = not defined
type(abs) = type built in function
11:38
@JonClements two Jons one suggestion
@Jacobadtr ...and in the scope where you get the error you're asking about? Where are you getting log from - from math import log?
If log was undefined then you'd get a NameError, not a TypeError - can you check the types on the line before the one raising the error?
I can try
Well there's little point checking them anywhere else!
Python is dynamically typed, and none of them are keywords, so any could have been shadowed by something else at runtime
I had the code imported as a module when I tried previously
11:43
You could also try splitting the calculation into multiple lines to narrow it down
that's a good idea
I get the same error when breaking down the calculation, when the first line is

"n = (x2 - x1)"
I don't see how you could get TypeError: 'float' object is not callable from that line
(note use of backticks ` for code formatting)
The error seems to be linked to line 17... I added a few lines of code and the error is still directed at line 17, which is now entirely different content
http://codebin.org/view/0859cb9e

I pasted it into codebin if anyone would be kind enough to take a look
Please provide a stackoverflow.com/help/mcve - consider asking an actual question
11:58
What is f.f supposed to be doing? :)
That was an experiment... The problem persists without that
Umm... you're not exactly helping anyone help you here
Again, we want an MCVE that highlights your specific issue with minimal cruft, not unrelated experiments
I am trying to do that now
what is f supposed to be when used in bisection - it looks like you expect to be the function f defined above, but it's also your parameter name... so depending what you're passing to bisection then it won't be callable
12:03
f is supposed to be the function of x that I use the bisection method to find it's roots
Could you show an example of actually calling the function? Also, consider using pythontutor.com to step through and see what names refer to what and when.
cbg
Found this while browsing old python questions stackoverflow.com/a/33566373/4099593
Flag as NAA?
Cabbage! Cabbage for everyone!
I'm sure we have enough rep between us to delete it without flagging
cbg Nadav
Need 3k more of rep to get to 20k ... :/
12:13
@BhargavRao I meant the room in general!
Thanks @Jon 1
Potato folk? Everyone's bananas?
I do like "This is a controlled document and should not be publicly available" - hey OCR, heard of this new thing called the internet?
Need to start answering soon, spending lotta time on moderation. Gotta get 3k asap.
Anyway.... closed the Q as well
12:14
@jonrsharpe `from bisection import *
root = bisection(f,-5,5,switch=1,tol=1.0e-9)`
@Nadav what's with the name change?
Apparently I commented on it and edited it but didn't VTC? Maybe I was out for the day.
@jonrsharpe nope you did - it aged away on the 21st
@JonClements Dunno, decided to use my first name for a change.
Well that's a disappointing outcome
12:17
Give it enough time and my surname will follow.
@jonrsharpe curiously... it only managed to get 3 close votes that all aged away and it didn't get much exposure in the queue...
How is it that few flagged answers are deleted immediately and others take many days? Tis confusing :(
They only get deleted when nobody is looking at them
Err yes, cos there's a new experiment called Schrodingers Flags :)
Colloquially known as Refrigerator Light Flags.
12:30
Is there a flag on the post or not? Once you check it'll be deleted
morning cbg all
or afternoon, evening. Wherever you all are :)
Pub lunch \o/
@idjaw It's night in Funafuti :D
Schrödinger was well known for his work in quantum-vexillology
12:42
> Vexillology is the scientific study of flags
They found the correct name \o/
I've always found flags vexatious, myself
Afternoon all. This afternoon, I start disassembling malware as my foray into security continues...
Almost sounds like a real thing!
Any particular malware that has garnered your ire?
It almost is.
Nah, it's part of a course I help do the labs for. Here's some malware, unplug your internet connection, what is it trying to do?
@PM2Ring Yeah...that's what surprised me, was that I got a comment on my own edit. I was in the middle of editing my post when the individual posted their answer. FWIW I would have even posted my edit faster, but I wanted to test my code first. I even noticed my test file name is still in my edit.
It's kinda weird that he claimed your answer invalidated his answer, since there's nothing wrong with multiple answers that give overlapping information. But I guess it's better than claiming you were stealing his answer.
12:53
Yeah. Glad it did not escalate beyond that.
Nuitka drag to control feature. Too broad and also "gimme teh codes"
> This kind of project will require hours and hours of development time
and money too :P

« first day (1847 days earlier)      last day (3326 days later) »