How to format on save on a file with no changes in JetBrains IDE? - phpstorm

If I change a file and press Ctrl + S, PhpStorm formats and saves file normally. However, if there's a file with no changes and I hit Ctrl + S then the code is not formatted.
How do I format on save even if there's 0 changes in a file?

You can reformat a file with ⌥ + ⌘ + L on a Mac or Ctrl + Alt + L on Windows.
Documentation: https://www.jetbrains.com/help/phpstorm/reformat-and-rearrange-code.html

Related

Python 3.9 Download and Save HTML - File is garbled

I have a simple Python script that successfully retrieves a web page and saves the web page as an .html on my local pc. When I open the local .html file, regardless of URL/web site, the file contains garbage. This seems like an encoding problem or a binary-to-text problem but not sure how to fix it?
cache = scrape_cache_dir + 'cache_' + symbol + '_' + cachetime + '.html'
try:
response = urlopen(URL_TARGET)
except urllib.error.HTTPError as err:
print(err.code)
html_doc = response.read()
fh = open(cache,'w')
fh.write(str(html_doc))
fh.close()
Here is a sampling of the resulting file that was saved
b'\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x00\xec\xbd\xebv\xdbF\xb20\xfa\x7f\x9e\x02bb\x9b\xdc& \xdcy3\xed\x91%9\xf6\x8cd\xe9\x93\x94xg\xbc\xbd\xb9#\x00\x14\x11\x83\x00\x03\x80\xbaX\xe1\xb7\xcek\x9c\xd7;Or\xaa\xaa\x1b n\x94(Y\xcexf\xcd8#\x02\x8d\xbeVU\xd7\xa5\xbb\xab\xfa\xc5\xd6\xde\xd1\xee\xd9\xaf\xc7\xfb\xc24\x99\xf9/\xe0\xc1s\x86\r+\tg\x9e\xdd\x10l\xdf\x8a\xe3a\xe3}\xf8\xb7X\xb0\xa7Q8s\x05\xc7\x8d?'\xe1\\x98X\x9e\x1f[\x13\xb7!\xf8Vp>l\xb8\x81\xf8\xf3i\x03\xeap-G\x98G\xee\xc4\xbb\x1a6\xc2\xf3>T\x9d\xcc\xfb\xdb\xdb\xe1\xf9\\x9a\xb9\xdbA\xfc\x03d\x8a\xed\xc8\x9b'//\xbd\xc0\t/\xa5\xb9\x1bM\xc2hf\x05\xb6+

How to create a new html file in windows 10?

I want to create a file called "home.html". Since i am using windows, i tried to first create a text file and then rename it to home.html. But after doing so, when i right click and check the properties of home.html, it shows "Type of file" - text(.txt). I want to create a file with html extension. Kindly help me. I am new to html
The file is renamed home.html.txt because by default the file extension is hidden on windows.
You must start by displaying the extension of the files to rename them correctly.
if you use windows 8,10,11
1. Open File Explorer (open any folder).
2. Click the View tab.
3. Select "File name extensions."
4. Optionally, you can enable Hidden items.
5. File extensions will now be visible.
If you use windows 7
1. In the Start menu search, type folder options.
2. In the Folder Options window, click the View tab.
3. Remove the check from "Hide extensions for known file types."
4. Click OK.
SOURCE : https://knowledge.autodesk.com
You can create that file using CMD,
Open CMD
Tape the following command in the location you want to create the file
type nul > file.html
Had same issue . What you need to do is that you gonna go to your editor be it NotePad or Sublime . Press ctrl N for a new page and Ctrl S to save the file and you will need to choose your file type to be html
In the desktop window of your PC create a new folder ( with any name) double click on the folder to enter, then right click and create a new txt file. After creating a txt file, right click on it, then select rename and change the .txt to .html to make it a HTML file.
You need to open notepad on your PC and write your HTML code.
Then go in 'File', 'Save as',write the file name with the .html example: name.html.
Now change .txt to 'all files'.

Internet explorer 11 file download rename file name

Anyone knows why IE11 is renaming my file name that has ’ whenever I download it?
Could it be some character encoding settings?
Attached picture displays the problem. The original file name I save as was Test’s.pdf
I manage to resolve it!
Discovered the bug in my response header as my file name requires encoding
I changed
context.Response.AddHeader("Content-Disposition", "inline;attachment; filename=\"" + fileName + "\"");
to
context.Response.AddHeader("Content-Disposition", string.Format("attachment; filename*=UTF-8''{0}", HttpUtility.UrlPathEncode(fileName)));

Editor with Maths functions . generating file

I am using math editor in web page. but it's generating jpeg file. not able to write in doc or other file . there is any change in javascipt file or php file
I was able to copy and paste the text from wiris into word and modify the equation in word. I wouldn't download the file as an image. Just copy and paste it into word.

Converting from .asm to .s file (Windows/Intel)

For my homework, I had to write a MIPS program. I'm on windows/intel machine and used notepad++ to write it, which doesn't have the functionality to save the file using a .s extension. Is there any way to save the file as a .s using windows?
On the Save As dialog, switch the "Save as type:" drop-down from "Text Documents (*.txt)" to "All Documents (*.*)" and type the full name of your file (e.g. "myfile.s").