#voice-chat-text-0
1 messages · Page 112 of 1
meh I'd leave it as them writing inconsistent tests tbh
I saw smth to that effect in the discussion section
Yeah kind of weird. Maybe in whatever programming language they use these things are converted implicitly?
Maybe they wrote the tests with Javascript 🤔
Ah right yep that's it lol
== strikes again.
So what is this for gofek?
Oh right
Yeah kind of sucks because it was a nice exercise otherwise 😄
!d dict.fromkeys is kinda nice on line 111 btw
classmethod fromkeys(iterable[, value])```
Create a new dictionary with keys from *iterable* and values set to *value*.
[`fromkeys()`](https://docs.python.org/3/library/stdtypes.html#dict.fromkeys "dict.fromkeys") is a class method that returns a new dictionary. *value* defaults to `None`. All of the values refer to just a single instance, so it generally doesn’t make sense for *value* to be a mutable object such as an empty list. To get distinct values, use a [dict comprehension](https://docs.python.org/3/reference/expressions.html#dict) instead.
Could you change your stream settings to "better text readability". It's kind of blurry right now for some reason.
Errr
Not sure 😄
Lemme find it 1 sec
🤔
Eh cant find it in the existing stream settings
but you can when starting a stream
It's still legible so it's not the end of the world
Yo Grey 👋
self.valid = valid | dict.fromkeys(self.keys(),False) would replace lines 110,111
Yeah definitely more readable with large text. You could also stream a smaller window for the same effect I think.
Not that you have to (wrt to using my edit) tbf, I would use dict.fromkeys(self.keys(),False) instead of {key:False for key in list(self.keys())} tho since that's the entire raison d'etre of the dict.fromkeys method :)
well it still needs the update, it was meant to replace exactly the dict comp
self.valid |= ... is also equiv to self.valid.update(...)
slight caveat for this being that this version is not done inplace wrt valid, which would be a change from your exact original meaning
dict.update doeant return the new dict
this would be the one liner
Assuming you're happy with this
You still need the valid |
currently we lost any realtion to valid
| on dicts combines 2 dicts
same as update but returns a new combined dict
well rn you dont use the old valid, I assume it wasnt an empty dict to start with so we cant ignore it
Then the init shouldnt need the valid arg if it's irrelevant
tkhd == tkhd[:16] + tkhd[12:16] + tkhd[20:] is the same as tkhd[:16] + tkhd[16:20] + tkhd[20:] == tkhd[:16] + tkhd[12:16] + tkhd[20:] which equals tkhd[12:16] == tkhd[16:20] no?
Heading off. Cya both 👋
for line 158

tkhd == tkhd[:16] + tkhd[12:16] + tkhd[20:]
tkhd --> tkhd[:16] + tkhd[16:20] + tkhd[20:] # decompose into partition
tkhd[:16] + tkhd[16:20] + tkhd[20:] == tkhd[:16] + tkhd[12:16] + tkhd[20:]
# cancel both sides, losing common tkhd[:16] at front and tkhd[20:] at the back
tkhd[12:16] == tkhd[16:20]
The start and end are logically equivalent
There's no way tkhd changes in between the 2 adjacent lines
If so you likely have bigger problems on your hands
exactly
Yeah, happens to the best of us dw
Ima have to go now, almost 2am for me
👋
I tried solving this and failed
https://www.codewars.com/kata/55dcdd2c5a73bdddcb000044
used a wrong data structure, ig
yes, there is a non-recursive solution
(I think)
I might try to do it but not right now
Hey, what's the stream about?
there's also RNA
"beyond zero and one" is quite meaningless
it makes no difference
you just have two bits instead of one
https://en.wikipedia.org/wiki/DNA_digital_data_storage
@midnight agate
DNA digital data storage is the process of encoding and decoding binary data to and from synthesized strands of DNA.While DNA as a storage medium has enormous potential because of its high storage density, its practical use is currently severely limited because of its high cost and very slow read and write times.In June 2019, scientists reported...
wtf
precursor to DNA
ooh DNA
used as an intermediate genetic material
in some organisms
(like humans)
and for permanent storage in more primitive ones
(like bacteria) no
(viruses)
DNA is more stable
@midnight agate
from random site: 1.47 terabit/mm2
from some other site:
4.2 × 1021 bits per gram
@elder knot those can just be interpreted as 00, 01, 10, 11
it's just two bits per an element
shuffle(x, random=None) method of random.Random instance
Shuffle list x in place, and return None.
Optional argument random is a 0-argument function returning a
random float in [0.0, 1.0); if it is the default None, the
standard random.random will be used.
hey guys, is here someone who can help me with handling csv files?
well i am not that good at them but i can have a look
if u want me to
i have a question about how to get the datatype from a column without using pandas
can u help me there?
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@hoary plaza do you know how to solve ImportError: DLL load failed while importing _ctypes : The specified module could not be found in venv?
@hoary plaza can you ask chat gpt?
I have to go to a part-time job in an hour, but I work at dawn because I am in Korea.
The error message you're seeing indicates that Python's _ctypes module was not able to be loaded because it couldn't find a required DLL file.
Here are some things you can try to resolve the issue:
Make sure your virtual environment is activated. If you're not sure, try running the source <venv>/bin/activate command in your terminal (replace <venv> with the name of your virtual environment).
Try reinstalling the affected package by running pip install --force-reinstall <package> (replace <package> with the name of the package that's causing the error). This may help replace any missing or corrupted DLL files.
Check that all required system dependencies are installed. Depending on your operating system, you may need to install additional system packages to support the _ctypes module. For example, on Ubuntu, you can try running sudo apt-get install libffi-dev.
If you're running Windows, try installing the Microsoft Visual C++ Redistributable for Visual Studio 2019. You can download it from the official Microsoft website.
If none of the above steps work, try creating a new virtual environment and installing the packages you need from scratch. Sometimes virtual environments can become corrupted, and starting fresh can resolve the issue.
I hope one of these steps helps you resolve the issue!
(chatgpt response)
I'm sorry I left without a word.
npnp, see you later
Did you use gpt 4 for this?
I'm using gpt4
im back
hi
Did you call me?
It is difficult for me to listen to English, so can you write it in a message?
yeah south korean
Chamchi means tuna
Damn it. I don't understand the conversation until now except for "chamchi"
im so sad 😦
Once upon a time, I studied music, and I think that chamchi reminds me of one of the rhythm syllable exercises we learned, which included the phrase "taamti'. Chamchi, taamti. There's a resemblance that I think my brain caught on.
You hang around here enough you'll start picking stuff up
oh okay
In what context?
in def?
More context required.
Identity as in naming a function?
So that's why I'm staying here, to study English and Python.
Cool cool
Write the function identity which takes an input x and returns that input.
Ah, so identity is the name of the function you're supposed to create. Okay.
def identity(...):
...```
Functions are a collection of code that can be called upon to run as many times as required on demand.
Here's an example function.
def function():
pass```I have created the function. It's not doing anything. If I were to call it (cause it to run), it wouldn't do a whole lot.
Let's make it a little more interesting.
what does the pass do?
pass is a keyword that signifies a null instruction. It doesn't do anything except provide syntactical completeness. It's what you put when you have to put something but don't want to put anything.
I'll try that again.
!e ```py
def func():
print('Hello, world.')```
@somber heath :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 3
002 | print('Hello, world.')
003 | ^
004 | IndentationError: expected an indented block after function definition on line 1
!e ```py
def func():
pass
print('Hello, world.')```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello, world.
Python complained because it was a def with an indented section, so it's expecting something to be there, but there isn't. It just de-indents and goes to the print. This is wrong.
In the example with pass included, it provides syntactic completeness. It's something the interpreter knows what to do with.
It doesn't have to be pass, it could be a string. It could be a variable reference. It could be pretty much any other code, but it has to be something.
So pass is what we put when we have to put something but we don't want to put anything.
Okay, moving on.
Make sense?
are you saying python ignored the def becuase theres nothing and just printed hello world?
!e ```py
def func(): #Here, I am creating a function and pointing the variable, func at it.
print('Hello, world.') #Here I am writing the code that should happen when this function is called/caused to run.
print('Goodbye.')
func() #This is a call to func. It causes func to be run.
func() #I call it again.```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello, world.
002 | Goodbye.
003 | Hello, world.
004 | Goodbye.
It didn't ignore the def. It created the function. I just didn't call it.
I'm calling the function I'm creating, now, twice.
So a function, a def, is like a reusable section of code that I can cause to run whenever I want.
Cottage cheese is lumpy.
i finally got it
It's nice and fresh.
I don't have it very often, but I don't mind it.
Okay, so. With this example in mind.
may i ask who are you? i do wanna become a person like you
okay
!e ```py
def function(value):
print(value)
function('abc')```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
abc
Here, I have created a function and pointed the variable, function at it. This function takes one argument to its one parameter, value.
value becomes a variable in the "local scope" of function.
it points to the argument given
Here, the argument is the string, 'abc'
def function(parameter):
...
argument = 'some object that is the argument'
function(argument)```
I washed up. I feel refreshed
So the argument is given to parameter.
So we can treat parameter as if it was the 'some object that is the argument'
string
!e ```py
def func():
return 'abc'
result = func()
print(result)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
abc
Here is a function. I've named this function func. From this function, I return the object, 'abc'.
Remember this: The object given to the return keyword replaces the call to the function.
So this is like I was writingpy result = 'abc' print(result)
Because the call, func(), is being replaced/evaluated to the object given to return.
print(func())```I could also have done this
So this happens in addition to anything else the function might be doing.
and when you return from within a function, the function execution terminates.
!e ```py
def func():
print('a')
return
print('b')
func()```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
a
All functions that complete, return.
!e ```py
def func():
print('ABC')
print(func())```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | ABC
002 | None
This function prints 'ABC' and returns None.
Because all functions that complete, return. If nothing is explicitly given to the return keyword by the time the function finishes, None is returned.
!e py result = print('Hello, world.') print(result)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello, world.
002 | None
print is a function
All functions that complete, return something.
So here, the call to print is printing 'Hello, world.' and returns None
So.
Your task is to write a function that has one parameter (accepts one argument) and returns that same object.
If I'm understanding you correctly.
!code
Give it a go.
Remember: parameters are variables
variables are signposts to objects
You can have more than one signpost pointing to the one object. variables aren't the objects, themselves.
but they can be used as if they were
Lin-Manuel Miranda (; born January 16, 1980) is an American songwriter, actor, singer, filmmaker, rapper, and playwright. He is known for creating the Broadway musicals In the Heights (2005), and Hamilton (2015), and the soundtracks for the animated films Moana (2016), Encanto, and Vivo (both 2021). His awards include three Tony Awards, two Emmy...
How many times can it fold before it starts showing wear?
The folding screen stuff, I meant.
Like, in person?
This is a function that, when called, and you call it once, prints x once and returns None.
It takes no arguments. It has no parameters.
Why doesn't it print the second x?
def function()
return 'x'
result= func()
print(result)
wait
is ther minimum iq required to learn python
This is a function that takes no arguments. It has no parameters. It returns the string, 'x'.
You call this function and assign the variable, result to the return of the function, 'x', because the call to the function evaluates to/is replaced by the object given to return. You then print the object referred to by result, 'x'.
is this the one that takes argument?
Yes.
This function has one parameter, value.
So it accepts one argument to it.
You've been feeding her beans, have you?
what do you mean?
I was responding to the voice conversation.
This is a function that has one parameter, value. When called, it prints the argument given to it and returns it.
You can drop the parentheses on the return line.
what
ah
return is a keyword, not a function
Your function does what the requirements state, however, it does more than what the requirements state.
What is the original text of the problem brief?
are you saying theres extra in ther
sorry, how can i make text look like this
!code
print('Hello world!')
But I wanted to have a look at the problem brief so I can know for sure.
It's good to not be adverse to correct word choice. (Voice conversation)
Effect is preceded by cause. Therefore, crows are to blame for everything.
!voice @jolly garden
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Hello everyone
I had to fix some audio issues
lol
I was listening to spotify and then opened discord and my laptop keeled over
Ok, so question
How does psuedocode work?
Hi!
(don't have mic)
is this valid? self.traveltimes: list[tuple(int)]
thanks :)
so the typehint "list[tuple(int)]" is valid for a variable?
Double checking
The outer list part would be right
Ah okay
self.traveltimes: list[tuple[int]]
oh thanks
brb
0
back
🐴 🛖 🧠
hello
should I use "if myvar > 10:" or "if 10 < myvar:"?
I'd do the first.
okay
Fire burn.
"Good luck"?
Oh
Macbeth.
"Let it be cursed. It'll be more metal."
The story I heard was that a dancer actually broke a leg immediately after having been told good luck, so people started saying break a leg, instead.
I got input as x minute y second for easyer usage should I convert it to x*60+y second?
okay
nah I just use my own variables
then how could I shorten this function's name? get_train_index_by_id
tran_index_by_id
🥚 👨 🥚 🧔♂️ 👨🦱 🦭 🚂
Should I use typehint when getting input?
I'd only bother typehinting your defs.
Like, the parameters and the return on the def line.
You can typehint elsewhere, but...
If you're wanting a more practiced view on the matter, ask in #type-hinting.
But then it would be like java and we would carry on every older version's bad stuff to because some older mod possibly could use it
what is the best way to convert a time like 143 minute to hour and minute?
I'll check in live coding bye!
It's a series of pictographs intended to be interpreted as a reference or phrase or word.
It's Bitcoin.
Sad trombone noises.
It's not. The Bitcoin was in reference to something in voice chat. The pictogram was separate.
need help
sir
i want to make a game like
like mystery and action
Sorry to let respond
Adventure
can u unmute me
UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d '
something new , found out yesterday
i want to know the pros/cons of it
ok
@rugged root how can i unmute
libraries that i used:
import numpy as np
import torch
import matplotlib.pyplot as plt
import copy
import tqdm
import torch.nn as nn
import torch.optim as optim
from sklearn.model_selection import train_test_split
import chess
from chess import Move
import torch.nn.init as init
import sqlite3
UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d '
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Is it just me or have the helpers in python-help reduced drastically?
[1] 97701 killed /usr/local/bin/python3 /Users/xxx/Desktop/Code/foldertest/aieval6elm.pyx /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d '
i don't have multiprocessing but the error says so
sure thing, did you enjoy your part time job atleast a little?
No, I'm just doing it for money.
I have to go empty the trash can later.
But it's convenient because there are no customers because it's dawn.
well, depends if you like people or not
I don't like the customer being rude to me
oh bye
Bye, see you later
😎
@supple fable 👋
hello
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
[1] 28597 killed python3
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '
not to mention that at some point i had like 23 GB of swap (i had 8GB of ram on my m1 macbook air)
are you using semaphores on your own, or does some underlying library use them?
im using pytorch
this is python traceback, but for warnings
(not for errors)
my imports
import numpy as np
import torch
import matplotlib.pyplot as plt
import copy
import tqdm
import torch.nn as nn
import torch.optim as optim
from sklearn.model_selection import train_test_split
import chess
from chess import Move
import torch.nn.init as init
import sqlite3
aieval6elm is written by you, right?
oui
i was having fun experimenting with extreme learning machines
i ran it as a cython
why is doing tqdm on import?
progress bar
import shouldn't do any printing
whatever logic of this sort you do, it should either be inside a function or inside if __name__ == '__main__': block
in a function
are you calling kill or is it called by some underlying library?
library
what library, exactly?
i think it's pytorch
one of these
oh wait
hmm
might not be a pytorch kill though
Shouldn't the ? parameterisation be used?
that too
wasn't there something like
!injection
seems no
I'm trying to run Python 3 on the new M1 chip MacBook. I tried installing python3 both via the official Python website (https://www.python.org/downloads/release/python-391/) and also via brew install
#databases some pin there
doesn;t seem to be an error from pytorch specifically
so no
so the error might not originate from pytorch
well
also, ? is just easier and works better than substitution/concatenation/interpolation
since the progress bar here actually shows the progress for games in my DB and stores it, since the progress bar is alr 100% for quite a while before the code crashed i doubt it might be the direct cause but i think it did contribute to the memory overload
right
Beware Little Bobby Tables.
(there are reasons why printing on import is a sign of something being wrong)
ah yes, injection
(is it injection though)
Can't complete the conversion Models to Core ML Chip: Apple M2 Memory: 8GB OS: 13.0.1 (22A400) pip list Package Version Editable project location ------------------------------ ---------- -----...
Hi I am facing an issue with semaphore tracking while using pytorch multiprocessing over multiple GPUs. I get the following warning message multiple number of times every time and it is slowing down the code execution substantially (8 times slower). /anaconda3/lib/python3.6/multiprocessing/semaphore_tracker.py:143: UserWarning: semaphore_track...
@neon dagger hi, this vc is better for us to see.
Ashu says hi to all in vc
@torn bough👋
Yeah we've got a voice gate. #voice-verification will tell you about it
!talk
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Glad to have you
someone update python to use subthreads in threads 🙂
from prettytable import PrettyTable
import psutil
# Get a list of all currently running processes
processes = list(psutil.process_iter())
# Create a table and add rows for each process
table = PrettyTable()
table.field_names = ["Process ID", "Process Name", "CPU Percent", "Memory RSS", "Memory Percent Used"]
for process in processes:
try:
pid = process.pid
name = process.name()
# Call cpu_percent() method twice with an interval to get non-zero value
cpu_percent = "{:.2f}%".format(process.cpu_percent(interval=0.1))
memory_info = process.memory_info()
memory_percent = "{:.2f}%".format(process.memory_percent())
table.add_row([pid, name, cpu_percent, memory_info.rss, memory_percent])
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
# Skip any processes that we can't access or that are zombies
continue
# Set the alignment to the left for all columns
table.align = "l"
# Sort the table by CPU percentage
table.sortby = "CPU Percent"
table.reversesort = True
# Print out the table
print(table)
Oh cool, which one?
He makes like eccentric moving sculptures right?
I am reading a book called Deepwork now.
That the one about tricks and coping mechanisms to help you focus?
Yes, this book helps you concentrate and learn deeply when you learn something.
I'd have a hard enough time just finishing the book
You are right. You should not only read books, but also read, learn, feel, and make them your own.
For sure
Ah yikes
yes
he is 18+
XD
yes
hasbulla
his name
hahaha
no cap
XD
i once saw video a man playing with him mistaken him as a child
xD
🤣
Dwarf I think
Might have good traction ¯_(ツ)_/¯
_-
where are u from
Australia.
ok sorry
That I live in Australia?
no on AOA
i am a muslim and i live in pakistan
@somber heath can u shere your python project file plz
No.
@somber heath no for what
No, I won't subscribe to your YouTube channel. 🙂
but why
wtf is that aspect ratio?
plz i am a new in youtube
That's not sufficient reason for me.
so thats why plz
Please don't beg for youtube subscriptions
even less reason to subscribe. My account is from 2006 and I don't ask.
If people are interested in your content they will subscribe
If they aren't, then they won't
@rugged root yes brother
Was what I said unreasonable?
what this is all about?
oh nice
bye I am going to explore more about apis, will back in future for help.
/usr/bin/python /usr/bin/python2.7 /usr/bin/python3.10 /usr/bin/python3.6 /usr/bin/python3.6m /usr/bin/python3-config
/usr/bin/python2 /usr/bin/python3 /usr/bin/python3.10-config /usr/bin/python3.6-config /usr/bin/python3.6m-config /usr/bin/pythontex
eli@rucola:~> file /usr/bin/python3.6
/usr/bin/python3.6: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=396fdc779a004e16983fd32424ac57c040c5c4b6, for GNU/Linux 3.2.0, stripped
@autumn bluff👋
$ BUILD_WHEEL=1 ./build-command
HELLO GUYS!
We're talking at you!
😁
Except I wasn't because I was muted.
I have a very dumb question
So it's...unspeakable?
@alpine pumice👋
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "lib"))
import splunklib.client as client
import splunklib.results as results
oh lawdy
!d with
8.5. The with statement
The with statement is used to wrap the execution of a block with methods defined by a context manager (see section With Statement Context Managers). This allows common try…except…finally usage patterns to be encapsulated for convenient reuse.
with_stmt ::= "with" ( "(" with_stmt_contents ","? ")" | with_stmt_contents ) ":" suite
with_stmt_contents ::= with_item ("," with_item)*
with_item ::= expression ["as" target]
``` The execution of the [`with`](https://docs.python.org/3/reference/compound_stmts.html#with) statement with one “item” proceeds as follows:
@frank hearth👋
Hi
rooms = {
'Great Hall': {'South': 'Bedroom'},
'Bedroom': {'North': 'Great Hall', 'East': 'Cellar'},
'Cellar': {'West': 'Bedroom'}
}
rooms["Great Hall"]["South"]
!e
rooms = {
'Great Hall': {'South': 'Bedroom'},
'Bedroom': {'North': 'Great Hall', 'East': 'Cellar'},
'Cellar': {'West': 'Bedroom'}
}
print(rooms["Great Hall"])
print(rooms["Great Hall"]["South"])
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | {'South': 'Bedroom'}
002 | Bedroom
!e
rooms = {
'Great Hall': {'South': 'Bedroom'},
'Bedroom': {'North': 'Great Hall', 'East': 'Cellar'},
'Cellar': {'West': 'Bedroom'}
}
...
# game loop and logic and stuff
current_room = rooms["Great Hall"]
print("The following are you options of rooms to go to:")
for direction, room in current_room.items():
print(f"If you go {direction}, you'll enter the {room}.")
!e
rooms = {
'Great Hall': {'South': 'Bedroom'},
'Bedroom': {'North': 'Great Hall', 'East': 'Cellar'},
'Cellar': {'West': 'Bedroom'}
}
# game loop and logic and stuff
current_room = rooms["Great Hall"]
print("The following are you options of rooms to go to:")
for direction, room in current_room.items():
print(f"If you go {direction}, you'll enter the {room}.")
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | The following are you options of rooms to go to:
002 | If you go South, you'll enter the Bedroom.
...
user_input = input("Enter the direction you want to go: ")
current_room = rooms[user_input]
!f-strings
Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.
>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."
Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.
!e
x = "world"
print("Hello %s!" % x)
@willow light :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello world!
!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!
!e
x = "world"
print("Hello %.3f!" % x)
@willow light :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | print("Hello %.3f!" % x)
004 | ~~~~~~~~~~~~~~^~~
005 | TypeError: must be real number, not str
while True:
# Blah blah story stuff based on current room and inventory
user_input = input("What do you do?")
if user_input in ("North", "South", "East", "West"):
current_room = rooms[user_input]
continue
...
sys.exit(1)
suggestions @lavish rover ?
if [ ! -d "venv" ]; then
echo "No virtual environment found with name 'venv', checking system python version"
if [ command -v python3.10 >/dev/null 2>&1 ]; then
echo "Confirmed Python 3.10 installed in system"
echo "Generating vitual environment"
python3.10 -m venv venv
echo "Activating environment"
source venv/bin/activate
echo "Installing requirements"
pip install -m requirements.txt
echo "Finished setup, deactivating and continuing normally"
else
echo "Python 3.10 not found in system, please install it to continue."
exit 1
fi
fi
echo "Activating virtual environment"
source venv/bin/activate
if { python3.10 -c 'import sys; print(".".join(map(str, sys.version_info[:3])))'; echo "3.10"; } | sort --version-sort --check &> /dev/null; then
echo "Virtual environment python version is less than 3.10. Please delete the venv directory and run this script again to create a new one."
exit 1
fi
cd src
echo "Starting bot"
python main.py
sys.exit(0)
no need to bash shell scripting
having a translucent terminal is kinda cool
is this better than iterm2?
i didn't use iterm2 because it had an issue with logitech mice
(and scrolling and window sizing, among others)
i have no idea
yo wassup 8080
yo 🙂
took the overall i/o process from 1hr to 23mins, but the report creation is killing me now... since it was generated in a per-process thread in the 1hr version, it's now processing everything in 1 thread 😦
Hello Hem, Verboof, Clari, Cruiser, Gofek, Mustafa, NotACrow, Opal, Pynoob
Its pretyt common but i dont like the contrast
current_room = "Great Hall"
move_options = rooms[current_room]
Text is unreadeable when you have it trransparent
Ah cant type today
like bg text? yeah unfortunately
Intelijj has the ability for background and its pretty cool
how about vscode?
It has transparency ( as an extension unlike intelijj )
@lucid blade Do you have one of these? https://www.amazon.com/gp/product/1885071620/
google?
Cheatsheet for the most useless stuff?
@rugged root what did you do ? the room is full wow
Didn't do anything this time
Publishers win in federal court.
its in the realm but not exactly , how newspapers nose-diving subscriptions rates for real paper and online - is going the way of the dinosaurs
many like physical books , very few use online materials ( few open to be defined )
Oh, fun
hot potato with a grenade
fun
that one is more fun
Doesn't work
print("I am inside your walls".uwuify())
do hooman clones have copyrights ?
We don't own our own genetics.
hoomans are copys of copys of copys...
Remember when Microsoft tried to copyright and trademark 1s and 0s?
Technically, counting is illegal.
Remember we live in a world where chord progressions have been copyrighted.
Passion of the Christ...
(╯°□°)╯︵ ┻━┻
"99 Luftballons" (German: Neunundneunzig Luftballons, "99 balloons") is a song by the German band Nena from their 1983 self-titled album. An English-language version titled "99 Red Balloons", with lyrics by Kevin McAlea, was also released on the album 99 Luftballons in 1984 after widespread success of the original in Europe and Japan. The Englis...
`We know things are bad – worse than bad. They’re crazy. It’s like everything everywhere is going crazy, so we don’t go out anymore. We sit in the house, and slowly the world we are living in is getting smaller, and all we say is: ‘Please, at least leave us alone in our living rooms. Let me have my toaster and my TV and my steel-belted radials and I won’t say anything. Just leave us alone.’
Well, I’m not gonna leave you alone. I want you to get MAD! `
I am very familiar with Network.
Mele Windows11 mini pc stick: A Cost-Effective Stick PC The first mini PC Stick with LAN port in the world, No Fan, No Dust Inside, No Vibration, No Noise! This hdmi stick computer with Gemini Lake Celeron J4125(2GHz~2.7GHz, CPU Mark 3298) has higher performance than other mini desktop computer w...
I love old films. Especially foreign films
Can someone please help with this - https://stackoverflow.com/questions/75988220/pandas-why-does-dataframe-to-csv-mess-up-row-column-order-when-dealing-with-l
I already posted there. https://discord.com/channels/@me/796755876031365132/1095387365947740222
Nobody answered and the question got closed 😦
!e
import string
import random
N = 32759
import pandas as pd
res1 = ''.join(random.choices(string.ascii_uppercase +
string.digits, k=N))
res2 = ''.join(random.choices(string.ascii_uppercase +
string.digits, k=N))
data = [[res1, res2]]
data += data
print(len(data[0][0]))
df = pd.DataFrame(data)
print(df.head())
@willow light :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 32759
002 | 0 1
003 | 0 CW5XF4YRLIGFAN12I2GE0ADPUK2CE5XS36NPV0GOYJ2XLE... RX96JK72RZ9B0M9SAW184QDCI77CVJ7M26MEYM3ISAS037...
004 | 1 CW5XF4YRLIGFAN12I2GE0ADPUK2CE5XS36NPV0GOYJ2XLE... RX96JK72RZ9B0M9SAW184QDCI77CVJ7M26MEYM3ISAS037...
micromamba is better than conda, it takes all the bullshit out and only leaves the useful parts
cant you make a virtual env then have a minimal install
@kind wharf I'm still checking
the name 'micromamba' just creates an image before hand in my mind lmao
Does python bot work here?
which i cant disclose:]
!e
print("Hello")
@kind wharf :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello
:[ why yall hating so bad??
!e
import string
import random
import pandas as pd
N = 32759
res1 = ''.join(random.choices(string.ascii_uppercase +
string.digits, k=N))
res2 = ''.join(random.choices(string.ascii_uppercase +
string.digits, k=N))
data = [[res1, res2]]
df = pd.DataFrame(data)
# print(df.head())
df.to_csv("df.csv")
df_new = pd.read_csv("df.csv")
print(df_new.head())
@kind wharf :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Unnamed: 0 ... 1
002 | 0 0 ... WG6F3FCUGRTCUNSQ6LYIMD7QRTDF2JVDCBAX08CTAVT9SP...
003 |
004 | [1 rows x 3 columns]
df.csv
too long to upload
1 rows x 3 columns
conda sounds like a virus
What's the alternative to .csv?
I prefer .json personally
It works well with more languages.
fuck xml.
hmm
JSON exists, we don't need XML anymore
Well if we're bringing in databases, may I interest you in Redis and/or Mongo?
Redis is wicked good
@rugged root It's not about Excel 🙂 If you write it as .csv in Pandas and load it back in, it'll have messed up columns
🙂
Perhaps I should try working with .json
That worked
. Thank you so much everyone!
Have a great day everyone!!
some kids know how to find anything on the net - so its ok...
silicon valley - Gilfoyle with a drill , making a ... service call
This VC is so random lol
Just like conversations with friends
Redis and Mongo Arent the same now are they?
no redis is easier
Redis is like hibranate its on the system
Mongo is No-SQL
redis is key value pairs, mongo is documents
No but like they are totatlly different?
mmmm mushroom beer ?
@lucid blade aero press ?
ohhh looky
@lucid blade didnt you do arduinos?
its pretty easy with an esp
shouldnt be hard to intergrate it with the actual thing
coffee bean roasting is rather complex
photocopy water
but pronounced like you're from Long Island.
water with three syllables
i used Arduino With Discord and man was it nice
My mother's from Long Island. The New York Accent is seen as a speech impediment in the Greater Boston Area
woooter
the convinience of chatting on discord and turning on and off your light/statistics/power usage/turning on and off my pc is just soo good
I'm currently updating my daily driver so discord on windows today
My daily driver laptop runs, you guessed it, Arch BTW
can a raspi 3B+ do openCV or is it a struggle to put on there?
boston accents are ass
Tell me you've never been to rural Maine without telling me
If you want an accent that's ass, try the Maine Fisherman sometime
T410
from my experience i have used ESP-32 and streamed it to a laptop and did OpenCV and it was pretty smooth
just need a decent fan for it though
It's like the Boston accent except filtered by copious amounts of fentanyl and alcohol
was only doing basic facial recognition
espcam32
are sick
😉
<£10 for an ip cam
i honestly hate the new york accent now
people try so hard to imitate it
the worst part is when the europeans say it's the same as boston.
we've started wars over lesser insults.
Man
they just end up sounding like they got a dick in their mouth
Remember, the Boston vs NYC rivalry is so strong that the sports games are broadcast nationally.
And politicians have lost elections by supporting the new york team in massachusetts.
@lunar haven ello govenor
i used it to turn on and off my lights when i was on vacation
and sent photos to my discord account to check here and there
but you really need a fan for it
It's a heckin' chunker
The face recognition not firmware its software
Yup i did this
i was going to add a 2 factor bio lock to my workshop
but in the end decided it was a bad idea
i wanted to do distributed computing with 2x raspi 3B+ via a switch , boot .... openCV is .... to much
what about a , PineA64 , 2Gig ???
2 gig would be too little
i wanted one of those
it has 2 GPU cores on it
@amber raptor I'm sorry
what OS is flexible on a RP3B+ if i want to do signal processing , external ADC and logic interfacing , im not using GPIO , via USB
ubuntu is stable -- but is theres something better?
khali linux ?
i tried lots of OS on pi , but ubuntu worked ... i have no idea if there is something WOW out there
https://aiomultiprocess.omnilib.dev/en/stable/ Seems interesting
@gentle flint If only I knew about this back when you were doing your thing
Even PI even though its nice its nothing cool
the Nvidia microprocessor or whatever it was called was very cool
Ok controversion opinion ARM just sucks
ERR_MSG
it should be constant
i use ubuntu 32 bit , for RPi jukebox , but ... is raspian better for bit flipping via python
peace dude
process_functions = [functions_here1, functions_here2, ...]
for function in process_functions:
_1, _2 = function(qos_package)
sm_report_qos.update(_1)
sm_qos_run_log.update(_2)
if not _2:
sm_qos_run_log['Retry'] = True
From today through April 16, we invite you to review the current draft of the updated Rust Trademark Policy and share any feedback you might have using this form.
Your responses will help us ensure the Rust Trademark Policy is useful for all! 🦀
175
I have a question. Is there any other way to say hello other than hi?
😉
Oh thanks
this is fucking insane
Can I use the Rust logo as my Twitter Avatar?
We consider social media avatars on personal accounts to be fair use. On the other hand, using Rust trademarks in corporate social media bios/profile pictures is prohibited.
A sequence diagram or system sequence diagram (SSD) shows process interactions arranged in time sequence in the field of software engineering. It depicts the processes involved and the sequence of messages exchanged between the processes needed to carry out the functionality. Sequence diagrams are typically associated with use case realizations ...
That looks awful in dark mode
ur mom looks awful in dark mode
ayo dont make it personal
https://www.npr.org/sections/health-shots/2022/08/01/1113825311/alzheimers-researchers-are-looking-beyond-plaques-and-tangles-for-new-treatments @narrow salmon I don't think this is the one I was thinking of but it's the one I can find at the moment
Trying to find the talk or paper, just not sure where or how to look
Thats all good! I can look it up using this, Thank you!!
@thorn wharf Your typing is coming through, brother
sorry bout that
Way healthier than my diet, that's for sure.
All good, just give you a heads up
*click click click click click click click *
Haha 😆
goodest boy
her name is Garlic 🧄
My Cat Likes to Hide in Boxes is a very popular New Zealand children’s book, which has also attained popularity in the United Kingdom and Canada. It was written by Eve Sutton and Lynley Dodd, cousins-in-law. The book was first published in 1974 and won the 1975 Esther Glen Award.According to Dodd, the book is based upon the "Dodd family cat, Woo...
beautiful :')
I'll be back when I get in the van. Delivery/mail run
@midnight agate I forgotten a prior apointment, my apologies..I tried to cheat while sitting here waiting to create this sequence thing you suggested.. but alas, I dont think it did a very good job.
epic fortnite gamer thanks cool
pg family friendly
Greatest Chinese Meme ever? The Leader of the Cenation sings about the Government of China and how much he loves his Ice Cream. #WWE #Food #SummerOfCena
Follow WWE x Figures on YouTube for more exciting action!
------------------------------------------------------------------...
welp im not qualified to speak yet 😦
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
i still need to use the server a bit
I'm taking a break now.
Sanbeiji (simplified Chinese: 三杯鸡; traditional Chinese: 三杯雞; pinyin: sānbēijī; Wade–Giles: San1-pei1 chi1; Pe̍h-ōe-jī: sam-poe-ke; lit. 'three-cup chicken') is a popular chicken dish in Chinese cuisine and one of the most iconic dishes of Jiangxi cuisine. The dish originates from the Jiangxi province of southern China, and is a specialty of Ning...
Are you having a conversation about food?
ohhhhh
yup
vodka pasta to be exact
what does the vodka do
Just fry it
the word taco doesn't sound like a word at all https://www.youtube.com/watch?v=npjF032TDDQ
If you'd like to help the homeless, please consider donating to these organizations-
Feeding America: https://www.feedingamerica.org
The National Alliance to End Homelessness: https://endhomelessness.org
In West Palm Beach Florida-
The Lord's Place: https://thelordsplace.org
#parrygripp #rainingtacos #tacorock
Animation by the awesome BooneBu...
honestly no idea, you dont taste it like that but its just a cooking thing
ohh its a solvent
Speaking of food, I think that Korea is so obsessed with kimchi
Because there is a refrigerator dedicated to kimchi in Korea and there is a habit of making all the ingredients in the world into kimchi.
not a bad obsession its good for your gut
probiotic
The habit of making something is good, but it's too much. Basically, there is kimchi made of cabbage and radish, but furthermore, there is celery kimchi, coriander kimchi, and durian kimchi. 😆
fr
is @rugged root driving rn?
yup
understandable
yo
yo yo
im stupid
understandable
so we had a math test today
Math is my specialty.
1 + 1 = 3 right?
its 103f here
correct
there was this cute girl in the hall tho-
man(1) + woman(1) =3 After that, think about it on yourselves
I'm sorry. It was just a lame joke
80 here
lemmi in there aaaaaa
we have a river here too its still ofnaoefo hot
11 here
and humid
111 ? or just 11
11
waw
wot?
lemmmi in there-
It's a little chilly
bro farenhite or celcius?
kelvin
51.8 in Fahrenheit
web sockets?
wtf
h7
Win by sacrificing 10 pawns and summoning the Checkmate Ghost Soldier
tonight - fettuccini and scallops , not sure what sauce
but i sure do love bernaise sauce
for i, size in enumerate(sz[s_i: s_i + current_sc],
s_i, + 1):
...
for i, size in enumerate(sample_sizes[sample_indx:
sample_indx + current_sc],
sample_indx, + 1):
...
that style...
you can replace inline if with an if block, if you want better looking multi-line
hi
why is there enumeratein the second loop?
seems like you're just discarding the index anyway
you ignore the start anyway
!e
print(list(x for _, x in enumerate([0, 1, 2])))
print(list(x for _, x in enumerate([0, 1, 2], 1)))
print(list(x for _, x in enumerate([0, 1, 2], 2)))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | [0, 1, 2]
002 | [0, 1, 2]
003 | [0, 1, 2]
start only affects yielded indices
and you ignore them
these two do the same:
for _, element in enumerate(array, start): ...
for element in array: ...
for size in sz[s_i:s_i + current_sc]:
I have no idea what that code does
@lunar havengood job men!
this should be a separate method
self.f.seek(offset)
self.f.read(size)
class ...:
def read(self, offset: int, size: int) -> bytes:
self.f.seek(offset)
return self.f.read(size)
code currently has
self.f.seek(offset)
samples.append(self.f.read(size))
with this method, it'd be
samples.append(self.read(offset, size))
class ...:
def samples_of_a_chunk(self, chunk_offset: int, sizes: Iterable[int]) -> Iterable[bytes]:
sample_offset = chunk_offset
for sample_size in sizes:
yield self.read(sample_offset, sample_size)
sample_offset += sample_size
for sample in self.samples_of_a_chunk(chunk_offset, sz[sample_i:sample_i + current_sc]):
samples.append(sample)
yield will have to be in a separate method
you broke the type signature by putting it in the same method
the method is called parse_samples not samples
that's why the error
yes, inside
exiting with closes the file
return type is now typing.Iterable[bytes]
you need to import it
(either typing or Iterable)
from typing import Iterable
def f() -> Iterable[int]:
yield 1
from __future__ import annotations isn't necessary
from typing import Iterable
yield is more memory efficient on large sequences
Iterable not Iterator
you imported the wrong thing
Iterable has .__iter__
Iterator has both .__iter__ and .__next__
for index, (a, b) in enumerate(zip(a_s, b_s)):
...
if it doesn't argue about accessing the closed file, then it should be fine called after with
this
this is step 1
this is step 2
first, factor out file reading logic
(add the method read)
it's just read
or read_sample (singular; one sample)
this is all it does:
...
def read_sample(self, offset: int, size: int) -> bytes:
self.f.seek(offset)
return self.f.read(size)
it reads size bytes starting at offset
now, in .samples()
yield self.read_sample(sample_offset, size)
yes
to make the code more clear
this factors out the whole loop
or, rather
the whole second inner loop
def samples_of_a_chunk(self, chunk_offset: int, sizes: Iterable[int]) -> Iterable[bytes]:
sample_offset = chunk_offset
for sample_size in sizes:
yield self.read(sample_offset, sample_size)
sample_offset += sample_size
and in .samples()
yield from self.samples_of_a_chunk(chunk_offset, sz[sample_i:sample_i + current_sc])
yield from
.f.read
.f missing
can be separated in two lines to reduce line length:
sample_sizes = sz[sample_i:sample_i + samples_per_chunk]
yield from self.samples_in_chunk(chunk_offset, sample_sizes)
yield from iterable
same as
for element in iterable:
yield element
!d yield from
7.7. The yield statement
yield_stmt ::= yield_expression
``` A [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield) statement is semantically equivalent to a [yield expression](https://docs.python.org/3/reference/expressions.html#yieldexpr). The yield statement can be used to omit the parentheses that would otherwise be required in the equivalent yield expression statement. For example, the yield statements
```py
yield <expr>
yield from <expr>
``` are equivalent to the yield expression statements...
yield from got introduced in python 3.3
yield from is quite commonly used
chunk_samples()
VS Code has a shortcut for black
I have it as alt+shift+f
nononono
wrong formatter
there was a button to use black instead of autopep8
autopep8 is weaker
and has different defaults
there is Git GUI on the left
but for faster CLI experience, there's probably nothing
this in settings
sample_i+samples_per_chunk may be made into a separate variable
idk what to name it
it has meaning of chunk_end in some sense
with sample_i being chunk_start
so the slice is [chunk_start:chunk_end]
and the assignment would be chunk_start = chunk_end
sample_i:chunk_end not sample_i:sample_i + chunk_end
sample_i = chunk_end
instead of adding
in sample_i +=
with sample_i renamed to chunk_start it makes more sense
it's start/end in sample terms not in byte terms
how often is if condition false?
if you add counter to the else branch, what the number would be?
just to make sure it gets called at all
like
counter = 0
for ...:
if ...:
...
else:
counter += 1
print(counter)
ok, it's 1
it shows
.
(I didn't understand at that point why that code meant anything)
def chunks(self) -> Iterable[tuple[int, int]]: # chunk_offset, samples_per_chunk
co = self.moov.chunk_offsets()
sc, first = self.moov.samples_per_chunk()
sc_i, next_run = 0, 0
for i, chunk_offset in enumerate(co, 1):
if i >= next_run:
...
yield chunk_offset, samples_per_chunk
def samples(self) -> Iterable[bytes]:
...
for chunk_offset, samples_per_chunk in self.chunks():
...
just moving samples_per_chunk logic into a separate method
(highlighted parts are separated into a different method)
there is a way to do it with the same amount of loops, but it involves callbacks and other not-so-readable techniques
yes, .chunks()
you can even define in moov class
comment isn't necessary
(it was just for me not to forget what I was writing)
yield is necessary
and samples() gets its loop replaced with
for chunk_offset, samples_per_chunk in self.chunks():
it's quite smart actually suggesting that
because
chunks method can be moved to moov
the only thing from self it uses is self.moov
in chunks() self is used twice
self.moov.chunk_offsets()
self.moov.samples_per_chunk()
which implies that .chunks() method only requires moov
depending on what moov means, you might move the method to its class
but if it's more tightly coupled to .samples() logic, it can be kept where it is now
what's the code of chunk_offsets method, again?