#ot0-no-stealth-portals-please
3246 messages · Page 26 of 4
int main(int argc, const char * argv[]) {
int c;
start();
printf( "Enter a value : ");
c = getchar( );
doTask(c);
return 0;
}
you need to format your code
why the fuck does it print "tf" when i enter 1
at least fedora and opensuse does not do that. and Debian is my first distro btw xD
@cursive agate you know C right?
I'll respect those who use things like Ubuntu, openSUSE, or Fedora
because youre passing in the ascii (?) value of thae character
as desktop distributions, I mean
how do i not do that
I find it a bit hard to get behind the idea of something like Debian as a desktop distro
you're better off using scanf("%i", c)
yeah only for the first two chapters. im taking a break this week because im too focused on studying for my uni stuff.
i see
AHAHAHA
alright so
int main(int argc, const char * argv[]) {
int c;
start();
printf( "Enter a value : ");
scanf("%i", c);
doTask(c);
return 0;
}
``` `zsh: segmentation fault ./kAWAI`
what the fuck
xcode does yell at me
something null null
Format specifies type 'int *' but the argument has type 'int
Ohh yea do &c in the scanf call
question, why does that fix it?
it takes in a pointer
so like it can change it wr somehitng
ah
it works niow
& returns the pointer to its actual value, yes?
yes i thin kso
alright so now i need to actually make the search feature
it points to the address in memory yes i think so.
&c returns the address of c
Yes
yes
yes
it is not itself a pointer though, is it
like, REST APIs?
it's a reference
no just a get request
ok so you need to find a http library
*c is deref maybe?
*c is a deference if c is a pointer
and what the hell are references
I thought that was &
&*c should be valid
dereferencing a pointer of c
(This is why I stay away from C btw)
something something precedence
test.c:6:26: error: indirection requires pointer operand ('int' invalid)
printf("%p -> %i", p, &*i);
^~
im back
#include <stdio.h>
int main() {
int i = 100;
int* p = &i;
printf("%p -> %i", p, *&i);
return 0;
}
0x7ffcba82fe88 -> 100
libcurl :3
what file name
my brain hurts
<curl/curl.h> something, ive never used it
curl/curl.h ig
oki
i kind of find it funny that obama is a meme now
no idea why he is but i do wanna know
just a thing that comes with being widely known
What kind of meme is he
obamium
many kinds
obameme
help
No
lmfao
i have ```c
char searchTerm;
printf(" Search : ");
scanf("%s", &searchTerm);
char command[500000];
strcpy( command, "brew search ");
strncat(command, &searchTerm, sizeof(&searchTerm));
printf(command);
if the name i'm searching for is bigger than 4 charecters is trace trap's
hey
could someone help me with a calculator
sure go on
can I dm
if you just post your problem here, you have better chances of getting help
maybe claim a help channel
no
oh ok
do you need a char* searchTerm?
I used
def cube(x)
return x * x * x
if choice == 6 :
print(num1, "^", "3", "=", multiply(num1, num1, num1))
it worked with square but if you choose cube, it doesnt work
could it be because of the SyntaxError you have?
you're missing a : after cube(x)
sorry I'm a beginner
is there any other error
I mean other than the fact you don't use cube() anywhere
why do u call multiply() when u have cube()
u can raise x to a power of 3 using x ** 3 if u want
it worked when I did square() and myltiply()
hello
yeah I know
but thanks
would I write it as
cube(num1, num1, num1)
You defined the function to take a single parameter, which is then cubed
So you'll just be passing it the single number to be cubed
I mean really you're just writing a glorified pow
@hearty prawn i can't remember if this is 100% up-to-date but this is roughly what the compilation process looks like
TIL pow exist
lol
you can also implement your own pow function
it doesn't have much use due to **
thank you
any speed difference?
except for pow's third argument, which is amazing and really weird to have in the prelude of a programming language
!d pow
pow(base, exp[, mod])```
Return *base* to the power *exp*; if *mod* is present, return *base* to the power *exp*, modulo *mod* (computed more efficiently than `pow(base, exp) % mod`). The two-argument form `pow(base, exp)` is equivalent to using the power operator: `base**exp`.
yes but you shouldn't be using python if you care abt speed difference between pow amd **
modular exponentiation usually needs a library, yet here it is in Python
I mean according to the above description... I have my doubts
I mean the only difference seems to be efficiency
I never knew pow existed
thank you all
it worked!
(computed more efficiently than
pow(base, exp) % mod)
you can calculate absurdly high powers if you are going to take mod
it's quite a catastrofic difference in efficiency, to start with
!e
print(pow(3123012312,312312312,1000))
like, pow(base, exp) might be impossible to calculate
@stone gyro :white_check_mark: Your eval job has completed with return code 0.
56
But what's even more powerful
is that it supports negative powers
modular inversion
!e
print(pow(4,-1,7))
@stone gyro :white_check_mark: Your eval job has completed with return code 0.
2
is it possible to use pow so that the user can input the power
1 % 7 is 8??
wha
is that not what I said :faint:
often written as 8 ≡ 1 (mod 7)
well, aren't negative powers just 1 / x^n
My brain does not compute
im talking about the mod part
not modular ones
(that was meant to be a reply to a diff message)
Oh
/* Compute an inverse to a modulo n, or raise ValueError if a is not
invertible modulo n. Assumes n is positive. The inverse returned
is whatever falls out of the extended Euclidean algorithm: it may
be either positive or negative, but will be smaller than n in
absolute value.
Pure Python equivalent for long_invmod:
def invmod(a, n):
b, c = 1, 0
while n:
q, r = divmod(a, n)
a, b, c, n = n, c, b - q*c, r
# at this point a is the gcd of the original inputs
if a == 1:
return b
raise ValueError("Not invertible")
*/
apparently this is how it works
i don't have that ≡ symbol on my keyboard 😢
it was better without the /* */ 😔
Take an input or whatever as a variable and put the variable in the function
!e print(4**(-1))
@neat glen :white_check_mark: Your eval job has completed with return code 0.
0.25
square root would be 4 ** (1/2)
nth root is x ^ (1/n) I believe
mb
hmm
You can't use | x |, you have to use abs in python right?
right
Ugh
yeah
to me that just looks like abs value of the bitwise OR operation's res
clearly the solution here is to remove bitwise operators from python
lol
yeah, imagine using |x| for length 😳 and abs at the same time
Imagine using x for filler variables
cc @stone gyro 😳
Looks like a function in rust but you’re gonna run into an error because you forgot to or something (second arg)
... is where it's at
You mean a closure?
Yep
closures r poggies
I do remember liking the Rust closures
when they did what I expected them to, I mean
yeah, rust and swift get closures right
some stuff was confusing, like async and move
and... move move?
something like that...
Are closures just anonymous functions but butter?
Top paragraph, yeah sorta https://doc.rust-lang.org/book/ch13-01-closures.html
yeah closures get access to the variables in the surrounding scope
fn main() {
let x = 1;
let f = || {
println!("{}", x);
};
fn g() {
println!("{}", x)
}
f();
g();
}
error[E0434]: can't capture dynamic environment in a fn item
--> src/main.rs:7:24
|
7 | println!("{}", x)
| ^
|
= help: use the `|| { ... }` closure form instead
For more information about this error, try `rustc --explain E0434`
this is where you'd use move, no?
i have no idea what that does 
I think it gives ownership to the closure
so
let f = move || {
println!("{}", x);
};
could be wrong about that
haven't used Rust in ages
yeah, closures borrow when possible, they don't implicitly move
fn main() {
let x = 1;
let f = || {
println!("{}", x);
};
f();
}
this compiles and prints 1
ive forgotten what little of borrowing and ownership i'd learnt 
lol
cba to learn again
how do i do that
please how do I do cube root
that's what I did but it's not working and I put : this time
did you float() the input?
no
it worked for square root
okay i pull up
yeah u need to do that
you can't get the cube root of a string
make no sens
oh wait
I did that
gosh, don't be shy.. put some more
using static System.Math;
using static System.Console;
var num = GetInput();
WriteLine($"Cube root of {num} is: {Pow(num, 1/3)}");
double GetInput()
{
Write("Enter a number: ");
while (!double.TryParse(ReadLine(), out var n))
WriteLine("Not a valid number. Try Again.");
return n;
}
just have to deal with this exponential
😎
🥲
?
I'm dumb, I dont understand what you wrote
ah
but please can you help with the exponential
i agre 🥶 👍
wat lang is this in?
A video of Conway's Game of Life, emulated in Conway's Game of Life.
The Life pattern is the OTCA Metapixel: http://www.conwaylife.com/wiki/OTCA_metapixel - for more information, see http://otcametapixel.blogspot.com.au/
The life simulator used is Golly - http://golly.sourceforge.net/ which has a built-in script to generate these metapixel gri...
I don't know if the notification 1 symbol is actually a small punctuation mark meaning an error. Lmao
c hashtag
ooo, thats why it look so java
Please stop hurting my eyes Lmao
no. c octothorpe
is this C#
oh, it is
c hastag.
the c sharp discord servers suck ngl i much prefer the community in python
yall I did the exponential but I want to get rid of the second number question, the ways I've tried didnt work
im confused, what am i looking at
oh yeetskeet compile
is ```
"
"C
"B
"A
...
e
Might I interest you in pressing win + shift + s?
hey cy
hi
that didnt do anything
I suppose win is windows
i didnt send my teacher my test
which was 2 weeks ago
im going to blame it on my partner and say that i though she sent it
er... what Windows version are you using?
bruh
this laptop is old and wack
yall the exponential is working well
I'm officially done with the calculator :sob: :sob:
Wow, I didn't know anyone actually uses Windows 8 anymore
nnoiceee
I've seen far more Windows 7 and XP users than Windows 8
i used to back in 2018
"anymore"
lol
I mean people used it when it was the newest
but literally like everyone jumped ship immediately
Windows 8 really wasn't a good look imo
8.1 :P
:faint:
What's your terminal?
should i ping
no it's a program
a program that prints ABC
@magic jacinth why end stream
sorry for the ping it was thought very well tho
heart beat intensifies
@hearty prawn
- source.ys : the source code for the program
- cargo run -- -c source.ys : call the compiler with the arguments "-c source.ys" (compile the source code)
- nasm -felf64 : assemble the assembly code that the compiler outputs
- ld ... : link the assembled code against the complib (which contains the implementation for most of theYS instructions) and turn it into a executable file
- ./main : run the outputted executable file
yes
C#
til about out
there's also in and ref
yea i saw in the docs
Hey
ohhh
@teal storm mind if i dm you this seems intresting lmfao
feel free
awesome
hello
https://www.youtube.com/watch?v=3FxfXVuHRjM
i thought i was in for a nice little story
i was wrong.
Perranporth Beach, in Cornwall, is famed for being the "Lego beach". The truth is more complicated. • Thanks to Tracey Williams! 📸 Lego Lost At Sea: https://instagram.com/legolostatsea or https://twitter.com/legolostatsea 📕 Her photo book ADRIFT: https://amzn.to/3a8glNW [aff. link]
Edited by Michelle Martin (@mrsmmartin)
Sound mix by Graham Hae...
https://m.youtube.com/watch?v=kxOuG8jMIgI
Anyone else so sick of yt?
Earlier in 2021, YouTube experimented with making the public dislike count private to see if it would help reduce dislike attacks across the platform. And after analysis conducted in July of this year, we did see a reduction. Now, the YouTube public dislike count will be made private (but the dislike button is staying). Viewers can still dislike...
why do i feel this is skewed towards youtube
oh wait i just realized it's a youtube channel (as in the channel is owned by yt)
"last question: is this due to the amount of dislikes youtube rewind got?"
Probs lol
foot
okie
with what
i need a tutorial to make a compiled programming language
i'm done with making interpreted ones
Hey @cedar imp!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
i can't find one and i'm dumb
I just went with llvm's kaleidoscope and expanded on that
send pls
@ocean walrus might have something more specific
https://llvm.org/docs/tutorial/ uses C++ with LLVM
OMG C++
i love c++
https://medium.com/young-coder/so-i-created-a-programming-language-4d9c11038d22 i also found this but it's interpreted
the website is so ugly
I've been following Crafting Interpreters for both tree-walk and bytecode, but those are still interpreters
yeah
I've looked at that, it tells you absolutely nothing
it just explains what each step does
rather terribly, imo
it's a very high level theoretical overview, nothing specific
hm
But I suppose it is a medium blog, not a guide
h,
well i'll look into llvm more tommorow in school
thanks a bunch dawn, you are very wise
this is so cringe
too busy being braver ¯\_(ツ)_/¯
same to you !!
tbh it's something I don't particularly like but some of it I kind of trust them
I mean they're running the numbers and shit
they are preparing for youtube rewind
lmao
I mean they'll be departmentalized to the point where YouTube Rewind probably doesn't get much of a say
imma just move to odyssey
nvm i need youtube for some useful stuff like
anime ;)
bruh
sure
What language?
from scratch or with llvm?
scratch :faint:
Lmao
dunno
snowy just asked about compiled language tutorials
Hm
kinda; kinda not
i registered, but wheres the actual conference happening
what conference
pyjamas
a fully remote ... conference
what is the best free software i can use to make pixel art, mainly sprites and backdrops
aseprite maybe? there's another one but i forget
https://www.aseprite.org/ if you compile it by hand
its being streamed on youtube? why need tickets for that then maybe im being stupid and should watch the youtube video
i need one for macos
unless it is possible to compile it on macos
iv looked at it
thank you
@wild heraldit is on macports
so yes
but also, just doing it with cmake should work fine
do you know how to comple it on macos?
They're saying it should be possible
https://github.com/aseprite/aseprite/blob/main/INSTALL.md#macos-details ye, just read this document and follow the instructions
it is kind of a pain
but if you follow the instructions correctly, it should work
thank you, il try it
can someone explain tactile switches, like what they are, I can't find a good explanation on the internet
its just the way they register signals from you pushing it down i believe
hm ok
tbh i cant find a decent explanation either
or what other types of switches there are
isn't there like linear
no
bro they could literally just have made it an option that the creators can chose instead of making it a whole platform wide thing
Congrats @hollow holly 😁
yeah i can see it too
Thanks! @sick olive @sick olive
Dude, I forgot how dedicated the CaveStory fanbase is. https://github.com/nxengine/nxengine-evo
They've been working on this source port for years
2 questions
what does terry prachett have to do with gnu
and why does it show i have 55 mods when i have like 5
and all of them are performance related dont modify the vanilla game
if in a site has an entire book but i cant dowload it, can i use python to dowload a pdf from ir ?
gnus not unix and neither is terry pratchet
do you know good computer science servers ? to get help about computer science stuff
nvm right click and dowload i can get the book
good point
my piano isnt unix
wait maybe it is i dont know
its painful how slow wheat grows
someone help 😔
oh
lmao sorry
read the error messages 💀
i did but i was too excited i didn't notice
ok
bruh
i went out to get some kelp
and a drowned was sniping me with a trident
in case you wanna know how dire the situation is
im on 1 hunger
and 4 hearts
i am addicted to mc ngl
Oof
not good food but it'll help me not die
relatable 
Ez cow farm
overcrowed them to death
Hey @cedar imp!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
works
isnt it hard doing uni and an internship at the same time
or do people dont have classes at all during internships
depends on your iterest
internships are often during the summer, some schools have a co-op placement built in to their curriculum
im thinking of an internship in facebook
def add(x, y):
return x + y
def subtract(x, y):
return x - y
def multiply(x, y):
return x * y
def divide(x, y):
return x / y
def square(x):
return x * x
def sqr(x):
return x ** (1/2)
def cube(x):
return x ** 3
def cuberoot(x):
return x ** (1/3)
def pow(x, y):
return x ** float(input("Input power: "))
print("""Select operation
1. Add
2. Subtract
3. Multiply
4. Divide
5. Square
6. Square root
7. Cube
8. Cube root
9. Exponential""")
while True:
choice = input("ENTER CHOICE (1-9): ")
if choice in ('1', '2', '3', '4'):
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
if choice == '1' :
print(num1, "+", num2, "=", add(num1, num2))
if choice == '2' :
print(num1, "-", num2, "=", subtract(num1, num2))
if choice == '3' :
print(num1, "*", num2, "=", multiply(num1, num2))
if choice == '4' :
print(num1, "/", num2, "=", divide(num1, num2))
if choice in ("9"):
num1 = float(input("Enter your number: "))
if choice == ('9') :
print("The answer is", pow(num1, input))
if choice in ("5", "6", "7", "8"):
num1 = float(input("Enter your number: "))
if choice == '5' :
print(num1, "^", '2', "=", multiply(num1, num1))
if choice == '6':
print(num1, "^", "1/2", "=", sqr(num1))
if choice == '7' :
print(num1, "^", '3', "=", cube(num1))
if choice == '8' :
print(num1, "^", "(1/3)", "=", cuberoot(num1))
My first project/calculator, feel free to leave constructive criticism in python
im wondering if i can do an internship and uni at the same time
if there's like a break or low work in uni during the internship then its fine ig
that's something you should ask your uni advisor, and then the recruiter or whoever at the company when you start that process
are you in the USA? what year of uni are you in
(i'm tempted to say trick question bc if you're in "uni" you're not american but these days i've started to say "uni" too)
How to start learning R? Start studying R has beeing much more difficult than starting python, it's not just like just to do it, the IDE, RStudios , is confusing and idk what i can do/ what i should do
how come you wish to learn R? seems like python should do the trick for stats
I'm curious
I started with R just by doing things in repl and later figured out how to actually use the text editor in RStudio
John Xinas Unite!!! @sick olive @visual narwhal @sick olive @peak moth @dry granite
I see Rcommander in stat and it's curious and, i think, better at analysis and datscience
if u become a john xina +100 social credit
and is another language that differenciate me in the market
python is enough for the vast majority of stats
your time is probably better spent getting better at stats and data science than learning R
in python , you mean ?
if you already know python, sure
yes
test to see if beta1 beta0 etc are statistical significant
its a table that show SQ
and pvalue
ooo but i need to program or there's a library for that ?
I assume this is something pandas can do, or maybe you could figure it out with https://docs.python.org/3/library/statistics.html
correct, NumPy has library for that
also, like lakmatiol pointed out, there is an in built function
https://docs.python.org/3/library/statistics.html#statistics.linear_regression
it's also worth noting that python is de-facto tool for machine learning
and machine learning is nothing else but statistics on large data
if you want "not python" for statistics, I would suggest julia. It is a pretty damn nice language for this kinda stuff from what I hear, though it's not better than python yet.
on the other hand if you want to be employable do R and maybe VBA
yeah
i'll try to pick on non-obrigatory class that has VBA
Julia, what a language name
but it's better than R for analysis?
I am willing to bet that python, R and julia will be more than good enough for the vast majority of normal statistics
there is a point where a tool gets good enough that there is really no point of comparing them unless you have a very specific task
God I missed this place
i like the name of the chanell
Yeah it's pretty good
How have you been we haven't talked in a while
Like a long time
Didn't your name used to be the colour blue, but now it's white
I can't remember
I lost interest in all my hobbies and separated myself from public for a long time
Went to the hospital and got emitted into the mental ward, got diagnosed with schizoaffective bipolar disorder
I barely remember y'all but I have slight memories of conversations
good evening gamers
🎮 hullo
Hi guys, I want to know what is the "trusted technical interview"?
i added ragdolls to my gta san andreas modpack
rockstar didn't do it, points for me i guess
I decided to test out Arch to see if I could get my dGPU working properly
er... same problem as openSUSE and Ubuntu
in that my dGPU is performing the same or worse as my iGPU
in curl or python requests? because we're in ot and idk which
rip
any works. i am just curious
whichever is easier to get going i guess
which would be python then
with open("epic_video.mp4", "rb") as video:
requests.post("foo.bar", headers={"Content-Type": "video/*"}, data=video)
I think this would work, but I'm unsure
a bit different
This is the same stackoverflow post that confirms my solution as well
just minus the content-type header
it sends as files= not data=
https://stackoverflow.com/questions/6408904/send-request-to-curl-with-post-data-sourced-from-a-file curl
Wouldn't both end up working?
oh, there's one like that, you're right
it doesn't matter what distro really. maybe check /etc/X11/xorg.conf.d/
Empty
i will give u a config that makes it work. you ready?
Hello yes who ping
Select the song and make sure shuffle is off. I'm assuming you have premium where you can choose your songs
dont use shuffle
Linus trying out Linux in a nutshell
lmfao
didn't he use windows for one of his servers
I mean, PC enthusiast doesn't automatically make you familiar with linux
He's a gamer too, which windows is objectively the best OS for
Why would he be a linux fan
The other fat guy he works with looks like a linux fan
he doesn't have any reason to
LMAO
he is, isn't he
No offense
i have a question, i wanna make games in unity, i understand how oop works is python, wound that be enough knowlegde to try learning unity or should i learn pygame first?
Unity works with python?
no
im going to learn c#
im just wondering if i would have enough knowlegde to do it tho
Sure
C# is an OOP language as well
And its not like you can't read a tutorial or two about unity before jumping in
Once you've learnt one languages, other language get easier to a certain extent
i get easier
hm
aaaaaa its like 17 degrees celcius
im positively shivering
Been changing all my socials to match my discord name. I made this name when my grandfather and I set up his ps4(rip). I am debating to change it, should I or should I keep it?
hopeless prism
rubbery revenge
such a mood
https://youtu.be/QyJZzq0v7Z4 hmm interesting talk
Richard is a member of the Elm core team, the author of Elm in Action from Manning Publications, and the instructor for the Intro to Elm and Advanced Elm courses on Frontend Masters. He's been writing Elm since 2014, and is the maintainer of several open-source Elm packages including elm-test and elm-css packages.
if my mail service only has 50gb shared between 50 people, would you still recommend using IMAP or should i switch to POP3 so i can save what little data i have? 😄
rescript seems interesting. hemlock introduced me to it iirc
looks cleannnnn
https://reasonml.github.io/ looks kind of like this
Reason lets you write simple, fast and quality type safe code while leveraging both the JavaScript & OCaml ecosystems.
ah wait
reason is rescript
they just changed names LMAO
i wonder why these two exist. still kinda confused
reason is rescript
the link i sent is still reason?
but it has a different repo
BuckleScript & Reason are now called ReScript, therefore the ReasonReact bindings will now be known as ReScript / React and need to be moved to a different npm package.
damn. so theyre still the same but rescript is just bucklescript + reason
yep he is
also his name is anthony lol
they do be preparing for yt rewind 2021
What's rewind
because of dislike removal, yes probably
youtube rewind
What's that
every year they do it
the yearly video that recaps the events on youtube
they've been doing it since 2010 or something
ahh, got it
yes yt rewinds always get like millions of dislikes
rewind 2018 became the most disliked video of all time
the early ones were liked
but the later ones were just dunked on
yes
they didnt do 2020 due to covid
a shame they couldnt celeb their 10th anniversary
uwu
nou
i need help
my spawn point has 2 drowned who snipe me every time i spawn
so i repeatedly get spawn killed
wat scam dis
lmfao
awe
@dusty aspen what's up dawn
@dusty aspen no ansewr??!@??!
hey aboo
not me trying to make a compiler
Hi :D
nice i'm in school
I was typing 
damn
my school required you to own a mac
damn
my school did, but they allow us to change the DNS number, so that just unblocks everything
My school gave us these terrible $50 chromebooks
We can't bring our own computers since no one knows the wifi password
They don't even make it your school username/passwords for wifi or anything
our wifi password is our school email and school password
dan
the chromebooks are so slowwww
that sounds so nice
also im a bit suprised by 2 things
- ur allowed devices in school?
- ur given internet?
yeah
wow.
wait you're not allowed those things?
us freshman's are allowed cool stuff
If you don't mind saying, where do you live? (country/state/whatever)
they middle schoolers aren't
india is all i can give ya
Rust has started freaking me too early, those colons and dots!!!! 😭
I was asking Bacon
awkward moment
im indian not in india rn tho
beauty
BUT LIKE TF YOU MEAN .read_line????
oh, everyone is learning rust now
WHY .
i'm just not motivated enough
iirc colons are for instance methods and dots are for associated functions, but correct me if I'm wrong
9th, india
i'ma stick with python
reverse
👀 how can you bear them!
oh. so Vec::new() is an associated function? I think I have this all confused
nice
oh wait of course it is
:p
I'm an idiot
How about any Haskell pros
How do I properly spread the 2nd if over multiple lines? hs helper f n = do if n == 1 then f else ( if (mod n f == 0) then (helper f (div n f)) else (helper (f + 1) n) ) main = print(helper 2 600851475143)
that's rude @fathom yew
Keep getting parse error (possibly incorrect indentation or mismatched brackets)
perhaps
was a joke
what awas a joke
get rid of the do
what happended
but it works fine if I do else (if (mod n f == 0) then (helper f (div n f)) else (helper (f + 1) n))
♿ js has the worst snytax
the ✅ reaction
oh
wdym JS syntax is fine
yeah its not that bad
gib me some motivation on learning pls
now the language itself, thats a different question
i really cant stand with it
learning what
ruwust
which parts?
Woah, how did that work? 
well, what do you like to program
tuis
@sick olive do notation isn't just multiline
haskell has multiline expressions by default
do notation is sugar for the monadic bind (>>=) and bind-drop (>>) operators
our very own Xith made this in Rust. I have some other cool ones, but I cannot find them https://github.com/Xithrius/twitch-tui
for example this
main = do
i <- getLine
putStrLn i
is sugar for this
main =
getLine >>= \i -> putStrLn i
basically just try both until one works
ooo
good good
👆 tbf i never really give it a chance
tui :D
what "both"?
it's really not difficult
- is it a method (operates on a value of the type) or an associated function (just a normal function that is connected to the type)?
- method ->
. - associated function ->
::
- method ->
.bm resouwurces
oops i pinged soworry
sO SLEEP Y I CAN'T Vene type [roperly
no you didn't
phew
also use :: when it's a member of a namespace or an enum variant
.bm
colons and dot
idk what \ or -> or <- do
I've just been using = as assignment
subtract 5
thankssssss
Circular shifting?
patpat read "learn you a haskell for great good", haskell is not the type of language you can learn by just playing around with at all
ig I shouldn't go with rust too early... I should strengthen my Python...
yeah strengthen your python first
i just do not see a constant relationship here
between A and B that happens every row
first i tried converting them to base 10
what does that give
in base 10?
ys show in base 10
111101 = 61, 111000 = 56
001101 = 13, 11001100 = 204
011001 = 25, 110000 = 48
i must be losing my mind if there's a clear pattern here
i sure don't see it
haskell weird
plug it into oeis
it's a shot in the dark but you never know
no u
what's oeis?
I NEED TO MAKE MY OWN AST METHOD :(
online encyclopedia (of) integer sequences
time to yoink it from online
whu..??
wait so what do you do here
my brain no worky
w oesis
idk
wdym "method"
i meant data type sry
why
Was there supposed to be a pattern there?
i'll need to learn a language to make a language
apparently so but maybe they messed it up
Wait, can haskell even handle an int as large as 600851475143
data AST
= Ident String
| IntLiteral Integer
| FltLiteral Double
| StrLiteral String
| Plus AST AST
| Minus AST AST
| Times AST AST
| Divide AST AST
| FunCall AST [AST]
```for example
ezpz ast
in rust,
type AST_B = Box<AST>;
enum AST {
Ident(String),
IntLit(i64),
FltLit(f64),
StrLit(String),
Plus(AST_B, AST_B),
Minus(AST_B, AST_B),
Times(AST_B, AST_B),
Divide(AST_B, AST_B),
FunCall(AST_B, Vec<AST>),
}
ezpz ast
it seems cool
uwu
this haskell?
haskull
yes
enums are in many languages + you don't necessarily have to use it
the shunting yard algorithm is very good but very narrow in scope, it can only really be easily applied to grammars consisting of:
- literals
- infix operators w/ defined precedence and associativity rules
- function calls (ml-style)
- parens (for grouping)
Should there be bail in the justice system?
i used shunting yard myself in https://github.com/nekodjin/HasKalc
should people interrupt ongoing conversations in off topic with random political questions that, if addressed, will just result in everyone getting mad?
bail seems pretty legit
alright rust learning montage moment
Is this correct rust let n: i64 = 600851475143;
.bm
no one getting mad
yes
I don't need a L in the literal or something 
let n = 600851475143i64;
.bm
is 64 bit default?
i think i32
yeah i32
but the suffix there makes it i64 literal
if the literal is bigger, it'll switch to i64
that number doesn't fit in 32 bits
lol didn't even notice the i64
maybe not an amazing idea to put it there
it can compute any computable function
i32 is default, the type can be inferred from things like function signatures but if thats not enough then the suffix for each type is just the type itself, for example if i want 8 as 16 bit signed integers i can just say 8i16 or, even better, 8_i16 the _ is just like in python it is ignored but you can put it there to make number more legible like for example 1_000_000
and like phyceral said if the number is too big it defaults to the next largest signed integral type
When I removes the i64 it warned me about it so I put it back = note: the literal `600851475143` does not fit into the type `i32` whose range is `-2147483648..=2147483647
it warn you because it exceeded the size for i32
isn't rust the language that screams at you for have un-used variables
or is that golang
so you may have been expecting it to default to i32 but then it didn't
golang is specifically for networking right?
The way you guys were talking I was thinking it would default to 64 without a warning 
it's mainly used for web-dev @dusty quarry
it's got a good system of managing endpoints and stuff
me likey
what's good?
unused vars are warnings in rust (which can be turned off with the #[allow(unused_variables)] attribute or something like that), while in golang they are compiler errors (if you have them it will simply refuse to compile your code) that you cannot turn off
yeah! i remember now
Yeah I'd just do let n: i64 = ...; personally. Much clearer at a glance.
package main
import (
"fmt"
"log"
"net/http"
)
func homePage(w http.ResponseWriter, r *http.Request){
fmt.Fprintf(w, "Welcome to the HomePage!")
fmt.Println("Endpoint Hit: homePage")
}
func handleRequests() {
http.HandleFunc("/", homePage)
log.Fatal(http.ListenAndServe(":10000", nil))
}
func main() {
handleRequests()
}
is there ever a reason to have unused vars in prod
well usually it defaults to i32, the warning is to tell you in case you were expecting it to default to i32 but it didn't default to that so that you don't makes incorrect assumptions about the type of it
i like this a lot
oi
oi
golang is a general purpose language but that's it's most common usecase yes
no but. prod is not the Only Situation that exists, and in fact it is by far the minority of situation in which developer spend their time
unused vars should be a warning, nothing more and nothing less
yeah ig warnings are good enough
if you want it to be an error simply put #![deny(unused_variables)] at the uppermost module
the fact that i can't test golang code if it has unused vars (because surprise surprise i want to test things before i am completely done with them, shocker) i literally just can't and then i gotta do something stupid like log it for no reason just so it compiles
better yet, put it in profile.release in cargo.toml, so it is an warning in debug mode and an error in release mode
didn't google make golang
tfw not snake_case variables are a compiler warning
lmfao
that's great
that's good tho..?
what's wrong with encouraging a standard style
makes everything more readable for everyone
and if it's really that much of a problem it literally takes one line of code to turn off
?
camelCase best
That is annoying. Go really doesn't like unused stuff n declared but not used imported and not used: "fmt" 
camelCase is less readable by far
Why do babies cry?
Attention 
to prevent parents from making another one
yeah, though for some reason dead code is only a warning not a error
it's cool though
can u stop interrupting conversationwith random stuff
thisis random channel
***ep it clean and respect ongoing conversations. See ***
***respect ongoing conversations. See ***
why though
respect
IDK IT'S SEXY
idk
How many stars are in the sky?
billions
More then 3
more than you will ever count
Do you need brackets { } around single expressions like in an if in Go and Rust?
yes in Rust, idk about go
yeah, but that don't mean it's good
hm.. i guess so
y yer so lazy for the brackets?
I wouldn't go so far as to call it laziness, I think it'd be clearer without for single line ones
sorta like how match can have one line stuff
Go seems to require them syntax error: unexpected f, expecting {
wdym
But what
you can't do math on diff int types? n % f (mismatched types int64 and int
Nothing like as in go?
use as type to cast between primitives
Like in Java/C#/C/C++/JS you can do if (foo) bar; instead of ```
if (foo) {
bar;
}
rust never ever ever ever ever does implicit type conversions, which is sometimes annoying but probably ultimately a good thing
no u always have to use bracket
u can do that..?
yah
you can just not
I mean it's really easy to do it explicitly (with (numeric) primitives, at least)
that was meant to be a reply to this
you could. your code wouldn't compile, but you could.
it does compile
I tried it and do it all of the time
in what language
not in rust
:laughingat:
i think you didn't read the question
Oh, I was talking Go but int64(f) works
huh
I don't use brackets in pyton
use as i64
https://www.youtube.com/watch?v=qvNyo1-AK6o imagine Tedx getting scammed
Do you ever wonder why some people seem to get lucky and make it look so easy to succeed, while so many others (maybe even you) struggle and fail to get what they want? You see these individuals around you who seem to have it all, and you ask yourself, why can't you? Dan Lok wants you to know that you can have everything you've ever wanted and t...
You can tho.
the question was about rust.
also those arente real types, there is no int type all the int types have sized associated in the name, unless you're using bigint crate but obviously
go back to sleep.
java does widening conversions for you, rust doesn't
so you use brackets in python? Go back to sleep
go cry somewhere
Yes I use them for dicts and sets
it's so funny to me that you have to call them widening conversion in java
in C# it's just called upcasting
I know that's not what you mean but I feel like being pedantic
xD
they refer to the same thing ¯_(ツ)_/¯
you don't "have to" call them anything
well calling it upcasting in java would be incorrect
The right pinky has too much keyboard responsibility 
since the primitive types are completely distinct from the rest of the type system, basically
i use my ring finger for semicolon lol
I type with 2 index fingers
cringe
hmmm i use just two fingers per hand
jk. that is so inefficient
i use 3 in one and 2 in the other
Learning to touch type is a super handy skill, whether you guys are joking or not 
But I still get numbers mixed up 
dont lie to me you 100+ wpm kid
Stephen Hawkin: Peasants
being used to QWERTY pretty much
i use my toes to type and i get 200wpm
I use my ass to type and get 666 wpm
Lies
~ @ocean walrus
hm
||LIES||
~ @ocean walrus
i really like aboo when he says Lies
Lies
damn. im fanboing this persona
I like it whenever I say anything
he 14 wtf
Lmao
youre thinking of something else >:(
searsX ?
I mean. How.
same



