file-extension

What is phtml, and when should I use a .phtml extension rather than .php?

谁都会走 提交于 2019-11-27 19:43:18
问题 I'm wondering what the difference between .phtml and .php files is, and when to use one over the other. 回答1: There is usually no difference, as far as page rendering goes. It's a huge facility developer-side, though, when your web project grows bigger. I make use of both in this fashion: .PHP Page doesn't contain view-related code .PHTML Page contains little (if any) data logic and the most part of it is presentation-related 回答2: .phtml was the standard file extension for PHP 2 programs.

How do I restrict access to files with specific extensions in ASP.NET?

梦想的初衷 提交于 2019-11-27 18:01:02
问题 I have in my web application an ADO.NET Entity-Framework *.edmx file. When I browse in the browser (when the application is running) to an edmx file, it doesn't show the error page like when browsing to a *.cs or vb file, it opens the edmx and shows my model scheme to all the users!!! How can I avoid that. 回答1: You can do this two ways; firstly in the web.config or secondly in IIS <system.web> <httpHandlers> <add verb="*" path="*.edmx" type="System.Web.HttpForbiddenHandler" /> </httpHandlers>

How to create my own file extension like .odt or .doc? [closed]

只谈情不闲聊 提交于 2019-11-27 17:19:09
问题 I am working with a document processing project like microsoft word (Academic project). Is there any quick way to create my own extension. Is there any third party library? 回答1: A file extension is just the portion of the file name after the last period. For example in the path: C:\Users\Tests\My Documents\file.txt The file extension is .txt which typically indicates that the file contains text data. To create your own file extension all you need to do is to place the desired extension after

How to filter git diff based on file extensions?

时光总嘲笑我的痴心妄想 提交于 2019-11-27 17:08:52
Is there an option to restrict git diff to a given set of file extensions? Yes, if you ensure that git expands a glob rather than your shell then it will match at any level so something like this (quotes are important) should work fine. git diff -- '*.c' '*.h' sehe Either use your shell's globstar (which does a recursive search) 1 ,2 : shopt -s globstar git diff -- *.py **/*.py or use find: find -name '*.py' -print0 | xargs -0 git diff -- Both of these are special-names and whitespace proof. Although you might want to filter for directories having the .py extension :) 1 I like to do git diff -

Why do Objective-C files use the .m extension?

时光毁灭记忆、已成空白 提交于 2019-11-27 16:54:46
Since I started learning Objective-C and Cocoa, I've been wondering why they have chosen the extension .m for the implementation files - was it supposed to mean something, or was it just a random letter? splattne Today most people would refer to them as "method files", but "The .m extension originally stood for " m essages" when Objective-C was first introduced, referring to a central feature of Objective-C [...]" (from the book " Learn Objective-C on the Mac " by Mark Dalrymple and Scott Knaster, page 9) EDIT: To satisfy an itch I emailed Brad Cox , the inventor of Objective-C, about the

Associate file extension to python script, so that I can open the file by double click, in windows

穿精又带淫゛_ 提交于 2019-11-27 15:34:02
I want to do the following: Save numeric data in a CSV-like formatting, with a ".foo" extension; Associate the ".foo" file extension with some python script, which in turns opens the .foo file, reads its content, and plots something with a plotting library (matplotlib most probably). The use-case would be: double-click the file, and its respective plot pops up right away. I wonder how I should write a python script in order to do that. Besides, the windows "open with" dialog only allows me to choose executables (*.exe). If I choose "fooOpener.py", it doesn't work. This isn't really a

complete list of mime-type <-> file extension mapping

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 15:05:34
I can't find a complete list of mime-type mappings on the internet. I would like to have a list that refers a file extension to every existing mime type. The list of all mime-types can be found here: http://www.iana.org/assignments/media-types but that resource doesn't include the file extension mapping. I googled a while and couldn't find a mapping list with all mime-types. Only lists with most common ones. In all lists I found for example this entry is missing: application/vnd.openxmlformats-officedocument.wordprocessingml.document -> .docx Does someone know a resource where to find a

File extensions and MIME Types in .NET

不羁的心 提交于 2019-11-27 10:31:50
I want to get a MIME Content-Type from a given extension (preferably without accessing the physical file). I have seen some questions about this and the methods described to perform this can be resumed in: Use registry information . Use urlmon.dll's FindMimeFromData . Use IIS information . Roll your own MIME mapping function. Based on this table , for example. I've been using no.1 for some time but I realized that the information provided by the registry is not consistent and depends on the software installed on the machine. Some extensions, like .zip don't use to have a Content-Type specified

JPG vs. JPEG image formats

◇◆丶佛笑我妖孽 提交于 2019-11-27 10:05:15
I often use JPEG images, and I have noticed that there are two very similar file extensions: .jpg , which my mobile's camera and the Preview application use, and .jpeg , with which Image Capture saves the images from scanning with my Canon MX455 printer. LaTeX doesn't seem to distinguish, as I gave it a .jpeg with the extension changed to .jpg and the result seems to be the same as if it had been a .jpg right from the start. I have wondered what the difference between the two is. I have come across this question , and will certainly read through it, though at the moment I'm slightly out of

Convert all file extensions to lower-case

筅森魡賤 提交于 2019-11-27 09:28:37
问题 I'm trying to lower-case all my extensions regardless of what it is. So far, from what I've seen, you have to specify what file extensions you want to convert to lower-case. However, I just want to lower-case everything after the first last dot . in the name. How can I do that in bash ? 回答1: Solution You can solve the task in one line: find . -name '*.*' -exec sh -c ' a=$(echo "$0" | sed -r "s/([^.]*)\$/\L\1/"); [ "$a" != "$0" ] && mv "$0" "$a" ' {} \; Note: this will break for filenames that