How to get only the name of the path with python? I have the following string :   a = "/home/user/Downloads/repo/test.txt"   My goal is just to create a string which contains only test, hwo can I do this ?  actually a comes from   f = tkFileDialog.asksaveasfile(mode='w', defaultextension=".txt")   and a is equal to a = f.name  but I realized f.name does not give me just the name of the file.
How to get the filename without the extension from a path in Python? How to get the filename without the extension from a path in Python? For instance, if I had &quot;/path/to/some/file.txt&quot;, I would want &quot;file&quot;.
Where can I find the application executables in the filesystem? What is the connection between regularization and the method of lagrange multipliers ? To prevent overfitting people people add a regularization term (proportional to the squared sum of the parameters of the model) with a regularization parameter $\lambda$ to the cost function of linear regression. Is this parameter $\lambda$ the same as a lagrange multiplier? So is regularization the same as the method of lagrange multiplier? Or how are these methods connected? There has been some recent behavior change on SE (around July 2015).  I have two accounts I use, one Google openId based for one set of sites (call it Account-A) and another SE login based for a different set of sites (Account-B).  Used to be that I could be logged into one set of sites with the first user and a different set with the other users.    But now I am logged in with the Account-A on Site-1.  When I go to one of the sites I use the other account for and click "log in" under the SE menu, I go to a page where I only have an option to confirm creation of an account based on my Google login.  It does not present a way to log in with an SE account.    How can I log in with my other account here?  (and before you flag this as a duplicate, please ensure the other question is recent enough and that the answer is relevant.  This behavior has definitely morphed over the years... and I am having trouble finding something that is relevant.  For instance this question  simply points out how to merge the accounts which is NOT what I want  .  This question  talks about presenting different user info on each site but that's not what I want -- I want totally separate accounts). Most people with a degree in CS will certainly know what . It helps us to measure how well an algorithm scales.   But I'm curious, how do you calculate or approximate the complexity of your algorithms? Proof that the real numbers are countable: Help with why this is wrong I was just thinking about this recently, and I thought of a possible bijection between the natural numbers and the real numbers.  First, take the numbers between zero and one, exclusive.  The following sequence of real numbers is suggested so that we have bijection.    0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.01, 0.02, ... , 0.09, 0.10, 0.11, ... , 0.99, 0.001, 0.002, ... , 0.999, 0.0001, etc.  Obviously, this includes repeats, but this set is countable.  Therefore, the set of all numbers between zero and one is a subset of the above countable set, and is thus countable.  Then we simply extend this to all real numbers and all the whole numbers themselves, and since the real numbers, as demonstrated above, between any two whole numbers is countable, the real numbers are the union of countably many countable sets, and thus the real numbers are countable.    Please help me with this.  I understand the diagonalization argument by Cantor, but I am curious specifically about this proof which I thought of and its strengths and flaws.  Thanks. Unable to change payment information to NONE in iOS Appstore Subscript labels in QGIS legends Is it possible to include subscript and superscript text in the title of a legend item in QGIS ?  I have tried using &lt;sub&gt;some text&lt;/sub&gt; but this just appears in the title with no change to the contents.  I am looking to have layer titles such as   Annual NO2 concentration (μg/m3)  The superscript is not a big issue, as I can use the character map to get a 3, but I don't know how to get the subscript. U.s. boiler / Burnham boiler alterations i have a 203ncl-tei2 boiler installed in danvers Massachusetts. Regular elevation. This boiler also has a failed tejurland (universal control) powerventer motor on it that is only humming, not spinning. Looked for a dead animal, or nest and checked for free spinning of the squirrel cage it was fine. Its installed 3 feet from outside wall on the verticle, (installed wrong also has 2 seperate 90° bends after the venter, not my issue but may have caused the motor to fail). Ontop of the boiler we have a factory automatic damper assy.   So the 2nd part of the problem is I noticed the tei in the model number and assumed this ment i should expect to see a tejurland "universal" power venter installed and i do. I assume because its a universal control unit thats where they went wrong. This unit is atleast 200$ cheaper here than the model burnham uses.  I call burnham and ask what the original power venter model number is and they tell me what some pros may already know, (i didnt), that the tei2 is actually (t)taco, (el)elivation, (2) 2 is 2,000 ft  .Note:he was not.100% sure about the el. He was definetly sure PV would be in the model number and it was not tejurland. There is no chimney on this house, never was. Power venter wall thimble outside is very old definetly older than the 1 year old motor that failed. Burnham also said this is not a boiler that can be converted to a powerventer which is sometging i do not understand. He said if it does not have pv in the model number it should not have one. I have in the past converted a boiler with a factory reccomended power venter after a customer lost the chimney. I called and got lucky they had a option for it. I do not remember manufacturer but do remember also seeing it in the install manual as an addendum or seperate manual.  Is this a fact?   Anyone have experience with this?   What are the ramifications of an elevated boiler installed at sea level?   If i can not find another awnser, i will havemto tell customer they need a new boiler or i will have to walk away.   Why do they not just make an orifice kit for elevated boilers to work properly at higher elevations? Is it because they have to add another section to the boiler so it can put out the same  b.t.u.?  I know there is a reason. Seems like smaller orifice would fix the air fuel ratio along with a regulator adjustment. Its to simple of an awnser knowing that manufacturers make a complete different boiler for higher elevations.   ! We know that $2^4 = 4^2$ and $(-2)^{-4} = (-4)^{-2}$. Is there another pair of integers $x, y$ ($x\neq y$) which satisfies the equality $x^y = y^x$? Is it possible to open directories as administrator? I want to have a root privileges on some directories. How can I do this? Why do Kurama and Gyuki appear as chakra while other bijuu don't? In Naruto, Kurama (the Nine-tailed bijuu) appears as chakra, as does Killer B's bijuu, Gyuki.      Other bijuu, however, don't appear that way. What is different between them? "Arnold raced out of the door": grammatical or not? Draw power from a portable mobile charger to power circuits What happens to folks who get question banned, by and large? There is a steady stream of duplicates of  coming in lately. It's got me wondering. Roughly speaking, out of say 100 folks who get this ban, how many    wander away and never interact with SO again?   do the sorts of things that might lift a ban, but don't get it lifted? do the sorts of things they should, and lift the ban? post a question of their own on Meta which we close as a dupe?   Among the continue-to-interact folks, is there a difference in success rate between those who post on Meta about it (motivated, but not good rules-readers, who nonetheless get customized advice) and those who do not (better rules readers, but working to some extent blind) - which do better?  Is there a reasonable chance of recovering from a ban, assuming you care enough to try? "Needs cleaned" or "needs to be cleaned" I am running centos 5.8 with cpanel. Lately I am getting reports that my swap is full , but there is a lot of free memory  to use.  top - 10:33:43 up 133 days, 17:00,  1 user,  load average: 0.05, 0.03, 0.05   Tasks: 170 total,   1 running, 169 sleeping,   0 stopped,   0 zombie   Cpu(s):  2.1%us,  0.5%sy,  0.0%ni, 97.2%id,  0.0%wa,  0.0%hi,  0.2%si,  0.0%st   Mem:  24726100k total,  8255368k used, 16470732k free,   599560k buffers   Swap:  1046520k total,   984740k used,    61780k free,  3641828k cached     How do I solve this? The unused ram memory should be used instead of the swap. Or should I increase the swap ( and how do I do that ? ).  Thanks Restore SQL Server 2012 backup to a SQL Server 2008 database? Why is the network configuration I set in /etc/network/interfaces ignored on Ubuntu 17.10? Singular or plural verb after parenthetical material containing a conjunction? I would tend to say     Sara (and all of us) have a lot to think about now.   ...but it occurs to me that if I remove the parenthetical it's clearly incorrect. Is it proper to say     Sara (and all of us) has a lot to think about now.   ...that sounds really strange to my ear.  Also, does it change the rules in any way if I use an em dash, e.g.     Sara–and all of us–have a lot to think about now. Eigenvectors of real symmetric matrices are orthogonal Can someone point me to a paper, or show here, why symmetric matrices have orthogonal eigenvectors? In particular, I'd like to see proof that for a symmetric matrix $A$ there exists decomposition $A = Q\Lambda Q^{-1} = Q\Lambda Q^{T}$ where $\Lambda$ is diagonal.