This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
# The goal of this file is to provide a FastAPI application for handling | |
# chat requests amd generation AI-powered responses using conversation chains. | |
# The application uses the LangChaing library, which includes a chatOpenAI model | |
# for natural language processing. | |
# The `StreamingConversationChain` class is responsible for creating and storing | |
# conversation memories and generating responses. It utilizes the `ChatOpenAI` model | |
# and a callback handler to stream responses as they're generated. | |
# The application defines a `ChatRequest` model for handling chat requests, |
import argparse | |
import pandas as pd | |
import numpy as np | |
TREC_RES_COLUMNS = ['qid', 'iteration', 'docNo', 'rank', 'docScore', 'method'] | |
TREC_QREL_COLUMNS = ['qid', 'iteration', 'docNo', 'rel'] | |
parser = argparse.ArgumentParser(description='Calculates NDCG@k') | |
parser.add_argument('qrels_file', type=str, help='path to a qrels file') |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
// Makes a copy of all selected components (how is this not built into Figma?) | |
let newSelection = []; | |
for (let component of figma.currentPage.selection.filter(node => node.type == 'COMPONENT')) { | |
let clone = component.clone() | |
clone.x += clone.width; | |
newSelection.push(clone); | |
} | |
figma.currentPage.selection = newSelection; |
9 March, 2019
We were discussing with @erusev what we can do with async operation when using useReducer()
in our application. Our app is simple and we don't want to use a state management library. All our requirements are satisfied with using one root useReducer()
. The problem we are facing and don't know how to solve is async operations.
In a discussion with Dan Abramov he recommends Solution 3 but points out that things are fresh with hooks and there could be better ways of handling the problem.
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: monitoring-influxdb | |
namespace: kube-system | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: |
1) Install cloudflared using homebrew: | |
brew install cloudflare/cloudflare/cloudflared | |
2) Create /usr/local/etc/cloudflared/config.yaml, with the following content | |
proxy-dns: true | |
proxy-dns-upstream: | |
- https://1.1.1.1/dns-query | |
- https://1.0.0.1/dns-query |
The goal of this project is to create and publish an API that allows users to evaluate code in different programming languages using isolated Docker containers.
Use cases for this project include an online IDE for pair programming, a remote interview tool and evaluation of challenges (like Make it Real), among others.
Before using this service users have to sign up so that they can grab a generated API Key that they have to use to authenticate the requests.
Assuming that the service is published in the domain http://eval.io/, it should be posible to make a POST to the path /v1/eval/<platform>
where <platform>
is one of the languages or platforms supported.
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.