So I'm currently making a tic tack toe game where you play against the computer, and I can't seem to figure this part out.  I want the computer to select a random variable from a list of positions that haven't been used yet, and make that variable's value O.  Here is what I have currently.    #positions is a list of variables that start off = ''  positions = [ul, uc, ur, cl, cc, cr, ll, lc, lr]  comchoice = randrange(0, len(positions))  while positions[comchoice] != '':     comchoice = randrange(0, len(positions)) else:     positions[comchoice] = 'O'   EDIT: This question is different than the one that it is said to be a duplicate of.  It is different because it is asking about changing the value of a variable in a list.  It's clear in my post that I understood the duplicate post's question with my code.
Assume I have the following list:  foo = ['a', 'b', 'c', 'd', 'e']   What is the simplest way to retrieve an item at random from this list?
Should I follow what was mentioned in the “duration of stay” or in the "validity of the visa"? I'm from Tunisia and I got a Schengen visa from the Austrian Embassy for  28 days, the “duration of stay”, and the number of entries is 1. But the validity of the visa is from 02/08/2015 to 13/09/2015.  Do I have to stay only 28 days, for example from 02/08/2015 to 29/08/2015 or can I stay there until 12/09/2015 ?  And if I have got to stay only 28 days, then can I choose the days of stay, that's mean can I stay in Austria for example from 09/08/2015 to 05/09/2015? It has come up in game a couple of times that a player might want to cast a spell that has a casting time of 1 bonus action using their "main" action (if they have another bonus action they also want to take on that turn, such as giving bardic inspiration, or controlling a Bigby's hand, etc.)  On the face of it, it seems obvious that something (a bonus action) that is usually much faster than a full action could be done as your full action.  Although the question comes up most often with respect to spellcasting, if I house rule this, I would rule that any bonus action can be taken as a regular action instead; however, I would not allow the same type of bonus action to be taken twice (so no giving bardic inspiration to two allies on the same turn, for instance).   Are there any abusive or overpowered combinations I should be wary of if I were to allow a character to take 2 bonus actions instead of one regular action and one bonus action on a turn?   The issue of casting two bonus-action spells would not come up because the rule against casting 2 spells on your turn unless one of them is a cantrip with a casting time of 1 action would still be in effect:  PHB p. 203 (under Bonus Action casting time)     You can't cast another spell during the same turn, except for a cantrip with a casting time of 1 action.   I know it's hard to prove/justify a negative answer to a question like this, but I'd be happy to get answers that say you don't think there would be any issues if you describe how you came to that conclusion. Windows 7 Taskbar Icon Highlight Sticks After running Win 7 for some unknown period of time, the taskbar icon highlight starts to stick (video demo here: ). If I restart or kill explorer.exe and relaunch, it goes away.  Any idea what might be causing this? How do you prevent a user from posting data multiple times on a website How to fade one material into the other? Hello blender community.  Could someone please let me know how to fix this issue? I have one material for the whole face and a different one for the lips.  there's a noticeable edge that I want to get rid of. I just want it to have an ease fade instead of a sharp edge.   what's the best way to go about this?  Thank you in advance!    Finished Update  I wanted to give an update on how it was fixed with @hexbob6 and @Lemon 's help.    I needed two textures. One is the actual colored version and the 2nd is the black and white masked version. Hexbob6 described very well on the process here:   A: The node process on how to do it.    The B/W masked texture is going to be connected to the Fac of the mixed shader along with its UV coordinates. Make sure the image is on clip instead of repeat. the 1st shader is going to be the black part of the B/W masked texture. An important thing to note is if you have a texture already for the object, be sure to connect the other UV coordinates! the 2nd shader will be the white part of the B/W masked texture.   B: This section is the UV layout called "mainUV" where all the color goes.  C: This section is the B/W masked texture to focus on the lips.  D: Just the render view  E: Best way to texture something is to be able to see it in 3D view and texture paint.  F: Just showing that there are two textures to keep track of. One is the main UV and the 2nd is to focus on the lip.   That was it. Once again thanks to those who replied and helped me figure this problem. In the process I learned other things that I didn't know about blender even though I've been using it for years. crisscross, dillydally, riffraff, etc Duplicate questions in feed, and questions incorrectly marked as unanswered I see duplicate questions in the feed (Why is the book still wanted if Aida has memorized it?) and the question is marked as "unanswered" even though it has an upvoted answer.  I would expect unique questions in the feed, as well as questions with answers to not be marked as unanswered.   App Version: 1.6.3.4 Device: iPhone 6 OS Version: Version 10.2 (Build 14C92) How do you convert CString and std::string std::wstring to each other? CString is quite handy, while std::string is more compatible with STL container. I am using hash_map. However, hash_map does not support CStrings as keys, so I want to convert the CString into a std::string. Writing a CString hash function seems to take a lot of time. CString -----&gt; std::string  How can I do this? std::string -----&gt; CString:  inline CString toCString(std::string const&amp; str) {     return CString(str.c_str());  }  Am I right?  EDIT: Here are more questions: How can I convert from wstring to CString and vice versa? // wstring -&gt; CString std::wstring src; CString result(src.c_str());  // CString -&gt; wstring CString src; std::wstring des(src.GetString());  Is there any problem with this? Additionally, how can I convert from std::wstring to std::string and vice versa? Correct user names when tracking /etc/ in git repository and committing as root What is the difference between equation and formula? Sometimes equation and formula are used interchangeably, but I was wondering if there is a difference.  For example, suppose we can calculate a car's fuel efficiency as:  mpg = distance traveled in miles / the fuel used in a gallon   Is that an equation or formula? Minecraft Survival Mode Using memory with a higher MHz rating? Can MacBook Pro's successfully support and fully exploit RAM of a higher MHz rating than that which they ship with?    For example, take my 15" MacBook Pro () that ships with 4GB of 1333MHz DDR3 memory. I'm considering buying 16GB of the same clock speed even though Apple says that it can "support up to 8GB" — .  What about installing 1600MHz in the 16GB variant — will it work? Or will it be clocked down to 1333MHz? When compared to 16GB 1333MHz, will the higher clock speed improve battery life, performance, timings, or what? Why won't Mathematica display an answer? If $a^2$ divides $b^2$, then $a$ divides $b$ Determinant of a $2\times 2$ block matrix I would like to know the proof for:  The determinant of the block matrix $$\begin{pmatrix} A &amp; B\\ C&amp; D\end{pmatrix}$$ equals $$(D-1) \det(A) + \det(A-BC) = (D+1) \det(A) - \det(A+BC)$$ when $A$ is a square matrix, $D$ is a scalar, $C$ is a row vector and $B$ is a column vector.  I appreciate your help. How much time do I have to wait before I can sell another car? I was wondering: How much time does it take until the cooldown resets and I can sell another car in the GTA Online LS Customs Garage? Graph Theory: Tree has at least 2 vertices of degree 1 Git keeps prompting me for a password On Cesàro convergence: If $ x_n \to x $ then $ z_n = \frac{x_1 + \dots +x_n}{n} \to x $ I have this problem I'm working on. Hints are much appreciated (I don't want complete proof):  In a normed vector space, if $ x_n \longrightarrow x $ then  $ z_n = \frac{x_1 + \dots +x_n}{n} \longrightarrow x $   I've been trying adding and subtracting inside the norm... but I don't seem to get anywhere.  Thanks! How do I deal with a runaway bride? I killed my first wife once I found out there is a mercenary you can marry who gives you up to 300 gold a day (in Whiterun). The only requirement, of course, being that I had to hire her first. So I hired her, and then I popped the question, to which she replied the usual: tell the priest to arrange the wedding.   When we reached Riften I told her to wait, just outside the bee and barb, and arranged the wedding. I went through the process, and the second it finished she left, I followed but as I left she was nowhere to be seen. I have tried going back to my house, the pub where I hired her and that same spot in Riften about 6 times each now, some during the day, some during the night and cannot find her at all.   Now this isn't to much of a problem because I can re-marry...oh wait, to remarry, my spouse has to die, so I can't claim gold off her and can't remarry, and the autosaves have been used up fast travelling to the places I thought she might've been. My last save is something like 6 levels ago, and I don't want to have to load it.   What should I do about this situation?