PHP provides support for the HTTP PUT method used by some clients to store files on a server. PUT requests are much simpler than a file upload using POST requests and they look something like this:
PUT /path/filename.html HTTP/1.1
Into your PHP code you would then do something like this:
<?p...
Python programs can read from unix pipelines. Here is a simple example how to read from stdin:
import sys
for line in sys.stdin:
print(line)
Be aware that sys.stdin is a stream. It means that the for-loop will only terminate when the stream has ended.
You can now pipe the output of anot...
Consider the following three equations:
x0 + 2 * x1 + x2 = 4
x1 + x2 = 3
x0 + x2 = 5
We can express this system as a matrix equation A * x = b with:
A = np.array([[1, 2, 1],
[0, 1, 1],
[1, 0, 1]])
b = np.array([4, 3, 5])
Then, use np.linalg....
The current frame rate (in FPS, Frames Per Second) and total number of SKNodes in the scene (nodeCount, each sprite is an SKNode but other objects in the scene are also SKNodes) can be shown in the bottom right hand corner of the view.
These can be useful when turned on (set to true) for debugging ...
An SKView does not need to fill the whole screen and can share space with other UI controls. You can even have more than one SKView displayed at once if you wish.
To create a smaller SKView amongst other controls with Interface Builder, first create a normal ViewController, then drag and drop a new...
A try-finally block may be nested inside a try-except block.
try
AcquireResources;
try
UseResource;
finally
ReleaseResource;
end;
except
on E: EResourceUsageError do begin
HandleResourceErrors;
end;
end;
If an exception occurs inside UseResource, then execution...
A try-except block may be nested inside a try-finally block.
AcquireResource;
try
UseResource1;
try
UseResource2;
except
on E: EResourceUsageError do begin
HandleResourceErrors;
end;
end;
UseResource3;
finally
ReleaseResource;
end;
If an EResourceUsageE...
In Tcl itself, a string consisting of a single word does not need to be quoted. In the language of expression strings that expr evaluates, all operands must have an identifiable type.
Numeric operands are written without any decoration:
expr {455682 / 1.96e4}
So are boolean constants:
expr {tr...
In order to print the value of a variable such as,
set tempVar "This is a string."
The argument in the puts statement is preceded by a $ sign, which tells Tcl to use the value of the variable.
% set tempVar "This is a string."
This is a string.
% puts $tempVar
This is a s...
The tr method returns a copy of a string where the characters of the first argument are replaced by the characters of the second argument.
"string".tr('r', 'l') # => "stling"
To replace only the first occurrence of a pattern with with another expression use the sub method
...
We can use org.apache.commons.lang3.RandomUtils to generate random numbers using a single line.
int x = RandomUtils.nextInt(1, 1000);
The method nextInt(int startInclusive, int endExclusive) takes a range.
Apart from int, we can generate random long, double, float and bytes using this class.
R...
What happens if I don't set base_url ?
You will not get any Impotency error to set this and proceed. You can continue without setting, but you should know about HTTP header injection
If I did't set it what will show up?
You will get http://[::1]/ instead of your actual URL.
What does this m...
Any project that targets netstandard1.X can be packed into a NuGet package by running:
dotnet pack
The resulting package can be uploaded to NuGet, MyGet, or hosted in a local package source.
This example describes how to create a SurfaceView with a dedicated drawing thread.
This implementation also handles edge cases such as manufacture specific issues as well as starting/stopping the thread to save cpu time.
import android.content.Context;
import android.graphics.Canvas;
import and...
One Button
Swift
class ViewController: UIViewController {
@IBAction func showAlertButtonTapped(sender: UIButton) {
// create the alert
let alert = UIAlertController(title: "My Title", message: "This is my message.", preferredStyle: UIAlertCo...
If you want to write strings containing other languages (JSON, regexes), it's hard to keep up with escaping symbols, and it would be nice to get some code assist.
Put your cursor inside an empty string
ALT + ENTER
Pick "Inect language or reference"
Pick the desirable language (...
Front matter tells Jekyll to parse a file. You add predefined variables, which are YAML sets, to the front matter. Then, you can use Liquid tags in your files to access the front matter.
Front matter is indicated with two triple-dashed lines. You must place the variables between the two triple-dash...
When using clustered index, the rows of the table are sorted by the column to which the clustered index is applied. Therefore, there can be only one clustered index on the table because you can't order the table by two different columns.
Generally, it is best to use clustered index when performing ...
Nonclustered indexes are stored separately from the table. Each index in this structure contains a pointer to the row in the table which it represents.
This pointers are called a row locators. The structure of the row locator depends on whether the data pages are stored in a heap or a clustered tab...
Go to the GitHub page for the project where you want to create an issue.
Click on Issues .
On the top right, click on New Issue.
Enter the title of the issue.
Enter the body of the issue (including logs, code snippets, etc.)
Optional: To view the issue before submitting it, click on preview.
...