#voice-chat-text-0
1 messages · Page 124 of 1
rows?
Too bored
though, arguably, asyncio enable some less-than-reliable patterns
it's probably best to have per DB:
exactly one task
exactly one connection
I used that for the disgusting threading project
lol
because shared memory go brrr**crash**
So tl;dr
If you can separate them, you should
but I used file locks to avoid this problem
yes
avoid locking
use queues/messages instead
at that point you just have one task accessing one db anyway
asyncio allows "safe" shared memory
but relying on shared memory is sometimes very not good
Erlang philosophy says that "sometimes" there is "always"
such a flex
https://www.sqlite.org/fasterthanfs.html
> 35% Faster Than The Filesystem
There's caveats there
@woeful wyvern is the thing server-side or desktop?
for blobs
full write, full read
on some filesystems
with some configs
this benefits from reducing the file metadata cost
that's probably all that it is
OS has caching and stuff for FS
I know
this
Both? Supposed to be able to run anywhere, locally or server. Only the machine itself will make writes though. Inputs to the program have no direct correlation to writes
oh, so, "embedded" in the same sense as sqlite is
ARC of illumos+ZFS just uses almost everything it can
that's why "flex" but not a reliable one
there was a bug where it went too hard and starts causing routes to get dropped
you want a file => use files
you want a str->bytes dictionary => there might be better ways than using files per key
i'm gonna go now as there's alot of movies to watch ig see you guys later 🙂
maybe abstract the data storage from the rest of the app?
@woeful wyvern on low-level it's mostly just matrix things
which can be optimised
"if matrix movie was so good, why don't they release tensor movie?"
Rust's interoperability with C might be good, but often it's not worth introducing an extra non-uniformity into the code base
if you have to cross the boundary in thousands of different places, then why have that boundary in the first place
True
"now take that out of context and apply to some political stuff/country borders"
35%-Faster-Than-The-Filesystem-ism is a religion now
Seek well light.
twilight zone
I should've auto-generated it instead
to train making .drawio diagrams
@receiver(post_save, sender=Event)
def post_save_event(sender, **kwarts):
<logic statement, in form of IF loop>
return ?
13 "hmmm yes I will definitely survive if I follow that"
what libraries if any?
number 16 is too easy to make a joke of
are they tricking you into making code for them
yes they do
so .. use a laptop with encrypted drive .. and show them in person , then demo
rather just host it without sending the code
ya a virtual interview thingy
(rather than bringing anything)
mmm - would they pull the ... ohh that code is on our property we own it
Django Signals thing sounds to me for some reason
@lavish rover there's also style, configurability, etc.
that shows too
Will be on later after the Gym.
Say hi to gym for me
can you do a virtual whiteboard ? then interviewer presents a problem , then you step a basic flowchart of how to solve it
slowly piece it together in front of them
!e
# I'm not sorry
from typing import Callable
def compose(*functions):
def composed(x):
for f in reversed(functions):
x = f(x)
return x
return composed
def fizzbuzz(n: int) -> str:
def test(d: int, s: str) -> Callable[[Callable[[str], str]], Callable[[str], str]]:
def tmp(x: Callable[[str], str]) -> Callable[[str], str]:
if n % d:
return x
else:
return lambda _: s + x("")
return tmp
return compose(
test(3, "Fizz"),
test(5, "Buzz"),
)(lambda x: x)(str(n))
print(*map(fizzbuzz, range(1, 101)))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 Fizz 19 Buzz Fizz 22 23 Fizz Buzz 26 Fizz 28 29 FizzBuzz 31 32 Fizz 34 Buzz Fizz 37 38 Fizz Buzz 41 Fizz 43 44 FizzBuzz 46 47 Fizz 49 Buzz Fizz 52 53 Fizz Buzz 56 Fizz 58 59 FizzBuzz 61 62 Fizz 64 Buzz Fizz 67 68 Fizz Buzz 71 Fizz 73 74 FizzBuzz 76 77 Fizz 79 Buzz Fizz 82 83 Fizz Buzz 86 Fizz 88 89 FizzBuzz 91 92 Fizz 94 Buzz Fizz 97 98 Fizz Buzz
generic modules
they are exploiting a percieved desperation
it could've been const(s + x("")) but eh
ig lambda x: x should be identity
Bill the Moustaschio
-> Callable[[Callable[[str], str]], Callable[[str], str]] good lord
the "benefit" of this is:
branching happens only twice
(two if calls, zero and, zero or)
I had a simpler version with a TypeAlias for Callable[[str], str] but I forgot to include that
that is an almost literal translation from Haskell, so quite cursed
def fizzbuzz(n: int) -> str:
left, right = "", str(n)
if not n % 3:
left += "Fizz"
right = ""
if not n % 5:
left += "Buzz"
right = ""
return left + right
print(*map(fizzbuzz, range(1, 101)))
this is basically the same but simpler
this is a rough translation of the first part of the paper
the DSL part
but without DSL
😦
I have some similar code in my more proper projects
life is hard until you meet a man with no feet
justine treudo gets a $8000 / month food budget
> who told you healthcare in US is expensive?
what the fuck?
reality is seeping into the coding room.......
lol
Leon the proffesional ??
!e
def join(arr):
def wrap():
sep = "("
tail = "empty"
for s in arr:
yield sep
yield str(s)
sep = ", "
tail = ")"
yield tail
return "".join(wrap())
print(join([]))
print(join([0]))
print(join([0, 1]))
print(join([0, 1, 2]))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | empty
002 | (0)
003 | (0, 1)
004 | (0, 1, 2)
@midnight agate how much problematic does this look? (including naming)
religious avoidance of writing ifs
but, yes, that would look cleaner, obviously
stand by your opinions publicly 🙂
!e
def join(arr):
return "(" + ", ".join(map(str, arr)) + ")" if arr else "empty"
print(join([]))
print(join([0]))
print(join([0, 1]))
print(join([0, 1, 2]))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | empty
002 | (0)
003 | (0, 1)
004 | (0, 1, 2)
the ideological opposition to this code is:
arr is read twice
so it's not "linear"
well, if arr does not read the array
just checks the length no?
ig does not work for arbitrary iterables
well, yes, "linear" qualifier is somewhat of a mathematical fanaticism
it just does not matter for real applications
so it's a simple useless totally superficial challenge not something real
def join(arr):
res = "(" + ", ".join(map(str, arr)) + ")"
return "empty" is len(res) == 2 else res
lmao
it's terrible
unlike the if arr one, this works with iterators, not only collections
!e
def join(arr):
res = "(" + ", ".join(map(str, arr)) + ")"
return "empty" if len(res) == 2 else res
print(join([""]))
@lavish rover :white_check_mark: Your 3.11 eval job has completed with return code 0.
empty
... sometimes works
!e
def join(arr):
res = "(" + ", ".join(map(str, arr)) + ")"
return "_basically_ empty" if len(res) == 2 else res
print(join([""]))
there, fixed
@lavish rover :white_check_mark: Your 3.11 eval job has completed with return code 0.
_basically_ empty
Morning
Hey, I would like to ask a question, but I don't have perms to talk in the vc
Is there any way I can get temp perms to talk?
What's the quick gist of your question?
https://paste.pythondiscord.com/cixefisuyi
Thats my script, I have the command report_message
I would like to convert this command into a context menu but I don't know how, could you help me with that?
you can claim markdown support
version 2.1 and higher, right?
yes
yes
Steven Strogatz, an applied mathematician at Cornell, is a prominent figure in the field of nonlinear dynamics and chaos, and a widely beloved popularizer of math.
Episode sponsor: https://brilliant.org/3b1b
Brilliant is a great site/app for being more active in learning math.
Note from Strogatz's high school geometry:
https://twitter.com/steve...
One of my favorite podcasts of all time
this one?
trying to find here
https://discordpy.readthedocs.io/en/stable/interactions/api.html
seems like you need to specify command type to be AppCommandType.message
oh, wait
it took too long to find
so the first one probably
@app_commands.context_menu()
async def react(interaction: discord.Interaction, message: discord.Message):
await interaction.response.send_message('Very cool message!', ephemeral=True)
@app_commands.context_menu()
async def ban(interaction: discord.Interaction, user: discord.Member):
await interaction.response.send_message(f'Should I actually ban {user}...', ephemeral=True)
with the message: discord.Message argument
"not the worst things you can expect a person to say on twitter;
rather just average twitter communications"
when the only thing you have is a hammer, everything looks like a nail
when the only thing you have is a hammer, everything looks like a screw
@lunar haven You working on code or are you just kind of sitting on it
Because if you're not actively doing anything I'd prefer you to not be streaming
Like if you're going to go afk, end the stream
(from my understanding)
the video role (here) is supposed to be for "there's a something to stream"
that includes when given for prolonged periods
@lunar haven This
@lunar haven find ways to think while actively interacting with the streamed IDE
write tests
write out thoughts
write ideas in any form (pseudo code, etc.)
!server
there are issues with multiple people streaming at the same time
"did you pay the hourly rate to mustafa?"
!rule 9
HA
"offer didn't include disclosure of payment upfront, so doesn't count"
@receiver(pre_delete, sender=Event)
def pre_delete_event(sender, **kwargs):
if Event.component == TSTAT:
if Event.rawvalue >= 20:
return JsonResponse(event.json())
elif Event.component == BATT:
if Event.rawvalue >=85
return JsonResponse(event.json())
what is the idea of the current stream?
is that the whole function?
if yes, then elif-if can probably be merged using and, right?
vacuum, one second, dont want to be rude
Much appreciated
@lunar haven
yes
oh, and also:
isn't Event.component == BATT always false?
if BATT and TSTAT are different
OOOh, not in vc
event is a data model
component is a object of that model
event.component can either be BATT or TSTAT with current configuration of k:v
that code has something like this:
if x == A:
...
if x == B:
... # never reached? or always reached?
as in
I have one challenge for this day... flatten a dict.. given a dict {key1: value1, key2: {nestedKey2: value2}} the output should be [(key1, value), (key2.nestedKey, value2)]
Am i ok proposing things like this for the current stream?
Thanks
elif is probably with a wrong indentation
@lunar haven
something like this?
https://www.codewars.com/kata/5cde541f52ed7f000c0aa9a0
(this one is broken-ish)
((specification-wise this task is very strange))
thats nice, but we can skip nested list
probably, @vocal basin Im still trying ot get good at logic based decisioning.
@vocal basin Oooh! Sorry, distracted. Yes, the logic will always be one or the other currently, otherwise it would be an error exception
@receiver(pre_delete, sender=Event)
def pre_delete_event(sender, **kwargs):
if Event.component == TSTAT:
if Event.rawvalue >= 20:
return JsonResponse(event.json())
if Event.component == BATT:
if Event.rawvalue >=85
return JsonResponse(event.json())
Like this?
What's this problem you're working on? 
django signals post_save_event function for post import/ingest of data to detect and conduct a test condition for a qualifier to generate a notification
is that worded wordy right? I dont know how to speak developer.
Right
Yeah yeah. Although I'm not sure I really understood completely sorry 😄
I'm going to read a bit about Django signals.
sadly, can't use ranges and named constants like in Rust
(for match)
its ok. im ok with making multiple functionns to get er done. A pig with lipstick still makes bacon
if Event.component == TSTAT:
if Event.rawvalue >= 20:
return JsonResponse(event.json())
if Event.component == BATT:
if Event.rawvalue >=85
return JsonResponse(event.json())
can probably be
if event_is_valid(Event):
return JsonResponse(event.json())
this is just a highlighting bug
\30 and \. shouldn't be different
I recommend using pathlib from the standard library.
definitely
pharynx @flat sentinel
Path("../../30DayQuakes.json")
this will auto-convert to \ on windows
Yep 👍
volo dolum
Wdym? 
pathlib does not care
it validly recognises this
why do you need to chdir anyway?
and this
it auto-converts to backslashes on windows
call .absolute() on the path if you need to
or, better
.resolve()
proof?
works perfectly fine
(called from user directory)
how are you testing whether it works?
what should the path be?
@lunar haven why not just "30DayQuakes.json"?
the error message showed what the value of inpf was
and it could've been inferred that it shouldn't have ../.. there
@turbid sandal #data-science-and-ml
it's from a root not from current directory
try this
inpf = (Path(__file__) / "../../../30DayQuakes.json").resolve()
.wa Wolfram Alpha
__file__ is the current source file
this is relative to the source file not to the cwd
useful if you have bundled resources in packages
what if you wanted to go to heaven but god said 𒈗𒆠𒉌𒂠𒌌𒌌𒈗𒆠𒉌𒂠𒌌𒌌𒈗𒆠𒉌𒂠𒌌𒌌
Part 1: https://youtu.be/4gjroGF-fVY
Part 3: https://youtu.be/jfuth_W0UCE
Part 4: https://youtu.be/43jwmuVB4ec
Embrace the 𒀉𒀀𒀭𒇇𒅇𒀉. Keep bronzeposting. 𒅋𒋫𒄠𒋢𒌝𒊏𒊏𒋗𒌒𒋾𒂊𒆷𒋾.
.
.
.
.
.
.
.
.
.
.
.
.
#memes #bronzeage #funny #shitpost #sumer #language
Embrace the 𒀉𒀀𒀭𒇇𒅇𒀉. Keep bronzeposting. 𒅋𒋫𒄠𒋢𒌝𒊏𒊏𒋗𒌒𒋾𒂊𒆷𒋾.
The Verge
Geoffrey Hinton who won the ‘Nobel Prize of computing’ for his trailblazing work on neural networks is now free to speak about the risks of AI.
!d pathlib.Path.open
Path.open(mode='r', buffering=- 1, encoding=None, errors=None, newline=None)```
Open the file pointed to by the path, like the built-in [`open()`](https://docs.python.org/3/library/functions.html#open "open") function does:
```py
>>> p = Path('setup.py')
>>> with p.open() as f:
... f.readline()
...
'#!/usr/bin/env python3\n'
Path objects have an open method
text read, yes
there's also
!d pathlib.Path.read_text
Path.read_text(encoding=None, errors=None)```
Return the decoded contents of the pointed-to file as a string:
```py
>>> p = Path('my_text_file')
>>> p.write_text('Text file contents')
18
>>> p.read_text()
'Text file contents'
``` The file is opened and then closed. The optional parameters have the same meaning as in [`open()`](https://docs.python.org/3/library/functions.html#open "open").
New in version 3.5.
#language
Ancient Languages:
Ancient Egypt / 3100 BC - 332 BC
Achaemenids / 550 BC–330 BC
Ancient Greece / c. 800 BC - c. 600 AD
Ancient Rome / 753 BC–476 AD
Assyria / 1813 BC–612 BC
Göktürks / 552 AD-744 AD
Hittites / c. 1600 BC–c. 1178 BC
Akkadians / c. 2334 BC - c. 2154 BC
Aztec / c. 1100 AD - 1533 AD
Celts / c. 517 BC - C. 100 AD
Mayans /...
New in version 3.4.
Source code: Lib/pathlib.py
This module offers classes representing filesystem paths with semantics appropriate for different operating systems. Path classes are divided between pure paths, which provide purely computational operations without I/O, and concrete paths, which inherit from pure paths but also provide I/O operations.
If you’ve never used this module before or just aren’t sure which class is right for your task, Path is most likely what you need. It instantiates a concrete path for the platform the code is running on.
Pure paths are useful in some special cases; for example:
purely syntactical, as long as the type of path is UnixPath or WindowsPath
Europe is all the way to Ural
"Russia's land is in Europe, Asia, and African mines"
Kemalstan?
75% of population is in Europe
Russia's economy is tiny
This is what it is like to be a British person in real life trust me this is real and factual. Today we will be making a normal trip to Sainsbury's.
Instagram: https://www.instagram.com/bosnianapesociety/
@haughty umbra @green inlet 👋
!e python print(int('Hello'))
@amber raptor :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | print(int('Hello'))
004 | ^^^^^^^^^^^^
005 | ValueError: invalid literal for int() with base 10: 'Hello'
True
and still (as I heard) Netherlands' economy is comparable to Russian economy without oil and gas
US just hides the oil rigs inside the cities
!e
print(int("𐒣𑄺𑃸𑃸𑄶"))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
34880
(screenshot if someone doesn't see those characters)
#ad Get started with Factor for up to 50% off by clicking here:
http://bit.ly/3LXPNmw or using code: ROB50
T-Shirts: https://www.dahmracing.com/collections/shop
Patreon for Build Videos: http://bit.ly/2koiw8G
Instagram: http://bit.ly/RobDahmIG
Subscribe to Rob Dahm: http://bit.ly/1OAN9yi
AWD 4 Rotor Video Series: https://bit.ly/2QiFduE
––––––...
hello world
listening you guys remember when I were young
!e
print(int("𐒣𑄺𑃸𑃸𑄶٠໖𑄶۲𑃸႕"))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
34880060285
How to fly an Autonomous UAV for Long Range FPV & Autonomous Missions
Audio cut at 2:25
meh the last one is very offset
Video captured a huge bear strolling down a street in a Southern California neighborhood. https://abc7chicago.com/bear-sightings-southern-california-arcadia-los-angeles-area/13199811/
A little mouse goes for a ride in my rc f4u corsair plane. No animals were harmed making this video.
I will be the pilot of one of these things
I wonder if there's a better decimal digit that looks like "d"
what is that are went to stanford
or something around that
it lied to me today
it changed one word of place
you said halllucinations or im going insane
what is chdir for anyway?
just use the path itself
inpp = Path(inp_path)
outp = inpp.with_stem(inpp.stem)
or do you want to make it in a separate directory?
inpp = Path(inp_path)
out_dir = inpp.with_suffix("")
out_dir.mkdir(exist_ok=True)
outp = out_dir / inpp.name
you don't need \\ in paths
it's always equivalent to / on Windows
because Path is stored as a list of parts
there is also Path("a", "b") instead of Path("a/b")
YouTube
Welcome to my home built Helicopter Channel, follow along with me in the adventure of designing, building, testing, and teaching myself to fly this rather complicated machine. I have no aviation related qualifications but enjoy learning and enjoy passing on what I've learnt. Not too many people doing this sort of thing and even fewer broadcastin...
!e
from pathlib import Path
print(Path("a", "b") == Path("a/b"))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
True
I prefer using / when combining things that are know to be paths
but it should be fine like that too
helicopters are cars
(or, rather, if the left operand is a Path)
less nesting
I broke all the mechanics of my car and seeing this video makes me cry
second drops everything before the name
every is possible with pressure, a dream team and money
abc/abc/abc/abc/stem.suffix
^^^^^^^^^^^^^^^ ^^^^^^^^^^^
parent name
@lucid blade give me back the tin foil
military has a habit of promoting conspiracy theories to cover up their own activities
are from military
those are mostly just illusions not actual objects
rarely weather effects
even more rarely -- something people made
you're claiming two separate things
this was a comment on what you said about WW2 time observations
aka visual sightings
a 100000w reflector
ball lightnings have something like a couple of potentially reliable recordings
and similar looking phenomena seems to be replicable in experiments
but, like, them as weather/natural thing are still rather hypothetical/unstudied
if you point a laser beam in a sphere it becames all color
there's also some stupid analytical result that, if you point it at an opaque sphere, the brightest shadow point will be in the middle
!e
# this being allowed did some irreversible things to my brain
print(int("૧୨৪༥႖૭꧸"))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
1245678
The different wavelengths travel at the same speed, but when the speed changes they refract at different angles, which splits the light up into its components.
#shorts #cherenkov #nuclear
This video shows the start up of a nuclear reactor and how the Cherenkov radiation looks like during the startup.
Social media links:
Facebook: https://www.facebook.com/ihknak
Instagram: https://...
(Arago/Poisson/Fresnel spot)
I might have forgotten
Yeah it wont be split into constituent wavelengths if it's just one wavelength.
I don't really understand how lasers work 😄
It's some quantum mechanical thing, and I never got that far in physics.
Oh yeah, isn't this one of the reactors that's run by undergrads?
I studied quantum mechanics in part because that way I could explain my absence from dancing lessons (schedule overlapped quite luckily)
@rugged root
do we still have temporary 1H AFK measures in this chat?
Unfortunately
2 months long temporary
@vocal basin https://youtu.be/w0ztlIAYTCU
What if the very fabric of space and time isn't made of one-dimensional strings or energy as we think of it, but instead was simply a code or a language made from a geometric projection?
Quantum Gravity Research is a Los Angeles based team of mathematicians and physicists working on developing a theoretical framework for a first-principles un...
"just introduce social credit system"?
damn, discord took a long time to check that message
or I just have slow internet suddenly
I was tempted to implement something similar for one of my bots
but ethics took over
some systems are fundamentally and reasonably opaque
Sorry are you talking about video permissions or the moderator role?
Being able to grant the video perms
which is quite correlated to moderation
(look at @toxic zephyr's description, for example)
one chance is one chance too much
Yeah I think the criteria for this are just trust and familiarity.
just write a book on making a better system addressing all potential concerns
Honestly I think there's an alternate solution
@lunar haven H5 😉
Mods can grant permissions on a temporary basis. Admins will then grant them for a probationary period. If that goes well, they get permanent permissions.
Just give the people with stream permission the ability to create a temp channel
The only goal is to prevent misuse of the permissions.
@midnight agate giving out video roles is useless without kick permissions
probably granting stream permissions
you know who has kick permissions?
moderators
you know what also moderators have?
granting Video
@honest kayak Your nickname was setting off a load of moderator pings sorry 😄
You should be able to change it to something else.
Oh actually sorry, I need to un-starify you I think.
Bro It was literally a barcode
trait CanGrantVideo: CanKick {}
trait CanKick: Moderator {}
trait Moderator: CanGrantVideo + ... {}
@midnight agate verify you understand why this is the case
It was setting off the spam filter.
Oh ok
is Bell Labs still Nokia?
Bell Labs offering eletrictal services too
idk about bell labs
probably Adobe Photoshop
Then Governor Bill Clinton playing sax on The Arsenio Hall in 1992 (one song played is Heartbreak Hotel).
✅ @lime vale can now stream until <t:1682980606:f>.
print(any(quake["properties"]["felt"] is not None and quake["properties"]["felt"] > 25000 for quake in data["features"]))
print(any(quake["properties"].get("felt", 0) > 25000 for quake in data["features"]))
print(any(felt_by_more_than(quake, 25_000) for quake in data["features"]))
do you use any tools for debugging async stuff? (beyond just logging)
or, like
print(any(felt_by(quake) > 25_000 for quake in data["features"]))
I use "staring at code until it starts to make sense"
I'm too lazy to look up anything sane, so I wrote my own dumb things instead
code injection stuff
change to .get at least; or use or
or both
rather
collection.get(key) or default
key not in collection => default
collection[key] == None => default
collection[key] == 0 => default
which is basically
collection[key] == x and x > 0 => x
otherwise => 0
add or 0 after get
and remove , 0 from get
@lunar haven also, add parentheses
add parentheses
or else it's wrong
(collection.get(...) or default) > 25_000
this isn't javascript
!d dict.get
get(key[, default])```
Return the value for *key* if *key* is in the dictionary, else *default*. If *default* is not given, it defaults to `None`, so that this method never raises a [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError "KeyError").
get(key[, default])```
Return the value for *key* if *key* is in the dictionary, else *default*. If *default* is not given, it defaults to `None`, so that this method never raises a [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError "KeyError").
without or hacks
# TODO: find a better name
def get_default_not_none(collection, key, default):
maybe_value = collection.get(key)
return default if maybe_value is None else default
it won't
@lavish rover can I stream algebra school work
not really the place to stream algebra school work? besides I don't have permissions to allow people to stream anyway, only a mod/admin can do that
What happened, I wasn't paying attention? 😄
people go bye
Ah ok
Yo
Bringing us towards the AI apocalypse 3 times faster
You can drop the inner () when you pass a generator expression as the sole argument of a function call.
Oh wait nvm, I thought it was any((...)), but misread.
I'm thinking about a very dumb idea right now
how to implement as much as possible using iterators/generators
def function_to_generator(f):
yield f(yield)
def list_but_worse(it):
"""\
to the outside, this is an iterator of iterators
"""
list_ = list(it) # there should actualy be some hack to avoid using `list`
while True:
yield iter(list_)
I think if I try making anything sensible out of it, it'll just be something equivalent to "boring" things like an actor model but worse
I have no idea what I'm doing
and that, my friend, is how you make breakthroughs
by not knowing what the hell you're doing
Fix my ChatGPT-generated code has become a pretty common question in this server.
so, the first task to do, I'd guess, would be do duplicate an iterator;
I need to choose what constructs to limit myself to;
no it's not
Python doesn't have a concept of pass-by-value vs pass-by-reference
!e
print(sorted('abc'))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
['a', 'b', 'c']
sorted returns list
Yeah I mis-read your code sorry.
it's mutable vs immutable
not reference vs value
sorted sometimes changes the original value
!e
value = iter([1])
print(*value)
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
1
!e
value = iter([1])
sorted(value)
print(*value)
@vocal basin :warning: Your 3.11 eval job has completed with return code 0.
[No output]
So like it can consume an iterator.
Iterators can only be looped over once.
Sorry that might not have been the best way to put it 
Not seen gof sorry 😄
Erm, nah just never got around to it.
.sort modifies the list in-place.
this one is the correctness parameter not performance parameter
I think collections.deque is a linked-list.
!e
# ihatemyself.py
def empty():
return
yield
def one(item):
yield item
def repeat(item):
while True:
yield item
def repeat_ones(item):
while True:
yield one(item)
def _join(it0, it1):
yield from next(it0)
yield from next(it1)
def join(it0, it1):
while True:
yield _join(it0, it1)
def listify(it):
ls = repeat(empty())
for item in it:
ls = join(ls, repeat_ones(item))
while True:
yield next(ls)
arr = listify([1, 2, 3])
print(*next(arr))
print(*next(arr))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1 2 3
002 | 1 2 3
Hey @lunar haven have I told you about https://pythontutor.com ?
!e
print(sorted([0, 1], key=(lambda _: 0), reverse=True))
print(sorted([0, 1], key=(lambda _: 0))[::-1])
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | [0, 1]
002 | [1, 0]
@lunar haven [::-1] gives a different result
Pretty sure it is 😸
Ah right
Modules/_collectionsmodule.c line 33
/* Data for deque objects is stored in a doubly-linked list of fixed```
well, works if works
Cya Fred 👋
look further, there are some nuances
The code is pretty readable too, probably because it's written by Raymond Hettinger.
I'd say "accessing" and "mutating"
sorted isn't guaranteed to be immutable
but it's expected to be immutable on variables which are immutable when iterated over
@lunar haven :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | from future import braces
004 | ModuleNotFoundError: No module named 'future'
!e
from __future__ import braces
@vocal basin :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | from __future__ import braces
003 | ^
004 | SyntaxError: not a chance
Heading off for a bit 👋
!e
print(int("8০၃꧷౪੪៨௨୯૮꧲᱙᱓1᱒໕๙٤꯴᧘꧗꘩꧷3൧5໑꯵᧔᠙७").to_bytes(13, 'little').decode())
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
i am new here
I'm addicted to doing this now
even JS doesn't allow this
I do hear
"৪୨" is the new answer to everything
scrub 42 - replace with 89
!e
print(int("৪୨"))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
42
now "the only thing" left there is making yield from stacklessly somehow (or join)
just not to recursion-crash
!server
brain not wrok
continuing with that diagram
before "restructuring"
after
the original point was about incorrectly restructuring the project
rewriting parts in Rust, specifically
so I see the picture of what that should look like in my imagination, just like I had with monad-based tracing
I'm highly against doing administrative duties
for quite a lot of reasons
there are two types of servers in Discord
!e python print("i'm hungry")
@faint raven :white_check_mark: Your 3.11 eval job has completed with return code 0.
i'm hungry
"community" and not
you have higher liabilities if you make the first one
if the server lacks moderation, your access to "community" features will probably get restricted in one way or another
what they do state explicitly in (probably) multiple places is that they care about "community" server moderation more than typical server moderation
Discord themselves don't host your bots
poll API, iirc
event based
websockets are involved at some point
but I'm not sure where exactly
didn't look into it yet
Discord's API is based around two core layers, a HTTPS/REST API for general operations, and persistent secure WebSocket based connection for sending and subscribing to real-time events.
outdated but gives some insight into how things were
https://discordapi.com/unofficial/comparison.html
very good row for taking out of context
right now, I'm making this diagram worse
[making attempts at ]writing two external book-like pieces of documentation on the project I'm doing in Rust
one is about the functional programming basis
another is about distributed storage part
not the implementation of distributed storage "on the low level", but rather usage of some underlying system
they are separate because only one of them is Rust-specific
there should be a third one focusing on listing all the algorithms/data structures used
because there are some concepts from the distributed storage part which are not required here
... and there are also two other projects which are supposed to be based on that this
which are being developed since 2020
and finally are getting migrated to a form both more flexible and more robust
test?
*or I might've misheard*
speaking of tests, I don't have any separating abstract algorithms from the distributed storage allows to write tests without involving some more heavy context-specific objects
subset testing algorithm, that I wrote, for example, works on abstract binary trees
it might look horrifying because of the amount of Rc it has
but it's kind of reasonable
(it's Rcd anyway so this doesn't add any real overhead)
and using references just doesn't work
for now, at least
nodes don't even need to uniform in types
also
dereferencing a pointer to a node might fail
"pointer"
it might be a URL, for example
I will probably duplicate the code in a more general-public-appropriate variant
because right now there are references to internal projects in docs and other places
but the algorithm's code isn't responsible for handling it, the outside code is, in some sense
future
@lunar haven :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | from __future__ import braces
003 | ^
004 | SyntaxError: not a chance
!e from future import braces
@junior ermine :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | from __future__ import braces
003 | ^
004 | SyntaxError: not a chance
!e import future
@junior ermine :warning: Your 3.11 eval job has completed with return code 0.
[No output]
1min
do someone can give me permission to stream? i wanna show ,my app to gofek
@stuck furnace
Sorry, not unless a mod is present, and I'm heading off.
oks
@earnest grotto 👋
@somber heath Hi, can't talk right now 😢
!voice
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
The crested pigeon (Ocyphaps lophotes) is a bird found widely throughout mainland Australia except for the far northern tropical areas. Only two Australian pigeon species possess an erect crest, the crested pigeon and the spinifex pigeon. The crested pigeon is the larger of the two species. The crested pigeon is sometimes referred to as a topkn...
The common bronzewing (Phaps chalcoptera) is a species of medium-sized, heavily built pigeon. Native to Australia and one of the country's most common pigeons, the common bronzewing is able to live in almost any habitat, with the possible exception of very barren areas and dense rainforests. Its advertising call is an extraordinary mournful whoo...
The Australian king parrot (Alisterus scapularis) is a species of parrot endemic to eastern Australia ranging from Cooktown in Queensland to Port Campbell in Victoria. Found in humid and heavily forested upland regions of the eastern portion of the continent, including eucalyptus wooded areas in and directly adjacent to subtropical and temperate...
The sulphur-crested cockatoo (Cacatua galerita) is a relatively large white cockatoo found in wooded habitats in Australia, New Guinea, and some of the islands of Indonesia. They can be locally very numerous, leading to them sometimes being considered pests. A highly intelligent bird, they are well known in aviculture, although they can be deman...
The galah (; Eolophus roseicapilla), also known as the pink and grey cockatoo or rose-breasted cockatoo, is the only species within genus Eolophus of the cockatoo family. Found throughout Australia, it is among the most common of the cockatoos. With its distinctive pink and grey plumage and its bold and loud behaviour, it is a familiar sight in ...
The spotted pardalote (Pardalotus punctatus) is one of the smallest of all Australian birds at 8 to 10 centimetres (3.1 to 3.9 in) in length, and one of the most colourful; it is sometimes known as the diamondbird. Although moderately common in all of the reasonably fertile parts of Australia (the east coast, the south-east, and the south-west c...
The eastern spinebill (Acanthorhynchus tenuirostris) is a species of honeyeater found in south-eastern Australia in forest and woodland areas, as well as gardens in urban areas of Canberra, Sydney, Melbourne and Adelaide. It is around 15 cm long, and has a distinctive black, white and chestnut plumage, a red eye, and a long downcurved bill.
Currawongs are three species of medium-sized passerine birds belonging to the genus Strepera in the family Artamidae native to Australia. These are the grey currawong (Strepera versicolor), pied currawong (S. graculina), and black currawong (S. fuliginosa). The common name comes from the call of the familiar pied currawong of eastern Australia a...
Kookaburras (pronounced ) are terrestrial tree kingfishers of the genus Dacelo native to Australia and New Guinea, which grow to between 28 and 47 cm (11 and 19 in) in length and weigh around 300 g (11 oz). The name is a loanword from Wiradjuri guuguubarra, onomatopoeic of its call. The loud, distinctive call of the laughing kookaburra is widely...
YOOO
The white-winged chough (Corcorax melanorhamphos) is one of only two surviving members of the Australian mud-nest builders family, Corcoracidae, and is the only member of the genus Corcorax. It is native to southern and eastern Australia and is an example of convergent evolution as it is only distantly related to the European choughs that it clo...
how goes it?
@sacred tundra 👋
It goes and you're the only one who knows.
The little raven (Corvus mellori) is a species of the family Corvidae that is native to southeastern Australia. An adult individual is about 48–50 cm (19–19.5 in) in length, with completely black plumage, beak, and legs; as with all Australian species of Corvus, the black feathers have a grey base, and the iris of the adult bird is white (typica...
@whole bear 👋
Hello
@turbid sandal @crystal fox I couldn't hear any of you because discord voice chat is blocked where I live
I just wanted to ask if any of you have knowledge in sphinx
no @fair citrus
okay thank you
@jolly slate 👋
@somber heath OY! ya got dem fancy birds up there ( oz top of world , righto )
do they make a 4k at 240 Hz
@calm mist 👋
The topic varies.
whats the re-sale value of a lambo
About $3.50.
you saying what you want sell crypt coins @turbid sandal
servers devalue - no business person will buy them
if your underage , then you daddy will be held liable
is this the cartoon channel
@somber heath so are wild parrots , common there
@somber heath i always look at the 4k vids of birds , especially parrots flying in a flock
@somber heath bird jail
@somber heath did you ever hear a budgie talk
@somber heath most animals need to be wild , cats may be ok
@somber heath i feel sorry for big dogs in a house , they need a farm to run around in
@rugged root when the cat away ,,,,,, the mice will play
is Hemmy getting some coffee , and a banana chocolate chip muffin before work
grapefruit has that same effect - 50/50 love hate
dont get to deep of confookled hooman rules - its just mind bending
14 yr kinda elderly for a cat
i hear good things about canabis and cancer
if your cat starts hiding to sleep - its kinda the beginning of the end
did you train your rats
@crystal fox did you train your rats
@crystal fox they can press a button then , text to speech setup
@crystal fox that is a must do project
@crystal fox food reward thingy
i got a nice $10 keyboard and mouse
Always on start: [5, 63, 1, 0, 0, 1]
Always on start: [11, 134, 36, 0, 112, 6, 0, 0, 118, 16, 0, 0]
Always on start: [7, 54, 144, 1, 232, 3, 0, 0]
FINISH LINE: [17, 41, 0, 0, 242, 189, 31, 73, 255, 129, 200, 0, 252, 0, 23, 51, 34, 35]
UNKNOWN!: [16, 39, 6, 33, 242, 189, 31, 73, 149, 1, 7, 255, 129, 200, 0, 144, 1]
NEW TRACK (dont know which):[17, 41, 0, 0, 242, 189, 31, 73, 255, 129, 200, 0, 254, 0, 41, 0, 22, 22]
UNKNOWN!: [16, 39, 12, 18, 242, 189, 31, 73, 139, 1, 7, 255, 129, 200, 0, 144, 1]
UNKNOWN!: [16, 39, 13, 18, 242, 189, 31, 73, 142, 1, 7, 255, 129, 200, 0, 144, 1]
NEW TRACK (dont know which):[17, 41, 0, 0, 242, 189, 31, 73, 255, 129, 200, 0, 254, 0, 0, 0, 39, 44]
UNKNOWN!: [16, 39, 12, 18, 242, 189, 31, 73, 122, 1, 7, 255, 129, 200, 0, 144, 1]
UNKNOWN!: [16, 39, 13, 18, 242, 189, 31, 73, 143, 1, 7, 255, 129, 200, 0, 144, 1]
NEW TRACK (dont know which):[17, 41, 0, 0, 242, 189, 31, 73, 255, 129, 200, 0, 255, 0, 0, 0, 39, 45]
UNKNOWN!: [16, 39, 12, 57, 242, 189, 31, 73, 162, 1, 7, 255, 129, 200, 0, 144, 1]
SPECIAL TRACK:[6, 83, 249, 117, 0, 0, 0]
SPECIAL TRACK:[6, 79, 249, 117, 0, 0, 0]
SPECIAL TRACK:[6, 83, 219, 39, 0, 0, 0]
SPECIAL TRACK:[6, 79, 219, 39, 0, 0, 0]
UNKNOWN!: [16, 39, 13, 57, 242, 189, 31, 73, 150, 1, 7, 255, 129, 200, 0, 144, 1]
NEW TRACK (dont know which):[17, 41, 0, 0, 242, 189, 31, 73, 255, 129, 200, 0, 0, 0, 0, 0, 56, 56]
UNKNOWN!: [16, 39, 12, 17, 242, 189, 31, 73, 139, 1, 7, 255, 129, 200, 0, 144, 1]
UNKNOWN!: [16, 39, 13, 17, 242, 189, 31, 73, 135, 1, 7, 255, 129, 200, 0, 144, 1]
NEW TRACK (dont know which):[17, 41, 0, 0, 242, 189, 31, 73, 255, 129, 200, 0, 253, 0, 0, 0, 38, 44]
UNKNOWN!: [16, 39, 12, 23, 242, 189, 31, 73, 132, 1, 7, 255, 129, 200, 0, 144, 1]
UNKNOWN!: [16, 39, 13, 23, 242, 189, 31, 73, 136, 1, 7, 255, 129, 200, 0, 144, 1]
NEW TRACK (dont know which):[17, 41, 0, 0, 242, 189, 31, 73, 255, 129, 200, 0, 255, 0, 0, 0, 39, 45]
UNKNOWN!: [16, 39, 12, 34, 242, 189, 31, 73, 147, 1, 7, 255, 129, 200, 0, 144, 1]
UNKNOWN!: [16, 39, 13, 34, 242, 189, 31, 73, 154, 1, 7, 255, 129, 200, 0, 144, 1]
FINISH LINE: [17, 41, 0, 0, 242, 189, 31, 73, 255, 129, 200, 0, 0, 0, 0, 0, 34, 34]
@crystal fox you need lots vit C and D
Provided to YouTube by The Orchard Enterprises
May 16 · Lagwagon
Let's Talk About Feelings (Reissue)
℗ 2011 Fat Wreck Chords
Released on: 2011-11-22
Auto-generated by YouTube.
Star Fleet is on the JOB!!!
everybody has covid , i feel so left out
jonny rotten = punk ?
jonny said some stuff then the BBC blacklisted him
Yeah that tracks
is goonygoogoo a ozzy thing
??
hmmmm , think of "The Goon show" from england , they secretly get drunk on the show
Just makes me thing of SomethingAwful
infected goonbag ?
as long as its high alcohol content - all is well
homebrew beer can be 12 or 18 % its nice
its the skin in red wine that is anti-cancer and anti-heart disease
gin as a marinade?
home brew beer is actually better - and when you go back to bought beer then its shocking
Q - mint julip , has gin ???
drinkology 1001
@turbid sandal @pulsar island #data-science-and-ml
isnt NUMPY faster at deep arrays
Word
if you want to code for emotion - then how do you feel about , coffee HAL9000
Red Dwarf --- toaster AI
there's this video but I don't know how correct it is
https://youtu.be/8Fn_30AD7Pk
-
Thank you, Bonnie Bees, for making this video possible: https://www.patreon.com/cgpgrey
-
Discuss this video: https://www.reddit.com/r/cgpgrey
Related Videos
-
Driving a Tesla Across The Loneliest Road: https://www.youtube.com/watch?v=_naDg-guomA
-
Testing Tesla on the Twistiest Road in America: https://www.youtube.com/watch?v=d6tgmGqXy...
@pulsar island there playing you , they want more money before bailing out
@pulsar island its a open market - give each of the staff your business card
restarted because this wasn't showing up
(just made sure it's a bug on my side)
google maps?
dragonfruit reminds mr of this.....
(google reviews is a part of it)
Such a good series.
i know i know
minesweeper.online
ERR_CONNECTION_REFUSED
sad situation
your puppy is called Django ?
"full stack" is a buzzword
> Flask is good
eh
Flask is a good implementation of awful ideas
no matter how well you implement request object as a globally imported object, it's just wrong
no matter how well you implement WSGI, it's not ASGI
Scala, to support XML literals
> jams up the whole process
????
I guess this one depends on contextvars or something like it
I should check
from quart import request
yes, ContextVars
Flask probably does that too
(hopefully)
there's way way more
Just interesting how it's saying Popular ones
And Django is the only one that jumps out at me
Python back-end framework following JavaScript front/back-end frameworks' fate
Masonite actually does seem kind of interesting
I tried to configure managed k8s as cheap as possible in Yandex Cloud price calculator
(just for fun)
$83.99 a month
sounds not cheap for its settings
So much wrong
@turbid sandal What's up?
there are cases where "security through obscurity" is worth it economically/otherwise
not everyone is qualified enough
like
cases where you don't care if it's 50% secure
DRMs, for example
True
... I was supposed to make a presentation on it at some point, but the audience was too much involved in !rule 5 stuff, so quite uncomfortable for me
Fair
hashes
public keys
other no-private-key stuff
and for password only use specific hashes
!d hashlib
Source code: Lib/hashlib.py
This module implements a common interface to many different secure hash and message digest algorithms. Included are the FIPS secure hash algorithms SHA1, SHA224, SHA256, SHA384, and SHA512 (defined in FIPS 180-2) as well as RSA’s MD5 algorithm (defined in internet RFC 1321). The terms “secure hash” and “message digest” are interchangeable. Older algorithms were called message digests. The modern term is secure hash.
Note
If you want the adler32 or crc32 hash functions, they are available in the zlib module.
Warning
Some algorithms have known hash collision weaknesses, refer to the “See also” section at the end.
how are they called?
is there a wikipedia page?
2min i need headphones
just use PyNaCl
# compute the hash value of text
hash_value = hash(text)
print(hash_value)
wrong hash
!e
from hashlib import sha256
text = 'Python Programming'
print(sha256(text.encode()).hexdigest())
yoloing failed
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
d15647d90cc9f8e341146110bf5058773171688b237d2f9b5704399a0b17c8bd
I only used PyInstaller
I kind of don't want to repeat that mistake
!e
import nacl.hashing
@vocal basin :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | import nacl.hashing
004 | ModuleNotFoundError: No module named 'nacl'
fancy front-end for pyinstaller
for passwords
https://pynacl.readthedocs.io/en/latest/api/pwhash/
yo
I like how rarely algorithm names appear inside public/secret/sign modules
does anyone know how to make a script where i can paste something into it and it will automate my keystrokes and type it in for me
what do you need it for?
I need it to copy and paste essays that are pre made for me and need it to copy it in therre for me cause they have it block so I need it to automate keystrochs fdor me and but it in
@vocal basin
why do you need to copy and paste essays?
Can you do it?
what do you mean by "pre made"?
My race condition is human.
Like I made them in a google doc to maske sure there right and have some look over it in the google doc before I submit it
Can ytou do it or nah
okay
so you were supposed to write it in the text box, and not in the google doc, right?
do you understand why you aren't supposed to use google docs?
I write it in google doc becausde it easeir to make agustments there thrn in text box
Can you do it or what bro
I'm not proceeding with any help until you answer that question
because there's !rule 5 and !rule 8
Idk I do it to make adjustments and send to my mother so she can l;ook over it for me cause its a big part of my grasde can you help or nah
I have it all typed out but I just need to but it in the text box
you aren't supposed to get external help on work that you receive grades for
type the text yourself, this is the cost you have to bear for external help
Bro its not a grade
and for google docs specifically, the issue is spell checking
if the site/app blocks pasting text, there are reasons for it
I juist need to copy it from the google dock to the text box can you help or nah
why is pasting text blocked?
Just large amounts?
YEs
Idk the console was made like that
is it a site?
Its a game
or an app?
I'm not sure it's ToS-allowed
What is not tos
BBL
Alright calm down everyone 😄
I have look at roles and its not I just need it to copy and past from the google doc to the text box
Verdoof
?????????????????
@turbid sandal Not really appropriate.
Cape Canaveral actually has bald eagles 😄
One flew along side the bus when I was there last.
It was majestic
Yeah that was arguably not a very smart decision by them 😄
They were building a steel plate to go under the pad, but decided not to wait till it was completed.
You reminded me of this @crystal fox: https://www.youtube.com/watch?v=aW2LvQUcwqc&ab_channel=chemdotinfo
The fictional Retro Encabulator device, which uses six hydrocoptic marzel vanes and an ambifacient lunar wane shaft to prevent unwanted side fumbling. We can't believe the salesman was able to keep a straight face.
lmfao
classic
reminds me of https://youtu.be/brdmnUBAS00
The right kind of batteries are never around when you need them. I'm Mark Erickson, and this is Infinite Solutions: Home Edition. In this episode, I'll show you how to recharge dead batteries using other types of batteries that still carry a charge.
IMPEDANCE RATIO CORRECTION: 2AA = 3 9V
Need more help? Contact me at www.marksinfinitesolutions...
Love it
Male koalas use a distinctive resonant donkey-like bellow to convey their dominance during mating season.
This one, at the Lone Pine Koala Sanctuary in Brisbane, seems to come out of a nap to mark its presence.
The Lone Pine sanctuary: http://koala.net/
More on koala conservation and biology at Dot Earth:
A Conservation Challenge Down Under...
@frigid tangle 👋
👋
@gentle flint https://www.youtube.com/watch?v=D-C6UvVGHto
No other object has been misidentified as a flying saucer more often than the planet Venus.
Police in Australia have released video a driver hooning a modified Nissan Silvia near an industrial area in Caloundra. Following an investigation, the Sunshine Coast Highway Patrol executed a search warrant and found the car at nearby address.
The vehicle was seized by police, while its owner was charged with one count of dangerous operation ...
Subscribe and 🔔 to the BBC 👉 https://bit.ly/BBCYouTubeSub
Watch the BBC first on iPlayer 👉 https://bbc.in/iPlayer-Home
Miriam is on a mission to explore the unique Australian ethos of the 'fair go.' She takes a deep dive into the diverse and extraordinary lives of her fellow citizen
#BBC #MiriamMargolyesAustraliaUnmasked #iPlayer
All our TV c...
To critics, the dirt bikes and ATVs that buzz around city streets are a dangerous nuisance. Others, including Boston's mayor, call them a much-needed outlet for the city's young people.
Subscribe to WCVB on YouTube now for more: http://bit.ly/1e8lAMZ
Get more Boston news: http://www.wcvb.com
Like us: https://www.facebook.com/wcvb5
Follow us: ...
@amber raptor your favorite config format: https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell
As a data format, yaml is extremely complicated and it has many footguns. In this post I explain some of those pitfalls by means of an example, and I suggest a few simpler and safer yaml alternatives.
It is awful
YAML Proves Dynamic Typing is awful
gtg 👋
I agree
What should we use instead?
And?
Well, IDK
I wouldn't actually have any problem with just shutting up and using JSON
people say verbose like it's a bad thing, it's not, it's ultra clear what is going on
Agreed
and that's why Java 8 is a good language
Verbose can be a good thing, look at FizzBuzz Enterprise Edition
There is too much but YAML went other direction with "Fuck it, I'll just guess"
NumberIsMultipleOfAnotherNumberVerifier.java
IntegerIntegerStringReturner.java
NoFizzNoBuzzStrategy.java
"no fizz no buzz"
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.factories;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.visitors.FizzBuzzOutputGenerationContextVisitor;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.OutputGenerationContextVisitorFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.visitors.OutputGenerationContextVisitor;
StringStringReturnerFactory.java
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.factories;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.stringreturners.IntegerIntegerStringReturner;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.IntegerStringReturnerFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.stringreturners.IntegerStringReturner;
/**
* Factory for IntegerIntegerStringReturner
*/
@Service
public class IntegerIntegerStringReturnerFactory implements
IntegerStringReturnerFactory {
private final IntegerIntegerStringReturner _integerIntegerStringReturner;
/**
* @param _integerIntegerStringReturner IntegerIntegerStringReturner
*/
@Autowired
public IntegerIntegerStringReturnerFactory(final IntegerIntegerStringReturner _integerIntegerStringReturner) {
super();
this._integerIntegerStringReturner = _integerIntegerStringReturner;
}
/**
* @return IntegerStringReturner
*/
@Override
public IntegerStringReturner createIntegerStringReturner() {
return this._integerIntegerStringReturner;
}
}
I see nothing wrong here
can't find any factory factories yet
There was a pull request for a factory factory factory
"increase" performance
https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/pull/478
should add alternative implementation with DSLs
from that one paper
are we sure it even can compile?
Next we need to make a front end in Angular.js
Not the new fancy Angular 2 that the kids are using these days, it's too new we can't be sure it works yet.
just use bash scripts and webhook endpoints written in php
perl
?
yes, was about to ask if webhook endpoints could be in cobol
Honestly why is this using Rest? It should be using SOAP. That way we can get the true enterprise feel
Maybe as a concession to the modern era we can integrate it with WSO2
@frank jay 👋
http-to-whatever-cobol-understand layer written in Ruby
don't forget to fall off while iterating over lists and handling exceptions instead of using for loops
because Ruby has (had) a feature of generating the full traceback even when unnecessary
Python doesn't explode when you throw StopIteration/IndexError
I would hope not
Ok I'll file a report in bugs.python.org then
ugh, the video died ("Bryan Cantrill: The Summer of RUST")
https://www.youtube.com/watch?v=LjFM8vw3pbU
this contained the reference to Ruby exploding on every single exception
RSS feed of JPEGs encoded in base85
@lunar haven You can shorten lines 15 and 27
https://www.ndbc.noaa.gov/faq/rss_access.shtml this is their api
well taking into account 0 == False returns True
actually, let's test that
!e
assert 0 == False
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
True
@willow light :warning: Your 3.11 eval job has completed with return code 0.
[No output]
!e
print(False == 0)
print(True == 1)
print(int(False))
print(int(True))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | True
002 | True
003 | 0
004 | 1
!e
match True:
case int():
print('int')
case bool():
print('bool')
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
int
!e
assert False
@willow light :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | assert False
004 | AssertionError
situation taken from some actual code
Don't get me started on actual code I've seen in production
# validation.py
assert(1==1)
!e
print(issubclass(bool, int))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
True
import requests
import os
url = os.path.join("https://jsonplaceholder.com", "get")
r = requests.get(url).json()
actual code in production right now
speaking of yield
#voice-chat-text-0 message
I only yield to pedestrians
oh, I think I can simplify that code
@lunar haven So what're you currently working on/what're you stuck on, etc.
!e
def empty():
return
yield
def one(item):
yield item
def repeat(item):
while True: yield item # pep8n't
def repeat_ones(item):
while True: yield one(item) # pep8n't
def _join(it0, it1):
yield from next(it0)
yield from next(it1)
def join(it0, it1):
while True: yield _join(it0, it1) # pep8n't
def listify(it):
ls = repeat(empty())
for item in it:
ls = join(ls, repeat_ones(item))
yield from ls
arr = listify([1, 2, 3])
print(*next(arr))
print(*next(arr))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1 2 3
002 | 1 2 3
All good all good
it works
Just wondering if there was anything I could help with
linked list implemented with yield
very wrong
def empty():
return
yield
yes
!e
def example():
yield
print(next(example()))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
None
!e
def example():
msg = yield
print('message: ', msg)
print(next(example()))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
None
eh
need to next() once more
!e
def example():
msg = yield
print('message: ', msg)
yield msg
g = example()
print(next(g))
print(next(g))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | None
002 | message: None
003 | None
!e
def example():
yield (yield)
g = example()
print(next(g))
print(next(g))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | None
002 | None
!e
def example():
yield (yield 1)
g = example()
print(next(g))
print(g.send(2))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | 2
!e
def example():
yield (yield 1)
g = example()
print(g.send(None))
print(g.send(2))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | 2
so
g.send(None) is equivalent to next(g)
when you dog.send(x), yield evaluates to x
!e
def double():
request = yield
while True:
response = 2 * request
request = yield response
g = double()
g.send(None)
print(g.send(1))
print(g.send(2))
print(g.send("3"))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 2
002 | 4
003 | 33
@whole bear 👋
Check out the #voice-verification channel
That'll tell you what you need to know about the voice gate
Lua has a similar thing with the coroutines
https://www.lua.org/manual/5.4/manual.html#2.6
initial send(None) is to start it
because value can be sent into only after something was yielded
they pass arguments from the first resume (send) call as arguments to the function that the coroutine is made from
is the game made by you?
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
A delightful language with friendly error messages, great performance, small assets, and no runtime exceptions.
this sounds like a good idea to make a language of
only yield, next, while True, for
and functions, I guess
to some extent
I wonder if it's enough to implement a queue
yield from probably too
at least it should include the related optimisations
Damn it, I'm getting discouraged again
Looking at the Elm repo and there hasn't been a main commit since September
maybe also .send
with .send queues should be implementable
what browser?
what do you run HTML on?
hi
IndexedDB is a low-level API for client-side storage of significant amounts of structured data, including files/blobs. This API uses indexes to enable high-performance searches of this data. While Web Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. IndexedDB provides a solut...
I studied English today.
While working part-time..
Don't overload yourself.
if it involves databases, it probably should be on the back-end not in HTML
I don't have time to study except for my part-time job. I want someone to teach me English next to me.
Fair.
Kind of hard without knowing Korean, though
Because I'd assume you'd need some common ground
like, with what you're describing there, you should consider the following
if the database is in the "HTML part", user can change absolutely anything as they choose to
Now I can use the microphone and I'm still chatting because I'm scared.
there's JWT-like stuff with encryption but it's not omnipotent
No need to be scared. We're patient. There's plenty of non-native English speakers here
You give me a sense of relief.
if you want to ban someone, it's way way easier to do that server-side
And more reliable
We aim to be welcoming to everyone. And like I said before, if you ever need us to repeat what we said or want clarification on meaning, don't hesitate to ask
quite obfuscated, not really code anymore
it's not the source file of the site
it's a compiled site
(just to make sure you understand that)
Thank you. I will try to talk a lot even if it is difficult to improve my English skills.
I'll finish my job and join the channel
Source code: Lib/pprint.py
The pprint module provides a capability to “pretty-print” arbitrary Python data structures in a form which can be used as input to the interpreter. If the formatted structures include objects which are not fundamental Python types, the representation may not be loadable. This may be the case if objects such as files, sockets or classes are included, as well as many other objects which are not representable as Python literals.
The formatted representation keeps objects on a single line if it can, and breaks them onto multiple lines if they don’t fit within the allowed width. Construct PrettyPrinter objects explicitly if you need to adjust the width constraint.
Similar names: ipython.pprint, django.pprint
I can't brain
what even is MonadFailAny
why did I name it like that
(trying to make Future of a Result work in some ways that Result works)
syntax error?
case _ if x >= 90:
...
@lunar haven case _ if not case if
pattern part is always required
and _ is the catch-all pattern
case <pattern>[ if <condition>]:
...
if-elif-else might be better for this case
not in this language
pattern matching
if there's any need to destructure data or check types, I tend to use match
if, on the other hand, the task is strictly conditional, then, usually, if-elif-else chains are better for Python
if x >= 90:
...
elif x >= 80:
...
elif x >= 70:
...
elif x >= 65:
...
else:
...
ML/Haskell derivatives often have better ways to match values in this form
C# has relational patterns:
string WaterState(int tempInFahrenheit) =>
tempInFahrenheit switch
{
(> 32) and (< 212) => "liquid",
< 32 => "solid",
> 212 => "gas",
32 => "solid/liquid transition",
212 => "liquid / gas transition",
};
which I find neat
ah, yes x is > 0 and < 10 thing, I forgot
I guess, my brain just considered C#'s new switch an ML derivative in that regard because F# exists
(C# 8 being "new")
that's 2019
semantic versioning
(which neither projects actually follow)
major.minor.patch
major -- breaking changes
minor -- backwards-compatible
patch -- forwards-compatible
Fahrenheit 🤮
time to see how much wrong my untested code is
!e
import bisect
grades = [
(65, 0, "D"),
(70, 0, "C"),
(80, 0, "B"),
(90, 0, "A"),
]
def grade_of(score: int) -> str:
ix = bisect.bisect_right(grades, (score, 1))
if ix:
*_, grade = grades[ix - 1]
return grade
else:
return "F"
print(grade_of(64), grade_of(65), grade_of(66))
print(grade_of(69), grade_of(70), grade_of(71))
print(grade_of(79), grade_of(80), grade_of(81))
print(grade_of(89), grade_of(90), grade_of(91))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | F D D
002 | D C C
003 | C B B
004 | B A A
less than 100 wpm, definitely
I also make mistakes often
typewriters had limits on typing speed to avoid jamming
(same reason why common letters are somewhat far apart)
that one is a separate machine
phonetics-based machine to record speeches
stenotype/stenograph
The website of the California Official Court Reporters Association (COCRA) gives the official record for American English as 375 wpm.
180~225 is considered normal with it
because you later have to spend time decoding parts of the text
(stenotypes do not use normal letter sets)
60,592
316,179