This file contains 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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"html" | |
"log" | |
"net/http" | |
"os" |
This file contains 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
// this is a comment | |
Node: Type { | |
data: T | |
next: Box<Node<T>> | |
} | |
LinkedList: Type<T> { | |
head: Box<Node<T>> |
This file contains 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
# this is just an example to get you started. a typical library package | |
# exports the main api in this file. note that you cannot rename this file | |
# but you can remove it if you wish. | |
# import trash_nim/submodule | |
# import llvm/core | |
import sequtils, options, tables, unicode, strutils, sugar, json, marshal | |
# {.passc: gorge(" llvm-config --cflags").} |
This file contains 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 numpy as np | |
# Define the sigmoid activation function | |
def sigmoid(x): | |
return 1 / (1 + np.exp(-x)) | |
# Define the derivative of the sigmoid function | |
def sigmoid_derivative(x): | |
return x * (1 - x) |
This file contains 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 net, asyncnet, asyncdispatch | |
proc ms_greet(s: AsyncSocket | Socket): Future[void] {.multisync.} = | |
await s.send("hi") | |
proc s_greet(s: Socket): void = | |
s.send("hi") | |
proc as_greet(s: AsyncSocket): Future[void] {.async.} = | |
await s.send("hi") |
This file contains 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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"sync" | |
"github.com/chasefleming/elem-go" | |
"github.com/chasefleming/elem-go/attrs" | |
"github.com/chasefleming/elem-go/htmx" |
This file contains 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
# this is just an example to get you started. a typical library package | |
# exports the main api in this file. note that you cannot rename this file | |
# but you can remove it if you wish. | |
# import trash_nim/submodule | |
# import llvm/core | |
import sequtils, options, tables, unicode, strutils, sugar, json, marshal | |
# {.passc: gorge(" llvm-config --cflags").} |
This file contains 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
# this is just an example to get you started. a typical library package | |
# exports the main api in this file. note that you cannot rename this file | |
# but you can remove it if you wish. | |
# import trash_nim/submodule | |
# import llvm/core | |
import sequtils, options | |
# {.passc: gorge(" llvm-config --cflags").} |
This file contains 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 std = @import("std"); | |
const EleKind = enum { | |
NewDocument, | |
Html, | |
DocType, | |
Head, | |
Body, | |
Meta, | |
Link, |
This file contains 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
from enum import Enum | |
from typing import Dict, List, Optional, Callable, Any, Type, TypeVar, Union | |
from enum import Enum | |
from typing import Union | |
from typing_extensions import Self | |
import inspect | |
from dataclasses import dataclass | |
class Tag(Enum): |