Skip to content

Instantly share code, notes, and snippets.

-}
-
-export function useStartRecording() {
- const recorder = useAtomValue(recorderAtom);
- const setIsRecording = useSetAtom(isRecordingAtom);
- const setError = useSetAtom(errorAtom);
- const setChatHistory = useSetAtom(chatHistoryAtom);
@rjpower
rjpower / squash.py
Created January 21, 2025 00:30
auto-squash aider commits
#!/Users/power/bin/.venv/bin/python
"""Automatically squash all commits not in the origin.
Nice to compact down aider commits.
"""
import subprocess
from litellm import completion

Okay, let's analyze the errors and their root causes from the provided test results.

General Observations:

  1. Type Errors: A large portion of the failures are due to TypeError. The model frequently tries to use types incorrectly in the code generated (e.g., performing arithmetic operations on an int and a ComplexNumber, or passing a dictionary to a function expecting a string).
  2. Logical Errors: The model's code also suffers from logical errors. For example, the from_pov and path_to logic is flawed, leading to incorrect tree re-orientations. The two_bucket logic has an issue with switching buckets and not exploring all states. The change method's greedy algorithm fails at edge cases, the book_store code has pricing logic mistakes and the variable-length-quantity code has some issues with bit operations.
  3. Incorrect Input Parsing: Some tests fail because the model's code fails to properly parse the input data. These include issues parsing SGF format, handling numerical str
@rjpower
rjpower / chat_history.md
Last active December 17, 2024 05:24
Aider Benchmark - Gemini Flash 2.0

Chat History for ./pov

aider chat started at 2024-12-16 22:53:32

Aider v0.69.2.dev8+g1869ab94.d20241216
Model: gemini/gemini-2.0-flash-exp with diff edit format
Git repo: none
Repo-map: disabled
Added pov.py to the chat.

def cleanup_html(
html: str,
strip_tags=["head", "script", "svg", "style", "doctype"],
attrs=["data-.*", "^_.*", "aria-.*", "^value$", "^style$"],
):
html = re.sub(r"<!DOCTYPE[^>]*>", "", html, flags=re.IGNORECASE)
soup = bs4.BeautifulSoup(html, "html.parser")
for tag in soup.find_all(strip_tags):
@rjpower
rjpower / main.dart
Last active June 26, 2022 15:59
flutter_hooks reproducer
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
void main() {
runApp(MyApp());
}
enum ChildType { a, b }
class ChildState<T> {
session_config = tf.ConfigProto(
intra_op_parallelism_threads=64,
inter_op_parallelism_threads=4,
)
...
run_config = tpu.RunConfig(
session_config=session_config,
@rjpower
rjpower / test.py
Last active December 12, 2018 20:34
disable grappler
from tensorflow.core.protobuf import rewriter_config_pb2
config = tf.ConfigProto()
config.graph_options.rewrite_options.memory_optimization = (
rewriter_config_pb2.RewriterConfig.NO_MEM_OPT)
off = rewriter_config_pb2.RewriterConfig.OFF
config.graph_options.rewrite_options.layout_optimizer = off
config.graph_options.rewrite_options.constant_folding = off
config.graph_options.rewrite_options.arithmetic_optimization = off
config.graph_options.rewrite_options.dependency_optimization = off
config.graph_options.rewrite_options.loop_optimization = off
import tensorflow as tf
import sys
from tensorflow.contrib.tpu.python.tpu import session_support
def reset_tpu(name):
print('Resetting: %s' % name)
resolver = tf.contrib.cluster_resolver.TPUClusterResolver(tpu=name, job_name='worker')
address = resolver.master()
cluster_def = resolver.cluster_spec().as_cluster_def()
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,