date | title | author | tags | ||||
---|---|---|---|---|---|---|---|
2023-04-24 |
Webって何?触ってみよう |
sor4chi |
|
Webは知らないといけない知識がとても多く、挫折しやすい分野です。特に自分のレベルから上の技術に挑戦しようとすると、すぐに挫折してしまうことが多いです。
import { | |
MouseEventHandler, | |
ReactNode, | |
StrictMode, | |
useCallback, | |
useSyncExternalStore, | |
} from "react"; | |
import { createRoot } from "react-dom/client"; | |
import { Hono } from "hono"; | |
import { Action, createBrowserHistory, Update } from "history"; |
import numpy as np | |
max_values = list(map(int, input().split())) | |
dice_counts = np.arange(1, 6) | |
prior_probs = np.ones(len(dice_counts)) / len(dice_counts) | |
def likelihood(max_val, dice_count): |
import { afterAll, beforeAll, describe, expect, test } from "vitest"; | |
import { unstable_dev } from "wrangler"; | |
const images = ["test01.png", "test02.jpg", "test03.avif", "test04.gif"]; | |
const imageUrl = (image: string) => | |
`https://raw.githubusercontent.com/SoraKumo001/cloudflare-workers-image-optimization/master/images/${image}`; | |
describe("Wrangler", () => { | |
const property = beforeAll(async () => { | |
const worker = await unstable_dev("../src/index.ts", { |
import { Hono } from "hono"; | |
import { validator } from "hono/validator"; | |
import { createFactory } from "hono/factory"; | |
import { testClient } from "hono/testing"; | |
const app = new Hono(); | |
const factory = createFactory(); | |
const handler = factory.createHandlers( |
#include <stdio.h> | |
// Define a struct to represent an LZ77 code | |
struct LZ77 { | |
int pos; // position of the longest match in the input string | |
int len; // length of the match | |
char next; // next character in the input string after the match | |
}; | |
// Encode the input string using the LZ77 algorithm |
if type brew &>/dev/null; then | |
FPATH=$(brew --prefix)/share/zsh-completions:$FPATH | |
source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh | |
autoload -Uz compinit && compinit | |
fi |
x = [0.13, 0.13 + 10 ** -10] | |
dif_1 = abs(x[0]-x[1]) | |
dif = 0 | |
counter = 0 | |
while (dif < dif_1 * 1000): | |
counter += 1 | |
for i,value in enumerate(x): | |
x[i] = 2*value if value < 0.5 else -2*value + 2 | |
dif = abs(x[0]-x[1]) | |
print(counter) |