I know this question was asked many times on here, but could not find an adequate answer. I need to find the position of the words in a list, when I run my code it gives me None Here is the code: words = ['Banana', 'Banana', 'Apple', 'Apple', 'Pear', 'Peach', 'Grapefruit', 'St', 'Apple']  def get_position(words, type_word):     for idx, value in enumerate(words):         if value in words == type_word:             return idx           positions = get_position(words, 'Apple') print(positions)  Preferred Output: [2, 3, 8]
Given a list ["foo", "bar", "baz"] and an item in the list "bar", how do I get its index (1) in Python?
C: pointer to struct in the struct definition How to redirect complete outgoing phone's traffic to a proxy server? How can I concatenate two arrays in Java? I need to concatenate two String arrays in Java.  void f(String[] first, String[] second) {     String[] both = ??? }   What is the easiest way to do this? How does one actually show from associativity that one can drop parentheses? I've always heard this reasoning, and it makes obvious sense, but how do you actually show it for some arbitrary product? Would it be something like this?  $$(a(b(cd)))e=((ab)(cd))e=(((ab)c)d)e=abcde?$$  Do you just say that the grouping of the parentheses now corresponds to just multiplying straight through? Thanks. Does anyone know the name of travel posters from the 1930s? Is there a name for this design style - use of flat colours for dimension and shading - that was so prevalent in UK travel posters of the 1930s? Username and Password not recognized when logging into Minecraft We just got a new laptop (ASUS) though we did have a mac.  We are trying to log onto Mojang to download Minecraft and it keeps saying, "The username and password are not recognized."   We have done all the usual procedures; we have reset the password, we are using the email, not the username to sign in, and it looks like the minecraft login servers are working etc. etc.  We quit Minecraft on the old computer and shut off that computer thinking that was the issue.   Still, we can't get onto Mojang.  We are accessing mincraft through firefox and trying to download it to the new computer but we can't get into the account to do that!  What in the world could be the issue? How to Start Web Mapping? I want to start working on a web map at work to map some of our statistics by city.    I have an idea, but I'm not exactly sure where to start.   Are there any definitive resources that provide step by step guidance on how to do this? More and more frequently in the review queues, I am spending time either fixing a post or considering whether an edit is valid, etc, only to make changes and have them denied/not count because someone else has blindly hit the approve button in the meantime.  My proposal is for the system to "lock" a post in the review queue once it has been presented to someone for review.  Do not let anyone else (in the review queue) do anything with it until it is released by the last user it was presented to (or a certain amount of time has elapsed).    By "lock" I mean that it won't show up in anyone elses list until released.  I did NOT mean that it would be in multiple queues and be unactionable in some of them.  This would fit well as the queues only present one at a time anyway.  This will allow people trying to make good decisions the time to do it and prevent someone else from making that effort a waste of time.  As support, look to some of the published reasoning behind the auto-question ban.  A large portion of it is that bad questions waste the time of the community.  Taking the time to ensure you are making a good decision in the /review queue only to have it not count because someone was badge-whoring and clicking the approve button as fast as they could also wastes the users time... arguably the more (for lack of a better way to put it) valuable user who is willing to invest some time and thought into making the site better. Code blocks are not prettified on mobile site On Chrome on Android, code blocks on the mobile site have no syntax highlighting, are not a monospaced font, and words are wrapped.  Mobile site on mobile browser:    Desktop site on mobile browser:    Inline code has the same issue, it isn't a monospaced font.  It has been this way for as long as I can remember. Wouldn't be surprised if this is a dupe. Given a file like this:  1,768,12,46576457,7898 1,123,435,134,146 2,345,6756856,12312,1311 5,234,567465,12341,1341 1,3245,4356345,2442,13 9,423,2342,121,463 9,989,342,121,1212   I would like to list all rows (in bash terminal) such that the value in column 1 appears at least twice (in column 1). The result should be  1,768,12,46576457,7898 1,123,435,134,146 1,3245,4356345,2442,13 9,423,2342,121,463 9,989,342,121,1212 How to troubleshoot unwanted white spaces smartly? Every vector space has a basis Prove that every vector space has a basis. I am going to use Zorn's lemma for this also here is a necessary definition regarding totally ordered subsets: one element will be contained in the other.   proof: A basis for $V$ is a maximally linearly independent set. Let $X$ be equal to all linearly independent subsets of $V$. On, $X$ define $A\leq B$ means $A\subset B$. Let $S$ be a totally ordered subset of $X$, let $T = \bigcup_{A_{s}\in S} A_s$ then $A_s\subset T$ for all $s\in S$. Does $T\in S$? i.e. is $T$ a linearly independent set?. Let $$O = \alpha_1 v_1 + \alpha_2 v_2 + \ldots + \alpha_n v_n \ \ \text{where} \ \ v_i\in T = \bigcup_{A_{s}\in S} A_s$$ Then there exists $S_i$ such that for all $i\in A_{s_{i}}$ all $i$ $A_{s_{1}},A_{s_{2}},\ldots, A_{s_{n}}$ (these will have one contained in the other then we would take the larger). So, there exists $A_{s_{k}}$ such that $A_{s_{k}}\supset A_{s_{i}}$ all $i$ just compare two at a time. Therefore, $V_i \in A_{s_{k}}$ all $i$, but $A_{s_{k}}$ is a linearly independent set. So, $\alpha_i = 0$ all $i$. Hence, $T\in X$ so $T$ is an upper bound for $S$. Hence every totally ordered subset of $X$ has an upper bound, hence by Zorn's lemma, there exists a maximal element and this would be the basis.  I am not sure if my proof is right, I apologize if it is a bit messy. If it is right, any suggestions on cleaning it up would be greatly appreciated. Real Analysis, Existence of a Limit Boundedly:$|\int_0^b\frac{sin(ax)}{x}dx | \le c$ I need to show that there exists a $c$ such that $|\int_0^b\frac{sin(ax)}{x}dx | \le c$, where $a$ is any real number, and $b$ is any real number greater than 0. Also I need to show that the smallest $c$ possible is $c=\int_0^\pi\frac{sinx}{x}dx$. I know that $\int_0^\infty \frac{sin(ax)}{x}dx = sig(a)\frac{\pi}{2}$ where $sig(a)$ literally just means positive one or negative one, depending on the sign of $a$. I think the fourier tranform of the characteristic function on the interval $(0,a)$ is $\frac{sin(ax)}{x}$. After that, I am unsure about how to proceed. Thanks for your help! Output URL of open firefox tabs in terminal The problem: The links at the bottom of the Stack&nbsp;Exchange newsletter link to a YouTube video instead of the right place on the website. I´m not sure if this is an oversight or a clever hack.  Screenshot: Breaking single polygon into multiple polygons? I created voronoi polygons after which I dissolved them on the basis of one attribute. Now there are cases where in for one single attribute "abc" I have3 polygons at different places with same object id. I would like to break these into 3 polygons as they are at different locations.  Is there any tool in ArcGIS Desktop or QGIS which can help me in doing that? What is an example of "this" assignment in C#? Does anybody have useful example of this assignment inside a C# method? I have been asked for it once during job interview, and I am still interested in answer myself. Access images inside jar I normally write using the American English forms, but for some particular words, I tend to naturally write it in the British manner (like with the word favourite rather than favorite).  Is it wrong to mix both styles? If not *wrong*, does it looks weird? Background  Recently  was implemented. With this feature the amount of questions with new activity is shown in parenthesis at the beginning of the page title, e.g.     (2) Meta Stack Overflow   means that MSO has two questions with new activity since the user last viewed it.   this feature is unrelated to inbox updates. Here is an example to illustrate this:    Even though there are two inbox messages in this screenshot this is not reflected by the page title. The page title is currently only sensitive to questions with new activity.  Suggestion  I suggest that the page title also reflects inbox updates. For the screenshot above this would mean that the page title shows that there are two inbox updates and two questions with new activity.  I am not sure what format is best for showing this. For chat * in the page title is used to show that there are messages directed at you which is similar in meaning to inbox updates. However, * if is placed after the number in parenthesis to denote inbox updates there might be confusion as there is no connection between the number in parenthesis and * like in chat. Thus, one might prefer another format such as one of the following (all are meant to reflect the status of the screenshot above):      * (2) Meta Stack Overflow     2* (2) Meta Stack Overflow     [2] (2) Meta Stack Overflow     2i 2q  Meta Stack Overflow     (2/2)  Meta Stack Overflow     (2|2)  Meta Stack Overflow    For the alternatives without an explicit hint of which number refers to what it might be best to place the number for questions with new activity first as it will in most cases be greater. This will to a greater degree avoid combinations such as "(0/2)" which may be confused zero of two.  An advantage of the suggested feature is that if the user has a browser tab with a Stack Exchange site then they will be instantly notified of inbox updates. They do not need to focus a tab with a Stack Exchange site to know if there are inbox updates, they merely have to check the relevant page titles among their tabs.  A disadvantage of the suggested feature is that it might be experienced as verbose. I suggest that it is implemented such that it is as unobtrusive as possible while still being informative. Think of a situation where a user has   one Meta Stack Overflow tab with two inbox updates relating to Meta Stack Overflow and two questions with new activity, and one Super User tab with one inbox updates relating to Super User and three questions with new activity.   Then the sum of the inbox notification in the page titles should be local to sites and not global. The page titles for the tabs above should be something like the following pair:      2i 2q  Meta Stack Overflow     1i 3q  Super User