Skip to content

Instantly share code, notes, and snippets.

View woniesong92's full-sized avatar

Howon Song woniesong92

View GitHub Profile
@woniesong92
woniesong92 / LLM.md
Last active March 29, 2023 04:17 — forked from rain-1/LLM.md
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@woniesong92
woniesong92 / example.js
Created February 23, 2018 07:43
Send a signed transaction to a contract in Ethereum
// Sending a signed transaction to a contract
// using the contract's owner's private key
// "web3": "^1.0.0-beta.30"
// "ethereumjs-tx": "^1.3.3",
// createItem function takes (name, price) as args
const web3 = new Web3(new Web3.providers.HttpProvider(INFURA_URL))
const myContract = new web3.eth.Contract(MY_ABI, MY_CONRACT_ADDRESS)
const ownerAccount = ""
const ownerPrivateKey = ""
subredditByTitle: {
food: {
id: subreddit_1,
title: "food"
posts: [post_1, post_2]
}
culture: {
id: subreddit_2,
title: "culture"
posts: [post_3, post_4]
subreddits: [{
title: "food"
posts: [{
id: "",
body: "..",
comments: [{
id: ".."
body: "..",
}]
..morePosts
$meteor create simple
$cd simple
$meteor
from math import sqrt
#x1 = X1 = midpt1.x
#x2 = X2 = midpt2.x
def getT(x, x1, x2):
x0 = 0.0 # origin
out1 = ((2.0 * x0 - x1) + sqrt(((-2.0 * x0 + x1) ** 2.0) - ((4 * (x0 - 2.0 * x1 + x2)) * (x0 - x)))) / (2.0 * (x0 - 2.0 * x1 + x2))
out2 = ((2.0 * x0 - x1) - sqrt(((-2.0 * x0 + x1) ** 2.0) - ((4 * (x0 - 2.0 * x1 + x2)) * (x0 - x)))) / (2.0 * (x0 - 2.0 * x1 + x2))
return (out1, out2)
$(function() {
window.data = [{name: "Amanda", vote: 0},
{name: "Katie", vote: 0},
{name: "Janice", vote: 0},
{name: "Kim", vote: 0},
{name: "Amy", vote: 0}];
window.pubnub = PUBNUB.init({
channel: "survey",
publish_key: "pub-c-aa0da548-076b-4c46-bf87-87d2d457368a",
.bar {
font: 10px sans-serif;
background-color: #e74c3c;
text-align: right;
padding: 3px;
margin: 1px;
height: 40px;
line-height: 35px;
color: white;
margin-left: 120px;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Realtime survey with PubNub and D3JS</title>
<link rel="stylesheet" href="index.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" />
</head>
<body>
<div class="container">
function init_votes() {
pubnub.history({
channel: 'survey',
start: 0,
callback: function(msg) {
var vote_history = msg[0];
for (var i=0; i<vote_history.length; i++) {
increment(vote_history[i]);
}
}