Posts

Showing posts from October, 2023

OpenAi in Azure using C#

  Program.cs located in OpenAiTest solution Requires Secrets.cs to be created with read-only AiModelName, WebsiteUri and Key properties. Assumes: 1) Azure account 2) OpenAi account, 3) Azure OpenAi account and the Secrets.cs reflects the correct answers. An alternative to this approach is to hit the OpenAi API directly. using Azure; using Azure.AI.OpenAI; using OpenAiTest; var options = new ChatCompletionsOptions(); options.Messages.Add(new ChatMessage(ChatRole.System, "You are friendly. You will be giving advice to Texas lawyers, so only use Texas state laws when quoting state laws.")); options.MaxTokens = 2000; Console.Write("Welcome to the OpenAI Copilot Test Console App!"); string prompt = string.Empty; var client = new OpenAIClient(new Uri(Secrets.WebsiteUri), new AzureKeyCredential(Secrets.Key)); while (true) {     Console.ForegroundColor = ConsoleColor.White;     Console.Write(">> ");     prompt = Console.ReadLine()!;  ...

ReactJS (overall) (general)

GENERAL NOTES React is built by Jordan Walke, a software engineer at Facebook, who founded the library in 2011. =============================================================== NAMING - JAVASCRIPT AND REACT: ... is "spread operator" "Arrow Functions" which are => like rest of Javascrpt a.k.a. lambda a.k.a. anonymous functions Syntax: "Arrow Functions" point at parenthesis rather than braces.   =============================================================== OVERALL: WHY REACT? High performance reinforced by Virtual DOM By virtualizing and keeping DOM in memory, React grants outstandingly fast rendering capacities with all view changes readily reflected in the virtual DOM. The specialized diff algorithm juxtaposes former and existing virtual DOM states, calculating the most efficient way to apply new changes without requiring too many updates. A minimum number of updates is then introduced to achieve the fastest read/write time, which results in an overall...

Lecture Notes: ReactJs & GraphQL Relays

My lecture notes:  REACT AND GRAPH QL RELAYS MEETING    night of 10/10/2023    at ReactJs Dallas monthly  (reactjsdallas.com)    by Rigre Garciandia — React Relay - Unlocking GraphQL's Full Potential    source code: https://github.com/rigrergl/react-relay-demo --------------------------------------------------------- REACT RELAY:      Dev Kit at:   https://relay.dev/   working example:  https://codesandbox.io/s/relay-sandbox-nxl7i?file=/src/TodoApp.tsx   1) Server state management   2) GraphQL partner   3) Used at Scale   Why Use?     A) Locally          a) co-locate          b) component code          c) encapsulation     B) Globally          a) static query generation     ...