For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.
| <?php | |
| namespace App\Http\Controllers; | |
| use Illuminate\Http\Request; | |
| trait RestControllerTrait { | |
| public function index() { | |
| $model = self::MODEL; |
| --- | |
| METHOD 1 | |
| This should roughly sort the items on distance in MySQL, and should work in SQLite. | |
| If you need to sort them preciser, you could try using the Pythagorean theorem (a^2 + b^2 = c^2) to get the exact distance. | |
| --- | |
| SELECT * | |
| FROM table | |
| ORDER BY ((lat-$user_lat)*(lat-$user_lat)) + ((lng - $user_lng)*(lng - $user_lng)) ASC |
| namespace Analogy | |
| { | |
| /// <summary> | |
| /// This example shows that a library that needs access to target .NET Standard 1.3 | |
| /// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET | |
| /// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library. | |
| /// </summary>INetCoreApp10 | |
| class Example1 | |
| { | |
| public void Net45Application(INetFramework45 platform) |
| robocopy c:\Sourcepath c:\Destpath /E /XC /XN /XO | |
| :: /E makes Robocopy recursively copy subdirectories, including empty ones. | |
| :: /XC excludes existing files with the same timestamp, but different file sizes. Robocopy normally overwrites those. | |
| :: /XN excludes existing files newer than the copy in the source directory. Robocopy normally overwrites those. | |
| :: /XO excludes existing files older than the copy in the source directory. Robocopy normally overwrites those. | |
| :: With the Changed, Older, and Newer classes excluded, Robocopy will exclude files existing in the destination directory. |
| // Redux mini | |
| type Reducer<TPayload, TState> = (params: TPayload) => (state: TState) => TState; | |
| type Action<TPayload> = { name: string, payload: TPayload }; | |
| type ActionFactory<TPayload> = (payload: TPayload) => Action<TPayload>; | |
| type ActionDispatcher<TPayload> = (payload: TPayload) => void; | |
| type ReducersSet<TActions, TState> = { [P in keyof TActions]: Reducer<TActions[P], TState> } | |
| type ActionFactorySet<TActions> = { [TActionName in keyof TActions]: ActionFactory<TActions[TActionName]> } | |
| type ActionDispatcherSet<TActions> = { [TActionName in keyof TActions]: ActionDispatcher<TActions[TActionName]> } |
| /* | |
| * © Copyright 2003-2017 by ScaleOut Software, Inc. | |
| * | |
| * LICENSE AND DISCLAIMER | |
| * ---------------------- | |
| * This material contains sample programming source code ("Sample Code"). | |
| * ScaleOut Software, Inc. (SSI) grants you a nonexclusive license to compile, | |
| * link, run, display, reproduce, and prepare derivative works of | |
| * this Sample Code. The Sample Code has not been thoroughly | |
| * tested under all conditions. SSI, therefore, does not guarantee |
Roslyn provides a rich set of APIs for analyzing C# and Visual Basic source code, but constructing a context in which
to perform analysis can be challenging. For simple tasks, creating a Compilation populated with SyntaxTrees,
MetadataReferences and a handful of options may suffice. However, if there are multiple projects involved in the
analysis, it is more complicated because multiple Compilations need to be created with references between them.
To simplify the construction process. Roslyn provides the Workspace API, which can be used to model solutions,
projects and documents. The Workspace API performs all of the heavy lifting needed to parse SyntaxTrees from source
code, load MetadataReferences, and construct Compilations and add references between them.
| # There is no facility to replace passwords in RDCMan once they are stored. The only way is to create a new custom credential. | |
| # If you open your *.rdg file in a text editor, locate the stored <password>, you can then decrypt it using this script. | |
| # This script can also encrypt a plain text password in rdg format which can be used to overwrite an existing one in the xml. | |
| Add-Type -AssemblyName System.Security; | |
| Function EncryptPassword { | |
| [CmdletBinding()] | |
| param([String]$PlainText = $null) | |
| # convert to RDCMan format: (null terminated chars) |
| HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters | |
| Right-click on the right side, and add a new DWORD (32-bit) Value | |
| Set the value name to DisableTaskOffload and the value data to 1 | |
| Open Network Connections. | |
| Right-click the icon of the Network card and select Properties. | |
| In Networking tab, click Configure… button. | |
| In the next window, switch to Advanced tab. | |
| Click the Large Send Offload Version 2 (IPv4) and change the value to Disabled. |