I want to find the capital letters in a string at any position, I want that if a string consists of capital letters at any position in a string then against that string "1" should be print and if string does not containing any capital letter at any position then "0" should be print against that string. for this i write a python code but it does not work properly  file='C:/Python26/test.txt' f=open('letters.txt','w') pattern='[A-Z+]' with open(file, 'r') as rf:      for word in rf:         for i in word.split():             if word[0].isupper():               ## finding letters starting with uppercase letters                   f.write(word.strip("\n")+"\t"'1'"\n");             elif word.isupper():                ## finding string containing all capital letters                   f.write(word.strip("\n")+"\t"'1'"\n");             elif re.search(pattern, word):      ## finding string containing capital letter at any position                    f.write(word.strip("\n")+"\t"'1'"\n");             else:             f.write(word.strip("\n")+"\t"'0'"\n");     f.close()   my exemplary data is like this     Src     mAB                                                                                                                                                                                                                 32DC32 P50 The activation fan .  NFKappaB  IL23RE cat .  but my out put is like this  Src 1     mAB 1                                                                                                                                                                                                                 32DC32 1 P50 1 The 1 activation 0 fan 0 . 0       1 NFKappaB 1 IL23RE   0 cat      0 . Which produce wrong result. It does not cater the white space and gave the title "1" and because of this nelection the period (.) did not get any label neither of "0" nor of "1"
What is the difference between the search() and match() functions in the ?  I've read the  (), but I never seem to remember it.  I keep having to look it up and re-learn it.  I'm hoping that someone will answer it clearly with examples so that (perhaps) it will stick in my head.  Or at least I'll have a better place to return with my question and it will take less time to re-learn it.
Different voltage sources in parallel I realize connecting two different voltage sources in parallel is a contradiction (in an ideal circuit). But if I were to connect this in practice and measure the voltage across points A and B, what value of voltage would it show? And how much current would be sunk by the 5V battery? (Non ideal conditions) I have a 2x2 experimental design. In the experiment, I also collected the participants' professional qualifications (categorical variable- yes /no). I would like to test the effect of controlling this variable on the MSE. I understand that in ANCOVA, the covariate is either an interval or ordinal variable. So should I refer to the test as an ANCOVA if I include professional qualification as an additional variable? Or should it be a blocking variable since &quot;prof. qualification&quot; is categorical. (Built-in) way in JavaScript to check if a string is a valid number I'm hoping there's something in the same conceptual space as the old VB6 IsNumeric() function? Do the Imperials know they are evil? I am looking for tutorials, articles or books containing theory of  in context of mathematical physics. Please suggest. If I have a double (234.004223), etc., I would like to round this to x significant digits in C#.  So far I can only find ways to round to x decimal places, but this simply removes the precision if there are any 0s in the number.  For example, 0.086 to one decimal place becomes 0.1, but I would like it to stay at 0.08. Query Feature and Usage based entitlements license I need to query programmatically the Feature license and usage-based license which is available in UI. Could someone please highlight if we can query the same or is it available in UI only, Thanks. For example, if the ex-dividend date is next Monday, and I buy the stock on next Monday, would I get the dividend? Or would the person who sold the stock to me get the dividend? Can store bought salmon be used for sashimi? Is it safe to consume raw fish purchased at the fish counter of a typical suburban grocery store? If not, do you have any tips for finding sushi grade fish. Also, are there requirements for safe sushi/sashimi beyond the use of safe fish? 3-manifold examples of homomorphisms between fundamental groups that are not induced by continuous maps Let $X$ be adapted integrand, for which we know that $E[\int_0^T X_s^2 \, ds]&lt; \infty $. Let $0≤s&lt;t≤T$ and we have some $W∈F_s$ ($F_s$ is $\sigma$-algebra) and we know $E[\int_s^t W^2X_u^2 \, du]&lt;\infty$. I have to show  that $\int_s^t W X_u \, dB_u=W \int_s^t X_u dBu$.  I know that for simple integrands this follows from definition. We also know that for $X$ there exists sequence of elementary integrands $X^n$ such that $E[ \int_0^t (X^n_u-X_u)^2 \, du]$ converges to $0$, when $n \to \infty$. From this one can see that it also holds $E[ (\int_0^t (X^n_u-X_u) \, dB_u)^2]$. I wonder if I can show that it  holds $E[ |(\int_s^t W (X^n_u-X_u) \, dB_u)|] \to 0$ as $n \to \infty$ . (I think I should use Cauchy- Schwarz inequality: $E(XY)^2 \leq E(X^2)E(Y^2)$, but not sure where. If I could show this convergence in $L^1$, it would be enough for my proof. If I rewrite it as $E[E[|(\int_s^t W(X^n_u-X_u) \, dB_u)|  \mid F_s]]$ I don't know if I can put $W$ out of integral. Would it be correct? Any help would be really very appreciated. Thanks. How to display quick-updating images without large memory allocation? Does the (relativistic) mass change? Why? How do I set the proper exposure for nighttime moon photos? All my attempts to get a good shot of the full moon with my DSLR result in an overexposed circle on a black background.  I've tried using a tripod, remote shutter release, low ISO, and long exposure, but nothing has worked so far.  What combination of ISO and exposure time that will produce good results?   I particularly want to catch a full moon with the reddish effect when it is close to the horizon. How many irreducible polynomials of degree $n$ exist over $\mathbb{F}_p$? I know that for every $n\in\mathbb{N}$, $n\ge 1$, there exists $p(x)\in\mathbb{F}_p[x]$ s.t. $\deg p(x)=n$ and $p(x)$ is irreducible over $\mathbb{F}_p$.     I am interested in counting how many such $p(x)$ there exist (that is, given $n\in\mathbb{N}$, $n\ge 1$, how many irreducible polynomials of degree $n$ exist over $\mathbb{F}_p$).   I don't have a counting strategy and I don't expect a closed formula, but maybe we can find something like "there exist $X$ irreducible polynomials of degree $n$ where $X$ is the number of...".  What are your thoughts ? One hour Lufthansa transit time in Frankfurt from Bangalore to Dublin Yesterday, I have downloaded and installed Windows 8 Professional, after downloading it (legally) and burning it to a DVD, on my 3-year-old  (Intel Core Duo 2x2.4&nbsp;GHz, 4&nbsp;GB RAM,  hard disk drive).   The installation failed two or three times, each time differently (error codes, for example 0xc000021a, with an infinite boot loop), but finally I completely formatted the hard drive and installed. Seemingly, everything was OK.  However, after booting successfully, the OS is extremely slow. When I open the task manager, it shows that the HDD is at 100% - however, no application or background process or Windows process can be made responsible. I searched the Internet and found that Windows might try to "index" the hard drive, but I did't find a process that isn't also on my second computer, which still uses the Release Preview (restarting every two hours). Also, the startup is empty, and HD Tune and HDD Health show that the drive health is OK, even though I don't know how reliable these two programs are.  I looked for diagnose software from Toshiba, but they only offer tools for "Fujitsu branded Toshiba devices"; I tried it out, and it did not work on my hard drive.  Does this sound like a hard drive failure? The laptop is 3.5-years-old, has been carried around sometimes roughly and was used (and on) most of the time. However, it would have failed exactly the night before installing Windows&nbsp;8 Profesional, which seems - unlikely.  If this is a software error - then what did I do wrong if this occurs from the moment of installation (even the personalization at the end of installation took half an hour)? How can I fix this? find command with regex quantifier e.g. {1,2} I have been trying to create a find command string that will find all files that end with a number 1-99 but exclude all others.  e.g. I want to find myfile1 myfile99 but not myfile456 and not myfilebackup  The regex I'm thinking of is myfile[1-9]{1,2} but I can't get this to work with find.  find . -regex '.*myfile[0-9]{1,2}' OR  find . -iname 'myfile[0-9]{1,2}'  From what I can see it's the {1,2} part that is not working.  (by the way can you use -name -regex interchangably?)  Any help appreciated. What is the sweet spot for experience gain? Is it more effective to fight the highest level enemies I can find, or am I penalized for being out of my depth? Are certain areas of the game better/best for experience gain/leveling? Are bosses better than areas with infinite minions? Would I get exp faster in a higher-level co-op game? What are the most time-effective techniques for rushing/boosting a character (either solo or co-op)? What is the physical explanation for energy transport in simple electrical circuits? Keeping it simple, what is the physics approach to a current in a wire connected to a battery? How does the electric field behave?  I've read somewhere that, contrary to the common conception, electrons don't really flow as water in a hose so, what is really going on there? How is energy transported at the speed of light if electrons don't flow like very fast water?