It's already difficult to find the correct version of VS2008 to use, never mind over the next 4(or maybe 6) years that Python 2.7 is going to be supported.
Trying to use a compiler that's 10-12 years old to support Python? Not gonna work.
Even if it wasn't prohibited, a 2.8 release to change the Windows compiler would mean a point release that doesn't change anything on Unix, which is unpleasant.
Admittedly this is from the perspective of someone happily unaffected, but it does seem to me that just leaving it might be the best bet. It will get progressively more painful to develop using Python 2.7 on Windows, and that will encourage people to move away from 2.7, or Windows, or both. Win-win :-)
How can i implement the static method get_class_name() to get the expected results.
I need to get the correct class name without instantiating. (I know this can be done with an instance). Python version is 2.6.
class base_class():
@staticmethod
def get_class_name():
return <??>
...
My friend is looking to put together a python package which uses Fourier theory to encode data into an image (stenography basically). Chocolate cookies to the person who comes up with the best package name.
I'll be buying the cookies from Ikea so you'll receive butter, sugar, an egg, some flour, and some chocolate chips and then you just put it together yourself.
I think my word chooser is buggy... It always outputs words that are so not random, like "statists" or "pilgarlics". Never "monkey" or "cheese" or "dishwasher".
I don't think it really gets the spirit of randomness.
This reminds me of a dumb physics question I had the other day... They say that matter can be converted to energy. Does this mean it's possible to have a system that's all energy and no matter?
If Matrix can change in size on the fly, it may be more convenient to have a function that recalculates the height value every time, rather than having to manually update the attribute yourself in every circumstance where the dimensions of the Matrix might change.
Here is a pure Python-specific design question:
class MyClass(object):
...
def get_my_attr(self):
...
def set_my_attr(self, value):
...
and
class MyClass(object):
...
@property
def my_attr(self):
...
@my_attr.setter
def my_at...
I will attempt to demonstrate with an example. Here is a class which uses ordinary attributes to store its height and width. It has a million methods which may change height and width on the fly. In all one million of these methods, it's necessary to recalculate the attributes at the end.
In contrast, here is the same class, except it uses properties for height and width. Now all one million of my methods are one line shorter, saving a lot of effort and memory.
One may ask, "in the second class, why not skip having height and width properties entirely, and make the user call get_height() and get_width() instead?". The answer being, "That is perfectly valid, although the user may be annoyed by the extra verbosity".
Let's say you have a list, and you've got its length, two indices, which are 'inside' the list and they are different, and you have a block_length. now, the question is, if you want to swap index1 + block_length with index2 + block_length blocks, how will you check: 1) if the blocks are overlapping or not, 2) if both blocks are inside the list?
The challenge is: is it possible to find a way, where you don't have to know which index is greater, compare the lesser + block_size to the greater, then the greater + block_size to the whole length?
Using only one greater/less than sign? No, I don't think so.
You could create a list containing [index of start of first block, index of end of first block, index of start of second block, index of end of second block, index of final element in the list], and raise an exception if the values aren't sorted
Or, no, that's no good, if you don't know which idx is smaller
that's more time consuming (it is not python btw, it is more like a hypothetical question, on this algorithm, if there's any algorithm here in the first place)
If it's just a matter of code cleanliness, I like to do this: when a function takes two numerical parameters, and I would like the first one to always be smaller than the second, I'll swap them at the beginning of the function if they aren't properly ordered: if a > b: a,b = b,a
I think they answered you pretty clearly in the comments. Either take out the code that's adding the columns, or use a schema migration to add the columns described by that code to the database.
The first sets up a many-to-many relationship between User and Group, the second uses that relationship to set up an association proxy to the group names.
Has the commenting interface on SO changed? I see " add a comment | show 2 more comments ", and I don't recall seeing both buttons side by side before.
so davidism, do you use the flask command to run your application? I tried exporting FLASK_APP to where my manage.py lived, but it did not register when I did flask run
@Kevin you should meet one of my clients. She had a designer redesign her logo 40 times (literally) only to choose the first one again. Which was absolutely attrocious.
I like the ones with happy endings. Like 'my client called and said "I prayed to God and he said I don't need to pay you". I waited ten minutes and called back. "that's funny, I prayed to God and he said you should pay me." He paid shortly afterward.'
ME: Since we are on such a tight schedule, could you please be more precise when giving me feedback on this?
CLIENT: It needs to look a bit nicer.
I pity that person... I've had that more times than I'd like to remember :)
I remember spending an entire day writing a 7 page document with options, pros/cons, next steps, timescales and costs, and asking how the client would like to proceed...
my client said "I want a website"... so I said "what kind of website...?". She was like "uh... I dunno". "do you have any examples...?" "uh... no". Why would someone ask for something with zero plans past that?
@Crow This one is understandable if they just want a site as a status symbol. "I want to be hip and on the cutting edge. Build me a web site so everyone knows how modern I am"
yeah. She wanted to throw everything in. Like she just looked at tons of gimmick sites and said she wanted things. Like she said she wanted webgl water, 3D CG animations, parallax scroll, single page blahblah, for a news site