Skip to content

Instantly share code, notes, and snippets.

@zh3036
zh3036 / claude_3.5_sonnet_artifacts.xml
Created October 22, 2024 06:12 — forked from dedlim/claude_3.5_sonnet_artifacts.xml
Claude 3.5 Sonnet, Full Artifacts System Prompt
<artifacts_info>
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.
# Good artifacts are...
- Substantial content (>15 lines)
- Content that the user is likely to modify, iterate on, or take ownership of
- Self-contained, complex content that can be understood on its own, without context from the conversation
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)
- Content likely to be referenced or reused multiple times
from __future__ import print_function
from keras.preprocessing.image import ImageDataGenerator
import numpy as np
import os
import glob
import skimage.io as io
import skimage.transform as trans
Sky = [128,128,128]
Building = [128,0,0]
@zh3036
zh3036 / plotKeras.py
Created July 27, 2018 07:56
plotKeras.py
%matplotlib inline
import matplotlib.pyplot as plt
def plot_decision_boundary(X, y, model, steps=1000, cmap='Paired'):
"""
Function to plot the decision boundary and data points of a model.
Data points are colored based on their actual label.
"""
cmap = plt.get_cmap(cmap)
# Define region of interest by data limits
@zh3036
zh3036 / logReg.py
Last active July 27, 2018 07:54
logReg.py
model = Sequential()
model = Sequential([
Dense(1, activation='sigmoid', input_shape=(2,))
])
model.compile(loss='binary_crossentropy', optimizer='sgd',metrics=['accuracy'])
model.fit(x=np.array(x).reshape(200,2),y=y,batch_size=15,epochs=25)
@zh3036
zh3036 / xiaoqi.py
Created October 31, 2017 21:30 — forked from anonymous/xiaoqi.py
import Tkinter
import socket
#task1
class log():
def __init__(self,root):
self.lab1=Tkinter.Label(root1,text="Username",relief=Tkinter.FLAT)
self.lab1.pack()
self.window=root
self.tusername = Tkinter.Entry(root1,bd=2,width=20)
self.tusername.pack()
@zh3036
zh3036 / rank.py
Created September 22, 2017 13:19 — forked from anonymous/rank.py
highschool rank sample
def readData(Data):
# here try to manually make xls file into a csv file and check python CSV library
# Q: what kind of variable do you want to use to store the file?
# list? 1-d list? 2-d list? dictionary? set?
pass
varoefdata=None
return varoefdata
def seperateData(data_var):
# supposely you could use a dictionary
@zh3036
zh3036 / sim.py
Created November 27, 2016 10:33
import random
size = 1000
men = range(size)
men = [i for i in men]
women = range(size)
matched_men = set()
matched_women = set()
def avg(ar):
if len(ar)>0:
def answer(x,y,z):
def allequal(L):
a = [i for i in L if i == L[0]]
return len(a)==len(L)
def format(m,d,y):
a=[m,d,y]
for i in range(0,3):
if a[i]<10:
a[i]="0"+str(a[i])
else: