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 Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.SemanticKernel; | |
// Create a kernel with Azure OpenAI chat completion | |
#pragma warning disable SKEXP0001, SKEXP0003, SKEXP0010, SKEXP0011, SKEXP0050, SKEXP0052 | |
var builder = Kernel.CreateBuilder().AddOpenAIChatCompletion( | |
modelId: "Phi-3-5-mini-instruct-lfqzp", | |
endpoint: new Uri("https://Phi-3-5-mini-instruct-lfqzp.eastus2.models.ai.azure.com"), |
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
version: '3.4' | |
services: | |
sql.data: | |
image: mcr.microsoft.com/mssql/server:2017-latest | |
container_name: dev_sql | |
environment: | |
- SA_PASSWORD=yourStrong(!)Password | |
- ACCEPT_EULA=Y | |
healthcheck: |
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
public class ImageConverter | |
{ | |
byte[] ConvertToPng(byte[] source, ConversionOptions options) => Execute(source, | |
$"- -filter Triangle -define filter:support=2 -resize {options.Width}x{options.Height}> -density 150x150 -unsharp 0.25x0.25+8+0.065 -dither None -posterize 136 -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB -strip png:-"); | |
byte[] ConvertToJpg(byte[] source, ConversionOptions options) => Execute(source, | |
$"- -filter Triangle -define filter:support=2 -resize {options.Width}x{options.Height}> -unsharp 0.25x0.25+8+0.065 -dither None -posterize 136 -quality {options.Quality} -define jpeg:fancy-upsampling=off -interlace none -colorspace sRGB -background white -alpha remove -strip jpg:-"); | |
} |
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
// Copyright (c) .NET Foundation. All rights reserved. | |
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | |
using System; | |
using System.IO; | |
using System.Reflection; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.HostFiltering; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Http; |
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
r.db("rethinkdb").table('jobs') | |
.filter(function(j){ | |
return j('type').eq('query') | |
.and(j('duration_sec').gt(0.001)) | |
.and(j('info')('query').match('jobs').eq(null)) | |
.and(j('info')('query').match('rethinkdb').eq(null)); | |
}) | |
.changes(); |