diff --git a/多语言笔记.1.3.多语言.ipynb b/多语言笔记.1.3.多语言.ipynb new file mode 100644 index 0000000..2656e28 --- /dev/null +++ b/多语言笔记.1.3.多语言.ipynb @@ -0,0 +1,118 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 同一笔记中使用多语言" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 使用C#" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 使用 F#" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 使用Powershell" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 使用 html" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 使用 JavaScript" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 使用 SQL" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 使用 KQL" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 使用 mermaind" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 使用 Raw Value Storage" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "## 使用 Rarzor" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "dotnet_interactive": { + "language": "value" + }, + "polyglot_notebook": { + "kernelName": "value" + }, + "vscode": { + "languageId": "polyglot-notebook" + } + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "language_info": { + "name": "python" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/多语言笔记.100.1.测试.ipynb b/多语言笔记.100.1.测试.ipynb new file mode 100644 index 0000000..5f7a0fd --- /dev/null +++ b/多语言笔记.100.1.测试.ipynb @@ -0,0 +1,182 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 测试使用" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 全局引用" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "dotnet_interactive": { + "language": "csharp" + }, + "polyglot_notebook": { + "kernelName": "csharp" + } + }, + "outputs": [], + "source": [ + "// 默认包源\n", + "#i \"https://api.nuget.org/v3/index.json\"\n", + "\n", + "//添加 Nuget 包\n", + "#r \"nuget: microsoft.dotNet.interactive.aspnetcore,*-*\"\n", + "#r \"nuget: Microsoft.DotNet.Interactive.ExtensionLab,*-*\"\n", + "//全局引用\n", + "\n", + "//全局变量" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 测试" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "dotnet_interactive": { + "language": "csharp" + }, + "polyglot_notebook": { + "kernelName": "csharp" + } + }, + "outputs": [], + "source": [ + "var names=new string[]{\"小张\",\"王明\",\"李立三\"};" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "dotnet_interactive": { + "language": "csharp" + }, + "polyglot_notebook": { + "kernelName": "csharp" + } + }, + "outputs": [], + "source": [ + "#!share --help" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "dotnet_interactive": { + "language": "javascript" + }, + "polyglot_notebook": { + "kernelName": "javascript" + } + }, + "outputs": [], + "source": [ + "let value = \"hello from js\"\n", + "\n", + "console.log(value)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "dotnet_interactive": { + "language": "javascript" + }, + "polyglot_notebook": { + "kernelName": "javascript" + } + }, + "outputs": [], + "source": [ + "#!share names --from csharp --mime-type text/plain --as cc\n", + "\n", + "console.log(cc)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "dotnet_interactive": { + "language": "javascript" + }, + "polyglot_notebook": { + "kernelName": "javascript" + } + }, + "outputs": [], + "source": [ + "var d =interactive.csharp\n", + "console.log(d)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "dotnet_interactive": { + "language": "javascript" + }, + "polyglot_notebook": { + "kernelName": "javascript" + } + }, + "outputs": [], + "source": [ + "let va = await interactive.csharp.getVariable('names');\n", + "interactive.csharp" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".NET (C#)", + "language": "C#", + "name": ".net-csharp" + }, + "language_info": { + "name": "polyglot-notebook" + }, + "orig_nbformat": 4, + "polyglot_notebook": { + "kernelInfo": { + "defaultKernelName": "csharp", + "items": [ + { + "aliases": [], + "name": "csharp" + }, + { + "aliases": [], + "name": "razor" + } + ] + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/多语言笔记.2.1.连接数据库.ipynb b/多语言笔记.2.1.连接数据库.ipynb index f72e42a..96f5a99 100644 --- a/多语言笔记.2.1.连接数据库.ipynb +++ b/多语言笔记.2.1.连接数据库.ipynb @@ -27,7 +27,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -36,7 +36,37 @@ "kernelName": "csharp" } }, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
This extension adds support for connecting to Microsoft SQL Server databases using the #!connect mssql
magic command. For more information, run a cell using the #!sql
magic command.