Sometimes you may only need to simulate an event with two outcomes, maybe with different probabilities, but you may find yourself in a situation that calls for many possible outcomes with different probabilities. Let's imagine you want to simulate an event that has six equally probable outcomes. T...
Consider a production table called questions_mysql and a table iwtQuestions (imported worktable) representing the last batch of imported CSV data from a LOAD DATA INFILE. The worktable is truncated before the import, the data is imported, and that process is not shown here.
Update our production da...
9 Patches are stretchable images in which the areas which can be stretched are defined by black markers on a transparent border.
There is a great tutorial here.
Despite being so old, it's still so valuable and it helped many of us to deeply understand the 9 patch gear.
Unfortunately, recently tha...
This example demonstrates creating a basic application in ExtJS using Sencha Cmd to bootstrap the process - this method will automatically generate some code and a skeleton structure for the project.
Open a console window and change the working directory to an appropriate space in which to work. ...
A While loop starts by evaluating a condition. If it is true, the body of the loop is executed. After the body of the loop is executed, the While condition is evaluated again to determine whether to re-execute the body.
Dim iteration As Integer = 1
While iteration <= 10
Console.Writeline(ite...
A package.json file, usually present in the project root, contains metadata about your app or module as well as the list of dependencies to install from npm when running npm install.
To initialize a package.json type npm init in your command prompt.
To create a package.json with default values use...
Any time you instantiate a class that Implements IDisposable, you should call .Dispose1 on that class when you have finished using it. This allows the class to clean up any managed or unmanaged dependencies that it may be using. Not doing this could cause a memory leak.
The Using keyword ensures th...
A slider control uses draggable handles to select numeric values. Below is an example of a basic slider initialization:
<script>
$(function() {
$( "#slider" ).slider();
});
</script>
<div id="slider"></div>
The @Header and @Body annotations can be placed into the method signatures and Retrofit will automatically create them based on your models.
public interface MyService {
@POST("authentication/user")
Call<AuthenticationResponse> authenticateUser(@Body AuthenticationReques...
The background-origin property specifies where the background image is positioned.
Note: If the background-attachment property is set to fixed, this property has no effect.
Default value: padding-box
Possible values:
padding-box - The position is relative to the padding box
border-box - The p...
Definition and Usage: The background-clip property specifies the painting area of the background.
Default value: border-box
Values
border-box is the default value. This allows the background to extend all the way to the outside edge of the element's border.
padding-box clips the background at ...
When you need to set a pixel value for something like Paint.setTextSize but still want it be scaled based on the device, you can convert dp and sp values.
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();
float pixels = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 12f, m...
One should have in mind that:
Angular's data binding relies on JavaScript’s prototypal inheritance, thus it's subject to variable shadowing.
A child scope normally prototypically inherits from its parent scope. One exception to this rule is a directive which has an isolated scope as it doesn't p...
COPY has two forms:
COPY <src>... <dest>
COPY ["<src>",... "<dest>"] (this form is required for paths containing whitespace)
The COPY instruction copies new files or directories from <src> and adds them to the filesystem of the container at the ...
EXPOSE <port> [<port>...]
The EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime. EXPOSE does NOT make the ports of the container accessible to the host. To do that, you must use either the -p flag to publish a range of ports or the ...
STOPSIGNAL signal
The STOPSIGNAL instruction sets the system call signal that will be sent to the container to exit. This signal can be a valid unsigned number that matches a position in the kernel’s syscall table, for instance 9, or a signal name in the format SIGNAME, for instance SIGKILL.
Make sure your image object is fully loaded before you try to draw it on the canvas with context.drawImage. Otherwise the image will silently fail to display.
In JavaScript, images are not loaded immediately. Instead, images are loaded asynchronously and during the time they take to load JavaScript...
This script, from here and here, will return all Tables and Columns where a specified value exists. This is powerful in finding out where a certain value is in a database. It can be taxing, so it is suggested that it be executed in a backup / test enviroment first.
DECLARE @SearchStr nvarchar(100)
...
SELECT ps.name AS PartitionScheme
, fg.name AS [FileGroup]
, prv.*
, LAG(prv.Value) OVER (PARTITION BY ps.name ORDER BY ps.name, boundary_id) AS PreviousBoundaryValue
FROM sys.partition_schemes ps
INNER JOIN sys.destination_data...
According to this [TechNet Microsoft page][1],
Partitioning data enables you to manage and access subsets of your data quickly and efficiently while maintaining the integrity of the entire data collection.
When you call the following query the data is not physically moved; only the metadata ab...