This file contains hidden or 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
| function claude-session | |
| set repo_root (git rev-parse --show-toplevel 2>/dev/null) | |
| if test $status -ne 0 | |
| echo "Not in a git repo, launching claude normally" | |
| claude $argv | |
| return | |
| end | |
| set base_branch (git symbolic-ref --short HEAD) |
This file contains hidden or 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
| import fs from 'fs' | |
| import * as jsondiffpatch from 'jsondiffpatch' | |
| const diffInstance = jsondiffpatch.create({ | |
| objectHash: function (obj) { | |
| // this function is used only to when objects are not equal by ref | |
| return obj._id || obj.id | |
| }, | |
| }) |
This file contains hidden or 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
| const fs = require('fs') | |
| // Read the file | |
| function parseFile(filename, callback) { | |
| fs.readFile(filename, 'utf8', (err, data) => { | |
| if (err) { | |
| console.error(err) | |
| return | |
| } |
This file contains hidden or 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
| {"total":3,"list":[{"id":"61f049424f347211410b0d51","title":{"code":"media-title-61f049424f347211410b0d51","translations":{"en":"","it":"Running Burn"}},"shortDescription":{"code":"media-shortdescription-61f049424f347211410b0d51","translations":{"en":"","it":"Obiettivo? Aumentare e migliorare le proprie tecniche di corsa. Il programma comprende tutte e 4 le andature proposte dalle più lente (walk) a quelle più performanti (sprint)."}},"fullDescription":{"code":"media-fulldescription-61f049424f347211410b0d51","translations":{"en":"","it":"Obiettivo? Aumentare e migliorare le proprie tecniche di corsa. Il programma comprende tutte e 4 le andature proposte dalle più lente (walk) a quelle più performanti (sprint)."}},"duration":0,"mainTrainer":"61f02951587ff91062d0d7db","mediaType":0,"activity":{"id":"61f028314f347211410b0d4a","name":{"code":"activity-name-61f028314f347211410b0d4a","translations":{"en":"Running","it":"Running"}}},"mainPlaylist":"","levelOfDifficulty":"0","allowedUserRoles":[""],"numberOfLikes":0, |
This file contains hidden or 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
| def mat(M): | |
| """verifica se M è una matrice""" | |
| m = M[0] | |
| n = M[1] | |
| L = M[2] | |
| if not(type(M)==tuple and len(M)==3): | |
| return False | |
| if not(type(L)==list and len(L)==m*n): | |
| return False | |
| if not(type(m)==type(n)==int and m>0 and n>0): |
This file contains hidden or 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
| def mat(M): | |
| """verifica se M è una matrice""" | |
| m = M[0] | |
| n = M[1] | |
| L = M[2] | |
| if not(type(M)==tuple and len(M)==3): | |
| return False | |
| if not(type(L)==list and len(L)==m*n): | |
| return False | |
| if not(type(m)==type(n)==int and m>0 and n>0): |
This file contains hidden or 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
| def mat(M): | |
| """verifica se M è una matrice""" | |
| if not(type(M)==tuple and len(M)==3): | |
| return False | |
| m,n,L=M | |
| if not(type(m)==type(n)==int and m>0 and n>0): | |
| return False | |
| if not(type(L)==list and len(L)==m*n): | |
| return False | |
| return all(type(x)==int for x in L) |
This file contains hidden or 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
| def mat(M): | |
| """verifica se M è una matrice""" | |
| if not(type(M)==tuple and len(M)==3): | |
| return False | |
| m,n,L=M | |
| if not(type(m)==type(n)==int and m>0 and n>0): | |
| return False | |
| if not(type(L)==list and len(L)==m*n): | |
| return False | |
| return all(type(x)==int for x in L) |
This file contains hidden or 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
| def mat(M): | |
| """verifica se M è una matrice""" | |
| if not(type(M)==tuple and len(M)==3): | |
| return False | |
| m,n,L=M | |
| if not(type(m)==type(n)==int and m>0 and n>0): | |
| return False | |
| if not(type(L)==list and len(L)==m*n): | |
| return False | |
| return all(type(x)==int for x in L) |
This file contains hidden or 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
| import random | |
| from ausiliarie import is_istogramma, is_markov_analysis, int_pos, word as is_word | |
| def bsearch_first_geq(lst, p): | |
| search = lst[:] | |
| index = 0 | |
| while search: | |
| i = len(search) // 2 | |
| _, val = search[i-1] | |
| if val < p: |
NewerOlder