#voice-chat-text-0
1 messages Β· Page 203 of 1
That was for nullable, wasn't it?
JS and C# are similar
yes
@rugged root nullable
x can be None as it's Option<i32>
What dos it do in that case
@rugged root like i had a question, how do some installers or scripts install their dependencies without internet
those provide a way to do property access and calls
!d typing.Any
typing.Any```
Special type indicating an unconstrained type.
β’ Every type is compatible with [`Any`](https://docs.python.org/3/library/typing.html#typing.Any).
β’ [`Any`](https://docs.python.org/3/library/typing.html#typing.Any) is compatible with every type.
Changed in version 3.11: [`Any`](https://docs.python.org/3/library/typing.html#typing.Any) can now be used as a base class. This can be useful for avoiding type checker errors with classes that can duck type anywhere or are highly dynamic.
weird
I can't type
no?
obj.val?.prop
obj.val?.[expr]
obj.func?.(args)
?.() not in C# because it uses methods rather than functions, I guess
because a method is guaranteed to be non-null, in some sense
yea i would love if python had this
!e
from functools import partial
def curry(f):
def inner(arg):
return partial(f, arg)
return inner
@curry
def repeat(n, f):
def inner():
for _ in range(n):
f()
return inner
@repeat(3)
def test():
print(3)
test()
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 3
002 | 3
003 | 3
decorator to write decorators
arg can also be variadic, I think
because f is only a singular argument
this is still not elegant
the or will break on empty tokens
but we know these tokens will never be empty
so i guess its fine
i could make the digit be not inherting bytes
"I will start a petition against using DSA acronym wrong"
@gentle flint "types are a myth in SQLite"
I think it expects external functions to be used for value manipulation
!e
from functools import partial
def parameterised(f):
def inner(*arg):
return partial(f, *arg)
return inner
@parameterised
def wrap(prefix, suffix, f):
def inner():
print(prefix)
f()
print(suffix)
return inner
@wrap(1, 3)
def test():
print(2)
test()
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 1
002 | 2
003 | 3
why wont this work
"There are 10 kinds of people in the world. Those who understand binary and those who don't."
can i do this?
def __int__(self):
...
No wait, hold on
i saw a __int__ there
Yeah it is there
str calls repr if there is no __str__ implementation
Yep
However repr() will not call __str__
Yeah you melt the cheese in the little shovels underneath and cook stuff on top π
That's amazing
Start the day off with cheese sweats
starting off the why by sweating out cheese
I'm more trying to figure out the how
Just right through the pores
Like a can of easy cheese
it almost surely does
Yeah I think it does
I think lists are contiguous arrays of pointers to objects.
Erm, in C you could have an array of values or pointers. Pointers are just data like anything else.
!e
from sys import getsizeof
a = []
for _ in range(11111):
a.append(None)
print(getsizeof(a))
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
95864
!e
print(95864/8)
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
11983.0
!e
from sys import getsizeof
a = []
for _ in range(15111):
a.append(None)
print(getsizeof(a))
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
121432
/* Vector of pointers to list elements. list[0] is ob_item[0], etc. */
PyObject **ob_item;
getsizeof is speculative, I think
is this for list?
yes
i thought we were looking at array.array
@flint yarrow Yo
@indigo crag What do you want to stream?
Β―_(γ)_/Β―
!stream 1097803309785567294
β @indigo crag can now stream until <t:1697646931:f>.
This is brilliant
Your keyboard's going crazy π
Oh right, so someone enters in e.g. seven, and your program prints out 7?
I love them, they're really fun
I'd first get the user's input: ```py
user_input = input('Please enter a number: ')
@indigo crag You have to save the output of the split function in a variable: ```py
words = user_input.split(',')
String methods always return a new string.
They don't ever modify the string in place.
Besides fun, it's a brilliant way to teach things
@indigo crag What's the issue with your keyboard that makes it keep spamming the letter c?
Regex courses are often TOO verbose
Ahh right ok.
https://regex101.com/ Love this as well
and I personally get lost while reading things since I have issues with concentration
Yeah I use that to test my shit
But not to learn
Good as reference when doing the crossword at least
Yep π
Yo FILE
hello mr hemlock
try:
new_num = numbers[word]
except KeyError:
print(f'Invalid number {word}')
Do you want the result to be a single number?
Like 123
I.e. do you want the digits to be joined together?
theres alot of numbers
if you want every single number
also why is "zero" not there?
"0"
new_words = [numbers.get(word,'Invalid Number') for word in words]
maybe this can works
@indigo crag Perhaps let's move down to #751592231726481530?
$14/month
So one thing to help your code:
if (the_board[(1)] == the_board[(2)] == the_board[(3)] == 'X'
or the_board[(1)] == the_board[(4)] == the_board[(7)] == 'X'
or the_board[(7)] == the_board[(8)] == the_board[(9)] == 'X'
or the_board[(9)] == the_board[(6)] == the_board[(3)] == 'X'
or the_board[(8)] == the_board[(5)] == the_board[(2)] == 'X'
or the_board[(4)] == the_board[(5)] == the_board[(6)] == 'X'
or the_board[(1)] == the_board[(5)] == the_board[(9)] == 'X'
or the_board[(7)] == the_board[(5)] == the_board[(3)] == 'X'):
pass
It will help you check your logic way easier
couldn't you switch your way through that
Also, it's a bit redundant to check for either X or O. All you care about per move is if there's a match
My guess is your teacher is going to fail you for not handling logic better
haha me?
Yes
!e
x = 4
if x:
pass
im learning alone haha
then I'm failing you
@rugged root :warning: Your 3.12 eval job has completed with return code 0.
[No output]
!e```py
x = 4
if x:
print(x)
pass
@pulsar light :white_check_mark: Your 3.12 eval job has completed with return code 0.
4
yo guys how do you make input that asks yes or no?
user_input = input("Yes or no: ")
!e
a=input("ye or no:")
Actually instead I'd do...
if user_input == "yes":
user_input = input("Yes or no: ").lower()
if user_input == "yes":
...
clean
That way you're always going to be checking for yes regardless of whether the person entered with caps or not
Could also strip off white space characters:
user_input = input("Yes or no: ").strip().lower()
So that even if they entered spaces on either end of the input, it'll still work
(because invalid input shouldn't be interpreted as no)
if ... == "yes":
...
elif ... == "no":
...
else:
... # blame the user
Best else
it tells me that yes is not recognised as cmdlet function ...
give code
The Royal Netherlands Air Force (RNLAF; Dutch: Koninklijke Luchtmacht (KLu), "Royal Air Force") is the military aviation branch of the Netherlands Armed Forces. It was created in 1953 to succeed its predecessor, the Luchtvaartafdeling (English: aviation department) of the Dutch Army, which was founded in 1913. The aerobatic display team of the R...
@pulsar light
if you scroll down you'll see the roundel
os.listdir()
!d pathlib.Path.iterdir
Path.iterdir()```
When the path points to a directory, yield path objects of the directory contents...
Augmented reality (AR) and Virtual Reality (VR) bridge the digital and physical worlds. They allow you to take in information and content visually, in the same way you take in the world. AR dramatically expands the ways our devices can help with everyday activities like searching for information, shopping, and expressing yourself. VR lets you ex...
I don't think I'll be back on until I get back to the office. Having a weird anxiety spike and need music instead
okay
hi guys
i just started coding and learning programming with python and work in backend.
i was worried about somethings.
that i really needs Data Structures and Algorithms ?
if i want to work as freelancering for long time do i really need that topic? or only by practice and coding more and learning more i can pass the way?
Thanks β€οΈ
learn_about = [hosting, frameworks, databases]
codewars = "codewars: a free website for programers to improve their coding solving skills"
backend = f"pick a popular language in backend and do {codewars}"
hi guys here is muy tictactoe improved game u need to see it https://paste.pythondiscord.com/D7PQ
@fierce summit py -m pip install [package_name_here]
β @pulsar light can now stream until <t:1697661341:f>.
n = int(input(' \n Player X: '))
if n ==0:
os.system('cls')
print(' \n Thanks for playing. \n ')
c = False
c1 = False
c2 = False
d = False
break
if n not in v_n:
os.system('cls')
print(' \n You can only type numbers from 1 to 9. \n ')
break
if turns==9:
print('Its a draw. ')
c1 = False
c2 = False
break
if the_board[n] == ' ':
the_board[n] = 'X'
xo(the_board)
c1 = False
c2 = True
turns +=1
...
@pulsar light
!e
for i in range(9):
if i % 2 == 0:
print("It's X's turn.")
else:
print("It's O's turn.")
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | It's X's turn.
002 | It's O's turn.
003 | It's X's turn.
004 | It's O's turn.
005 | It's X's turn.
006 | It's O's turn.
007 | It's X's turn.
008 | It's O's turn.
009 | It's X's turn.
is it tictactoe
yes
def _setup_board(self):
self._current_moves = [
[Move(row, col) for col in range(self.board_size)]
for row in range(self.board_size)
]
self._winning_combos = self._get_winning_combos()
def _get_winning_combos(self):
rows = [
[(move.row, move.col) for move in row]
for row in self._current_moves
]
columns = [list(col) for col in zip(*rows)]
first_diagonal = [row[i] for i, row in enumerate(rows)]
second_diagonal = [col[j] for j, col in enumerate(reversed(columns))]
return rows + columns + [first_diagonal, second_diagonal]
def process_move(self, move):
"""Process the current move and check if it's a win."""
row, col = move.row, move.col
self._current_moves[row][col] = move
for combo in self._winning_combos:
results = set(
self._current_moves[n][m].label
for n, m in combo
)
is_win = (len(results) == 1) and ("" not in results)
if is_win:
self._has_winner = True
self.winner_combo = combo
break
!e
from pprint import pprint
board = [[None for _ in range(3)] for _ in range(3)]
pprint(board)
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
[[None, None, None], [None, None, None], [None, None, None]]
!stream 469419943755120650
β @pulsar light can now stream until <t:1697663176:f>.
for diagonal summing how about
sum([board[i, i] for i in range(len(board))])
(0, 2), (1, 1), (2, 0)
and for right to left```py
sum([board[i, -i-1] for i in range(len(board))])
Sup
going good
havent been able to code for the past week
too much school work
its annoying
havent been able to play much games either
I know that feeling
ya
<input type="number" id="quantity_65304fe40b3ca" class="input-text qty text" name="quantity" value="1" aria-label="Product quantity" size="4" min="1" max="4" step="1" placeholder inputmode="numeric" autocomplete="off"/>
!e
from collections import Counter
ham = "I'm a huge fan of ham, dude"
totals = Counter(ham)
print(totals)
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
Counter({' ': 6, 'a': 3, 'm': 2, 'h': 2, 'u': 2, 'e': 2, 'f': 2, 'd': 2, 'I': 1, "'": 1, 'g': 1, 'n': 1, 'o': 1, ',': 1})
Only problem is that it doesn't give that in proper order
@rugged root
i just got a ping from a bot to verify?
i have no idea how it works its my first time joining here
im a college student and im studying a python course
Oh it's just letting you know about the voice gate. For details, see the #voice-verification channel
and i really just wanna learn
What have you tried so far?
Oh you mean in school?
Still technically school
def first_non_repeating_letter(word):
lower_word = word.lower()```
Any of the stuff you need clarification on? Always happy to explain stuff
!stream 469419943755120650
β @pulsar light can now stream until <t:1697665891:f>.
not right now but if i do have any trouble ill come crying to u for sure
much appriciated
!e
ham = "I'm a huge fan of ham"
print(ham.count('h'))
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
2
You have to tell it what character you want to count
!e
from collections import Counter
ham = "I'm a huge fan of ham, dude"
totals = Counter(ham)
for char in totals.elements():
print(char)
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | Counter({' ': 6, 'a': 3, 'm': 2, 'h': 2, 'u': 2, 'e': 2, 'f': 2, 'd': 2, 'I': 1, "'": 1, 'g': 1, 'n': 1, 'o': 1, ',': 1})
002 | Counter({' ': 6, 'a': 3, 'm': 2, 'h': 2, 'u': 2, 'e': 2, 'f': 2, 'd': 2, 'I': 1, "'": 1, 'g': 1, 'n': 1, 'o': 1, ',': 1})
Hmm
!e
from collections import Counter
ham = "I'm a huge fan of ham, dude"
totals = Counter(ham)
for char in totals.elements():
print(char)
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | I
002 | '
003 | m
004 | m
005 |
006 |
007 |
008 |
009 |
010 |
011 | a
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/OYMWYH4YXOHIKPFS63XYVFOHHY
I hopped down since I'm wrapping up my day
else:
p1 = 'X'
p2='O'
score_p2 += 1
elif p2 == 'X':
p1 = 'X'
p2 = 'O'
score_p2 += 1
using HTTP
function make_API_call(url)
try
response = HTTP.get(url)
return String(response.body)
catch e
return "Error occurred : $e"
end
end
response = make_API_call("http://jsonplaceholder.typicode.com/users")
println(response)
Julia, are you okay?
Why use end when you can use two spaces?
@rugged root
print(f"Player 1: {score_p1} \nPlayer2: {score_p2}")
print("Player 1", score_p1, "\nPlayer2:", score_p2)
@rugged root can you give @pulsar light permissions to stream?
!stream 469419943755120650
β @pulsar light can now stream until <t:1697668694:f>.
thanks
thanks
my code, sir
!stream 266030641382948865
β @faint raven can now stream until <t:1697673535:f>.
please with a cherry on top! π₯Ί
In the other channel?
@faint raven oi, yβall want to jump back up here?
@gray nova π
@steel torrent π
@somber heath you sound like my friend from perth
but are you from perth
thats like
east
coast?
alright
perth is like the west most part of austrailia if im not wrong bc we could still play games together without having the biggest timezone issues lol
@gilded solstice π
Join the challenge or watch the game here.
@indigo crag hal shama chittori
weeb @whole bear
i dont talk to anime enjoyers
no
my grandfather knew farsi
@somber heath im joking im an anime enjoyer
fmab is the goated anime
my pfp is anime
Join the challenge or watch the game here.
what if u lose and its not even bullet
thatd be sad @whole bear
no
chess is alright but i dont have the patience to think through that game
HAHHA
Join the challenge or watch the game here.
i just
played
u
i never palyed
15
s
ive played
bullet
yteah fair
you cant spam moves
if you keep getting checked
guys
DO U HAVE TO POOP IF U HAVE CEREAL + MILK
in the morning
i have to
max_attempts = 0
x = 45
difficulty = {'easy': 1,
'medium': 2,
'hard': 3}
difficulty_option = input("""
Choose your difficulty.
""")
if difficulty_option in difficulty:
print (f"""
You chose {value}
""" )
print (f"""
Word Guessing Game
You have {max_attempts} attempts to guess! Good luck!
""")
while True:
if attempts == max_attempts:
if attempts == 5:
print (f"You ran out of attempts, x = {x}.")
exit()
y = int(input("""
Guess the number. It's 100 or under
"""))
if y == x:
attempts+=1
print(f"""
------------------------------------------------------
Attempt {attempts}.
""")
print (f"""
Correct!
It took {attempts} attempt(s)
""")
elif y > x:
attempts+=1
print(f"""
------------------------------------------------------
Attempt {attempts}.
""")
print (f"""
x is less than {y}.
""")
continue
elif y < x:
attempts+=1
print(f"""
------------------------------------------------------
Attempt {attempts}.
""")
print(f"""
x is greater than {y}.
""")
continue
else:
print("Please Enter a valid input...")
continue
!d random.randint
random.randint(a, b)```
Return a random integer *N* such that `a <= N <= b`. Alias for `randrange(a, b+1)`.
!e py import random for _ in range(5): print(random.randint(1, 100))
@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 24
002 | 71
003 | 9
004 | 8
005 | 46
Professional Software Engineering = Agile + Rank & Yank
attempts = 0
max_attempts = 15
x = 0
difficulty = input("""
Choose your difficulty.
""")
if difficulty == "easy":
x = random.randint(1, 10)
elif difficulty == "medium":
x = random.randint(1, 50)
elif difficulty == "hard":
x = random.randint(1, 100)
print (f"""
Word Guessing Game
You have {max_attempts} attempts to guess! Good luck!
""")
while True:
if attempts == max_attempts:
if attempts == 5:
print (f"You ran out of attempts, x = {x}.")
exit()
y = int(input("""
Guess the number.
"""))
if y == x:
attempts+=1
print(f"""
------------------------------------------------------
Attempt {attempts}.
""")
print (f"""
Correct!
It took {attempts} attempt(s)
""")
elif y > x:
attempts+=1
print(f"""
------------------------------------------------------
Attempt {attempts}.
""")
print (f"""
x is less than {y}.
""")
continue
elif y < x:
attempts+=1
print(f"""
------------------------------------------------------
Attempt {attempts}.
""")
print(f"""
x is greater than {y}.
""")
continue
else:
print("Please Enter a valid input...")
continue
All'o'yall'd've.
π
!e
from math import erf
print(2 / (1 - erf((100 - 7) / 15 / 2 ** .5)))
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
3542132832.249878
the math behind the rat count
1 in 1771066416.124939 are outside of the 7~193 range
with 1 rat below 7 and 1 rat above 193
because IQ by definition is normally distributed
(it's just a way to convert ranking to a number)
I wanna post a rat related meme so bad but i think i'd get banned
!e
iterable = [1, 2, 3]
iterator = iter(iterable)
while True:
try:
element = next(iterator)
except StopIteration:
break
print(element)
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 1
002 | 2
003 | 3
desugared for loop
for element in iterable
# ^^^^^^^ this variable gets assigned on each iteration
!e
for (a, b) in [(1, 2), (3, 4)]:
print(b, a)
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 2 1
002 | 4 3
!e
iterable = [(1, 2), (3, 4)]
iterator = iter(iterable)
while True:
try:
(a, b) = next(iterator)
except StopIteration:
break
print(b, a)
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 2 1
002 | 4 3
this is what for does inside
and, like normal assignment, the variable remains assigned after the loop is done (if there was at least one iteration)
which works because Python doesn't have block scopes
!e
for x in [1, 2]:
pass
print(x)
for y in []:
pass
print(y)
@vocal basin :x: Your 3.12 eval job has completed with return code 1.
001 | 2
002 | Traceback (most recent call last):
003 | File "/home/main.py", line 6, in <module>
004 | print(y)
005 | ^
006 | NameError: name 'y' is not defined
(explanation as to why relying on it functioning as assignment is sometimes troublesome)
the loop doesn't unassign the variable, yes
if there are any elements, then it will be the last element
if there are no elements, it will be the same as before the loop
in almost all circumstances, variable should not be used after the loop until it is re-assigned
just to avoid errors
Ryright (VS Code's language server) will detect such potential errors
(PyCharm might do that too)
thanks!
I need to get some python going for some local build jobs, its not fun doing things in batch/bash
unrelated, anyone have experience with problem matchers and github actions? idk if its just me but coming up with these on the fly is such a pain
ok
so
maatchers and github actions? idk if its just me but coming up with these on the fly is such a pain
the loop doesn't unassign the variable
i just
copy and paste
btw, this doesn't apply to comprehensions
because they have a function/generator-like scope
!e
print([x * x for x in [1, 3, 5]])
print(x)
@vocal basin :x: Your 3.12 eval job has completed with return code 1.
001 | [1, 9, 25]
002 | Traceback (most recent call last):
003 | File "/home/main.py", line 2, in <module>
004 | print(x)
005 | ^
006 | NameError: name 'x' is not defined
huhhh
001 | [1, 9, 25]
002 | Traceback (most recent call last):
003 | File "/home/main.py", line 2, in <module>
004 | print(x)
005 | ^
006 | NameError: name 'x' is not defined
seems real
https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md
Reading some of these docs looks like gibberish tbh, could be because im tired or something but usually its not this hard trying to read
Reading some of these docs looks like gibberish tbh, could be because im tired or something but usually its not this hard trying to read woahh
!e
print((x for x in range(10)))
print([x for x in range(10)])
print({x for x in range(10)})
print({x: x for x in range(10)})
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | <generator object <genexpr> at 0x7f471c38cac0>
002 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
003 | {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
004 | {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9}
expression equivalent of a for loop
to create generators, lists, sets and dictionaries
use replies or quoting via > to make it easier to distinguish what you're referring to from the rest of the text
quoted text
comment related to original text
> no-formatting quoted text
or like this
like this
yes
i cant able to talk in vc
differences from a for loop:
- an expression, not a statement
- creates a separate scope
- in case of
(... for ... in ...), does not compute all values right now, but instead creates a lazy generator - does not allow
break,continue, etc.
i think i already did 50 messages
not yet
3739 rn
!e
print(*(x for x in range(10)))
print(*[x for x in range(10)])
print(*{x for x in range(10)})
print(*{x: x for x in range(10)})
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 0 1 2 3 4 5 6 7 8 9
002 | 0 1 2 3 4 5 6 7 8 9
003 | 0 1 2 3 4 5 6 7 8 9
004 | 0 1 2 3 4 5 6 7 8 9
all four types created by comprehensions are iterable
e.g. can be used in a for loop, passed as *args, etc.
!e
def process(x):
print('processing', x)
return x * 10
gen = (process(x) for x in range(3))
for processed in gen:
print(processed)
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | processing 0
002 | 0
003 | processing 1
004 | 10
005 | processing 2
006 | 20
parts about integrating it or about the config format?
config format is fine, its just json. its the integration that im so lost in.
ive looked on the marketplace for specific problem matchers and what im looking for isn't listed. if it was something like the starter actions like setup-python or anything of that sort i think i would be fine.
also the build takes years to complete since its a massive project that has reached the limits of the standard runners
rebuilt from scratch always, if i could find something to cache brew or apt packages that would cut down so much time but the main crux is the actual project
have you tried docker-based actions?
i havent but it is something in the works kinda
with all the installs happening during image build stage
idk how much GitHub caches the images
GitHub might just delete the image, they're not obliged to store it forever
storing base images on dockerhub might be an option
or on whatever GitHub has that actually has some retention guarantees
they are not obligated which is fine, it only fetches the cache when there isnt an update and that is not a problem with something like pulling Qt from somewhere and caching it since that takes time depending on how the individual runner is feeling
I've only used any caching via this
https://github.com/actions/cache
but that didn't include apt dependencies and other system-level things
only target directory itself
(I used it for Rust)
Im doing this with C++ 
basically im converting a crumbling and slowly melting jenkins instance into a series of jobs for github actions, its been a task as ive spent many months doing this
> a massive project
is there an option to split it?
I'd expect C++ allows compiling static libraries separately for the most part
how long is the build taking right now?
several minutes? hours?
(days?)
on average each build job takes about 3.5 hours, a codeql job takes like 7+ hours
the jenkins instance takes days to complete a single job, and thats praying the nodes running dont crash and go offline
and right now looking at that instance it is backed up by 139 jobs pending with no available runners
its okay if you tell me this is absurd and dumb since ive been telling myself this is stupid and dumb since ive taken this on
are some of those apt dependencies what the program links to?
or are all of them required for the build system itself?
all of them are required. and then when you do the Cmake steps it then proceeds to download Chromium and even NodeJS to use as its also a dependency.
MPV was a nightmare too, since a specific version isnt available on ubuntu 20.04 and i cannot for the life of me get a consistent build of mpv without a dependency being broken for it
is chromium used as a library or as an executable?
static or dynamic?
I'd expect dynamic for chromium
dynamic
its an opengl app using chromium as its ui, and it also has its own ui for special things that the chromium doesnt have as its more developer or enthusiast
im not on the team building it, just a contributor who has spent many years working with the people building it
-----------------------------------------------------------------------------------
Language files blank comment code
-----------------------------------------------------------------------------------
JSON 29 15 0 233998
C++ 584 28261 28490 152201
C/C++ Header 657 20029 42642 67168
CSV 25 1 0 13215
GLSL 191 2235 5611 6647
CMake 73 686 1882 4031
JavaScript 5 872 401 3900
HCL 2 1072 0 3210
XML 12 111 140 2838
XSD 6 149 197 2071
Lua 7 198 116 1134
YAML 5 94 32 603
Python 4 214 121 523
SVG 3 4 3 383
CSS 3 64 13 313
Handlebars 10 1 0 265
Objective-C++ 1 45 33 206
Markdown 12 49 0 164
INI 1 17 0 105
DOS Batch 1 20 6 72
Windows Resource File 2 20 25 35
-----------------------------------------------------------------------------------
SUM: 1633 54157 79712 493082
-----------------------------------------------------------------------------------
this is without the submodules even checked
fname = input("Enter file name: ")
fh = open(fname)
lst = list()
for line in fh:
line = line.strip()
line = line.split()
print(line)
hi guys
i just started coding and learning programming with python and work in backend.
i was worried about somethings.
that i really needs Data Structures and Algorithms ?
if i want to work as freelancering for long time do i really need that topic? or only by practice and coding more and learning more i can pass the way?
Thanks
If you learn a skill, you have a tool.
The more tools you have, the fewer you'll need to use for a given problem.
If you have the one correct tool for a job, you don't need additional tools for the job.
The fewer tools you have to use, the more elegant the solution.
so shoud i learn about logarithms and big O and this stuffs?
because these topics are part of my Data Strctures and algorithms book
I understand it in abstract, but not in any formal capacity. Learn time and space complexity notation if you want.
It won't hurt you.
It's a good idea to be able to know how to do a thing in a few minutes that would otherwise take the heat death of the universe and more gigabytes of ram than there are atoms to complete.
For the sake of "Should I learn x?" questions, let's just assume the answers range from, "Sure, if you want" to "Absolutely."
thanks man.
it very helped me.
so if want to be a good programmer i need that
Concentrate on understanding the foundational concepts of the language.
Build on that.
Keep building on that.
Until you reach where you:re building to
The more you know, the more you'll start having informed opinions on what else you need to know.
so you tell me that focus on Language completly syntax or should i learn data structures and logarithms and big O and ,,,?
I think you needn't focus too much on time and space complexities. Be aware that they're a thing, and try to be reasonably economical and aware of what your code is doing and how much space it's taking up.
i mean full focus on language syntax and be good at it is enough? or shoud i follow another steps like big O and ....?
It doesn't matter. Just keep learning things.
You will need to learn syntax at some point.
Otherwise what's the point?
yeah i undrestand now
i will need to other stuffs
for be better and better
exactly for Backend
yeah?
I'm not a backend developer.
If I needed to be, I know enough to be able to pick up documentation and figure out what would be involved.
Possibly.
I think that if you focus on the language itself, first, then you aren't fighting to learn the language and something else at the same time. It'd be like having no knowledge of Lithuanian and having someone explain, in Lithuanian, how to do something you don't know how to do.
Whereas if you did understand Lithuanian fluently, you'd be able to concentrate on learning the thing.
ok brother, thank you so much for giving me your time.
you're welcome
My spokesperson, Super </dev>.
haha
Hey @turbid sandal
hey
!stream 1053732836693258391
β @turbid sandal can now stream until <t:1697719339:f>.
@dire quarry if you need a place to start, you could do a lot worse than https://hyperskill.org/tracks/41. The study material is free although the quizzes are limited to 10 per day for free users. I think it has enough structure to set you on the right path and will cover 95% of everything you might need for 95% of jobs. Happy learning.
!stream 1053732836693258391
β @turbid sandal can now stream until <t:1697723074:f>.
May anyone help me ?
What's up?
The performance profile of isinstance() checks against runtime-checkable protocols has changed significantly. Most isinstance() checks against protocols with only a few members should be at least 2x faster than in 3.11, and some may be 20x faster or more. However, isinstance() checks against protocols with fourteen or more members may be slower than in Python 3.11. (Contributed by Alex Waygood in gh-74690 and gh-103193.)
@ornate mica π
hi
HA
Remove support for obsolete browsers from webbrowser. The removed browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, Firebird, and Firefox versions 35 and below (gh-102871).
Oh no, whatever will I do without Netscape!?!?
Chris How are you π
Any maniac that may have watched all Harvard CS50 courses yearly and would recommend a specific year to watch for today's standards?
Kinda off-topic, didn't seem to find an appropiate channel to ask but here lol
That's unfortunate. I wish I could help more, but I don't know what else to check
Don't you know people who can help me?)
Dude this is going to drive me crazy
There's PyPy, pyjion, Numba, pyinstaller....
There's another one I just can't remember what the name is
Found it
Nuitka
@amber raptor https://blog.massdriver.cloud/posts/devops-is-bullshit/ i found this blogpost i think you could relate to xD
Already read it multiple time
should've expected
seems pretty popular
!pip cython
Hi @vocal basin
@rugged root ansble docs front page for yaml syntax π€£ likes emacs: TRUE
Jesus
that's the only all caps one too
i've switched 100% to neovim at this point btw :x unless i'm working with java in which case i still use idea
!e ```python
a = list()
for x in range(0,50):
a += list(x)
print(a)
b = ()
for x in range(50):
b.append(x)
print(b)```
@amber raptor :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 3, in <module>
003 | a += list(x)
004 | ^^^^^^^
005 | TypeError: 'int' object is not iterable
!e
a = []
for x in range(0,50):
a += [x]
print(a)
b = []
for x in range(50):
b.append(x)
print(b)
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
002 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
$a = @()```
!e ```python
a = list()
for x in range(0,50):
a += [x]
print(a)
b = []
for x in range(50):
b.append(x)
print(b)```
@amber raptor :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
002 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
a = [i for i in range(50)]
@mild quartz :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | then what
003 | ^^^^
004 | SyntaxError: invalid syntax
!e
a = [*range(50)]
print(a)```
!code
!e
for i in range(100):
print("HEMLORK")
@mild quartz :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | HEMLORK
002 | HEMLORK
003 | HEMLORK
004 | HEMLORK
005 | HEMLORK
006 | HEMLORK
007 | HEMLORK
008 | HEMLORK
009 | HEMLORK
010 | HEMLORK
011 | HEMLORK
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/NBPLTHCACVTEVIPYUSC45BEMKI
π
@dusk raven :white_check_mark: Your 3.12 eval job has completed with return code 0.
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
!e
print("formatting?")
- a = list()
- for x in range(0,50):
- a += [x]
- print(a)
+ b = []
+ for x in range(50):
+ b.append(x)
+ print(b)
@mild quartz :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | python3
004 | NameError: name 'python3' is not defined
!timeit
a = [i for i in range(1000)]
@rugged root :white_check_mark: Your 3.12 timeit job has completed with return code 0.
5000 loops, best of 5: 45.1 usec per loop
!timeit
code
!timeit [python_version] [setup_code] <code, ...>
Can also use: ti
Profile Python Code to find execution time.
This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
If multiple formatted codeblocks are provided, the first one will be the setup code, which will not be timed. The remaining codeblocks will be joined together and timed.
Currently only 3.12 version is supported.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
!timeit python a = list() for x in range(0,50): a += list(x) print(a)
@amber raptor :x: Your 3.12 timeit job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/lang/python/default/lib/python3.12/timeit.py", line 330, in main
003 | number, _ = t.autorange(callback)
004 | ^^^^^^^^^^^^^^^^^^^^^
005 | File "/lang/python/default/lib/python3.12/timeit.py", line 226, in autorange
006 | time_taken = self.timeit(number)
007 | ^^^^^^^^^^^^^^^^^^^
008 | File "/lang/python/default/lib/python3.12/timeit.py", line 180, in timeit
009 | timing = self.inner(it, self.timer)
010 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
011 | File "<timeit-src>", line 46, in inner
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/QW5D3HMEYEI7CMBJBGU6VTETPA
!timeit
a = [*range(1000)]
@rugged root :white_check_mark: Your 3.12 timeit job has completed with return code 0.
10000 loops, best of 5: 21.2 usec per loop
!timeit
a = []
for i in range(1000):
a += [i]
@rugged root :white_check_mark: Your 3.12 timeit job has completed with return code 0.
1000 loops, best of 5: 157 usec per loop
!timeit
a = []
for i in range(1000):
a.append(i)
@rugged root :warning: Your 3.12 timeit job timed out or ran out of memory.
[No output]
!timeit
a = []
for i in range(1000):
a.append(i)
@rugged root :white_check_mark: Your 3.12 timeit job has completed with return code 0.
5000 loops, best of 5: 60.6 usec per loop
!timeit
a = []
for i in range(1000):
a += [i]
@rugged root :white_check_mark: Your 3.12 timeit job has completed with return code 0.
2000 loops, best of 5: 152 usec per loop
+= [i] is O(1) time amortized
am finally back at the PC
!timeit
a = []
for i in range(1000):
a.extend([i])
@vocal basin :white_check_mark: Your 3.12 timeit job has completed with return code 0.
2000 loops, best of 5: 147 usec per loop
+= is extend usually
|= is update
!timeit
a = []
assert not a
for i in range(1000):
a += [i]
@vocal basin :x: Your 3.12 timeit job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/lang/python/default/lib/python3.12/timeit.py", line 330, in main
003 | number, _ = t.autorange(callback)
004 | ^^^^^^^^^^^^^^^^^^^^^
005 | File "/lang/python/default/lib/python3.12/timeit.py", line 226, in autorange
006 | time_taken = self.timeit(number)
007 | ^^^^^^^^^^^^^^^^^^^
008 | File "/lang/python/default/lib/python3.12/timeit.py", line 180, in timeit
009 | timing = self.inner(it, self.timer)
010 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
011 | File "<timeit-src>", line 44, in inner
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/SPEAMQ63U5S2Z2NH2CHHH3E4PM
!timeit
code
!timeit [python_version] [setup_code] <code, ...>
Can also use: ti
Profile Python Code to find execution time.
This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
If multiple formatted codeblocks are provided, the first one will be the setup code, which will not be timed. The remaining codeblocks will be joined together and timed.
Currently only 3.12 version is supported.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
actually, there should be three parts then
setup for all tests
setup for a single test
test
but that's too complex
!d unittest.mock
New in version 3.3.
Source code: Lib/unittest/mock.py
unittest.mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used.
unittest.mock provides a core Mock class removing the need to create a host of stubs throughout your test suite. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return values and set needed attributes in the normal way.
Forgot fuzz testing was a thing
@obsidian dragon just move to Russia for no youtube ads
they're not really in Russia
Cyprus/Czech Republic or somewhere else
headquartered at, at least
and many of developers fled the country because yes
No YouTube ads and potentially no YouTube!
they're trying to force people to use government-controlled platform
but failing
that's a lot of money
(JetBrains)
half a billion dollar in assets
Russian Wikipedia lists these as "location":
Czech Republic, USA, Germany, Netherlands, Cyprus, Serbian, Armenia
it was founded in Prague
and it's still in Prague
by three Russian software developers
S-lang
rip
@wind raptor there are legitimate reasons for is-even/is-odd to exist
but that specific implementation doesn't address those reasons, iirc
or at least not fully
and/or it's made as too much of a troll/meme/npm abuse
just copy and link to the original, yes
!pypi httpx
!pypi sniffio
Huh
It's really interesting looking through all the different dependencies the libraries we use have
Brony Hawk
Rust has necessity to detect async runtime too in some cases
mostly because tokio did something wrong
That's the backend web thing? Or wait that's rocket...
in context of odd async, there is tornado
which did async before async/await was in Python
it's not dead but it's old
starlette rather than fastapi
Right right
Flask has no ASGI support still
I think
oh
wow
that's new
yeah, that's still bad
i.e. it doesn't work
it's not ASGI
Django has proper ASGI
@woeful salmon if a worker process expects ASGI, there is a need for middleware
it's only for compatibility
there is 0 reason to use ASGI with Flask otherwise
it will negatively impact performance
Django
FastAPI
both support both, I think
(wsgi/asgi)
Quart (async Flask)
Ah right right
I've seen something like two people use it
Flask is fundamentally broken
this is very wrong
from flask import request
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'POST':
return do_the_login()
else:
return show_the_login_form()
request thing specifically
does it use contextvars?
!d contextvars
This module provides APIs to manage, store, and access context-local state. The ContextVar class is used to declare and work with Context Variables. The copy_context() function and the Context class should be used to manage the current context in asynchronous frameworks.
Context managers that have state should use Context Variables instead of threading.local() to prevent their state from bleeding to other code unexpectedly, when used in concurrent code.
See also PEP 567 for additional details.
New in version 3.7.
Which
I'd very much rather have request as an argument than a global implicitly scoped variable
FastAPI's approach also helps see exactly what routes access request metadata and which don't
at the cost of an extra argument
God damn it, WHY did I forget this was a thing: https://docs.python.org/3/library/sched.html
Rust has two ways to use the builder pattern
which is something uncommon to think about for usual OOP languages
&mut Self -> &mut Self
Self -> Self
Command "mut" is not found
booooo
small self is not a type
You are going to learn beanstalkd
it's a variable and a keyword
my new company uses beanstalkd so I've confirmed it's in production
there are some more cursed things about Rust
for example, some pointers are twice as large
despite being called raw pointers
pointers to str, [T] and dyn Trait
object
dynamic dyspatch of trait methods
Huh, there's a handful of beanstalkd Python implementations
because those require metadata to be stored alongside the pointer
Or client lib I guess
pointer to &str or just str?
&str, *const str both consist of two parts
- pointer to the first byte
- length
usize address + usize length
@amber raptor Was greenstalk the one you've talked about before?
16 bytes normally
whereas &SomethingSized is 8 bytes
or whatever usize size is
and for objects it stores a pointer to the vtable
Raw, unsafe pointers, *const T, and *mut T.
ig it is a term
nomicon references it once as "wide pointer"
https://doc.rust-lang.org/nomicon/exotic-sizes.html
The Dark Arts of Advanced and Unsafe Rust Programming
zero
dynamic
non-existent
and extern
yes
Noted. Bookmarked to look at it later
zig helps to cross-compile Rust
Now!
no u
I already did
Introduce BeanStalkd into the bot
doesn't Ocen still compile to C?
Someone put redis into the bot. Mistakes were long made
(Aecor re-branded)
You canβt compile into C
depends on the definition of "compile"
it relies on C to run
on compiling to C
well, ig, readme says "transpiles" so okay
weird terms meaning the same thing
im in the bomb shelter now
stability, human writability, etc.
i had an air raid alarm
Stay safe
i will
and "compiler" is still used to refer to something that is said to "transpile"
(depends on complexity/intent/etc., I guess)
I kind of think of transpiles just change the language, compilers make optimizations
I haven't seen some of these before
where did uck go
for a moment I though I haven't heard of Love2D before but then I remembered seeing it, like, 1~4 years ago
Lua game engine something something
is this what
replit?
yeah, they put game engines separately
to support graphics
There's a handful of game libraries on there
extend node with Python.h
bundle that into electron
feel the pain
It's a bit old, though
But it's the one that first jumps to mind
Another possibility
Bloop, Crystal, Pyxel, Kaboom, Unlambda, Reason, Emoticon, Ray
these are new to me
I've heard about Crystal, but I know nothing beyond the name
Reason I'm familiar with, Emoticon I'm unfortunately aware of
thanks for the info
Bloop was an ultra-low-frequency, high amplitude underwater sound detected by the U.S. National Oceanic and Atmospheric Administration (NOAA) in 1997. By 2012, earlier speculation that the sound originated from a marine animal was replaced by NOAA's description of the sound as being consistent with noises generated via non-tectonic cryoseisms or...
BlooP and FlooP (Bounded loop and Free loop) are simple programming languages designed by Douglas Hofstadter to illustrate a point in his book GΓΆdel, Escher, Bach. BlooP is a non-Turing-complete programming language whose main control flow structure is a bounded loop (i.e. recursion is not permitted). All programs in the language must terminate,...
@rugged root https://tauri.app/
what do you think about it
First time I'm hearing about it
Python is usually embedded in case of desktop apps
general purpose isn't any purpose
general purpose language just means
"not a DSL"
"my spelling skills decrease each day"
so it's by replit
("language")
Blazor is a feature of ASP.NET for building interactive web UIs using C# instead of JavaScript. It's real .NET running in the browser on WebAssembly.
Also very pink
C extensions
I guess
(not necessarily as an intention of integrating it, but as an excuse)
as an excuse
My favorite reason
is this the ray they mean
https://www.ray.io/
What is?
i use it for a niche usecase
math, Crystal, Python, Javascript, Unlambda, Javascript, π, Python
when model is too big to distribute across H100 node or TPU pod
When your AWS bill isnβt high enough
you would be disgusted by deep learning aws bills
@rugged root can u help me out
With?
Wait
also can just compare time instead
input when timed out => fail
I'm getting annoyed by typesetting/grammar errors in docs
but I'm too lazy to go make a PR
JS forces async
almost
there are holes
in both web and node
i see
httpxmlrequest and sync filesystem operations
!e
from time import perf_counter, sleep
start = perf_counter()
sleep(2)
end = perf_counter()
print(end - start)
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
2.0001639989204705
monotonic is preferred in this context, I think
(just monotonic not perf_counter)
!d time.monotonic
time.monotonic() β float```
Return the value (in fractional seconds) of a monotonic clock, i.e. a clock that cannot go backwards. The clock is not affected by system clock updates. The reference point of the returned value is undefined, so that only the difference between the results of two calls is valid.
Use [`monotonic_ns()`](https://docs.python.org/3/library/time.html#time.monotonic_ns) to avoid the precision loss caused by the [`float`](https://docs.python.org/3/library/functions.html#float) type.
New in version 3.3.
Changed in version 3.5: The function is now always available and always system-wide.
Changed in version 3.10: On macOS, the function is now system-wide.
!e
from time import monotonic, sleep
start = monotonic()
sleep(2)
end = monotonic()
print(end - start)
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
2.0001410259865224
"perf_counter is for perf_counting, monotonic is for monotonising"
time can go back in time
perf_counter too, possibly
but shouldn't
monotonic can't
I'm not sure what the difference is, AF
u have some sort of article to read about time module func?
or, rather, not guaranteed
semantics/intent/underlying mechanisms
!d time
This module provides various time-related functions. For related functionality, see also the datetime and calendar modules.
Although this module is always available, not all functions are available on all platforms. Most of the functions defined in this module call platform C library functions with the same name. It may sometimes be helpful to consult the platform documentation, because the semantics of these functions varies among platforms.
An explanation of some terminology and conventions is in order.
β’ The epoch is the point where the time starts, the return value of time.gmtime(0). It is January 1, 1970, 00:00:00 (UTC) on all platforms.
in Rust it's idiomatic to use Instant which is an equivalent of monotonic
I think it matters with daylight savings, if your time counter is running when your system goes back or forward an hour, it can count that maybe?
right
2 seconds isn't short
perf counter is based on CPU metrics though isn't it?
or I guess that's the idea at least
The reference point of the returned value is undefined, so that only the difference between the results of two calls is valid.
on both
!e
import time
a = time.monotonic()
b = time.monotonic()
print(a-b)
@lavish rover :white_check_mark: Your 3.12 eval job has completed with return code 0.
-1.4500692486763e-06
!e
import time
a = time.monotonic()
b = time.monotonic()
print(b-a)
a = time.perf_counter()
b = time.perf_counter()
print(b-a)
@lavish rover :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 1.1599622666835785e-06
002 | 6.598420441150665e-07
can i get voice verified i want to talk
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
and i want to show you guys my new dating app i made
yes in python
its like from the facebook
movie - the social network
you know the face smash thing?
!e
from time import monotonic, perf_counter
c0, c1, t = 0, 0, 100000
for i in range(t):
c0 -= monotonic() - monotonic()
for i in range(t):
c1 -= perf_counter() - perf_counter()
print("monotonic", c0/t)
print("perf_counter", c1/t)
@lavish rover :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | monotonic 1.4436703640967607e-07
002 | perf_counter 1.3811212964355946e-07
!e
import matplotlib.pyplot as plt
import numpy as np
# Data for plotting
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)
fig, ax = plt.subplots()
ax.plot(t, s)
ax.set(xlabel='time (s)', ylabel='voltage (mV)',
title='About as simple as it gets, folks')
ax.grid()
fig.savefig("test.png")
plt.show()
@lavish rover :white_check_mark: Your 3.12 eval job has completed with return code 0.
!e
import numpy as np
from PIL import Image
# numpy.random.randint returns an array of random integers
# from low (inclusive) to high (exclusive). i.e. low <= value < high
pixel_data = np.random.randint(
low=0,
high=256,
size=(300, 300, 3),
dtype=np.uint8
)
image = Image.fromarray(pixel_data)
image.show()
@lavish rover :warning: Your 3.12 eval job has completed with return code 0.
[No output]
yo you should use the pomedoro techniqe
learn 25 min take a break and repeat
Einstain techniqe btw
what programming language should i use to create new facebook?
python and typescript
What did they use, PHP?
started out as php i believe
mark zuckerberg used php
after he upgraded that language and changed that name to hack
i mean you could reverse compiled C aswell.
Have to do it in #voice-verification
how is the C interop with Rust?
bruh i have allreaddy like 100+ messages so i dont care
Ah true, you did hit the message threshold
whats that?
is that you on your profile picture?
It is, yeah
classic moderator face 
Meaning....

your face is beautiful
they all put their faces into the camera thats what i mean
ππΏββοΈ

i love this emojis
discord nitro is so fun
true he is cute no homo tho
helplock
I do
minecraft is fun with friends


crunch it
Maybe you can resolve a debate I have been trying to defuse among my old professors: math.pi or numpy.pi
@whole bear lol
lol idk that was copy pasted from matplotlib docs
am i allowed to do a yo mama joke?
Well my next question was going to be how do I skew the x-axis, so I can make a Skew-T Log P diagram
like this
did you want hemlock's pfp to shake?
...i just noticed that temperature is misspelled in the image and now i'm upset
could i please stream?
One sec
!e
import matplotlib.pyplot as plt
import numpy as np
# Data for plotting
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)
fig, ax = plt.subplots()
ax.plot(t, s)
ax.set(xlabel='time (s)', ylabel='voltage (mV)',
title='About as simple as it gets, folks')
ax.grid()
plt.show()
@lavish rover :warning: Your 3.12 eval job has completed with return code 0.
[No output]
!e
import numpy as np
from PIL import Image
# numpy.random.randint returns an array of random integers
# from low (inclusive) to high (exclusive). i.e. low <= value < high
pixel_data = np.random.randint(
low=0,
high=256,
size=(300, 300, 3),
dtype=np.uint8
)
image = Image.fromarray(pixel_data)
image.save("test.png")
@lavish rover :white_check_mark: Your 3.12 eval job has completed with return code 0.
!e
import numpy as np
from PIL import Image
# numpy.random.randint returns an array of random integers
# from low (inclusive) to high (exclusive). i.e. low <= value < high
pixel_data = np.random.randint(
low=0,
high=256,
size=(300, 300, 3),
dtype=np.uint8
)
image = Image.fromarray(pixel_data)
image.save("foo.png")
image.save("bar.png")
@lavish rover :white_check_mark: Your 3.12 eval job has completed with return code 0.
!e
from PIL import Image, ImageDraw
images = []
width = 200
center = width // 2
color_1 = (0, 0, 0)
color_2 = (255, 255, 255)
max_radius = int(center * 1.5)
step = 8
for i in range(0, max_radius, step):
im = Image.new('RGB', (width, width), color_1)
draw = ImageDraw.Draw(im)
draw.ellipse((center - i, center - i, center + i, center + i), fill=color_2)
images.append(im)
for i in range(0, max_radius, step):
im = Image.new('RGB', (width, width), color_2)
draw = ImageDraw.Draw(im)
draw.ellipse((center - i, center - i, center + i, center + i), fill=color_1)
images.append(im)
images[0].save('pillow_imagedraw.gif',
save_all=True, append_images=images[1:], optimize=False, duration=40, loop=0)
@lavish rover :white_check_mark: Your 3.12 eval job has completed with return code 0.
@whole bear I went ahead and gave you the 3 week probationary period, so you're good for a while.
Don't make the Hemlock regret it
"Dzhemz"
Taumata whakatangi hangakoauau o tamatea turi pukakapiki maunga horo nuku pokai whenua kitanatahu
actual name of a small hill in new zealand
Java class names be like
FactoryFactoryFactoryClassFactory
and ofcourse you need a
!d abc.ABC
class abc.ABC```
A helper class that has [`ABCMeta`](https://docs.python.org/3/library/abc.html#abc.ABCMeta) as its metaclass. With this class, an abstract base class can be created by simply deriving from [`ABC`](https://docs.python.org/3/library/abc.html#abc.ABC) avoiding sometimes confusing metaclass usage, for example:
```py
from abc import ABC
class MyABC(ABC):
pass
``` Note that the type of [`ABC`](https://docs.python.org/3/library/abc.html#abc.ABC) is still [`ABCMeta`](https://docs.python.org/3/library/abc.html#abc.ABCMeta), therefore inheriting from [`ABC`](https://docs.python.org/3/library/abc.html#abc.ABC) requires the usual precautions regarding metaclass usage, as multiple inheritance may lead to metaclass conflicts. One may also define an abstract base class by passing the metaclass keyword and using [`ABCMeta`](https://docs.python.org/3/library/abc.html#abc.ABCMeta) directly, for example...
Gotta head out for a bit. Cheers.
!e
from PIL import Image
F=open(__file__,'rb').read()
I=Image.new("RGB",(128,128))
for a,b in zip(F,F[1:]):I.putpixel((a,b),(255,)*3)
I.save("foo.png")
import os
print(os.system("ls"))
@lavish rover :white_check_mark: Your 3.12 eval job has completed with return code 0.
32512
AI Frank Sinatra cover of Where Is My Mind
SenPy notice me!
SymPy Gamma, for those who really don't want to use Wolfram Alpha
from PIL import Image
import requests
F=requests.get("http://placekitten.com/200/300").content
I=Image.new("L",(256,256))
for a,b in zip(F,F[1:]):I.putpixel((a,b),I.getpixel((a,b))+70)
I.save("foo.png")
I'm getting old. The joints in my hands are achy
Video from Derbycon 2012. All videos, with downloads, can be found at this link shortly:
http://www.irongeek.com/i.php?page=videos/derbycon2/mainlist
That moment when you reach this stage and realize you're all out of parmigiana
@desert wolf Granted your perma stream
i learned everything i know about programming on the job. I was hired into a software engineering role with my only programming experience being matlab and fortran for the two-layer model of the atmosphere
@velvet tartan Suuuuuuuup
fwiw i'd absolutely go to grad school just because i actually enjoy it. that and i'd definitely be doing more physics.
@modest condor Yo
hiiii π
i'd absolutely go to grad school just because i actually enjoy
good reason to go to grad school
think it might help me get industry job
not good reason to go to grad schoo
Would rather go to dad school
But first I'd have to get my "no-longer-a-bachelor" degree
FFS hemlock
DOCTOR ALL THE THINGS