When you make a POST request, you have to encode the data that forms the body of the request in some way. HTML forms provide three methods of encoding. application/x-www-form-urlencoded (the default) multipart/form-data text/plain Work was being done on adding application/json, but that has been abandoned. (Other encodings are possible with HTTP requests generated using other … [Read more...]
How to unmount a busy device
YES!! There is a way to detach a busy device immediately - even if it is busy and cannot be unmounted forcefully. You may cleanup all later: umount -l /PATH/OF/BUSY-DEVICE umount -f /PATH/OF/BUSY-NFS (NETWORK-FILE-SYSTEM) NOTE/CAUTION These commands can disrupt a running process, cause data loss OR corrupt open files. Programs accessing target DEVICE/NFS files may throw … [Read more...]
Why does “pip install” inside Python raise a SyntaxError?
pip is run from the command line, not the Python interpreter. It is a program that installs modules, so you can use them from Python. Once you have installed the module, then you can open the Python shell and do import selenium. The Python shell is not a command line, it is an interactive interpreter. You type Python code into it, not commands. Use the command line, not the … [Read more...]
Kill detached screen session [closed]
"kill" will only kill one screen window. To "kill" the complete session, use quit. Example $ screen -X -S [session # you want to kill] quit For dead sessions use: $ screen -wipe You can kill a detached session which is not responding within the screen session by doing the following. Type screen -list to identify the detached screen session. ~$ screen -list There … [Read more...]
JavaFX – Exception in Application start method? [duplicate]
A simple fix: copy your fxml file/s into the package in which your main method is currently located. Save & re-run. … [Read more...]
What does “SyntaxError: Missing parentheses in call to ‘print'” mean in Python?
This error message means that you are attempting to use Python 3 to follow an example or run a program that uses the Python 2 print statement: print "Hello, World!" The statement above does not work in Python 3. In Python 3 you need to add parentheses around the value to be printed: print("Hello, World!") “SyntaxError: Missing parentheses in call to 'print'” is a new error … [Read more...]
Changing image size in Markdown
You could just use some HTML in your Markdown: Or via style attribute (not supported by GitHub) Or you could use a custom CSS file as described in this answer on Markdown and image alignment ![drawing](drawing.jpg) CSS in another file: img[alt=drawing] { width: 200px; } With certain Markdown implementations (including Mou and Marked 2 (only macOS)) you can append … [Read more...]
Django TemplateDoesNotExist?
First solution: These settings TEMPLATE_DIRS = ( os.path.join(SETTINGS_PATH, 'templates'), ) mean that Django will look at the templates from templates/ directory under your project. Assuming your Django project is located at /usr/lib/python2.5/site-packages/projectname/ then with your settings django will look for the templates under … [Read more...]
How do I force git pull to overwrite everything on every pull?
Really the ideal way to do this is to not use pull at all, but instead fetch and reset: git fetch origin master git reset --hard FETCH_HEAD git clean -df (Altering master to whatever branch you want to be following.) pull is designed around merging changes together in some way, whereas reset is designed around simply making your local copy match a specific commit. You may want … [Read more...]
The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path [duplicate]
Add a runtime first and select project properties. Then check the server name from the 'Runtimes' tab as shown in the image. Include servlet-api-3.1.jar in your dependencies. Maven javax.servlet javax.servlet-api 3.1.0 provided Gradle configurations { provided } sourceSets { main { compileClasspath += configurations.provided } } dependencies { … [Read more...]