Skip to content

Commit

Permalink
chore: playground: notebooks: OlaGerador: cleanup logs
Browse files Browse the repository at this point in the history
  • Loading branch information
guesant committed Mar 27, 2024
1 parent 3c47118 commit 9429109
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 194 deletions.
58 changes: 23 additions & 35 deletions playground/notebooks/.ipynb_checkpoints/OlaGerador-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "c58aa995-8ad3-465b-9e03-af2ff50b4c1e",
"metadata": {},
"source": [
"## \"Olá, Mundo!\" pq ninguem é de ferro ne"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0fee0429-ba2b-455a-966f-71b00ec3cb1e",
"metadata": {},
"outputs": [],
"source": [
"Console.WriteLine(\"Olá, Mundo!\");"
]
},
{
"cell_type": "markdown",
"id": "617ed7b2-355d-43f8-867b-a91648a9a61c",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"## Faz o build do projeto-gerar-horario;"
]
Expand All @@ -25,9 +41,7 @@
{
"cell_type": "markdown",
"id": "84c34044-82f5-432d-8dbe-ee8945343794",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"## Instala as dependências do projeto;"
]
Expand All @@ -45,9 +59,7 @@
{
"cell_type": "markdown",
"id": "3d315942-e4bd-420e-9a66-48c547d3ecbf",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"## Importa a lib GerarHorario;"
]
Expand All @@ -65,9 +77,7 @@
{
"cell_type": "markdown",
"id": "c4240d90-8dd1-4f83-89cc-6ef6d1099bcb",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"## Faz o uso do namespace Sisgea.GerarHorario.Core;"
]
Expand All @@ -82,32 +92,10 @@
"using Sisgea.GerarHorario.Core;"
]
},
{
"cell_type": "markdown",
"id": "c58aa995-8ad3-465b-9e03-af2ff50b4c1e",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"## \"Olá, Mundo!\" pq ninguem é de ferro ne"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0fee0429-ba2b-455a-966f-71b00ec3cb1e",
"metadata": {},
"outputs": [],
"source": [
"Console.WriteLine(\"Olá, Mundo!\");"
]
},
{
"cell_type": "markdown",
"id": "cda61c20-4b19-441c-8db6-119acf78eb32",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"## Felicidade :))"
]
Expand Down
181 changes: 22 additions & 159 deletions playground/notebooks/OlaGerador.ipynb
Original file line number Diff line number Diff line change
@@ -1,154 +1,37 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "c58aa995-8ad3-465b-9e03-af2ff50b4c1e",
"metadata": {},
"source": [
"## \"Olá, Mundo!\" pq ninguem é de ferro ne"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0fee0429-ba2b-455a-966f-71b00ec3cb1e",
"metadata": {},
"outputs": [],
"source": [
"Console.WriteLine(\"Olá, Mundo!\");"
]
},
{
"cell_type": "markdown",
"id": "617ed7b2-355d-43f8-867b-a91648a9a61c",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"## Faz o build do projeto-gerar-horario;"
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "b50a9f5d-c261-4500-8a58-e1dc1ba27c66",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\r\n",
"<div>\r\n",
" <div id='dotnet-interactive-this-cell-697.Microsoft.DotNet.Interactive.Http.HttpPort' style='display: none'>\r\n",
" The below script needs to be able to find the current output cell; this is an easy method to get it.\r\n",
" </div>\r\n",
" <script type='text/javascript'>\r\n",
"async function probeAddresses(probingAddresses) {\r\n",
" function timeout(ms, promise) {\r\n",
" return new Promise(function (resolve, reject) {\r\n",
" setTimeout(function () {\r\n",
" reject(new Error('timeout'))\r\n",
" }, ms)\r\n",
" promise.then(resolve, reject)\r\n",
" })\r\n",
" }\r\n",
"\r\n",
" if (Array.isArray(probingAddresses)) {\r\n",
" for (let i = 0; i < probingAddresses.length; i++) {\r\n",
"\r\n",
" let rootUrl = probingAddresses[i];\r\n",
"\r\n",
" if (!rootUrl.endsWith('/')) {\r\n",
" rootUrl = `${rootUrl}/`;\r\n",
" }\r\n",
"\r\n",
" try {\r\n",
" let response = await timeout(1000, fetch(`${rootUrl}discovery`, {\r\n",
" method: 'POST',\r\n",
" cache: 'no-cache',\r\n",
" mode: 'cors',\r\n",
" timeout: 1000,\r\n",
" headers: {\r\n",
" 'Content-Type': 'text/plain'\r\n",
" },\r\n",
" body: probingAddresses[i]\r\n",
" }));\r\n",
"\r\n",
" if (response.status == 200) {\r\n",
" return rootUrl;\r\n",
" }\r\n",
" }\r\n",
" catch (e) { }\r\n",
" }\r\n",
" }\r\n",
"}\r\n",
"\r\n",
"function loadDotnetInteractiveApi() {\r\n",
" probeAddresses([\"http://172.19.0.2:2048/\", \"http://127.0.0.1:2048/\"])\r\n",
" .then((root) => {\r\n",
" // use probing to find host url and api resources\r\n",
" // load interactive helpers and language services\r\n",
" let dotnetInteractiveRequire = require.config({\r\n",
" context: '697.Microsoft.DotNet.Interactive.Http.HttpPort',\r\n",
" paths:\r\n",
" {\r\n",
" 'dotnet-interactive': `${root}resources`\r\n",
" }\r\n",
" }) || require;\r\n",
"\r\n",
" window.dotnetInteractiveRequire = dotnetInteractiveRequire;\r\n",
"\r\n",
" window.configureRequireFromExtension = function(extensionName, extensionCacheBuster) {\r\n",
" let paths = {};\r\n",
" paths[extensionName] = `${root}extensions/${extensionName}/resources/`;\r\n",
" \r\n",
" let internalRequire = require.config({\r\n",
" context: extensionCacheBuster,\r\n",
" paths: paths,\r\n",
" urlArgs: `cacheBuster=${extensionCacheBuster}`\r\n",
" }) || require;\r\n",
"\r\n",
" return internalRequire\r\n",
" };\r\n",
" \r\n",
" dotnetInteractiveRequire([\r\n",
" 'dotnet-interactive/dotnet-interactive'\r\n",
" ],\r\n",
" function (dotnet) {\r\n",
" dotnet.init(window);\r\n",
" },\r\n",
" function (error) {\r\n",
" console.log(error);\r\n",
" }\r\n",
" );\r\n",
" })\r\n",
" .catch(error => {console.log(error);});\r\n",
" }\r\n",
"\r\n",
"// ensure `require` is available globally\r\n",
"if ((typeof(require) !== typeof(Function)) || (typeof(require.config) !== typeof(Function))) {\r\n",
" let require_script = document.createElement('script');\r\n",
" require_script.setAttribute('src', 'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js');\r\n",
" require_script.setAttribute('type', 'text/javascript');\r\n",
" \r\n",
" \r\n",
" require_script.onload = function() {\r\n",
" loadDotnetInteractiveApi();\r\n",
" };\r\n",
"\r\n",
" document.getElementsByTagName('head')[0].appendChild(require_script);\r\n",
"}\r\n",
"else {\r\n",
" loadDotnetInteractiveApi();\r\n",
"}\r\n",
"\r\n",
" </script>\r\n",
"</div>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"MSBuild version 17.8.3+195e7f5a3 for .NET\n",
" Determining projects to restore...\n",
" All projects are up-to-date for restore.\n",
" GerarHorario -> /home/user/gerar-horario/projeto-gerar-horario/GerarHorario/bin/Debug/net8.0/GerarHorario.dll\n",
" GerarHorario-Tests -> /home/user/gerar-horario/projeto-gerar-horario/GerarHorario-Tests/bin/Debug/net8.0/GerarHorario-Tests.dll\n",
"\n",
"Build succeeded.\n",
" 0 Warning(s)\n",
" 0 Error(s)\n",
"\n",
"Time Elapsed 00:00:01.67\n"
]
}
],
"outputs": [],
"source": [
"#!pwsh\n",
"cd \"/home/user/gerar-horario/projeto-gerar-horario\";\n",
Expand All @@ -158,9 +41,7 @@
{
"cell_type": "markdown",
"id": "84c34044-82f5-432d-8dbe-ee8945343794",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"## Instala as dependências do projeto;"
]
Expand Down Expand Up @@ -211,24 +92,6 @@
"using Sisgea.GerarHorario.Core;"
]
},
{
"cell_type": "markdown",
"id": "c58aa995-8ad3-465b-9e03-af2ff50b4c1e",
"metadata": {},
"source": [
"## \"Olá, Mundo!\" pq ninguem é de ferro ne"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0fee0429-ba2b-455a-966f-71b00ec3cb1e",
"metadata": {},
"outputs": [],
"source": [
"Console.WriteLine(\"Olá, Mundo!\");"
]
},
{
"cell_type": "markdown",
"id": "cda61c20-4b19-441c-8db6-119acf78eb32",
Expand Down

0 comments on commit 9429109

Please sign in to comment.