#ot2-the-original-pubsta
652 messages · Page 66 of 1
dare I quote the ArchWiki
I'm not
Foreign accent syndrome
um
I'd suggest p10k tbh
p10k, right? :)))
huh
lol
I have that with transient prompt and stuff
I'm hiding here cause #ot0-fear-of-python is quite active
lol
that's what I myself did
made everything blue
but with openSUSE, not too many things are green so now everything is purple
lol
it never does
lol
linux is fun
brij
yes
Lol
O.o
Tweet 
lmao I was tempted to
but I don't even use Twitter
ಡ ͜ ʖ ಡ
:[
@raw lion hey man 👋
heyo
so yeah basically I'm like
not rich
so I'm waiting for GPU prices to drop but idk when that would approximately happen I've read online it'd be like 4-6 months
the gpu market will come back when etherium transissions from proof of work to proof of stake
Yeah I'd say it's gonna be longer than 6 months, I've heard estimates of winter 2022
Imo tho I think summer next year will be mostly stable
its as always very volatile, but it feels like it will be rushed, so im not so sure about the winter 22 estimate. even though i personally think thats a more realistic date
i hope it gets resolved sooner, if VoidForce's sources are right about 4-6 months that would be great
seems unlikely tho
i see a lot of people complaining that the miners are driving up prices, but i thought it was that we've been this close to the max turnover for silicon for ages, and with COVID-19 putting a lot of factories on hold we've missed out on a few $bln worth of processors
Hello eivl, wsb
Something that a lot of people underrate is the flavor of the brew water. Each cup is still going to be mostly water, and if you don't like the taste of the brew water, it's not likely that you'll enjoy it after brewing coffee with it.
are you talking to yourself about coffee..?
oh i see the name lol
The shape of the cup matters. If you use a cup with a broader rim, the stream of coffee with likewise be broader and cover more of the tongue
Likewise, if you use a cup with a narrower rim, the stream will be more focused on the center of the tongue
Which is preferable?
matter of personal taste, I guess.
while I don't recommend just sitting around sniffing your coffee, using a cup that surrounds the nose will trap some of the aromatics.
what do you use for brewing?
What is this? Stelercus's coffee dialogues?
I use an aeropress though.
Unlike drip brewers, which are used primarily for convenience, the aeropress is an immersion brewer
what's the difference between that and a french press?
so drip brewers have a slow trickle of water that passes through a bed of coffee, whereas with an aeropress, all the water and all the grounds hang out together, and then you press the water through a filter.
a french press has a metal filter, and the pressing part at the end is just about separating the grounds and water. whereas with an aeropress, the pressing step is applying pressure
so it's actually a vacuum inside the chamber at the end.
what does that get you?
good flavor idk
the thing I don't like about french presses is that a lot of oil (and sometime fine grounds) gets through the filter
and coffee oil doesn't taste good. but some people like the added texture.
haha yep that'd be me
Just one message since 1969 Discord? 
lol, discord does that sometimes
goes back to 1970
because of the unix epoch probably
wants to go back to simpler times 

HA
light theme psychopath spotted

target acquired
A lot of people confuse sour and bitter. However coffee is not always bitter, and bitter isn't necessarily bad.
"sour" is also not necessarily bad. Acidity is actually quite nice.
Coffee can be "sour" in the way that citrus fruits can be "sour".
People generally like the acidity of citrus.
I've been making a lot of cocktails at home since lockdown started, and a huge portion of my bar is bitter things
Bitter can be very nice
@languid osprey stop converting to rust
n't
accept ur fate
ikr
yes
damn, he has the same pfp too ‼️
int n = 50;
string s = "HI!;
printf("%p", &n);
printf("%p", s);
i dont rly get why a string can be seen directly as a pointer with the address of the first character in the string
how's s different from n when we want to print the pointer
int data[3] = {10, 20, 30};
printf("%p", data);
printf("%p", &data);```
and i think both lines give the same values
Why do you love rust so much
I doubt anybody on this server loves rust more than you
hm
oh ok i see
can i ask i find it abit weird that string data type doesnt exist in c, but %s still exist in c
It's also where most of the nutritional value of coffee comes from fyi
oh alright ok thx
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int n;
int x;
scanf("%i %i", &n, &x);
printf("%i %i", n, x);
int a[n];
for (int i = 0; i < n; i++)
{
scanf("%i", a[i]);
}
for (int i = 0; i < n; i++)
{
printf("%i", a[i]);
}
}
for the first line, i wanted to get 2 inputs (n, x)
where n is the number of elements in an array
and second line, i wanted to get n number of integers
so for eg.
5 2
1 4 6 2 9
so i tried to create a loop for scanf,
int a[n];
for (int i = 0; i < n; i++)
{
scanf("%i", a[i]);
}```
but it doesnt work
arrays like that can only have constant length
n isnt constant here
u have to do int a[10] or something
what does that do
lol
bruh
@cedar turtle The most used libraries in Javascript, is pretty much two lines of code, which checks if a number is even. And the second most used library, imports that library and just does !isEven(number) to check if it's odd. And I hate everything about that.
Or the other way around, I don't recall
i just searched on google it seems lodash and react are the most used
ok wtf
How did this come about
react does appear to be slightly popular
WHY 250K+ FOR ISEVEN?
lmao
i can't even comprehend it
why use x % 2 == 0if you can do npm install isEven 🧠
isOdd
is npm so good that installing that package is easier than writing 2 lines of code?
laughs in node_modules
thicc boi
500 GB
Cosmologists made an important discovery purely by accident. When an ongoing research into finding dark matter within our solar system was underway, one of the scientists at the National Laboratory of Matter decided to build a single-page application using a popular JavaScript framework. As soon as the project boilerplate was
lol
bruh
another good article
lmao
lmao
isOdd is made by the same guy
its actually smart
if the definitions of odd and even ever change, you only need to change the code in one place
🧠
trueeeee
what the fuck
number % 2 and !(number % 2) >.>
yeh
its more than 2 lines tbf
its 16
I created this in 2014, the year I learned how to program. All of the downloads are from an old version of https://github.com/micromatch/micromatch. I've done a few other things since: http...
lmao
845k 😐
Oh, God
When I worked at a coffee shop, people often said that they only drink iced coffee because hot coffee is too hot. And what I don't understand is why they were drinking it when it was too hot to drink
I think a lot of places intentionally hold the coffee at undrinkable temperatures. Perhaps because they anticipate that people will drown it with milk
mcdonalds coffee lady flashbacks
that mcdonalds did that so that people would never ask for a refill
their first cup would never cool down in time for them to drink it with the food they ordered, so they'd just leave
this website is gold tyvm
lmfao
yes
it wasn't that hot tho tbh
by indian standards at least heh
why would you drink chai when coffee exists?
a lot of customers from india would order chai extra hot. some specifically said that they wanted the milk to be boiled.
hmmmmmmmmmmmmmmm
coffee > tea
For a sec, I thought that was a rick roll
I'm glad that when I opened this channel there was an easily accessible coffee conversation
As it should be
This game consists of 7 questions.
**Rules: **No cheating and have fun!
Category: general
How many planets are there in the Solar system?
8
@vapid atlas got the correct answer :tada: 100 points!
Information
In the Solar system, there are 8 planets: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus and Neptune. Pluto isn't considered a planet in the Solar System anymore.
Let's move to the next question.
Remaining questions: 6
QuackerUltimate ᓚᘏᗢ#0934: 100
Which country is the largest producer of coffee?
brazil
@vapid atlas got the correct answer :tada: 100 points!
Information
Brazil is the world's largest coffee producer. In 2016, Brazil produced a staggering 2,595,000 metric tons of coffee beans. It is not a new development, as Brazil has been the highest global producer of coffee beans for over 150 years.
Let's move to the next question.
Remaining questions: 5
QuackerUltimate ᓚᘏᗢ#0934: 200
What is the largest ocean in the world?
@vapid atlas got the correct answer :tada: 50 points!
Information
The Pacific Ocean is the largest and deepest of the world ocean basins. Covering approximately 63 million square miles and containing more than half of the free water on Earth, the Pacific is by far the largest of the world's ocean basins.
Let's move to the next question.
Remaining questions: 4
QuackerUltimate ᓚᘏᗢ#0934: 250
What does the acronym GPRS stand for?
20s left!
general packet radio service
@vapid atlas got the correct answer :tada: 75 points!
Information
General Packet Radio Service (GPRS) is a packet-based mobile data service on the global system for mobile communications (GSM) of 3G and 2G cellular communication systems. It is a non-voice, high-speed and useful packet-switching technology intended for GSM networks.
Let's move to the next question.
Remaining questions: 3
QuackerUltimate ᓚᘏᗢ#0934: 325
In what country is the Ebro river located?
20s left!
spain
@vapid atlas got the correct answer :tada: 75 points!
Information
The Ebro river is located in Spain. It is 930 kilometers long and it's the second longest river that ends on the Mediterranean Sea.
Let's move to the next question.
Remaining questions: 2
QuackerUltimate ᓚᘏᗢ#0934: 400
Which country is known as the "Land of Thunderbolt"?
bhutan
@vapid atlas got the correct answer :tada: 100 points!
Information
Bhutan is known as the "Land of Thunder Dragon" or "Land of Thunderbolt" due to the violent and large thunderstorms that whip down through the valleys from the Himalayas. The dragon reference was due to people thinking the sparkling light of thunderbolts was the red fire of a dragon.
Let's move to the next question.
Remaining questions: 1
QuackerUltimate ᓚᘏᗢ#0934: 500
Which is the largest hot desert in the world?
sahara
@vapid atlas got the correct answer :tada: 100 points!
Information
The Sahara Desert covers 3.6 million square miles. It is almost the same size as the United States or China. There are sand dunes in the Sahara as tall as 590 feet.
Remaining questions: 0
QuackerUltimate ᓚᘏᗢ#0934: 600
The round has ended.
Congratulations @vapid atlas :tada: You have won this quiz game with a grand total of 600 points!
@jovial island
wrong
no
shh
tea is generally sweeter than coffee
that is if you put sugar
so it depends on whether you like sweet or sour
tea
is bad
no
good
what is this conversation
coffee > tea
tea > coffee
no
yes
you're too young to have opinions
and so are you
no
yes
no
16 heh

to conclude this discussion, coffee > tea.
wrong again
honey + water
tf
how about coffee = tea
absolutely not
how about coffee>tea>coffee
:loading_cat:
🤝

cats are delcious
ah yes, how to ruin your stomach
orange juice



broccoli juice
that's fine
acceptable
completely true
absolutely
@dusky cliff there?
ye
def get_all_possible_selections(N):
final_set = set()
a = list(range(N))
for i in range(1, N+1):
for j in combinations(a, r=i):
# print(list(j))
print(list(j), len(j))
if len(j) == 1:
final_set.add(lambda A: A[j[0]])
else:
final_set.add(lambda A: A[list(j)])
return final_set
D = [i(np.array([5,6,7])) for i in get_all_possible_selections(3)]
D
o/p
[0] 1
[1] 1
[2] 1
[0, 1] 2
[0, 2] 2
[1, 2] 2
[0, 1, 2] 3
[5,
5,
5,
array([5, 6, 7]),
array([5, 6, 7]),
array([5, 6, 7]),
array([5, 6, 7])]
i wonder what is wrong in this
while same static version is working
def zzz():
c = [
lambda Z: Z[0,],
lambda Z: Z[1],
lambda Z: Z[2],
lambda Z: Z[[0, 1]],
lambda Z: Z[[0,2]],
lambda Z: Z[[1,2]],
lambda Z: Z[[0,1,2]],
]
return c
[i(np.array([5,6,7])) for i in zzz()]
=> [5, 6, 7, array([5, 6]), array([5, 7]), array([6, 7]), array([5, 6, 7])]
The Redox official website
🤔
i even tried to print j to make sure.
if len(j) == 1:
final_set.add(lambda A: A[j[0]])
else:
final_set.add(lambda A: A[list(j)])
i feel thats where im doing something wrong but can't figure out what
😔
Was a tough read
oh so it is taking last value of j?
I think so
In [10]: def func():
...: a = 5
...: y = lambda: a
...: a = 6
...: return y
...:
In [11]: func()()
Out[11]: 6
ah
maybe you can try returning slice objects instead of a function that slices
no returning function is what is important
on top of this i need to do function composition in next part
I think this issue could be solved with a generator yielding lambas instead of returning a single set at the end
i don't think it will work

that would be cool
but can't i like add function like js?
In [21]: def get_all_possible_selections(N):
...: a = list(range(N))
...: for i in range(1, N+1):
...: for j in combinations(a, r=i):
...: yield lambda A: A[list(j)]
In [23]: for i in get_all_possible_selections(3):
...: print(i(np.array([5,6,7])))
...:
[5]
[6]
[7]
[5 6]
[5 7]
[6 7]
[5 6 7]
my?
it kinda returns last value
wait hahastinkypoop lemme explain why this works
when it yields lambdas it has to use the current value of j for the calculation
correct me if im wrong
so we have not created the function for next iteration so it cannot consider the next one, while for next, we have already returned array so we're safe for mutation of last one
yeah
but
wait
why are we generating all indices
i think we can use itertools.combinations on the numpy arr directly
but we are doing it on combinations
may be we can make np thingy for upper loop.
again, is this possible in py?
wdym add function
okay lemme show kinda js version
const get_all_possible_selections = (N) => {
final_set = []
a = list(range(N)) // lets forget HOW TO in js for this
for(let i = 1; i++; i<N+1){
combinations(a, r=i).forEach(j => {
const something = (A) => A[j]
final_set.push(something)
})
return final_set
}
D = [i(np.array([5,6,7])) for i in get_all_possible_selections(3)]
D
this will work in js as we create a new function everytime
i tried this but didnt work
def get_all_possible_selections(N):
final_set = set()
a = list(range(N))
for i in range(1, N+1):
for j in combinations(a, r=i):
if len(j) == 1:
def something(A):
return A[j[0]]
n = something
final_set.add(n)
else:
final_set.add(lambda A: A[list(j)])
return final_set
D = [i(np.array([5,6,7])) for i in get_all_possible_selections(3)]
D
In [33]: def factory(j):
...: return lambda A: A[list(j)]
...: def get_all_possible_selections(N):
...: final_set = set()
...: a = list(range(N))
...: for i in range(1, N+1):
...: for j in combinations(a, r=i):
...: final_set.add(factory(j))
...: return final_set
...:
In [34]: [i(np.array([5,6,7])) for i in get_all_possible_selections(3)]
Out[34]:
[array([7]),
array([5]),
array([6, 7]),
array([5, 7]),
array([5, 6]),
array([5, 6, 7]),
array([6])]
lesgo
yeah lol
so lemme ask a very weird way
if i define lets say by some way create a unique named function in above version it will work right?
you mean using a def func() instead of a lambda?
it would have the same problem i think
yes and lets assume function name is unique everytime
oh god that sounds terrifying
i know
i don't think the function name will affect the scope of its vars though
yes i know, but im thinking of yes it would work. terrible way but by the way how things in py work it will.
so shit is in thej?
yeah, in my soln i create another function where j remains fixed for each lambda
yes
aa this is weird to explain
one sec
so the lambda's scope works by looking up the environment it is created in
if you create the lambda in get_all_possible_selections, the environment for the lambda is get_all_possible_selections, andthe j changes in the next iteration, so the j used in the lambda changes
if you create the lambda in factory, the environment is factory, and inside factory j never changes, it remains the list that it was called with. in the next iteration of get_all_possible, there will be another call to factory but this is a separate environment, so the next lambda is independent of the current one and the current one is independent of changes happening in the next one
ah i see.
alright that makes very clear sense.
so @dusky cliff I was near in my version
def get_all_possible_selections(N):
final_set = set()
a = list(range(N))
for i in range(1, N+1):
for j in combinations(a, r=i):
def something(j):
return lambda A: A[list(j)]
n = something(j)
final_set.add(n)
return final_set
D = [i(np.array([5,6,7])) for i in get_all_possible_selections(3)]
D
but mine creates new function everytime while once is enough(your version)
yeah it works but at the same time, im creating the same function again and again
thanks a lot @dusky cliff you've been a real real help ❤️
np
what do I do if I want coffee but I need to sleep eventually
drink coffee flavoured uncaffeinated water
pretend to drink coffee or pretend to sleep
drink so much coffee that you pass out
Unfortunately, because of selective breeding, there isn't very much genetic diversity among coffee crops worldwide
so a disease that can affect one crop is likely to affect most crops worldwide
there's talk of mixing existing crops with wild varieties, but it might not taste as good
Become genetically superior like me and don't let coffee keep you up.
@real forum I'm not genetically superior
If I drink enough coffee will it become part of my DNA?
Uhh probably not
one way to find out
You might get like heart problems in your dna tho!
remember the limit is 52 cups
it has to be radioactive coffee
then just administer one drop under the tongue
then bam! You are now coffeeman
Yay!
Common joe, stop slowing down the infraction queries 😔
radioactive coffee and coffee injection to dna-
welp, daily dose of ot for ya
you drink tea 
no!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ok
ah yes common joe
common joe lol
a Common Joe in its natural habitat
did you photoshop it or did you have that picture in your folders?
tell me right now
this is an investigation
target acquired
no
@unreal sigil have you gotten to chap 5.1 yet?
nope
I'll finish chapter 4 later today when I get time
ah
i decided to kinda just read chap 4 but go to chap 5 and try to make a simple program at this point
so uh, could say I haven't finished chap 4
I might have actually finished 4 already, can't remember
Yeah that ties into Rusts memory management
wait how
Slices don't have ownership, it goes on to discuss a few more things regarding rusts memory management while talking about slices
bye mate
wow nice spamming sussy
bruh
lmao
joe mammas name so fat it take O(tan(n)) time
what if n is pi/2
joe mama so fat she larger than tan(pi/2)
lol
joe mamma so fat the number of digits in her weight increase faster than speed of light
tfw speed of light is a constant
wooah lool
@grim seal really joe? You're in the microsoft winget reg
lol
o_o
lol
version 4.6 o_o
okay but why are you just... "winget show joe"ing
why've you got an obsession with Joe D:
Because I scrolled through the entire repo lol
To see what they had
um
what do i do
did you install the dependencies
lol
pyenv installation section
one second
prerequisites
thanc
lol
comic sans is not bad
not bad in general
just bad for coding
🤣
If i have list like [1, 1, 1, 2, 2, 3] and try to count how many 1s are in that list and then how many 2s are in that list and so on, what’s that called?
um. counting
!d collections.Counter
class collections.Counter([iterable-or-mapping])```
A [`Counter`](https://docs.python.org/3/library/collections.html#collections.Counter "collections.Counter") is a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "dict") subclass for counting hashable objects. It is a collection where elements are stored as dictionary keys and their counts are stored as dictionary values. Counts are allowed to be any integer value including zero or negative counts. The [`Counter`](https://docs.python.org/3/library/collections.html#collections.Counter "collections.Counter") class is similar to bags or multisets in other languages.
Elements are counted from an *iterable* or initialized from another *mapping* (or counter):
```py
>>> c = Counter() # a new, empty counter
>>> c = Counter('gallahad') # a new counter from an iterable
>>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping
>>> c = Counter(cats=4, dogs=8) # a new counter from keyword args
hmph
doesn't show the common use
!e
import collections
a = [1, 1, 1, 2, 2, 3]
print(collections.Counter(a))
@dusky cliff :white_check_mark: Your eval job has completed with return code 0.
Counter({1: 3, 2: 2, 3: 1})
thanks
Is there such a thing for hot reloading Flask/apache2
so when I deploy I don't have to manually do "systemctl reload apache2"
@flat hinge
oh dumb me so x is a place holder for sh or h or th
it's probably how they were made, yes - they're old and they were originally meant as a general gender neutral pronoun.
there's a lot of pronouns that end with -e or -ey to imitate the standard pronouns.
true.
👀
the channel name ;-;
lol
public static void main
string args
ope
System.out.println
all characters are of the same width
Sorry, you can't do that here!
so
wwwwww
iiiiii
would be of the same width
nvm
need some help with c, anyone here?
perhaps
Ok
So I made a simple Tic Tac Toe game, here is the code: https://pastecord.com/itazykudob
You learning c ?
But I get this error, dunno where I went wrong 
you probably meant i < 3 here
Oh gosh I am so stupid
errors like these are the worst, you just never look in places like that
well, the while loop goes while (won == -1) but it's set to 0
doesn't your IDE warn you for stuff like that
i get this in intellij
nvim 🙃
😩
i guess that is what i get for using notepad++
👀
oh notepad fan, never used it
oh no, even the default C/C++ VSC extension and gcc -Wall stay silent
jetbrains moment
no
ok
for java it sorta hints by complaining about unreachable code
i tried out pycharm once, apparently i'm not the best at following PEP8 so my entire screen was effectively ⬇️
ok after a few more silly erros, I get stuck here
just ctrl alt L whenever pycharm is annoyed
and let it do what it wants on its own
works for me
or disable it 

you can use a loop there btw
yeah
also wait what happened to 0?
why not started from 0 lol
def isWon(board):
for i in range(3):
# check if we're winning in nth row
if board[i][0] != 0 and board[i][0] == board[i][1] == board[i][2]:
return board[i][0]
# check if we're winning in nth column
if board[0][i] != 0 and board[0][i] == board[1][i] == board[2][i]:
return board[0][i]
if board[0][0] != 0 and board[0][0] == board[1][1] == board[2][2]:
return board[0][0]
if board[2][0] != 0 and board[2][0] == board[1][1] == board[0][2]:
return board[2][0]
return 0
thats my py version but im pretty sure i can do it with 1d too and c
Yeah, first i was using 0, 1, 2, 3, ... and the places would be starting from 1, and then I changed it
and forgot
for(int i=0;i<9;i+=3){
if(board[i] == board[i+1] && board[i] == board[i+2]) {
// same row
}
}
for(int i=0;i<3;i++){
if(board[i] == board[i+3] && board[i] == board[i+6]) {
// same col
}
}
this would probably work for row and col(i haven't checked tho)(starting from 0 version)
also if im not mistaken aren't you first supposed to see if place is filled? else if all 3 are empty cond will be true.
for(int i=0;i<3;i++){
if(board[i*3] == board[i*3+1] && board[i*3] == board[i*3+2]) {
// same row
}
if(board[i] == board[i+3] && board[i] == board[i+6]) {
// same col
}
}
single loop version
it's asking you to select more than one answer
the first one shows div in green, meaning that one is right, you just didn't select all of the right ones
oh i forgot
lol
if i want to print 30%
int main(void)
{
int x = 30;
printf("%i", x);
printf("%s", "%");
}```
can i ask why the % here is considered a %s
and not %c
oh ya
prashant
u mean printf("%i %", x);?
yeah?
nothing
no i mean print("%i %%", x) but im not sure
nope i think one is fine
printf("%s", "%");
printf("%c", '%');
// both valid
ya youre right
need 2 %%
printf("%i%%", x)
printf("%d%", 30); // 30%
yeap
thanks
no wait
need 2 %%
👍
mine fucking took % of next line print lol
i knew it B)
does anyone happen to know how modern chess apps are done? I started going down the rabbit hole that is bitboards but im struggling to find much without just copying a tutorial
That's sometimes the best thing to try
Start with something existing and then start from scratch after learning what you've learned
true but I also wouldn't mind learning the theory and trying to grind through it first
That's fair
Hmm, I wonder if #algos-and-data-structs or #game-development might know
maybe, I might end up asking in the c server too
Also a fair option
Pick an engine and build a frontend for it basically
Multiplayer is gonna be more complicated with sockets and shit
well yes but no, that kind of defeats the purpose of it
I want to be able to use different engines/no engine + (try to) build my own eventually
- it'd probably look good on a resume if I can figure it out properly
I would first start with a frontend for a singleplayer app using stockfish probably
And then you can do multiplayer modes, use different engines, etc
I want to figure out the backend first before working on frontend/gui but I might just do that if I give up
if it was a project for a client/for fun it'd do it but I want to figure out how the more technical/lower level stuff works and see if I can manage it
after that, creating generalized hooks for engines should be fairly self explanatory
I might see if I can get in contact with any of the devs from chess.com/lichess too, that might help a bit
👍
So 2 laptops... 6hdd replacements... 1 aux... 50 mails... 2 lawyers... 2 service centers ... and all the acer technicians later... I've been scammed of 60000 rupees by an mnc
@foggy cape
Summary
damn
Of the story
Soon ™️
mhm
rip
Birdo still hangs around ❤️
Cattos are home so they won't get the birdie
why it look chonkier
Because cats are frustrated they don't get the birdo so they eat more?
- cats are liquid and it's hot, so they melt
sounds legit
My first though was "looks dead" tbh XD
Moved to a box a bit later, when acting dead in front of doors didn't give him pass to go outside
Alright, I'm confused about something
I was messing around with JavaScript and specifically arrays and .sort(), and there's something that isn't making sense:
https://paste.pythondiscord.com/epayagupiv.js
Why would lines 11 and 12 happen? Would it not just check it only once?
Hello hem
This has been driving me crazy for the past couple days
nice catch, ima ask in some js server for an answer if its alright? now im curious af too
So something I found
It seems to be exclusive to V8
As I can only replicate it on Chromium based
does js use timsort too?
oh! i tried to follow mdn full page but didn't find anything about this, but but this can be to preserve order which was introduced in ecma.
iirc its timsort.
also moreover it depends on numbers too i think.
works twice with 105 too
let test = [1, 5, 2, 3, 59, 123, 1, 4]; ends up with the same issues, but with 2 - 5 = -3
So it has something to do with the second and third element
At this point I'm probably just going to make an SO question about it
He looks so happy
Why does that snake look so happy lmfao
He probably just got the joke
you'd think he'd frown
Can snakes frown?
Can they really smile?
Nah, just look stoked
Snakes can look pissed
oh my
yeah in FF its different so its v8 based.
Starting with V8 v7.0 / Chrome 70, Array.prototype.sort is stable.
this may help @short cliff if i get a precise reason i'll let you know
Perfect! I really appreciate you tracking that down for me
don't use JS ez fix
Har dee har
have you tried typescript /srs
i've never used either, but heard that ts is better
I have, but I haven't in a long time so I'm brushing up on JS vanilla first
ah
its better(and js compiled from it can be faster too), but well he would still produce it with that too, it gets compiled down to js anyways.
do you use windows or *nix?
Windows (and it's what I use for work, which is where I do most of my hobby coding since I don't do it professionally)
But I'm comfortable with Windows anyway
same
Also, https://javascript.info/ is probably the best resource for learning JS that I've ever used. And it teaches modern practices
https://davidlowryduda.com/extra-comparisons-in-pythons-timsort/
this may be the case. ima check this algo in details tomorrow but yeah guess is it's more about timsort altho the question still remains if spidermonkey uses timesort too.
.bm 854432162379464704
Rust
Hi
@languid osprey hello
Hi
Hello
Hello
hello
How's it going?
I'm making some Cheeseburger Mac but it's plant based. It's pretty decent.
good
Cool. Do you guys talk about random topics or is it pretty restricted to coding
random
I'm having allergies because of plants procreating and whatnot so I took some Aleve D and now I'm all amped up.
because of what now
whispers: plant coitus
procreating plants
😅
for programmers can sleep
blame tenor for shitty gifs
i have nitro now?
oh.
Cool
I started watching a show
i have a server
but you guys don't really chat much... or at least maybe not late at night? during work hours?
0 bobux
lol
Why do you keep saying that in every OT channel
@copper kernel Please don't spam advertise your help channel
There's no need to advertise your help channel at all, especially in every single off topic channel
I will not
but how long will it take when someone will come to help
we're all volunteers here
I want to type a tuple that has unlimited length, the first item is a string and all other ones are ints
Basically Tuple[str, int, int, int, int, int, int, etc.]
tuple length are fixed
tuples are read only once created
What, no. I want a tuple (immutable, hashable)
But I don't know how long the tuple I will expect in my parameter is
You can probably implement your custom data type
Tuples of variable-length + static typing don't really go together
('a', 1, 2, 3, 4, 5, 6, 7) or ('c', 1, 2, 3) or ('a', 5, 6, 7)
tuple[int, ...] would be any number of ints
not sure how you incorporate the first str there
I am not declaring the tuple, there I do know the length
Yeah that's exactly where I am stuck
none of my business but i wonder why would you want that
wait, you need unlimited length?
Yes, I do not know the length of the tuple that I am accepting as a parameter
dynamic length may be a better phrase
can you show a code example of what you want it to be
why not just do Tuple
you can just add the string tuple and int tuple
huh
(string,) + (ints)
i'm fairly you sure you can't just add type hints like that
wait..., he needs type hints?
yes
def accept_something(a: Tuple[?????]):
...
accept_something(('a', 1, 2, 3, 4, 5, 6, 7))
accept_something(('c', 1, 2, 3))
accept_something(('a', 5, 6, 7))
bruh
That's what I've been saying from the start 😅
but type hints dont matter either way.. why even use python for this
makes sense
I don't get why would you want mixed data structure? you're giving type hints so they are kinda typed. i mean. huh?
in normal static languages you can't have arrays/lists/tuples/vectors with different types
rust moment
ok, rust tuples exceptions
normal
just make a custom class and type hint it
Well I know that the first item is a string, the rest is variable length integers
Tuples are not necessarily sequences in most languages
then why not just pass two args?
yeah
instead of unpacking inside?
class SpecificTuple(tuple):
def __init__(self, string, ints):
super().__init__((string,) + ints)
def my_func(arg: SpecificTuple):
...
``` would this work?
If you want that static typing:
from typing import Generic, TypeVar
_Head = TypeVar("_Head")
_Tail = TypeVar("_Tail")
class HeadTuple(Generic[_Head, _Tail]):
def __init__(self, head: _Head, *tail: _Tail) -> None:
self._head = head
self._tail = tail
...
def accept_something(a: HeadTuple[str, int]) -> None:
...
I'm curious
Interesting, that's cool
not quite as hard
nice
@urban jewel it would be fine here
thanks man
I'll close the previous one
Which text?
Ah, it's in the previous channel
You can copy -> paste it
so anyone know how to in linux terminal ; i want to change the root account password, but after i get to the new password section i cannot type anything but hit the enter key
then it lets me go to retype password, then says error
because there isn't anything lol
how do i change it?
or what am i doing wrong that i cannot type it
all good thanks
idk what you are doing that makes you unable to type for the new password.
What is the code rn?
i'm not home rn i'm at work, but before i left it was doing that.
it was all default
i can pull it up
but it was correct bc it gave me the new password option
it was like sudo root passwd
or something like that
but it just refused to input characters
I can't do anything without seeing
sudo password root is the correct
i'll come back later. it just sucks bc i don't have coding mentor so it's overwhelming
i'm sure i put that i just couldn't remeber off of the top of my head
I have to go to sleep atm
Good luck next time.
have question for naming, I have a database model named RolePacket that can have multiple PacketRole.
Problem is that it's very often the case that RolePacket has only one role (multiple roles is just a additional feature).
So since in most cases it will just be one role I'm thinking ´packet´ is kinda misleading. I'm thinking to rename it from ´packet´ to ´payload´ so it would be
as ´RolePayload´ and ´PayloadRole´ to make it more consistent. Is this a good idea?
not sure if average joe (no pun intended) would understand the term 'payload'
there is a link to a text i need: and the directions say online:
'text' and put it in /home/pi/rpi-hdmi.sh.
[1:09 AM]
how do i "put it in" that location?
good night
That was last night
i actually consdier windows to be borderline malware in general. their recent update to win10 had jsut been more ways for them to scrape data from the users of their operating system. Here's a trick ... open the search function and type something in there ... notice that the first results that come up are those connected to an internet search . Which means everything searched in the search bar is getting passed to a browser .
to continue a conversation of malware , from #python-discussion
i have a nitro?
it's in the air
yes
@sturdy relic
kk
prove that the accounting equation is satisfied in all the following transactions of a ltd
started business with cash 25000
purchased goods for cash 7000 and credit 3000
paid salary 400 and outstanding salary 100
sold goods for cash 10000 costing cash 6000
withdrew cash for personal use 7000
and what is your question?
you need to take your current cash and see if it adds up with all of the transactions
do you want another example that shows you have the transaction would fail?
@subtle wedge ?
so basicaly i need to add and subtract everything to see if i get profit or nthin?
yes, but you cant go out of bounds with the calculations
lets say you start out with 2000
and you want to buy goods for 2001 and sell them for 100_000
now you cant to that because you dont have 2001 in cash
you could on the other hand
buy goods for 2000 cash and 1 credit
sell it for 100_000
pay back 1 credit





