This file contains hidden or 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
#!/usr/bin/env python3.14t | |
""" | |
Pure Python CPU Benchmark - Python 3.14t Free-Threading | |
======================================================== | |
Benchmark using PURE PYTHON CPU-intensive operations to prove | |
true parallelism. Uses operations that hold the GIL in standard | |
Python but run in parallel with free-threading. | |
Author: Hammad Abbasi |
This file contains hidden or 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
require 'http' | |
OPENAI_API_KEY = 'your-api-key-here' | |
def moderate_text(input_text) | |
headers = { | |
'Content-Type' => 'application/json', | |
'Authorization' => "Bearer #{OPENAI_API_KEY}" | |
} | |
data = { input: input_text } |
This file contains hidden or 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 System; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json; | |
namespace ContentModerationCSharp | |
{ | |
class Program | |
{ |
This file contains hidden or 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
import requests | |
OPENAI_API_KEY = 'your-api-key-here' | |
def moderate_text(input_text): | |
headers = { | |
'Content-Type': 'application/json', | |
'Authorization': f'Bearer {OPENAI_API_KEY}', | |
} | |
data = {'input': input_text} |
This file contains hidden or 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
const fetch = require('node-fetch'); | |
const OPENAI_API_KEY = 'your-api-key-here'; | |
async function moderateText(inputText) { | |
try { | |
const response = await fetch('https://api.openai.com/v1/moderations', { | |
method: 'POST', | |
headers: { | |
'Content-Type': 'application/json', |
This file contains hidden or 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
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') "> | |
<!-- Ensure Node.js is installed --> | |
<Exec Command="node --version" ContinueOnError="true"> | |
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" /> | |
</Exec> | |
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." /> | |
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." /> | |
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" /> | |
<!-- Include source map for debugging (for other source map options see https://webpack.js.org/configuration/devtool/ ) --> | |
<Exec WorkingDirectory="$(SpaRoot)" Command="npx webpack --debug --devtool inline-source-map scripts/index.js" /> |
This file contains hidden or 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
const { Product, Empty, Result } = require('./stock_pb'); | |
const { StockClient } = require('./stock_grpc_web_pb'); | |
var client = new StockClient(window.location.origin); | |
var txtName = document.getElementById('name'); | |
var txtCode = document.getElementById('code'); | |
var btnAddProduct = document.getElementById('addProduct'); | |
var trProducts = document.getElementById('trProducts'); |
This file contains hidden or 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
syntax = "proto3"; | |
option csharp_namespace = "StockServices.Protos"; | |
package stock; | |
service Stock { | |
rpc GetAllProducts(Empty) returns (stream Product); | |
rpc AddProduct (Product) returns (Result); | |
} |