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
sourcegraph git:(main) brew services stop postgresql@15 | |
brew uninstall postgresql@15 | |
rm -rf /usr/local/var/postgres | |
rm /usr/local/var/log/postgres.log | |
rm -f ~/.psqlrc ~/.psql_history | |
Stopping `postgresql@15`... (might take a while) | |
==> Successfully stopped `postgresql@15` (label: homebrew.mxcl.postgresql@15) | |
Uninstalling /opt/homebrew/Cellar/postgresql@15/15.5_3... (3,700 files, 63MB) | |
rm: /usr/local/var/log/postgres.log: No such file or directory | |
➜ sourcegraph git:(main) git checkout jsm/sg-setup-pg |
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
### 1. i think realistically women want both. and both of those groups each already have one, so they’re trying to acquire the other | |
### 2. the addictive & isolating cycle of deep work: | |
### 3. being articulate might be the most underrated skill of all time. it's *the* most direct path to influence (aside from inheritance). it's a core competency of all the characteristics that make people trust you, look to you for direction: persuasiveness, charisma, sales, leadership | |
### 4. filling life with beauty is such a low hanging fruit way to improve our day to day, but i feel like we sometimes forget that beauty isn’t just visual—it’s five dimensional. i made a list (non-exhaustive) to remind myself what feels beautiful to all five senses. | |
### 5. life feels VERY different when you go from optimizing for appearances (looking like you have your shit together, heading in a direction that seems "good") to optimizing for alignment (*feeling* like you have your shit together, headed in a direction that *you* are excit |
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 anthropic import Anthropic | |
import time | |
anthropic = Anthropic(api_key="claude-api-key") | |
prompt_lengths = [100, 1000, 10000, 50000] | |
for prompt_length in prompt_lengths: | |
# generate a prompt of the desired length | |
prompt = "Human: " + "cars are great " * (prompt_length // 5) + "write an essay on cars" |
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 file is useful for reading the contents of the ops generated by ruby. | |
# You can read any graph defination in pb/pbtxt format generated by ruby | |
# or by python and then convert it back and forth from human readable to binary format. | |
import tensorflow as tf | |
from google.protobuf import text_format | |
from tensorflow.python.platform import gfile | |
def pbtxt_to_graphdef(filename): | |
with open(filename, 'r') as f: |
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
require 'tensorflow' | |
graph = Tensorflow::Graph.new | |
tensor_1 = Tensorflow::Tensor.new([[2, 2.3], [ 10, 6.2]]) | |
tensor_2 = Tensorflow::Tensor.new([[4, 3.2], [ 47, 1.2]]) | |
placeholder_1 = graph.placeholder('tensor1', tensor_1.type_num) | |
placeholder_2 = graph.placeholder('tensor2', tensor_2.type_num) | |
opspec = Tensorflow::OpSpec.new('Addition_of_tensors', 'Add', nil, [placeholder_1, placeholder_2]) | |
op = graph.AddOperation(opspec) | |
session_op = Tensorflow::Session_options.new |
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
require 'rubyplot' | |
@x1 = [] | |
@y1 = [] | |
for i in 0..1000 | |
num = Float(i) / Float(500) | |
puts num | |
x = Math.sin(num * Math::PI) | |
x = 16 * x * x * x | |
y = 13 * Math.cos(num * Math::PI) - 5 * Math.cos(2 * num * Math::PI) - 2 * Math.cos(3 * num * Math::PI) - 4 * Math.cos(num * Math::PI) |
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
require 'rubyplot' | |
@datasets = [ | |
[[20, 10, 5, 12, 11, 6, 10, 7], :Anna], | |
[[5, 10, 20, 6, 9, 12, 14, 8], :Jack], | |
[[19, 9, 6, 11, 12, 7, 15, 8], :Katie] | |
] | |
plot = Rubyplot::StackedBar.new(1000) | |
plot.title = 'Net earnings in different months' | |
plot.labels = { | |
0 => 'Jan', |
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
g = Rubyplot::Figure.new | |
@x1 = [7, 3, 3, 5.6, 5.6, 7, 7, 9, 9, 8] | |
@y1 = [10, 10, 4, 4, 5.4, 5.4, 4, 4, 6, 6] | |
g.line! @x1, @y1, line_width: 4, line_color: :green | |
@x2 = [11, 11, 15, 15, 11.3, 15] | |
@y2 = [4, 10, 10, 7, 7, 4] | |
g.line! @x2, @y2, line_width: 5, line_color: :stormy_blue |
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
cmd> plot "/var/folders/f0/g51qrlhs20zbb5f3qsn3y5r00000gn/T/go-gnuplot-444176234" title "Simple Circles" with circle | |
res> 112 | |
cmd> replot "/var/folders/f0/g51qrlhs20zbb5f3qsn3y5r00000gn/T/go-gnuplot-408069569" title "Simple Lines" with lines | |
res> 111 | |
cmd> set title "Test Plot" | |
res> 23 | |
cmd> set xlabel 'X-Axis' | |
res> 20 | |
cmd> set ylabel 'Y-Axis' | |
res> 20 |
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 ( | |
rbt "github.com/Arafatk/dataviz/trees/redblacktree" | |
) | |
func main() { | |
tree := rbt.NewWithIntComparator() | |
tree.Put(5, "e") | |
tree.Put(6, "f") |
NewerOlder