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
Is there a function to extract the extension from a filename?
"He acted strange(ly?)" Pixelated image in ps format! Proof of $a^n+b^n$ divisible by $a+b$ when $n$ is odd I read somewhere that     $(a^n - b^n)$         It is always divisible by $a-b$.   When $n$ is even it is also divisible by $a+b$.   When $n$ is odd it is not divisible by $a+b$.      and     $(a^n + b^n)$         It is never divisible by $a-b$.   When $n$ is odd it is divisible by $a+b$.   When $n$ is even it is not divisible by $a+b$.      I wonder what's the proof for this.  First postulate is clear. $(a-b)$ would or would not be a factor. Any light on others? How long does mana from Burning-Tree Emissary stay around? Does mana added to your pool from  get destroyed when the card that added it is destroyed? Custom unique constraint, only enforced if one column has a specific value What is a "DIE" package? In a list of ICs, along with the familiar package names such as QFN32, LQFP48, etc., I've seen a few ICs to be listed as DIE for the package size. I've never seen that description before as an IC package size, and  does not list it either.  What can it be?  I assume it's some kind of chip-scale package, but it does not reveal the silicon size or any other properties, like number of pins, etc. A question in Complex Analysis $\int_0^{2\pi}\log(1-2r\cos x +r^2)\,dx$ My problem is to integrate this expression:  $$\int_0^{2\pi}\log(1-2r\cos x +r^2)dx.$$ where $r$ is any constant in $[0,1]$.  I know the answer is zero. Can you explain you idea to me or just prove that? Maybe you will use the "Cauchy integral theorem ". Is the electromagnetic spectrum discrete? I am having an issue with wifi; it seems when I'm trying Ubuntu without installing, it only detects connection via the ethernet cable.  I can't connect and none of the available wifi networks are detected.  $ lspci 00:00.0 Host bridge: Intel Corporation Device 5904 (rev 02) 00:02.0 VGA compatible controller: Intel Corporation Device 5916 (rev 02) 00:04.0 Signal processing controller: Intel Corporation Skylake Processor Thermal Subsystem (rev 02) 00:08.0 System peripheral: Intel Corporation Sky Lake Gaussian Mixture Model 00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21) 00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21) 00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI (rev 21) 00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21) 00:1c.0 PCI bridge: Intel Corporation Device 9d10 (rev f1) 00:1c.4 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port (rev f1) 00:1c.5 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port (rev f1) 00:1f.0 ISA bridge: Intel Corporation Device 9d4e (rev 21) 00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21) 00:1f.3 Audio device: Intel Corporation Device 9d71 (rev 21) 00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21) 01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330] (rev 83) 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15) 03:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device d723     $ lspci -knn | grep Net -A3 03:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:d723]     DeviceName: Hanksville Gbe Lan Connection     Subsystem: Hewlett-Packard Company Device [103c:8319] Proving or disproving inequality $ \frac{xy}{z} + \frac{yz}{x} + \frac{zx}{y} \ge x + y + z $ When should I use # and = in ASP.NET controls? I have been using ASP.NET for years, but I can never remember when using the # and = are appropriate.  For example:  &lt;%= Grid.ClientID %&gt;   or  &lt;%# Eval("FullName")%&gt;   Can someone explain when each should be used so I can keep it straight in my mind? Is # only used in controls that support databinding? Extending an enum via inheritance I know this rather goes against the idea of enums, but is it possible to extend enums in C#/Java?  I mean "extend" in both the sense of adding new values to an enum, but also in the OO sense of inheriting from an existing enum.    I assume it's not possible in Java, as it only got them fairly recently (Java 5?).  C# seems more forgiving of people that want to do crazy things, though, so I thought it might be possible some way.  Presumably it could be hacked up via reflection (not that you'd every actually use that method)?  I'm not necessarily interested in implementing any given method, it just provoked my curiosity when it occurred to me :-) I have the following sentence:     If T had still been alive, there is the great possibility that either T or C ...   My teacher says that the word "then" must appear after the comma, but I think that it's implied and unnecessary. Who is right? C++ pointer address issue Hosting options for people that have Imgur blocked by their ISP When is it OK to shrink a Database? I know shrink is the devil: It reverses page order and is responsible for skin cancer, data fragmentation, and global warming.  The list goes on... That being said, say I have a 100 GB database and I delete 50 GB of data -- not on one table, but a general pruning of old data on a database wide level, covering 90% of the tables -- does this constitute an appropriate use case for shrinking the database?  If not, what are the appropriate steps to take to clean house after removing such a high percentage of data from a database?  I can think of two: Rebuild Indexes and Update Stats. What else? Same Video on each face, but with different time delay? iam looking for a way to - like the title says - i want to put the same video on each face, but with different time delay.  In other words, i want to create a kind  of videowall.  i found :  #---------------------------------------------------------- # File multi_material.py #---------------------------------------------------------- import bpy  def run(origin):     # Create three materials     red = bpy.data.materials.new('Red')     red.diffuse_color = (1,0,0)     blue = bpy.data.materials.new('Blue')     blue.diffuse_color = (0,0,1)     yellow = bpy.data.materials.new('Yellow')     yellow.diffuse_color = (1,1,0)      # Create mesh and assign materials     bpy.ops.mesh.primitive_uv_sphere_add(         segments = 16,         ring_count = 8,          location=origin)     ob = bpy.context.object     ob.name = 'MultiMatSphere'     me = ob.data     me.materials.append(red)     me.materials.append(blue)     me.materials.append(yellow)      # Assign materials to faces     for f in me.faces:         f.material_index = f.index % 3      # Set left half of sphere smooth, right half flat shading     for f in me.faces:         f.use_smooth = (f.center[0] &lt; 0)  if __name__ == "__main__":     run((0,0,0))   But it didn't really work out for me, it creates a red sphere and sends      Traceback (most recent call last):   File "\Text", line 36, in      File "\Text", line 28, in run AttributeError: 'Mesh' object   has no attribute 'faces' Error: Python script fail, look in the   console for now...   to the console. Also i didn't know how i could add the delay in there.  Hope you can help me out with this! :) Which Distribution Does the Data Point Belong to? Selecting a Textbox Item in a Listbox does not change the selected item of the listbox Is there a word or phrase for something that one might wish exists, but most certainly doesn't?