This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Threading.Tasks; | |
using Couchbase.Extensions.DependencyInjection; | |
using Microsoft.AspNetCore.Authentication.JwtBearer; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Configuration; |
This file contains 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
using System; | |
using System.DirectoryServices.AccountManagement; | |
using System.IdentityModel.Tokens.Jwt; | |
using System.Linq; | |
using System.Security.Claims; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Authorization; | |
using Microsoft.AspNetCore.Cors; | |
using Microsoft.AspNetCore.Http.Features; |
This file contains 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
/** | |
* @author Nick Baughman | |
* @description SortableList is a drag-and-drop horizonal list component that allows for animated re-ordering of a list of elements. | |
* @todo This component *WILL* require customization! You cannot just copy and paste! See the "TODOs"... | |
*/ | |
import React, {useState, useEffect} from 'react'; | |
import { | |
LayoutRectangle, | |
StyleSheet, |
This file contains 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
// Basically, this allows you to easily stream a Multipart file upload request to MinIO, rather than save a file locally on the server | |
// or reading the full file into memory. | |
// | |
// While it was created with MinIO in mind, you'll notice that `createMultipartUpload()`, `uploadPart()` and `completeMultipartUpload()` | |
// are all available inside Amazon's S3 Java SDK. that means you can easily swap this over to use the S3 API instead | |
package server | |
import com.google.common.collect.HashMultimap |
This file contains 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 bytesToSize = (bytes: number) => { | |
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']; | |
if (bytes == 0) return '0 Byte'; | |
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString()); | |
return Math.round(bytes / Math.pow(1024, i)) + ' ' + sizes[i]; | |
} |
This file contains 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
# parameters | |
nc: 2 # number of classes | |
depth_multiple: 0.33 # model depth multiple | |
width_multiple: 0.50 # layer channel multiple | |
# anchors | |
anchors: | |
- [10,13, 16,30, 33,23] # P3/8 | |
- [30,61, 62,45, 59,119] # P4/16 | |
- [116,90, 156,198, 373,326] # P5/32 |
This file contains 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 { useEffect, useState } from "react"; | |
interface IMapProps { | |
// so that the parent can get a reference to the google maps instance | |
onMapLoaded?: (next: google.maps.Map) => void; | |
// so that the parent can get a reference to | |
onDrawingManagerLoaded?: (next: google.maps.drawing.DrawingManager) => void; | |
className?: string; | |
} |
This file contains 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
// Portions of this example assume that: | |
// 1. You are using [ConfiguredGraphFactory](https://docs.janusgraph.org/operations/configured-graph-factory/) to manage multiple graphs in JanusGraph | |
// 2. For the above, that you have already added a default graph template using `ConfiguredGraphFactory.createTemplateConfiguration()`. | |
// connect to a JanusGraph instance running on localhost | |
val cluster = Cluster.build("localhost").create() | |
val session = cluster.connect<Client.SessionedClient>() | |
// get a list of graph names (List<Result> which needs to be acted upon differently than a List<String>) | |
val graphNames = client.submit("ConfiguredGraphFactory.getGraphNames()").all().get() |
This file contains 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
# It's best to run this in a local notebook as two separate code blocks | |
# | |
# | |
# First, manually initialize the Ray cluster | |
# | |
import ray | |
if ray.is_initialized(): | |
ray.shutdown() |