- We've got some components
A,BandCwhich provide different slots.const A = { template: `<div><slot name="a">Default A Content</slot></div>` }
const B = {
| """ | |
| This Python code demonstrates Schema-Guided Reasoning (SGR) with llama.cpp and small model - Qwen3-4B Q8_0. It: | |
| - implements a business agent capable of planning and reasoning | |
| - implements tool calling using only SGR and simple dispatch | |
| - uses with a simple (inexpensive) non-reasoning model for that | |
| This demo is modified from https://abdullin.com/schema-guided-reasoning/demo to support local llm | |
| Test model: Qwen3-4B-Instruct-2507-Q8_0 (https://huggingface.co/unsloth/Qwen3-4B-Instruct-2507-GGUF/resolve/main/Qwen3-4B-Instruct-2507-Q8_0.gguf) |
| """ | |
| This Python code demonstrates Schema-Guided Reasoning (SGR) with OpenAI. It: | |
| - implements a business agent capable of planning and reasoning | |
| - implements tool calling using only SGR and simple dispatch | |
| - uses with a simple (inexpensive) non-reasoning model for that | |
| To give this agent something to work with, we ask it to help with running | |
| a small business - selling courses to help to achieve AGI faster. |
| import credentials | |
| from time import time | |
| import jwt | |
| import requests | |
| class YandexGPT: | |
| def __init__(self, service_account_id, key_id, private_key, folder_id, default_system_msg=None, |
| var webpack = require('webpack'); | |
| var MemoryFS = require('memory-fs'); | |
| var SingleEntryDependency = require('webpack/lib/dependencies/SingleEntryDependency'); | |
| var fs = new MemoryFS(); | |
| fs.mkdirpSync('/src'); | |
| fs.writeFileSync('/src/app.js', 'require("./dep.js")', 'utf-8'); | |
| fs.writeFileSync('/src/dep.js', 'module.exports = function(msg){console.log(msg)}', 'utf-8'); | |
| fs.writeFileSync('/src/extra-entry.js', 'require("./dep.js")', 'utf-8'); |
| try: | |
| from xml.etree.cElementTree import XML | |
| except ImportError: | |
| from xml.etree.ElementTree import XML | |
| import zipfile | |
| """ | |
| Module that extract text from MS XML Word document (.docx). | |
| (Inspired by python-docx <https://github.com/mikemaccana/python-docx>) |
This Gist contains instructions to setup Ubuntu server with Nginx, uWSGI & Node.js with that can serve for any Python apps (Django for instance) and will allow it's automatized deployment.
The content is as follows:
01-ubuntu.md – A basic Ubuntu server setup.02-nginx-uwsgi-nodejs.md – Nginx, uWSGI and Node.js installation and setup.03-deployment.md – A server setup for automatized deployment.04-mariadb.md – Mariadb installation and setup.Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)The Liang-Barsky algorithm is a cheap way to find the intersection points between a line segment and an axis-aligned rectangle. It's a simple algorithm, but the resources I was pointed to didn't have particularly good explanations, so I tried to write a better one.
Consider a rectangle defined by x_min ≤ x ≤ x_max and y_min ≤ y ≤ y_max, and a line segment from (x_0, y_0) to (x_0 + Δ_x, y_0 + Δ_y). We'll be assuming at least one of Δ_x and Δ_y is nonzero.
(I'm working with Flash, so I'll be using the convention that y increases as you go down.)
We want to distinguish between the following cases: