#voice-chat-text-0
1 messages · Page 347 of 1
idk
hmm
it doesn't pass them from outside world is what the issue is
@sour imp I'd pick PySide instead because it's made by Qt
I made it less confusing but no less scary
6
hei#t • ftoat(irvutCEnter heiht value: •
Width • widthWatue: • i)
doth • •
• • width • Épth
of the is', units•)
thanks, OCR
I'm just gathering more reasons to uninstall this one
and not install another
@primal shadow there's way more to GitHub profile than commit history
discussions, issues, PRs
that's the important part
also
push history
push history is tracked differently
you can't fake it in one day
write your program here
height = float(input("Enter height value: "))
width= float(input("Enter width value: ")) depth float(input("Enter depth value: "))
volume height width depth *depth
6 print("The volume of the cuboid is", volume, "cubic units")
2```
That's waht the googs did from a bad cameraphone photo of my monitor
you need to copy another person's activity for the lifetime of the project
@verbal zenith it shouldn't be 0
it should be same as indent
see here
or here
depending on which you like better
#include <iostream>
#include <vector>
#include <string>
// Assuming the Token structure is already defined as in your lexer.
enum TokenType { TK_Identifier, TK_Argument, TK_String, TK_Flag };
struct Token {
TokenType type;
std::string value; // Change from char* to std::string for easier management
};
struct Command {
std::string name;
std::vector<std::string> flags;
std::vector<std::string> arguments;
};
Command parse(const std::vector<Token>& tokens) {
Command cmd;
size_t i = 0;
// The first token should be the command name (identifier)
if (tokens[i].type == TK_Identifier) {
cmd.name = tokens[i].value;
i++;
} else {
std::cerr << "[parse] Error: Expected command identifier at start." << std::endl;
exit(1);
}
// Process remaining tokens
while (i < tokens.size()) {
if (tokens[i].type == TK_Flag) {
cmd.flags.push_back(tokens[i].value);
} else if (tokens[i].type == TK_Argument || tokens[i].type == TK_String) {
cmd.arguments.push_back(tokens[i].value);
} else {
std::cerr << "[parse] Error: Unexpected token type." << std::endl;
exit(1);
}
i++;
}
return cmd;
}
int main() {
// Example input
std::string input = "command -flag1 -flag2 \"argument with spaces\" arg2";
// Lex the input string
std::vector<Token> tokens;
lex(input, tokens); // Assuming lex fills the tokens vector
// Parse the tokens into a command structure
Command cmd = parse(tokens);
// Output the parsed command
std::cout << "Command: " << cmd.name << std::endl;
std::cout << "Flags: ";
for (const auto& flag : cmd.flags) {
std::cout << flag << " ";
}
std::cout << std::endl;
std::cout << "Arguments: ";
for (const auto& arg : cmd.arguments) {
std::cout << arg << " ";
}
std::cout << std::endl;
return 0;
}
no, that's deque
.push
just to make it clear ig
consistency between the two
surprising given it's C++
which can't even keep consistency across different std::vectors
well
(std::vector<bool> is different and wrong)
cmd [arg|flag]*
cmd [arg]* [flag]*
cmd [flag]* [arg]*
command agruments flags
command -f something -o somethingelse 1 2 3
"if you're making a bit set, might as well name it something reminiscent of bit set; like, idk, for example, bitset"
it's template-level specialisation
nightly Rust can theoretically do that too, I think
command arg1 arg2 arg3 flag1 flag2 flag3
-f [file]
@whole bear AND ANOTHER ONE HELPED LETS GO!
-d
Stahp itttttt not in public!
@sour imp "the ultimate flex is to have been programming for so long you can't even remember when you started"
>starting with Java
idk if that's better or worse than Pascal
uh
I saw punched cards, and I'm not that old
☭☭☭
or whatever
> vector operations
mongo mentioned
@sour imp @whole bear
!rule 10x dev
I'm on that 6 jokes in a row streak
☭
@whole bear that's just countable infinity
In mathematics, particularly in set theory, the aleph numbers are a sequence of numbers used to represent the cardinality (or size) of infinite sets that can be well-ordered. They were introduced by the mathematician Georg Cantor and are named after the symbol he used to denote them, the Hebrew letter aleph (ℵ).
The cardinality of the natural nu...
merely the number of integers
Graham's number is an immense number that arose as an upper bound on the answer of a problem in the mathematical field of Ramsey theory. It is much larger than many other large numbers such as Skewes's number and Moser's number, both of which are in turn much larger than a googolplex. As with these, it is so large that the observable universe is...
just +1 it
max_int++;
so should probably be aiming for "density" instead (size per bits needed to describe in some formal way)
"per" obviously not being just division
Alisa Feistel, is there a reason why you don't talk in vc?
multiple
what are those reasons, if I may ask?
Hello
whassap
Another beautiful day
are you from poland?
Originally
your name reminds me of polish
it is a polish name
I do the clicky clacks
whats that
click clack on the ⌨️
I smack mine hoping whatever output I get works lololol
know is a strong word, but I quite enjoy Python
Hello there @turbid swallow,
and welcome to the Python Community Discord! Please check out #code-help-voice-text to get permission to talk in the voice channels, and have a careful read of our #rules!
-Nerd Bear
(DM's open for help, and use #1035199133436354600 or #python-discussion channels for general help)
What’s python like the snake? 🐍
Is that like an ATM? Machine
how long have u been learnin
All The Mods?
Over 4 years since I first dove in
On the bright side, if you keep it going, you're as bad as you're gonna get
i know some things
would u mind if i ask u how old are u
a millenial
He meant a million lololol
yes
!stream 1028671867785068574
✅ @whole bear can now stream until <t:1724716294:f>.
.xkcd 927
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
!stream 1028671867785068574
✅ @whole bear can now stream until <t:1724717888:f>.
✅ @whole bear can now stream until <t:1724720651:f>.
Star Wars IV made in ASCII by http://asciimation.co.nz/
@deep shore 👋
hello
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@whole bear 👋
hi!
@uncut lynx welcome
@whole bear 👋
Hi
+1
@wind raptor you ever get around to that puzzle?
+2
I recently learned how to use rust with python, it's pretty neat
+3
I benchmarked a fibonacci function written about the same in both python and rust, and the rust was running in like 5 micro seconds, with python runnning in like 10 nano seconds
@fossil yarrow 👋
hello
Okay no spamming
no... 🙂 just learning from python master 🙂
Maybe like python MOJO
use pyo3::prelude::*;
fn matrix_mult(a: [[u64; 2]; 2], b: [[u64; 2]; 2]) -> [[u64; 2]; 2] {
[
[
a[0][0] * b[0][0] + a[0][1] * b[1][0],
a[0][0] * b[0][1] + a[0][1] * b[1][1],
],
[
a[1][0] * b[0][0] + a[1][1] * b[1][0],
a[1][0] * b[0][1] + a[1][1] * b[1][1],
],
]
}
fn matrix_pow(mut m: [[u64; 2]; 2], mut power: u64) -> [[u64; 2]; 2] {
let mut result = [[1, 0], [0, 1]]; // Identity matrix
while power > 0 {
if power % 2 == 1 {
result = matrix_mult(result, m);
}
m = matrix_mult(m, m);
power /= 2;
}
result
}
#[pyfunction]
fn fibonacci(n: u64) -> u64 {
if n == 0 {
return 0;
}
let m = [[1, 1], [1, 0]];
let result = matrix_pow(m, n - 1);
result[0][0]
}
#[pymodule]
fn fib_lib(py: Python, m: &PyModule) -> PyResult<()> {
m.add_function(wrap_pyfunction!(fibonacci, m)?)?;
Ok(())
}
this is the rust python function
@steep harness 👋
hello
just wandering around
server
interested in python
and planning to learn it
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Spamming Spamming Everywhere 🤣
oh yes, for this, try reading the "byte of python" book
i feel it gives the best overview and coverage of fundamental concepts to the language
thank you for the sources
"Me am from US guvment! Pay me yur tax money in iTune gift cards er else"
what got you guys into coding in the first place?
well i do some cybersecurity and I have seen some things that require python and also it's just a overall good language to know .
i'll be heading out now
thank you all for the sources
byeee
I was watching Dr Mike about some hosptitals getting hacked and shit, all I could think was if it's so private of info, why not switch the OS to like Arch, Gentoo, Kali, something more secure.
I see a lot of hospitals use windows XP maybe 7.
If I see my hospital running Kali, I'm finding a different hospital.
LOL I dunno, I'm just mentioning OS' that have strong security (this is what google told me)
if my hospital runs arch, i'm going to walk out of the ER
At.
?
People swear at Arch.
people swear at arch
oh lol
why the hell does Mutahar love it?
I checked it out, it wasn't for me.
If I ever go back to linux it would likely be Mint for me.
besides, I would think windows overall would just have better support for 90% of the software running there
true
not trusting the AUR to run my respiratory bypass machine
Problem is that for some reason hospitals are cheap on that stuff.
Well my life support system runs on TempleOS.
I C that you value holiness in your recovery
LMAO wow it's been a while sense I googled "best gaming linux" and I see a new things have popped up. Ever sense Pop_OS!
Manjaro, Lakka, drauger, Garuda
@wraith stirrup 👋
Are you referring to this app
https://crisp.chat/en/
Discover our Business Messaging Platform for Startups & SMBs. The one-stop for sales, marketing & support in one platform: Crisp. 14-day free trial. No credit card required. Try now! We provide Knowledge base, Team Inbox, Chatbot, CRM and multiple other features to let you build your own way to customer success.
@wary maple 👋
aih=ght yall, ima head out, no escaping furries tho. or vtubers shudder
be seein' ya
!stream 154425749221146624
✅ @terse rose can now stream until <t:1724734345:f>.
@wind raptor why i can see python legacy help system in mobile?
its just unnecessary
nvm i read #changelog message
def update(self) -> None:
""" Update the circuit given the modified circuit log.
Usage
-----
>>> circuit.update()
"""
converted_circuit = self.convert(type(self))
self.circuit = converted_circuit.circuit
self.measured_qubits = converted_circuit.measured_qubits
# Update the measurement keys (This is for `qickit.circuit.CirqCircuit` only)
if hasattr(self, "measurement_keys"):
self.measurement_keys: list[str] = converted_circuit.measurement_keys
def update(self) -> None:
""" Update the circuit given the modified circuit log.
Usage
-----
>>> circuit.update()
"""
converted_circuit = self.convert(type(self))
self.__dict__.update(converted_circuit.__dict__)
def update(self) -> None:
""" Update the circuit given the modified circuit log.
Usage
-----
>>> circuit.update()
"""
# Set the flag to False as we do not need to reprocess the gate parameters
self.process_gate_params_flag = False
converted_circuit = self.convert(type(self))
self.__dict__.update(converted_circuit.__dict__)
self.process_gate_params_flag = True
def convert(self,
circuit_framework: Type[Circuit]) -> Circuit:
""" Convert the circuit to another circuit framework.
Parameters
----------
`circuit_framework` : type[qickit.circuit.Circuit]
The circuit framework to convert to.
Returns
-------
`converted_circuit` : qickit.circuit.Circuit
The converted circuit.
Usage
-----
>>> converted_circuit = circuit.convert(circuit_framework=QiskitCircuit)
"""
# Define the new circuit using the provided framework
converted_circuit = circuit_framework(self.num_qubits)
# Iterate over the gate log and apply corresponding gates in the new framework
for gate_info in self.circuit_log:
# Extract gate name and remove it from gate_info for kwargs
gate_name = gate_info.pop("gate", None)
# Use the gate mapping to apply the corresponding gate with remaining kwargs
getattr(converted_circuit, gate_name)(**gate_info)
# Re-insert gate name into gate_info if needed elsewhere
gate_info["gate"] = gate_name
return converted_circuit
def MCS(self,
control_indices: int | Sequence[int],
target_indices: int | Sequence[int]) -> None:
""" Apply a Multi-Controlled Clifford-S gate to the circuit.
Parameters
----------
`control_indices` : int | Sequence[int]
The index of the control qubit(s).
`target_indices` : int | Sequence[int]
The index of the target qubit(s).
Raises
------
TypeError
Qubit index must be an integer.
ValueError
Qubit index out of range.
Usage
-----
>>> circuit.MCS(control_indices=0, target_indices=1)
>>> circuit.MCS(control_indices=0, target_indices=[1, 2])
>>> circuit.MCS(control_indices=[0, 1], target_indices=2)
>>> circuit.MCS(control_indices=[0, 1], target_indices=[2, 3])
"""
self.process_gate_params(gate=self.MCS.__name__, params=locals().copy())
self._controlled_qubit_gate(gate="S", control_indices=control_indices, target_indices=target_indices)
def process_gate_params(self,
gate: str,
params: dict) -> None:
""" Process the gate parameters for the circuit.
Parameters
----------
`gate` : str
The gate to apply to the circuit.
`params` : dict
The parameters of the gate.
Usage
-----
>>> self.process_gate_params(gate="X", params={"qubit_indices": 0})
"""
if not self.process_gate_params_flag:
return
# Remove the "self" key from the dictionary to avoid the inclusion of str(circuit)
# in the circuit log
params.pop("self", None)
for name, value in params.items():
value = self._convert_param_type(value)
value = self._validate_qubit_index(name, value)
if value is None:
continue
value = self._validate_angle(name, value)
# Indicate no operation needed
if value is None:
return
params[name] = value
self.circuit_log.append({"gate": gate, **params})
why I'm suppressed to talk ? 🙂
This server's voice chat has a gating system. See #voice-verification for information.
I see thanks man
The frequency and intensity of voice trolling, screaming, slurs, etc, got to be such that something which required an investment of social interaction and of patience was needed and it proved to be effective at keeping our ears largely unmolested.
That makes sense
hi @heady cypress
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
hi @austere hornet
hello
@obsidian dragon Yep
I am working on my calculator and I am stuck
What?
GUI
tkinter?
No. PySide6
@quaint gull
hi @pulsar shale
Hi
opal and milien aren't here tonight 🙃
Writing a novel in word?
@quaint gull Please stop dm-ing, you can message in here.
89% done!
almost there huh
lol
Sei
@sage patio 
im suspenede
@meager sentinel 
from speaking why
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Read the embed above
I suppressed myself on purpose by leaving and rejoining the server just then lmao
Interesting music 
They left

hell no we all saw that
hi
stop trying to play it off
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
posting n**** like that 😭
!mute 418483453160325122
wait 50 messages
:incoming_envelope: :ok_hand: applied timeout to @meager sentinel until <t:1724764282:f> (1 hour).
Thank god
oh yeah cat elf girl
it's some cute fanart though
@formal cedar 
nvm 🥲
lmao
my wallpaper image: (migu)
@stray sparrow @vocal basin 
somehow I have the same wallpaper I had 5 years ago
though it actually wasn't continuously same
ooh I've seen that Frieren sniper fanart in the astolfo cult server before
lol
Nice counting
I read a book that was called the curious incident of the dog in the night time
and since the narrator's point of view was of someone with asperger's, the chapter numbers were the prime numbers iirc
dnd type book
with sims logic
from what I've read from your book
Breakfast -> Some person came back from a court hearing? -> Dragon fight
Alisa's emojis in the about me:
Better Call Lesbian
and then the 1st of September 275760 embedded
you're in GMT+3 or more Eastern than that?
@whole bear 👋
+6
no +8
... Western Australia.
in more Western timezones it fails to display
(this is wrong)
hmm
I'm too lazy to change system time to test that
invalid date for some, in 273736 years for others
<t:8639998952399:R>
and explain the emojis lol
there's a 3x3 one but it doesn't fit
well, at least, that fits the pfp 
and the previous pfp too
(previous was this, for context)
@upper basin at what
Are you not streaming?
Why bother with the model
@still herald 👋
@versed heath 👋
qickit/synthesis/unitarypreparation.py:54: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
qickit/synthesis/unitarypreparation.py:96: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
Opal/Milien still not here 😭
no non-overload version?
this has happened before
Like I have to add an additional abstract method that's not overloaded?
yes
I'd do it @obsidian dragon
afair the answer last time was to just union
@upper basin only overload on abstractmethod might be ending up in that method not being actually present in the base class
canonical pfp is the one I have on GitHub
Me? Hypercritical?
sure
@earnest crag 👋
principle (?)
don't you mean principal?
unless you have some concept that has been manifested into existence and not some principal of a school
you?!
I think so
principal vs principle
@upper basin you have the same return type, you don't need an overload
also same number of arguments
the most important or senior person in an organization or group vs a fundamental truth or proposition that serves as the foundation for a system of belief or behaviour or for a chain of reasoning.
there is no extra constraint that overloads promise
Unless you have a character that literally is a principle that's been manifested into 3d existence somehow
I have different types of parameters, one is NDArray, the other is my builtin Operator.
plain union argument is easier for LSPs and, imo, some humans to understand
So, overload is useless here?
union is enough and doesn't sacrifice any typing information
I see. I'll remove it then. Thank you very much for spotting it!
btw Osyra does capitalisation count as spell checking
overloads are more for "behaves differently" than "takes various values"
i.e. multiple functions under same name rather than pre-processing conversions inside the same function
Right, I think I totally forgot about that hehe.
also, ... (line 2)
the year was 2000... (line 5)
there are cases where union, overloads and generics do similar things
some examples of probably many mistakes
Also like you must be an English major because idk this word and it sounds fancy
ger a plum
Ooh milien is finally here!
if it can't pass mypy it won't be finished ever
Capitalise the T for The...
(The year was 2000)
10th line of the page you're currently on
Line 16 of the same page:
ger a plum
my callouts 😭
lmao
Hehehe
It's sth I'm still actively figuring out.
punctuation
comma after great
cheery is correct
oh ig all of your speaking bits are wrong
wrong punctuation 😭
- "Yeah, it was great." in a cheery voice.
+ "Yeah, it was great," [she said] in a cheery voice.
^ two edits made... one after "great" and the she said bit
Also you have some weird tense changes in the speaking bits too
funny sentence
from about chapter 7 the text goes from past tense to present
i like the rpg-ness the book starts to adopt near the mid 20 something chapters
Biology class in chapter 2, some dungeons and dragons type stuff in chapter... 30 ish
Doesn't mypy understand if-else?
He sat down insert comma please took his backpack off...
Did me weekend go well?
...
OPAL!!!!
They never got off the bus 😭
plot hole
but they were still on the bus
(I'm back; phone call happened suddenly)
Took the not out of her pocket
Shove if in her hand 
Also what's a "ting"
You never explained it
plot hole 😭
what's a ting 😭
first appearance of ting
there's more 😭
How to disable mypy check for a specific directory?
Ok I'm going to bed with this brain damage
gn... @obsidian dragon you better fix these 
@tidal stream 👋
Sha 256
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Can't hear nobody 😦 what's going on
hellow
Pasta is chasing about their bit.
umm?
OK audio is working on mobile but not here I wonder why
now fix my stories
whats going on?
Why writing manually
hello !
@solemn saddle 👋
Join my discord to see for yourself
https://discord.gg/mUYTdwXB7v
I'm so burnt out on web development after 10 years. That's why im getting into python honestly
same. I thought jquery was lang at one point 😅 then ES6 came out and so much js on the front end that i was like fuck it, i'll go full stack dev
problem with being full stack dev is you get 4x the responsibilites and often less pay.
sorry my wifi is very jittery
now create a character voice @whole bear
lol like become a lama vtuber?
Ah, an Entomologist.
remote computing to access GPUs @sour imp
very cool
CBC French TV channels wouldnt censor movies or shows , allowed nudity - its a incentive to learn french
yaba dabba doo , opensource
did you look at , mojo python , can it be applied to AI research @whole bear
I've heard of mojo but I haven't used it. 100% down to learn it though
What is the best model for coding that's free and accessible through Continue?
its for GPUs , AI and BIG data - @whole bear
I heard you can use it jupyter too
I dont know enough about advanced coding to test MOJO and give opinion @whole bear
same
I want to do coding for small scale parallel systems
half-way to vc, 25 messages to go
heard GROK 2.0 , has no limitations @whole bear
define no limits
also the quality of their models has never been very good for what i do
point taken , less limits than others
ya , you mentioned , specifically trained to application
I do want to try Groq's propoganda machine though aka uncensored image gen
@frozen owl what kinda ML stuff are you doing?
big yes
building autograd lib
although usually i do reinforcement learning
i see @sour imp
shit my wifi keeps cutting this is annoying af
Yeah, i know Elon and his team haven't released their own models. I didn't know they used flux, but that makes sense. I believe you can run flux locally just like any of their other models aside from whisper i think
Shoot.
my understanding is grok is on x, and Groq builds ASIC infrastructure for groq
this
ok maybe im wrong
Grokking refers to a sharp rise of the network's generalization accuracy on the test set,
never knew that until now
overfitting
can anyone give me a breif run down on the ecosystem of python?
Like i know how to use jupyter notebooks and the lab and I get how to use requirements.txt and pip.
I think i understand why we use conda but poetry and other things in the ecosystem i dont get why or whats considered best practice
poetry and other package managers are just people wanting to do things their way, I don't think there's a 'best practice' though I always think the zen of python is to keep things simple, if pip works, pip it is.
that was my impression. I've noticed and always heard the python community was a lot less opinionated than JS
I quite enjoy jupyter for iteratively building a thing
this and also just for running small snippets
If you don't need it, don't worry about it. If you want to learn the whole ecosystem, you should have started long ago, and gone at 5x the speed you can, because there's far too much.
Once you run into the problems Poetry solves (no idea what it solves) you should look into Poetry since someone's already solved that problem, or do what others have done and roll your own solution, then there can be yet another solution out there to further confuse those who do not understand why
uh
dependency shouldn't use the runtime directly normally
@verbal zenith there is a runtime by Rust org
but it's more as a proof of concept
also
"runtime" is not the issue
different interfaces are
and that's getting better than it used to be
it's near trivial to mix async runtimes in Rust
the whole "oh, so bad, so many runtimes" thing is bs
I know some CSS
idk how much
@verbal zenith I made some changes like I used the match statement instead of if-elif as you said
And made a def safe_eval function
btw, @verbal zenith, have you understood what this cursed thing does?
in short:
.indent on &mut Write makes a Write that indents everything you write to it,
.indent on &Display makes a Display that shows the original but indented
And AF I am using AST now
struct Example1;
impl std::fmt::Display for Example1 {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Example 1")
}
}
struct Example2;
impl std::fmt::Display for Example2 {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Example 2\n{}", Example1.indent(2))
}
}
struct Example3;
impl std::fmt::Display for Example3 {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Example 3\n{}", Example2.indent(2))
}
}
fn main() {
println!("{}", Example3);
}
@verbal zenith does it have edit history panel?
it might store alternate paths (i.e. what you undid)
I think VSC stores all saved states for a few days
idk about VS proper
@whole bear just learn both
yes it absolutely is easier to work with
segfaults in prod are not fun
C++ is not simple at all
templates are cursed
Rust is complex,
but the amount of tools C++ provides to create further complexity is huge
im back
@vocal basin i have a question, i want to organise my python code in folders and have a example folder and run my code from. how should i structure my python imports
assembly is simple until you need to have portability
are you pip install -e'ing your project?
i tried __init__.py but i dont think that does anyshit
hm what does this do?
(maturin develop does that automatically)
no im doing a seperate project
for the current environment, ensures you can import your package
it's like pip install but doesn't copy
main.py
notmain.py Can be used by default
mypackage/
__init__.py You need this to import python scripts from a folder
something.py
anotherpackage/
__init__.py
anotherthing.py
all that not including the difficulty of installing and linking libraries
so the project is called TensorOps and im opening the folder in vscode.
the actual source code is in TensorOps/tensorops.
i plan to have an example folder in TensorOps/examples
which for C++ is "just give up" situation often
borrow checker:
borrow checker makes code easier to write
if you're comparing to C++
C++'s GC is purely optional
as in
not implemented
yeah
shit "setup.py"
@vocal basin
what year is it again
pyproject.toml
it said i didnt have either
smfh
OHWAIT
I HAVE HEARD OF THIS FILE BEFORE
I CONFIGED IT FOR MY MATURIN STUFF
wait do i do this at the root directory?
like TensorOps?
@verbal zenith
@sour imp
£99 for partial implementation
£99 for full implementation
wait can i not have __init__.py
sounds like a pain
@vocal basin
i got the pip install e to work
@verbal zenith reminder that this implies checking it for all variable names
so you can break existing code
@frozen owl do you need to export anything from the module directly?
@frozen owl you don't need for examples
@frozen owl you installed it incorrectly, likely
or misconfigured VSC
shit
ffs TURN OFF THE SPELLCHECKER
(in some cases missing import is blue underlining too)
idk why am i having a hard time doing typing stuff in python when i do it all the time in rust smfh
my favourite VSC hack is to remove activation scripts for venv
because that for whatever reason does not break activation
makes it more transparent instead
(no prefix, and no paste+run on new terminal)
I hope there is a way to do that without deleting the files, but I'm too lazy to search for it
@whole bear are you choosing between free-form and significant space?
free-form: for token separation, only existence of some space matters, not amount and type
@verbal zenith table of contents
it can be resized
@verbal zenith you're also on the wrong page, from what it looked like
docs.rs/crate/miette instead of docs.rs/miette
lex_line()
{
// lexing
}
lex_file()
{
// lex entire file
}
@verbal zenith cog on the top right
you can also just resize it to nothing
push all the way
wouldn't there be both
and second uses first
but
not all languages can be done line-per-line
Zig can
Rust can't
Python can't
@whole bear do you want to include multi-line strings in your language?
@verbal zenith in some languages newline isn't a token
- see Zig
line-by-line increases compilation performance
via parallelism
there is still a serial initial process splitting lines
but
more advanced/intense tokenisation is shoved onto the threadpool
ig in chunks of multiple lines
@verbal zenith why not just anyhow
or do you need to actually pull data out of it/present to user
hmm
ariadne not ariadine
allegedly with /i/ sound
ariadni
is this some mythological creature
"creature"
ah yes humans
const std::string &filename
@vocal basin
This is a const pointer to a string right?
const reference
so address
its a value not a address
right control releases virtualbox controls allegedly
I'm too sleepy for maths questions rn
reference itself is an address
but
C++ makes it operate syntactically as if it's just what's being pointed to
@verbal zenith I've just noticed there's a separate panel in VSC to see source code of all Rust dependencies in the workspace
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
class Lexer {
public:
Lexer(const std::string& filename, char customLineBreak)
: file(filename), lineNumber(1), customLineBreakChar(customLineBreak) {
if (!file.is_open()) {
throw std::runtime_error("Could not open file");
}
}
void tokenize() {
std::string currentLine;
std::string token;
while (std::getline(file, currentLine, customLineBreakChar)) {
processLine(currentLine);
lineNumber++;
}
}
private:
std::ifstream file;
int lineNumber;
char customLineBreakChar;
void processLine(const std::string& line) {
size_t index = 0;
while (index < line.length()) {
char currentChar = line[index];
// Example: Skip spaces
if (isspace(currentChar)) {
index++;
continue;
}
// Example: Handle multi-line statement, custom logic to detect statement ending
if (currentChar == ';') {
// End of statement
std::cout << "Token found at line " << lineNumber << ": " << token << std::endl;
token.clear();
} else {
// Continue building the token
token += currentChar;
}
index++;
}
}
};
int main() {
try {
Lexer lexer("yourfile.txt", '@'); // Replace '@' with your custom line break character
lexer.tokenize();
} catch (const std::exception& ex) {
std::cerr << "Error: " << ex.what() << std::endl;
return 1;
}
return 0;
}
hard-code \n and ignore all \r
@verbal zenith CR first
\r
\r\n
macs used to prefer \r
carriage return line feed
❌ BASICally
✅ VBAally
@verbal zenith this is actually a recent change I think
like within last 9 years
@verbal zenith the set_var change will be stabilised when 2024 edition is released
Future in prelude
force unsafe {} usage inside unsafe fn
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) {
Utils::CreateWinAPI32BallonNotification("Started Orion Shell", "Started Orion Shell, compiled using G++ from main.cpp using windows.h. Please remember that errors can occur!", 0);
Utils::clear_logs();
Utils::clear_lex_out();
std::ifstream file("C:/coding-projects/CPP-Dev/Orion-Shell/assets/to_lex.txt"); // Open the file
std::stringstream buffer; // Create a stringstream to hold the file content
std::string line;
if (file.is_open()) {
while (std::getline(file, line)) { // Read each line from the file
buffer << line << "\n"; // Append the line and a newline character to the buffer
}
file.close(); // Close the file
} else {
std::cerr << "Unable to open file";
}
buffer.str();
return 0;
}
if your language is simple enough to parse line-by-line, might as well try doing that
the issue is more that some languages can't be tokenised that way
"""
example
"""
if {
} else {
}
if {} else {}
oh
2024 is getting reserved keyword
for generators
reserved
Rust already has generator functions
like Python
and async-await is implemented via generator-like things, at some level
like in Python
whereas now there's also a proposal for gen blocks analogous to async blocks
https://rust-lang.github.io/rfcs/3513-gen-blocks.html
wait till you see rust runtimeerrors with c libs
pytorch is notorious with its fucky errors
"did you mean segmentation fault"
is this good practice?
def __call__(self, input_node):
return self.forward(input_node)
like im making 2 functions do the same shit
like i alr have self.foward() that does the shit
since pytorch does support
model = NewModel()
y = model(x)
and also model.foward(x)
I'd just go with __call__ only, if you control the base class chain
right
wdym "control the base class chain" what does the "chain" refer to
i wrote all the code, including the base class
base class, base class of the base class, and so on
many languages just have a big stream of tokens at some point, so putting all that in same list should be normal
right, the
def forward(self, x)
is still implemented for the pytorch base class but is open for the user to change the forward operation accordingly but ppl seem to do model(x) as opposed to model.forward(x)
yeah so i'll stick to model(x)
ty
but should i expose
def __call__(self, input_node)
directly to the user to edit as opposed to exposing the
def forward(self, input_node)
how do you separate and display them nicely:
you can, theoretically, store metadata for tokens
and probably should
mostly just position in the file (offset, line, column)
I've hit a few rustc bugs in the past
mostly crashes
fearless concurrency
assert_eq! inside the compiler
likely coming from codegen-units of more than 1
not as painful as recent vtable-related change
@verbal zenith you need to display the report?
fn title<W: Write>(&self, w: &mut W) -> std::fmt::Result {
write!(w, "{}: ", self.variant_name())?;
match self {
ReportKind::UnexpectedCharacter(char) => write!(w, "{char}")?,
ReportKind::UnexpectedToken(unexpected, _) => write!(w, "{unexpected}")?,
ReportKind::UnexpectedEOF => {}
}
Ok(())
}
I'd suggest just making a display-specific type, yes
in which language
I started C# and Python 7 years ago
prior to that, some other languages
lol
C# and Python were the first ones I studied properly
these ppl know programming or skidding?
first time I wrote Pascal code was ~18 years ago
10~20 years of experience and barely any skill is quite common, according to people who have that level of experience
wow
my first ever time touching a program was in robotics in school
i worked on a nxt roboter
im currently on arduino
i learned a little bit c++ with it
... and here I am googling this because JS literally does not have that built-in, and I'm just picking whatever method is in fashion
yes, C++ has labels and goto
but goto is advised against
since it violates principles of structured programming, allegedly
destructors made goto obsolete in some cases
anyone can help me inna sec when i verify
sure
im working on my roboter rn and its using a raspi and arduino nano.
task of the roboter is to with the help of a camera, read values of a obstacle it reads infront of it and pass it onto the arduino
i am working right now on a function called tokenize
void tokenize(char *str, char *delim, char **tokens)
{
int i = 0;
char *token = strtok(str, delim);
while (token != NULL)
{
tokens[i] = token;
i++;
token = strtok(NULL, delim);
}
}
i have not worked much with c tbh
how do i get verified to screenshare?
@whole bear

u got c experience?
or any1
cuz i dont
so pretty much i get 6 numbers from my raspi through a serial port which i have opened to arduino
thats a bug
from discord or idk
lemme ask an admin real quick for screenshare
int Picturemiddle_x = 0;
int Picturemiddle_y = 0;
// own split function since arduino doesn't have a default one
void splitString(String input, char delimiter, String output[], int &count)
{
int startIndex = 0;
int endIndex = 0;
count = 0;
while (endIndex != -1)
{
endIndex = input.indexOf(delimiter, startIndex);
output[count] = input.substring(startIndex, endIndex);
startIndex = endIndex + 1;
count++;
}
}
// 2nd tokenizing function
void tokenize(char *str, char *delim, char **tokens)
{
int i = 0;
char *token = strtok(str, delim);
while (token != NULL)
{
tokens[i] = token;
i++;
token = strtok(NULL, delim);
}
}
void findNextPillar()
{
String substrings[10]; // Create an array to store the substrings
// Block
P_color = 'U';
P_x = 0;
P_height = 0;
P_wall_L = 'N';
P_wall_R = 'N';
String data = raspi_get_data();
int count = 0;
splitString(data, ' ', substrings, count); // Split the data into substrings using a space delimiter
P_color = substrings[0].charAt(0);
P_x = substrings[1].toInt();
P_height = substrings[2].toInt();
P_wall_L = substrings[3].charAt(0);
P_wall_R = substrings[4].charAt(0);
return;
}```
here is my complete cam.h so far
check this out maybe itll clarify something
the space between char and token was because discord
not the tokenize i mean as in the code itself
when im on my raspi checking the values of a obstacle infront of what the roboter sees the values are not the same as i get
sadly i killed my battery for the roboter so i have to check later what to change just lemme check rq
thats how my program works
the bot just sees obstacles if they are red or green and then decides which direction to go
#bot-commands message
is there a mod in here that might grant me temporary screensharing permissions
don't .gitignore the .gitignore, normally
Basic
ass
stupid
shity
inpractical
language
(Bassil)
perfect
@vocal basin 🙏
text logo "Bassil"
depending on what's in settings.json
egg-info -- no
shit do i have to manually delete egg info
{
"python.analysis.extraPaths": [
"./TensorOps"
]
}
doesnt look like a basil
git rm --cached allegedly
yes
most open source licenses require attribution
⚠️ CLOWN WARNING ⚠️
no license is quite restrictive
isnt it all rights reserved
as in you don't allow to do anything with your code
yes
almost
there is CC0 and WTFPL for very permissive
@verbal zenith it requires &'static str?
@verbal zenith yeah, seems like, the idea is that those are expected to be hard-coded/macro-generated
also
uh
that is a level, isn't it?
so, like
a class of reports
why would you need to create it that based on inputs
(I know some answers to that, but you probably aren't hitting those usecases I'm thinking of)
@whole bear ||git reset --hard origin/main||
if you want to kill local changes
this assumes remote has a branch named main
@whole bear you don't care about local changes, right?
hmm
what do you need to do, again?
ah
if you want to push, then don't reset
git pull fails?
git push -u origin main
do you have main as currently checked out branch?
remote is not empty
git pull --rebase
or just git pull if you're okay with merge commits
first, commit whatever you have changed currently
then pull
it will merge
then rebase
git pull --rebase origin main
idk why i dont really trust llms for code documentation
there will be a bit of a time paradox in the history lol
@whole bear you should probably git config your name and email so it matches what's in github, otherwise your commits don't show up as made by you
just note that --rebase rewrites local history
uh
you need to know what commit you were on
as in the hash
save it before pulling
git reset --hard ORIG_HEAD
allegedly
also
git reflog
@verbal zenith self-host crates.io, push everything you use there
@sour imp that's just Windows
so that if you need to reuse something you can just cargo add it
maybe I should do something about this
I have 111 cargo packages uploaded on self-hosted instance
including separate versions, ofc
@verbal zenith have you tried ??
wrap in Ok
also
Box<dyn Error>
why do you need dyn Debug?
remove + '_
ah
okay then idk
time to check something
oh, dyn Debug can't ?
lmao
dyn Error can
@verbal zenith Box::new(e) as _
huh
I just realised I pushed a crate to a wrong registry
to one more private than necessary
@sour imp outage started quite a while ago
#bot-commands message
#community-meta message
wouldn't SQL be an overkill yeah
ew
no, not the mongo
you can't mongodb if you can't AVX
MongoDB of versions newer than 4.4 requires that CPU supports AVX
for whatever reason
likely for JSON/BSON parser
(AVX is just a wider SIMD)
MongoDB is actually not critically bad
same for Redis
(except Redis is used more widely in prod)
both went BSL way
iirc there are some re-implementations of Mongo interface on top of other stuff
postgres and mariadb specifically
thing for postgres
https://www.ferretdb.com/
time to come up with better name than "metadata" for whatever that is
(I said metadata originally just because it roughly conveyed the meaning lol)
[
{
"line": 1,
"start_column": 1,
"end_column": 5,
"type": "Identifier",
"value": "first"
},
{
"line": 1,
"start_column": 7,
"end_column": 13,
"type": "Argument",
"value": "command"
},
]
I might've once or twice unironically said something very similar to that "it's my library" sketch at work lol
slightly inconsistent trailing commas?
(it doesn't parse as JSON)
while we're on the topic of use ReportKind::*;
I don't like that doing it automatically in VSC+rust-analyzer is non-trivial
So, to learn, turn knowledge into a fish.
!stream 317279909112446976
✅ @somber heath can now stream until <t:1724818243:f>.
@minor tartan 👋
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
this doesnt work btw
i be here 3 separate days
ive vced before but it doesn't work
did you voice voice call 3 different days for 10 minutes each and also send 50 unique massages that are not spam?
you clicked this button?
yes
it is angry
it forgot my join
:<
i know of atleast 3 days that i was here
heck i bet even 3 consecutive
i'm willing to wait 3 days and try again
not 3 days
you joined today
look
Voice calling is not part of the prerequisite criteria.
You have to have been on the server for at least three days from your last join date.
Have sent 50 undeleted messages in the text chats other than the bot channels.
Not have any active voice infractions.
I think you left and joined again
The messages have to have at least one message per ten minute span for a total of three spans.
At least.
(Don't worry too much about this.)
If you stay in the server and keep talking with people via text, you'll qualify in no time.
Don't overthink it.
Just periodically check back with the voice verification button.
