I have a list of files each named after a camera. In the Finder on a Mac, if I sort them by "Name" the first three are in this order:  1D 5D 10D  However, in another application, the same list of files is sorted like this:  10D 1D 5D  Notice the 10D moved from the bottom to the top of the list. I think this is because the the second app is favoring numbers over letters. It's like because "0" is a number it has a higher placement than "D".  In Python, I have written a script that accepts a folder of files and adds them to a list. But I need the list to be sorted the same way the second app sorts them, not the way the Finder sorts them. I think the solution might have to do with the sorted() function and the key parameter but beyond that I'm not sure what to do.  For those of you who want to see code:  myList = ["1D", "5D", "10D"] sorted(myList, key=theSolutionToMyProblem) print myList &gt;&gt;&gt;["10D", "1D", "5D"]   If I'm way off please tell me. Point me in the right direction.
I'm looking for an algorithm that sorts strings similar to the way files (and folders) are sorted in Windows Explorer. It seems that numeric values in strings are taken into account when sorted which results in something like  name 1, name 2, name 10   instead of  name 1, name 10, name 2   which you get with a regular string comparison.  I was about to start writing this myself but wanted to check if anyone had done this before and was willing to share some code or insights. The way I would approach this would be to add leading zeros to the numeric values in the name before comparing them. This would result in something like  name 00001, name 00010, name 00002   which when sorted with a regular string sort would give me the correct result.  Any ideas?
Are all multiplicative functions additive? (Disclaimer: I've read the  and I do understand that this is bordering on off-topic since it's about consumer devices. However I hope that I've managed to make enough on-topic by asking about why it is the way it is, and what is the explanation from an electromagnetic point of view - in other words, what laws of electricity and what practical considerations have gone into these decisions).  I recently bought a power tool and in its manual I found a few peculiar safety rules. I cannot see why they would be there, although reading up more it seems that they are commonplace. My understanding of electricity is limited (just about enough to be dangerous), so I'm hoping to expand it. :)  The rules are:   Don't use an extension cord longer than 25m. Considering this is an outdoors tool, this limitation is severely restrictive. The best explanation I've seen is that longer cables would simply have too high of a resistance and the tool wouldn't be able to operate at full power. But this argument doesn't convince me. The tool is rated at 2.4kW, and it's meant to be used with 220V AC power source, which means it uses about 11 amps of current. All the extension cords I've ever come across have at least 16A limitation, so there is quite a reserve still. In addition, the power has to travel much, much further to get to my house, and even after the meter it still takes probably close to those same 25m to get to the power outlet. Why only 25m after the outlet? The resistance of the cables isn't that big, is it? Don't daisy-chain extension cords. I suspect this is a variation of the above - don't exceed 25m; every connection adds additional contact resistance; water in the outdoors connections can be a problem - in general, it just adds risk. However, apart from the water in the contacts, the rest seems to me to be practically negligible. Is there really a significant contact resistance? Assuming that the extension cords are in a good shape. Make sure that the power cord is entirely unrolled. This is another odd one. My suspicion is that it has to do with inductive resistance. But is it really that strong? Wherever I've seen people actually wanting to create an electromagnet, it's pretty much hard work. You need a lot of neat, tightly-wound loops of wire. An extension cord has a lot of insulator around it, spacing the wires pretty far apart, and the loops are very chaotic. In addition, if that was a problem, why do  exist? They're used especially when you need a very long extension cord, and you don't need to unroll them completely every time you want to use them. Solved: OK, I was off the mark. The correct answer (also a ) has to do with the wire heating up from being used close to its limits. When coiled together, the temperature can go pretty high and melt the cables. Not fun. Careers should allow me to add external (authored but not owned) GitHub projects under "other" Lie Algebra of U(N) and SO(N) U(N) and SO(N) are quite important groups in physics. I thought I would find this with an easy google search. Apparently NOT! What is the Lie algebra and Lie bracket of the two groups? the problem of using "~\\" and blank line Recently,I found the code that cotains the"~\\" and blank line always shows the warning imformation "Underfull \hbox (badness 10000) in paragraph at lines"  \documentclass{ctexart} \usepackage{color} \usepackage{amsmath} \usepackage{amssymb} \usepackage{graphicx} \usepackage{epstopdf} \hfuzz=\maxdimen   $(A \pm  B)^{-1} \neq A^{-1} \pm B^{-1}$,$(A \pm  B)^* \neq A^* \pm B^*$~\\  $|(A^*)^*|=|A|^{n^2-2 n+1}$~\\  \end {document}   I add the code:  \tolerance=10000 \hbadness=10000 \begin{document}   However,fail to solve it! Is it ok to answer based someone's older answer on SE? Possible Duplicate:             This question will probably be closed in a few minutes. It is a duplicate but I couldn't find the question using with meta search.  Anyway, , . In this case, is vote to close the new question as a possible dublicate not the best choice? Looks to me a little bit not ethical. How to determine capacitance I’m looking to install a capacitor in a circuit which runs at 12V and &lt;10A, and I want it to discharge in about 3 seconds.   The discharge voltage isn’t too important, but it’s probably best if it is as high as possible (not higher than 12V if that is even possible) for those 3 seconds.  The discharge time can be longer but probably should have an absolute minimum of 1.5 seconds.   Sorry if this sounds like gibberish. If I'm not giving enough info, please let me know what else i need to provide. I’m not an electrical guy; just working on a project and have no clue what I'm doing. I have some files/directories on an external hard drive connected using USB to my Windows XP laptop. I am trying to delete those files but every time I try, I get an error "Cannot delete ....: Access Denied. Make sure disk is not full or write protected and that the file is not currently in use".  I checked that the directory is not is use. However, the permissions are set to read-only. Even if I remove the "read-only" checkbox, in Properties->Attributes, it automatically comes back again. How do I fix this? Is it a virus that is automatically changing it back to read-only?  regards,  JP When looking at my objects in 3d view I'm seeing a gray cone that seems to be hiding other objects.   Can anyone help me turn this off and explain what it is please.  Screenshots attached. Why do some questions in question lists have a yellow background? On SO, when I'm scrolling through "questions" some have a yellow background.  Is this intuitive to everyone but me?  What is the yellow background trying to tell me about this particular question? Is a URL allowed to contain a space? Is a URI (specifically an HTTP URL) allowed to contain one or more space characters? If a URL must be encoded, is + just a commonly followed convention, or a legitimate alternative?    In particular, can someone point to an RFC that indicates that a URL with a space must be encoded?  Motivation for question: While beta-testing a web site, I noted that some URLs were constructed with spaces in them. Firefox seemed to do the right thing, which surprised me! But I wanted to be able to point the developers to an RFC so that they would feel the need to fix those URLs. Student missing exam for “medical reasons” Switch command output language from native language to english How can I re install the APT Tool? Fibonacci divisibilty properties $ F_n\mid F_{kn},\,$ $\, \gcd(F_n,F_m) = F_{\gcd(n,m)}$ Can any one give a generalization of the following properties in a single proof? I have checked the results, which I have given below by trial and error method. I am looking for a general proof, which will cover the all my results below:   Every third Fibonacci number is even. 3 divides every 4th Fibonacci number. 5 divides every 5th Fibonacci number. 4 divides every 6th Fibonacci number. 13 divides every 7th Fibonacci number. 7 divides every 8th Fibonacci number. 17 divides every 9th Fibonacci number. 11 divides every 10th Fibonacci number. 6, 9, 12 and 16 divides every 12th Fibonacci number. 29 divides every 14th Fibonacci number. 10 and 61 divides every 15th Fibonacci number. 15 divides every 20th Fibonacci number. I was wondering why a laser beam diverges. If all the photons are in the same direction, I would imagine that it would stay that way over a long distance. I am aware that a perfectly collimated beam with no divergence cannot be created due to diffraction, but I am looking for an explanation based on  photons rather than wave physics. Where does Minecraft for Windows 10 store its data? I have searched in %appdata%, pulling up the list of files there, but there is no file labelled .minecraft. Searching %appdata%\.minecraft returns "no results found".   I also opened Minecraft to click on the resources button and could not locate that either. HD bad blocks: is there a way to repair them? How to stop an animation in C# / WPF? I have something like this:   barProgress.BeginAnimation(RangeBase.ValueProperty, new DoubleAnimation(     barProgress.Value, dNextProgressValue,     new Duration(TimeSpan.FromSeconds(dDuration)));   Now, how would you stop that animation (the DoubleAnimation)? The reason I want to do this, is because I would like to start new animations (this seems to work, but it's hard to tell) and eventually stop the last animation... Ought we only form beliefs based on sufficient empirical evidence? In , John Loftus often makes statements like:  Faith, as I argue, is an irrational leap over the probabilities. Probabilities about such a matter are all that matter. We should think exclusively in terms of them. (19) If God created us as reasonable people, then the correct religious faith should have sufficient evidence for it, since that’s what reasonable people require. (22) Because science is the only game in town. It works. It produces the goods. There isn’t a better alternative. (119)  Loftus' attitude seems representative among many atheists; while I'm aware that there are other views, it is this kind of view which leads to the title of this question: Ought we only form beliefs based on sufficient empirical evidence? Here are some sub-questions which may help guide answers:  How can we get an ought from an is, given that evidence only describes what is? Reformulating the title as a hypothetical imperative doesn't seem to help, because the scientific method doesn't seem to ever make a hypothetical imperative binding. And yet, surely those who would agree with the quoted text would find certain hypothetical imperatives binding?  Given that the scientific method includes &quot;basic arithmetical truths and also certain truths about formal provability&quot;,  seems to apply: a given axiomatic formulation of the scientific method will be unable to imply certain (virtually all, it turns out) truths. To say that science is complete—there are no other methods of knowing things—seems to imply that science is inconsistent. Is this 'seems' an illusion?  Does the scientific method require that we make observations prior to forming hypotheses? It could be argued that probabilistically, trying to come up with hypotheses before making a 'sufficient' number of observations will result in a failed hypothesis too much of the time. Is there evidence to support this which can probabilistically rule out all other kinds of hypothesis-forming?  Must we accept any unfalsifiable claims? The answer seems to be 'yes', given e.g. the example of crystal structure discussed by Michael Polanyi in  (43-48, 1984 paperback). A set of geometries seemed to well-describe many crystals found in nature, and even if some crystals aren't well-described, that doesn't falsify the instances in which it does. This opens up the question of which unfalsifiable claims we ought to accept.  If we model human reasoning as , we can ask what is meant by 'sufficient' by what the 'probabilities' are, prior to any observations: what  ought we start with? I am tempted to say &quot;the most effective one&quot;, but that presupposes a purpose; are we given an objective purpose?   I am left with the suspicion that one ought to only follow the scientific method to the extent that one only wants to predict one's future observations—this smells like a tautology. It seems to beg the question to say that the most important area of 'truth' is objective reality, a question which cannot be answered with the scientific method. A 'yes' answer to the main question would seem to fall prey to something like  of .  I was tempted to phrase my question as:  Is science the only source of truth?  I believe this is a bad question, for a few reasons:  We care about whether a method can reliably arrive at truth/knowledge. The terms 'truth' and 'knowledge' would possibly stir a debate about , which may not be a prerequisite for the answer to my question. My question makes explicit that we are talking about what one ought to do, which is not explicit in the above formulation.