- Second price auctions (2PA) are a type of auction where the highest bidder pays the second highest bid
- In contrast to first price auctions (FPA), where the highest bidder pays her own bid
- Why 2PA work better than FPA
| #!/bin/sh | |
| # message can come from script args or environment | |
| message=${message:-"${*}"} | |
| model=${model:-"@cf/mistral/mistral-7b-instruct-v0.1"} | |
| system=${system:-"You are a consice AI assistant. You help the user the best you can. If you don't know something, you admin it and ask clarifying questions. Use markdown as needed."} | |
| post_data=$(cat <<JSON | |
| {"messages":[{"role":"system","content":"${system}"},{"role":"user","content":"${message}"}],"max_tokens":10240,"stream":true} | |
| JSON | |
| ) |
| query IntrospectionQuery { | |
| __schema { | |
| queryType { name } | |
| mutationType { name } | |
| types { | |
| ...FullType | |
| } | |
| directives { | |
| name | |
| description |
| #!/usr/bin/env python | |
| import argparse | |
| import sys | |
| import sqlparse | |
| from pygments import highlight | |
| from pygments.lexers import get_lexer_by_name | |
| from pygments.formatters import TerminalTrueColorFormatter | |
| def prettyPrint(raw_sql): |
| alias λ lambda | |
| sadd = λ {|ns, a| [*ns, a].sort } | |
| hsort = λ {|h| Hash[h.sort] } | |
| hadd = λ {|h, n, g| h.merge(g => sadd.(h[g], n)) } | |
| school = λ {|gs| School.new(gs) } | |
| School = Struct.new(:gs) do | |
| define_method :add, λ {|n, g| (school . (hsort . (hadd . (to_hash, n, g)))) } | |
| define_method :to_hash, λ {| | gs || {} } |
| # Load this file in your `.pryrc` | |
| # | |
| # load 'path/to/pry_sql.rb' | |
| # | |
| # See how to use this by running: `psql --help` | |
| # Originally created for Rails 3. | |
| # Updated to Rails 6 | |
| module Rails | |
| class DBConsole | |
| APP_PATH = Rails.root.join('config', 'application') |
| hardstatus alwayslastline | |
| hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]' |
Searching can be an efficient way to navigate the current buffer.
The first search commands we learn are usually / and ?. These are seriously cool, especially with the incsearch option enabled which lets us keep typing to refine our search pattern. / and ? really shine when all we want is to jump to something we already have our eyeballs on but they are not fit for every situation: