-
Use Onion architecture
- Dependencies go inwards. That is, the Core domain doesn't know about outside layers
-
Use pipeline model to implement workflows/use-cases/stories
- Business logic makes decisions
- IO does storage with minimal logic
- Keep Business logic and IO separate
-
Keep IO at edges
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
USE [master] | |
GO | |
IF OBJECT_ID('dbo.calendar') IS NOT NULL | |
DROP TABLE [dbo].[calendar]; | |
IF OBJECT_ID('dbo.fn_generate_calendar') IS NOT NULL | |
DROP FUNCTION [dbo].[fn_generate_calendar]; | |
GO |
Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma
You can get the list of supported formats with:
ffmpeg -formats
Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:
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
Sparkline Line = | |
// Static line color - use %23 instead of # for Firefox compatibility | |
VAR LineColor = "%2301B8AA" | |
// "Date" field used in this example along the X axis | |
VAR XMinDate = MIN('Table'[Date]) | |
VAR XMaxDate = MAX('Table'[Date]) | |
// Obtain overall min and overall max measure values when evaluated for each date |
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
// killerDateTableRu | |
// функция killerDateTableRu создает таблицу с датами. Дополняет ее различными полезными для Time Intelligence столбцами. | |
// В случае, если четвертый аргумент принимает Дни 1, то функция добавляет столбец с выходными. | |
// Оригинальная идея philbritton https://gist.github.com/philbritton/9677152 | |
// пример: killerDateTableRu(#date(2017, 2, 1), #date(2017, 2, 4), "RU-ru", 1) | |
// Описание полей результирующей таблицы: | |
// =================================================== | |
// Date - дата | |
// Year - год |
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
#I "../lib" | |
#r "FSharp.Markdown.dll" | |
#r "FSharp.Literate.dll" | |
#r "Deedle.dll" | |
open System.IO | |
open Deedle | |
open Deedle.Internal | |
open FSharp.Literate | |
open FSharp.Markdown |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
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
//------------------------------------------ | |
// Step 0. Boilerplate to get the paket.exe tool | |
open System | |
open System.IO | |
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ | |
if not (File.Exists "paket.exe") then | |
let url = "http://fsprojects.github.io/Paket/stable" |
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
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
// THE SOFTWARE. | |
namespace Utility |
NewerOlder