Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories β€” IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2019-06-28 00:00:00Z and 2019-06-29 00:00:00Z
Avatar
Is it acceptable to have single file python "projects" or should I be creating a virtualenv?
Avatar
I don't really ever make anything with python except "scripts", I use it mostly like a very powerful bash
10:05
so I'm not sure what the "standard" way to organise a project is in python
Avatar
i guess u put ur files in a folder like any other project? xd
Avatar
Well DUH
10:10
I was putting them on the blockchain
Avatar
Hmm, ethereum smart contract teeworlds master server?
Avatar
sounds cool
Avatar
anyways, I have a half working version of http masters \o/
10:12
I'll clean it up a little and will put up a draft pr tomorrow or the day after
Avatar
nice
Avatar
I remembered how much I hate languages without static typing, I should have done this in typescript or just c++
10:31
maybe directly in rust even
Avatar
ChillerDragon 2019-06-28 10:58:06Z
are you trolling Learath2?
10:59
or did you really get some tw masters stuff running on a blockchain lol?
Avatar
not at all, I wholeheartedly believe dynamic typing is evil
Avatar
ChillerDragon 2019-06-28 10:59:44Z
-.-
Avatar
oh that, yeah i'm trolling
Avatar
ChillerDragon 2019-06-28 10:59:49Z
i mean the master part
10:59
sad
Avatar
I wouldn't waste time with putting masters on blockchain πŸ˜„
Avatar
ChillerDragon 2019-06-28 11:00:23Z
idk how smart contracts work but i assume you cant host anything on it
Avatar
you are evil
Avatar
anyone who thinks dynamic typing is acceptable, don't @ me
Avatar
ChillerDragon 2019-06-28 11:01:25Z
well best language uses dyntypes
Avatar
that's an oxymoron
Avatar
ChillerDragon 2019-06-28 11:01:59Z
:p
Avatar
it can't possibly be the best language if it uses weak types
Avatar
ChillerDragon 2019-06-28 11:02:41Z
hm it somehow is
Avatar
I'm intrigued, are you talking about Scratch? πŸ˜„
Avatar
ChillerDragon 2019-06-28 11:03:40Z
hehe :D i knew you thought about scratch
11:03
idk what types it has
11:03
but i am talking about shell o.O
Avatar
I'd only like to say "Ew"
Avatar
ChillerDragon 2019-06-28 11:04:44Z
oh cmn its best
Avatar
It should be against the genova convention to use languages with weak types
Avatar
Scratch lmao
Avatar
ChillerDragon 2019-06-28 11:05:42Z
sh > bash > scratch > masm > rest
Avatar
masm?
Avatar
Masm
11:07
Wth is this
Avatar
that's an assembler
Avatar
ChillerDragon 2019-06-28 11:07:20Z
microsoft assembler :p
Avatar
an x86 assembler
Avatar
ChillerDragon 2019-06-28 11:07:44Z
it has quirks more fucked up than javascript
Avatar
so it doesn't belong on your list
11:07
you should say x86 assembly πŸ˜›
Avatar
Microsoft ew
Avatar
well masm does kinda have it's quirks with it's macro syntax though
Avatar
x86 64 bestt
Avatar
Why do people put up with this madness? It's insane that doing field validation is so hard in this supposedly high level language
11:23
It's easier in rust even
Avatar
what’s so hard about it
Avatar
fields themselves don't have a type, so validating them requires you to either requires you to write your own validator or use a library, which requires you to create a schema
11:27
either way, now I have either two classes or one class one function that can easily go out of sync
11:30
I guess I'll use marshmellow and call it a day
11:30
marshmallow*
Avatar
@Learath2 latest python versions got some type hinting but not as good as typescript
12:10
typescript is rly well done tbh
12:10
to go around the js shit
Avatar
ChillerDragon 2019-06-28 12:55:31Z
welcome to another episode of syntax fails:
12:55
highlight*
Avatar
that editor must be rly bad
Avatar
I have never written anything this ugly
Avatar
ChillerDragon 2019-06-28 13:52:36Z
ye the editor is the worst but i already had similar stuff in vscode
Avatar
GitHub Gist: instantly share code, notes, and snippets.
13:57
still the huge avatar πŸ˜›
13:57
this is the "reference" i'm implementing against
13:58
it barely works
Avatar
hmm, removing the support for old masters and serverinfo packets might be a tad too radical πŸ˜›
Avatar
shouldn’t validate_dict return false and then raise exception from that
Avatar
yeah, it's all very dirty now, i was debugging sth, so I moved the exceptions up, then forgot to move them back down
Avatar
you can combine the 2 checks btw
Avatar
haven't slept in like 30-35 hours, so a little brainmelted aswell
14:44
go sleep
Avatar
if i sleep now I'm fucked
14:45
I'd sleep 8 hours minimum, waking up at 2400, then tomorrow i'll sleep at 1600 again πŸ˜„
14:45
unwise
14:46
@jao which two checks you mean?
Avatar
@Learath2 again
14:47
stop stopping sleeping
14:49
I would pass the dict to init
Avatar
@Learath2 damm how is that even possible. I sleep atleast 7 hours a day.
Avatar
init can't return a None though, I guess I should be raising the exception anyways
Avatar
go sleep
14:52
its time
Avatar
@n000b it's usually not possible, making an adjustment today
14:52
@archimede67 I have already told you it'd be insane to sleep right now, so stop giving me bad ideas
Avatar
And if i make it till 6am on Saturday i just sleep 4 hours.
14:53
But not sleeping is the worst
Avatar
anyways, do you think it's a little too much to remove the support for oldmasters and serverinfo packets?
Avatar
but you validated already before
Avatar
I was thinking we inject the servers that don't support the new protocol into the masters ourselves
Avatar
why would it be insane
14:54
you can go sleep at any time
14:54
if you need it
Avatar
@archimede67 if I sleep now, when do you think I'll wake up?
Avatar
and you, need it
14:54
tomorrow at 2pm
Avatar
Well that is bad advise actually
Avatar
the whole point of staying awake is to shift my sleep schedule to more favourable hours
14:55
@archimede67 no way i'll sleep 19 hours lmao
Avatar
Better advise is just sleep for 3 hours now and go to bed again at noon
Avatar
lol then better stay up
Avatar
@n000b and that's too little, no way I'll be able to get out of bed after 3 hours
Avatar
@Learath2 yeah but when its 35h you didn't sleep its not shifting anymore xd
Avatar
he will be even more wasted after 3h sleep
Avatar
@archimede67 ofc it's shifting, I can sleep a max of 10 hours, if i go to sleep at 2400 today, i'll wake up at 1000 at the worst case
14:57
which is much better then what i have now
14:57
sleeping at 0600 waking up at 1500 is not good for one
Avatar
but
14:57
why 35h no sleep
Avatar
how else do you suggest i move the sleep schedule ahead?
Avatar
in one day there's enough time?
Avatar
If I could sleep on command like the lucky few, I would do so
Avatar
if you go sleep at 12 pm each day
Avatar
I need to actually be quite sleepy to sleep, insomnia is a bitch
Avatar
that's why you wait so much?
Avatar
easy for you to say with your decent sleep, 2400 is usually when I'm at peak awareness
Avatar
ah xd
Avatar
they probably never had a fucked up sleep schedule πŸ˜‚
Avatar
Lying in bed is also resting. I gave up to sleep fast. I just am chilling 1 or 2 hours before i sleep.
Avatar
he would fall asleep
Avatar
currently yes
15:00
i would instantly pass out πŸ˜„
Avatar
afterall its ur life xd
Avatar
anyways, we have some major spaghetti code with the serverbrowser :/
15:02
this will be so much to refactor :/
Avatar
dont add old master support to new master pls
15:12
its all just validation code
Avatar
well at this point it just needs to make sure i'm sending proper requests, saves them and sends them back
15:35
I don't need it to do anything else rn
16:06
new rpi
16:06
looks awesome
16:06
i think the rpi website is hosted on it
Avatar
I should find a new project to do with it
Avatar
ill buy it probs
16:11
it got wifi and bluetooth
16:11
thats nice
16:12
it has also dual display 4k60
16:12
justatest
Avatar
i doubt it's beefy enough to render much of anything worthwhile at 4k60
16:22
let alone 2 πŸ˜›
Avatar
can't believe it actually works, now just need to polish it for a couple dozen years
Avatar
Make a live cam online with a timelapse feature
Avatar
did you know that it's fairly untrivial to parse a url?
Avatar
@Learath2 thats why u use libraries but ur u and i guess u dont like them
Avatar
I don't think anyone wants any more libraries in ddnet πŸ˜„
Avatar
oh u mean in ddnet
17:06
not masterserver
17:06
xd
Avatar
http masters sorta work, if you don't send them bad json \o/
18:00
if you send them bad json they crash and burn πŸ˜›
Avatar
why
18:01
u didn't do something that validates the json?
Avatar
validating json in C++ is even more cancer then validating in python
Avatar
ah
Avatar
ill send u bad json in a min bb
Avatar
in c++ ye
Avatar
@Learath2 u just use
Avatar
i'm sure
Avatar
a LIBRARY!
Avatar
there's online api
Avatar
WE ALREADY HAVE A JSON PARSER
Avatar
you do
18:01
but it still crashes? xd
Avatar
SEARCH A JSON VALIDATOR LIBRARY
18:01
xd
Avatar
one that doesn't do validation
Avatar
xd
Avatar
no I'll just add a HUGE function that does it πŸ˜›
Avatar
ok maybe there is an online tool which u can use instead of including yet another library
Avatar
I actually wanted proper json schema validation
Avatar
or that could be something to do if not
Avatar
@Learath2 btw instead of ur ugly validation code u can use https://pypi.org/project/jsonschema/ or something liek that
An implementation of JSON Schema validation for Python
18:02
note i dont think this validates if the text is correct json
18:02
but it works for the value parsing
Avatar
@Learath2 show an example of what you need, input -> output
Avatar
@Ryozuki I was doing that with marshmallow, then I noticed I made some mistakes while unpacking
Avatar
@Learath2 btw why u dont just catc the error if parsing errors
Avatar
then I didn't want to bother re-arranging
18:03
@Ryozuki in the client?
Avatar
in the sv
18:03
u are talking about
18:03
masterserver
18:03
right?
Avatar
yeah, that side I do catch the error normally
18:04
I just disabled it while debugging
Avatar
so it crashes
Avatar
u want to make the client not crash if it recieves invalid json
Avatar
i would use a lib but ur the one doing this
18:04
xd
Avatar
it's a couple dozen lines of verification
18:05
I'll write them, @heinrich5991 will complain that I didn't use a library
18:05
then I'll probably use a librarys
18:05
library*
Avatar
@Learath2 by invalid u mean malformed or incorrect value types?
Avatar
all of the above πŸ™‚
Avatar
a troll master server sending malformed json to clients
18:06
crashing all them
18:06
trolls would do it
18:06
for sure
18:06
xd
Avatar
well trolls can't has masterservers
Avatar
i guess
Avatar
I'm actually about to fall asleep on the laptop πŸ˜›
Avatar
then go sleep
18:07
:D xd
Avatar
I'll eat and I'll sleep
Avatar
do it then
Avatar
my god you are pedantic
Avatar
wtf πŸ˜‚
Avatar
Why can’t I play teeworld anymore
19:22
?
Avatar
hum
19:22
explain?
Avatar
Who is the monkey tee made by?
Avatar
60604ca fix name/clan width when zooming out (fixes #1752) - Jupeyy d35550c Merge #1799 - bors[bot]
Exported 237 message(s)