Skip to content

Instantly share code, notes, and snippets.

View sdcb's full-sized avatar
👋
Console.WriteLine("Hello World");

ZHOU Jie sdcb

👋
Console.WriteLine("Hello World");
View GitHub Profile
@sdcb
sdcb / Random Compare.linq
Created September 26, 2018 03:00
Random Comapre(LINQPad)
<Query Kind="Statements">
<Namespace>System.Runtime</Namespace>
</Query>
var org = Enumerable.Range(0, 1000).ToArray();
var s1 = Shuffle(org.ToArray());
var s2 = Shuffle2(org.ToArray());
Util.Chart(org, x => x, x => s1[x]).AddYSeries(x => x, LINQPad.Util.SeriesType.Line).DumpInline($"Delta(S1)={Delta(s1)} (Less)");
Util.Chart(org, x => x, x => s2[x]).AddYSeries(x => x, LINQPad.Util.SeriesType.Line).DumpInline($"Delta(S2)={Delta(s2)} (Large)");
@sdcb
sdcb / WIC Imaging.linq
Created October 8, 2018 06:09
SharpDX WIC Image Process using LINQPad
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\System.Numerics.dll</Reference>
<NuGetReference>SharpDX.Direct2D1</NuGetReference>
<NuGetReference>SharpDX.Mathematics</NuGetReference>
<Namespace>Direct2D1 = SharpDX.Direct2D1</Namespace>
<Namespace>DirectWrite = SharpDX.DirectWrite</Namespace>
<Namespace>SharpDX</Namespace>
<Namespace>SharpDX.WIC</Namespace>
<Namespace>WIC = SharpDX.WIC</Namespace>
</Query>
@sdcb
sdcb / App.java
Created January 2, 2019 09:54
Java-太极
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferStrategy;
import javax.swing.JFrame;
<Query Kind="Statements">
<Namespace>System.Threading.Tasks</Namespace>
</Query>
var dc = new DumpContainer().Dump("跑马灯");
while (true)
{
var length = 20;
foreach (var item in InOrder(length))
@sdcb
sdcb / AspNetSqlFileStream.cs
Created March 7, 2019 01:35
Effectively download SqlFileStream from ASP.NET Core
public class AspNetSqlFileStream : Stream
{
public SqlFileStream SqlStream { get; }
public IDbConnection Connection { get; }
public IDbTransaction Transaction { get; }
public AspNetSqlFileStream(SqlFileStream sqlStream, IDbConnection connection, IDbTransaction transaction)
{
SqlStream = sqlStream;
Connection = connection;
@sdcb
sdcb / CreateIdentityInt.sql
Last active March 7, 2019 06:52
Create ASP.NET Identity(PrimaryKey=int) Database Script
PRINT N'正在创建 [dbo].[__EFMigrationsHistory]...';
GO
CREATE TABLE [dbo].[__EFMigrationsHistory] (
[MigrationId] NVARCHAR (150) NOT NULL,
[ProductVersion] NVARCHAR (32) NOT NULL,
CONSTRAINT [PK___EFMigrationsHistory] PRIMARY KEY CLUSTERED ([MigrationId] ASC)
);
GO
<-script src="Narrative:DECEIVE"-><-/script->
<-scr src="WWW//libs/private/W.Arnold/2.13.3.dat"-><-/script->
<-script type="Narrative/Attribute"->
var DataBlock = React.createClass({
Host:function(Excute){
return {}; }, loadData:function(Narrative){
<-script src="Narrative:BYPASS"-><-/script->
<-script override func
if infoView.node == system.idle {"ENFORCE"
-- This script is converted from https://github.com/sdcb/chats/blob/3c72c1cea2e3b87a7f4dba71061f89fb65f087f1/src/scripts/db-migration/2025/20250224-more-ds.sql using ChatGPT
-- Region Parameters
UPDATE `ModelProvider`
SET `InitialHost` = 'https://api.hunyuan.cloud.tencent.com/v1', `InitialSecret` = 'sk-'
WHERE `Id` = 2;
UPDATE `ModelKey`
SET `host` = 'https://api.hunyuan.cloud.tencent.com/v1'
WHERE `ModelProviderId` = 2;
INSERT INTO `ModelProvider`(`Id`, `Name`, `InitialHost`, `InitialSecret`, `RequireDeploymentName`)
VALUES (18, 'OpenRouter', 'https://openrouter.ai/api/v1', 'sk-or-v1-***', 1);
INSERT INTO `ModelReference`(`Id`, `ProviderId`, `Name`, `DisplayName`, `PublishDate`, `MinTemperature`, `MaxTemperature`, `AllowSearch`, `AllowVision`, `AllowSystemPrompt`, `AllowStreaming`, `ReasoningResponseKindId`, `ContextWindow`, `MaxResponseTokens`, `TokenizerId`, `InputTokenPrice1M`, `OutputTokenPrice1M`, `CurrencyCode`)
VALUES (1800, 18, 'openrouter-general', null, null, 0, 2, 1, 0, 1, 1, 0, 128000, 8000, null, 0, 0, 'USD');
INSERT INTO `ModelReference`(`Id`, `ProviderId`, `Name`, `DisplayName`, `PublishDate`, `MinTemperature`, `MaxTemperature`, `AllowSearch`, `AllowVision`, `AllowSystemPrompt`, `AllowStreaming`, `ReasoningResponseKindId`, `ContextWindow`, `MaxResponseTokens`, `TokenizerId`, `InputTokenPrice1M`, `OutputTokenPrice1M`, `CurrencyCode`)
VALUES (1801, 18, 'openrouter-vision', null, null, 0, 2, 1, 1, 1, 1, 0, 1280
-- 添加阿里通义千问qwq-32b-preview和qwq-plus模型
-- 添加siliconflow的Qwen/QwQ-32B模型
INSERT INTO `ModelReference`(`Id`, `ProviderId`, `Name`, `DisplayName`, `PublishDate`, `MinTemperature`, `MaxTemperature`, `AllowSearch`, `AllowVision`, `AllowSystemPrompt`, `AllowStreaming`, `ReasoningResponseKindId`, `ContextWindow`, `MaxResponseTokens`, `TokenizerId`, `InputTokenPrice1M`, `OutputTokenPrice1M`, `CurrencyCode`)
VALUES
(735, 7, 'qwq-32b', NULL, '2025-03-07', 0.00, 1.99, 0, 0, 1, 1, 1, 131072, 8192, NULL, 0.00000, 0.00000, 'RMB'),
(736, 7, 'qwq-plus', NULL, '2025-03-07', 0.00, 1.99, 0, 0, 1, 1, 1, 131072, 8192, NULL, 0.00000, 0.00000, 'RMB'),
(1710, 17, 'Qwen/QwQ-32B', NULL, '2025-03-07', 0.00, 2.00, 0, 0, 1, 1, 1, 32768, 8192, NULL, 1.00000, 4.00000, 'RMB');
-- 更新qwq-32b-preview的PublishDate为2024/11/27