#ot2-the-original-pubsta
652 messages Β· Page 91 of 1
omg perl
dude must have been ol school linux user
But this is the only script that was ever shared around, and this extracts the tgx file into a Data folder
Kohan mod statistics collector written in Perl, version 0.1.3
that's why I would like more than one set of ini+tgx (even two would be good, just so I have something to compare) π
Is it cool if I link the git I've set up for this?
jesus christ that is some god awful perl
It has tgx files and ini files in there.
ye, you can link to gh repos
ye. you could even just send me the files - as long as I know which files make a set, I can take a look π
Probably simpler to send them over discord yeah. Alrighty, files incoming
I'd like to see the GH for cursiousity
That too
but the last line
"should I invite alessandro?"
He didn't capitalize his name...
is a name a proper noun
yes...
What is in a name?
Characters.
idk what a proper noun is tbh
@sinful sun really?
im not english, why should i
non-native english speaker?
I'm raiding at the moment, will take a look later π
sorry
lmao no worries
You're English is really good, I couldn't tell
A proper noun would be your name, like Bill
as opposed to just him
Thank you for the help and interest in the problem, I really appreciate that.
@tall sparrow it is cool that the community is still passionate for such an old game
basically a name, not only person's name
the Moon vs a moon
we're in TBC now
Tempest Keep, the Eye
It's a great game. No other RTS like it, imo. It's old and a bit of a pain to get working for windows 10, but sometimes games just don't get proper sequels, and you're forced to stick with the old game if you want the same experience.
yes? minimap in the corner? or map under M?
minimap in corner
I swear when I tried WoW classic it wasn't there...
+MC was first raid of vanilla
we haven't been in MC in a looong time π
playing minecraft even in wow, smh my head π
wait, does my profile still say minecraft? XD
MC π
Zul Gurub was phase 3
or 2
Phase 1 - Onyxia and Molten Core - Released August 26th, 2019
Phase 2 - Release Date: November 12th, 2019 - Honor System and World Bosses
Phase 3 - Release Date: February 12th - Blackwing Lair
Phase 4 - Release Date April 2020 - Zul'Gurub and Arathi Basin
Phase 5 - Release Date - Ahn'Qiraj
Phase 6 - Release Date - Naxxramas
that's from some guide on Classic Wowhead
we're now on 2nd phase of TBC
Did WoW classic move into TBC?
yes
Aw man, I kinda thought it'd be like eternal vanilla
oh, there was split!
and if you wanted your character to be in both, you had to pay
and now Blizzard wants to release vanilla again, but this time with some changes. Season of Mastery they call it
Ah, ok, so you can still do pure vanilla if you want to
So it'll be kinda like those seasons they have in Diablo 3 nowadays
idk about the state of classic-classic servers, I think most people moved to TBC and continued progressing
@jovial island maybe it's an assignment and they're specifically being asked to use certain functions, you don't know. in general I try to help with what they know or what they're trying to do and then show them alternative preferred ways
there's nothing wrong with learning how to use the round function
Is that even guaranteed to convert to string with that many digits?
floats don't even have digits, it doesn't make sense.
it may be that they should look up documentation for string formatting floats
yeah, that's my main beef with round. it doesn't make sense
but that's unlikely to happen.
and you basically have to show that, there's no figuring that out
I WILL AGREE the timing sucked
people shouldn't be allowed to use floats while learning xD
In [4]: round(2.50)
Out[4]: 2
In [5]: round(2.51)
Out[5]: 3
who has done this >:(
nearest even number go brrr
they should teach decimal if they're gonna use ... decimals
petition to move the float type to some obscure nested module
and remove the literals
oh i have no idea of the context. i just don't like the round function
context is I showed how to do it with f-string when they were dealing with an error in their use of round
so they didn't solve the error, jumping to my example
with some insults thrown in too i see
there was plenty of time to read what error they got in their attempt before jumping in
that's all i ask
they passed a list to their round function, had you read more closely you would have seen that and guided them to see why they were getting that error
or, what i would have done
so uhm are we mad at each other now or do we simply both agree that went wrong?
please don't teach people to misuse float, though.
what went wrong?
misuse float
huh?
...why?
floats are great
how else are you going to process decimals
grr
Or do you mean replace it with decimal.Decimal?
tbh, i would be totally happy with decimal.Decimal being the default
Yeah I'd be fine with that, but not get rid of the literal
well they don't bother me for my own use. in that way I don't mind.
but beginners constantly expect them to behave as decimal does
I think they've been in school too much.
i mean, its not an unreasonable expectation
also considering that python ints aren't limited like in other langs
just make the literals create decimals instead of floats
mhm
sup @lucid girder could you share the playlist you listen to while you are streaming on Twitch?
which one?
the one you were listening to yesterday
The last stream I did was a 10 hour stream, you're going to have to be more specific on the song you want.
hmm, just gimme any1 of them, don't remember the name
cool thanks
is it just me who has this Discord bug on Linux
it never loads
and it's only a problem on Linux

I'm on windows web and when I had that I waited for like 1 to 2 mins and it loaded
They never load for me
theres discord desktop on linux?
like ever
Well of course
wew discord is nicer than I expected
it's just terrible quality because there's not a single Discord Linux desktop dev
not a single one
add braces
hmmm not for me
make userdefined infix operators
like, idk,
>>> infix ~(x, y) = abs(x - y)
>>> 2 ~ 3
1
F
hmph you've already done better lambdas
meow
meow
good nyaaight
uwu
scroll up? \π€
it's the section right above that
Identifier equality
idk, sounds fun Β―_(γ)_/Β―
plus it's something that I've wished Python has had for a while
no it wouldn't
huh
Isn't consistency a large part of the Zen of Python
uh
I'd think the opposite
say you import a module
all the methods are camelCase
your code is primarily snake_case, as per standard
you either live with the inconsistency or you go against standard with camelCase
but then you end up importing modules that are snake_case anyways
C modules.
things like cv2
they are in camelCase
this allows programmers to be more in charge of the consistency in their program
and I argue it complicates hardly anything
It allows programmers to mostly use their own preferred spelling style, be it humpStyle or snake_style, and libraries written by different programmers cannot use incompatible conventions. A Nim-aware editor or IDE can show the identifiers as preferred. Another advantage is that it frees the programmer from remembering the exact spelling of an identifier. The exception with respect to the first letter allows common code like var foo: Foo to be parsed unambiguously.
i think you can do it in pure python lol
just hook into variable assignments and everytime there's a snake_case insert, insert snakeCase too
and so on
ye
I wish you the best of luck
keep me apprised \π©
I shall now commence sleep protocols
Man, I love windows
I managed to, due to user error, screw up my efi partition and boot information when I cloned my SSD
Took only a couple of minutes to rebuild a new one from a recovery disk
I'd have been sitting for hours trying to fix an issue with GRUB or something
π€£
make type hints required
nah thats a bad idea linters already do that
how about
>>> let x be 1
>>> print(x)
1
or macros
>>> unless = macro quote(expr), quote(body), quote(alternative): unquote(body) if not unquote(expr) else unquote(alternative)
>>> unless(1 != 1, print("all good"), print("math broke"))
all good
>>>
oh yeah or just make unless built-in and don't bother about macros lol
unless 1 != 1:
print("all good")
else:
print("math broke")
niceee
Hey @vague shadow, can you send a link to the server that has kirby gunner?
It's from DMD π
Why does a go server have such cute emojis and stickers
they have to lure them in somehow π
True lmao
because gophews good wustaceans bad
(also apparently gophers are cuter than snakes)
no one likes ferris because they spiky crabby
no...... ah fuck im loving this qt crab
and then, when your guard is down, it turns out...
to kill me? sad
Elementor is not opening in 000webhost , anybody knows how to fix it ?
@jovial island yeah but they'll get that using pass too, that's caused by the if-statement, not the continue
Wdym?
the print is in the else, so if the condition is satisfied, the printing is skipped
!e
for i in range(10):
if i == 5:
continue
else:
print(i)
@jovial island :white_check_mark: Your eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 6
007 | 7
008 | 8
009 | 9
!e
for i in range(10):
if i == 5:
pass
else:
print(i)
@jovial island :white_check_mark: Your eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 6
007 | 7
008 | 8
009 | 9
Seems correct
And ur right, it's due to how the if statements are implemented in this case
so it doesn't demonstrate continue x) it's just a no-op
Exactly π
Me wants
π
tar -zxf bomb.tar
tar --help 
tar x
tar bomba
shouldn't have mattered
mhm, what are you computing
the data is pretty big however, 373 columns and 127k rows
csv file?
yes
shift + enter on the cell again and the printed result is gone
ok it printed
takes a couple seconds tho
yeah i believe it
The kernel appears to have died. It will restart automatically.
i think the biggest csv i deal with is several million
my computer sucks as well, i have a 2018 macbook air, took me an hour to open the csv file alone
building a pc this black friday
opening with python? or just macos
macos
whatever you do don't open it with excel
nop numbers
why not lol my other comp took 15 secs to open it w excel
its windows tho
and what are those machine's specs
dont know exactly its my dad some lenovo
company's laptop so i believe it would be faster
what do u use? @hollow heart You said u work with csv files as wlel
i'm testing loading this 10 million row csv in vs code right now. let's see
12 million*
[12670108 rows x 10 columns]
0:00:10.595457
bruh
the csv is 1.01GB
prebuilt
so anyway, the reason i said don't open in excel is because at that size when you try to filter and sort it will lag and crash if the file is big enough
@hollow heart
mhm
String index out of range? There's literally 373 columns tho
show your data?
there's 173k rows
are you trying to just get the column names? row names?
filtering out rows i dont want
thats not how you filter rows
and what's the criteria
how do you want to filter
filtering based on labels.. is so much nicer than based on integer positions
if column[-16] has 220 then keeo
what's the name of that column
gtcbsa
? whats iloc?
index based selection
but values 220 only exist in column[-16]? whats wrong w my code?
it'd be easier if you chould show us a slice of your df
vc?
df.head()
whats .head()?
Shows the top few rows of a dataframe object
I think the columns get truncated too?
Like the first 3 and the last 2 or something like that
not usually
vc so i can show data?
?
what on earth are you storing anyway
print(df.columns) and print(df.index)
there
Alrighty, and you want to filter it based on the value of the 16th to last column?
yes
What is the column name
df[df.loc["gtcbsa"] == "220"] try this now that you have a label
I'll recommend mariosis' solution: df[df.iloc["gtcbsa"] == "220"]
i really dont wanna use iloc bc they havent taught us that yet but lemme try
use .loc with labels
.iloc is for indexes
and slices
also loc/iloc are the pandas bread and butter
not being taught them is no excuse for not using them
wait your .loc is in the wrong spot
they;ll just give me a zero lol
yk how schools are
ight just ignore ill figure it out
thanks
df.loc[df["gtcbsa"] == "220"]
or
df.loc[df["gtcbsa"] == 220] if it's numbers
Mina saving the pandas
my real title is pandas helper not python helper
worked
but still cant use loc so
that first attempt looked like some funky list comp
actually you know
sucks but u gotta do it that way
df[df["gtcbsa"] == "220"]
df[df["gtcbsa"] == 200]
there, it works without loc too 
they can't say you're wrong then
lolol ok
TypeError: invalid type comparison
do only 1 or the other, not both
makes sense, must be numbers in that column
print(df.dtypes)
yeah so they're all ints or floats
gtcbsa int64
which is why "200"doesn't work
hm i don't get a type comparison error though. just an empty df
i have no idea what that is lol
list comprehension
specifically a list though? not a dataframe?
filtered = df[df["gtcbsa"] == 200]
just do that
lol ok
that's a dataframe though
thanks
this shows [769 rows x 388 columns] but when i ctrl f on excel it shows 800 something
just ignore ill figure it out my bad
why would you CTRL+F? you should filter that specific column only
like you have had 200 in other cells, excel would find those
wanted to double check, jupyter nb doesnt even show that specific column and the vlaues in there bc of how big it is, so stupid
lemme do this in vim so i can actually look at the entire data and make sure bc jupyter nb is stupid
you can select which columns appear
print(filtered[['column1', 'column3', 'gtcbsa']])
list_x = df[df["okklmo"] == 220 or df["okklmo"] == 740 or df["okklmo"] == 800]
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pandas/core/generic.py", line 1537, in __nonzero__
raise ValueError(
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
no or and and in pandas boolean filtering.. doesn't work the way you'd think
use & and |
ok
list_x = df[df["okklmo"] == 220 | df["okklmo"] == 740 | df["okklmo"] == 800]
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pandas/core/generic.py", line 1537, in nonzero
raise ValueError(
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
parenthesis around each condition
im stupid imma stop bugging u now lol
noo problem these are all issues i faced when trying to learn it..
figured lol im stupid
list_x = df[(df["okklmo"] == 220) | (df["okklmo"] == 740) | (df["okklmo"] == 800)]
idk if there's a better way to do that tho
print(filter[['eemmMM', 'WSSSHF', 'okkk223']])
TypeError: 'type' object is not subscriptable
when i said filtered, it said "No module filtered found, did u mean filter?"
this?
"No module filtered found, did u mean filter?"
no print
print(filtered[['column1', 'column3', 'gtcbsa']])
what exactly is classified as a data fraame?
if print(type(filtered)) does not give you: <class 'pandas.core.frame.DataFrame'>
then you did not make filtered a dataframe
add this to your code
system("");
no help
why do i get -1invalidargument
they sent me here
no don't ask in python-general
this is annoying me
Send a screenshot of your error
kk
@old vale consider joining the server above
please help
i wiil
but please help
Send us your whole code
i was told to put %d before the system method and it returned this
kk
#include <iostream>
#include <json/json.h>
#include <json/jsoncpp.cpp>
#include <fstream>
#include <stdlib.h>
#include <direct.h>
#include <errno.h>
using namespace std;
int main()
{
//read json
Json::Value craftbooster_data;
ifstream craftbooster_file("./craftbooster.json" , ifstream::binary);
craftbooster_file >> craftbooster_data;
cout<<craftbooster_data["key"]<<"\n";
//copy files to the path in json
if(mkdir("E:\\tesst") == -1){
cerr << " Error : " << strerror(errno) << endl;
}
else{
cout<<"done";
}
printf("%d", system("cmd batchcode.bat"));
printf("%s", strerror(errno));
getchar();
return 0;
}
Nice, now wait until someone who knows c++ helps you out π
srsly
bro this aint funny
What?
i mean...you decided to ask your cpp question in python server idk what you expected
lol
bro
there is no other way to get help
my problem only exists on my pc
none other
zero
there are cpp servers
Nobody here is forced to help someone, if they want, they will. You're also in a Python server asking for C++ help, now I got you to move into a off topic channel, you posted your issue and your code, now wait patiently until someone that willingly wants to help you out. If no one does here, ask in C++ server.
ive asked in 10+ servers no one knows this error
so i think you can paint a picture of my situation
"this error" what error? you haven't said
even this "help" server
The error looks like you're trying to create/do something a file which already exists
yes i hv
Does anything in the code do that (create a file (or some other fs operation))?
Error: File exists -1 invalid argument
that seems quite descriptive
tbh that error looks like you're using some knockoff library to create a file that already exists
I googled it and I can't find anything about it, could be a custom raise error?
Whats craftbooster_file?
https://developer.arm.com/documentation/dui0496/c/elf-image-converter-errors-and-warnings/list-of-the-fromelf-error-and-warning-messages?lang=en
even this doesn't tell me what the error means
how can i export file and name is updated.csv?
what's the current name of the dataframe you want to save?
!d pandas.DataFrame.to_csv
DataFrame.to_csv(path_or_buf=None, sep=',', na_rep='', float_format=None, columns=None, header=True, index=True, index_label=None, mode='w', encoding=None, compression='infer', ...)```
Write object to a comma-separated values (csv) file.
current namr of the csv file?
oh filtered
filtered.to_csv('updated.csv')
or filtered.to_csv('updated.csv', index=False) if you don't want the index to be saved in the csv
if you don't want all 300 columns you can also select which columns you want saved
yes i alr filtered out columns
if i were to create a bar graph with 6 different values, and each value has values from an entire column, how would i go on w that?
so i have no experience with plotting/graphing, try out the stuff here https://pandas.pydata.org/docs/user_guide/visualization.html
the previous thing didnt work tbh
can i dm w pics?
@hollow heart
no pls, just send here you can also open a help channel if you like #βο½how-to-get-help
haha ill try figuring out if i need help ill let ya know
are you saying that all that stuff we did earlier didn't work?
filtering rows didnt work, the updated file has rows that contain 0 and some other numbers under that column
nvm i solved it
yp
its still there
nop unfortunately
yep yep
the one thats affecting me is the -1invalid error
see all your code that does outputs:
if(mkdir("E:\\tesst") == -1){
cerr << " Error : " << strerror(errno) << endl;
}
else{
cout<<"done";
}
printf("%d", system("cmd batchcode.bat"));
printf("%s", strerror(errno));
-1 comes from the batch call
and the text comes from the second print
you probably shouldn't use cmd here, you want to just execute the .bat file - so put only the file name to execute
https://stackoverflow.com/questions/1478171/how-can-we-use-a-batch-file-in-c
@old vale
i did that and same thing
its a pc problem
so dont mind aabout it
.
.
,
`
'
...
"
'
β
:
LOL sorry guys :x
How dare you >:(
damn
raisin bran
let them eat lemons
French sounds elegant even in english
@brisk edge but the gevent sleeps though, that's still unexplained black magic
it probably is spawning its own userspace threads inside the worker processes
did you try with gevent and with --threads?
oh it's... oh it's being naughty
from time import sleep
@app.route("/")
def test():
print(sleep.__module__)
gevent.hub
gevent.hub
gevent.hub
gevent.hub
?? xD
wait even with --threads it's running 4 in parallel. lol
monkey patching
gevent bad
it's probably suspending the userspace thread instead of the kernel thread which time.sleep suspends
since it's using its own impl of sleep
uhh. right so it keeps python stacks ?
as in call stack?
gears grinding
is gevent using a different bytecode loop?
that's gotta be it right? that's how it's able to suspend the thread
we could just check it's codebase π
src/gevent/hub.py line 129
def sleep(seconds=0, ref=True):```
ah. ye that's a good place to start
the monkey patch is at https://github.com/gevent/gevent/blob/master/src/gevent/time.py (i think)
why is it so hard to google what gevent does
yeah okay it monkey patches the world I get it
but how does it stop
about half a dozen times now I've been reading text that gets SO CLOSE to telling me how the sausage is made and then just doesn't
wdym how does it stop?
it suspends the threads
suspend - run something else - resume
normally you can do that with recursion, but I doubt that's it.
instead it suspends the whole thing, and starts fresh with another
if it is indeed replacing the bytecode loop it could do it that way. but idk if it's doing that
the logic's in the sleep function i llinked above
do you mean that explains it or just that this is the sleep function?
I read it and moved on, not seeing it
it's just comunicating with the actual machinery, wherever that is, from what I can tell
but does not itself do anything
it calls hub.wait, and if you see what hub.wait does
digging deep it just seems to give control to the event loop's timer method
so lost in this rabbit hole
haha. yea the flow goes back and forth between hub and other files
I give up
A PyGreenlet is a range of C stack addresses that must be
saved and restored in such a way that the full range of the
stack contains valid data when we switch to it.
so a manually maintained call stack huh?
crazy people -_-
ehβ¦ if it works Β―\_(γ)_/Β―
@languid osprey I'm taking a look at the parser and language implementation links you sent me a while back and wow are they going over my head
I really do have zero CS knowledge or experience
Ooh lang dev
thank you for the links though, they're quite a good read even if my comprehension is near 0 /hj
If you want a guide to it from rock bottom to a fully functional language, I'd advise you read Crafting Interpreters by Robert Nystrom
that's literally the link aboo sent me
I've been working through it recently, and it's a really wonderful book
I'm not surprised haha, it's great
SET-REGISTER 81000
STORE &product
# Initalize the loop.
ADD 1
STORE &loop_until
SET-REGISTER 1
STORE &factor
# Calculate the reminder of product / factor.
# Jump if the reminder is zero.
LOAD &product
LOAD-B &factor
MODULO
GOTO-IF-NOT 17
# Add one to factor; keep looping until factor > product.
LOAD &factor
ADD 1
STORE &factor
LOAD-B &loop_until
EQUAL
GOTO-IF-NOT 6
# If factor > product, jump the above if's body and exit.
GOTO 24
# The reminder of product / factor was zero.
LOAD &product
LOAD-B &factor
DIVIDE
FLOOR
PRINT &factor
PRINT
GOTO 10
EXIT
This was my latest forray into implementing languages, let's just say this is really basic :p
That's the only "good" read on lang dev
That's cool! Seems quite good to me.
the VM is rather ... uh ... slow lol
I mean, there's no parser involved here, just lexical analysis with a basic VM bolted on
oh yea I almost forgot, I implemented a super sketchy transcompiler from this assembly-like language to Python. Basically any kind of conditionals break it :p
SET-REGISTER 0
STORE &i
LOAD &i
ADD 1
PRINT
STORE &i
EQUAL 900
GOTO-IF-NOT 2
register_a = 0
register_b = 0
db = {}
def chunk_2():
global register_a, register_b
register_a = db['i']
register_a += 1
print(register_a)
db['i'] = register_a
register_a = (register_a == 900)
if not register_a:
chunk_2()
register_a = 0
db['i'] = register_a
chunk_2()
I should probably learn some proper language techniques at this point before I learn how to craft language implementations in the totally wrong way :)
This is some cool stuff regardless
Nice job!
There's quite a few good reads related to lang dev
You'll get it eventually :P
I switched projects back to my original recursive-descent attempt
I was trying to write a calculator because that's like classic CS homework
Rewriting everything except for the tokenizer which is actually usable
Lmao
169 lines of a poorly functional recursive-descent parser: https://paste.pythondiscord.com/egabidolaj.py
Nice :D
I'm not using it, it's garbage
No parser is worth using until after a few rewrites :P
9: (
"1 + (2 + 3 + (4 + 5))",
[
Token(kind="Number", value=1, pos=(0, 1)),
Token(kind="Operator", value="+", pos=(2, 3)),
Token(kind="Parenthesis", value="(", pos=(4, 5)),
Token(kind="Number", value=2, pos=(5, 6)),
Token(kind="Operator", value="+", pos=(7, 8)),
Token(kind="Number", value=3, pos=(9, 10)),
Token(kind="Operator", value="+", pos=(11, 12)),
Token(kind="Parenthesis", value="(", pos=(13, 14)),
Token(kind="Number", value=4, pos=(14, 15)),
Token(kind="Operator", value="+", pos=(16, 17)),
Token(kind="Number", value=5, pos=(18, 19)),
Token(kind="Parenthesis", value=")", pos=(19, 20)),
Token(kind="Parenthesis", value=")", pos=(20, 21)),
],
Expression(
body=Operation(
1,
"+",
ParenthesizedExpression(
body=Operation(
2, "+", ParenthesizedExpression(body=Operation(4, "+", 5))
)
),
)
),
),
it fails even this simple test case
tokenization is fine as expected but the AST isn't quite right
where did the 3 go π
wait what
lol
Improper failing π
11: (
"1 + (2 + 3) + 4",
[
Token(kind="Number", value=1, pos=(0, 1)),
Token(kind="Operator", value="+", pos=(2, 3)),
Token(kind="Parenthesis", value="(", pos=(4, 5)),
Token(kind="Number", value=2, pos=(5, 6)),
Token(kind="Operator", value="+", pos=(7, 8)),
Token(kind="Number", value=3, pos=(9, 10)),
Token(kind="Parenthesis", value=")", pos=(10, 11)),
Token(kind="Operator", value="+", pos=(12, 13)),
Token(kind="Number", value=4, pos=(14, 15)),
],
Expression(
body=Operation(
1,
"+",
Operation(ParenthesizedExpression(body=Operation(2, "+", 3)), "+", 4),
)
),
),
okay, this shows the failing of my (terrible) parser
I'm trying to write a testing tool for my language and it's so haaard
I just make the ast into a string and compare it
Well, not my language, but one I'm implementing
I have a custom display impl for that
Yeah I could do that, but I've decided to try parsing it from that language's files
Something more sophisticated might be nicer than just comparing strings
Since writing them out is a pain
Expression(
Operation(
Number(1)
+ ParenthesizedExpression(
Operation(
Number(2)
+ Operation(
Number(3)
+ ParenthesizedExpression(Operation(Number(4) + Number(5)))
)
)
)
)
)
this is what it spits out actually, which is so wrong :(
Lmao
Like this is an example lexer test for what I want
(){},.-+;/*!=><!===>=<=
// expect: OpenParen
// expect: CloseParen
// expect: OpenBrace
// expect: CloseBrace
// expect: Comma
// expect: Dot
// expect: Minus
// expect: Plus
// expect: Semicolon
// expect: Slash
// expect: Star
// expect: Bang
// expect: Equal
// expect: Greater
// expect: Less
// expect: BangEqual
// expect: EqualEqual
// expect: GreaterEqual
// expect: LessEqual
// expect: Eof
And it shall lex it
!otn sudden-language-dev-channel
or !otn makeshift-language-dev-channel
(helpers can't actually do this)
Just become mod ez
yeah i know it's soo easy /s
Lol
(mods, we aren't disrespecting the critical roles y'all hold in this server π )
or are we π
Perhaps
.< well
I'd like to make it clear that when I use an emoji in a message, it's a joke, I don't mean it negatively
Lies /s
Anyway back to lang-dev, I assume that pratt parsing would be a good fit for implementing a calculator?
Wdym
Sure, it has operator precedence
I have a few articles on Pratt parsing
... that are all in rust presumably
https://matklad.github.io/2020/04/13/simple-but-powerful-pratt-parsing.html this is pretty fantastic
Welcome to my article about Pratt parsingβββthe monad tutorial of syntactic analysis.The number of Pratt parsing articles is so large that ...
how'd you guess
you sent me that a few months ago
I know no languages well except for Python
Oop and for c
If I had to save my life with javascript I could, but like it's going to be the most messy code ever
Lmao
well this is going better than I expected
the right and left hand sides shouldn't be instances of token but I'll fix that later
one kind of number, smh - what is this, a JS interpreter? π
just a calculator π³
parsing is the most enjoyable part because you get to work on top of tokens or AST instead of user input
i love how my parser can be smarter than me. for something like -1 - -2 + -2 / -3**2 or more complex i'd have to put parens for my brain to comprehend whereas the parser can recursively parse it
not a bad idea tbh
whitespace dependent precedence, interesting concept
Eh, debatable
Parsing is fun, but I prefer writing vms
The actual execution part is pretty interesting to implement
so 1 * 2 * 1-1 * 3 + 4 would be (1 * (2 * (1-1) * 3) ) + 4?
You have an extra closing parenthesis there after the 3, but that looks right, I think
oh yeah
That would be interesting
What about using the length of the whitespace to determine it? So one space would have higher precedence then two.
wait no it's right
oh wait, I see
I thought there was one after 4, oops
But that's the fun of it :D
And you'd have normal precedence if you use consistent whitespace (one space every time)
Which isn't hard
but it would be confusing if you have a big expression
so only a single level of whitespace precedence would be allowed?
like this
1 - 1 - 1 - 1 would be (1-(1-1))-1 because of double whitespace
okay how about 1 - 1 - 1-1 - 1 - 1 as (1-((1-(1-1))-1)-1 :P
How about instead of parentheses we use forward and back slashes 
2 * / 5 + 3 \
is the same as
2 * (5 + 3)
I'm sure it can be more cursed than this
lmao, wouldnt that be the same as existing parsers, except when lexing parens you set / to be left paren and \ be right paren
division can be (
if:
* = )
+ = ]
- =[
/ = (
( = /
) = \
then... 2 [ 3 ( / 1 ] 1 \ ) 3 being 2 + 3 / (1+1) * 3 is pretty cool
This looks like some familiar math notation that I forgot the name of, intervals?
Guys , do not eat pure cinamon it dfoesn't taste good by itself.
finishing to read book about javscript
I thought python is magic...
I was wrong ...javascript is pure magic and hacks
You're a wizard . . . https://www.youtube.com/watch?v=I4EWvMFj37g
Bash is the command line shell that you encounter when you open the terminal on most Unix operating systems, like MacOS and Linux. Learn how to create your own bash scripts to automate tasks on your computer.
#linux #compsci #100SecondsOfCode
π Resources
Bash Reference https://www.gnu.org/software/bash/manual/bash.html
Unix Shell History http...
Time to burn you at the stake.
those are already known magical incantations to me, I even already learned higher order magic: ansible.
I'll catch up. π
π π
I think that video is good for people like me that only really know python. The rest can be learned over time.
perhaps. I love reading books though. One book read in two days, gives condensed experience that otherwise takes months to learn on your own
the best is to learn the book and then to apply, apply, apply, apply, apply at practice ;b
Have you read ringworld?
it is worthy to read books for beginners btw, at least the best ones, they explain a lot of core practices / best practices / mechanisms behind the current tech in a really easy to get way
nope
Why?
Resource?
whole Head First books series at least
any topic they cover... usually always the best covered
in the easiest to understand way
I finish their javscript book at the moment
they don't just give syntax, they explain mechanics, that otherwise you would get only through experience ;b
for other books I just search O'Reilly, and carefully monitoring Amazon reviews and other factors, how much re editions the author published for the book and e.t.c.
There is some need for certain balance to find the best book and preferably updated recently. Some topics can be taken with older books though
Everyone learns differently and what works for one might not work for the other. I'll check out some of their books even though I have in the past. Personally I don't like O' Reilly published books because of all the bloat but who knows maybe it's just the author.
well. yeah, everyone learns differently
I am really... fast reader with a lot of... passion for books? that's the best way for me
i had a time when in three years I had read few thousands books ;b
I get bored with the redundance of some authors.
Even Sweighart was guilty of this.
π€·ββοΈ IMO finding quality book is certainly easy
and even if there is some water, it is the book, it is easier to read faster
books give great navigation ;b
I have ADHD so maybe that has something to do with it.
Bwhahaha.
Javascript has even python generators
they just aren't named so and sort of based on another javascript hack
Suggest more topics here!
The famous youtuber skinny boi 5
Any famous CEO of a any big interesting to me company that recruits me ;b
Just kidding.
5 gigs
My Cousin
That'd be really easy
Suggest more topics here!
Power to have any power i chose to ANd be able to remove it
Pydis lingerie when?
Let's make our own
what is lingerie
underwear
there's pydis jammies
whats a jammie
pajamas
It is required that every staff member owns a pair of pydis pyjamas. Please get yours immediately.
whats a button
buttons dont exist
wait, its all <div onClick="handleClick"></div>?
its all <a>
is onclick camelcase or am i confusing it with react
i think im confusing it with react
You all over here messing with my understanding of reality
It's not
It's only camelCase in react
u have to call it?
Yeah; the script text in vanilla < onclick="" > is wrapped in a function
That function then gets called
oh
wow
ive been using document.addEventListener
all this time
because onclick="handleClick" would never work
Yeah; unlike < onclick="" >, aEL and .onclick = doesn't need the parentheses for calling the function
Arguably inconsistent, but yeah
yea
@jovial island https://en.wikipedia.org/wiki/Series_(mathematics)
In mathematics, a series is, roughly speaking, a description of the operation of adding infinitely many quantities, one after the other, to a given starting quantity. The study of series is a major part of calculus and its generalization, mathematical analysis. Series are used in most areas of mathematics, even for studying finite structures (s...
no way, my brain wont let me open it
it's ok you said you knew +. this is just +
Oh, but still my brain just can't stand with math
I stay far as possible from that thing
haha understandable. if you take it slow though it's not all that scary
Link please vester
No but like, we really need to make these
Pydis has some surprising clothing articles and trinkets on their redbubble
@visual slate we should've known π¦
i was aware of the rule, but their original question was simply making a loop quittable without blocking and i had no other context
my dumbass didn't even know this was considered as a self-bot
Same here, might be useful for other stuff
@rare moat My local friendly C user, may @languid osprey and I pick your brain about good C books?
hmm
I have been summoned
'The C Programming Language' is still pretty much the de-facto standard for C books.
e
okie, tyty
let me get you the P D F
hey it is on GitHub.
there seems to be a couple here.
.bm 905932313827872769
oh nice, pirated books
@echo fern problem? 
it's strange this lived for 5 years, actually
at least one such repo I've seen, with more than a dozen programming books, got taken down
i totally didn't clone it or anything, though
Turkey made of tofu, lol
turkey flavored tofu, generally considered an abomination
i agree
!warn 767407164003450930 Don't spam people with pings please.
:incoming_envelope: :ok_hand: applied warning to @jovial island.
Can we get him muted (meaning wiser) or can you atleast do something in #discord-bots if you havenβt already
howdyyy
If you have an issue with a user, please DM @vapid maple .
would you guys recommend learning C or C#?
Not no more lol but in future Ight lol
these two are extremely different in usage
I'd say C# is something with far more everyday usages than C, which you'd use, like, if you wanted to contribute to the linux kernel or something
I see, thanks! I was checking some CS course requirements and I saw that C was one, but C# also looks promising
that's interesting - in my world, C# is way less common than C, heh
I do unix backend development for a living. I see a web service written in C# every once in a while, but almost every tool I use in my normal day to day life is written in C or C++ or Python or shell.
?
but does anyone else get stressed out while playing video games because of the code?
Like??? Iβm PLAYING the games
And Iβm thinking βdamn, imagine all the lines this mustβve taken for this window to pop upβ
Idk if that makes sense
I don't rage to video games, but I raged to computer errors.
Hehe, I only get sad instead
But every time I play a game, i imagine how the code must look like??? And Iβm kinda stressed because I start feeling bad for the devs
This is so incoherent T__T
Back 4 Blood uses Unreal Engine and that shit doesn't need any code if you don't want to use it.
Games are more about concept and assets the coding is secondary and in most cases today is optional.
scribbles down on notepad
some games took the hard way out and implemented everything from scratch though
like factorio with their fully custom engine, it took them many years to build
What language?
C++ and Lua
How many people?
Originally 3, now 25
25 sounds right for that kind of task.
How far did the founders get it before hiring new people?
I would assume not very far considering they had to hire 22 more people
That's what I was thinking.
It sounds like they built the engine and hired people to use the engine.
few years I think
I'm just wondering how much alpha/beta did they develop before they realized they needed 22 extra employees. They could have spent 10 years developing the engine and 1 year on the game.
You can probably see that if you dig into their blog called FFF
Maybe if I buy the game and enjoy it enough to care.
Dew it
Greta Thunberg wants to know your location
Greta thunberg should go finish school first
lol
Imagine granting this much media attention to some brat that hasnt even graduated high school yet
wait who
Greta Thunberg. The climate change activist
mmm yes the climate is made out of climate
@real forum did u tell ppl I'm 14 lmfao
No?
I'm confused then
About what?
things i cba to dig it's 4am I'm half asleep
I don't know what you're trying to say
be smarter smh
K
K
2 mole potassium
Don't be, that was my sleep deprived brain asking you
That age doesn't even make sense, I was being an idiot
Must have been thinking about someone else
true im clearly 18+ just ignore my parents' opinions on that 
or the seamstress sending me to the kids section of the store cuz they dont have my size 
@noble totem wasn't my algorithm :x I wasn't really providing any sort of meaningful code
I may have misunderstood matrix multiplication on the other hand when describing it in prose but I did point this out :^)
it was them that should describe it anyhow
the code I posted only had renamed vars
your code was easier to read π

Hi mates is there anyone who knows Emacs?
cmon people
literally half the server does and is very passionate abt emacs but everyone died ig
Hardly anyone uses emacs
wdym there's like four of them on this server
in all seriousness though, there's at least 2
I only know Pure and Joe, but there are likely others
ok then 3, bc LP
I also sometimes use emacs
woah a whole 4 nice
speaking of Elm...
I was playing around with PureScript (Halogen)
and I think it won
as in, I gave up
PureScript is a work of a madman
I'm saying this as a person who still hasn't given up on Agda
someone really just sat down one day and implemented typeclasses and structural subtyping in a language
but yeah, I tried it, got lost in the weird typesystem, got unlost in the weird typesystem, got sth done then decided I would stick to JS or clojurescript
I like TS
the thing that makes elm so appealing is how trivially simple it is
for extension in GHC.extensions:
print("someone really just sat down one day and implemented {0} in a language".format(extension))
although haskell still doesn't have anything structural, right?
not to my knowledge
I liked purescript as a language, but
- Halogen is really complicated, feels like I'm writing a PhD not making a web app
- the ecosystem is sparse and very poorly documented
I liked <pretty much anything haskell-related> as a *, but
- <pretty much anything haskell-related> is really complicated, feels like I'm writing a PhD not making a *
- the ecosystem is sparse and very poorly documented
lol
let's call this a Higher Kinded Message
everytime I write something even mildly intersting in haskell, I realise that literally no one but me will ever be able to understand this
hey, I actually succeeded in making a telegram bot with commands in Haskell. it was fun.
that's cool
agda compiles in JS as well, maybe I should try making a web app with that
like, when I go on vacation
https://lavirlifiliol.github.io/goblet4.html this is the purescript thing I made
but I wasn't using halogen I don't think
I don't have the code, so IDRK
...which is at least 5 months from today π unless I get fired of course
oh yes. early vacation
true
@spice spear I ended up with this btw
https://paste.pythondiscord.com/fayoqomiya.py
@jovial island i like
@jovial island thanks a million for your help I will be able to get this to work i think
@jovial island is it more like a message broker with smart routing than pub sub?
@spice spear don't ask me it's your design xD
I wouldn't say a message broker would have any sort of worker pool in it
@jovial island lol, love it. Its some frankenqueue.
I suppose I'd call it a work queue with some weird messaging thrown in. x)
not that I know anything about concurrent stuff (wish I did, it's always fun to mess around with)
@jovial island i agree. I am enjoying playing around with it. I would like to give golang a go for that purpose too. I am hoping that this concurrent pattern will mean I can move away from boring loops and focus on just writing the producers / consumers.
haha. "golang a go"
goroutines are simpler to work with than threads to work with but due to this people abuse it and use it to concurrently do everything which can sometimes overcomplicate things
Hm, it's past Halloween. Should I move to my usual pfp or find/make/commission something new?
@full haven Rust has an ownership model that helps you avoid writing memory unsafe code.
(pinging you here because that's off topic for pygen)
I haven't noticed it was Halloween themed until now lmao
santa hat
Well, the pumpkin bag is cut because of circle frame...
yea
I think it's a bit too early + I would need to find a good holidays base...
Furvilla's bases are cute. But holidays canine is Santa-like, while holidays fox is snowman-themed
Fox for comparison
Oh! Found a nice Christmasy free to use base
Sweden's financial regulator just released an article in which the director-general concludes that if cryptocurrency mining via Proof-of-Work is allowed in Sweden, we'll run out of renewable energy and endanger our chances of meeting our Paris Agreement climate responsibilities.
132
760
@elfin vine i applaud the Swedish land
Then the rest of the thread is just galaxy level bs
1 780 000 kilometers for one bitcoin

!
