#voice-chat-text-0
1 messages ยท Page 1034 of 1
you can check a help channel #help-pineapple
yah bmi calculator
bmi calculator
name1 = "Anish"
height_m1 = 2
weight_kg1 = 90
name2 ="Anika"
height_m2 = 1.8
weight_kg2 = 70
name3 ="Ravi"
height_m3 = 2.5
weight_kg3 = 160
def bmi_calculator(name, height_m, weight_kg):
bmi = weight_kg / (height_m ** 2)
print("bmi: ")
print(bmi)
if bmi < 25:
return name + " is not overweight"
else:
return name + " is overweight"
result1 = bmi_calculator(name1, height_m1, weight_kg1)
result2 = bmi_calculator(name2, height_m2, weight_kg2)
result3 = bmi_calculator(name3, height_m3, weight_kg3)
print(result1)
print(result2)
print(result3)
this is the code
i had problems getting the results with it
ahhh no worries
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
don't forget to test it)
it works but the problem i had was when i changed the sequence from def bmi_calculator(name, height_m, weight_kg) to def bmi_calculator(name, weight_kg, height_m) the value also changes i wamted to know the reason behind this
you switched parameters in function, but didn't change them in function call
can u pls explain it in a little more detail
@rugged root do you know any way to do SSO integration of social media, with Python? using Django Rest Framework like login and such authentication?
I know it's possible but I've never done it myself. #web-development would be the folks to ask
thank you man
msym/linalg/matrix.py lines 5 to 10
def __init__(self, rows, cols, name="M", fstr='{}_{}{}'):
self.rows = rows
self.cols = cols
self.name = name
self.fstr = fstr
self.data = [[Symbol(fstr.format(name, i, j)) for j in range(cols)] for i in range(rows)]```
Reason lets you write simple, fast and quality type safe code while leveraging both the JavaScript & OCaml ecosystems.
from contextlib import contextmanager
@contextmanager
def cleanup():
yeild
exiter(True)
Also wonder how much bit flipping and other issues you have at that number
from contextlib import contextmanager
@contextmanager
def openFile(filename):
f = open(filename)
yeild f
f.close()
๐ณ
!docs contextlib.contextmanager
@contextlib.contextmanager```
This function is a [decorator](https://docs.python.org/3/glossary.html#term-decorator) that can be used to define a factory function for [`with`](https://docs.python.org/3/reference/compound_stmts.html#with) statement context managers, without needing to create a class or separate `__enter__()` and `__exit__()` methods.
While many objects natively support use in with statements, sometimes a resource needs to be managed that isnโt a context manager in its own right, and doesnโt implement a `close()` method for use with `contextlib.closing`
An abstract example would be the following to ensure correct resource management:
class contextmanager:
def __init__(self, func):
self.func = func
def __call__(self):
self.iter = self.func()
return self
def __enter__(self):
return next(self.iter)
def __exit__(self, exception_type, exception_message, traceback):
try:
next(self.iter)
except:
pass
@contextmanager
def foo():
print("hello")
yield 5
print("bye")
with foo() as x:
print(x)
@quasi condor :white_check_mark: Your eval job has completed with return code 0.
001 | hello
002 | 5
003 | bye
Right guys, Ill head out now. Catch y'all later!
type(prov) is NatureProvider:
isinstance(prov, NatureProvider)
index = providers.index(
sorted(
zip(
[i.curr.initiative for i in providers],
[1, 0],
providers
)
)[-1][-1]
)
!d max
max(iterable, *[, key, default])``````py
max(arg1, arg2, *args[, key])```
Return the largest item in an iterable or the largest of two or more arguments.
If one positional argument is provided, it should be an [iterable](https://docs.python.org/3/glossary.html#term-iterable). The largest item in the iterable is returned. If two or more positional arguments are provided, the largest of the positional arguments is returned.
There are two optional keyword-only arguments. The *key* argument specifies a one-argument ordering function like that used for [`list.sort()`](https://docs.python.org/3/library/stdtypes.html#list.sort "list.sort"). The *default* argument specifies an object to return if the provided iterable is empty. If the iterable is empty and *default* is not provided, a [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "ValueError") is raised.
max(lst, key=lambda provider: provider.curr.initiative)
!timeit
import random
from dataclasses import dataclass
@dataclass
class Test:
a = random.randint(1,10)
a_random_list = [Test() for i in range(10)]
sorted(a_random_list, key=lambda x: x.a)
!timeit
import random
import operator
from dataclasses import dataclass
@dataclass
class Test:
a = random.randint(1,10)
a_random_list = [Test() for i in range(10)]
sorted(a_random_list, key=operator.attrgetter("a"))
I am the wrong
if random.choices([True, False],
weights=[(enem.curr.full_hp / enem.curr.hp)
* chance + catch_chance,
enem.curr.full_hp], k=1)[0]:
@alpine path https://pdm.fming.dev/latest/
@amber raptor ^ all the ways for the different shells (there's also activate.bat for bat)
@vernal bridge
try:
main()
finally:
exiter(True)
Sehen Sie sich den Dell XPS Plus 33,02 cm (13")-Laptop mit Intel Core Prozessoren der 12.ย Generation mit modernem Design oder alle Dell XPS Laptop-Computer auf Dell.com an.
len([poke for poke in pokes if poke.identifier != "__fallback__"])
sum(poke.identifier != "__fallback__" for poke in pokes)
@woeful salmon why neovim over vim?
In this video I'll dive into some of the ways Git allows us to rewrite commit history. Specifically I cover: amending commits, rewording commit messages, deleting commits, reordering commits, squashing commits and splitting commits.
Check out my full writeup and reference guide here: https://www.themoderncoder.com/rewriting-git-history/
Or if ...
Doom vs Dune
I appreciated it
Genome-wide CRISPR-Cas9 knockout screens aim to elucidate the relationship between genotype and phenotype by ablating gene expression on a genome-wide scale and studying the resulting phenotypic alterations. The approach utilises the CRISPR-Cas9 gene editing system, coupled with libraries of single guide RNAs (sgRNAs), which are designed to targ...
tracrRNA
A BioProject is a collection of biological data related to a single initiative, originating from a single organization or from a consortium. A BioProject record provides users a single place to find links to the diverse data types generated for that project
oh rip i can't speak ;-;
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
hi
Hi @magic obsidian
Hi
fun fact chmod 777, in binary, is chmod 111 111 111, referring to the permissions you're giving to the files
so chmod 744 would be chmod 111 100 100, meaning you're giving full rwx permissions to owner, and only r permissions to group and user
It's surprising how many very knowledgable people don't know that so
!e py octal = "777" decimal = int(octal, base=8) binary = format(decimal, "b") print(octal) print(decimal) print(binary)
@somber heath :white_check_mark: Your eval job has completed with return code 0.
001 | 777
002 | 511
003 | 111111111
Opal octal is a base 8 system, so to convert to decimal you would just do this: (7*(8^2)) + (7*(8^1))+(7*(8^0))
similarly binary is a base two system, so 111 would be (1(2^2)) + (1(2^1))+(1*(2^0))
hence 7
so instead of memorizing the chmod codes or look them up everytime, it's easy to figure them out based on the permissions you want to give the files
test
.!opalmist voice-verify-help
we need tts with opal's voice lol
sets up recording for next time.
Source Attribution:
https://www.youtube.com/watch?v=UsVfElI-7oo
โบ For more sound effects/music for your videos check out Artlist (Get 2 free extra months when you subscribe) - https://bit.ly/artlist2months
FAQ:
โบ How do I download this sound effect/music?
There will be a link at the top of the description if you are allowed to download and us...
!e ```py
def func_a():
for i in range(10000):
if i % 2 == 0:
yield i
def func_b():
result = []
for i in range(10000):
if i % 2 == 0:
result.append(i)
return result
for n in func_a():
if n == 100:
print("Found")
break
for n in func_b():
if n == 100:
print("Found")
break```
@somber heath :white_check_mark: Your eval job has completed with return code 0.
001 | Found
002 | Found
@woeful salmon Do you use textual on Windows? Does it just work โข๏ธ ?
srry i missed the ping but no i have not used textual on windows (for cli apps i usually just use ncurses)
but it does seem to be working
Mm. Thanks for confirming. There is something wrong with my setup then.
๐คทโโ๏ธ i just created folder -> created venv -> activated -> pip install textual -> copy pasta example from their page
and ran it
Is this in Windows Terminal?
You can test with -m textual.app.
ok powershell 7 and windows terminal just works but powershell 7's default window still has artifacts left after closing app
windows powershell and command prompt both give blank screens when started and magically start working on resizing window but also leave behind artifacts after closing
That fits my experience too.
I will update this on the GitHub discussion. I can credit you for testing if I can know your username!
ah i think you missed the part about powershell 7 but
it has this issue after closing the app
no blank screen but this still happens
so it doesn't clear the screen :x
Oh. So buggy even on PowerShell 7.
samurai ra
def solution(string, ending):
if ending is string:
return True
if ending in string[1:]:
return True
return False```
lol found fix too...
Ooh?
def solution(string, ending):
return ending == string[-len(ending):]
Hope I did not spam everyone with my edits on GitHub!
manually copying an example and adding import os; os.system("") to the top of the example
makes it work on cmd
and powershell
both 7 and windows
its a common fix for making ANSI work on windows idk why it makes textual work too but it does (i would've assumed them to already be doing a windows ANSI fix if they're using it :x)
try testing with ```py
import os; os.system("")
from textual.app import App
from textual.reactive import Reactive
from textual.widgets import Footer, Placeholder
class SmoothApp(App):
"""Demonstrates smooth animation. Press 'b' to see it in action."""
async def on_load(self) -> None:
"""Bind keys here."""
await self.bind("b", "toggle_sidebar", "Toggle sidebar")
await self.bind("q", "quit", "Quit")
show_bar = Reactive(False)
def watch_show_bar(self, show_bar: bool) -> None:
"""Called when show_bar changes."""
self.bar.animate("layout_offset_x", 0 if show_bar else -40)
def action_toggle_sidebar(self) -> None:
"""Called when user hits 'b' key."""
self.show_bar = not self.show_bar
async def on_mount(self) -> None:
"""Build layout here."""
footer = Footer()
self.bar = Placeholder(name="left")
await self.view.dock(footer, edge="bottom")
await self.view.dock(Placeholder(), Placeholder(), edge="top")
await self.view.dock(self.bar, edge="left", size=40, z=1)
self.bar.layout_offset_x = -40
# self.set_timer(10, lambda: self.action("quit"))
SmoothApp.run(log="textual.log", log_verbosity=2)
That is very interesting. New tricks for me! I am guessing it initialises stdin/stdout somehow.
def solution(string, ending):
return ending == string[-len(ending):] if ending else True
๐คทโโ๏ธ i've just seen it alot when helping people make ansi escape codes work on windows
i think colorama also somehow handles this when you do convert=True in initializing it
but idk how they've implemented the fix
def solution(string, ending):
return string.endswith(ending)```
Another alternative is not ending or other_condition, I think.
๐ anyways i need to go now so cya later ig
Fairly new, I think.
Cool
When all else fails while helping, link to this catch-all tutorial: https://www.youtube.com/watch?v=dQw4w9WgXcQ
!d str.endswith
str.endswith(suffix[, start[, end]])```
Return `True` if the string ends with the specified *suffix*, otherwise return `False`. *suffix* can also be a tuple of suffixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing at that position.
Oh wait its not a string module thing Xdd
I trought it as from string module
Coooolllllll
I can finally spare the [:-3]
Lol
Mm.
Ooh. endswith has always been there. I confused it with removesuffix.
Removesuffix does what?
!d str.removesuffix
str.removesuffix(suffix, /)```
If the string ends with the *suffix* string and that *suffix* is not empty, return `string[:-len(suffix)]`. Otherwise, return a copy of the original string:
```py
>>> 'MiscTests'.removesuffix('Tests')
'Misc'
>>> 'TmpDirMixin'.removesuffix('Tests')
'TmpDirMixin'
``` New in version 3.9.
Sooo removesuffix only removes the string at the end
If im correct
Usefull for pathing?
I don't have an answer to that.
The last time I wanted to use it, it was for parsing an program stdout.
Something like this.
prefix = line.removesuffix(static_ending)
if prefix == line:
raise RuntimeError("Unexpected output from program.")
Is python great for mobile app development?
i wanna create a mobile app and i only know python, what should I do? Should I learn the syntax of another language and with what programs/apps should i work with? If anybody has any suggestion tag me or dm me pls.
No. Also yes. But mostly no.
Do check out Kivy and Beeware.
Web deployment may be a viable alternative to apps.
hey why is everyone in the staff chat?
Staff meeting 
like amongus?
It's every other week at 19:30 UTC, and we just discuss improvements to the server etc.
Right now we're talking about possibly changing a server rule.
๐ we're finding the the imposters yes
@somber heath bruh
damn i'm somewhat a staff myself why am i not in ;'c
@light python https://soundcloud.com/luiz-felipe-taborda/tracks
Listen to Luiz Felipe Taborda | SoundCloud is an audio platform that lets you listen to what you love and share the sounds you create.
[num for num in range(1, 10**38) if "9" in str(num)] still can't handle 10**38
shall i do live coding
If you feel like it, completely up to you
I feel like there's definitely gonna be flood of people though haha
anyhow
I'll start in a few mins
@swift valley I don't know quite know how hemlock likes to enforce the rules but we have the channel #764232549840846858
TL-PA7017 KIT uses HomePlug AV2 technology to extend your wired internet. With Gigabit Ethernet port, it ensures high speed wired connection, providing data transmissions of up to 1000Mbps and allowing smooth transmission of Ultra HD video streaming. This makes the TL-PA7017 KIT the perfect home ...
From the manufacturer Excellent Performance Integrated power socket, no power socket goes to waste Gigabit Ethernet port for fast data transfer Power saving mode for 85% less energy consumption Model:1000Mbps w/Passthrough PH6 is a power line adapter designed for 3D/HD video streaming and home en...
import selenium
py -m pip install selenium
@whole bear Probably better to ask your question here. More eyes on a problem means more people to see and help
Ah okay!
So, pretty much I have this python bot which I have complied to an exe file. Every-time I open the exe file it flashes and then dissapears instantly. The bot does commands etc.
I just followed the instructions of the github.
It's a specific website bot
I may have an idea on how to resolve this issue without compling which isn't needed
Good. Yeah, putting it into an exe, especially for a discord bot, isn't really the best practice
@rugged root https://i.imgur.com/Cdm8l48.png while using pycharm
You'll need pip @distant kestrel
i have installed it
Ah!
from functools import lru_cache
@lru_cache
def sol(n):
#print(n)
if not n: return 0
if n == 9: return 1
l = int(math.log10(n))+1
s = str(n)
total=0
#print('try',10**(l-1)-1,(int(s[0])-1))
# total += sol(10**(l-1)-1)*int(s[0])
total += (10**(l-1)-9**(l-1))*int(s[0])
if s[0] == '9': total += int(s[1:])+1
elif len(s)>1: total += sol(int(s[1:]))
#print(f'total for {n} is {total}')
return total
Okay, Andersson. Go to File -> Settings -> Project: [project name here] -> Python Interpreter
Should look something like: @distant kestrel
im there
So, my stepson has a girl upstairs in his room that stayed the night and my wife doesn't know yet. I'm curious on how he plans to smuggle her out now that the whole family is awake...
...and now we wait.
364006
78610
i love you
it works now
Nice
That was a rollercoaster of emotion and I loved every moment
Just realized that I didn't have windows power settings to adjust based on whether or not I'm charging.
So like what, was it in high power mode both ways?
Nope it was underclocking my cpu even when I was plugged in.
Niiiiice
Yay so much lost performance.
Dude your memory consumption
๐
https://i.imgur.com/5aMWS1a.png what does one do
Hit Use Python 3.10 blah blah blah
ah
teaching memoization nice
Can't have more than 9 tabs open in chrome. This is part of the reason I think the web needs to be seriously optimized in some form.
Agreed
That's tough to do, though
Especially with JS. The best we can do there is minifying
i have so much i hate here from the if and else with the next line in the same line and the 1000 files in a single folder
Yeah I know. I think there are a lot of new web tools that have the right idea. It just annoys me when I open a new window with a pdf in it and that tab still takes a lot of memory.
?
in the screenshare
It took me a second to understand that first half.
๐ just use a bundler and let it do it for you
I recently worked on a PureScript library that eliminated recursion errors for free
Had to do some very magical tricks but it ended up being super fast
NetPBM.
One of several iterations of the format.
What I first used before I came across Pillow.
Hoooowwwwww
In functional programming, continuation-passing style (CPS) is a style of programming in which control is passed explicitly in the form of a continuation. This is contrasted with direct style, which is the usual style of programming. Gerald Jay Sussman and Guy L. Steele, Jr. coined the phrase in AI Memo 349 (1975), which sets out the first versi...
Oo, neat
Pirate programming. Arrrgs.
Dude, host
WHyyyyyyyyy would you do that to yourself
Just looking at the example in the wiki
A purescript core team member walked me through the approach ๐
Frankly I have a very surface level understanding of it but I'm confident my package already being used in production somewhere
@ivory stump why not use a dict at the global level then mutate that?
@rugged root ๐ i hate that cuz finally runs after exceptions too which means it will run cleanup after SIGINT but it does not handle SIGTERM
too complex
it doesn't gracefully shutdown
Huh, okay that I didn't know
ye if you want graceful shutdown with your cleanup code properly running you need to use the signal module
to handle SIGTERM
Another library I forgot existed
its been two hours , yet stackoverflow is offline
i use it on my linux vm for a command along with SIGALRM
๐ข
Oh hey Cheeki's talking
@ivory stump you're moderator
moderate yourself
hemlock doesn't need to do it lol
ello @ivory stump
cheeky
he's cracked
i just realized
how good golang is
i literally made a decent backend in less than an hour without prior experience
meanwhile
java spring boot :/
ctx = inspect.stack()[1].code_context[0]
if re.search(rf"^(.*?)(\bawait (.*?){coro.__name__}\b)(.*)$", ctx):
meanwhile my neovim which has almost all features vscode has at this point
If I paste a small piece of code could someone explain plz
class Client(object):
@property
def client(self) -> Tuple[cloudscraper.CloudScraper, str]:
platforms: list = [
'ios',
'android',
'windows',
'darwin',
'linux'
]
session: cloudscraper.CloudScraper = cloudscraper.create_scraper(
browser={
'browser': 'chrome',
'mobile': True,
'platform': random.choice(platforms)
}
)
ua = session.headers['User-Agent']
return session, ua
What does the @property decorator really do here
I don't get the point of it
i only see like 6 processes
its a feature of the PSFzf powershell module
uses fzf with Get-Process and kills the one i selected
as in what @property does or why its there
in the latter case, its a little strangely done as it makes a new client each time so looks like it should be used only once
in which case why save the brackets instead of a constructor method
you might argue that it looks neater for threading purposes
well yeah, I just call it once further down in the script
client, ua = Client().client
u code Java in neovim
wow
that must be hella hard
๐ no? i can code everything from assembly to python to lua to c# in my neovim
@ivory stump Like what's the benefit of the @property there, if I just remove it and call ```py
client, ua = Client().client()
i'd say literally none, at least in your case
gives me lsp autocompletion, refactoring, snippets, auto generates getters , setters and all that for me
- has a git client much better than vs code's built in
So what's with the threading
i just use git cli
me too but some things are easier to do from inside the editor
also its much faster as in Neogit which is the git client every action is 1 key away
rather than 1 command
for _ in range(50):
threads.append(Thread(target=f,args=(Client().client))
``` ๐คท i was thinking kinda sweeps under the hood that they're different sessions
an easy example scenario where the commandline would be slower
i wanna commit 5 out of the 10 changes i made from my current file, need to reset all the other changes and then change branch and then commit and push
Neogit and Gitsigns i press <leader>hs on each hunk of changes i wanna stage, then <leader>hr to reset other hunks of changes, <leader>ng to start neogit and then b to change branch and choose using j and k or fuzzy search branch name and C to commit and P to push :x
commandline git add --patch <- already more than half keypresses and now i have to interactively find the hunks and do all that crap
then type out all the full commands for git checkout <branch_name>, git commit, git reset --hard HEAD, git push origin HEAD
ima go now, cya
hello
hi
@mystic kernel #data-science-and-ml
Looking ahead, there is a month remaining of my internship here at COMPANY..
Working here I have learned a lot about software development with the help of our team's developers.
I would like to discuss converting this into a full-time role as a Junior Backend Software Developer.
What do you think?
I look forward to continuing to work with our team here at COMPANY NAME until July 29th.
If someone may give feedback ๐
Do you know how I can fix this? bit confused.
Can you link the repo? It's likely a library wasn't installed or something
Of course, let me upload it
I'm new to learning coding so I ain't a pro or anything lmfao, I'm learning by re-writing etc
No no, more talking about needing to see the code. Better to just upload the scripts themselves rather than a zip
Ah alrigh!
even if you don't want to take time making a good configuration, there is "space vim" (i don't like it but it exists) that is especially good for java
https://github.com/Replayyyy/Tinychat-Bot/blob/701c78edeb95f2826e1c5309f5a3fae67aa20da7/page/__init__.py#L25-L26
I'd try to add a . before acc and privacy in that file
page/__init__.py lines 25 to 26
from acc import Account
from privacy import Privacy```
It's the only thing I can think of off the top of my head
Yeah, that would probably do it
Should
Did you create your own console?
It was from this but I change it from python 2 to python 3 using 2to3.
https://github.com/nortxort/nortbot
Have you installed all the requirements?
I have yeah
util/console.py line 104
class Console(ChatLogger):```
Yeah, they're all there
You'll just have to go through all the local imports and add the . to make them relative
Alright
How do I fix the "Cookies must be enabled to use GitHub." problem?
doing some work with the request module.
url = "https://github.com/session"
# disposable account is used so dont try anything :)
data = {
"login": "EllieBellieFellie",
"password": "@Abdddd",
}
r = requests.post(url, data=data)
print(r.text)
print(r.status_code)
Use their API
Don't try to scrape
Also, delete this and change your password
ayo
# disposable account is used so dont try anything :)
gordon ramsay is a developer
My new book: https://www.darkwebstersdictionary.com/
Upcoming feature film:
use api.github.com. hit a specific endpoint
what is "scraping"
What you're doing
what are u trying to do??
Say that i want to search for "Cute rabbits"
Use one of these instead -
https://docs.github.com/en/rest
https://docs.github.com/en/graphql
What's the site? Ideally if they have an API it's better to use that
GitHub
They most definitely do
use their api then
so that would be api.github.com?
they have a good documentation
oh
Yes, check out the getting started https://docs.github.com/en/rest/guides/getting-started-with-the-rest-api
@vernal bridge I'll have to think about this, but I think #game-development would know more
Nothing I'm coming up with is good yet
thx
thx
the only use
of what u were doing is
deleting user accunts
or stealing passwords, emails, 2fa, mobile
wow vc is weird todday
lmao
Not quite.
its wonderful
Selenium's original purpose is to do automated site testing
It's only later that they started to label themselves as a tool for scraping
i used it to farm youtube views ๐
Yes, because everything somehow involves a blob, or saving everything on a server
Rust
Still no .
@rugged root you guys look channel by id?
What do you look by?
As opposed to the soft ID?
or the bot can just make the channels
oo what's this?
https://github.com/greyblue9/scratchpad/pull/1
all of them slash commands?
Grey forked my scratch repo to make a joke PR, and his AI thing PR'd my AoC solutions
You can do it @rugged root !
Actually - @rugged root - Do you want to join my thing?
"let's build a x"
haha
i don't see ruby
:god-bless:
ruby on rails sucks
7B devices use Java
Simcards
are among the most notable
Also, all major comapnies use Java
it has a very weird way of doing things, but you can get used to it
c# is microsoft java clone ripoff
syntax says it all
Thoughts on this?
I remember someone saying not to do this because it's less readable
Which lines specifically?
good company
The sum?
santa knocks
You should use Rust
@sweet lodge they don't even have a study for ruby on rails
children are just expensive dlc
jetbrain has no respect for ruby on rails
JetBrains literally makes RubyMine which comes with a Rails template built in
what
it is easy to bully u
๐ข
Not - ummm, not necessarily, I'm just saying it's not quite dead yet, there are a few big projects in it
You the aspiring developer shouldn't use it
I wonder what GitHub will look like when they leave RoR?
class DCMotor:
def __init__(self, pin1, pin2, enable_pin, min_duty=750, max_duty=1023):
self.pin1=pin1
self.pin2=pin2
self.enable_pin=enable_pin
self.min_duty = min_duty
self.max_duty = max_duty
def forward(self,speed):
self.speed = speed
self.enable_pin.duty(self.duty_cycle(self.speed))
self.pin1.value(0)
self.pin2.value(1)
def backwards(self, speed):
self.speed = speed
self.enable_pin.duty(self.duty_cycle(self.speed))
self.pin1.value(1)
self.pin2.value(0)
def stop(self):
self.enable_pin.duty(0)
self.pin1.value(0)
self.pin2.value(0)
def duty_cycle(self, speed):
if self.speed <= 0 or self.speed > 100:
duty_cycle = 0
else:
duty_cycle = int(self.min_duty + (self.max_duty - self.min_duty)*((self.speed-1)/(100-1)))
return duty_cycle
๐
They've already started rewriting chunks in Go
https://github.blog/2022-04-21-improving-git-push-times-through-faster-server-side-hooks/
Significant IT-related experience with debugging and writing in programming languages like Python, Go, Java, JavaScript/NodeJS, or Ruby
i doubt they actually use ruby that much nowadays
i don't know how reliable go is in production
It's fine in production?
but in a development sate , imo its among the best languages
its quite easy to learn the language, and its straightforward
unlike java per say
Your Kubernetes experience says hello
but yk, its a new community so
not that many import options
but very good documentation
if you were to use SQLx for example.
very powerful and well documented
Kubernetes work in production
it's just not the "Kubernetes is easy" that everyone makes it out to be
this is quite bold
but you really don't need kubernetes imo
its just like redis
just adds complexity
You take that back
On a more serious note - it's pretty neat
It's automated away almost my environment. It configures networking and DNS for me, it even gets a certificate from Let's Encrypt, and renews it, all on it's own
It runs multiple containers, handles all the ups and downs
Good code can't abstract away the need for caching
that's a bummer
this
@rugged root u down for voice 0?
It's not a great idea to set it to ~/.cache, because this directory is supposed to be temporary and could be cleared every so often. People also sometimes clear it as it tends to get quite larg...
from pathlib import Path
SAVEDIR = Path.home() / ".local" / "share"
with open(SAVEDIR / "x.json", "w") as f:
...
with SAVEDIR:
...
!d runpy
Source code: Lib/runpy.py
The runpy module is used to locate and run Python modules without importing them first. Its main use is to implement the -m command line switch that allows scripts to be located using the Python module namespace rather than the filesystem.
Note that this is not a sandbox module - all code is executed in the current process, and any side effects (such as cached imports of other modules) will remain in place after the functions have returned.
Furthermore, any functions and classes defined by the executed code are not guaranteed to work correctly after a runpy function has returned. If that limitation is not acceptable for a given use case, importlib is likely to be a more suitable choice than this module.
?
https://github.com/letsbuilda/programmer/blob/main/book/getting-started.md
I'd be interested in opinions.
It's still very much a work in progress
I feel like I added too many pictures, but I think I've convinced myself that pictures are a good thing, at least in the beginning
hey can u help me with something
Maybe
If I experience in what it's about
What's this about?
I don't help in DMs
You can ask here, or preferably, in #โ๏ฝhow-to-get-help
I think it's a little too granular compared to what I'm looking for.
There's guides on "how do I install python and get hello world to run" out there. But what would be good is an article that says:
Why do you want to learn to program?
How do you learn best?
Here's the course/courses for you
Here's the next steps to take after you've done whatever beginner course we recommended
don't
if i said it in time
it resets the requirements if you rejoin
oh shit
alr done : (
How can this be fixed? need help aha.
Hey!
I am unsure mate, if I was to get teamspeak could you possibly help? aha. I have no idea, I searched it up but I am confused
Teamviewer*
Ah! what could I use for remote access?
Oh sure!
I'll just upload it on replit
!paste
Pasting large amounts of code
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 floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
On in a bit. Have to change some lightbulbs here in the office
Did pip install web3
I don't quite understand it ๐ฅฒ
It's a web bot
Downloaded it
It's a bot with commands
I am using python3
Yeah
OH
Didn't see that lmfao
Got it from this
Trying to get this to work
It's a room bot
I kept getting errors so I was looking up and trying to resolve the issues
Nope
This is just a chat bot
With commands
Webclient socket
pip uninstall web3 then cd to the project folder
run it and tell us the errors
so we can help you through them ๐
oh then 1 sec
try running pip install websocket-client requests colorama beautifulsoup4 simplejson
then try running again
ah it says it only supports python 2.7
True ๐ข
Urgh
I just want a bot that can run commands and take action for this website, this whole process has been frustating
have you ever voice with a programmer girl
I mean... yes? We have plenty of users here that are programmers that also happen to be female
https://docs.python.org/3/library/2to3.html
there is a builtin tool for it
also you need to fix the imports
@wind plover If you're wondering why you can't talk, check out the #voice-verification channel
Hi @rugged root
Did you see this?
I only spent like five minutes on it so far, so it's not very pretty
I'm curious to see if people think there should be more or less details
Movie from: Silly Symphony - The Skeleton Dance - 1929
Mark Twain left school at 11 to become a typesetter's apprentice. I don't know what bell was ringing in my head. Might have been getting confused with Tom Sawyer or Huck Finn.
๐ข
๐ชต
i am a noob i have no rank
Unpaid internships are a class based gatekeeping system. If you can afford to not be paid while you get the training experience, then you have an inner track advantage over others who can't.
I'm currently in a "nutrition" seminar that is mandatory for work
Or at least that's something I've read that made sense at the time.
and it is unbelievably painful
Nootrition?
@rugged root a-noise you?
yeah, it's about the attrition of penguins in the land of Pingu
- never do unpaid internships
- tell others about how internships where you pay to do work are a scam
Can't wait for the new monogatari season :Dใ็ต็ฉ่ช2ๆๆฅฝใใฟ๏ฝโช
I released a new mini album at the Spring M3 on April 29th in Japan! Check out the album crossfade in the link below! ไปๅนดใฎๆฅM3ใงใใใขใซใใ ๅบใใพใใ๏ผใขใซใใ ใฏใญในใใงใผใใฏใใกใ: https://www.youtube.com/watch?v=FNjoQE3inZw
โปใใฎๅ็ปใฏๅฃฐ็ไผผใงใฏใใใพใใใ
โป ๅ็ปใฏใใกใใใใๅใใใพใใ / sm31119358
โป Mix & Encode / OFFๆง (mylist/5938950...
!tvmute 927893607850061826 3d Given your past infraction history, I think you've earned a time out. When someone asks you to stop being disruptive with a noise and asks you to mute, the proper response isn't "Just ignore it." Please review our #rules and #code-of-conduct. If this kind of attitude happens again, you will lose voice permissions permanently.
:incoming_envelope: :ok_hand: applied voice mute to @tranquil shoal until <t:1656082066:f> (2 days and 23 hours).
You are not allowed to use that command here. Please use the #bot-commands channel instead.
!user
You are not allowed to use that command here. Please use the #bot-commands channel instead.
or don't
#bot-commands
bruh did i seriously get muted for sending this?
@rugged root :(
Did you read the infraction message at all?
It was for the noise and refusing to mute for it
You can never get away from JavaScript - we just need to accept it
embrace the jjquery
BRUH I DIDN'T EVEN KNOW U WERE TALKING TO ME
SOMEONE WAS SNORING AT MY ROOM
Several of us said your name. Multiple times.
ahhhhh
idk how i missed it
no i wasn't trolling
except ImportError:
import ustruct as struct
_BME680_CHIPID = const(0x61)
_BME680_REG_CHIPID = const(0xD0)
_BME680_BME680_COEFF_ADDR1 = const(0x89)
_BME680_BME680_COEFF_ADDR2 = const(0xE1)
_BME680_BME680_RES_HEAT_0 = const(0x5A)
_BME680_BME680_GAS_WAIT_0 = const(0x64)
_BME680_REG_SOFTRESET = const(0xE0)
_BME680_REG_CTRL_GAS = const(0x71)
_BME680_REG_CTRL_HUM = const(0x72)
_BME280_REG_STATUS = const(0xF3)
_BME680_REG_CTRL_MEAS = const(0x74)
_BME680_REG_CONFIG = const(0x75)
_BME680_REG_PAGE_SELECT = const(0x73)
_BME680_REG_MEAS_STATUS = const(0x1D)
_BME680_REG_PDATA = const(0x1F)
_BME680_REG_TDATA = const(0x22)
_BME680_REG_HDATA = const(0x25)
_BME680_SAMPLERATES = (0, 1, 2, 4, 8, 16)
_BME680_FILTERSIZES = (0, 1, 3, 7, 15, 31, 63, 127)
_BME680_RUNGAS = const(0x10)
_LOOKUP_TABLE_1 = (2147483647.0, 2147483647.0, 2147483647.0, 2147483647.0, 2147483647.0,
2126008810.0, 2147483647.0, 2130303777.0, 2147483647.0, 2147483647.0,
2143188679.0, 2136746228.0, 2147483647.0, 2126008810.0, 2147483647.0,
2147483647.0)
_LOOKUP_TABLE_2 = (4096000000.0, 2048000000.0, 1024000000.0, 512000000.0, 255744255.0, 127110228.0,
64000000.0, 32258064.0, 16016016.0, 8000000.0, 4000000.0, 2000000.0, 1000000.0,
500000.0, 250000.0, 125000.0)
halp meh whats happening here
no one can tell you what is happening, no
hmm, can't hear anything... ok, back later
"religious people are more understanding" is definitely a bait
No amount of guilt can change the past, and no amount of anxiety can change the future.
locked for 1 week
Apropos of...?
Unitarians and Episcopalians are usually pretty reasonable
I'm emo
Yes, well... *gestures vaguely at everything*
locked?
We're getting UK census results within the next few weeks, and I'm excited to see "no religion" become 60+% of the population
My dad locked me
there's lots of lightning gods - but you've got to go to Blind Io for yer' thunder
I don't even know what program that is
Includes: Jesus Christ Vampire Hunter, Life of Brian...
Termius
I thought that was a gamecube
Basketball is the biggest sport in China
Also, South Park: Bigger, Longer, Uncut
Would have thought baseball, but I'm thinking of Japan I now realize
yeah, baseball is Japan
Ahh lol ๐
I remember seeing a map about this exact thing on Reddit the other day
it is apparently free on Tubi.
I mean if you don't have a backup key or your passphrase key, then I don't know. Did you try the "Forgot passphrase?" button?
Jesus Christ Vampire Hunter is a 2001 Canadian horror parody film from Odessa Filmworks which deals with Jesus' modern-day struggle to protect the lesbians of Ottawa, Ontario, from vampires with the help of Mexican wrestler El Santo (based on El Santo, Enmascarado de Plata, and played by actor Jeff Moffet, who starred as El Santo in two other Od...
@rugged root voice chats have built in chats by the way
u should look into it its cool
if you're holding your breath, it is emphatically not Scuba
because there is no self contained breathing apparatus
Odessa Filmworks.... not the same as Abraham Lincoln Vampire Hunter, Done by: Bazelevs Company, Dune Entertainment, and Tim Burton Productions
They do but I've been waffling about weather to use them. They're harder to see/use if you're not in VC, and I find them kind of unwieldy
fair. You cant use them on phone im pretty sure
"Alright. So if you want to die, feel free to ignore everything I'm about to tell you. Just let me know so you can die on someone else's watch."
I think you know Lucky Catonally
i just signed up.. and going to connect my ssh but after signing up i got this
I'm unsure
!charinfo \โ
!charinfo \๐ต
\u005c : REVERSE SOLIDUS - \
\U0001f375: TEACUP WITHOUT HANDLE - ๐ต
\u005c\U0001f375
Corporate History
I always wanted to know why film looked better than video. Moving electronic images have as long a history but were invented for a different purpose. This video was sponsored by B&H Photo: https://www.bhphotovideo.com
Huge thanks to:
Richard Diehl, Video Labguy https://www.youtube.com/user/videolabguy
https://www.labguysworld.com
Branch Educa...
check this
it explains everything here
woops gotta go dinner see yall later
thats sexy ui
The high tape-to-head speed created by the rotating head results in a far higher bandwidth than could be practically achieved with a stationary head. VHS tapes have approximately 3 MHz of video bandwidth and 400 kHz of chroma bandwidth, which is lower than the 6 MHz in NTSC broadcasts, and the 5 MHz in Type C videotape. The luminance (black and white) portion of the video is recorded as a frequency modulated, with a down-converted "color under" chroma (color) signal recorded directly at the baseband. Each helical track contains a single field ('even' or 'odd' field, equivalent to half a frame, see interlaced video) encoded as an analog
what
hi
out of a turn of events
ima start leaning django
im going to rewrite my codebase into django
i feel like its easier
also web5 is the future
brb
There's opinions then there's champignons.
A weed is any plant that's growing where you don't want it to.
honestly seems worth 10$/m
I'd pay $10 a month
nvm its gone
its already not free anymore
i'm not buying it
i'd much rather google than spend 10$ per month on this
I'm guessing there would be a free tier
it increases my productivity enough while coding for me to justify it
there's a free trial
not a free tier
yeah that's the point
hey come get used to this convenient thing so you need to buy it later
I don't blame them, it's very convenient and I don't imagine it was cheap building / maintaining it
and they said monetisation was coming pre-launch
yeah xD i already uninstalled it honestly don't care enough
hydrogenating
!e
print("babies" < "ham")
@rugged root :white_check_mark: Your eval job has completed with return code 0.
True
@quasi condorhttps://github.com/salt-die/nurses_2/tree/main/examples/rubiks
use this to get faster
C++ and Python Professional Handbooks : A platform for C++ and Python Engineers, where they can contribute their C++ and Python experience along with tips and tricks. Reward Category : Most Viewed Article and Most Liked Article
I need those 3 opinions
- Rust is better than C++
- LP's code is ass
- Pringles are superior to other chips
- Groovy is superior to Kotlin
!e
using DifferentialEquations
f(u,p,t) = 1.01*u
u0 = 1/2
tspan = (0.0,1.0)
prob = ODEProblem(f,u0,tspan)
sol = solve(prob, Tsit5(), reltol=1e-8, abstol=1e-8)
using Plots
plot(sol,linewidth=5,title="Solution to the linear ODE with a thick line",
xaxis="Time (t)",yaxis="u(t) (in ฮผm)",label="My Thick Line!") # legend=false
plot!(sol.t, t->0.5*exp(1.01t),lw=3,ls=:dash,label="True Solution!")
@willow light :x: Your eval job has completed with return code 1.
001 | File "<string>", line 11
002 | plot!(sol.t, t->0.5*exp(1.01t),lw=3,ls=:dash,label="True Solution!")
003 | ^
004 | SyntaxError: invalid decimal literal
hmmm
you just want to cause pandemonium
@zenith radish do you want to work on this? I'm fine with both doing the frontend and/or doing the backend by myself - my plan was to do the frontend today
!server
!e print(4400/(287655+62777))
Just out of curiosity, does this work
@quasi condor :white_check_mark: Your eval job has completed with return code 0.
0.012555930965208656
!e
print(4400//(287655+62777))
@willow light :white_check_mark: Your eval job has completed with return code 0.
0
!e
import math
print(dir(math))
@quasi condor :white_check_mark: Your eval job has completed with return code 0.
['__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'comb', 'copysign', 'cos', 'cosh', 'degrees', 'dist', 'e', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'gcd', 'hypot', 'inf', 'isclose', 'isfinite', 'isinf', 'isnan', 'isqrt', 'lcm', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'log2', 'modf', 'nan', 'nextafter', 'perm', 'pi', 'pow', 'prod', 'radians', 'remainder', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'tau', 'trunc', 'ulp']
!docs math.gamma
math.gamma(x)```
Return the [Gamma function](https://en.wikipedia.org/wiki/Gamma_function) at *x*.
New in version 3.2.
Unexpected quote mark, '"', in non-quoted string
!e print(import("math").gamma(4))
@lavish rover :white_check_mark: Your eval job has completed with return code 0.
6.0
!e print(iอmอpอoอrอtอ("math").gamma(4))
@quasi condor :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'iอmอpอoอrอtอ' is not defined
!e
print(__import__("math").gamma(-1))
@lavish rover :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | ValueError: math domain error
!e
from math import gamma, factorial
x = 5
print(f"Gamma(x) is {gamma(x)}, (x-1)! is {factorial(x - 1)}")
@willow light :white_check_mark: Your eval job has completed with return code 0.
Gamma(x) is 24.0, (x-1)! is 24
!e
from math import gamma as ฮ
from math import factorial
x = 6
print(f"ฮ(x) is {ฮ(x)}, (x-1)! = {factorial(x-1)}")
@willow light :white_check_mark: Your eval job has completed with return code 0.
ฮ(x) is 120.0, (x-1)! = 120
@rugged root https://en.bitcoin.it/wiki/Satoshi_(unit)
Huh, that's a thing
hi!
what ya upto @rugged root
This is when I take issue with Fortran
Oh, and I found a nice bit of documentation:
Print Publication: 01 Mar 1945
DOI: https://doi.org/10.1175/1520-0477-26.3.76
Page(s): 76โ85
ids = {d['name']:d['id'] for d in lst if d['name'] in names}
Bald eagle scream!
20 billion parameter language model demo https://20b.eleuther.ai/
(its open source if you happen to have too much storage and gpu power)
I think the main limitation is the GPU memory that you need to load the model
List of the lowest temperature and coldest day for each year in Springfield, MO.
the UI
That was one of several captcha's I had to solve just to finish step 2 of 6 to sign up to make doctor appointments online.
screw this, I'm just using the phone
American Healthcare System right there.
ig i'm the last one tonight ;-;
Right, this should work...despite it giving me a red squiggle
and yet....it don't work
is it safe to use?
i use it at work, seems good to me
Whats the use for?
@lyric talon ๐
hewo^
one-click ssh to dev vm
import pyttsx3
engine = pyttsx3.init()
engine.setProperty('rate', 120)
while True:
engine.say(input())
engine.runAndWait()
Have fun walking your dogs @wind raptor
Send cute dog pics
yes please
Will do!
anyone wanna call
I like that filtration
might have gotten banned pulling a stunt like that
XD 
Yeah
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@whole bear
thats nice
mostly i hopped on cuz i got bored
learning for loops
having a bit of a struggle
nested loops aswell as for loops
kinda hard to grasp for my tiny mind
welp
pretty much also if i am given a exercise to something i cant really make the code out in my mind
pretty to use nested loops to type a messeage
no worries
i am very much used to it
@surreal wyvern
thats nice
XD
i been in here for about like 3 years now
discord i mean
the server i pretty much just joined
i like the fact thats it so peaceful
Ohh that's Cool !
Me too
dont get used to it though as most servers can be pretty damn chaotic
who asked for help?
Me
mind if i ask you something chris
how long have been programming
pretty damn long compared to me so yeah
i started like 2 weeks
ago
I have a python code made with request and it's making request synchronslly .
But I want to do that with httpio
I mean asynchronousouly .
I'm not able to convert that code
Wow
Best of luck ๐
what includes the basics if you dont mind me asking
also thanks
oop & functions
what the hell even is oop
yikes, you should know this abbr
Meh i dont really care trying to take it at my own pace
since i have other stuff going on
yeah i agree
i am guessing with data types and methods it becomes muscle memory
am guessing flow is identation/spacing
yh i think i have that kinda covered
plus python is helpful
in code yes, but not in logic)
uhhh i didnt think classes were that deep
tbh
cuz when i was reading a bit into it when i first started i was a using a whole like 6 hour video
and he kinda introduced me to classes but didnt go as deep as you just did
tbh i also dont think have the creativity right now
tbh i can understand learning new concepts but i struggle putting them in use
eh i can understand that thats why i aint worrying to much about it right now
my_list = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
for x in my_list:
for y in x:
print(y)
ok
wouldnt this return with a error tho
as i did try this
i wish i could talk right now
hate it
obv the first loop will grab the first value from the list which is 1
but then i get confused
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
go to this


62,777
287,655