For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * © 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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]> } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Http\Controllers; | |
| use Illuminate\Http\Request; | |
| trait RestControllerTrait { | |
| public function index() { | |
| $model = self::MODEL; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| next_xid = 1 | |
| active_xids = set() | |
| records = [] | |
| def new_transaction(): | |
| global next_xid | |
| next_xid += 1 | |
| active_xids.add(next_xid) | |
| return Transaction(next_xid) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| internal static class NativeMethods { | |
| public static void PreventSleep() { | |
| SetThreadExecutionState(ExecutionState.EsContinuous | ExecutionState.EsSystemRequired); | |
| } | |
| public static void AllowSleep() { | |
| SetThreadExecutionState(ExecutionState.EsContinuous); | |
| } |