My list looks this: l = ['abcdbcex', 'abcdbc1fz', 'abcdcd11', 'abcd11a5']  I want to sort it in a way that it will become: l = ['abcd11a5', 'abczbc1fz', 'abcfbcex', 'abcecd11']  So sort in ascending order, but skipping first 4 letters, also skipping everything after the 7th letter. I have tried doing: sorted(list, key=lambda x:x[:4]) but this does not skip the first 4 letters, because I don't know how to do it.
I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.
Why can't we initialize members inside a structure? I find myself repeating a lot of:  mkdir longtitleproject cd longtitleproject   Is there a way of doing it in one line without repeating the directory name? I'm on bash here. Are there solutions that can limit the CPU usage of a process? I am using an old laptop and doing heavy processing that needs high CPU usage for a long time (~30mins - 2hours). When the process puts heavy load on CPU for a long time, CPU overheats and computer shuts down. I don't want to use a cooler/stand because I am carrying this laptop around and working outside home.  Is there a way/application that I can limit CPU usage of a process in Windows?  Note: Setting the priority of the process from task manager does not work.  Note 2: Fans are clean. Should moderators be allowed to decline flags on their own comments? I think I just witnessed a moderator decline a flag raised on his own comment. (I'm hesitant to discuss specifics unless I have to, as I don't mean to put anyone in a negative light.)  Since there are at least 2 other moderators per site, I'm not sure this should be allowed—I feel that either   only uninvolved moderator(s) should be able to view and handle flags on co-moderators' posts, or moderators should be able to view all flags, but a flagged moderator should not be allowed to decline a flag against him- or herself.   I have no personal issue with this moderator. I just felt in this case that there was truth in both sides (the moderator's as well as the flagging user's), and sought a win-win solution, i.e. by improving the disputed answer. Coming back an hour later to see that the moderator unilaterally declined the user's flag—that didn't seem fair to the user...  I am making some assumptions based on the "Last Seen" stat in the moderator tools, so if I'm simply mistaken on what happened, I apologize in advance. Pass An Instantiated System.Type as a Type Parameter for a Generic Class The title is kind of obscure. What I want to know is if this is possible:  string typeName = &lt;read type name from somwhere&gt;; Type myType = Type.GetType(typeName);  MyGenericClass&lt;myType&gt; myGenericClass = new MyGenericClass&lt;myType&gt;();   Obviously, MyGenericClass is described as:  public class MyGenericClass&lt;T&gt;   Right now, the compiler complains that 'The type or namespace 'myType' could not be found." There has got to be a way to do this. I eliminated a computer player that had a strong religion (Buddhism). My religion was weak, whereas this other one was taking over the continent quickly. Now that I have him overrun, I want, well wanted, to work on converting cities to mine, but I see now that all of the cities period have his religion! I tried making an Inquisitor just to test, but he is ineffectual at removing Buddhism, being that I can only buy him in Buddhist cities. (Because all of my cities are Buddhist and my religion, Shinto, has been wiped out.   Is there no way to recover your religion in such a situation? What are the mechanics by which Time Dilation and Length Contraction occur? When to use unsigned values over signed ones? Communicating with all potential clients as a multi niche photographer This may be seen as a bit off topic, but I'm hoping it's a question that some photographers can associalte with and clear up for me.  I'm an amateur wanting to get more serious in the new year, and aiming to build up a portfolio of work that I will showcase on my own website, which will hopefully build up a client base.  I figured that a good way to get started would be to create a few 365 style projects that I can publish on my site and on social media. However, my interests vary a great deal, and therefore my photography will more than likely range from nature and local events, to more NSFW style topics.  My problem is, how to successfully communicate with people who will be interested in certain aspects of my work, without losing touch with those interested in others.  In theory, I'd like to set up a single social media presence, preferably Twitter, where I can freely post anything I want, and connect with anyone I want. Essentailly pointing people in the direction of whatever content they will be interested in. Problem is, social media sites like Twitter publicise ALL of your posts to ALL of your followers, so people who are following for nature/local photography will possibly unfollow me for my NSFW content. At the same time, some SFW followers may be potential clients in other areas, and vice versa.  So as a multi niche photographer, how can you engage with all potential clients, and showcase all portfolio peices ( in my case all 365 project shots ) via a single or limited number of social networks? How are you doing it? How do I create a deb package for a single python script? I have a single python script that I want to distribute as a deb package. It is a  which shows local date in Unity panel. I did follow  but I could not create a deb package because it fails.   Can someone give me a step-by-step instruction on what I should do? As far as I know this script depends on python-appindicator.   NOTE: I do not want any links to Debian/Ubuntu packaging instructions. I have seen most of them. I don't find them beginner friendly. Does Gentle Repose work on a Circle of Spore Druid's Fungal Infestation Ability? The Circle of Spores Druid feature Fungal Infestation states:  If a beast or humanoid that is Small or Medium dies within 10 feet of you, you can use your reaction to animate it, causing it to stand up immediately with 1 hit point. The creature uses the zombie statistics. It remains animate for 1 hour, after which time it collapses and dies.  Circle of Spore druids also gain access to the  spell, which states:  You touch a corpse or other remains. For the duration, the target is protected from decay and can’t become undead. The spell also effectively extends the time limit on raising the target from the dead, since days spent under the influence of this spell don’t count against the time limit of spells such as raise dead.  There seem to be some good arguments that they cannot work together:  First, Gentle Repose states the target cannot become undead, which would seem to preclude Gentle Repose working on a fungally infested creature that appears to be in some sense raised from the dead. Second, gentle repose states you touch a corpse or other remains - one could argue that using the zombie statistics, the fungally infested entity is neither a corpse or remains, but an undead zombie.  However, there are also some reasonable arguments that they could work together:  First, the Fungal Infestation does not say that the creature is undead or a zombie, but that it uses the statistics of a zombie, which might leave room for a RAW interpretation that the features could work together (for example, it could be considered a fungally infested corpse or fungally raised remains). Second, Gentle Repose says that it extends the time limit of raising the target from the dead and makes reference to spells like Raise Dead, which in flavour are similar to what happens with Fungal Infestation.  RAW, can a player cast gentle repose on a zombie created by Fungal Infestation? Limit of sequence in which each term is defined by the average of preceding two terms We have a sequence of numbers $x_n$ determined by the equality   $$x_n = \frac{x_{n-1} + x_{n-2}}{2}$$  The first and zeroth term are $x_1$ and $x_0$.The following limit must be expressed in terms of $x_0$ and $x_1$ $$\lim_{n\rightarrow\infty} x_n $$  The options are:   A)$\frac{x_0 + 2x_1}{3}$ B)$\frac{2x_0 + 2x_1}{3}$  C)$\frac{2x_0 + 3x_1}{3}$ D)$\frac{2x_0 - 3x_1}{3}$  Since it was a multiple choice exam I plugged $x_0=1$ and $x_1=1$. Which means that all terms of this sequence is $1$,i.e, $$x_n=1, n\in \mathbb{N} $$  From this I concluded that option A was correct.I could not find any way to solve this one hence I resorted to this trick. What is the actual method to find the sequence's limit? Non-existence of $\lim \limits_{(x, y) \to (0,0)} \frac{x^3 + y^3}{x - y} $ How to show that $\lim \limits_{(x, y) \to (0,0)} f(x, y)$ does not   exist where,         $$f(x, y) =  \begin{cases} \dfrac{x^3 + y^3}{x - y} \; ; &amp; x \neq y \\  0 \; \;\;\;\;\;\;\;\;\;\;\; ; &amp; x = y  \end{cases}  $$   I tried bounding the value of the function as $(x, y)$ approaches $(0,0)$ but was not successful. I graphed the function and saw that it was actually approaching $0$ but Microsoft Math failed to render some points around the $x = y$ plane. So I imagine I need to find points $(x, y)$ such that $x$ is extremely close to $y$ but $(x, y)$ is not as close to $(0,0)$ to show that the function does not approach $0$ around the origin. But was unable to think of any.   Hints or suggestions would be awesome. Any help is appreciated. Where do I put the code snippets I found here or somewhere else on the web? Many posts here or somewhere else contain code, but they do not say where to put it.  Example:  I have found this post:  I'm a newbie with PHP. Where exactly should I place the code from the answer? How does the post-2.0 Puzzle Ring work? Patch 2.0.1 introduced a lot of significant changes to the loot system in the game. One of the significant ones was the revamp to the , which now has a new effect:      Summon a treasure goblin who picks up normal-quality items for you. After picking up 12–16 items, he drops a rare item with a chance for a legendary.    What is the cooldown on the goblin item drop? Does the effect stack if you have one on your character and another on your follower (i.e. two goblins)? Is the drop chance for the rare/legendary affected by increased Magic Find? If so, approximately how much? Is there a cap on them max item level of the dropped item? (While &lt; lvl 60, at lvl 60, and when the level cap is raised in the expansion.) Does the item counter reset when you leave the game, change acts, or die? Assume that $f$ be continuous on $\mathbb{R}$, $f'(x)$ exists for all $x\neq 0$, and $\lim_{x\rightarrow 0} f'(x)=1$. We need to show $f'(0)$ exist and is equal to $1$.  $f'(0)=\lim_{x\rightarrow 0}\frac{f(x)-f(0)}{x}$, $\lim_{x\rightarrow 0}f'(x)=1\Rightarrow\lim_{x\rightarrow 0}\lim_{h\rightarrow 0}\frac{f(x+h)-f(x)}{h}=1$...am I going in the right direction? Please help. Problem with Non English(Farsi, ...) subtitle Why directory with large amounts of entries does not shrink in size after entries are removed? Close vote notice: While the linked duplicate asks same question, the comments and the only answer do not provide an answer which draws from authoritative source. The , does in fact provide the answer I've been seeking. Thus the proposed duplicate isn't helpful, however Thomas's answer here is proper.  According to the  and personal account , directories that have large amount of entries get to a size over 4096 bytes (which can be seen with ls -l output), but once the entries are removed - the number never goes down.   The question is "why" ? Is it due to how ext4 filesystem configured to retain directory metadata ? Obviously removing the directory and recreating it isn't a solution, since it deletes original inode and creates a new one. What can be done to decrease the number manually ? Finding the derivative of $x\uparrow\uparrow n$ I am trying to find a general derivative for the function: $f(x)=x^{x^{x^{...^{x}}}}$however to do that I must find $f^{\prime }$ and $f^{\prime \prime}$...etc. I am now trying to write down a general expression for $f^{\prime \prime}$ and I have stumble opon the series in the picture below, I wonder, do anyone have an idea of what sort of expantion it migth be ? I have tried breaking it down into three different sums, but I wasn't very successful!  EDIT  So since this post has gotten some attention and the title has been change I will tell you what I am on about, although I already have a post just for the question in the title from before. I am as I said earlier trying to find a general derivative for the function $f(x)=x^{x^{x^{...^{x}}}}$ where $n$ is an arbitrary number, natural number and greater or equal to 2. I have already made success when I tried to find the first derivative, and I have also found some interesting pattern emerge when the derivatives as well as n incresses. But my question here was if anyone knew what this expation might be or look similar to be, since I have yet to be lernt series etc. I did not know that the question needed such background since it's straight a forward question. Is the Star Wars Universe just one galaxy?