#voice-chat-text-0

1 messages Β· Page 870 of 1

orchid barn
#

but we want to make it

#

recursively

#

download windows terminal

wise glade
#
L = []
def sequence(N):
  if N == 0:
    return
  L.append(N-1)
  sequence(N-1)

then later reverse it πŸ€·β€β™‚οΈ

#

that's just the top of my head

orchid barn
#

you see @rain rose

rain rose
#

What

orchid barn
#

srry

#

wrong kaden

#

Xd

rain rose
#

Wrong ping?

#

Ah

orchid barn
#

@whole bear

rain rose
#

Understandable

orchid barn
#

lets generate 0,2,4,6,8,

#

now the question is

#

if i give a formula

#

the generates a sequence

#

can you tell me whether the sequence will go forever

#

or it will "end" at some number

#

let me give you a formula

wise glade
#

@orchid barn ```py
def generate_sequence(my_sequence, N):
if N == 0:
return
my_sequence.append(N)
generate_sequence(my_sequence, N-1)

def sequence(N):
my_sequence = []
generate_sequence(my_sequence, N)
my_sequence.reverse()
return my_sequence

print(sequence(10))

this works for me
orchid barn
#

you don't need to reverse

#

if you do it this way

wise glade
#

been a while, since I've written any python πŸ₯²

orchid barn
#

sorry, i was busy.

#

Xd

#

it's ok ^^

wise glade
#

I feel like, Opal's gonna show something really good πŸ™‚

marble ledge
#

i just joined, is there any way i can contribute ?

wise glade
#

idk, sukuna is doing it all πŸ€·β€β™‚οΈ
_only fans will know 😏 _

novel portal
#

ah yeah why is it *2 when ur adding two to the previous number

somber heath
#
for value in range(10):
    print(value)```

The first time through the loop, `value` will have the first element from range assigned to it. The second, the second and so on. 0 to 9. A total of 10 values.

```py
for value in (9,5,3):
    print(value)```
Similar again, but this time, value has 9 assigned to it the first time, 5 the second, 3 the third.
wise glade
#

oh, common Opal 😠
I thought some list comprehension was coming at least

urban whale
#

🀣

novel portal
#

yeah u should put an elif n = 0: n+= 2 or something

wise glade
#

shi*, Opal's on phone rn πŸ˜‚

#

he wrote that on phone

#

with proper formatting and everything

marble ledge
#

ooh your just tracing the code

somber heath
#

Don't sound too surprised.

marble ledge
#

sequence of what ?

#
def fac(n):
    if n == 1:return 1
    return n * fac(n-1)
novel portal
#

idk, any recursice sequence

marble ledge
#

best example ig

#

you had initially defined l = [1]

#

when you called the function

somber heath
#

!e ```py
def func(v=1):
print(v)

func()
func(2)```

wise cargoBOT
#

@somber heath :white_check_mark: Your eval job has completed with return code 0.

001 | 1
002 | 2
wise glade
#

I once wrote something like this in C++ πŸ˜‚ c++ void myFunc() { try { while (true) { myFunc(); } } catch (StackOverflowException e) { while (true) { myFunc(); } }

whole bear
#

what are we doing on here?

wise glade
#

Sukuna is teaching
_only fans know 😏 _

somber heath
whole bear
#

how

wise glade
#

dude, this is the best I can do @whole bear πŸ™‚

#

It's friday night, I watch anime today πŸ™‚

#

and don't work πŸ™‚

novel portal
#

do I see

oak oracle
#

By every iteration the n increases by 1 until it reaches the threshold given

novel portal
#

a weeb?

#

what anime tho

wise glade
novel portal
#

i see

wise glade
#

but if I tell you, what I'm watching rn
you're gonna kill me πŸ₯² ( if you're a weeb too )

novel portal
#

u cant be too sure

wise glade
#

||Naruto||

#

I've literally started a week ago πŸ₯²

novel portal
#

i see

#

are u

#

new?

wise glade
#

πŸ˜‚ , yeah, to naruto

#

only naruto

novel portal
#

no to anime

wise glade
#

not to ||AOT||, ||Death Note||, ||Haikyuu||, ||other good stuff||

novel portal
#

what

wise glade
#

lemme go check my server

oak oracle
#

Yaoi or nothing lol

novel portal
#

then what have u watch

wise glade
#

it's on a bot command, on my server

novel portal
#

i see

terse olive
#

Hello!

#

How are you guys doing today

#

I used to be in this server accidentally left though

#

now i cant talk

#

but its cool

novel portal
terse olive
#

ill get my messages back

novel portal
oak oracle
wise glade
#

@orchid barn I remember learning my recursive functions
with a pen and paper, then later code it
I believe it's mandatory for proper comprehension

novel portal
#

i made a program first

#

for fibonacci series and factorial

wise glade
novel portal
#

i see

wise glade
#

I mean, just doing it for fun
I would just forget it, like, after a week later

novel portal
#

lol

wise glade
#

in fact, I think, I've never used recursion in any of my projects πŸ˜‚

novel portal
#

neither have i but it came as a question for my exam

#

so we had to write a program just for that

marble ledge
#
x = list(range(100))
y = [f(r) for r in x]
plt.plot(x,y)
orchid barn
#

yea @wise glade true

novel portal
#

why do u use terminal tho

marble ledge
#

its not his main IDE ig

novel portal
#

i see

wise glade
#

I mean, I don't use it πŸ™‚

marble ledge
marble ledge
wise glade
#

too soon πŸ˜‚

oak oracle
#

Same as linear programming

marble ledge
#

πŸ˜‚

novel portal
#

i see

wise glade
#

@whole bear ```py
def recursiveFunction(n):
if (n == 5):
return
else:
n += 1
print("Hello")
recursiveFunction(n)
recursiveFunction(0)

do you understand this?
marble ledge
#
print('hello world')
import __file_name__

@orchid barn what does this return ? is it also recursive ?

#

yeah lol

novel portal
#

wait

whole bear
#

Appreciation everyone trying to teach me

#

means alot

#

πŸ™‚

wise glade
novel portal
#

wont it just run once

#

because its not in a loop

marble ledge
#

from os import system
system('pwd')

oak oracle
#

Is there a major difference between glob.glob and os when it comes to locating files on the PC??

errant nova
#

from https://docs.python.org/3/library/functools.html

from functools import chache

@cache
def factorial(n):
    return n * factorial(n-1) if n else 1

print(factorial(10))      # no previously cached result, makes 11 recursive calls
# 3628800
print(factorial(5))       # just looks up cached value result
# 120
print(factorial(12))      # makes two new recursive calls, the other 10 are cached
# 479001600
marble ledge
#

lmao cd and mkdir

wise glade
#

@rugged root tell us something about this
when you come back

print('hello world')
import fileName
marble ledge
errant nova
#

that would be for lru_cache

errant nova
novel portal
#

i want to try making web applications

#

so should i use django or flask

wise glade
#

python having an inbuilt cyclic import check
pretty nice πŸ™‚

marble ledge
marble ledge
novel portal
#

oh ok

wise glade
#

React all the way πŸ™‚

novel portal
#

lol then what do i use

marble ledge
#

nah it doesnt

novel portal
#

@orchid barn what did u say u use

oak oracle
#

Are Microsoft Visual Studio and PyCharm used for the same thing? I'm Data scientist sry I use only JupyterLab and Google Collab so dunno πŸ™‚

marble ledge
#

: (

novel portal
#

oh ok

wise glade
novel portal
#

lol is this a class

marble ledge
oak oracle
#

Oh ok, thanks

errant nova
#

In how far is the flask documentation not generated? It looks very much like sphinx

wise glade
#

I used to do these DSA questions before.., I got in the industryπŸ™‚

#

now I don't need to

marble ledge
#

i saw a few leetcode problems on this

#

dont remember XD

wise glade
#

hint for people who are actually doing this:-

marble ledge
wise glade
#

you have n
and let's say you grab a from the list
now you just need to find b which would be .....?? using a + b = n .....?

wise glade
#

not the best big O time

novel portal
#

looks fine to me

marble ledge
#

actually idk what are complexity and space

wise glade
marble ledge
#

basically something like the number of dimensions used in the algo ?

wise glade
#

everyone should know this at least πŸ‘†

marble ledge
#

dude imma 12th grader XD

wise glade
#

it's missing exponential πŸ€”

#

it's even worse

marble ledge
#

so lesser the derivative of the graph the better the algo is

wise glade
novel portal
#

ur french?

#

i see

marble ledge
#

ok wait then what would be the best algo for that

#

?

novel portal
#

the double for loop is much simpler to think of tho

marble ledge
#

unique value

wise glade
#

for the problem he gave earlier about a + b = n
it'll be O(nLogn)

novel portal
#

i dont think i understand

orchid barn
grand acorn
novel portal
#

no

austere walrus
#

what is the name of the program you're using right now?

novel portal
#

i basically had to learn most python myself

austere walrus
#

not tihs LOL

marble ledge
#

lmao

novel portal
#

because my teacher barely taught anything

grand acorn
#

I would check out the link from @orchid barn

marble ledge
austere walrus
#

the one who look like cmd

wise glade
#

unless...

marble ledge
#

i love math i dont mind

novel portal
#

yeah i feel like its more interesting learning myself as well

grand acorn
#

unless you are exceptionally fortunate and have a great teacher :)

novel portal
#

that would've been great as well

austere walrus
grand acorn
#

it's never too late to, unless you are 100% done with college and don't intend to pursue post-grad education

novel portal
#

ah i got that but how do u think about reducing it for that program

wise glade
#

just read any material on big O notation
and before you start solving some problems
Just look into Arithmetic Progression and Geometric Progression
and you're good

#

you will be able to calculate any problem's big O

#

ok, see you guys later πŸ‘‹

novel portal
#

bye

#

but before u go

#

@wise glade why does java suck?

marble ledge
#

quick input and output

austere walrus
#

Thx!

fallow summit
#

!voice

wise cargoBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

orchid barn
novel portal
#

yeah

#

what does i++ do

#

i dont really know java

grand acorn
novel portal
#

ah ok

grand acorn
#

it's a shortcut common in c-based languages

novel portal
#

k thnx

#

ah yeah

tacit dome
#

what are we making here?

novel portal
#

idk he's just explaining stuff

tacit dome
#

oh

#

ok thanks

novel portal
#

rn how to reduce runtime i think

marble ledge
#
def fun(l,n):
    for x in range(len(l)):
        if (n-l[x]) in l:
            print(x,n-x)

wait i got it ig @orchid barn

grand acorn
# orchid barn

For fun, I am making this as condensed as possible :) (it might not work, my js is not great)```js
let sum = (arr) => arr.reduce((total, x) => total + x, 0);

#

yay it works

orchid barn
#

@rugged root can you make me stream again ?

marble ledge
#

lmao

zenith epoch
marble ledge
#

nope

#

look at the slope

#

slope of O(1) = 0

#

so i think its the best

marble ledge
tacit dome
#

so what r people doing here?

orchid barn
#

we were discussing asymotic analysis

tacit dome
#

Oh

#

and your live went out

#

ok

orchid barn
#

ye

tacit dome
#

is there some rule about chitchating?

rugged root
#

?

#

What do you mean

marble ledge
rugged root
#

@orchid barn What're you wanting to stream?

orchid barn
#

i'm doing some data strucuters and algor discussions

rugged root
#

Oh yeah

#

!stream 176058829128073216

wise cargoBOT
#

βœ… @orchid barn can now stream until <t:1627062656:f>.

tacit dome
#

ok thx

marble ledge
#

i can just loop through ai and aj and find ak as ak = -ai - aj

rugged root
#

A dict in Python is a good example of a hash map

marble ledge
#

len(set(l)) ?

#

yeah

#

@orchid barn isnt l a list ?

#

u used it in a range thing

orchid barn
#

we can do it as a list

#

but the problem

marble ledge
#

but you did for j in range(i,l)

#

ooh ok

#

dude what i was saying is you cant use range function with a list input

#

yeah lol

#

oooof that was quick

#

it does ig

#

just append it into a list l and do s = set(l)

#

the one you remove first

#

e.sort() ?

#

del d[key]

#
d[l_k-1] = d[l_k]
rotund scaffold
#

select and press enter

#

that copies in windows atleast

#

right click and mark

#

you can

#

delete dots easily

#

shift + alt and drag select the dots

orchid barn
#

s = set()
...:
...:
...: for i in range(len(l)):
...: for j in range(len(l)):
...: if i == j:
...: continue
...:
...: l_k = -(l[j] + l[i])
...: if l[i] in d.keys() and l[j] in d.keys():
...: if l_k in d.keys():
...: e = sorted([l[i], l[j], l_k])
...:
...: l_i, l_j, l_k = e
...: d[l_k] -= 1
...: d[l_i] -= 1
...: d[l_j] -= 1
...: if d[l_k] == 0:
...: del d[l_k]
...: if d[l_i] == 0:
...: del d[l_i]
...: if d[l_j] == 0:
...: del d[l_j]
...:
...:
...: s.add((l_i, l_j, l_k))
...:
...:
...:

marble ledge
#

i tried 😦

rotund scaffold
#

I think im done for the day, thanks for explanations, twas fun

ocean timber
#

darn i'm late to the party, can I ask what we are trying to accomplish here?

desert sluice
#

same

marble ledge
#

alright guys i think i will sleep now, thanks i am so satisfied today XD

grand acorn
alpine path
#

httpx.get("/my/url", params={"foo": "bar"})

orchid barn
#

gonna get cup of tea one min.

alpine path
#

brb dogs barking

grand acorn
#

Buddhist cosmology is the description of the shape and evolution of the Universe according to the Buddhist scriptures and commentaries.
It consists of temporal and spatial cosmology: the temporal cosmology being the division of the existence of a 'world' into four discrete moments (the creation, duration, dissolution, and state of being dissolve...

oak oracle
#

@uneven yarrow don't mean to interrupt but since you said you are from Israel, one Israely girl got a statue in my town a few days ago: https://emedjimurje.net.hr/vijesti/drustvo/4073744/memorijalna-setnja-hrvatski-i-izraelski-vojnici-zajedno-u-spomen-na-junakinju-hannu-szenes/

#

Čakovec

#

Kiryat Tiv'on

#

brb

quasi parrot
#

@strong arch programming linkedin

orchid barn
#

dayum

#

Psilocybin with psychological support is showing promise as a treatment model in psychiatry but its therapeutic mechanisms are poorly understood. Here, cerebral blood flow (CBF) and blood oxygen-level dependent (BOLD) resting-state functional connectivity (RSFC) were measured with functional magnetic resonance imaging (fMRI) before and after treatment with psilocybin (serotonin agonist) for treatment-resistant depression (TRD). Quality pre and post treatment fMRI data were collected from 16 of 19 patients. Decreased depressive symptoms were observed in all 19 patients at 1-week post-treatment and 47% met criteria for response at 5 weeks.

#

Quality pre and post treatment fMRI data were collected from 16 of 19 patients. Decreased depressive symptoms were observed in all 19 patients at 1-week post-treatment and 47% met criteria for response at 5 weeks.

oak oracle
#

Gotta go, have fun and thanks for talking everyone

orchid barn
#

u2

grand acorn
#

peace!

orchid barn
#

aeros, what's the idea behind they pronouns?

#

is it making an assumption can send a potentially harmful message?

#

that people have to look a certain way to demonstrate the gender that they are or are not

grand acorn
#

oh no, I just indentify as non-binary but if ppl use different pronouns I don't really mind much

#

im not the type to be offended :)

orchid barn
#

ah

#

cool!

#

thanks

grand acorn
#

np!

orchid barn
#

aeros what is the tibetan music?

grand acorn
#

this is also another favorite of mine: https://www.youtube.com/watch?v=IXsI99aaFaw&t=8138s (although not strictly tibetan)

MEDICINE BUDDHA MANTRA CHANTS @285Hz
πŸ§˜β€β™‚οΈ Best Healing Mantra Meditation

Chanting this mantra helps in eliminating the pain of true suffering. This mantra not only helps in reducing physical pain but also the suffering and pain caused by negative thoughts and emotions.

Complete MEDICINE BUDDHA MANTRA & ITS MEANING

Tayatha Om Bekandze Bekandz...

β–Ά Play video
#

Having dwelt upon the nature of nirvana, the Buddha now explains its positive aspect and says that nirvana has the four attributes of the Eternal, Bliss, the Self, and the Pure ... the Buddha says: "O you bhiksus [monks]! Do not abide in the thought of the non-eternal, sorrow, non-Self, and the not-pure and have things as in the case of those people who take the stones, wooden pieces and gravel for the true gem [of the true Dharma] ... In every situation, constantly meditate upon the idea of the Self, the idea of the Eternal, Bliss, and the Pure ... Those who, desirous of attaining Reality meditatively cultivate these ideas, namely, the ideas of the Self [atman], the Eternal, Bliss, and the Pure, will skilfully bring forth the jewel, just like the wise person."

misty trout
#

So of i want to talk in a voice channel i must send 50 messeges

wise cargoBOT
#

failmail :ok_hand: applied mute to @misty trout until <t:1627077144:f> (9 minutes and 59 seconds) (reason: burst rule: sent 8 messages in 10s).

orchid barn
#

single value decomposition

#

f(x;w) = w x, (w is number) (x is a vector)

#

X = [[1,2,3], [4,5,6], [7,8,9]]

#

[10,11,12]

#

y

#

X = [[1], [2],[3]]

#

y = [[2], [4], [6]]

#

f(x;w) = w x , w = 2

#

c = 1/m sum0_m ((y_hat - y)**2)

#

f(x) = x^2 + 2x + 1

#

d/dx

#

f`(x) = 2x + 2

#

x= -1

#

c(w) = 1/m sum0_m ((wx - y)**2)

#

f(x) = x^2, df(x)/dx = 2x

#

2x, gives us the steepest ascent, if we move along 2x

#

now if we want to minimize f(x)

#

we move against df(x)/dx

#

but how large should we move ?

#

w = w - (moving factor) * df(x)/dx

#

moving factor = learning rate, if it's too big it will overshoot

#

the minimum

#

if it's too low, it will be too slow to reach the minimum

#

(2,4)

#

f(x;w) = 5x

#

f(x;w) = w x

#

f(x) = 2

#

f(x) = 2 , -2

#
In mathematics, a function is a binary relation between two sets that associates each element of the first set to exactly one element of the second set. Typical examples are functions from integers to integers, or from the real numbers to real numbers.
#

f(x) = x

#

X = [1,2,3,.....]

#

f`(x) = 1

#

f(x) = wx + b

#

f(x) = 2x + 1

#

X= [[1],[2], [3]]
y = [[4], [7], [10]]

#

find me a function

#

f(x)

#

f(x) = mx + b

#

y

#

c(m,b) = 1/m sum(1,m) (mx + b - y)

#

m = 5
b = 2

#

!eval
def f(x):

wise cargoBOT
#

@orchid barn :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     def f(x):
003 |              ^
004 | IndentationError: expected an indented block
orchid barn
#

@dense ibex gimme streaming please

olive hedge
orchid barn
#

@olive hedge what is this ^_^

#

array([[ 7.],
[12.],
[17.]])

#

@brave steppe stream?

brave steppe
#

What?

orchid barn
#

never mind thanks

toxic bluff
#

a= []
b = ["Aplha "]
for i in b:
a+=i
print(a)

errant nova
#

!code

wise cargoBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

toxic bluff
#
a= []
b = ["Aplha "]
for i in b:
    a+=i
print(a)
#
a = []
b = ["king"]
a+= b
print(a)
errant nova
#

usually a+=i is a = a + i, but not in this case

errant nova
#

@toxic bluff apparently a+=i behaves analogous to a.extend(i) in your particular case. extend iterates over the object on the right hand side. To get the same behaviour as you would with a.append(i) you would have to write a+=[i]. Performance wise other soultions should probably be preferred.

toxic bluff
#

ok

#

Thanks

grand acorn
#

something like this should work: ```py
class myList(list):
def iadd(self, other):
self.append(other)

errant nova
#

sounds really not like best practice to be honest

grand acorn
#

it's okay if it's your own project and it's explicitly documented

#

also even if you never use it, good to be aware that the dunder functionality exists and where its derived from :)

#

but that's fair. If it were a large project where there's many distinct developers, it would be easier to just know of the odd behavior and adjust for it so there's no confusion around a custom list class with differing behavior.

errant nova
grand acorn
#

oooh interesting

whole bear
#

aeros join 0

whole bear
#

@dense ibex wanna join 0

dense ibex
#

yeah hold on

whole bear
#

ok

daring orbit
#

Hello all

errant nova
#

hi there

daring orbit
#

Hi @errant nova

errant nova
somber heath
errant nova
#

the former image is how perlin noise should look like and the second image was due to a bug in my implementation (which I fixed by now + its 3 times faster than the solution before)

somber heath
#

Pfeh. Accidents can make for some fun results.

#

Sometimes boring linearity. Sometimes less boring.

errant nova
#

Sure looks nice - I didn't want to use something based on seed points/partitioning initially. Might try out other forms of noise but for now thats probably too much of a side track.

stuck dirge
#

Hello

#

anyone might have any experience in django?

stiff cloak
#

Sorry @whole bear I was just hopping in to say hi but appearently I can't talk for another two days

whole bear
#

alr

terse needle
#

hide you config file (im just assuming its config.json)

config.json

hide all json files

*.json

hide all json files in a specific folder

config/*.json
flat sentinel
#
to_do.txt
#

here is for one file

brave steppe
#

πŸ‘‹

#

ty ty

dense ibex
#
version: "3"

services:
  postgres:
    image: postgres
    restart: always
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    ports:
      - "5432:5432"
  
  redis:
    image: redis
    blah blah blah 

brave steppe
#

Docker is meant for deploying

#

That's the point of docker

warm flicker
#

hi

brave steppe
#

The code will run EXACTLY the same way on deployment as it does during development

#

Because everything will be exactly the same with services and dependencies

#

Hm? No

#

Docker does nothing with kubernetes

#

But kubernetes uses Docker iirc

#

You commonly deploy to kubernetes with Docker images

#

Since docker images contain all instructions for getting dependencies and starting, Kubernetes uses it to easily start and close down pods.

#

Kubernetes is a way to host applications, it will smartly open and close pods (that's a single Docker image) as well as restart them when they die.

#

It's actually open source and used by EVERYONE

#

My dad works at Ericsson and I keep hearing about how much he complains about it haha

terse needle
#

hmmm discord cant find my mic or headphones

brave steppe
#

Hahahaha everybody joins when you start GTA

#

lmao

#

I was watching for a second but it kept lagging when I was scrolling

#

This Chromebook is so old that I know the date it will stop getting updates

#

It's like this September

#

No that's not what I was responding to Jake

#

This Chromebook I have will get its last update this September

#

"This device will receive security updates until September 2021"

loud karma
#

nice driving skills

brave steppe
#

BRUUUUHH

loud karma
#

this game's physics is so realistic. your car fell from above and your character did not die

brave steppe
#

Huh? Are you talking about the long log-in time?

#

Who forgot?

#

Oh hahaha

tidal plank
#

hey

brave steppe
#

cya

gloomy vigil
#

i use conda

#

no

#

use this for windows

#

heres a tutorial for virtual environment

#

where did opal go?

stark plover
#
Amazon Web Services

Amazon SageMaker is a fully managed service that provides every developer and data scientist with the ability to build, train, and deploy machine learning (ML) models quickly. SageMaker removes the heavy lifting from each step of the ML process to make it easier to develop high-quality ML artifacts. AWS Serverless Application Model (AWS SAM) is ...

pastel linden
hollow plank
errant nova
brave steppe
#

Like this Chromebook is complete dogshit

#

Well.. the connection is as well haha

errant nova
#

thats disappointing

brave steppe
#

It's several years old, last update I'll get is September this year

errant nova
#

really? Google is giving their notebooks the same kind of support as for their phones?

brave steppe
#

Seems like it

#

I mean, this is really old: Toshiba cb30-b-104

#

I couldn't find the release year

errant nova
#

2015 - really old?

brave steppe
#

Oh really?

#

Yeah I would consider that pretty old

errant nova
#

my 4810tzg from 2009 just failed me this year

brave steppe
#

Damm.. RIP πŸ™

errant nova
#

probably just the hard drive

#

it had a fancy Pentium with 2 cores and 1.3 GHz

brave steppe
balmy nymph
#

Hey @pastel mesa, you have a lot of backgorund noise

#

Perfect

#

I'm writing my talk for EuroPython 2021

#

It is an online event, where different speakers around the world discuss different topic

#

Yeah, it is a conference

#

Recreating Git commit from scratch and how Python can be used to automate simple tasks

#

The command git commit

#

This one in particular

#

Basically you have a script that simulates what the command is doing, it is creating an actual commit

#

If you think about it in term of graphs, the script will create a new node

#

Yeah, the first part is about exploring how it is structured

#

and the script will emulate what the normal git executable is doing, and place the right files at the right place

#

Well, you can see that on Friday 16:15 CEST πŸ˜„

#

wdym?

#

Yeah

#

Yep

#

It does an hash check for efficiency, but yes

#

it is comparing files one by one

#

It won't save it again

#

It will only keep one version of each file

#

Yeah, it will only save it again if the content changed

#

Yeah, I can show you a quick example

#

So here, we create three files and add them to the repo

#

You can see on the bottom command it created three objects in the Git database

#

Yeah

#

yep

#

hah, it should be doable on windows, I think

#

Yep

#

There are different structures for that

#

Yeah, a commit object and a tree object

#

you looking at the stream?

#

Yeah

#

I can't talk because my family is around

#

but basically, you can see the commit object, bdffcc9

#

Yeah, an object is a file in .git/objects

#
akarys@mojito /t/example (main)> git cat-file -p bdffcc9
tree d672becf763d2a9b769b07940e87443f68c4afcf
author Matteo Bertucci <matteobertucci2004@gmail.com> 1627197944 +0200
committer Matteo Bertucci <matteobertucci2004@gmail.com> 1627197944 +0200

example commit
#

Yeah, every object is in the same folder

#

It pretty prints an object

#

If we look at the tree

akarys@mojito /t/example (main)> git cat-file -p d672becf763d2a9b769b07940e87443f68c4afcf
100644 blob 6f670c0fb53f9463760b7295fbb814e965fb20c8    test
#

I guess you could consider it like that, yeah

#

So here you can see there is a blob (so a file) named test with the hash 6f670c0fb53f9463760b7295fbb814e965fb20c8

#

aaaannnnddd if we look at that file

akarys@mojito /t/example (main)> git cat-file -p 6f670c0fb53f9463760b7295fbb814e965fb20c8
test 1
#

We have the content

#

Now, if we create another commit and don't change the file content

#

Yeah yeah

#

a tree is a directory

#

You can have trees inside of a tree

#

I guess it is more of a branch haha

#
akarys@mojito /t/example (main)> git commit -m "example commit 2" --allow-empty
[main 0c329fd] example commit 2

akarys@mojito /t/example (main)> git cat-file -p 0c329fd
tree d672becf763d2a9b769b07940e87443f68c4afcf
parent bdffcc922f6182eee13336d5467d2a8cede69b24
author Matteo Bertucci <matteobertucci2004@gmail.com> 1627198254 +0200
committer Matteo Bertucci <matteobertucci2004@gmail.com> 1627198254 +0200

example commit 2
#

So we create a commit without changing anything at the top

#

and it still points to the same tree, yep

#

Exactly

#

They are actually an hash of the content

#

Do you know what an hash is?

#

Well, there you go

#

If you have two huge files and have their hash you know that they are the same very quickly

#

Yes

#

It explodes

#

Basically

#

nah

#

It is almost impossible to have collisions

#

.wa 8^20

viscid lagoonBOT
balmy nymph
#

that's the amount of SHA1 hashes possible

#

I believe

#

So having two exactly similar files is almost impossible

#

One problem though is that you don't always use the full hash

#

In most cases you just abbreviate to the first 6 or 7 characters

#

because who the heck types 40 chars hashes

#

BUT

#

the linux project is very large

#

so large that they had to use the 10 chars, they ran into so many collisions

#

it is just crazy

#

I wonder how large it is

#

Weeeellll

#

I wonder if it is just the active directory or the whole history

polar galleon
#

gtg

balmy nymph
#

yes

#

Oh boy, it is just the active repo

#

Well, since objects are saved by hash, it isn't really possible

#

Like, in the .git/objects folder

#

If you have a collision one file will override the other

#

I don't think they do

#

I mean, most softwares break on edge cases πŸ˜„

#

I think one file will have the content of another file

#

Same for trees

#

which would be more funny

#

You have a directory that is replaced by the content of another directory

#

but if you have a collision between two objects of a different type your database is corrupted

#

Like, if Git expects to find a blob of data and gets a commit instead it will be very confused

#

and flag that as a corruption

#

They are all in the same folder

#

trees, commits, blobs and tags

#

Yeah

#

Yeah

#

You can have a common interface I guess

#

but each file has its type at the beginning of the file

#

so that's a bit weird

#
>>> import zlib
>>> with open(".git/objects/b0/7f0ed953b8a24983dd5048cd2019b595692d74", "rb") as file:
...     content = file.read()
...     print(zlib.decompress(content))
...
b'blob 17\\u0000This is a README\n'```
#

If they already have type tags, they could be put in different folders

#

but I guess there isn't really a point to do that

#

No probs!

#

It also helps me prepare for the questions after the talk lemon_sweat

#

so if you have anything else to ask, please go ahead haha

#

fair 'nuff

#

cool, thanks

#

Haha, good question

#

Wikipedia has a table on the probability of Birthday Paradox collisions. There is no entry for a 40 character hash. But an interpolation of the entries for 32 and 48 characters lands us in the range of 5*1022 git commits for a 0.1% probability of a collision. That is fifty thousand billion billion different commits, or fifty Zettacommits, before you have reached even a 0.1% chance that you have a collision.

#

50 zettacommits haha

#

Someone tried it haha

#

yeah

#

error: object 0400000000000000000000000000000000000000 is a tree, not a blob
fatal: bad blob object
error: failed to push some refs to origin

#

Yeah

#

I guess it makes sense, they are the same thing technically

#

haha, how late is it for you?

#

oh boy

#

that's like.. far left of the US?

#

Cool, cool

#

Thank you

#

Night!

#

Yep :(

#

hello!

#

from what server?

#

oh, you mean voice banned

#

gotcha

#

@gloomy vigil I'm writing my EuroPython talk

#

it is an online presentation around programming, stressful stuff lemon_sweat

#

I mean, I did that to myself, I can't reallllly complain haha

gloomy vigil
balmy nymph
#

yep

#

*voilΓ !

gloomy vigil
#

baguettes

balmy nymph
#

πŸ˜”

gloomy vigil
#

guilotine

#

and monsiuer

balmy nymph
#

I don't think that's the right spelling

gloomy vigil
#

and bonjour

balmy nymph
#

but I can't remember it

gloomy vigil
#

these are the only words i know

balmy nymph
#

lol, let's speak english please

#

haha, I'll self yeet from the server

gloomy vigil
#

!rule 5

wise cargoBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

gloomy vigil
#

!rule 4

wise cargoBOT
#

4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.

#

:x: Invalid rule indices: 69

balmy nymph
#

!ban @balmy nymph Rule 4

#

There was a backslash at the start of the message, no idea if it works haha

#

!role 270988689419665409

wise cargoBOT
#
Python info
ID

270988689419665409

Colour (RGB)

#000000

Colour (HSV)

0.00 0.00 0

Member count

1

Position

81

Permission code

8589405951

balmy nymph
#

!role 267629731250176001

wise cargoBOT
#
Moderation Team info
ID

267629731250176001

Colour (RGB)

#ff9f1b

Colour (HSV)

0.10 0.89 255

Member count

33

Position

82

Permission code

7784497094

balmy nymph
#

nah, it shouldn't

#

Surprisingly enough I didn't see any ping today yet

#

but please don't ping just for the lol

wise cargoBOT
#

:incoming_envelope: :ok_hand: applied mute to @whole bear until <t:1627200935:f> (9 minutes and 59 seconds) (reason: discord_emojis rule: sent 21 emojis in 10s).

balmy nymph
#

haha

#

!unmute 819463667024003072

wise cargoBOT
#

:incoming_envelope: :ok_hand: pardoned infraction mute for @whole bear.

balmy nymph
#

First ping of the day haha

#

Bunch of lemon_ping

#

nah, it is 10am

#

yes

#

Would I be right to say you are on UTC+5:30?

#

soooo 1:38 PM?

#

Noice, I for once recognized an accent haha

#

haha, yeah

#

Sorry, what sounds fun?

#

aaahh

obsidian phoenix
#

hey yo

balmy nymph
#

yo!

#

Cool, I think the text is done

#

Should I time it or create the slides first

gloomy vigil
gloomy vigil
balmy nymph
#

google slides :P

gloomy vigil
#

by time it you mean like, getting the number of wods and then getting an avg human number of words per minute sutff?

balmy nymph
#

I think I'll just run through it? That could work too tbh

gloomy vigil
balmy nymph
#

Thing is, it should be around 25mins long

#

I hope I have enough content

gloomy vigil
balmy nymph
#

lol

obsidian phoenix
#

lol

#

XD

dusky arch
#

16 min 😩

balmy nymph
#

ugh, I only have 16 minutes according to the average reading speed

gloomy vigil
#

drink water 30 seconds

#

you need 8 more mintues

balmy nymph
#

I don't know how fast I speak though

gloomy vigil
#

which is roughly 500 words

dusky arch
#

speak slow

balmy nymph
#

Lets try a random paragraph

gentle flint
#

that's 16 drinks of water @gloomy vigil

#

1 per two minutes or so

gloomy vigil
dusky arch
#

lol

gloomy vigil
#

6

balmy nymph
#

lol, I've just read a paragraph

#

like, quietly

#

110 words in 48s

#

.wa short 110/48*60

viscid lagoonBOT
balmy nymph
#

wat

#

137 words/min lol

#

Okay, that should be enough text

obsidian phoenix
#

XD

balmy nymph
#

3300

#

24 minutes

#

perfect

#

slide time

#

live, yeah

#

nah, online

#

like, I'll speak in front of my webcam live

obsidian phoenix
#

noice

balmy nymph
#

that's what I used during the speaker training to test my slides

#

isn't that awesome

obsidian phoenix
#

nice logo

balmy nymph
#

that's the EuroPython logo

#

#F59C27 #5BAA81

obsidian phoenix
#

what is your live about

gloomy vigil
#

well i have to go

obsidian phoenix
#

bye

gloomy vigil
#

bye

balmy nymph
#

Recreating Git commit in a 80 lines script and how Python can be used for daily scripting

#

bye!

balmy nymph
balmy nymph
#

Yup

gloomy vigil
#

what will you teach

balmy nymph
#

My talk is titled "Learn Python automation by recreating Git Commit from scratch"

#

which should sums it up

balmy nymph
#

What do you think of this color theme?

obsidian phoenix
#

its nice

balmy nymph
#

cool

#

hello!

#

a cactus what

gentle flint
#

why does every company feel the need to use the word "empowered"

balmy nymph
#

because powah

gentle flint
#

and they all have these pictures

obsidian phoenix
#

welp

#

cuz they're dumb

gentle flint
#

revolting

obsidian phoenix
#

XD

balmy nymph
#

Can I not have an inline code block

#

frick

#

that sucks

#

mostly fine

gentle flint
balmy nymph
#

thanks

#

lol

#

haha

#

true

#

yes yse

#

oh yeah, I forgot that was a thing

#

I'm not good at LaTex at all haha

#

hmmm

#

ah, you mean the full slides in latex?

#

Yeah, but it will look like shit

#

how the heck do I do that

#

:(

#

that is okay-ish

#

Yeah, that's decent enough

gloomy vigil
#

yeah

balmy nymph
#

lemme check if there's still my family around

gloomy vigil
#

well i am going to eat will come back in an hour or so

gentle flint
#

akarys's stream rn

#

@balmy nymph ahem

#

none of us can see a fuck

balmy nymph
#

uh

#

cool

#

My internet kinda sucks, sorry

gentle flint
#

have y'all tried right-clicking user settings in bottom left

#

shortcut to the actual thing, but as a menu

glad sandal
#

Hi im gonna be on a break
for 1 week

fiery juniper
#

Scam, don't click this

whole rover
#

wat

#

?

#

you gonna... stop?

#

alright I've had enough thanks

#

!ban 819463667024003072 14d General weirdness, posting my face and making several odd statements. Please don't be weird.

wise cargoBOT
#

:incoming_envelope: :ok_hand: applied ban to @fallen oyster until <t:1628482246:f> (13 days and 23 hours).

shadow rain
#

Hi guys

#

I have been learning python for 1 month

#

currently working on face verification libraries but I couldn't manage to run it this library on jupyter notebook

short gate
#

Hello

#

@rugged root Are we alone?

faint ermine
#

gonna not be talking cuz at work

west nymph
#

people go to work now?

faint ermine
#

uh, yes?

west nymph
#

ah
I thought covid existed

faint ermine
#

oh hmm m stuck rtc connecting

rugged root
#

Weird

short gate
#

I created a file compressor πŸ™‚

faint ermine
#

ok here we go it works now

short gate
#

@leaden comet Hello there πŸ‹

faint ermine
west nymph
#

ahhh that makes sense

#

so restrictions lifted?

#

where do you live

#

who authorized this

short gate
short gate
short gate
vivid palm
#

i has pharmacy now

faint ermine
short gate
swift valley
#

hey guys

gentle flint
#

I'll be there in a minute

#

just gonna drink some milk

faint ermine
gentle flint
#

gotta uphold my dutchness

short gate
gentle flint
west nymph
#

that was a rhetorical statemnet

faint ermine
#

Β―_(ツ)_/Β―

west nymph
faint ermine
#

i have told people here the city where i live i dont care

vivid palm
#

i'm lemon_cyclops's favorite

faint ermine
#

im at work so muted but hey @olive hedge

#

im at work work, not homeoffice

#

so collegues nearby, cant talk

west nymph
#

ah that makes sens

rugged root
short gate
#

Stolen

swift valley
#

anyhow gtg folks

short gate
west nymph
#

okay
but why pfp change

swift valley
#

why not?

olive hedge
faint ermine
#

when the script runs way too fast: oh no, oh no no no

swift valley
olive hedge
#

very nice though

faint ermine
short gate
#

I have an idea for @rugged root's variants...

Mr.      Grimlock (a Transformer)
Mr.     Cremelock (Hemlock with a ice cream head)
Mrs.      Hemlock (Equivalent to Sylvie)
Mr.       Hamlock (An anthropomorphic pig)
Comrade Hemlovich (Soviet Hemlock)
Mrs. Remlock      (Rem from Re:Zero, but likes Python)

BTW have anybody watched Loki on Disney+?

vivid palm
#

when customers call you "my love" loll

rugged root
faint ermine
#

looking at robot: how the hell do you define what Open Browser To Login Page actually does?

faint ermine
#

🎡 welcome to the internet, have a look around
anything that brain of yours can think of can be found
we got mountains of content some better some worse
if none of its of interest to you you'd be the first.

short gate
#

Anybody heard of 2b2t?

faint ermine
#

ah, makes sense
but it still seems awfuly complex to implement whats basically a entirely new language and then do testing

#

when you could just do testing directly

#

and also, you proposed this as a alternative to selenium, but it needs selenium?

olive hedge
#

alternative to pytest/java testing framework I mentioned

faint ermine
#

i mean, its interesting, but it doesn't seem like a alternative to a testing framework

#

im not saying its useless, but you proposed this as if it was a alternative to whatever testing thing similar to selenium fisher was talking about

#

i mean, for something like that i would think that a proper DSL is better than trying to read it from normal english

short gate
#

@leaden comet Hey, I've created a "file compresser" that not only compresses Python files but is capable of running the compressed files, as if those files were executable files.

leaden comet
#

haha. okay. nice work

short gate
#

That "whistle" sound sounds like... high-pitched fart.

rugged root
#

If your farts sound like some kind of space gun, see a doctor

faint ermine
#

some services keep sessions alive

#

ah

short gate
faint ermine
#

what algorithm is this "state of the art" compressor using?

#

what dependecies does it need?

#

does it package the scripts dependecies too?

short gate
faint ermine
#

hmm, yes, very "state of the art"

short gate
#

When "compressing", the program encodes the input, and then compress it.

faint ermine
#

dont get me wrong, its a cool project, but please dont advertise gzip as state of the art

#

well maybe but why not just say "compressed using gzip"?

#

i dislike disingenuous marketing

short gate
#

Yeah, I know it's blatant cheating.

#

But for people who does not know anything about Python, you can't tell any difference...

crimson copper
#

that would actually be a fun project, pdf as database

severe pulsar
#

lmao

faint ermine
#

i wonder whether gzip might be more efficient without the b64 step

crimson copper
#

yeah, just auto-upload all pictures to facebook

faint ermine
#

i remember a file called distorage.py that was part of the first discord bot i worked one. storing json in b64 in discord messages.

crimson copper
#

just buy discord

faint ermine
#

@short gate i just tested some code in cyberchef with gzip with and without b64 and without b46 compresses smalelr

crimson copper
#

python slack

leaden comet
faint ermine
#

im assuming its becasue normal code has less different chars than b64

#

also im sorry for everyone reading this chat for the enormous link above

crimson copper
#

trying to make a function generic over integers is so annoying in rust

short gate
faint ermine
#

probably

#

its not public is it?

#

if its me sending the links

short gate
#

@rugged root I've been waiting for minutes. I'm expecting a scam.

stuck furnace
#

D-nice

faint ermine
olive hedge
faint ermine
#

ahahaha

short gate
olive hedge
faint ermine
olive hedge
#

good

#

I can claim it

#

what should it be?

faint ermine
short gate
faint ermine
#

the javascript one? developer tools?

#

in the browser

olive hedge
short gate
crimson copper
#

that's the funniest thing i've heard in years

faint ermine
# short gate

that seems like something is blocking it. maybe a overactive adblocker?

short gate
crimson copper
#

you only have to stop at stop signs if there's another car

faint ermine
#

this seems really odd, firefox should not stop blobs from the same domain due to security

crimson copper
#

helmets are for nerds

short gate
faint ermine
#

nice

rugged root
faint ermine
# short gate

so that works, guess you'll have to add it yourself

#

put some code in the input field, drag To Base64 and then Gzip into the Recipe part, and toggle base64 on and off

crimson copper
#

ah, he's not wearing a helmet, let me just hit him

faint ermine
#

if ANYTHING ELSE killed as many people as powered vehicles it would be a global crisis

faint ermine
#

@rugged root : uhh corona

also hemlock: i mean theres tons of things that kill more that are not a global crisis

so hemlock, corona is not a global crisis?

#

if ebola was a global as vehicle deaths it would be a global crisis

#

and pollution is not a global crisis?

#

i mean, fuck governments opinion on pollution, its a goddamn crisis

#

why do you think it has to be actively acted upon to be a crisis?

#

why?

#

a crisis is impeding, but not immediete

#

Β―_(ツ)_/Β―

#

did i say a crisis cant be immediate?

stuck furnace
#

When I hear crisis I think of a moment of change.

faint ermine
#

im only saying it can be more than immediate. not that it can ONLY be more than immediate

gloomy vigil
#

okay here listen global warming is a crisis because we are seeing major rare weather events frequently like 50 degree in Canada, Floods in Germany and Extreme Forest Fire in California

faint ermine
#

i think a crisis is something people in general can recognize to be a danger to them, their way of life or culture

stuck furnace
#

But arguably global warming is a crisis, because while the effects are slow and drawn out, the time to act is short.

faint ermine
#

we just need more trains tbh

#

every single traffic issue can be solved by suffecient trains

#

i think it depends whether the artist themselves separate their artistic work (and the gains from that) from their political opinions

#

razer smh

olive hedge
rugged root
faint ermine
short gate
short gate
faint ermine
#

maybe we should steer away from this convo

#

@short gate did you figure out cybechef?

short gate
faint ermine
gloomy vigil
#

verbose be like

faint ermine
#

@rugged root its actaually a "dissasemble x86" thing in cyberchef

#

just

#

WTF samiel

#

WTF

olive hedge
#

!warn 603610743811604513 when we say drop it, you drop it.

wise cargoBOT
#

:incoming_envelope: :ok_hand: applied warning to @tough panther.

rugged root
#

@gentle flint Well played

faint ermine
#

things are getting out of hand

rugged root
#

I could see that being an awesome stop motion

faint ermine
#

@gentle flint in english the word "projector" is more commonly used i think

gloomy vigil
faint ermine
#

its a "false-friend" word that sounds english but isnt

#

afaik

#

oh good a speeding insurance

#

"false-friend" is what english teachers here call words in german that sound english but are not @rugged root

#

like smarthphones are called "handy" in german but if i say that in eglish i sound like a idiot

#

even though it sounds english

rugged root
loud karma
#

quiet chat

gentle flint
#

shelf broke in half

gentle flint
# rugged root

These strings are precision manufactured to the highest standards and most exacting specifications to ensure consistency, optimum performance, and long life. These Air Guitar Strings are made from nothing wrapped around more nothing, with specially tempered nothing-plated high carbon nothing, producing a well balanced tone for your air guitar.

balmy nymph
#

Yeah, slides creation again

#

eating rn though

faint ermine
#

im gonna go home so cya

balmy nymph
#

cookies re gud

gloomy vigil
balmy nymph
#

bye!

long quiver
#

@gentle flint are you tryung to speak?

gentle flint
#

no, I am speaking.

long quiver
#

i cant hear you

gentle flint
#

well, everyone else can

#

so it's down to you

gloomy vigil
#

150 people joined

#

approx

#

@zealous wave

balmy nymph
zealous wave
#

Also, I never knew you were French

#

I should have realized by what you posted in dev contributed yesterday (with the datetime display on French)

olive hedge
long quiver
#

why i cant hear you @gentle flint

gentle flint
#

How should I know

long quiver
#

i cant hear anyone

zealous wave
#

Besides joe, who is the worst shitposter on staff

gentle flint
#

did you listen to too much heavy metal?

long quiver
#

no

gentle flint
#

then idk

long quiver
#

i think im going reinstall discord or resdtart my pc