#python-discussion

1 messages Β· Page 381 of 1

crisp jay
#

Its kinda old but its useful

velvet hull
#

Thx for telling will look that later but gonna stick on this one for now

hexed topaz
#

What should i make in python?

golden mortar
edgy krakenBOT
#
Kindling Projects

The Kindling projects page contains a list of projects and ideas programmers can tackle to build their skills and knowledge.

hexed topaz
ocean ridge
#

guys i finally fixed a feature after 10 hours of working 😭

crisp jay
ocean ridge
hexed topaz
ocean ridge
#

3 hours yesterday and 7 hours today

#

im gonna open source it tmrw or day after tmrw.

#

its usable now tada

bronze dragon
#

(you have to click the blue "Kindling projects page" text, not the "Kindling Projects" heading, I guess is what went wrong)

ocean ridge
#

i have worked like 50 hours+ on the game editor now 😭

velvet trout
#

Why was blue color picked from the rest of the colors for hyperlinks on internet.

wraith oxide
hexed topaz
#

Is there a way that i can hide all of the outputs in a python program?
Like is there a function where I can hide all previous outputs and start from a clean shell?

gleaming knoll
wraith oxide
gleaming knoll
wraith oxide
crisp jay
gleaming knoll
#

how is python horrible for implementing a compiler?

wraith oxide
#

i just finished one myself

#

it was worst programming expirience i had like ever

gleaming knoll
#

how is the python language itself at fault for this? what problems did it give you?

bronze dragon
wraith oxide
wraith oxide
gleaming knoll
wraith oxide
#

nothing serious but it was still better

#

but at least it was worth it, a dynamiclly typed compiled language

gleaming knoll
#

did you do nan tagging for primitives

wraith oxide
gleaming knoll
wraith oxide
#

its justa homebrew of stuff

gleaming knoll
#

how do you handle nested constructs?

wraith oxide
#

and it works

gleaming knoll
#

like?

wraith oxide
#

like for example modules
so u do import stuff
stuff.function()
i just do stuff__function()

velvet trout
#

I think contextlib had something to control stdout/in/error

gleaming knoll
#

!d contextlib.redirect_stdout

edgy krakenBOT
#

contextlib.redirect_stdout(new_target)```
Context manager for temporarily redirecting [`sys.stdout`](https://docs.python.org/3/library/sys.html#sys.stdout) to another file or file-like object.

This tool adds flexibility to existing functions or classes whose output is hardwired to stdout.

For example, the output of [`help()`](https://docs.python.org/3/library/functions.html#help) normally is sent to *sys.stdout*. You can capture that output in a string by redirecting the output to an [`io.StringIO`](https://docs.python.org/3/library/io.html#io.StringIO) object. The replacement stream is returned from the [`__enter__()`](https://docs.python.org/3/reference/datamodel.html#object.__enter__) method and so is available as the target of the [`with`](https://docs.python.org/3/reference/compound_stmts.html#with) statement...
velvet trout
#

Not sure if that's the appropriate thing

#

For your case, but worth checking stuff here and there

wraith oxide
#

cuz i don't want to like ignore someone

gleaming knoll
# wraith oxide is this to me?

lmao i had the same thought
like i understood what thing they are talking about but i dont understand to who they are saying it

twin night
#

hi guys

wraith oxide
wraith oxide
crisp jay
#

Is it a file?

gleaming knoll
crisp jay
#

Oh

gleaming knoll
hexed topaz
wraith oxide
bronze dragon
wraith oxide
gleaming knoll
#

how is the memory management done? seems to be automatic but im not sure what the semantics are

crisp jay
spice hamlet
velvet trout
#

I was too lazy to tag

spice hamlet
wraith oxide
crisp jay
gleaming knoll
velvet trout
gleaming knoll
#

all programs should be written in Standard ML

wraith oxide
spice hamlet
velvet trout
#

Guys

#

Why not from __future__ import func_as_def ?

#

We have one for != To <> then why not for just a keyword?

gleaming knoll
crisp jay
velvet trout
gleaming knoll
velvet trout
crisp jay
wraith oxide
velvet trout
wraith oxide
velvet trout
spice hamlet
#

how useful do you (the reader of this message) think this comment is?

# level 2
    Level(
        width = 32,
        height = 16, 
        name = "Your First Threat", 
        window_sprite = '#',
        blocks = [], 
        enemies = [Enemy(Vector2(16, 13), '?')], 
        coins = [], 
        player = level_player, 
        time_left = 300, 
        end_pos = Vector2(16, 14)
    )]
crisp jay
#

Does the python docs explain how import works?

dry pike
#

it's in a list?

velvet trout
#

There was a pep i think which talked about a proper mechanism for import system IIRC

spice hamlet
crisp jay
dry pike
#

I think I would prefer to have that a dict, with the keys being the level number

wraith oxide
#

well now i need to get to implementing standard libraries among which will be a fast version of pygame

gleaming knoll
wraith oxide
velvet trout
#

Why does __import__() even exist? And when is it appropriate and recommended to use it?

#

Is it python 2 leftover?

crisp jay
spice hamlet
#
levels: dict[int, Level] = {
    1: Level(width = 32, height = 16, name = "Humble Beginnings", window_sprite = '#', blocks = [Blocks(Vector2(5, 5), Vector2(2, 2), '#')], enemies = [], coins = [Coins(Vector2(10, 12), Vector2(4, 3), '$')], player = level_player, time_left = 300, end_pos = Vector2(31, 15)), 
    2: Level(
        width = 32,
        height = 16, 
        name = "Your First Threat", 
        window_sprite = '#',
        blocks = [], 
        enemies = [Enemy(Vector2(16, 13), '?')], 
        coins = [], 
        player = level_player, 
        time_left = 300, 
        end_pos = Vector2(16, 14)
    )}
    current_level_number: int = 1
    current_level: Level = levels[current_level_number]
velvet trout
gleaming knoll
spice hamlet
#

like this?

dry pike
cerulean ravine
gleaming knoll
#

(dynamic imports - say, a plugin system. though then importlib will usually be the proper choice, not dunder import)

velvet trout
#

thought*

coarse salmon
spice hamlet
velvet trout
dry pike
#

yes, kwargs must be with no spaces around = unless there is a typehint

wraith oxide
cerulean ravine
gleaming knoll
wraith oxide
velvet trout
#

oh wait

#

Doesn't this server have a channel for this type of question

crisp jay
velvet trout
#

include probably pulls and paste the code in that place ig xD

crisp jay
#

Love how C++ took +30 years to make an import system thats not even implemented in all compilers (I think)

velvet trout
#

LMAO

#

Same could be said for lazy import ig

gleaming knoll
crisp jay
mossy sigil
#

Ohh shi i accidentally left this server as i was cleaning all inactive servers from my server list

#

πŸ’€

velvet trout
gleaming knoll
mossy sigil
raven urchin
#

import minecraft
Minecraft.Minecraft

Look guys, I made Minecraft

crisp jay
raven urchin
gleaming knoll
#

hi robin automatic reference counting

raven urchin
peak egret
raven urchin
#

Where is it from

raven urchin
fossil steeple
#
class Copier(type):
    def __getattribute__(cls, name):
        print(name)
        return super().__getattribute__(name)

class Weapons(metaclass=Copier):
    EXCALIBUR = Weapon("Excalibur", "A mighty sword that deals 25 damage.",damage=25)

hey lads what am i doing wrong here

#

oh wait nothing i didn't have my test right lol

coarse salmon
#

you def dont need to subclass type

fossil steeple
#

i need to be able to intercept classvars

coarse salmon
#

how come?

fossil steeple
#

bc i need to give copies of the classvars cos i'm gonna start adding like durability to weapons

frigid quartz
#

Hi

coarse salmon
#

why not just make durability a field on the weapon class?

#
class Weapon:
  durability: float
frigid quartz
#

Hi

#

Pls permission

charred tusk
#

for what

wraith oxide
#

i love how inefficient my compiler is and stil outperforms python

wraith oxide
charred tusk
#

or voice

#

could be multiple things

crisp jay
grave tree
wraith oxide
celest osprey
#

compiler for what lang

wraith oxide
wraith oxide
celest osprey
#

huh

gleaming knoll
celest osprey
#

oh alr alr

crisp jay
fossil steeple
crisp jay
wraith oxide
grave tree
bronze dragon
fossil steeple
coarse salmon
#

each weapon has its own durability

wraith oxide
hexed topaz
fossil steeple
velvet trout
wraith oxide
potent sun
#

hi guys

cerulean ravine
thorn juniper
#

Is there a way to make python type things with out pyautogui (I am learning python atm)

potent sun
#

I just started learning python 2-3 days ago.

fossil steeple
crisp jay
#

!pypi keyboard

edgy krakenBOT
#

Hook and simulate keyboard events on Windows and Linux

Released on <t:1585000026:D>.

velvet trout
wraith oxide
velvet trout
#

Ain't no way i letting inconsistency appear

fossil steeple
thorn juniper
gleaming knoll
wraith oxide
charred tusk
#

Yeah don't be Python, just ignore whitespace

velvet trout
wraith oxide
charred tusk
#

Hi Ned

gleaming knoll
velvet trout
#

Especially consistency

cerulean ravine
crisp jay
potent sun
#

You guys have any idea how do i add empty lists outside of my loop. Because it keeps giving me a NoneType error when the variable strikes in the loop.

crisp jay
#

with out

potent sun
#

or i am just dumb.

celest osprey
#

you are probably over looking something

potent sun
celest osprey
#

happens all the time

gleaming knoll
potent sun
#

wait

velvet trout
edgy krakenBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

cyan scaffold
crisp jay
velvet trout
#

Would be more appropriate if you give us the exact code even if long so we can give appropriate and accurate help

wraith oxide
gleaming knoll
# crisp jay Slow

pithink how is pyautogui slow? just set the appropriate interval and zero the global pause (not sure why it exists but yeah)

wraith oxide
#

thanks

potent sun
#

uhh i pasted it on the site

#

what next

crisp jay
cerulean ravine
edgy krakenBOT
#
Pasting large amounts of code

So that everyone can easily read your code, you can paste it in this website:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

bronze dragon
# hexed topaz Then what do you use?

I use a terminal text editor called Helix, and run my code from a terminal itself using. But you don't have to use these if IDLE works for you.
(eventually you would want to move on to something more featureful like VS Code, but idk how well that works on a Chromebook)

final hollow
#

Click save, then share the link

cyan scaffold
#

What kind of speed you're looking for

potent sun
#

hold up i am new to this thing wait

gleaming knoll
potent sun
#

i am using var_list so it prints out all the created titles when the loop expires.

crisp jay
#

str(input(
[Insert higuruma gif]

thorn juniper
velvet trout
crisp jay
gleaming knoll
cerulean ravine
thorn juniper
potent sun
cerulean ravine
gleaming knoll
crisp jay
thorn juniper
gleaming knoll
# thorn juniper Wdym

open a terminal (not python, just a terminal) and do pip install package where package is the package name

cyan scaffold
thorn juniper
#

Oh Ty

potent sun
#

@cerulean ravine Thank you sir, for your help. It's a little janky but I'll work it out. [sleep hormones are kicking in]

quiet lake
#

programming just clicked today, i was making project without ai and i am doing it good and i think i am gonna go pro in future

potent sun
#

Got the idea from a youtube short for some reason.

crisp jay
#

Idk whats worse:
str(input( or input(print(

potent sun
#

print seems wrong there

#

or i am just new

crisp jay
gleaming knoll
potent sun
spice hamlet
#
input(ehehe)

is way worse

potent sun
cerulean ravine
velvet trout
crisp jay
#

@potent sun Btw you DONT need to do str(input( because input() ALWAYS returns a string

velvet trout
#

I wonder what was behaviour difference between raw input and input in python 2, did it implicitly convert by guessing?

#

Gotta check out old docs

harsh anchor
#

yes

velvet trout
#

How much did it guess and how did it even guess at all? Did it have any loopholes

velvet trout
velvet trout
#

yo why would python go that hard

potent sun
velvet trout
#

I see

crisp jay
potent sun
#

while i was busy fixing my function problems

gleaming knoll
potent sun
#

after which i had the weird idea of using the list i started to make.

crisp jay
#

sys.input() is faster than input() right?

cerulean ravine
potent sun
#

and now I can't process anything.

cerulean ravine
#

second, they would both wait for the user to type something, so Β―_(ツ)_/Β―

potent sun
#

this looks like something out of java

gleaming knoll
#

sys.stdin.read()
though that will wait until eof not newline
so sys.stdin.readline()
and .rstrip('\n') then
horrible

surreal knot
#

thinking in real time

potent sun
#

Thank the holy coding gods for blessing us with Python. I gave up on Java when I saw the amount of script for just printing,

velvet trout
bronze dragon
potent sun
#

java is still important nonetheless

crisp jay
bronze dragon
#

or, I suppose sys.stdout.write, if we're going that way

gleaming knoll
#
sys.stdout.write(str(prompt))
sys.stdout.flush()
sys.stdin.readline().rstrip("\n")

amazing code right here

potent sun
#

@bronze dragon can I dm you pal?

velvet trout
bronze dragon
crisp jay
#

Oh yea

#

sys.stdin.read()

potent sun
crisp jay
#

I used it only one time in my entire life 😭

#

Is it faster than input?

bronze dragon
potent sun
velvet trout
velvet trout
#

I myself find it hard due to natural human thinking of BIG == HARD

#

But later when i learnt basics of programming and OOP, it made sense and not so long/hard, although it is verbose but it makes sense in its own way

velvet trout
crisp jay
#

Java makes OOP easier to understand idk why

spice hamlet
#

i really like OOP

gleaming knoll
#

i like x.f() because of autocompletion, but thats not necessarily OOP, UFCS and dispatch can do that

velvet trout
velvet trout
#

It makes sense after a long journey

gleaming knoll
crisp jay
#

Thats why C++ exist

cyan scaffold
#

Is that a HolyC reference?

crisp jay
#

Does the vatican uses Holy C?

charred tusk
#

probably

velvet trout
#

Holy Python

#

Holy P

potent sun
#

Holy Binary

crisp jay
#

Python interpreter in Holy C

velvet trout
potent sun
#

typing with 0s and 1s must have been insane though.

dull arrow
#

I did play around with TempleOS recently, coercing gcc into generating binaries which can run on TempleOS. In my head I called that endeavor "Unholy C"

velvet trout
potent sun
#

Software Engineer beck then

#

no compiler

velvet trout
#

Punch cards βœŠπŸ‘Š

potent sun
#

i dont think no debug even

#

just 0 and 1

potent sun
gleaming knoll
#

i dont think it uses gcc/clang specific extensions

steel whale
velvet trout
#
type Class = type[object]  # or simply type
type Instance = object

Which one to pick? And is it accurate to what typename is?

cerulean ravine
steel whale
#

test it yourself

cerulean ravine
celest osprey
#

i swear we went through this before lol

steel whale
gleaming knoll
velvet trout
#

Claims without evidence can be dismissed without evidence xD

velvet trout
celest osprey
velvet trout
gleaming knoll
velvet trout
#

How do i? Or is it generally enough

gleaming knoll
crisp jay
velvet trout
gleaming knoll
#

types are also objects - they have a __repr__ and stuff
all values are objects

velvet trout
#

Evrything is an object ahhh

fossil steeple
#

well weapons to be exact

crisp jay
velvet trout
cerulean ravine
velvet trout
#

Everything is OO-able

fossil steeple
#

the metaclass is gonna do smth with them in a second

gleaming knoll
#

i consider using a metaclass for anything concrete an overcomplication

cerulean ravine
timid ember
gleaming knoll
#

something daemon
somethingd

velvet trout
fossil steeple
velvet trout
cerulean ravine
gleaming knoll
velvet trout
#

Difflib had a stroke lmao

edgy krakenBOT
#
Naw.

No documentation found for the requested symbol.

gleaming knoll
#

ok its time to binge watch some more romance anime

velvet trout
#

.endswith("d")

cerulean ravine
cerulean ravine
velvet trout
#

Because why not? XD

velvet trout
fossil steeple
#

anyway i have it done now

velvet trout
#

?does the preceding ? Triggers bot

#

?hibot

fossil steeple
#

wait i actually don't seem to need deepcopies they seem to be made by default

#

interesting

heavy narwhal
#

Guys I’m 14 completed some python courses and im very familiar with the basics and don’t know what to do next i ultimately wanna go into AI and machine learning and have some spare money with which i could buy some books on python but i wanna know what i should focus on now and some book recommendations ig, Have also worked with oop and basic async

fossil steeple
#

oh welp that was a waste of time

cerulean ravine
fossil steeple
cerulean ravine
grave tree
coarse salmon
#

ya youre definitely shooting yourself in the foot by trying to over-engineer the design

fossil steeple
#
x = Weapons.EXCALIBUR
x = 2
print(x,Weapons.EXCALIBUR)

this gives

2 Weapon(name='Excalibur', effect='A mighty sword that deals 25 damage.', damage=25)

therefore deepcopies are made by default

fossil steeple
cerulean ravine
coarse salmon
#

like fundamentally Weapons should be a dictionary or list or something, it being a class makes 0 sense

cerulean ravine
fossil steeple
#

i'll get the help channel up now

cerulean ravine
heavy narwhal
#

Guys I’m 14 completed some python courses and im very familiar with the basics and don’t know what to do next i ultimately wanna go into AI and machine learning and have some spare money with which i could buy some books on python but i wanna know what i should focus on now and some book recommendations ig, Have also worked with oop and basic async

coarse salmon
white temple
crisp jay
fossil steeple
#

1035199133436354600

#

huh

#

oh wait that's id

cerulean ravine
fossil steeple
fossil steeple
wise imp
# coarse salmon like fundamentally `Weapons` should be a dictionary or list or something, it bei...

classes can easily be used simply as data containers (think struct in C), just like a dictionary and you get dot attribute access
there's nothing fundamentally wrong about it, it's in that sense exactly the same as using a dictionary (a list would be a bit dubious for something that benefits from named properties though and semantically incorrect, a tuple maybe, but again, lack of named attributes)
god damnit, you said Weapons... well, still, a class (such as an enum) might make sense for this, it'd be similar to having a dictionary of enum: object pairs

crisp jay
coarse salmon
#

yeah i would personally go
WeaponDef for storing static data about a weapon
weaponDefs: dict[str, WeaponDef] for storing the map of weapon def ids to their respesctive definition
Weapon for the actual game runtime object that does stuff
WeaponManager for the object attached to the player that manages all of the player's weapons

source: the naming convention i used for the game i worked on the past 2 years

coarse salmon
#

enum is fine, but it might not be super useful since i feel like it would be rare to access a specific weapon by its static id

cerulean ravine
coarse salmon
#

like if you have 200 weapons the player can pick up, the logic is probably going to be like player.primary_weapon = picked_up_weapon referencing a variable not a specific id

coarse salmon
quick compass
#

Hello nedbat

I see that you are a helper, May I know if you have knowledge in data science field?

wise imp
dry pike
wise imp
charred tusk
#

coming soon...

wise imp
#

you can probably confuse it pretty badly though

dry pike
wise imp
quick compass
left path
#

Anyone here use gemini code assist?

runic flower
coarse salmon
#

no

left path
runic flower
left path
#

ya only issue i have with gemini is its tool access

#

seeing if anyone has found a way to give it web search

coarse salmon
#

claude has been pretty good to me for learning recently

#

since when it explains, it tends to use much more up to date info than chatgpt

#

like chatgpt still recommends to use SERIAL in postgres even though it was deprecated 9 years ago lol

charred tusk
#

It was?

coarse salmon
#

soft deprecated i suppose

charred tusk
#

What's the replacement?

raw bramble
coarse salmon
charred tusk
#

Isn't that not the same?

#

What if I want a SERIAL thats not my PK?

coarse salmon
#

well it's the modern replacement, there were a few issues with serial that it tried to address

runic flower
# coarse salmon like chatgpt still recommends to use `SERIAL` in postgres even though it was dep...

Yeah stuff like that happens all the time. I asked ai how to get rabbitmq installed via helm and it lead me down a LONG rabbit hole (NPI) before finally after much debugging announcing that it can no longer be done after I started checking rabbitmq's documentation myself. This is a typical expereince, sometimes AI cuts through the noise and is a big win, sometimes it gets lost in legacy forests and just delays you.

coarse salmon
#

can just be used wherever

crisp jay
coarse salmon
left path
charred tusk
#

Is it stealing other tables identities?

left path
coarse salmon
charred tusk
#

What good is an identity that’s not an identity

coarse salmon
#

well im pretty sure 95% of the time you would use it for a pk

#

but it's not required

charred tusk
#

Not even a little bit

#

Okay maybe a little bit
But serial columns are not inherently always identity

scarlet wyvern
#

hello guys

static patio
#

hey people there is a chineese woman here that give a script to use it
then when I installed the script it have trojan horse
told here when I met you I will knock you out cold

crisp jay
brisk pagoda
#

bro why cant i send gifs

#

they turn into links

cerulean ravine
brisk pagoda
#

oh alr

#

mb

cerulean ravine
wise imp
#

it's unusual even within this server, this is the only channel with that restriction

manic flare
#

I’ve seen quite a few servers which do the same, especially in general-type channels

dry garden
#

guys, for loops in c make more sense than in python

gleaming knoll
fossil steeple
crisp jay
dry garden
# wise imp how come?

you dont iterate thro a list, you loop a number of times under a certain condition, straightforward

dry garden
gleaming marten
#

Whats not straightforward about iterating through a list

#

Is this tired bait

lunar cobalt
#

Is yfinance a yahoo api or a scraper?

crisp jay
#

Ngl I prefer writting python for loops

peak relic
crisp jay
#

Imagine if C had for (int i = 0..10)

fossil steeple
#

yahoo

lunar cobalt
fossil steeple
#

get it

lunar cobalt
#

Like I cant use it for commercial use

crisp jay
#

I know that C++ has that

lunar cobalt
#

But in a github repo for example

dry garden
peak relic
wise imp
#

!pypi yfinance

edgy krakenBOT
#

Download market data from Yahoo! Finance API

Released on <t:1771271554:D>.

gleaming marten
dry garden
#

alr

lunar cobalt
#

a scraper

wise imp
#

it literally says it uses an API

gleaming knoll
#

im not sure how

for (size_t idx = 0; idx < array.size; idx++) {
  process(array[idx]);
}

makes so much more sense than

for element in array:
  process(element)
gleaming marten
#

There is no yahoo finance api anymore i dont think

crisp jay
lunar cobalt
#

I think the API is internal though?

#

So like not meant to be used like this

gleaming marten
#

Cant be internal if yfinance sees it

#

It just scrapes

peak relic
#

Its undocumented API... So I guess a bit of scraping is involved

gleaming marten
#

Yahoo shut down their finance api like 10 years ago

unborn lagoon
wise imp
#

why'd they not keep it alive forever, smh

gleaming marten
#

Yahoo wasnt doing so well

gleaming knoll
raw bramble
#

Why does Yahoo still exist? How does Yahoo still exist?

coral musk
#

can anyone help me?

raw bramble
unborn lagoon
fossil steeple
green perch
gleaming marten
#

No?

coral musk
green perch
#

ok my bad

wise imp
gleaming marten
#

Theyre still in the 90s technologically

gleaming knoll
#

are they safe from AI slop??

wise imp
fiery yarrow
wise imp
gleaming marten
#

Im sure they have some cool gadgets of their own

unborn lagoon
# wise imp why?

It's basically a different company from Yahoo in the US, pretty much.

wise imp
#

I see

crisp jay
errant steppe
#

If you suddenly received $50,000 at your doorstep, which of these would you spend it on first?

  1. Family
  2. Child
  3. Car
  4. Bills
  5. Clothes
  6. Food
  7. Investment
  8. School
  9. Vacation
  10. House
  11. Savings
  12. Donations”
peak relic
edgy krakenBOT
gritty kite
#

piton

steel whale
#

even the most remote islands and countries are not safe from AI slop

runic wharf
spice hamlet
#

jython tho

runic wharf
spice hamlet
runic wharf
#
#include <CGame.h>
frank turret
#

Python?

#

I only know PythOWO

runic wharf
frank turret
runic wharf
gritty kite
remote harness
#

should I use pycharm or visual studio?

cerulean ravine
remote harness
runic flower
stray field
remote harness
cerulean ravine
#

more people use VSCode these days, but that might not be a deciding factor

runic flower
#

One vscode feature (extension) I found recently lets me remotely build/run/git python on my linux box from my windows desktop, gives me a remote ssh for the terminal window too. Very convenient.

charred tusk
coarse salmon
#

If you want tabout the best extension known to mankind use vsc

runic flower
charred tusk
#

Based

stray field
#

Microsoft should open source the remote extension. Iirc, most of its functionality is built into vscode

stray field
#

But that was probably in response to cursor

raw bramble
#

Microsoft should just Open Source all of their products and have people who actually care about their stuff fix it

cerulean ravine
#

"just"

peak egret
#

justfile

rare gazelle
#

i think that there aren't any better alternatives

#

for example, windows

#

or vscode

#

(although vscode is open source?)

#

but its not like i must use their products

runic flower
rare gazelle
#

cursor does look like vscode, didn't know it's a fork of it

#

i think that the better route is to try and make an os better than windows, and open source

stray field
#

What's your favorite justfile recipe?

rare gazelle
#

that can load exe files natively, and basically support all of windows features

#

or not, but do things better

cerulean ravine
rare gazelle
#

thats not what i said

stray field
#

Cursor ruined Microsoft extensions for code-oss and vscodium users.

rare gazelle
#

i said to have all its features, or neglect some and have better features

cerulean ravine
rare gazelle
#

so people could move to it without losing features

cerulean ravine
rare gazelle
#

u reimplement the features u want, thats true, but its not a windows copy

unborn lagoon
rare gazelle
cerulean ravine
#

ok

rare gazelle
#

it doesn't need to be exactly all the features

#

it needs to feel that u dont lose by moving

#

and if its open source u finally dont need microsoft

#

and dont rely on it

cerulean ravine
#

sounds great, but it;s a lot of work. better get started

rare gazelle
peak egret
#

should i make my dream proglang or not

rare gazelle
autumn forge
peak egret
#

i need to ban OOP but i cant

cerulean ravine
autumn forge
#

well, you can not add it

peak egret
autumn forge
#

polymorphism isn't just an OOP concept

peak egret
#

yep but its hard to reason about it outside of OOP

tame hinge
#

Languages like go and rust already effectively ban oop

peak egret
#

they don't

#

rust doesn't

#

rust just doesnt have inheritance, it has all other oop features

autumn forge
kind thicket
peak egret
#

compare modern TS to rust, TS gets verbose quickly

autumn forge
#

rust can also be very verbose

#

I don't see your point

peak egret
#

no I mean look at idiomatic React code

tame hinge
peak egret
#

the thing with modern TS is that classes are hated

#

TS doesn't have pretty features like dataclasses, and people just prefer to create raw "unbranded" objects, then later realize their mistake and hack on a "brand" property

tame hinge
#

Yea the typescript/JavaScript community doesn't seem to like oop generally.

soft notch
#

hello

peak egret
#

ban

autumn forge
#

I don't really understand what you're getting at. If there are things you don't like about OOP, then... don't include them? It is your language, you can do what you want.

velvet trout
#

Pythonic morning, chat

cerulean ravine
velvet trout
#

Is not that name and profile violating some rules? Or not.

grave tree
# soft notch hello

could you change your nickname in this server to something that isn't blank?

soft notch
#

ok

grave tree
#

ty

coarse salmon
#

But I agree that bad typescript can get very ugly

peak egret
#

i dont feel TS is any higher level than Rust is

peak egret
velvet trout
#

I would still credit Astral for that

peak egret
#

I wish there was a better way to write this:

p = await create_subprocess_exec(
    "tree",
    "--gitignore",
    *(["-P", self.pattern] if self.pattern else []),
    stdout=PIPE,
)
crisp jay
coarse salmon
#

It compiles directly to machine code

peak egret
#

even JS does

crisp jay
#

TS is just a linter

autumn forge
cerulean ravine
crisp jay
#

I dont understand it in OOP

coarse salmon
soft notch
jagged belfry
tame hinge
# crisp jay I dont understand it in OOP

It's so that you can take the shape of something, define this shape, and anything that matches it you can use while knowing nothing about it. You get more variation and reuse. Even functions can be polymorphic.

cerulean ravine
tame hinge
peak egret
jagged belfry
#
extra_args = []

if self.pattern:
  extra_args.extend(["-P", self.pattern])

p = await create_subprocess_exec(
    "tree",
    "--gitignore",
    *extra_args,
    stdout=PIPE,
)
autumn forge
# crisp jay Yea

specifically in OOP, it is useful that subtypes can be used wherever a type is valid, i.e., a method expecting an Ant would also work with WorkerAnt. WorkerAnt may have different behaviour to, say SoldierAnt, but this doesn't matter to a method which expects simply an Ant

peak egret
#
await sh(t"tree --gitignore {self.pattern and ['-P', self.pattern]}")
crisp jay
#
extra_args = list()

if self.pattern != None and self.pattern != False:
  extra_args = extra_args + ["-P", self.pattern]

p = await create_subprocess_exec(
    "tree",
    "--gitignore",
    *extra_args,
    stdout=PIPE,
)
jagged belfry
#

+= can be used here too I guess

autumn forge
#

list() ew

jagged belfry
#

My instinct keeps itching at me to make extra_args a dict but that's not how the command line works unfortunately

crisp jay
crisp jay
peak egret
#
p = await create_subprocess_exec(
  *ListFactory("tree")
    .args("--gitignore")
    .args("-P", self.pattern, when=self.pattern)
)
autumn forge
#

de morgan's law strikes again

slender urchin
crisp jay
#

Oh yea

jagged belfry
#

should be and

autumn forge
peak egret
#
p = await create_subprocess_exec(
    *Cmd(tree, "--gitignore").args("-P", self.pattern, if_=self.pattern),
    stdout=PIPE,
)
#

Cmd(...).if_(condition)(*arguments) is also possible

#
tree = Cmd(cmd) if (cmd := shutil.which("tree")) else None
#
    def if_[*K](self, condition: object) -> Callable[[*K], Cmd]:
        def wrapper(*args: object) -> Cmd:
            if condition:
                return self.arg(*args)
            return self

        return wrapper

not sure how to type this

shrewd plinth
#

Man, I'm spinning out on a course assignment because I'm being asked to select 20 random values from an array that are evenly spaced, presumably while using their random seed

#

Maybe I do'nt need to get the exact value they did and there's a tolerance, but I'm afraid I need to match it exactly

#

Also, this isn't even an algorithm class so I'm not sure what they want me to do

peak egret
#

pick random values until you pass the test cases

shrewd plinth
#

hah

#

Honestly

peak egret
#

tell claude to do it

shrewd plinth
#

nah

#

I know AI too well to rely on it for this

#

I don't even know if they want evenly spaced logarithmically, linearly, or index...ally

#

Screw it, I'll do it indexally. I doubt they're looking for an actual selection algorithm here

pallid garden
#

nowadays i cant even trust my linter

#

let alone an LLM

autumn pelican
vale wasp
shrewd plinth
vale wasp
shrewd plinth
#

The potentially relevant bits:

Instructions:

  1. Fit an unpruned tree on training data and obtain ccp_alphas via cost_complexity_pruning_path on the TRAIN split only.
  2. Subsample up to 20 unique alphas, evenly spaced.
#

Whoah sorry, forgot about markdown

raw bramble
#

Finding issues and annoyances to solve has to be a skill I swear

shrewd plinth
#

Anyway, I already have the array. By subsample I assume they're applying sklearn.utils.resample. But the "up to" and "evenly spaced" are throwing me for a curveball

vale wasp
shrewd plinth
#

Not my tree, just the alphas that are calculated as part of the cpp algorithm

shrewd plinth
#

239

#

So I might just go by index in terms of evenly spaced, because they are not spaced evenly in absolute terms

wise imp
shrewd plinth
vale wasp
# shrewd plinth 239

So [arr[n] n for n in range(0, len(arr), len(arr) // max_samples)] should do it.

wise imp
peak egret
#

its my favorite computer science approach after vodka

shrewd plinth
pallid garden
#

you jest, but i have taught people python while on gin before

shrewd plinth
#

Idk, I hate the problem statement

granite wyvern
# peak egret ```py p = await create_subprocess_exec( *Cmd(tree, "--gitignore").args("-P",...

I've got a function prep_argv(argv) which returns a new argv list after tidying it. I use it both directly and through run() (a pretty thin wrapper for subprocess.run) so that i can make argument lists like this (real example):

        run(
            [
                'rsync',
                not doit and '-n',
                ('-e', ssh_exe),
                not quiet and '-i',
                verbose and '-v',
                partial and '--partial',
                bwlimit and ('--bwlimit', bwlimit),
                doit and not quiet and sys.stderr.isatty() and '--progress',
                '-ar',
                delete and '--delete',
                f'--exclude={fstags.tagsfile_basename}',
                *rsync_opts,
                '--',
                f'{srcdir}/',
                f'{dstdir}/',
            ],
            doit=True,  # let rsync -n do this
            quiet=quiet,
        )

prep_argv (called internally by run above) turns that into a flat argument list, discarding None and False arguments and inlining the tuples (which are there basicly to eg group ('-e', ssh_exe)

shrewd plinth
#

I have coded while blazed

#

THe downside is that I have no idea what my comments mean

wise imp
shrewd plinth
#

#yo, this right here

vale wasp
shrewd plinth
#

I just dislike the ambiguity. I'll try just evenly spacing the indices out and if that doesn't work see if I can get enough points on other sections for that one to not matter.

It's a newer course which is good for getting caught up on later advances but bad for being the guinea pig

vale wasp
shrewd plinth
#

That's probably the best approach

vale wasp
#

The feedback that the instructions aren't clear should help. It's also possible that the instructor doesn't care how you interpret the instructions.

shrewd plinth
#

haha

#

I'm actually not 100% sure I can contact the instructor. This is for a master's program but it's performance based admissions. I have to pass 3 specific classes with a certain grade to get admitted.

hybrid nebula
patent solstice
#

Hi guys , hope everyone if fine !
Rn i am learning python from a book , and w3sschools .
Also i use Gemnin to create me some problem to solve and some mini project to do so i dont forget what i took and use them.
is this a right way to learn python?
(ping me)

shrewd plinth
#

I mean I could reverse engineer his email address from other prof emails at the university

#

w3schools is a very unreliable source, and llms can also be fairly unreliable

swift sparrow
vale wasp
#

I once had an assignment to "write a program that will clear a 25x80 terminal window." My solution:

void main(char* argv, int argn) {
    system("clear");
    return 0;
}

Instructor was looking for:

for (i = 0; i <= 25; i++) {
    print("\n");
}

He had taught us system in that class. I got an A on the assignment.

swift sparrow
#

Pick an actual structured resource and work through it so you can better track your progress

edgy krakenBOT
#
Go-to beginner resources

Here are the top free resources we recommend for people who are new to programming:

For a full, curated list of educational resources we recommend, please see our resources page!

shrewd plinth
#

I saw a really funny language course submission. I think it was a english class based in russian. Kid had to submit a sample conversation, it went something like this:

"Hello, do you speak Russian?"
"Yes, I do"
"Great! Please tell me how to reach the terminal"
russian directions
russian response
russian farewell

#

the prof was not amused

hybrid nebula
vale wasp
hybrid nebula
#

Guess how I did it

vale wasp
autumn forge
vale wasp
# hybrid nebula 15?

I stopped counting. It was a common interview question back when I worked in C.

hybrid nebula
orchid pier
hybrid nebula
#

1<< x

vale wasp
autumn forge
vale wasp
orchid pier
vale wasp
orchid pier
#

I can't remember

steady rain
orchid pier
#

oh that function

steady rain
patent solstice
autumn forge
toxic breach
vale wasp
steady rain
autumn forge
#

in any case it is a bad question, and bad questions ought to be answered in equally silly ways

orchid pier
shrewd plinth
#

update on my thing, I just wound up doing:

indices = np.linspace(0,238,20).astype(int)

steady rain
orchid pier
patent solstice
hybrid nebula
shrewd plinth
#

!resources

Well, you know how you best learn, but if you're really not sure where to go, here are some good ones. Automate the boring stuff is very popular

edgy krakenBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

orchid pier
#

Damn

orchid pier
#

I got an F in coding

hybrid nebula
shrewd plinth
#

Can I do powers of 2 but in binary

patent solstice
vale wasp
edgy krakenBOT
#
Go-to beginner resources

Here are the top free resources we recommend for people who are new to programming:

For a full, curated list of educational resources we recommend, please see our resources page!

steady rain
hybrid nebula
shrewd plinth
#

You're giving me flashbacks to an interview where they wanted me to convert from base 3 to base 7 in my head

rugged barn
#

Might be a stupid question,
But when would you ever actually want to use a sentinel value?

patent solstice
#

I want also to ask smth , many freind also my freinds tell me that Ai will take my job and yap yap yap.
i just want to hear more people saying why AI wont take my job or my dream so i feel a releaf:)))

shrewd plinth
#

and no, it was not relevant to the position in any way shape or form

steady rain
orchid pier
rugged barn
hybrid nebula
vale wasp
shrewd plinth
# vale wasp That's just cruel.

What's worse is that I was told it was just a screening call, then I was suddenly there for the company's vp of engineering

shrewd plinth
#

Also, I was off by like.... only 1 or 2 somehow, I have no idea how i got that close. Still got mocked

hybrid nebula
#

Null-terminators for strings are just sentinel values

rugged barn
patent solstice
#

I want also to ask smth , many freind also my freinds tell me that Ai will take my job and yap yap yap.
i just want to hear more people saying why AI wont take my job or my dream so i feel a releaf:)))

shrewd plinth
#

Yeah. I still get some interviews like that from time to time.

rugged barn
#

Like, a function parameter has a sentinel value

hybrid nebula
#

Sentinel values can be used to send a stream of data without knowing the length

vale wasp
shrewd plinth
#

I don't know what AI will take or not take, nobody really does. It's not even about the technology, it's about what people think the technology can/will do

vale wasp
shrewd plinth
#

I also had to write SQL in my head and rattle of linux syntax

grave tree
hybrid nebula
patent solstice
shrewd plinth
#

I think AI and its impact is very unstable now and it will be some time until we can see its true effect.

vale wasp
rugged barn
#

Explains it succinctly

#

Much appreciated, you two

shrewd plinth
#

Yeah, I'm like..... man, I haven't done this since college

#

and I had pen and paper

vale wasp
#

I despise whiteboarding interviews. They are such a waste of time.

hybrid nebula
#

or should I say 10-10

shrewd plinth
#

The market is so rough these days that I'm even willing to do takehome assignments. Although I've limited myself to only ones that can be done in an evening. No more of this week long stuff.

There was a hero online though who did take home projects but watermarked them and said he's had a couple companies completely flip out over it

vale wasp
vale wasp
shrewd plinth
#

I think I would, too. But also like... My algorithms are on medical devices that are out on the market. I should jsut be able to point and say "there's your proof"

#

Idk. I'm also of the belief that like.... idk man, 5 rounds of interviews max

#

I don't care if you're hiring for the CEO

patent solstice
#

we gotta wait for now, but i know learning and understand the code could protect me from it

vale wasp
#

I once went through a process of 5 or 6 interviews. Left the last one being told to expect to hear about next steps in a day or two, i.e. expect the job offer. Got home to find an no thank you email in my inbox. (This was before smartphones.)

rapid mulch
#

So I added a comma to fix an error

#

And I got 56 errors

#

❀️

shrewd plinth
#

Haha that's how it is

#

I've been fixing the error that came from fixing the error that came from fixing the error that....

rapid mulch
#

1e7 errors

vale wasp
#

99 little bugs in the code.
99 little bugs.
Take one down,
Patch it around.
117 little bugs in the code.

rapid mulch
#

😭

vale wasp
#

There's a reason 80% of the job is debugging.

rapid mulch
#

I’m a beginner and decided to make my programming assignment harder by using nodes for a CYOA game

#

This sucksss it takes forever cuz im a bad writer

patent solstice
rapid mulch
#

Its a form of data management

patent solstice
#

like def and for loops

rapid mulch
#

Me too I just chose a really hard way to do something to learn

rapid mulch
shrewd plinth
#

Is it the writing part that's tripping you up? Or the organization of it?

patent solstice
shrewd plinth
#

I suggest instead of using defs and for loops you.... oh. A graph works really well for this

#

If you're uh, familiar with graphs

#

if not then RIP

rapid mulch
#

Writing parts annoying and long but the engine is really hard

patent solstice
#

is this a good source?

grave tree
shrewd plinth
#

Seems like it but bear in mind the tip, it's made for programmers new to python as opposed to someone new to programming

rapid mulch
#

It’s made by the Python devs so I’d assume so

#

But it’s kinda hard to read syntax

patent solstice
rapid mulch
vale wasp
edgy krakenBOT
#
Go-to beginner resources

Here are the top free resources we recommend for people who are new to programming:

For a full, curated list of educational resources we recommend, please see our resources page!

rapid mulch
#

CS50p is really good if you do the problem sets

patent solstice
rapid mulch
#

How do I make a message formatted in code 'py something?

rapid mulch
strong lava
#

Hi where is the channel to ask for help with coding ?

vale wasp
rapid mulch
#

Your in it

shrewd plinth
#

!code-block

edgy krakenBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

shrewd plinth
#

Hah, I guessed it

vale wasp
patent solstice
#

So to many things will confuse me tbh .
I have
1-Automate the Boring Stuff with Python
2-CS50
3-https://docs.python.org/3/tutorial/

i can not use 3, i should stick with 1 or 2 max ?
what do u think all?

patent solstice
vale wasp
#

The python.org tutorial is aimed at experienced programmers.

rapid mulch
#
nodes = {
        β€œnodeName”: {
                   β€œtext:”: β€œ\n txt”
                    β€œchoices”: {
                           β€œchoice1”: {
                                β€œnext: β€œnode1”
                           },
                           β€œchoice2”: {
                                     β€œnext”: β€œnode2”
                           }
                     }
              },
#

This is how I’m formatting my nodes (roughly my phone makes it really hard to type it exactly vs what’s on my laptop)

patent solstice
patent solstice
#

what are your experainces?

#

btw?

vale wasp
#

I've been a professional software engineer for 20 years.

pallid garden
vale wasp
pallid garden
#

20 years is a long time to stay awake...

granite wyvern
vale wasp
rapid mulch
vale wasp
patent solstice
vale wasp
patent solstice
#

Thanks for the help!
how is the job market after AI , AM i cooked?

rapid mulch
#

He’s been a professional software engineer longer than Ive been alive

rapid mulch
vale wasp
pallid garden
patent solstice
vale wasp
patent solstice
vale wasp
shrewd plinth
#

Well, on one hand AI is still growing. On the other hand, a lot of the push of replacing engineers with AI is done by people who don't understand the limitations of AI. So who knows where it will balance out over time.

pallid garden
rapid mulch
pallid garden
patent solstice
patent solstice
shrewd plinth
#

Honestly, even on the upper bound, I don't think GenAI can ever grow beyond a point where it's probably approximately correct

vale wasp
#

A friend of mine, a staff software engineer and PSF board member, was just laid off last week with a number of other people at their company. There's fallout.

pallid garden
patent solstice
#

Also i heard that they are cutting emplyers bc of no money , but they are saying we are using AI so investors dont get the money back

shrewd plinth
#

Honestly, you know what the most important thing is? If you rely on a person/company and they don't deliver, you can blame/sue them. If you rely on AI and it screws up? You'll be the only one shouldering the blame

#

I don't pay someone to repair my laptop because I can't, I pay them so I can blame them if it goes wrong

granite wyvern
vale wasp
pallid garden
patent solstice
patent solstice
vale wasp
frosty oriole
patent solstice
pallid garden
#

when will oracle fire the 3 billion devices

patent solstice
patent solstice
pallid garden
#

they probably shouldnt keep so many devices running when they have no customers

frosty oriole
patent solstice
pallid garden
shrewd plinth
#

Speaking of, does anyone know how to turn off the stupid google AI when you google something?

rapid mulch
pallid garden
grave tree
rapid mulch
#

My school is in massive debt cause some dumbass messed up

shrewd plinth
#

Good advice. Any suggestions on other search engines?

vale wasp