how do I get the type of the file in flask? I have to differenciate between two types of files (RIS-file and bibTex file).  I know how to get the complete filename (example: uploadedfilename = file.filename). But I need to get only the type of the file and my current code only gives me something like this: "uploadedfilename: test.ris".  Is there a way to get only the file type so that I could do something like this:  if(filetype=="ris"):       do some stuff?  Thanks for your help
Extracting extension from filename in Python Is there a function to extract the extension from a filename?
Is there any software package to solve the linear regression with the objective of minimizing the L-infinity norm. How to get exact camera view? I'm currently a beginner when it comes to 3D modelling but doing okay so far. I'm struggling a bit when it comes to the final renders of my scene, specifically on the camera view I want. Sometimes its to zoomed in and sometimes to zoomed out that it's gone out of the environment of the blender. I realized the settings for the camera on blender are for actual cameras / photography and I'm no expert on that too. A tip on how to control them precisely would be nice. Thank you. Subscribing to questions and comments that don't belong to you "Install alongside" option missing. How do I install Ubuntu beside Windows using "Something Else"? Whenever I startup from the LinuxLive USB, and try to install Ubuntu 12.04, it only gives me two options instead of the usual 3 or 4. My options are "Replace Windows 7 with Ubuntu" and "Something Else". Whenever I go into "Something else", it looks extremely confusing. How do I install it side-by-side while using the "Something else" section? These are my partitions.   /dev/sda /dev/sda1 ntfs (104Mb, System Required Partition) /dev/sda2 ntfs (1000097Mb, Windows 7 Partition)   Or should I try reinstalling my installer on a CD rather than USB and maybe then it will have the "Install alongside" function? . While the reasons for his doing this are not yet public, this is a real loss of a valuable service. Does anyone know of similar services available to the general public?  Edit:  is definitely relevant, but that approach is more appropriate for finding top journals rather than identifying bottom ones. I.e., following that method would probably exclude lots of valid, lower-tier journals. Are there any approaches to easily identifying a predatory publisher? The program ed, a minimal text editor, cannot be exited by sending it an interrupt through using Ctrl-C, instead printing the error message "?" to the console.  Why doesn't ed just exit when it receives the interrupt?  Surely there's no reason why a cryptic error message is more useful here than just exiting.  This behavior leads many new users into the following sort of interaction:   $ ed hello ? help ? exit ? quit ? ^C ? ^C ? ? ? ^D $ su # rm -f /bin/ed    Such a tragic waste—easily avoidable if ed simply agreed to be interrupted.  Another stubborn program exhibiting similar behavior is less which also doesn't appear to have much reason to ignore C-c.  Why don't these programs just take a hint? Attribute editing in QGIS on geoJson file We have vector files in the format of geoJson files. We need to keep it in geoJson format as it is picked up by mobile devices via Restful services.  The problem is we want to change the attributes of the features in QGIS but it seems like this is not possible. We don't have to add or remove columns. We simply need to edit the existing data.  Is there a work around for this?  Are there any plugins that I can download that will allow me to do this in QGIS? Fix SD card that cannot be formatted I'm studying for qualifying exams and ran into this problem.  Show that if $\{a_n\}$ is a nonincreasing sequence of positive real numbers such that $\sum_n a_n$ converges, then $\lim_{n \rightarrow \infty} n a_n = 0$.  Using the definition of the limit, this is equivalent to showing \begin{equation} \forall \varepsilon &gt; 0 \; \exists n_0 \text{ such that } |n a_n| &lt; \varepsilon \; \forall n &gt; n_0 \end{equation} or \begin{equation} \forall \varepsilon &gt; 0 \; \exists n_0 \text{ such that } a_n &lt; \frac{\varepsilon}{n} \; \forall n &gt; n_0 \end{equation} Basically, the terms must be bounded by the harmonic series. Thanks, I'm really stuck on this seemingly simple problem! REST Service API executor.executeAsync Call Ends in Failure Function in Sharepoint Hosted App Any Answers Will Help me to Forward and Gain Knowledge in SharePoint Development  While i am Trying to get the list Items Using Rest API Calls in SharePoint Hosted App Using Below Function  function loadingSamples()  {     var JobListName = "RRR Jobs #";     var executor;     // Initialize the RequestExecutor with the app web URL.     executor = new SP.RequestExecutor("/");      //Fetching the choice values from the Job Status Field, to show in the Dropdown field     executor.executeAsync     ({         url: "/_api/web/lists/getbytitle('" + encodeURIComponent(JobListName) + "')/fields/getbytitle('Job Status')?$select=Choices",         method: "GET",         headers: { "Accept": "application/json; odata=verbose" },         success: successHandlerStatus,         error: errorHandler     }); } function successHandlerStatus(data)  {     alert("sucesss") }  function errorHandler(data, errorCode, errorMessage)  {     alert("errorMessage") }   It's always going to error function named errorHandler With  Error Code as -1002 and Error Message as Bad Request and Inside Data -> Body , the Error message is  {     "error":{            "code":"-1,Microsoft.SharePoint.Client.InvalidClientQueryException",         "message":{             "lang":"en-US",             "value":"The expression \"web/lists/getbytitle('DWR Jobs \" is not valid."         }     } }   Note :    This is working code in Sharepoint Hosted App that previously hosted in another Windows server. Now i hosted this App in New windows server,it's successfully hosted but it gives above mentioned Error in Rest Service Call. Flagging summary improvement: filters SSH welcome message on 17.04 shows notice about 12.04 I just did a do-release-upgrade going from Ubuntu 16.04 to 17.04. However, now when I login via SSH I have the following message   Welcome to Ubuntu 17.04 (GNU/Linux 4.10.0-20-generic x86_64)   * Documentation:  https://help.ubuntu.com  * Management:     https://landscape.canonical.com  * Support:        https://ubuntu.com/advantage  Ubuntu 12.04 LTS end-of-life was April 28, 2017 -- Upgrade your Precise systems!  $ sudo do-release-upgrade -m server  0 packages can be updated. 0 updates are security updates.   My question is, how can I remove the   Ubuntu 12.04 LTS end-of-life was April 28, 2017 -- Upgrade your Precise systems!  $ sudo do-release-upgrade -m server   it wasn't there prior the release-upgrade  I checked and I am on Zesty  lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 17.04 Release:    17.04 Codename:   zesty   My question is not, how can I remove this message, this I found. My question is more, is there a reason why this appears after a release-upgrade? Is this message something generic not taking into consideration the current version of Ubuntu? Or maybe my system is not updated properly? Is there a way in Adobe Creative Suite to "share palettes/swatches" across programs? I use a mixture of InDesign, Photoshop and Illustrator to produce the vast amount of printed media I design at my current position and I find myself faced with copy/pasting color values from one program to another almost all the time, I have tried to find a quicker way but have been unsuccessful. I use a program called  to copy and store my most used colors, but still, it's not the same as being able to select it from the swatches palette in Adobe CS.  So the main meat of the question is:   Can I share my colors/swatches between InDesign, Photoshop and Illustrator and if so, how? Sorry to start a subjective question, but want to understand "own.sty" file.  Other than all \usepackage{} what sort of other commands can be added to the makeyourown.sty file.  Can you include \let command, and \newcommands in it.   What sort of precaution / structure newbies should follow. Simple Math Problem A bat and ball cost \$1.10.  The bat costs a dollar more then the ball.  How much does the ball cost?  If this is not the correct place to ask a question like this please tell me and I will remove it :)     The ball costs \$0.05, not \$0.10 Here is my attempt to prove the Well-Ordering Principle, i.e. that any non-empty subset of $\Bbb N$, the set of natural numbers, has a minimum element.  Proof. Suppose there exists a non-empty subset $S$ of $\Bbb N$ such that $S$ has NO minimum element. Define $A = \left\{n\in \Bbb N : (\forall s\in S)(n \leq s)\right\}$. It is obvious that $1\in A$. Suppose $n\in A$, then for each $s \in S$, there exists $q \in N$ such that $n + q = s$. Since $q \ge 1$, $n+1 \leq s$, for all $s\in S$. By Principle of mathematical induction, $A = \Bbb N$. Take any $s_0 ∈ S$, then $(\forall s\in S)(s_0 \leq s)$. (This contradicts that $S$ has no minimum element).  How do I prove the statement without invoking Mathematical Induction? Also, I read that the proof of Principle of Mathematical Induction makes use of Well-Ordering. Can it be proven independently of Well-Ordering too? How do I write a URL in Markdown on Stack Exchange? If/When to move to secondary fermentation Digression from   What are the good rules of thumb for determining a. whether to use secondary fermentation at all and b. when to move from primary to secondary.  Preferably any rule of thumb should have both chemical and anecdotal rationale supporting it. Find a circle's radius with three known tangent lines I need to find the equation for a circle (mainly its radius) which is tangent to the following three lines:  $y = 0$  $y = \tan(70)x$  $y = -1.428148x + 0.790201$  For the last tangent line equation, I know that it is tangent at the point $(0.371272, 0.259968)$ However, for the other two I do not know the exact point of tangency, only that the circle is tangent to them. In Ubuntu ISO MBR, why does a GPT partition overlap the boot partition, and make MBR uneditable?