#voice-chat-text-0
1 messages · Page 123 of 1
I've learnt a bit about like the implementation of Functors and Applicatives in haskell, it's pretty interesting. I feel like I have learnt about this from Rust before but just never understood the Haskell language
I still have quite a serious question about Functors in Rust due to lifetimes
I don't mean not understood the syntax but yk like the words 'Functor' and 'Applicative' I feels like they over-complicate the idea
they're simple terms and familiar terms if you come from C.T. background
C.T.?
@lunar haven
Category Theory
oh yeah ig
Applicative is actually quite an important thing
for (some) IO/Async monads that, for example, represents parallel execution
Like, I'm sure it's some fucking setting somewhere that's got confused, but I've tried a whole bunch of sensible things and it hasn't shifted it.
It's not like I changed anything.
The IO Monad was the bane of my existence when I started writing haskell
and the fact that you can derive Applicative from Monad shows that you can do parallel execution consecutively if you wish to
I've given the headphones a thorough resetting. I think it's the phone, but I can't be sure.
The bluetooth audio mode setting looks right, and it's what it was before.
Hi @manic badger
Hello
The only different thing I did was, in a somewhat unrelated matter, pair the phone to an older dongle, which I've since unpaired.
wrong (doesn't work)
pub trait WeakFunctor {
type F<A>;
}
first correct option
pub trait WeakFunctor {
type F<'a, A: 'a>: 'a
where
Self: 'a;
}
second correct option
pub trait WeakFunctor<'a>: 'a {
type F<A: 'a>: 'a;
}
Not so as to satisfy that purpose.
Utopia Series
Season 01
Trailer.
Created & Written by
Dennis Kelly
Produced by
Rebekah Wray-Rogers
Directed by
Marc Munden
2013
lol
re: 20 minutes
#funny #cow #laugh
Copyright Disclaimer under Section 107 of the copyright act 1976, allowance is made for fair use for purposes such as criticism, comment, news reporting, scholarship, and research. Fair use is a use permitted by copyright statute that might otherwise be infringing. Non-profit, educational or personal use tips the balance in fa...
hello, fellow animal enthusiasts
🍅
can't speak yet, and general chat is too chaotic
I suppose streaming also takes into account the 50 messages, huh
Video role is separate
: o
he
YEHA
I MEAN
usinga bus ehh
maybe they arent american
potatoies in the oven?
@lucid blade Was able to listen to a confirmed recording from the bluetooth mic, it sounds ordinary, but not muffled.
I'm having difficulty dealing with it emotionally.
That's not a joke.
yeah the customers are usually overbuying them
This scene.
If you know it.
Moriarty is introduced as her boyfriend. Sherlock takes one look at him and says the above.
Moriarty deliberately dressed as he did to play a trick on Sherlock.
BBL
@somber heath this, to me, sounds like how phones generally treat audio during "calls"
This is different. It's behaving differently.
for example, when I have both a call and a music on, music just goes over-the-edge loud and low quality
@midnight agate
a game of "guess which ones compile and which don't"
fn narrow_aa_ab<'a: 'b, 'b>(f: &'a dyn FnOnce() -> Something<'a>) -> &'a dyn FnOnce() -> Something<'b> {
f
}
fn narrow_aa_ba<'a: 'b, 'b>(f: &'a dyn FnOnce() -> Something<'a>) -> &'b dyn FnOnce() -> Something<'a> {
f
}
fn narrow_ab_bb<'a: 'b, 'b>(f: &'a dyn FnOnce() -> Something<'b>) -> &'b dyn FnOnce() -> Something<'b> {
f
}
fn narrow_ba_bb<'a: 'b, 'b>(f: &'b dyn FnOnce() -> Something<'a>) -> &'b dyn FnOnce() -> Something<'b> {
f
}
fn narrow_aa_bb<'a: 'b, 'b>(f: &'a dyn FnOnce() -> Something<'a>) -> &'b dyn FnOnce() -> Something<'b> {
narrow_ab_bb(narrow_aa_ab(f))
}
still can't figure out why this works the way it does
Something<'a> is covariant over 'a
(so it can just be &'a usize, for example)
I had it defined as this
struct Something<'a>(&'a usize);
Yooo👋🏻
all (any) errors are expected to happen inside the body, yes
yes
doesn't depend on Fn/FnOnce
first one works, yes
yes
second is actually simpler to the compiler
I think
because it doesn't involve the closure's return type covariance
yes, 3 by the same logic as 2
&'a T -> &'b T with T being a black box
1: compiles
2: compiles
3: compiles
3, yes, compiles
4 doesn't compile
there's never &mut
not yet sure if the reason for 4 failing is correct
anyone familiar with python3 internals?
I'm really not sure
Define internals.
is there any possible way to convert a code object back to AST in python?
3.8 specifically
probably not
sadge
there's also this
fn narrow_aa_ab<'a: 'b, 'b>(f: &'a dyn FnOnce() -> Something<'a>) -> &'a dyn FnOnce() -> Something<'b> {
let f: &'a dyn FnOnce() -> Something<'b> = f;
todo!()
}
fn narrow_aa_bb<'a: 'b, 'b>(f: &'a dyn FnOnce() -> Something<'a>) -> &'b dyn FnOnce() -> Something<'b> {
let f: &'a dyn FnOnce() -> Something<'b> = f;
todo!()
}
second fails
whereas conversion from AST to Python is since some recent version
3.9 maybe
I don't remember
!d ast.unparse
ast.unparse(ast_obj)```
Unparse an [`ast.AST`](https://docs.python.org/3/library/ast.html#ast.AST "ast.AST") object and generate a string with code that would produce an equivalent [`ast.AST`](https://docs.python.org/3/library/ast.html#ast.AST "ast.AST") object if parsed back with [`ast.parse()`](https://docs.python.org/3/library/ast.html#ast.parse "ast.parse").
Warning
The produced code string will not necessarily be equal to the original code that generated the [`ast.AST`](https://docs.python.org/3/library/ast.html#ast.AST "ast.AST") object (without any compiler optimizations, such as constant tuples/frozensets).
Warning
Trying to unparse a highly complex expression would result with [`RecursionError`](https://docs.python.org/3/library/exceptions.html#RecursionError "RecursionError").
New in version 3.9.
yeah ik that but the one im looking for is converting a code obj to AST
@lunar haven no objects are copied automatically
!e
s = object() # or any other object
def f(x):
print(id(x))
print(id(s))
f(s)
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 140202950508880
002 | 140202950508880
these will always match
I think @viscid lagoon has bookmarks or something
@midnight agate there is this
for saving messages
!e
import ast
def my_func():
x = 1
y = 2
z = x + y
return z
code_obj = my_func.__code__
ast_obj = ast.parse(code_obj)
print(ast_obj)
@cosmic lark :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 11, in <module>
003 | ast_obj = ast.parse(code_obj)
004 | ^^^^^^^^^^^^^^^^^^^
005 | File "/usr/local/lib/python3.11/ast.py", line 50, in parse
006 | return compile(source, filename, mode, flags,
007 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
008 | TypeError: compile() arg 1 must be a string, bytes or AST object
!e
import ast
import dis
def my_func():
x = 1
y = 2
z = x + y
return z
code_obj = my_func.__code__
code_string = dis.Bytecode(code_obj).dis()
ast_obj = ast.parse(code_string)
print(ast_obj)
@cosmic lark :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 14, in <module>
003 | ast_obj = ast.parse(code_string)
004 | ^^^^^^^^^^^^^^^^^^^^^^
005 | File "/usr/local/lib/python3.11/ast.py", line 50, in parse
006 | return compile(source, filename, mode, flags,
007 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
008 | File "<unknown>", line 1
009 | 4 0 RESUME 0
010 | IndentationError: unexpected indent
!e
import ast
def my_func():
x = 1
y = 2
z = x + y
return z
code_obj = my_func.__code__
ast_obj = ast.parse(code_obj.co_code)
print(ast_obj)
oof
@cosmic lark :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 11, in <module>
003 | ast_obj = ast.parse(code_obj.co_code)
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | File "/usr/local/lib/python3.11/ast.py", line 50, in parse
006 | return compile(source, filename, mode, flags,
007 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
008 | ValueError: source code string cannot contain null bytes
!e
def my_func():
x = 1
y = 2
z = x + y
return z
print(eval(my_func.__code__))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
3
surprisingly, it somewhat works
hmm
not the parsing part
but at least the execution
!e
def my_func(_a):
x = 1
y = 2
z = x + y
return z
print(eval(my_func.__code__))
@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 7, in <module>
003 | print(eval(my_func.__code__))
004 | ^^^^^^^^^^^^^^^^^^^^^^
005 | TypeError: my_func() missing 1 required positional argument: '_a'
my_func(1).__code__
!e
from functools import partial
def my_func(x):
y = 2
z = x + y
return z
print(eval(partial(my_func, 1).__code__))
@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 8, in <module>
003 | print(eval(partial(my_func, 1).__code__))
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | AttributeError: 'functools.partial' object has no attribute '__code__'. Did you mean: '__call__'?
eh
!e
from functools import partial
def my_func(x):
y = 2
z = x + y
return z
print(eval((lambda: my_func(1)).__code__))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
3
;-;
if the goal is to pack code for execution, then compile+exec/eval
if there's any need to get the text of the program, it's simpler to just store it in non-compiled form
im reversing a pyc file lol, so i dont have the original source code
do you have permission for that?
i have the code obj so, i think if i can get it to the AST i can unparse it and get the og source
@lunar haven i wanna be good as @wind raptor in coding
yoo
Meanwhile I’m being a software engineer: weekends spent outside and avoiding the computer whenever possible.
@desert vector
#include <stdio.h>
int main() {
/* printf({'c','o','d','e','\0'}); */
printf("code");
}
#include <stdio.h>
int main() {
// This does work
char buf[5] = {'c','o','d','e','\0'};
puts(buf);
// This does not
puts({'c','o','d','e','\0'});
return 0;
}
@whole bear
does that work?
puts((char *) {'c','o','d','e','\0'});
nah, segfaults
@desert vector got it thanks
markdown+git
@lunar haven GitHub and other providers have preview for Markdown
and even local link support
also
mdbook
epic thing
that's what Rust book is compiled with
it produces a site not a pdf
or just have things stored in markdown
with editor being that
@lunar haven https://www.reddit.com/r/Notion/comments/pqb9gu/does_anyone_have_a_method_for_document_control/
5 votes and 3 comments so far on Reddit
this is in Gitea
but it can be done in GitHub/GitLab too
or just write your own thing
"gittion"
empty files?
that's a new level of Whitespace PL
there's also Overleaf if at any point you actually want PDF at some point
add pre-processors to convert text to emojis
with mdbook
@brazen gazelle are you using any IDE?
without IDE integration, then just git cli commands
they're quite easy to use
I don't like auto-add
As developers, we are no strangers to managing and saving various code copies before joining it to the main code. A version control system is a system that allows developers to track file changes. Version control systems are not limited to text files; they can track even changes in binary data. How To Install and Use Git On Linux for Beginners i...
is this doc fine?
does it include everything I would need?
class A:
def __init__(self, val):
self.val = val
obj = A(5)
obj.val # 5
perfect thanks
@turbid sandal
@turbid sandal
this is a stupid way to write the above:
class A:
pass
obj = A()
obj.val = 5
print(obj.val)
In this Python Object-Oriented Tutorial, we will begin our series by learning how to create and use classes within Python. Classes allow us to logically group our data and functions in a way that is easy to reuse and also easy to build upon if need be. Let's get started.
Python OOP 1 - Classes and Instances - https://youtu.be/ZDa-Z5JzLYM
Python...
the course in whole is somewhat old, but not irrelevant
i like the way he explains classes
!stream 1053732836693258391
✅ @turbid sandal can now stream until <t:1682798602:f>.
it's all good LX :D
hey help me i miatkenly added an excusion in error lens extension in vs code i want to remove it but i cant find it
Hey. Your best bet is probably to ask in #1035199133436354600. See #❓|how-to-get-help
im having issues with string index errors
Sorry, not sure how to solve that one.
im super new to python, is anyone willing to have a 1 on 1 with me to help
oh well chatgpt helped me thank you btw
lunix
Hey. Feel free to post your question here or in #1035199133436354600
by tinus lorvalds
Ah it might be that your working directly is set differently each time you run it @formal horizon
Whoops wrong ping sorry 😓
@turbid sandal 
Chuck Severance is a great name 😄
¯_(ツ)_/¯
Just sounds cool

Some more videos if you need them: https://youtube.com/playlist?list=PLnpfWqvEvRCdaYN3XjpfSKdbzFHHStzIM
any playlist to learn data structure using python there should be practical implementation of codes too in the tutorial
?
Not sure about videos, but Khan Academy have some nice intro algorithms content: https://www.khanacademy.org/computing/computer-science/algorithms
Maybe also take a look at: https://cs50.harvard.edu/x/2023/
Yoo
I have no idea why the compilation fails
like, at all
I just know it fails
and I'm still trying to figure out
there are some non-trivial ways in which outputs/inputs of the function are connected
that code
it works with fn but not with dyn Fn
I can't be sure it's not a deficiency in rustc
though, well, I do have a hint of why some other case fails
fn narrow<'a: 'b, 'b>(f: impl FnOnce() -> Something<'a>) -> impl FnOnce() -> Something<'b> {
f
}
for simple implementations of deque
!d collections.deque
class collections.deque([iterable[, maxlen]])```
Returns a new deque object initialized left-to-right (using [`append()`](https://docs.python.org/3/library/collections.html#collections.deque.append "collections.deque.append")) with data from *iterable*. If *iterable* is not specified, the new deque is empty.
Deques are a generalization of stacks and queues (the name is pronounced “deck” and is short for “double-ended queue”). Deques support thread-safe, memory efficient appends and pops from either side of the deque with approximately the same O(1) performance in either direction.
Though [`list`](https://docs.python.org/3/library/stdtypes.html#list "list") objects support similar operations, they are optimized for fast fixed-length operations and incur O(n) memory movement costs for `pop(0)` and `insert(0, v)` operations which change both the size and position of the underlying data representation.
something that behaves like this
it's more efficient (and more possible) sometimes to use a circular buffer for that
rustc and clippy are fighting
clippy wants to replace ||f() with f or *f, which causes compilation error
fn narrow<'a: 'b, 'b>(f: Box<dyn 'a + FnOnce() -> Something<'a>>) -> Box<dyn 'b + FnOnce() -> Something<'b>> {
Box::new(||f())
}
* 9.0/5.0 places too much faith into compiler optimisations
it should almost certainly be * 1.8
or * (9.0/5.0) with parentheses included explicitly
(celsius * 9.0) / 5.0 and celsius * (9.0 / 5.0) may give different results
so compiler might not optimise 9/5 away as 1.8
/is a more expensive operation
computationally (more CPU cycles)
though
in this particular case, given it's a constant, the compiler might replace /5.0 with *0.2
which it hopefully does
if you know the exact coefficient, use it instead of multiplying twice
as in common sense
celsius * 9.0 / 5.0
(celsius * 9.0) / 5.0
(celsius * 9.0) * 0.2
celsius * (9.0 / 5.0)
celsius * 1.8
first one is what's in the code
and it's less accurate
Ubuntu is great at segfaulting on calling ls
@midnight agate Wildebeest
lacking Solaris/BSD representation
I was planning to install illumos once
I failed
it was more than once
time to make that "only" qualifier properly accurate
i m going crazy
coding is very hard
even for simple things
somebody can help me?
ok i m in a job where it s only repetitive tasks
if i can automatise all of this
i could just wach movies or going sport
instead of being a robot
i m poor
i need to send money to my family
no no very hard situation
if i continue to do it
i will go crazy
too much robot tasks
too much time lost
ask chatgpt
if somebody help me to code i will tell u the secret of love
i m going LOCOOOOO
bro it s very hard to me
even the week end i wor
work
i worked straight 4 hours
to solve this problem
i m too dumb
the thing is i m stupid litteraly
1 minute of your time
is better than 4 hours of my time
because i m stupid
ye ye letter from chat gpt
Dear [Name],
I hope this letter finds you well. As I sit down to write this, my heart is filled with love and affection for you. It's been a while since we last saw each other, but I want you to know that you are always on my mind and in my heart.
You have brought so much joy and happiness into my life, and I can't imagine my life without you. You have been my rock, my support, and my confidant. You have stood by me through thick and thin, and I am forever grateful for that.
I want you to know that I love you more than words could ever express. You are the sunshine in my life, the reason I wake up every morning with a smile on my face. You make me feel alive and give me a sense of purpose.
I promise to always be there for you, to love and cherish you, and to support you in all your dreams and aspirations. I want to spend the rest of my life with you, growing old together and sharing every moment of our lives.
Thank you for being the love of my life. I look forward to seeing you soon.
Forever yours,
[Your Name]
ok help me now
i take a lot of time
to write it
yes yes bro bro
bro
BUT BRO
Bro....
True friend
help
i think we can help us together
ze can u tell to deblock me pls
👋
yes it was very tough tool
hi @vivid palm~
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:0-3.11",
"features": {
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"version": "latest",
"helm": "latest",
"minikube": "none"
},
"ghcr.io/devcontainers/features/powershell:1": {
"version": "latest"
}
},
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind",
"source=${env:HOME}${env:USERPROFILE}/.kube,target=/home/vscode/.kube,type=bind"
],
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements.txt",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-vscode.powershell",
"eamodio.gitlens",
"ms-kubernetes-tools.vscode-kubernetes-tools"
]
}
}
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}```
hi
!voice @rapid ridge
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Wrong room, my bad. Point stands.
A methodology for building modern, scalable, maintainable software-as-a-service apps.
hi
Hi
!kindling
The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
Thank you very much!
I don't know any commands here😅
how to make a code wait for x sec?
(a few seconds)
I heard you use something like time.sleep
so you need import a module for it?
and also my internet sucks and I cant hear a single thing
So noted.
tkinter?
But yes. You can use time.sleep, but if you're using tkinter, you'll want to be using tkinter.Tk.after method.
So as to schedule a callback after the specified amount of time.
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
Thank you
@cerulean sphinx👋
@whole bear 👋
!e
import requests
resoult = requests.get("https://google.com")
print(resoult.text)
@somber smelt :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 requests
004 | ModuleNotFoundError: No module named 'requests'
This code does not work for me
I would like to know a way to render html using python without tkinterhtml
When loading google.com, I get the error:
Exception in Tkinter callback
Traceback (most rec...
.
@vernal halo 👋
@ocean tapir 👋
👋 @somber heath
@lyric jay 👋
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@worthy breach 👋
🖖
@hazy phoenix 👋
hes saying humans are a force of bad
how are the ways you use chatgpt
opal and plome
or dev if ur here
try gptgo ai
its a cool hybrid site
how do you do gentlemen
its a rather splendid evening
Food, at the time of enquiry.
@stoic ore hi hi!
Chilly
But I have noodles and tea
Marsala
Chai, chai marsala
Cinnamon, cloves, cardamom, tea, sugar, milk of choice. I'm a soy boy.
Pepper and nutmeg, as a twist
We've the spices, yes
Honey is a popular sweetener for it
I find the flavour overtakes the spiders
Spices
Australian things.
Funny typo I could have corrected
Decided to not
Night in common area.
I'll speak in a bit
@whole bear 👋
In functional programming, a monad is a structure that combines program fragments (functions) and wraps their return values in a type with additional computation. In addition to defining a wrapping monadic type, monads define two operators: one to wrap a value in the monad type, and another to compose together functions that output values of the...
how kind to link us
I felt like at least pretending I could be useful in this conversation.
functor and applicative?
can someone link us some doctumention
can we use chatgpt to figure this out
ChatGPT can be used to generate search terms you can then go on to research from more reliable resources.
It is not to be taken at its word, however convincing it sounds.
it can show us examples
@vagrant estuary 👋
Hello
everyone sells out at a price
show us
write us examples
for monad so we can pin it
anyone have any code snippets to share
chatgpt is so fucking bad at monads that it's categorically useless
in Python terms for Awaitable monad:
Functor:
g(await fa)
Applicative:
await asyncio.gather(fa, fb)
Monad:
await g(await fa)
fmap, liftA2, bind
minimal definition in Rust
pub trait Functor {
type F<'a, A: 'a>: 'a
where
Self: 'a;
fn fmap<'a, A: 'a, B: 'a>(f: impl 'a + FnOnce(A) -> B, fa: Self::F<'a, A>) -> Self::F<'a, B>
where
Self: 'a;
}
pub trait Applicative: Functor {
fn pure<'a, A: 'a>(a: A) -> Self::F<'a, A>
where
Self: 'a;
fn liftA2<'a, A: 'a, B: 'a, C: 'a>(
f: impl 'a + FnOnce(A, B) -> C,
fa: Self::F<'a, A>,
fb: Self::F<'a, B>,
) -> Self::F<'a, C>
where
Self: 'a;
}
pub trait Monad: Applicative {
fn bind<'a, A: 'a, B: 'a>(
fa: Self::F<'a, A>,
f: impl 'a + FnOnce(A) -> Self::F<'a, B>,
) -> Self::F<'a, B>
where
Self: 'a;
}
you can attempt doing that in Python, but it's not going to go well
Hello Guys!
something like this, maybe
class T(Generic[A]):
def map(self, f: Callable[[A], B]) -> T[B]:
raise NotImplementedError
def bind(self, f: Callable[[A], T[B]]) -> T[B]:
raise NotImplementedError
class AsyncT(T[A], Generic[A]):
def __init__(self, awaitable: Awaitable[A]) -> None:
self.awaitable = awaitable
@classmethod
def wrap(cls, a: A) -> T[A]:
async def resolve() -> A:
return a
return AsyncT(resolve())
def map(self, f: Callable[[A], B]) -> T[B]:
async def resolve() -> B:
return f(await self.awaitable)
return AsyncT(resolve())
def bind(self, f: Callable[[A], T[B]]) -> T[B]:
async def resolve() -> B:
match f(await self.awaitable):
case AsyncT(awaitable=awaitable):
return await awaitable
case PureT(value=value):
return value
case _:
raise TypeError("mixed contexts")
return AsyncT(resolve())
class PureT(T[A], Generic[A]):
def __init__(self, value: A) -> None:
self.value = value
def map(self, f: Callable[[A], B]) -> T[B]:
return PureT(f(self.value))
def bind(self, f: Callable[[A], T[B]]) -> T[B]:
return f(self.value)
to whom is that a response?
I love lifetimes /s
oh
a question there
yeah bro!
there is an option to move 'a into being a trait parameter, but it's sometimes less flexible
@steep juniper @stoic ore never rely on ChatGPT
it's not a teacher
it will just fucking lie to you
it always fucking does
no, you won't understand
quite often
the only language where you can say "it's working therefore it's not wrong" is something like Haskell/Rust
good luck claiming your C code works if it "works"
it's not a teacher. it. just. isn't.
a wild suggestion:
just read the documentation
it can pretend to be one
useblackbox . io
very convincingly, but it has literal zero responsibility for what it says
if (!strcmp(str[0], "r")) {}
if(!strcmp(name[0], "R") == 0 || !strcmp(name[0], "r") == 0){
^~~~~~~
&
Create a function which answers the question "Are you playing banjo?".
If your name starts with the letter "R" or lower case "r", you are playing banjo!
The function takes a name as its only argument, and returns one of the following strings:
name + " plays banjo"
name + " does not play banjo"
Names given are always valid strings.
WHAT LANGAUGES DO YOU GUYS KNOW
bash c c# html javascript css python ruby c++ java
what are projects you can show me to make with gptgo.ai
char *are_you_playing_banjo(const char *name) {
if(strcmp(&name[0], "R") == 0 || strcmp(&name[0], "r") == 0){
return ("%s plays banjo", name);
}
return ("%s does not play banjo", name);
}
solution.c:6:13: warning: expression result unused [-Wunused-value]
return ("%s plays banjo", name);
^~~~~~~~~~~~~~~~
#define TRUE 0
#define FALSE 1
#include <stdbool.h>
Create a function which answers the question "Are you playing banjo?".
If your name starts with the letter "R" or lower case "r", you are playing banjo!
The function takes a name as its only argument, and returns one of the following strings:
name + " plays banjo"
name + " does not play banjo"
Names given are always valid strings.
Here's a simplified version of the code:
char are_you_playing_banjo(const char* name) {
if(name[0] == 'r' || name[0] == 'R') {
return "plays banjo";
}
return "does not play banjo";
}
This code takes in a string pointer name, checks if the first character is either 'r' or 'R', and returns a string indicating whether or not the person plays banjo. Note that since the function returns a character, the "plays banjo" and "does not play banjo" strings do not have the %s format specifier.
solution.c:6:13: warning: expression result unused [-Wunused-value]
return ("%s plays banjo", name);
^~~~~~~~~~~~~~~~
solution.c:6:12: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
return ("%s plays banjo", name);
^~~~~~~~~~~~~~~~~~~~~~~~
solution.c:8:11: warning: expression result unused [-Wunused-value]
return ("%s does not play banjo", name);
^~~~~~~~~~~~~~~~~~~~~~~~
solution.c:8:10: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
return ("%s does not play banjo", name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.
why are you doing 5m
function are_you_playing_banjo(name) {
if (name[0] === 'r' || name[0] === 'R') {
return 'plays banjo';
}
return 'does not play banjo';
}
javascript
what are you
going to send
share it with the class
one day they will give me voice
what is a python script everyone should know by now
@hazy phoenix Say "Let me in!"
"Let me in!"
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
Try now.
i did 50 messages
it works
finally
hi
in league?
wood 1
A regrettable necessity.
@median quarry 👋
hi hi
void __cdecl main_main()
{
__int64 v0; // rbx
__int64 v1; // rax
__int64 v2; // rax
__int64 v3; // rax
__int64 v4; // [rsp+8h] [rbp-48h]
_QWORD *v5; // [rsp+8h] [rbp-48h]
__int64 v6; // [rsp+8h] [rbp-48h]
__int64 v7; // [rsp+10h] [rbp-40h]
__int64 v8; // [rsp+18h] [rbp-38h]
__int64 v9; // [rsp+20h] [rbp-30h]
__int64 v10; // [rsp+28h] [rbp-28h]
__int64 v11; // [rsp+30h] [rbp-20h]
void *retaddr; // [rsp+50h] [rbp+0h] BYREF
while ( 1 )
{
if ( (unsigned __int64)&retaddr <= *(_QWORD *)(*(_QWORD *)NtCurrentTeb()->NtTib.ArbitraryUserPointer + 16LL) )
goto LABEL_14;
runtime_newobject((__int64)&unk_4F8E40, v4);
v5[1] = 4LL;
*v5 = "GSOD";
v5[3] = 4LL;
v5[2] = "GSOD";
v5[5] = 4LL;
v5[4] = "GSOD";
github_com_kardianos_service_New((__int64)&off_527320, (__int64)&unk_5EF510, (__int64)v5);
v0 = v11;
if ( !v10 )
break;
v1 = *(_QWORD *)(v10 + 8);
LABEL_13:
runtime_gopanic(v1, v0);
LABEL_14:
runtime_morestack_noctxt();
}
(*(void (__golang **)())(v8 + 32))();
v2 = v9;
v0 = 0LL;
qword_5BD540 = v7;
if ( dword_5EF590 )
v2 = runtime_gcWriteBarrierCX();
else
qword_5BD548 = v8;
if ( v2 )
{
v3 = *(_QWORD *)(v2 + 8);
LABEL_12:
runtime_gopanic(v3, 0LL);
goto LABEL_13;
}
v6 = (*(__int64 (__golang **)())(v8 + 56))();
if ( v6 )
{
runtime_gopanic(*(_QWORD *)(v6 + 8), v7);
goto LABEL_12;
}
}
unk_4F8E40
double click on this function
hola @whole bear
right now Yibtag is disassembling a virus and analyzing it to find out its purpose
hes running all of this on a vm
thats amzing
I'm new to coding I know some python and I'm learning C now
bruhhh
we are on the same plate then
// implementation of new builtin
// compiler (both frontend and SSA backend) knows the signature
// of this function.
func newobject(typ *_type) unsafe.Pointer {
return mallocgc(typ.size, typ, true)
}
I just started c recently
command: gunicorn -w 4 --threads 2 --bind 0.0.0.0:8010 --chdir Microservices/satellite-1 wsgi
cd Microservice/satellite-1 wsgi
then run
yeah in docker.yml
WORKDIR /Microservice
&off_527320, (__int64)&unk_5EF510,
void __golang main___ptr_NTDLL__bsod(__int64 a1)
{
_QWORD *v1; // [rsp+8h] [rbp-48h]
__int64 v2; // [rsp+8h] [rbp-48h]
__int64 v3; // [rsp+40h] [rbp-10h]
__int64 v4; // [rsp+40h] [rbp-10h]
void *retaddr; // [rsp+50h] [rbp+0h] BYREF
while ( (unsigned __int64)&retaddr <= *(_QWORD *)(*(_QWORD *)NtCurrentTeb()->NtTib.ArbitraryUserPointer + 16LL) )
runtime_morestack_noctxt();
v3 = runtime_newobject((__int64)&unk_4E1320);
v1 = (_QWORD *)runtime_newobject((__int64)" ");
*v1 = 19LL;
v1[1] = 1LL;
v1[2] = 0LL;
v1[3] = v3;
golang_org_x_sys_windows___ptr_LazyProc__Call(*(_QWORD *)(a1 + 8), (__int64)v1, 4LL, 4LL);
v4 = runtime_newobject((__int64)&unk_4E12A0);
v2 = runtime_newobject((__int64)"0");
*(_QWORD *)v2 = 3221225477LL;
*(_OWORD *)(v2 + 8) = 0LL;
*(_QWORD *)(v2 + 24) = 0LL;
*(_QWORD *)(v2 + 32) = 6LL;
*(_QWORD *)(v2 + 40) = v4;
golang_org_x_sys_windows___ptr_LazyProc__Call(*(_QWORD *)(a1 + 16), v2, 6LL, 6LL);
}
GSOD
to insert a discord script already provided, I have to do it with a bot, it's impossible to do it on the terminal, if there isn't a bot to host the script, is that it?
// Membership //
Want to learn all about cyber-security and become an ethical hacker? Join this channel now to gain access into exclusive ethical hacking videos by clicking this link: https://www.youtube.com/channel/UC1szFCBUWXY3ESff8dJjjzw/join
// Courses //
Full Ethical Hacking Course: https://www.udemy.com/course/full-web-ethical-hacking-cou...
Yooooo
-= LEARN =-Everything in a computer can be constructed from a basic component called a NAND gate. You will be challenged through a series of puzzles, to discover the path from NAND gates to arithmetic, memory and all the way to full CPU architectures. If you complete this game, you will have a deep understanding of how assembly, CPU instruction ...
$19.99
1401
Yoo
one day, I will be awesome enough to have a universe in my name
hi
fine
yes please
still no audio
cant hear you well
Can not
negative
i mean the voice is deep
co clear voice of you
as if your talking under water
now is fine
i get testing
hahaha
ok
yes clear
now it is fine
"testin recording 12."
bug?
may be
but your recording is not meant to be noise
try stop streaming and record again?
mono is output
your recording is input
now record
your voice
okay
now it works
so the problem is when you record while streaming it overlaps
okay
yes
no
to be sure
stop the voice metering
and try again
this will cut the doubt out
can you stream and talk without using the voice meter?
I think you can
yes
it is moving means it is getting data as input
but the output is distorted
48000Hz
16bits
it means 16 samples/sec
not clear
yes
but not clear at all
what is VAIO?
i can hear it
but it so fast
no problem
fast x1000
:p
no problem
I may watch it alone
it is increasing exponentially
:p
ok slower now
getting faster
:p
what
the video
I mean its speed
ok
the volume is fine
higher
:p
can you send me the link of the video?
thank you
tyt
wb
a multimodal ai assistant
@wind raptor can i get stream perms ?
Could you please give me screen share?
@jolly terrace ssh 84X4GEFdUMagphEqh49m6BagC@sgp1.tmate.io
ssh ro-BCYCXVe24tADYrXsLYCpncGvp@sgp1.tmate.io
@cedar briar
@wind raptor can you reigive me, i left by accident
c[0] == *c
wtf
why am i a caveman here?
jacob sorber
#define DEFINE_C_NODE_INTERFACE(type) \
typedef struct C_Node C_##type##_NodeInterface; \
struct C_##type##_NodeInterface; { \
union {C_Node *node, ##type## value} as; \
}; \
\
void C_NodeInterface_insert(C_Node *tree, NodeInterface *node); \
void C_NodeInterface_is_empty(C_Node *tree); \
const char *C_NodeInterface_print(C_Node *tree); \
type C_NodeInterface_get(int n);
like this
tild
` <-- three of these
squiggly boi is tild
`
+ abc
- your mom
#include <string.h>
char *are_you_playing_banjo(const char *name) {
int i = name[0];
if(strcmp(i, "R") == 0 || strcmp(i, "r") == 0){
char *yp = ("%s plays banjo", name);
return yp;
}
char *np = ("%s does not play banjo", name);
return np;
}
int main(){
return 0;
}
#include <stdlib.h>
#include <string.h>
char *are_you_playing_banjo(const char *name) {
int i = name[0];
if(strcmp(i, "R") == 0 || strcmp(i, "r") == 0){
char *yp = ("%s plays banjo", name);
return yp;
}
char *np = ("%s does not play banjo", name);
return np;
}
int main(){
return 0;
}
.
@wind raptor Stream permissions ?
char *yp = malloc(sizeof *yp);```
// sexy example by lux
int *lol()
{
int *a = malloc(sizeof *a);
*a=12;
return a;
free(a);
}
int *lol()
{
int *a = malloc(sizeof *a);
*a=12;
return a;
}
void x() {
int *x = lol();
}
int main() {
x();
}
basically
pointer stays in memory
after use
the address*
IPv6 World view:
. o ( Look, Ma! No hands!)
O
_| <-- /127 (Extremely anal,
, / \ possibly dangerous transfernets)
,
XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX <-- /128 (Loopbacks)
^ ^ ^^^ ^ ^ ^ ^ ^ ^ \
| | ||| | | | | | | --- /126 (Anal transfernets)
/8 /16 ||| | | | | | \ /112 (Less anal Transfernets)
HERE ||| | | | | \ /96 (V4 LANs, an abandoned utopia)
BE ||| | | | \ /80 (Screw EUI-64)
BOGONS! ||| | | \ /64 (End-user LAN, incl. Co-Lo)
||| | \ /56 (Residential end-user, multi-LAN)
||| \ /48 (End-user per-site assignment)
||\ /32 (RIR PA assignment)
|\ /28 (Big RIR PA assignment)
\ /24 (Much argued 6RD assignment)
German (formal) : Ich liebe Sie (rarely used)
German : Ich liebe dich
: Ich hab' dich lieb
: Ich hab dich lieb (not so classic and
conservative)
German dialects:
Bavarian (Bayrisch) : I moag di gern
(Bavaria/Bayern) : I mog di (right answer: "I di a")
: I lieb di
Berlin dialect : Ick liebe dir (Old, very old)
(Berlinerisch) : Ick liebe Dich
Berner-Deutsch : Ig liebe di
Bochumer : Ich lieb Dich!
Franconian (Fra"nkisch): Du gfa"llsd mer fai
(Franconia/Franken) : Bisd scho mai gouds freggerla (already in a
relationship)
: Mid dier ma"cherd ich a amol (sexually
touched, ment as a compliment, not litterally)
(the above 3 entries really mean "I like you",
a Franke would never say "I love you")
Friesian (Friesisch) : Ik hou fan dei (sp?)
: Ik hald fan dei
Hessian (Hessisch) : Isch habb disch libb
Ostfriesisch : Ick heb di leev
Saarla"ndisch : Isch hann disch lieb
Saxon (Sa"chsisch) : Isch liebdsch
Swabian (Schwa"bisch) : I mog di fei sauma"ssich (Literally "I like
you like a pig.")
: I mog di ganz arg (More formal, literally
"I like you very much!")
Swiss German : Ch'ha di ga"rn
(Schweizerdeutsch)
Vorarlberg dialect : I stand total uf di
(Vorarlbergerisch)```
# TO: All Employees
# From: Management
# Subject: Special High Intensity Training
#
# In order to ensure the highest levels of quality of work from our
# employees, it will be our policy to keep employees well trained
# through our program of Special High Intensity Training (S.H.I.T).
#
# We are trying to give employees more S.H.I.T. than any other
# company.
#
# If you feel that you do not get your share of S.H.I.T. on the job,
# please see your manager. You will immediately be placed at the top
# of the S.H.I.T. list, and our managers are especially skilled at seeing
# that you get all the S.H.I.T. you can handle.
#
# Employees who don't take their S.H.I.T. will be placed in the
# Departmental Employee Evaluation Program (D.E.E.P.S.H.I.T.). Those
# who fail to take the D.E.E.P.S.H.I.T. seriously will have to go on
# the Employee Attitude Training (E.A.T.S.H.I.T.). Since our managers
# took S.H.I.T. before they were promoted, they don't have to do
# S.H.I.T. anymore, and are full of S.H.I.T. already.
#
# If you are full of S.H.I.T. you may be interested in the job of
# training others. We can add your name to our Basic Understanding Lecture
# List (B.U.L.L.S.H.I.T.). Those who are full of B.U.L.L.S.H.I.T. will
# get the S.H.I.T. jobs and can apply for a promotion to Director of
# Intensity Programs (D.I.P.S.H.I.T.).
#
# If you have any further questions, please direct them to our Head
# Of Training, Special High Intensity Training (H.O.T.S.H.I.T.).
#
# Signed,
# Boss In General, Special High Intensity Training
# (B.I.G.S.H.I.T.)```
adopt me
pls
:0
im doing an consult painel
with python
customtkinter
and requesting api's
can you help me ?
i can try but my skills arent that good in python yet
i know tkinter
im still learning apis
blocks, sir.
let's do traink in the house.
and he cainck! the who grinch sith out of the houst.
who as should we d we have
on the fish thein the was tont.
we stwo dos! do some sound fish,
and he called him on a rump.
when they sad.
"in ham if muth is with that this stop.
then he got a wall ir it the rain.
i do not like them, sam-i-am.
i was looking at a joke api to learn how to use it so i think i can do that easily now, but i want to learn how to build one
i want to make the button call a function and this API_ENDPOINT recive the entry1's content
entry1 = customtkinter.CTkEntry(master=frame,placeholder_text="digite o cep aqui!",width=300,font=font2).place(x=25,y=105)
label1 = customtkinter.CTkLabel(master=frame,text='*preencha o campo acima com o cep no estilo 00000000', font=font3,text_color='green').place(x=25,y=135)
button2 = customtkinter.CTkButton(master=frame, text='CONSULTAR CEP',width=300,command=lambda:consulta_cep(entry1.get())).place(x=25,y=200)
API_ENDPOINT = f'https://viacep.com.br/ws/{entry1}/json/'
is this like a premade api for testing program functionality
wow
would you like them
in a house.
i do not like them here?
oh you like them,
some good from he knew, the will shoen a littey care rump.
fox in socks on knox and knox, box in socks not.
bup of fook un come frumby yours do some.
wevery we sind a cain
LOL
but when i click the button and load the function it's returning me an error
i dont know why
is there a typo
/tts would you like them
in a house.
i do not like them here?
oh you like them,
some good from he knew, the will shoen a littey care rump.
fox in socks on knox and knox, box in socks not.
bup of fook un come frumby yours do some.
wevery we sind a cain
one says bentry and the other doesnt
self._command()
File "C:\Users\lorezz\Desktop\painel\main.py", line 83, in <lambda>
button2 = customtkinter.CTkButton(master=frame, text='CONSULTAR CEP',width=300,command=lambda:consulta_cep(entry1.get())).place(x=25,y=200)
^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
this error
okay
i love you
?
bcz the tkinter's style is suck
so i use the custom
this painel shouldnot work in other countrys
bcz its a painel that consult personal data of a person
yep
yep
not at all
im selling this painel
?
oh
i can convert .py into exe with vscode
wwwwww
i cant program in C languages
:(
C++
ez to learn
im sorry my english is not good
:(
i cant understand you some times
portugues
portugese
?
lol
its a little bit close to spanish
c++ is hard
Coding is Hard 
Coding while Hard 
i cant kickflip
i learned 5050 and boardslide
i skate in a park called madureira's skatepark
you can search
i tryed to jump a bottle of coke
i can
my ollie is very high
but
i forgot to slide my front foot
then i fall
and beat my face on the floor
very hard
!voiceverif
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Y’a des fr ?
don't spam.
a = """(It) (((2 's) (((2 a) ((3 lovely)"""
def CREER_ARBRE_AUX(lexer):
mot = []
nexter = 0
for i in range(len(lexer)):
if lexer[i+nexter].isalpha():
mot.append(lexer[i+nexter])
print(f"VAL ({mot})")
mot = []
elif lexer[i] == '(':
print("OPEN")
elif lexer[i] == ')':
print("CLOSE")
elif lexer[i].isdigit():
print(f"NUM ({lexer[i]})")
print(CREER_ARBRE_AUX(lexer))
!e ```py
a = (It) (((2 's) (((2 a) ((3 lovely)
print(a)
@somber heath :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | a = (It) (((2 's) (((2 a) ((3 lovely)
003 | ^
004 | SyntaxError: unterminated string literal (detected at line 1)
OPEN
VAL (['I'])
VAL (['t'])
CLOSE
OPEN
3.10.6
def CREER_ARBRE_AUX(lexer):
mot = []
nexter = 0
for i in range(len(lexer)):
if lexer[i+nexter].isalpha():
mot.append(lexer[i+nexter])
print(f"VAL ({mot})")
mot = []
elif lexer[i] == '(':
print("OPEN")
elif lexer[i] == ')':
print("CLOSE")
elif lexer[i].isdigit():
print(f"NUM ({lexer[i]})")
print(CREER_ARBRE_AUX(lexer))
'
OPEN
VAL (['I'])
VAL (['t'])
CLOSE
OPEN
OPEN
OPEN
NUM (2)
VAL (['s'])
CLOSE
I'll be on later, I have to 100% focus on getting my timesheets done
!stream 158991471733637120
✅ @vast light can now stream until <t:1682947751:f>.
thank you
lexer = """(It) (((2 's) (((2 a) ((3 lovely) (2 film))) ((2 with) (((3 lovely) (2 performances)) ((2 by) (((2 Buy) (2 and)) (2 Accorsi))))))) (2 .)))
(((1 No) (2 one)) (((2 goes) ((((2 unindicted) (2 here)) (2 ,)) ((2 which) (((2 is) (2 probably)) ((2 for) ((2 the) (4 best))))))) (2 .)))
((2 And) (((2 if) ((2 you) ((((2 're) (1 not)) (2 nearly)) (((3 moved) ((2 to) (1 tears))) ((2 by) (((2 a) (2 couple)) ((2 of) (2 scenes)))))))) ((2 ,) ((2 you) (((2 've) ((2 got) (((2 ice) (2 water)) ((2 in) ((2 your) (2 veins)))))) (2 .))))))
(((2 A) (((3 warm) (2 ,)) (3 funny))) ((2 ,) (((4 engaging) (2 film)) (2 .))))
(((2 Uses) ((((3 sharp) (((4 humor) (2 and)) (2 insight))) ((2 into) ((2 human) (2 nature)))) ((2 to) ((2 examine) ((2 class) (1 conflict)))))) ((2 ,) (((2 adolescent) (((2 yearning) (2 ,)) (((2 the) (2 roots)) ((2 of) ((2 friendship) ((2 and) ((2 sexual) (2 identity)))))))) (2 .))))
(((2 Half) ((((((2 Submarine) (2 flick)) (2 ,)) ((2 Half) ((2 Ghost) (2 Story)))) (2 ,)) ((2 All) ((2 in) ((2 one) (2 criminally)))))) ((1 neglected) (2 film)))
(((3 Entertains) ((2 by) ((2 providing) ((3 good) ((2 ,) ((3 lively) (2 company))))))) (2 .))
(((4 Dazzles) ((2 with) (((((((2 its) ((2 fully-written) (2 characters))) (2 ,)) ((2 its) ((2 determined) (3 stylishness)))) ((1 -LRB-) (((2 which) ((2 always) ((2 relates) ((2 to) (((2 characters) (2 and)) (2 story)))))) (3 -RRB-)))) (2 and)) ((((2 Johnny) ((2 Dankworth) (2 's))) ((4 best) (2 soundtrack))) ((2 in) (2 years)))))) (2 .))
(((((((3 Visually) (4 imaginative)) (2 ,)) ((3 thematically) (3 instructive))) (2 and)) ((2 thoroughly) (4 delightful))) ((2 ,) ((2 it) (((((2 takes) (3 us)) ((2 on) (((2 a) ((2 roller-coaster) (2 ride))) ((2 from) (2 innocence))))) ((2 to) ((2 experience) ((2 without) (((2 even) ((2 a) (3 hint))) ((2 of) ((2 that) ((1 typical) ((2 kiddie-flick) (2 sentimentality)))))))))) (2 .)))))
(((((2 Nothing) ((2 's) ((2 at) (((2 stake) (2 ,)) (((2 just) ((2 a) ((2 twisty) (2 double-cross)))) ((2 you) ((2 can) (((2 smell) ((2 a) (2 mile))) (2 away))))))))) (2 --)) ((2 still) ((2 ,) (((2 the) ((3 derivative) ((2 Nine) (2 Queens)))) ((2 is) ((2 lots) ((2 of) (4 fun)))))))) (2 .))"""
def CREER_ARBRE_AUX(lexer):
mot = []
nexter = 0
for i in range(len(lexer)):
if lexer[i+nexter].isalpha():
mot.append(lexer[i+nexter])
print(f"VAL ({mot})")
mot = []
elif lexer[i] == '(':
print("OPEN")
elif lexer[i] == ')':
print("CLOSE")
elif lexer[i].isdigit():
print(f"NUM ({lexer[i]})")
print(CREER_ARBRE_AUX(lexer))
!e
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
By default, your code is run on Python 3.11. A python_version arg of 3.10 can also be specified.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
@vast light :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | OPEN
002 | VAL (['I'])
003 | VAL (['t'])
004 | CLOSE
005 | OPEN
006 | OPEN
007 | OPEN
008 | NUM (2)
009 | VAL (['s'])
010 | CLOSE
011 | OPEN
... (truncated - too many lines)
Full output: too long to upload
I love it when updaters cause race conditions with themselves
SO cool how they do that
Not inconvenient at all
@elder sage If you're wondering why you can't talk, check out the #voice-verification channel
That'll tell you what you need to know about the voice gate
If you've heard this before, my bad
Just force of habit to mention it to folks
@vast lightI'm sitting down, now.
Ears on.
I won't talk for the moment.
@vast light clickclickclickclickclick
@gentle surge👋
In broad terms.
So I have a list
of string
if the string is == '('
I need to print OPEN
if ths string is == ')'
I need to print CLOSE
if the string is a number
a need to print NUM(n)
if the string is a word
i need to print VAL(word)
that's all
is it more accurate now ?
all seems to be working
Okay, well...if you say it's working...
noo
there's a problem
when there's a " ' "
and I'm not returning the hole word
002 | VAL (['I'])
003 | VAL (['t'])
It's supposed tu be VAL([ It ])
Hey Hemlock.
Is the issue just that you don't want the '?
Because you could use str.strip.
'
from string import ascii_letters, punctuation
letters_and_punc = ascii_letters + punctuation
a = "'"
if lexer[x].isalpha() or a
Source code: Lib/string.py
!e py import string print(dir(string)) print(string.ascii_lowercase)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | ['Formatter', 'Template', '_ChainMap', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_re', '_sentinel_dict', '_string', 'ascii_letters', 'ascii_lowercase', 'ascii_uppercase', 'capwords', 'digits', 'hexdigits', 'octdigits', 'printable', 'punctuation', 'whitespace']
002 | abcdefghijklmnopqrstuvwxyz
🎵 Hurdy-durdy hurdy-durdy hurdy-durdy man. 🍄
def CREER_ARBRE_AUX(lexer):
mot = []
nexter = 0
for i in range(len(lexer)):
if lexer[i+nexter].isalpha():
mot.append(lexer[i+nexter])
print(f"VAL ({mot})")
mot = []
@rugged root so how could I implement it to this?
did not want to cut your intense conversation
@midnight agate https://www.youtube.com/shorts/yZHBApD3kJs
What’s the point of this “hack”? 😂
🇬🇧 Ciao! We are Matteo and Emiliano. We are two Italian best friends, musicians, and content creators! Follow us for more content! :)
🇮🇹 Ciao! Siamo Emiliano e Matteo. Siamo due migliori amici, musicisti, e content creators di Roma. Iscriviti al canale per nuovi video ogni giorno :)
#shorts
SUBSCRIBE & F...
!stream 158991471733637120
✅ @vast light can now stream until <t:1682951970:f>.
from string import ascii_letters
chars_and_punctuation = ascii_letters + "',."
for i in range(len(lexer)):
if lexer[i+nexter] in chars_and_punctuation:
...
How goes it
good and y
Not too shabby
test = "(Hello World)"
i = 0
while i < len(test):
character = test[i]
match character:
case '(':
print("OpenParen")
i += 1
case ')':
print("CloseParen")
i += 1
case _:
word = ""
while i < len(test):
if test[i] in "()":
break
word += test[i]
i += 1
print(word)
this
str.isdigit()```
Return `True` if all characters in the string are digits and there is at least one character, `False` otherwise. Digits include decimal characters and digits that need special handling, such as the compatibility superscript digits. This covers digits which cannot be used to form numbers in base 10, like the Kharosthi numbers. Formally, a digit is a character that has the property value Numeric\_Type=Digit or Numeric\_Type=Decimal.
str.isdecimal()```
Return `True` if all characters in the string are decimal characters and there is at least one character, `False` otherwise. Decimal characters are those that can be used to form numbers in base 10, e.g. U+0660, ARABIC-INDIC DIGIT ZERO. Formally a decimal character is a character in the Unicode General Category “Nd”.
choose wisely between those two
test = "(Hello World)"
i = 0
while i < len(test):
character = test[i]
if chacacter == ')':
print("OpenParen")
i += 1
elif character == ')':
print("CloseParen")
i += 1
else:
word = ""
while i < len(test):
if test[i] in "()":
break
word += test[i]
i += 1
print(word)
what's c +
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
0
@midnight agate did you know this?
@midnight agate you still alive, man?
!e
print(int("١٢٣٤٥٦٧٨٩٠"))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
1234567890
What am I seeing?
!e
print(int("৪"))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
4
amazing
regularisation/normalisation
from non-0123456789 decimals
!d str.isnumeric
str.isnumeric()```
Return `True` if all characters in the string are numeric characters, and there is at least one character, `False` otherwise. Numeric characters include digit characters, and all characters that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. Formally, numeric characters are those with the property value Numeric\_Type=Digit, Numeric\_Type=Decimal or Numeric\_Type=Numeric.
@vast light are you looking for valid decimal digits?
or anything numeric at all?
like
!e
print("⅕".isnumeric())
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
True
@vast light
are you sure you want this to happen?
!e
# let's make it worse and mix different sets
print(int("١۲߃४৫੬૭୮௯౦"))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
1234567890
it's not a dot
it's a zero
@midnight agate it's not a dot, it's an Arabic zero
U+0660 is the unicode hex value of the character Arabic-Indic Digit Zero. Char U+0660, Encodings, HTML Entitys:٠,٠, UTF-8 (hex), UTF-16 (hex), UTF-32 (hex)
Hey Mustafa 👀
I never tried parsing s-expressions properly
GAUXGH!-nome.
You might just be consuming two ) each time instead of one?
Don't think so because it's working for everthing else
coffee fixes brain
What might help to debug is to have each token retain information about where it is in the code (i.e. line an column number).
Il will try to debug it
@molten pewter get your ass online
@obsidian dew make a language for music to program synths
Coffee makes me insane
coffee = neuronal accelerant
no
And it accelerates other things too if you drink too much 😄
it does , it does !!
brb
need to switch to sublime text , i have fresh install
!e
from itertools import pairwise
print(*pairwise('ABCDEFG'))
@quasi condor :white_check_mark: Your 3.11 eval job has completed with return code 0.
('A', 'B') ('B', 'C') ('C', 'D') ('D', 'E') ('E', 'F') ('F', 'G')
I only did some dumb subset looking like where anything text-ish is quoted and pair (text,nothing) is equivalent to text
and now, 17 months later, I discover a fatal bug in that code
each question requires - free pizza vouchers
!e ```py
def my_pairwise(iterable):
iterator = iter(iterable)
try:
current = next(iterator)
while True:
previous = current
current = next(iterator)
yield previous, current
except StopIteration:
return
print(*my_pairwise("ABCDEFG"))
@quasi condor :white_check_mark: Your 3.11 eval job has completed with return code 0.
('A', 'B') ('B', 'C') ('C', 'D') ('D', 'E') ('E', 'F') ('F', 'G')
!e py text = "ABCDEFG" print(*zip(text, text[1:]))
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
('A', 'B') ('B', 'C') ('C', 'D') ('D', 'E') ('E', 'F') ('F', 'G')
This is still nicest.
!e
from typing import Iterator, Iterable, Generic, TypeVar
T = TypeVar('T')
class pairwise(Iterator[tuple[T, T]], Generic[T]):
def __init__(self, it: Iterable[T]):
self.__it = iter(it)
def __next__(self) -> tuple[T, T]:
return next(self.__it), next(self.__it)
print(*pairwise([0,1,2,3]))
print(*pairwise([0,1,2,3,4]))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | (0, 1) (2, 3)
002 | (0, 1) (2, 3)
!e
from itertools import pairwise
print(type(pairwise([])))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
<class 'itertools.pairwise'>
oh, look, it's a class too, how surprising
I don't like use of % in any way
it just feels wrong
at least to me
but
% is fine
this will be sad in Rust
but this is not Rust
because, like, prev exists in two places for some time
I will try translating this into Rust
(I might fail)
struct Pairwise<T> {
it: T,
}
impl<T> Iterator for Pairwise<T>
where
T: Iterator,
{
type Item = (T::Item, T::Item);
fn next(&mut self) -> Option<Self::Item> {
Some((self.it.next()?, self.it.next()?))
}
}
failing can lead you to wonderful ideas sometimes...
without type hints
class pairwise:
def __init__(self, it):
self.it = iter(it)
def __next__(self):
return next(self.it), next(self.it)
@midnight agate yes please , more pieces of code - looking at itertools now - is shiny and new to me
!e
class _pairwise:
def __init__(self, it):
self.it = iter(it)
def __next__(self):
return next(self.it), next(self.it)
print(*_pairwise("ABCDEFG"))
print(*pairwise("ABCDEFG"))
@quasi condor :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 7, in <module>
003 | print(*pairwise("ABCDEFG"))
004 | TypeError: print() argument after * must be an iterable, not pairwise
I forgot to inherit the thing
class pairwise:
def __init__(self, it):
self.it = iter(it)
def __next__(self):
return next(self.it), next(self.it)
def __iter__(self):
return self
fixed
!e
class pairwise:
def __init__(self, it):
self.it = iter(it)
def __next__(self):
return next(self.it), next(self.it)
def __iter__(self):
return self
print(*pairwise("ABCDEFG"))
!e```py
class pairwise:
def init(self, it):
self.it = iter(it)
def __next__(self):
return next(self.it), next(self.it)
def __iter__(self):
return self
print(*pairwise("ABCDEFGH"))
@quasi condor :white_check_mark: Your 3.11 eval job has completed with return code 0.
('A', 'B') ('C', 'D') ('E', 'F') ('G', 'H')
thank you for help @rugged root ❤️
The classic implementation of pairwise is something like this: ```py
def pairwise(iterable):
it0, it1 = itertools.tee(iterable)
next(it1, None)
return zip(it0, it1)
and @stuck furnace and @vocal basin
I don't know what I did 😄
!e
def pairwise(it):
it = iter(it)
return zip(it, it)
print(*pairwise("abcd"))
print(*pairwise("abcde"))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | ('a', 'b') ('c', 'd')
002 | ('a', 'b') ('c', 'd')
!e
print(int("৪୨")) # answer to everything
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
42
13cm
buffer saturation -- im stealing that line
That's my near sighted limit past 13cm i cant see well
This is still legible... right?
Yep
if there was (for any reason) an acute need to shorten it, then, maybe use Bound::*?
though that might make things worse
Alisa i swear i saw you on the rust vc
Don't use single letter variable please
old habits die hard
contextually it can be inferred it's left-right
but l on its own is problematic on some fonts
because 1
I've written extremely cryptic stuff before
Even much worse than that
Lambda syntax
vertexShader : WebGL.Shader Vertex Uniforms { vcolor : Vec3 }
vertexShader =
[glsl|
attribute vec3 position;
attribute vec3 color;
uniform mat4 perspective;
varying vec3 vcolor;
void main () {
gl_Position = perspective * vec4(position, 1.0);
vcolor = color;
}
|]
Ooo
well, c/v is at least hypothetically legible
because it represents coerce/variant
unlike naming everything x,y,z,a,b,c,... without meaning
I guess... https://book.realworldhaskell.org/read/
Feels very niche
https://elm-lang.org/examples/triangle This should not be as mesmerizing as it is
Try out Elm: A delightful language with friendly error messages, great performance, small assets, and no runtime exceptions.
i/j are expected to be an index usually
so, excusable if used this way
Frankly, I taught myself PureScript w/ https://github.com/thomashoneyman/purescript-halogen-realworld before I actually became productive w/ Haskell
Debug.Trace is your friend in Haskell
I made myself re-implement Monad Haskell class in Rust as a trait
Yeah, that's understandable
the only visual thing I can show related to that is this one
(graph of memory access during testing whether one tree is a subset of another)
#voice-chat-text-0 message
so, like, that example uses some tracing-related monad to make those graphs
def shampoo(func):
return func
@shampoo
def func():
pass```It's a de-de-de-decorator.
I guess as an example of a "real" monad, https://www.fpcomplete.com/blog/2017/06/readert-design-pattern/
tl;dr just pass around a mutable reference to your app's state using a Reader
Maybe/Solo/IO vs List, when translated to Rust, are very different
update : Msg -> Model -> (Model, Cmd Msg)
update msg model =
case msg of
GotText result ->
case result of
Ok fullText ->
(Success fullText, Cmd.none)
Err _ ->
(Failure, Cmd.none)
@lavish rover you can make something generic over an abstract Monad
idk if that qualifies for a "mixin" or whatever
but, yes, generally you just don't need that
yes, interface in a quite broad sense
It's basically a type with two functions: unit and bind: ```py
def unit[T](value: T) -> MyMonad[T]:
...
def bind[A, B](
wrapped: MyMonad[A],
func: Callable[[A], B],
) -> MyMonad[B]:
...
Monads are functors
[T]? after function name?
Yeah it's new syntax in python 3.12.
This is a 1988 tv video commercial from Decore Shampoo-Australian and titled "The Family Shampoo". Hope you enjoyed the video and as always thanks so much for watching.
howdy
shorthand for typevar, ig
Well ain't that handy
I only learned about it myself a couple of days ago 😄
because first ones store at most one value
It's currently being implemented by Jelle
so you can fmap FnOnce not only Fn
always nice to find tools to speed things up
Yep. You can even define bounds: ```py
def fooT: SomeClass:
...
I guess in CPython, yeah
what about variance?
Errrm, I'm not sure.
But you could implement a runtime that makes use of hints to JIT compile optimized versions of a function specific to a type a la Node/V8
Ah, it's inferred.
Python Enhancement Proposals (PEPs)
time to ask this to @swift valley and @lavish rover too;
which of these looks more usable as a base for Functor?
(only included the type=>type part, not fmap)
pub trait Wrapper {
type Wrapped<'a, A: 'a>: 'a
where
Self: 'a;
}
pub trait Wrapper<'a>: 'a {
type Wrapped<A: 'a>: 'a;
}
(lifetimes are required for, e.g., Rust's equivalents of IO monad like Pin<Box<dyn 'a + Future<Output=A>>>)
Turing Complete
that game
-= LEARN =-Everything in a computer can be constructed from a basic component called a NAND gate. You will be challenged through a series of puzzles, to discover the path from NAND gates to arithmetic, memory and all the way to full CPU architectures. If you complete this game, you will have a deep understanding of how assembly, CPU instruction ...
$19.99
1401
@somber smelt this?
yes
I didn't go through this game in full because got distracted by some other things
and never got back to it
the journey , not the destination ?
Amnesia: The Dark Descent, Amnesia: Machine for Pigs, SOMA.
worse than horror
https://store.steampowered.com/app/2138700/Crypt/
If you've found this game by chance through Steam, I advise you not to play it.My name is Valefisk, and I'm a YouTuber. I made this game as a joke - it's not designed to be fun, but to be awful to play. And in this it succeeds.This version that has found its way to Steam is slightly different from the one in the original video. This one is beata...
Theif, Thief 2
remembered that movie idea
#voice-chat-text-0 message
gtg 👋
japanese dont like ghosts
hello
so if you have a hologram projector -- japan is the place for you
openheimer - played by christopher walken ....
@woeful wyvern or just use one thread responsible for the db and communicate to that thread via something else
or just two DBs, yes
@woeful wyvern there is a per-db lock
there are more granular ones, but the main one exists at least for some time, so you will get throttled sometimes
