#ot0-no-stealth-portals-please

3246 messages · Page 31 of 4

serene dagger
#

yeah i got it wrong just double checked with fren lol

viral hull
#

I think HVAC tech might go to a community college, for instance.

#

I don't think that's a career that uses an associate's degree - I think it's just a certificate program

#

not positive, though - it's admittedly outside my area of expertise.

#

Tig Notaro had a standup special where she performed topless for most of it. After a double mastectomy, she didn't have nipples or breast tissue anymore, so it was fine, apparently! Very, very weird standards.

sick olive
magic carbon
#

yasuo?

boreal apex
#

y

sick olive
#

its gobblegeek pretty sure

teal storm
#

cite OED i think, or wherever it is they source their dictionary from, it says in small print at the bottom

#

str8 🧢

#

wat

serene dagger
#

no coming back sorry fam

teal storm
#

we'll see who's laughing when the world eventually switches to dozenal (the superior system)

#

well

#

only for length rlly

#

volume is base 2 in imperial units

#

length is more or less base 12

static trout
#

how

teal storm
#

with base 2 for fractions of an inch

static trout
#

oh imperial

#

i was thinking of metric

teal storm
#

until you get to thou at which point it's back to decimal

#

lol

#

volume being base 2 is very pleasing to me as a CS person tbh

#

happy today

#

yes but tomorrow is now today

static trout
#

hmmmmm
timezones ic

#

i could ask the same to you

serene dagger
#

timezones dont exist its all the CIA doing

sick olive
#

hi

viral hull
#

That's the norm in the US

static trout
#

hm yes iirc

#

i dont have a calender in my room

cursive agate
#

i wanna troll someone

cursive agate
#

Splash onto @oak hemlock

serene dagger
solid prawn
cursive agate
#

i wonder if it got stuck because i dont have ms edge

#

😆

cursive agate
#

yeah i installed the runtime

#

fuck basically seb is malware

pale mesa
#

why is a client-server model better than a p2p model

#

how do i delete windows security smh

hearty prawn
#

?

#

?

upper turret
#

nvm

cursive agate
#

How to use Stack Overflow:

  1. Create your question with your account
  2. On a second account give a wrong answer with a confident language
  3. Wait for the right answer along with offenses to the wrong answer
    hmm interesting
thick widget
#

"so i have this problem in my code, "

thick widget
pale mesa
#

and then someone will update the answers a few years later, which is a plus

cursive agate
#

or a new library

hollow holly
livid vale
#

work meets the page of .txt files that exist in the cyberspace of my life

sick olive
#

hi

#

halo

sinful frost
#

why people do import math , then math.sqrt

#

isn't it kinda bad to import all math library just for one function

#

isnt from math import sqrt would be better

sick olive
#

@sinful frost but the whole module runs for both ways

sick olive
#

when u import math u have all the names available in the math

#

u aren't polluting anything unless if u did something from math import *

#

I don't seem anything bad overall

hearty prawn
#

i'm finally done with my own language

#

@cursive agate i finished IT!!!

sick olive
#

@hearty prawn showcase pl

hearty prawn
#

okok

#
> var name = "Snow";
> var name1 = "Neo";
> var space = " ";
> print name + space + name1;
Snow Neo
> var trueyyy = true;
> if(trueyyy) print "it's a truee!! :D";
it's a truee!! :D
>  
sick olive
#

i didn't get anything

hearty prawn
#

get what?

sick olive
#

u said u made a language

hearty prawn
#

i did

sick olive
#

so this is how it looks

hearty prawn
#

yeah

sick olive
#

great

#

using?

hearty prawn
#

C

sick olive
#

cool

hearty prawn
#

it has unary too

#
> print !true;
false
> print !false;
true
> 
sick olive
#

repo?

hearty prawn
#
declaration    → classDecl
               | funDecl
               | varDecl
               | statement ;

classDecl      → "class" IDENTIFIER ( "<" IDENTIFIER )?
                 "{" function* "}" ;
funDecl        → "fun" function ;
varDecl        → "var" IDENTIFIER ( "=" expression )? ";" ;

statement      → exprStmt
               | forStmt
               | ifStmt
               | printStmt
               | returnStmt
               | whileStmt
               | block ;

exprStmt       → expression ";" ;
forStmt        → "for" "(" ( varDecl | exprStmt | ";" )
                           expression? ";"
                           expression? ")" statement ;
ifStmt         → "if" "(" expression ")" statement
                 ( "else" statement )? ;
printStmt      → "print" expression ";" ;
returnStmt     → "return" expression? ";" ;
whileStmt      → "while" "(" expression ")" statement ;
block          → "{" declaration* "}" ;

expression     → assignment ;

assignment     → ( call "." )? IDENTIFIER "=" assignment
               | logic_or ;

logic_or       → logic_and ( "or" logic_and )* ;
logic_and      → equality ( "and" equality )* ;
equality       → comparison ( ( "!=" | "==" ) comparison )* ;
comparison     → term ( ( ">" | ">=" | "<" | "<=" ) term )* ;
term           → factor ( ( "-" | "+" ) factor )* ;
factor         → unary ( ( "/" | "*" ) unary )* ;

unary          → ( "!" | "-" ) unary | call ;
call           → primary ( "(" arguments? ")" | "." IDENTIFIER )* ;
primary        → "true" | "false" | "nil" | "this"
               | NUMBER | STRING | IDENTIFIER | "(" expression ")"
               | "super" "." IDENTIFIER ;

function       → IDENTIFIER "(" parameters? ")" block ;
parameters     → IDENTIFIER ( "," IDENTIFIER )* ;
arguments      → expression ( "," expression )* ;```
#

NUMBER         → DIGIT+ ( "." DIGIT+ )? ;
STRING         → "\"" <any char except "\"">* "\"" ;
IDENTIFIER     → ALPHA ( ALPHA | DIGIT )* ;
ALPHA          → "a" ... "z" | "A" ... "Z" | "_" ;
DIGIT          → "0" ... "9" ;
#

big boi documenation

hearty prawn
cursive agate
hearty prawn
#

I DID THOUGH

cursive agate
#

nah im tired. im studying zzzzzzzzz

hearty prawn
#

dang

#

took me a few hours to go through the tutorial

#

now i need to read the entire thing to understand how it works on a lower level lmfao

#

memory bytes moment

sick olive
#

@hearty prawn ++

hearty prawn
#

?

#
> a = true
[line 2] Error at end: Expect ';' after expression.
#

not me forgggeting how my own language works

sick olive
#

LoL

hearty prawn
#

i need he;[p[

neat glen
cursive agate
sick olive
#

Please do not join MEE6 support as it will ban you if you ping the moderators role when a situation is really urgent.

#

@sick olive there is really no need to spam that message in all the ot channels

jade wedge
pale mesa
#

any idea?

#

this is a past year paper btw, not an exam i am currently sitting for

#

i cant think of anything else other than insertion into an array being O(n)

stone gyro
#

Consider the complexity of checking whether a name is in it, too

#

ah, that's an advantage though

#

they basically want you to make up two ways linked lists are better than arrays, which is a... tall order

solid prawn
#

but finding the spot for inserrtion would still be O(n)

stone gyro
#

O(1) insertion at the front and, uhh, that's it? I can't think of a second advantage

solid prawn
#

yeahh

#

merging two of them is O(1)

#

though youd lose sorted order if you did that, which is probably not an advantage in this specific case

#

they just want one advantage tho

oak hemlock
#

Meow

solid prawn
#

a fine meow to you too

pale mesa
#

i cant come up with similarities between bst and linkedlist and arrays

solid prawn
#

hmm are BSTs balanced by definition

#

i forgor

#

if they are, then you get log(n) search and log(n) insertion

pale mesa
#

i think we can assume they meant a balanced BST because of (d) asking for balacing bst stuff

pale mesa
#

i guess it comes in the middle?

solid prawn
#

log(n) insertion is an advantage over arrays
log(n) search is an advantage over linked lists

pale mesa
#

ahhh i see, while we are at this, is inserting into a linked list always O(1)?

#

i heard someone said inserting at the end becomes O(n)

stone gyro
#

Inserting at the end is O(1) if it's a doubly-linked one

#

it's insertion anywhere in the middle that's O(n) always

pale mesa
#

thats due to the need to traverse the linked list to insert in the middle right?

plucky onyx
#

Connected... Good Day to ALL - I see some talks about optimisation / optimal algorithms ? it's my theme 🙂

pale mesa
#

my lecturer gave me this really confusing notes

#

which says it is O(1), but i thought it should be O(n)

lean pebble
novel hull
#

Depends on whether you take reaching the point in the list as part of the insertion

#

Because technically, given a doubly-linked list's node, you can insert an item before or after it in O(1)

pale mesa
#

ahh... so traversal itself is O(n), but from then on since u have an determined point, the insertion itself is O(1)?

novel hull
#

Yeah, since it's just a bunch of pointer assignments

#

Traversing the list is O(n), because you need to find each consecutive element to move further

pale mesa
#

so when comparing time complexity for insertion into an array and a linkedlist, is it safe to say that linkedlist is slightly faster since it is O(1)?

novel hull
#

While with arrays it's just pointer arithmetic, which allows you to, for example, perform binary search

novel hull
#

Though I guess it would be worth mentioning in your answer (since it's a freeform question, from what I can see) that insertion is only O(1) if you are already given a node

plucky onyx
stone gyro
#

what

lean pebble
#

ah yes increasing number of )

#

it generates confidence

novel hull
#

Traversing the list to reach a node in the middle will be O(n), though still cheaper than inserting into the middle (or the beginning, which is the worst case scenario) of an array

novel hull
#

press ) repeatedly

lean pebble
pale mesa
#

inserting into the middle of an array is O(n) because it has to create a larger block in memory, and copy its contents over iirc?

novel hull
#

!e ```py
dominance = False

assert dominance

obtuse swallowBOT
#

@novel hull :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 | AssertionError
novel hull
quasi cape
novel hull
#

Wym? Inserting into the end of an array, or the end of a doubly-linked list?

quasi cape
#

array

novel hull
#

Inserting at the end of an array is cheap(er) because you don't have to shift any elements

quasi cape
#

ah , so the expensiveness is inversely proportional to the index where we are

stone gyro
#

yeah, n-i operations to insert at i

plucky onyx
#

Pure theorists / TERRORISTS :))))) size of your array / lists in elements ? element type ? hardware you are working on ? :)))

novel hull
#

Yeah, the closer you are to the beginning of the array, the more elements you'll have to shift

#

Inserting at index 0 will force you to shift the entire array

#

Given you're using an amortized array, that is. I think if you're reallocating on each insertion there's little additional cost, but you have a bigger problem on your hands

pale mesa
plucky onyx
#

list[1]['deleted'] = True; ....... ; list[1]['data3']; list[1][deleted] = False;

#

something that way need to correct this - no insertion - just mark element as deleted, then mark it as undeleted when it gets new (inserted) value and append to end of list if no deleted elements found

stone gyro
#

At the cost of O(n) element access

#

and in fact, insertion and deletion is still O(n) I believe, since you'll have to find the i-th non-deleted element somehow

plucky onyx
#

sort by deletion attribute / flag 🙂

novel hull
#

@pale mesa Here's some images, I hope they are informative more than confusing, hah

plucky onyx
#

How funny theorists / mathematicans are 🙂 - array/list performance depends on low-level software implementations, performance of low level software depends on hardware implementation for example I'm now on Intel Celeron 2 core with 1Mb L2 cache.... only but Xeon processors have about 40Mb cache.... so if your list/array completely resides in this 40Mb cache...... it very very very fast on 2.4GHz 🙂

novel hull
#

:)

cursive agate
#

🤔

novel hull
#

Apparently big-O notation for time complexity doesn't apply to CPU cache

cursive agate
#

🤔

#

dont mind me im thinking

plucky onyx
plucky onyx
novel hull
#

I failed to find it, sadly

novel hull
#

No, human customer support 🙂

hearty prawn
hearty prawn
neat glen
hearty prawn
#

hehehehehehe

#

i spent a lot of time making it

neat glen
#

i kinda want to make my own lang sometime after my doom proj

hearty prawn
#

i used a tutorial but it took time :(

#

nice

neat glen
#

reeading creeftinginteerpreeteers should heelp

hearty prawn
#

wanna know something cool?

#

objects and variables, as far as I know are only free'd once process ends

stone gyro
hearty prawn
#

therefore with enough varaibles you can crash your PC

stone gyro
#

Similarly for all the hardware differences. They won't change asymptotic complexity.

cursive agate
#

because Big O notation -/-> what cache your CPU has. hmm so yeah it does not matter.

plucky onyx
plucky onyx
cursive agate
#

yeah

stone gyro
#

meh, I wouldn't say "doesn't promise anything"

hearty prawn
#

what do i work on now

#

help

#

making a language was cool and all but tf do i do now

stone gyro
#

I mean, I'm reminded of that GTA 5 online loading bug, which ended up being caused by, apparently, rockstar programmers being hacks who implemented an O(n^2) JSON dict parsing algorithm, and this is used to parse megabytes worth of JSON every launch, which takes minutes. 😔

plucky onyx
#

got it thanks 🙂 I'm droppping down everything that is far away from real world results.... I'm sorry for that dear MATHEMATICANS/ THEORISTS 🙂

hearty prawn
#

?

cursive agate
#

like how i am depressed

hearty prawn
#

math is weird

#

depression is not fun

cursive agate
#

i thought i can be happy but i just cant get it huhuhu

hearty prawn
#

lmfao

#

i need to learn frontend AGAIN

cursive agate
#

this package needs to be merged lmao it has been five months already xD

plucky onyx
#

!e

obtuse swallowBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

plucky onyx
#

!e [print('Hellow world - this is extremelly great feature of this chat I dont know that is exists')]

obtuse swallowBOT
#

@plucky onyx :white_check_mark: Your eval job has completed with return code 0.

Hellow world - this is extremelly great feature of this chat I dont know that is exists
eternal trail
#

you can test out eval in the #bot-commands

#

but yeah, it's pretty cool

cursive agate
#

whats cool?

eternal trail
#

it

cursive agate
#

me? thanks

plucky onyx
eternal trail
#

time to make uncomfyhalomacro a deweted usew

cursive agate
#

otn worthy

#

deweted uncomfy

plucky onyx
eternal trail
plucky onyx
#

!e [a = input(); print (a);]

obtuse swallowBOT
#

@plucky onyx :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     [input a; print (a);]
003 |      ^^^^^^^
004 | SyntaxError: invalid syntax. Perhaps you forgot a comma?
cursive agate
#

hmmm sad.

plucky onyx
#

!e [a = input(); print (a);]

obtuse swallowBOT
#

@plucky onyx :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     [a = input(); print (a);]
003 |      ^^^^^^^^^^^
004 | SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
plucky onyx
#

!e [a := input(); print (a);]

obtuse swallowBOT
#

@plucky onyx :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     [a := input(); print (a);]
003 |                  ^
004 | SyntaxError: invalid syntax
oak hemlock
#

\🤔

plucky onyx
#

i'm just switching between 2 channels - not convinient

eternal trail
#

as I told you earlier, you can test out the commands in #bot-commands

#

Im assuming you want me to make a new thread

#

I can't do that, sorry

plucky onyx
#

find solution - duplicate tab in chrome - than in second tab bot-commands 🙂

#

may be not perfect... but more convenient

neat glen
vast valley
#

!e quit()

obtuse swallowBOT
#

@vast valley :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'quit' is not defined
plucky onyx
#

!e [quit()]

obtuse swallowBOT
#

@plucky onyx :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'quit' is not defined
hearty prawn
#

!e

exit()
obtuse swallowBOT
#

@hearty prawn :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'exit' is not defined
hearty prawn
#

!e

import sys
sys.exit()
obtuse swallowBOT
#

@hearty prawn :warning: Your eval job has completed with return code 0.

[No output]
hearty prawn
#

!e

print("still works")
obtuse swallowBOT
#

@hearty prawn :white_check_mark: Your eval job has completed with return code 0.

still works
plucky onyx
hearty prawn
#

All the code executed from the bot is done in a thing called snekbox, basically arbitrary code execution.

vast valley
#

!e ```py
import sys
print(sys.version)

obtuse swallowBOT
#

@vast valley :white_check_mark: Your eval job has completed with return code 0.

3.10.0 (default, Oct 26 2021, 23:04:50) [GCC 8.3.0]
hearty prawn
#

!e

case
obtuse swallowBOT
#

@hearty prawn :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'case' is not defined. Did you mean: 'False'?
plucky onyx
#

!e import sys
print(sys.version)

obtuse swallowBOT
#

@plucky onyx :warning: Your eval job has completed with return code 0.

[No output]
hearty prawn
#

Use a code block.

plucky onyx
#

how to multiline ?

hearty prawn
#

!code Use a code block.

obtuse swallowBOT
#

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.

hearty prawn
#

!e

import sys
print(sys.version)
obtuse swallowBOT
#

@hearty prawn :white_check_mark: Your eval job has completed with return code 0.

3.10.0 (default, Oct 26 2021, 23:04:50) [GCC 8.3.0]
hearty prawn
#

Funny thing, I remember making a ticket since I was able to access the files.

plucky onyx
#
print (sys.version)
print ('thanks - I got it')
hearty prawn
#

!e

import os
print(os.listdir("/"))
obtuse swallowBOT
#

@hearty prawn :white_check_mark: Your eval job has completed with return code 0.

['usr', 'snekbox', 'lib64', 'lib', 'etc']
hearty prawn
#

!e

import os
print(os.listdir("/usr"))
obtuse swallowBOT
#

@hearty prawn :white_check_mark: Your eval job has completed with return code 0.

['local', 'lib']
hearty prawn
#

!e

import os
print(os.listdir("/usr/lib"))
obtuse swallowBOT
#

@hearty prawn :white_check_mark: Your eval job has completed with return code 0.

['dpkg', 'gcc', 'os-release', 'x86_64-linux-gnu', 'apt', 'tmpfiles.d', 'locale', 'mime', 'compat-ld', 'bfd-plugins', 'gold-ld', 'ssl']
hearty prawn
#

ahaha

#

I still don't think mod's want us to access this.

plucky onyx
#

thats intersting -thanks

hearty prawn
#

No problem! Not much you can do except access the linux folder.

royal jetty
hearty prawn
#

Can't really edit anything since the OS is read only.

sick olive
#

hackers😱

hearty prawn
royal jetty
#

Hmm?

hearty prawn
#

I don't remember being able to access the linux folder.

novel hull
#

I don't think there's anything secret about that though

#

Snekbox is open-source

hearty prawn
#

Yeah.

sick olive
#

rm -rf /

plucky onyx
#

I don't want to hack anything - its in past - just searching for possibilities

hearty prawn
novel hull
#

!e py import os print(os.system('rm -rf /usr'))

hearty prawn
#

It didn't edit anything.

obtuse swallowBOT
#

@novel hull :white_check_mark: Your eval job has completed with return code 0.

32512
hearty prawn
#

!e

import os
print(os.listdir("/usr/lib"))
obtuse swallowBOT
#

@hearty prawn :white_check_mark: Your eval job has completed with return code 0.

['dpkg', 'gcc', 'os-release', 'x86_64-linux-gnu', 'apt', 'tmpfiles.d', 'locale', 'mime', 'compat-ld', 'bfd-plugins', 'gold-ld', 'ssl']
hearty prawn
#

It's still there. I tried this last time.

novel hull
#

I was wondering if it'd audibly error or just silently noop

hearty prawn
novel hull
#

I guess the exception would be raised if I didn't use os.system but rather remove

hearty prawn
#

Hm

#

I don't think there is a way to break out of NsJAIL

#

Unless you turn it off but for that I need to get it running on my local machine, which didn't work last time I tried.

novel hull
#

Hopefully there isn't

sick olive
#

!e
import os
print ('before')
print(os.listdir())
os.mkdir('shit')
print('after')
print (os.listdir())

obtuse swallowBOT
#

@sick olive :x: Your eval job has completed with return code 1.

001 | before
002 | ['Pipfile', 'Pipfile.lock', 'config', 'snekbox', 'user_base', 'tests', 'LICENSE']
003 | Traceback (most recent call last):
004 |   File "<string>", line 4, in <module>
005 | OSError: [Errno 30] Read-only file system: 'shit'
hearty prawn
#

Chris and Eivl and Jack did tell me to try stuff so I'll give it another shot.

neat sparrow
#

I wonder what's inside user_base

plucky onyx
#
print ("can't use multiline - whats wrong ??")
#

how to exec it ?

sick olive
#

3 quotes

#

copy the above @plucky onyx

plucky onyx
#
import os
print (os.version)
]
sick olive
#

edit doesn't work

novel hull
plucky onyx
#

!e ```py
import os
print (os.version)

obtuse swallowBOT
#

@plucky onyx :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | AttributeError: module 'os' has no attribute 'version'
plucky onyx
#

great thanks 🙂

novel hull
#

On another note

#

Littering ot with this is not very helpful, #bot-commands is better suited for playing around with eval

sick olive
#

!e
import datetime
print(datetime.datetime.now())

obtuse swallowBOT
#

@sick olive :white_check_mark: Your eval job has completed with return code 0.

2021-11-14 12:06:07.266724
plucky onyx
#

!e ```py
import datetime
datetime.now()

obtuse swallowBOT
#

@plucky onyx :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | AttributeError: module 'datetime' has no attribute 'now'
sick olive
#

guess the server loc?

#

UTC

plucky onyx
#

got it - thanks so much

novel hull
#

@obtuse swallow is hosted on Linode servers, maybe they have the locations on their site

plucky onyx
#

so next question to this GREAT thing - if google auth for python preinstalled here or can be installed - than I can read here file from my google drive an process it - and show my processed data to community and allow to play with it

sick olive
#

!e
import datetime
print(datetime.datetime.tzinfo())

plucky onyx
#

my drive is read / write - so all changes can be saved back to my google drive shared file

sick olive
#

!e
import datetime
print(datetime.datetime.tzinfo())

plucky onyx
#

i can make shared folder on my google drive and we can play with files there from right here

sick olive
#

!e
import datetime
print(datetime.datetime().tzinfo())

sick olive
#

but again I don't think u can access system cmds

plucky onyx
#

so collaboration in real time with code not only words

sick olive
#

!e
import datetime
dir(datetime)
#print(datetime.datetime().tzinfo())

#

!e
import datetime
print(dir(datetime))
#print(datetime.datetime().tzinfo())

#

!e
import datetime
dir(datetime)
print(datetime.tzinfo())

#

!e
import datetime
dir(datetime)
print(dir(datetime.tzinfo()))

still pike
#

#bot-commands pls thx

cursive agate
#

i see pollution

sick olive
cursive agate
static trout
#

zuckerburg looks like an alien

#

idk his expressionless face for any tone of his voice

novel hull
#

Artisanally Enriched with Carbon Dioxide™®

static trout
#

focus on artisanally

novel hull
#

Yes, disregard the carbon dioxide part pls

cursive agate
#

i breathe their 2d existence into my lungs like cocaine

oak hemlock
#

don't do drugs kids

cursive agate
#

yes dont do drugs. also i already have drugs, called hormones

dusky inlet
#

h

thick widget
#

my wisdom is that 2037 will be a very dangerous year

#

or no

#

2027

sick olive
#

2007

neat sparrow
#

damn i wish i won the code jam

oak hemlock
#

don't we all

neat sparrow
#

Then i could be the true rust ruler

oak hemlock
#

too bad my team kinda stinky 😔

sick olive
#

2020-2021 has been very dangerous

neat sparrow
#

2024 is prolly gonna be a pandemic year

thick widget
thick widget
neat sparrow
#

For the last 20 years, there has been a pandemic every US presidential election

static trout
#

wat do you mean

thick widget
#

oh god

vast valley
#

!e ```py
def fibonacci(n):
if n == 1:
return 1
elif n == 2:
return 1
elif n > 2:
return fibonacci(n - 1) + fibonacci(n)
for n in range(1, 1001):
print(n, ':', fibonacci(n))

obtuse swallowBOT
#

@vast valley :x: Your eval job has completed with return code 1.

001 | 1 : 1
002 | 2 : 1
003 | Traceback (most recent call last):
004 |   File "<string>", line 9, in <module>
005 |   File "<string>", line 7, in fibonacci
006 |   File "<string>", line 7, in fibonacci
007 |   File "<string>", line 7, in fibonacci
008 |   [Previous line repeated 995 more times]
009 |   File "<string>", line 2, in fibonacci
010 | RecursionError: maximum recursion depth exceeded in comparison
thick widget
#

i said 2027 will be a dangerous year because all the 12 year olds today will turn 18 then

#

meaning adults

sick olive
#

n - 2?

glad grove
neat sparrow
#

should be fibonacci(n-1) + fibonacci(n-2)

#

Only if n > 2

novel hull
#

I think it's the 4th suggestion to use #bot-commands in the last 30 minutes kek

thick widget
#

sorry i cant resist the laughter

novel hull
#
def fib():
    a, b = 0, 1
    while True:
        a, b = b, a + b
        yield a

def first_n_fib(n):
    return [num for num, _ in zip(fib(), range(n))]

[dabs in generator]

oak hemlock
#

dabbing is dead

#

let's keep it that way

novel hull
#

I speak the language of the dead

oak hemlock
#

what the heck

#

what is ctrl + ctrl

vast valley
#

!e ```py
def fibonacci(n):
if n == 1:
return 1
elif n == 2:
return 1
elif n > 2:
return fibonacci(n - 1) + fibonacci(n - 2)
for n in range(1, 1001):
print(n, ':', fibonacci(n))

obtuse swallowBOT
#

@vast valley :x: Your eval job timed out or ran out of memory.

001 | 1 : 1
002 | 2 : 1
003 | 3 : 2
004 | 4 : 3
005 | 5 : 5
006 | 6 : 8
007 | 7 : 13
008 | 8 : 21
009 | 9 : 34
010 | 10 : 55
011 | 11 : 89
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/zufixiqubu.txt?noredirect

solid prawn
novel hull
#

You win this round

vast valley
#

I was just trying to see if the bot would even try to output it but it gave up.

clear root
#

itertools.islice crying in the background

vast valley
#

weak

cursive agate
#

hmm

novel hull
#

zip with range is how chads do it

solid prawn
#

yeah imagine having an import

novel hull
#

imagine using map(tuple) instead of zip(*zip(*mat))

mortal hull
#

itertools.starzip when

novel hull
#

y e s

mortal hull
#

we need a star version factory function

solid prawn
#

does that work

#

hm

novel hull
#
In [21]: mat = [[0, 1, 2], [3, 4, 5], [6, 7, 8]]

In [22]: [*zip(*zip(*mat))]
Out[22]: [(0, 1, 2), (3, 4, 5), (6, 7, 8)]```
solid prawn
#

hmm

novel hull
#

zip(*item) transposes the iterable

solid prawn
#

yeah

novel hull
#

So if you transpose twice, you get the same, but in tuples

#

which is officially pog

solid prawn
#

i thought you were talking about the fibonacci thing lol

novel hull
#

oh, no, sadly

pale mesa
#

is the in-order traversal for this SQTPURV

#

and the pre-order PQSTRUV

mortal hull
#

yes

pale mesa
#

google and copy lemon_smug

obtuse swallowBOT
oak hemlock
static trout
#

bing and copy

oak hemlock
#

gross

pale mesa
#

copilot

static trout
#

lmao

oak hemlock
#

omg

pale mesa
#

"the ai gave the code to me"

oak hemlock
#

love Copilot

dusky inlet
#

lol

cedar imp
pale mesa
pale mesa
#

thats better

oak hemlock
#

vroom vroom

oak hemlock
dusky inlet
oak hemlock
stone gyro
#

I just got a wonderfully cursed idea

oak hemlock
#

oh no

cedar imp
#

I can delete it

oak hemlock
#

\🤔 I don't think that's necessary

dusky inlet
static trout
oak hemlock
static trout
oak hemlock
#

I do not approve of this code

stone gyro
#

!e
want to add generated elements to a list until you stop generating them? Just loop over the list itself!

import random
lst = [object()] # sentinel
for _ in lst:
    if random.random()<0.95:
        lst.append(0)
print(lst)
oak hemlock
#

Yandere dev might, though

cedar imp
obtuse swallowBOT
#

@stone gyro :white_check_mark: Your eval job has completed with return code 0.

[<object object at 0x7f9c78a58200>, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
cedar imp
stone gyro
#

who needs while loops, amirite

oak hemlock
#

until loops \🥴

unkempt vapor
#

logo_pycharm vs logo_vscode

dusky inlet
#

nvm

#

somehow i was interpreting it as 2 loops

obtuse swallowBOT
dusky inlet
#

lo

oak hemlock
#

bant

dusky inlet
#

🐜

#

lol

oak hemlock
#

that emoji is like impossible to see

dusky inlet
#

ikr

#

same with 💣

oak hemlock
#

🕷️

dusky inlet
quasi cape
#

lol

clear root
#

don't see the problem tbh

oak hemlock
#

♟️

quasi cape
#

does bant mean banned

oak hemlock
#

yes

dusky inlet
#

no

quasi cape
#

ok

oak hemlock
#

what

dusky inlet
#

b an ant

cedar imp
#

I know my code may not be so eloquent or classy but as a learner i tried my best to do it my way with my availableknowledge instead of just asking others or the internet to do the work for me so sorry if it wasn't up to your standards but I'm happy with my accomplishment

oak hemlock
#

that was trippy

#

I thought I jumped channels

oak hemlock
#

I thought this joke was funny

pale mesa
#

oh wait its white now it was grey for me a few days back

cedar imp
#

it just print user chose this computer chose that and stops

oak hemlock
#

™️ isn't an actual emoji

pale mesa
oak hemlock
#

\™️ and ™️ are the same

pale mesa
oak hemlock
pale mesa
#

trippy huh

oak hemlock
#

LMAO

#

bizarre

neat glen
oak hemlock
#

fr

#

is this why you always ignore me

neat glen
oak hemlock
#

just another ping to you lemon_angrysad

neat glen
#

sometimes you reply me at 1:00 am

static trout
#

timezones 🕶️

oak hemlock
#

tbh it's not even just timezones

#

what even is a sleep schedule

neat glen
pale mesa
neat glen
#

blame thanOS

cedar imp
oak hemlock
#

:(

neat glen
pale mesa
#

time disappears

oak hemlock
#

oh

#

where it go tho

pale mesa
#

smh its a pick up line

oak hemlock
#

oh

pale mesa
#

time to kms

oak hemlock
#

you are right I feel picked up

pale mesa
#

this slow mode really makes it hard to do pickup lines

#

or i am just naturally terrible

oak hemlock
#

I know a place without slow mode

pale mesa
#

you mean my heart whenever i see you

oak hemlock
#

oh

oak hemlock
#

LMAO

sick olive
#

thoughts on cash-app vs paypal?

oak hemlock
#

in what regard?

sick olive
#

which is better, not only in pros and cons but with personal experiences

pale mesa
#

not american enough to try out cash app

sick olive
#

same

pale mesa
#

but paypal works for me. the transaction fees are abit irritating sometimes but i never had issues with it

sick olive
#

nah i've hated paypal recently, they block your account for literally anything

#

i have money locked in there since march

oak hemlock
#

I can't imagine CashApp being better in many regards tbh

#

It's a lot harder to get away with things on PayPal, plus it's used by a lot more online retailers

pale mesa
#

cashapp feels more casual to me

sick olive
#

surprised no one has created a payment app which solves the problems paypal has

oak hemlock
#

and what's that?

sick olive
#

money transfers

oak hemlock
#

uh

#

what are you using PayPal for if not to transfer money?

sick olive
#

i mean they make money transfers so painful

oak hemlock
#

hm... not in my experience

pale mesa
#

ey? i thought u just enter the email and then its one click away

oak hemlock
#

yeah lol

sick olive
#

yeah i'm just waiting for strike to come to the uk

clear root
#

tbh, everytime I wanted to give a friend money, I just did it through a bank

#

or even online retail

neat glen
oak hemlock
#

I've used many different things in the past lol

pale mesa
#

if u want really safe ways just do wire transfers haha

oak hemlock
#

PayPal, CashApp, Venmo, crypto

#

unfortunately everyone just uses their own things

sick olive
#

i would use crypto for international payments. since it's not managed by governments or anything and it's an online currency, there's no fees

pale mesa
#

my country is real small and our banks have their own standardized payment protocol

neat glen
#

just use cash ._.

pale mesa
#

so its easy to transfer money directly from banks

clear root
#

there are fees for crypto

sick olive
vast marlin
clear root
#

they are just smaller than alternatives for international transfers

deep heath
#

'protects'? Lol, no. Because it has it's own bubble and its worts is based solely on demand

sick olive
#

bitcoin lightning network resolves those issues

still pike
#

huh...?

deep heath
#

Gold is inflation-proof. Swiss Frank used to be inflation-proof because it used to be covered with gold

sick olive
deep heath
#

Crypto is basically gambling that the hype will continue and you can sell your coins late at the higher price (because demand)

clear root
#

at the same time, buying voting rights for a financial system seems a bit dystopian

sick olive
#

best to use bitcoin because of it's lightning network

deep heath
#

Didn't Revolut market themself as easy payment and transfer in any currency? They were quite loud a few months back, now I don't really see their ads

#

And I'm salty at how Revolut's recruiter just ghosted me when I asked for its antidiscrimination policies. They just said 'we have it' but when I asked some detailed questions, I got ghosted. And when I finally said after a month or two that the silence speaks more about their real inclusivity than their declarations, I just got told the position is closed now. Not even sorry, if I recall correctly

sick olive
#

can't believe revolut charges you just to make an atm withdrawal

#

yeah we're definitely moving towards a cashless economy

#

especially since covid

deep heath
sick olive
#

^

deep heath
#

And since Revolut doesn't have their own ATMs, then they don't really have any way of providing withdrawals without any fees

#

It depends. My bank makes my card and all withdrawals free if I fulfill some stuff.
Some banks have fees for ATMs belonging to different organisations

sick olive
deep heath
#

And every bank has a fee for withdrawal in other countries - and Revolut's cards aren't really based in any country, so it's just logical they keep their money virtual

eternal trail
#

Some banks have fees for ATMs belonging to different organisations
same here, but only if you withdraw over x times a day or something

#

I think it's 2 withdrawals per day

deep heath
sick olive
#

i'm switching to them from halifax soon

#

monzo has to have the worst security i've seen 😂

thick widget
#

i hold it pretty much everyday

neat glen
#

why is mspaint lagging on this size, is it too large?

deep heath
#

In my case it's about those requirements that also make the card free. For student/young adult account (which I still have, I guess they will convert me next year or they forgot? XD) it's about card usage only (card-present transaction druign a month). For full account it's also about earning (getting inbound transfers) of x amount during a month. So I don't even remember what the fees are, at all XD

#

I also decided to keep my business account there as I formally need one and there are no fees when you have personal with them as well

#

Although I don't keep a card for it

thick widget
deep heath
#

Nfc payment from my bank app + BLIK when I can't be arsed to log in on bank webpage to confirm online payment or type card info because we 3DSecure and I'd need to confirm on the app anyway

#

Blik (stylised: blik) is a payment system in Poland that allows users to make instant payments and withdraw cash using only the user's standard mobile banking app.
The system allows to make online and in-store purchases and to transfer money in real time between bank accounts and ATMs, including cash withdrawal from ATMs, without the need of a p...

#

Blik also allows for making cardless withdrawals, so I don't carry a card with me at all

sick olive
deep heath
# sick olive how does that work? do you get a code or something that you can scan at an atm?

6-digit code, 2 minute lifespan. You type it in. Then I guess the ATM/blik website (for online payments, I use it for shipping all the time) makes some request and checks for active blik codes (I guess it must be centralised so they know which bank to ask? or if I select my bank as payment option, I get blik or normal login, so they just check their own)... Then bank app prompts you to confirm payment (with info how much, to whom, and device details like OS and browser). Type in your PIN and you're done

#

Blik also allows for easy transfers to phone numbers (you register in your bank app your phone number and it's used as shorthand for your account number)

sick olive
#

oh alright

static trout
#

except it doesnt withdraw from your account

#

it's like a seperate mini-bank you charge with money at your convenience and you can make payments from there

deep heath
#

Google Pay is using your card linked to Google to pay for stuff, including NFC payments. I use it for uber

#

While blik is integrated by banks themselves

#

And not a separate account to prepaid or linked service that charges your card

#

Blik was launched in February 2015 by Polski Standard Płatności, an alliance of six Polish banks,[4] itself a member of the European Mobile Payment Systems Association. The number of participating banks has grown since. Blik had 7 million users and processed 424 million transactions in 2020.[5]

thick widget
deep heath
#

My partner recently became annoyed because they have their card saved in eg train ticket system... But now the train system implements 3DSecure and they would need to log in to the bank anyway (log in + text message code) to confirm the card payment. And I just use blik XD

#

Cat or snek?

raven mountain
#

cat

tepid echo
#

lol

#

snek

raven mountain
#

nah snakes aint that fat

tepid echo
#

lol ik

raven mountain
#

cats are pretty flexible

tepid echo
#

@deep heath still the cofee?

deep heath
deep heath
tepid echo
#

i see

deep heath
#

Hm, but file doesn't have children. And it's an interface...
I'd do that as abstract base class without children, then I can do so methods already. And then two children classes for file and dir, dir implementing additional stuff about children

sick olive
#

should i commit to learning golang or rust?

solid prawn
#

what are you learning it/them for

sick olive
#

i'm probably never going to use either of them, but i see myself more likely to use rust

solid prawn
#

you have your answer then 🤷‍♂️

sick olive
#

i've worked halfway through this golang course though and i feel like i've come too far to stop

ocean walrus
#

Hi :D

#

what language is this

#

Go?

#

TS?

neat glen
#

i'm guessing ts

dusty aspen
#

TS, probably

#

Those type annotations are TS-like

neat glen
#

yeah

ocean walrus
#

alright

dusty aspen
#

.uwu deleted user deweted usew

median swallowBOT
#

deweted usew deweted usew

neat glen
#

it could've been deweted uwuser

#

i'm upset after seeing this

deep heath
cursive agate
#

Alright
~ @ocean walrus (2021; also cited by @cursive agate ,2021)

valid APA 😉

static trout
dusty aspen
static trout
#

why are there so many upvotes/downvotes

#

134 - 32
that means well over 160 people have seen it

ancient mural
novel hull
#

I'm unsure if this is expert-level trolling

dusty aspen
#

Now how many people like it

static trout
ancient mural
#

134 lines were added, 32 lines were removed

static trout
#

ah i see

onyx ice
#

13 reviews and 2 comments is the better measure of how much has been viewed

static trout
#

but you have to agree this pr is the epitome of greatness

#

nice nickname btw

onyx ice
dusty aspen
#

1828 additions 🥴

onyx ice
onyx ice
dusty aspen
#

ahh

ancient mural
onyx ice
#

1,569 in the json, 259 for the colo(u)r file

#

I am never spelling colour again in my life

#

I am almost tempted to change everything back to color

static trout
#

COLOUR

dusty aspen
#

this is treason

#

lies

#

greetings

static trout
#

its
colour > color
behaviour > behavior

dusty aspen
#

noo

#

why would you want to type out a u for no reason

static trout
#

because!

onyx ice
#

then explain this:

static trout
onyx ice
#

Can't believe you guys went through all of that trouble to get rid of autocorrect

dusty aspen
#

shh we won't talk about how discord does this through the language choice in settings

onyx ice
#

Typed that out faster didn't you

static trout
#

look at those gross red lines
imagine not typing colour KEK

tepid echo
dusty aspen
static trout
#

im not going to type race

tepid echo
static trout
tepid echo
#

lol

static trout
#

no like really

#

it pained horribly

dusty aspen
static trout
#
struct ColorCode(u8);

impl ColorCode {
    fn new(foreground: Color, background: Color) -> ColorCode {
        ColorCode((background as u8) << 4 | (foreground as u8))
    }
}

(background as u8) << 4 | (foreground as u8) what does this statement do? thanks

dusty aspen
#

eww imagine not using named struct fields

tepid echo
#

kinda confusing yea

onyx ice
static trout
#

rest assured anything going in my code will be "colour"ed.

dusty aspen
tepid echo
#

@onyx ice this name is great

static trout
tepid echo
#

are you bald bearded btw

dusty aspen
onyx ice
tepid echo
#

lol ok

novel hull
#

Which is basically equal to multiplying by 2 ** n

static trout
tepid echo
#

I've never really understand bit manipulations

novel hull
#

Bitshifting to the right is the same, except you're dividing and rounding down

dusty aspen
#

don't we all, don't we all

novel hull
static trout
tepid echo
#

didn't need them

dusty aspen
#

it's great yeah

tepid echo
#

they're fast aren't they

novel hull
#

& is masking, you're checking if something is present
| is inserting, you're forcing a bit to be 1
^ is removing, you're forcing a bit to be 0

#

You can store a lot more info using integer masks

static trout
#

so we need to write 1 byte (8 bits)
so we are shifting the background u8 to the side and adding the foreground u8 using a insert

#

i got it thank you
i just needed to know that's a bitshift

tepid echo
#


    #include <iostream>
     
    using namespace std;
     
    int main() {
      string a, b;
      cin >> a >> b;
      int sum1=0, sum2=0;
      for(int i = 0; i < a.size(); i++) {
        sum1 += (int)tolower(a[i], locale());
        sum2 += (int)tolower(b[i], locale());
      }
      if(sum1 > sum2)
        cout << 1;
      else if(sum1 == sum2)
        cout << 0;
      else
        cout << -1;
    }``` why tf this code failed at test 5 :/
serene dagger
tepid echo
#

great

obtuse swallowBOT
#

@sick olive :white_check_mark: Your eval job has completed with return code 0.

001 | bin(a)='0b101'
002 | a=10 and bin(a)='0b1010'
static trout
#

ColorCode((background as u8) << 4 | (foreground as u8))

#

one question about this

static trout
#

because ColorCode is a u8

#

and the inputs are u8

#

wont it overflow?

#

aboo will say: Hi :D

dusty aspen
#

ColorCode isn't a u8, it's being used as a C-style enum

ocean walrus
#

Bit shifting left is sort of like multiplying a value by two, or multiples of two

static trout
unreal zenith
#

should i use pycharm or vscode?

static trout
#

isnt it based on u8 anyway

tepid echo
ocean walrus
#

What do you prefer? Both will provide you great experiences

dusty aspen
static trout
#

that's what im telling

unreal zenith
# ocean walrus Depends

i like both, I like having liveshare and github closely integrated which is why I use vscode, also it's pretty light on resources

static trout
unreal zenith
#

but also pycharm installs every package for a project into the project folder so it can run everywhere which I like

onyx ice
unreal zenith
novel hull
#

I'm pycharm gang

onyx ice
#

Nah, just get through vim tutor once and use it a few times, should be good to go from there

novel hull
#

Though VSC is pretty good also, I use it for go

unreal zenith
#

graphic design is my passion

dusty aspen
sick olive
#

be me
write proposal
proposal get praised so much for its intelectuall brain waves level that the Queen of England herself (yes real) gave me the title of Lord and Sir.
win noble price
win the 2024 presidential election
be ceo of BlackRock
its that simple?

static trout
#

wait nvm i just realized overflow isnt a problem

#

because the Color enum has values only upto 15

#

in other words, just a u4

novel hull
#

And two of those fit nicely into a u8

static trout
#

yes

sinful lark
#

"Now it appears the backlash was so extreme the tech giant decided to quietly scrap the new move just days after it announced the change. "

novel hull
#

Who could've seen that coming

solid prawn
#

i didnt

#

didnt think they would listen to community feedback that is

sinful lark
#

yeah i was pretty certain they were not gonna 180 on this

static trout
#

Since the field ordering in default structs is undefined in Rust, we need the repr(C) attribute. It guarantees that the struct's fields are laid out exactly like in a C struct and thus guarantees the correct field ordering.
would someone please explain what difference does it make

pseudo pivot
#

guys what would be better to learn css (advanced) or typescript? 🤣

narrow prawn
#

can someone help me out, im tryna revise for a paper. i forgot what computational thinking is

dusty aspen
#

also, what constitutes as advanced CSS? The syntax of CSS is rather simple, and memorizing all the possible properties is a lost cause.

pseudo pivot
narrow prawn
#

css is actually alot better for programing game mechanics, but like dawn said above time with java is more on the side of typescript

#

really depends on the purpose

dusty aspen
#

Uhh, what does CSS have to do with mechanics? It's for styling.

pseudo pivot
#

just a bit weak in css

narrow prawn
#

then go for typescript, since u know alot abt java its going to be alot easier for u 2 learn

dusty aspen
#

Uh, typescript has nothing to do with java, besides the fact that they're both statically typed

narrow prawn
#

just the generic components, like abstraction and decomposition

#

yeah

#

i cant remember stuff even from 16+ lvl

#

the messiah ..

sick olive
#

has anyone here heard of web3 before? if so, do you think its a good or bad idea. do not search it up.

hollow holly
#

web3io?

#

The smart contracts thing?

sick olive
#

im trying to get as close to an objective view on cryptocurrencys and stuff as possible.

#

to do so im trying to see how many people even know what web3 is, and of those who do, how many think its good and how many think its bad.

cursive agate
sinful lark
#

anyone have a ELI5 explanation for race condition and data race?

magic tendon
#

for example, you have a count.txt file that is incremented by a script after ten seconds for some reason

dusty aspen
#

it can also happen with one piece reading and another writing at the same time, right? Or is that fine?

tepid echo
#

do you guys directly search on stackoverflow or you just google it

sinful lark
tepid echo
#

i think verbose directly search on stackoverflow

#

iirc

pliant canyon
#

ay but if two pieces of code read data it should be fine ri?

magic tendon
#
with open("count.txt") as f:
    count = f.read()

time.sleep(10)

with open("count.txt", "w") as f:
    count = f.write(count + 1)

If I launch two of those at a 20s interval, it should work fine, right?

sinful lark
#

yeah

magic tendon
hollow holly
#

A real-life example of a data race, kind of (credit to gobble for this) ,would be deja-vu

your brain is trying to read memories while also writing, hence why you feel like you've been there before

deep heath
pliant canyon
#

nice

magic tendon
teal storm
# static trout > Since the field ordering in default structs is undefined in Rust, we need the ...

well the C compiler expects the fields in a struct to be laid out in a certain way (namely, in the order in which they are defined, + alignment) so if they aren't laid out like that then the C code and the Rust code will be accessing the wrong data
like for example let's say i had a struct like this:

struct Thing {
    uint64_t a;
    uint16_t b;
}

now the C compiler will assume that a comes before b but then maybe the rust compiler puts b before a, and then in your rust code you assign a = 1 b = 0 and then you pass it to the c code but the C code expects a to be before b so it reads b = 1 a = 0

sinful lark
magic tendon
#

nah, you launch that script at the same time, and you assume your OS is smart enough to have multitasking

sinful lark
#

so what would happen during a 1s interval exactly?

magic tendon
#

lemme just make you a timeline

sinful lark
#

alright

teal storm
sick olive
teal storm
dusty aspen
#

nicky replied to a message about 2 readings, no writes

deep heath
teal storm
teal storm
teal storm
#

brain moment

deep heath
#

Well, without context (with missing reply) my message is wrong, I don't blame you :)

sick olive
#

now even if cryptocurrency works as solution to problems like big tech having all our data, its more of a trade the anything. in return we get free services, youtube, google docs, practically unlimited storage. cryptocurrency doesnt give any benefits in return. and, big tech are beginning to invest in crypto because of web3/metaverse. the best way of making money off that is nfts. its no coincidence that discord is beginning to implement nfts. theyr'e not going to sell our data. instead, they're now going to discretely make everything pay to win. we've literally just replaced one trade off with another.

magic tendon
#

@sinful lark

magic tendon
#

they both read n and write n + 1, because the first process didn't have time to write to the file before the second process could read it

#

so despite launching two processes, the file has only been incremented by 1

sinful lark
#

ahh i see

deep heath
magic tendon
#

yup yup

sinful lark
#

so what is the best way to avoid this race condition

teal storm
#

mutex

#

how do mutex work

#

mutex or use rust

#

or both uwu

magic tendon
#

some form of locking

deep heath
sinful lark
#

oh lol

teal storm
sinful lark
#

so this mutex will lock the portion of the thread until the first task finishes?

deep heath
#

C has atomic ops. I remmeber using it years ago

sinful lark
#

or do they work in parallel

teal storm
#

i was thinking abt how to do it and i had an idea to have like a boolean flag that says if it's locked but writing to that boolean flag is not an atomic operation

deep heath
teal storm
#

or more specifically, checking it and then writing to it is not an atomic operation

sinful lark
#

ahh okay i see

deep heath
sinful lark
#

cpp standard library so big, ive never even heard of this lol

sick olive
#

imagine using libraries or modules in anything or for anything smh

deep heath
sinful lark
#

so what is the difference between atomic vs mutex?

sick olive
deep heath
#

There are also semaphores which are kinda like... Not flag mutex but value mutex. They allow for a set number of locks at the same time

sinful lark
#

so will mutex lock slow down whatever you are doing?

deep heath
sinful lark
#

ah, and as for an atomic operation, there is no locking involved

deep heath
# magic tendon <@!319993807183544320>

Atomic only means that something is one operation. In case of mutex it's checking state of mutex and changing the state. So there's no chance that someone else will do anything in this sleep/pause part (Ak's diagram, after which I said the sleep can also be just normal time between two operations) @sinful lark

#

Race condition can also block you if you do more than one mutex at once (eg one for each resource)
Because let's say one threat locks mutex A and then mutex B. And the other tries them as well... but in opposite order.
And it can happen that thread1 locks A, thread2 locks B... And they wait for each other's release which doesn't happen

#

That's why you should always lock from the same 'direction' so you don't lock yourself out

sinful lark
#

oh interesting.. thank you for the explanation. I am gonna play around with std::mutex and atomic now.

#

also thanks @magic tendon for the detailed timeline

deep heath
#

Lol, staff at the cat cafe realised the tip box has money. I overheard one member telling the other "I got a heart attack" XD
I love being a secret tipper. Especially when the day seemed busy but the box was literally empty or almost empty

safe ravine
#

Anyone wanna learn Sylheti Bengali? I will teach it you😂

sinful lark
safe ravine
#

I was born and raised in the UK so forgot a lot of the language when I started school 😦

sinful lark
#

it happens, i assume ur family didnt speak much of bengali at home?

serene dagger
#

no thanks im already unintelligible enough lemon_hyperpleased

sinful lark
#

the area of new york city i live in is literally Dhaka 2.0 🤣

#

too crowded and i dont like it, thats why im moving out after next semester

safe ravine
#

When I did my mum wanted to hear me speaking English and I was shy to speak it then gradually I did and it turned into me speaking only english.

pseudo pivot
#

Ah Bengali nice

#

I am one too

sinful lark
teal storm
sick olive
#

big companies will use them
small companies will also use them to exploit us
effectively becoming big companies
investors will invest in big company

what am i describing??

#

i'll give you a cookie if you get it right

sinful lark
#

ai

oak hemlock
#

tax fraud

sinful lark
#

and that

#

loopholes

oak hemlock
#

capitalism

sinful lark
#

tru

onyx ice
#

Cookies

serene dagger
#

i second cookies

sinful lark
#

capitalism benefits the ruling class

onyx ice
#

Also, side note, finally got the .color command merged, much happy

oak hemlock
#

.color? What's that do again

sinful lark
#

according to my socy class xd

midnight forge
#

lol

oak hemlock
sinful lark
#

yea]

sick olive
#

the correct answer was

oak hemlock
#

ngl, I had that class online and I don't remember a single thing it tried to teach me

onyx ice
median swallowBOT
#
Burning Sand

Color information for Color Burning Sand.

RGB

(217, 147, 118)

HSV

(18, 46, 85)

HSL

(18, 57, 66)

CMYK

(0, 32, 46, 15)

Hex

#D99376

Name

Burning Sand

sinful lark
#

the bourgeoisie

#

aka ruling class

oak hemlock
sick olive
#

everything. i was using it to prove a point to a friend that web3 will fail because that happening is an emergent system of captalism and inevitable

#

you all get cookies!!!

oak hemlock
#

I knew it was capitalism and tax fraud!

sick olive
#

losing my will to live everyday as i learn golang

oak hemlock
#

speaking of which

#

Unity is confusing the heck out of me

sick olive
oak hemlock
#

For some annoying reason...

#

When I tell my character to sprint while it's moving, the sprint animation plays but the speed won't update

#

if I sprint before moving, then the speed does update

sinful lark
#

did u write the event handling all on ur own

oak hemlock
oak hemlock
pliant canyon
#

handle that player movement 😩

oak hemlock
#

tbh I have yet to conquer C# naming schemes

#

everything is just PascalCase

pliant canyon
#

yes

sinful lark
#

thisThat this_that ThisThat

oak hemlock
#

someone thought that was a good idea apparently

pliant canyon
#

it does look wird

sinful lark
#

i prefer snake case for everything i use. regardless of language. Bad practice most likely

oak hemlock
#

yeah

#

I'm trying to "fit in" but it feels so cursed

sinful lark
#

yeah i feel u lol

oak hemlock
#

classes are PascalCase, methods are PascalCase, functions... aren't?

sinful lark
#

anyways i didnt know c# naming convention was pascal case. always though it was camel case

oak hemlock
#

maybe I'm crazy, actually

#

functions might be PascalCase

pliant canyon
#

there are no functions

oak hemlock
pliant canyon
#

non existent

sinful lark
#

isnt procedure also a function

oak hemlock
#

Rider calls them "Local functions"

sinful lark
#

class functions = methods and anything outside of a class i call them functions

sick olive
pliant canyon
#

yea but u cant have functions outside a class in c#

oak hemlock
sick olive
#

i know a kid who uses scratch. their naming scheme was essentially iphone case. Lower case first letter of the first word, and then uppercase first letter of the second word, then lowercase.

pliant canyon
sick olive
#

tIsiPhoneCase

oak hemlock
pliant canyon
#

the one where u dont need public static void main(string[] args) {}

sinful lark
oak hemlock
sinful lark
#

Procedures or subroutines are very important in assembly language, as the assembly language programs tend to be large in size. Procedures are identified by a name. Following this name, the body of the procedure is described which performs a well-defined job. End of the procedure is indicated by a return statement.

pliant canyon
#

yea that

#

thats just a convenience thing

#

how far can u go without making a program class

#

with a main method

oak hemlock
#

Rider calls it a local function, though

tepid echo
pliant canyon
#

damn rider

#

i guess rider is right

tepid echo
#

but tell me, why java 🥲

oak hemlock
pliant canyon
#

c#

sinful lark
#

what would be the opposite of local function

oak hemlock