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
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
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"
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
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
@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]
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 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
I 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 ...
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.
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
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
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
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
@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
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?
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.
@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
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
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 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
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.
> 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.
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
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.
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. :)
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.
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.
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.
@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.
@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
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.
A 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...
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
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
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.
@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.