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
#!/bin/false | |
# This file will be sourced in init.sh | |
# https://raw.githubusercontent.com/ai-dock/comfyui/main/config/provisioning/animated.sh | |
printf "\n##############################################\n# #\n# Provisioning container #\n# #\n# This will take some time #\n# #\n# Your container will be ready on completion #\n# #\n##############################################\n\n" | |
## Set paths | |
## main paths |
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
julia> let_in_pos = Dict{Int,Char}(); | |
julia> let_not_in_pos = Dict{Char,Vector{Int}}(); | |
julia> let_not_in_word = Set{Char}(); | |
julia> word_set = copy(words); | |
julia> word=rand(word_set) | |
"excel" | |
julia> update_constraints_by_response!(word, "00020", let_in_pos, let_not_in_pos, let_not_in_word) | |
julia> word_set_reduction!(word_set, let_in_pos, let_not_in_pos, let_not_in_word) | |
698-element Vector{String}: |
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
lines = readlines("input20.txt") | |
algo = lines[1]|> x->[c=='.' ? false : true for c in x] | |
imag = lines[3:end] .|> (x->[c=='.' ? false : true for c in x]) |> x->hcat(x...) | |
# pad the image by zeroes to simulate the infnitued | |
function pad(imag,pad) | |
oldsize = size(imag) | |
newsize = oldsize .+ 2*pad | |
new_imag = zeros(eltype(imag), newsize...) | |
new_imag[pad+1:oldsize[1]+pad,pad+1:oldsize[2]+pad] .= imag |
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
input_dir = "images_need_fix/" | |
output_dir = "images_fixed/" | |
input_files = readdir(input_dir) | |
filter!(x->endswith(x,"png"),input_files) | |
for f in input_files | |
input_base_name = splitext(f)[1] | |
output_file_name = input_base_name*".jpg" | |
from = joinpath(input_dir,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
"Pascal triangle" | |
function pascal(n) | |
(n<=0) && error("Pascal trinalge can not have zero or negative rows") | |
r=Vector{Int}(undef,n) | |
pr=Vector{Int}(undef,n) | |
pr[1]=r[1]=1 | |
println(@view pr[1]) | |
for i=2:n | |
r[1]=r[i]=1 | |
for j=2:i-1 |
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
round_up(x,m::Integer)=ceil(Int,x/m).*m | |
round_down(x,m::Integer)=floor(Int,x/m).*m |
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
using Interpolations, Plots | |
# Demonstrating interpolations | |
x=0:0.5:2π | |
y=sin.(x); | |
itp=LinearInterpolation(x,y); | |
y2=[itp(x) for x in 0:0.1:2]; | |
x2=0:0.1:6; | |
y2=[itp(x) for x in x2]; | |
itpC=CubicSplineInterpolation(x,y); |
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
using CSV | |
data=CSV.read("Jan19.csv") | |
# The occursin is used to get the line where the transfer happened...hence summing all transfers | |
audi_ind=findall(x->ismissing(x) ? false : occursin(r"audi"i,x), data[:,1]) | |
data[audi_ind,1:3][:Cash] |> x-> prod.(split.(x,',')) |> x-> Meta.parse.(x) |> sum |
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
#= | |
I was getting the following errors when running | |
Pkg.update("TensorFlow") | |
On my ubunutu 14.04 | |
INFO: Building TensorFlow.jl for CPU use only. To enable the GPU, set the TF_USE_GPU environment variable to 1 and rebuild TensorFlow.jl | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 | |
curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none |
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
# Reading a fusion table from Julia | |
using Requests, DataFrames | |
request_url = "https://www.googleapis.com/fusiontables/v2/query" | |
query = "SELECT * FROM 1KlX4PFF81wlx_TJ4zGudN_NoV_gq_GwrxuVau_M" | |
resp=get(request_url,query=Dict("sql"=>query, "key"=>"somekey","alt"=>"csv")) | |
myTable=readtable(IOBuffer(resp.data)); |
NewerOlder