Can you sort by subclass? Is there a way to list through subclass value? I'd like 'by' variable to be the first one and sort entire list by .number subclass.  class Abcd:     def __init__(self, name, number):         self.name = name         self.number = number  ax = Abcd("a", 20) by = Abcd("b", 1)  lst = [ax, by]  print lst[0] list.sort(lst) print lst[0]
How to sort a list of objects based on an attribute of the objects? I've got a list of Python objects that I'd like to sort by an attribute of the objects themselves.  The list looks like:  &gt;&gt;&gt; ut [&lt;Tag: 128&gt;, &lt;Tag: 2008&gt;, &lt;Tag: &lt;&gt;, &lt;Tag: actionscript&gt;, &lt;Tag: addresses&gt;,  &lt;Tag: aes&gt;, &lt;Tag: ajax&gt; ...]   Each object has a count:  &gt;&gt;&gt; ut[1].count 1L   I need to sort the list by number of counts descending.  I've seen several methods for this, but I'm looking for best practice in Python.
How to get Intel Dual Band Wireless-AC 3168 work on Ubuntu 16.04? Bias of maximum likelihood estimators for logistic regression Let $A,B$ be two sets. The  states that if there is an injection $f\colon A\to B$ and an injection $g\colon B\to A$, then there exists a bijection $h\colon A\to B$.  I was wondering whether the following statements are true (maybe by using the AC if necessary):   Suppose $f \colon A\to B$ and $g\colon B\to A$ are both surjective, does this imply that there is a bijection between $A$ and $B$. Suppose either $f\colon A\to B$ or $g\colon  A\to B$ is surjective and the other one injective, does this imply that there is a bijection between $A$ and $B$. Do new wire runs in an existing ceiling need to be stapled down? I've heard some people say that code requires wiring in the wall to be stapled to framing every so often (how often?), but when you are doing a remodel, is that necessary?  I have a two story house, and would like to remove one standard dome light on the first floor ceiling and replace it with 6 recessed lights.  There is about 12" of empty space between the floors, and it seems easy enough to run the wire from light to light without cutting any drywall except for the 4-5" holes required for the lights. However, there's no way I'd be able to staple the wiring down.  It's just going to be loose in the ceiling, running through a small hole in the I joists every once in a while.  They sell "remodel" light cans that are made specifically so you only have to cut a hole big enough for them to fit in, so this seems like a common job.  What am I missing and how can I do this job in the most correct way?  This is in Dallas, TX, single family residence. Does using the Console Commands negatively affect me? I'm wondering in case I get stuck in an area that I'm unable to get out of or if I clip into a wall and I suddenly can't move. I've had to disable clipping to get out of certain areas in Skyrim before but I want to make sure that things like my achievements and stuff won't shut out on my playthrough.  If I enable something, spawn an item that didn't spawn for me, or just basically use the console command to fix any bugs, what will happen achievement and game-wise? What is the longest additional time ever used in Europe's top five leagues? Please mention the details of the match. If $a_{ij}=\max(i,j)$, calculate the determinant of $A$ How to correctly install libpng12-0 on the Ubuntu 19.10? Affiliation for a retiree This question is similar to   and  except that I am a retiree.  I intend to submit a paper to a journal without mentioning any affiliation because I am no longer employeed. I have been thinking about a footnote in the paper indicating I am a retiree from my former employer for two reasons: I am receiving pension from the company pension fund and it is a well-known company in U.S. Using their name may make me look good. On the other hand, I feel like it's cheating because I am not their employee anymore. Is there a proper way to handle large combat engagements with party members involved? For instance, a party of four player characters raise a force of 30 militia men to go take a bandit camp. When they get there the bandit camp has 40 men, and none of them notable.  For the sake of simplicity, both the 30 men and the 40 bandits are armed with long swords, and wearing leather armor.   Is there a proper way to handle combat between the 30 man militia and the 40 bandits while also incorporating our four player characters? If no "proper" way exists, is there a generally accepted "best" way? What are the correct settings for min-memory and max-memory in this use case?  The server has 8GB ram, dual Intel Xeon processors, running Windows Server 2008 R2 / Sql Server 2008 Standard Edition. It's running several databases ranging from 30GB - 5GB in size.  Originally the memory usage was set to the default settings (min=0 max=2,147,483,647). On these settings most of the memory usage was taken up by sqlservr.exe and the server would eventually need to be restarted every day or two. It would run normally at first but within a day start to timeout on simple operations like looking up a record using the primary key.   I have changed min=4,096 and max=6,144. This results in only 1.4GB memory usage. However now all four cpus are running at 50-60% cpu usage constantly. Tasks are taking roughly 1/3rd longer to execute, although the server is much more stable. How can a question banned user fix their questions if they're deleted? If a user is question banned  and the , how can the user fix this on their own?  Until recently, advice has been to improve their questions, but since they can't see the questions on their question screen, they can't improve them:     Feature request: Allow a question banned user to see their own deleted questions, or warn them that deleting questions could lead to a question ban. Problems with partial derivatives. What exactly is the Box-Jenkins method for ARIMA processes? The  page says that Box-Jenkins is a method of fitting an ARIMA model to a time series. Now, if I want to fit an ARIMA model to a time series, I will open up SAS, call proc ARIMA, supply the parameters $p,d,q$ and SAS will give me AR and MA coefficients. Now, I can try different combinations of $p,d,q$ and SAS will give me a set of coefficients in each case. I select the set with the lowest Akaike information criterion.  My question is: where in the above procedure did I use Box-Jenkins? Am I supposed to use Box-Jenkins to come up with initial estimates of $p,d,q$? Or did SAS use it internally somehow? I have a lidar file (file.las) with the following spatial reference:  Spatial Reference:            PROJCS["NAD83 / UTM zone 11N",     GEOGCS["NAD83",         DATUM["North_American_Datum_1983",             SPHEROID["GRS 1980",6378137,298.2572221010002,                 AUTHORITY["EPSG","7019"]],             AUTHORITY["EPSG","6269"]],         PRIMEM["Greenwich",0],         UNIT["degree",0.0174532925199433],         AUTHORITY["EPSG","4269"]],     PROJECTION["Transverse_Mercator"],     PARAMETER["latitude_of_origin",0],     PARAMETER["central_meridian",-117],     PARAMETER["scale_factor",0.9996],     PARAMETER["false_easting",500000],     PARAMETER["false_northing",0],     UNIT["metre",1,         AUTHORITY["EPSG","9001"]],     AUTHORITY["EPSG","26911"]]   Then I reproject it to WGS84 with las2las:  las2las --a_srs EPSG:26911 --t_srs EPSG:4326 -i file1.las -o output.las   And I get:   Spatial Reference:                GEOGCS["WGS 84",         DATUM["WGS_1984",             SPHEROID["WGS 84",6378137,298.257223563,                 AUTHORITY["EPSG","7030"]],             AUTHORITY["EPSG","6326"]],         PRIMEM["Greenwich",0],         UNIT["degree",0.0174532925199433],         AUTHORITY["EPSG","4326"]]   But when I try to revert the transformation: from WGS84 to NAD83/UTM 11N, I get an error:  las2las --a_srs EPSG:4326 --t_srs EPSG:26911 -i output.las -o wgs2utm.las ERROR 1: latitude or longitude exceeded limits error: Could not project point for ReprojectionTransform::latitude or longitude exceeded limits0.   Why I got this error, if I am just reversing the transformation (originally from NAD83 to WGS84, and then from WGS84 to NAD83)?. How to find a function in $ L_{2}(0,\infty)$ but not $L_{q}(0,\infty)$, $q\neq 2 $ Is there a VB.NET-Like operator in C#? What are the dev-loop services that started on boot? Please stop using SoftwareEngineering.SE as your toilet bowl Stack Overflow users have been using the "off topic - belongs on SoftwareEngineering.SE" close reason as an alternative to all the other close reasons. It'd be helpful if people actually read the FAQ and the six  before voting to migrate questions like:   , no redeeming value to favorite lists that become argumentative , "help my exact situation" questions are too localized , fails 5 out of the 6 guidelines , fails 4 out of 6 , too localized and too vague , too broad   Absent a reversal of the Stack Overflow community from viewing SoftwareEngineering.SE as the Stack Overflow cesspool, can the "off topic - belongs on SoftwareEngineering.SE" close reason be removed in favor of manual migration by moderators who can actually spend the 10 seconds to determine if the question should be closed outright first?    To say that SoftwareEngineering.SE is such a nebulous place and nobody knows what its scope is as the reason why crappy questions keep getting migrated there is to miss the point. Good questions are good questions on all of the sites, and questions that are too vague, that are too argumentative, too localized, and too broad are universal close reasons. There is no special dispensation for SoftwareEngineering.SE to have bad questions, even if you personally think the questions on there suck.  Even the six subjective guidelines for subjective questions are universal guidelines: they affect all sites. So even if you had no idea what the consequences of using the "off topic - belongs on SoftwareEngineering.SE" close reason were, there are still all of the other close reasons for which bad questions, like the ones above, can be closed. When conducting multiple regression, when should you center your predictor variables & when should you standardize them? In some literature, I have read that a regression with multiple explanatory variables, if in different units, needed to be standardized.  (Standardizing consists in subtracting the mean and dividing by the standard deviation.)  In which other cases do I need to standardize my data?  Are there cases in which I should only center my data (i.e., without dividing by standard deviation)?