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 ChironB.Benchmarks | |
| open Chiron | |
| open BenchmarkDotNet.Attributes | |
| open Newtonsoft.Json | |
| open Newtonsoft.Json.Linq | |
| module Bench = | |
| open System.IO | |
| open System.Text |
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
| import requests | |
| def firstQuery(substr): | |
| response = requests.get(f"https://jsonmock.hackerrank.com/api/movies/search/?Title={substr}") | |
| respDict = response.json() | |
| rtn = { | |
| "per_page": respDict["per_page"], "total": respDict["total"], "total_pages": respDict["total_pages"] | |
| } | |
| return rtn | |
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
| #!/bin/python3 | |
| import math | |
| import os | |
| import random | |
| import re | |
| import sys | |
| # |
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
| from __future__ import print_function | |
| from IPython.core.magic import register_cell_magic | |
| import subprocess as sp | |
| import tempfile | |
| import os | |
| IRON_PYTHON_PATH = r'C:\HOMEWARE\IronPython-2.7.5\ipy64.exe' | |
| @register_cell_magic | |
| def iron(line, cell): |
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
| //10bd8edbd5f0a13489931a75fdd21363a70c461e | |
| //https://github.com/DiffSharp/DiffSharp/blob/10bd8edbd5f0a13489931a75fdd21363a70c461e/docs/input/gettingstarted-symbolicdifferentiation.fsx | |
| ``` | |
| (*** hide ***) | |
| #r "../../src/DiffSharp/bin/Debug/FsAlg.dll" | |
| #r "../../src/DiffSharp/bin/Debug/DiffSharp.dll" | |
| (** | |
| Symbolic Differentiation | |
| ======================== |
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
| /// Source: GitHub Microsoft.ML | |
| /// https://github.com/dotnet/machinelearning-samples/blob/master/samples/fsharp/common/ConsoleHelper.fs | |
| /// New versions may reflect my own changes | |
| /// MIT License | |
| namespace Microsoft.ML.Extensions | |
| open System | |
| open Microsoft.ML | |
| open Microsoft.ML.Data |
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
| // Renaming files | |
| open System | |
| open System.IO | |
| [<Literal>] | |
| let Folder = """P:\""" | |
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
| console.table((function listAllEventListeners() { | |
| const allElements = Array.prototype.slice.call(document.querySelectorAll('*')); | |
| allElements.push(document); // we also want document events | |
| const types = []; | |
| for (let ev in window) { | |
| if (/^on/.test(ev)) types[types.length] = ev; | |
| } | |
| let elements = []; | |
| for (let i = 0; i < allElements.length; i++) { |
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
| const listeners = (function listAllEventListeners() { | |
| let elements = []; | |
| const allElements = document.querySelectorAll('*'); | |
| const types = []; | |
| for (let ev in window) { | |
| if (/^on/.test(ev)) types[types.length] = ev; | |
| } | |
| for (let i = 0; i < allElements.length; i++) { | |
| const currentElement = allElements[i]; |
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
| // This is a conversion to F# of the C# code presented in | |
| // MSDN Magazine, March 2015, by James McCaffrey: | |
| // https://msdn.microsoft.com/en-us/magazine/dn913188.aspx | |
| open System | |
| let sumprod (v1:float[]) (v2:float[]) = | |
| Seq.zip v1 v2 |> Seq.sumBy (fun (x,y) -> x * y) | |
| let sigmoid z = 1.0 / (1.0 + exp (- z)) |