Decided to play a little dangerous with not deprecating some things. I'd rather just get 1.0 out in the correct form rather than worry about jumping through too many crazy hoops each step of the way.
Any opinions on CSRFProtect vs CsrfProtect (and CSRFError)? I know the former is PEP8, but it's been the other way forever. I did rename and deprecate Form to FlaskForm, so it wouldn't be the only thing being renamed.
I think you first need to learn the basics or you make a good question on stackoverflow. "How to read data from json and store the data in sqlite DB?" is not a good question. I gave you the answer to that question, but the question tends to result in much more questions. Tbh those questions (like "How to create a table") is an easy google type-in.
@WiktorStribiżew That question gives far enough ideas on how to approach this specific subproblem. In fact, OP already suggested one solution themselves that works fine in this case (making a possible answer to this question: “Don’t use regexes, that’s just slower”). – In general, it’s fine to expect people to use related questions to solve their specific problem instead of having separate questions and answers for every single special case. — poke19 secs ago
So the following happened:
A question was closed as a duplicate of question X
Someone disagreed and reopened the question, adding a comment explaining why themselves. In that comment, they linked to the duplicate target X.
I disagreed with the arguments and re-closed the question as a duplicate...
@MartijnPieters I don't think it's serious, I just wanted you to know in case you wanted to react:) I've seen you respond to mild criticisms, so I thought there's nothing to lose.
Hi, @JRichardSnape I think you'll enjoy this poignant violin work by Èlia Bastida from the Sant Andreu school, backed up by tasty clarinet & sax playing from some other Sant Andreu kids, with vocals by trombone player Rita Payés. Although it was composed by Jobim it's certainly not bossanova - it's more reminiscent of J. S. Bach, IMHO. Por toda a minha vida
@neet_jn You can easily replace a method of an instance, just like you can overwrite (or add) any other attribute. You could do it in the __init__ method, but you can also do it externally, if you like, after the new instance has been returned from the constructor.
@neet_jn You may also find this answer of interest.
question: if you have to argue a certain programming paradigm being "better" than another one in a certain use case, with someone who is staunchly against it, what's the best way to approach it?
And it depends on the person. Some people prefer theoretical arguments, others prefer actual example code so you've got something tangible to argue about and that can be bench-tested.
in general, if the person is more logical style thinking, pointing out the pros and cons and giving facts as example is a great way of winning them over
well, the basic idea is that you want to show something at the "root" level of the interface. One concept to accomplish this is called a "Portal", which is a node where you can inject that element. Another option is just putting the items at the top level and showing/hiding them
if they are a more money, time and just cares about the job done and not how it's done, then you might wanna bring money into it. play with their feelings. This will cost X because it will take Y long but this will be this and that, so I feel it's best we do this reducing the cost and time, These people don't care about how difficult it may be. - To exapnd on PM
Hmm it's harder than I thought to create animated gifs when I need to be able to query the color of any coordinate on the screen, including non-integer coordinates.
Normally I'd just, like, draw shape primitives, but the equivalent to that here would be to keep a list of polygons and do point-in-polygon testing on each queried coordinate to see which region it falls into. This is impractical at the resolution I'm trying to work on.
@MooingRawr I'm going to try that in a second but I suspect it's going to come out jaggy after I've applied various rotations and such
is memory a problem? If not, is there some kind of hashmap like structure you could use? Would be like an O(1). If not, there's k/d trees, not sure how useful it is for 2 dimensions
@Kevin I probably need to know more details to make useful suggestions, but you may be able to get away with simple bilinear interpolation to get colour values from your float co-ords. Are you doing the drawing in PIL?
Or just draw in a larger bitmap & then blur it a little & scale it down to produce the final image. That'll handle your jaggies & colour interpolation.
Not fun. I hope they get better soon. (I've suffered with sinus problems all my life, so I know how distressing it can be, especially when you're a little kid).
social issues in a world where artificial intelligence is common, conceptual aspects of AI, or human factors in AI development
...and it is not about...
the implementation of machine learning, or asking for a development tool or career path recommendation
oops
> Questions about machine learning implementation should be asked at Data Science, and questions about the mathematics of machine learning should be asked at Cross Validated.
Right, duh. I forgot I could just pass it to the subclass.
Thanks!
I had to write a subclass of a dictionary so that I could alter the value returned from the dict if you accessed a key multiple times. If I never have to parse another flat file in my life, I would be okay with that. This code makes me depressed.
We should switch jobs. I actually really enjoy writing parsing code.. I think it comes from trying to write text adventures in elementary school, when I didn't yet understand the idea of splitting tokens so my programs were of the IF ROOM = 3 AND CMD = "GET BOOK" variety.. once I learned there were smarter ways to do it I was so happy. :-)
@MorganThrapp Hi Morgan! Long time no see. I think using the old-style dict constructor with a gen exp that yields (key, value) tuples would be more efficient than passing a dict comp to your subclass's constructor.
Hey, PM! Yeah, I've been crazy busy at work. I'm the lead dev on our C# services now, so I've been spending much less time in Python. Oh, cool. I'll use that, thanks!
@MorganThrapp: does get not call the __getitem__ override naturally?
(I just wasted a few minutes trying to find a picture of Lucky Star's Konata shaking her fist in rage to express my jealousy of @idjaw's hat but failed. Still, time well spent. So I guess not a waste at all!)
Not happy with the fisheye effect here. I took some shortcuts with the viewing frustum and as a result it has to be axis-aligned and it distorts the bottom of the image too much.
The good news is that the frustum calculations are well-encapsulated so slotting in a better algorithm doesn't require changes anywhere else in the code. The bad news is that I can't remember how to do the math the right way.
I don't know. Probably some artifact of the limited precision of floating points trying to calculate the state of the plane as the distance approaches infinity
I thought about implementing some kind of fade-out effect so it gradually washes out to gray as you approach the horizon, but I'm not sure what kind of formula I should use.
@wim, finally I found you after the holiday, did you work out your mem solution to that AoC 2015 day 17 part 1 ? I got the answer after you left, but never saw u again
If anyone's using Flask-WTF (or just interested), could you take a look at github.com/lepture/flask-wtf/pull/271 to see if I'm about to do anything too silly?
@wim this solution works for my data input for part 1 but im not sure if it's complete since i didnt have more than one data access pastebin.com/DSNdRYKP
i didnt do part 2 since didnt felt like it and what not
@davidism Yeah all the frames use independent calculations. On top of that, 90% of the work of rendering one frame is independent per-pixel calculations.
If only Python had actual threading ;_;
"What about multiprocessing?", you say. I don't think I can put Pil(low) Image objects into a shared queue.
I could save them to disk and pass around filenames instead, but... My code's already messy enough.
from multiprocessing import Process
if __name__ == "__main__":
def f():
pass
p = Process(target=f)
p.start()
p.join()
#AttributeError: 'module' object has no attribute 'f'
AttributeError: 'module' object has no attribute 'f' in 2.7.11, AttributeError: Can't get attribute 'f' on <module '__mp_main__' from 'c:\\Users\\Kevin\\Desktop\\test.py'> in 3.5.1.