|
FlapYoJacks posted:F-strings should be used everywhere possible. I think I read somewhere that you shouldn’t use them when logging but i don’t remember why or even if it makes sense
|
# ? Jan 14, 2024 02:29 |
|
|
# ? May 20, 2024 06:24 |
|
Armitag3 posted:I think I read somewhere that you shouldn’t use them when logging but i don’t remember why or even if it makes sense The official logging library uses lazy evaluation for string interpretation yeah. Gotta go with logger.info("%s: Turn your monitor on.", name) edit: You can also set the style using logging.basicConfig either to '%', '{' or '$'. https://docs.python.org/3/library/logging.html#logging.basicConfig FlapYoJacks fucked around with this message at 02:39 on Jan 14, 2024 |
# ? Jan 14, 2024 02:36 |
|
FlapYoJacks posted:edit: You can also set the style using logging.basicConfig either to '%', '{' or '$'. https://docs.python.org/3/library/logging.html#logging.basicConfig
|
# ? Jan 14, 2024 02:42 |
|
today i learned that ?>!:,< is a valid key name in yaml
|
# ? Jan 14, 2024 02:52 |
|
prisoner of waffles posted:f-strings are fine. I would like to revise my earlier statement: if it is possible to write an f-string where one of the interpolated expressions is itself an f-string (presumably using different quotation marks?) then that is forbidden and shameful. that way lies the greatest sins of JSX
|
# ? Jan 14, 2024 03:53 |
|
prisoner of waffles posted:I would like to revise my earlier statement: if it is possible to write an f-string where one of the interpolated expressions is itself an f-string (presumably using different quotation marks?) then that is forbidden and shameful. that way lies the greatest sins of JSX Nested f-strings are fine.
|
# ? Jan 14, 2024 03:57 |
|
prisoner of waffles posted:I would like to revise my earlier statement: if it is possible to write an f-string where one of the interpolated expressions is itself an f-string (presumably using different quotation marks?) then that is forbidden and shameful. that way lies the greatest sins of JSX with JSX, or javascript template strings, the code inside the {} is parsed like completely normal code
|
# ? Jan 14, 2024 04:20 |
|
tef posted:today i learned that ?>!:,< is a valid key name in yaml i think a parser that breaks compat with the spec for this is fine, tbh
|
# ? Jan 14, 2024 05:02 |
|
FlapYoJacks posted:F-strings should be used everywhere possible. sure would be nice if they worked for binary strings. loving python
|
# ? Jan 14, 2024 05:03 |
|
Visions of Valerie posted:sure would be nice if they worked for binary strings. loving python And floats for some reason.
|
# ? Jan 14, 2024 05:05 |
|
air on a f-string
|
# ? Jan 14, 2024 05:09 |
|
tef posted:today i learned that ?>!:,< is a valid key name in yaml it's a syntactically valid composition in k, too, but it doesn't do anything useful "distinct of grade-down of odometer of enclose of less" the colon is redundant, since ! is textually forced to be monadic already, but some dialects tolerate it Internet Janitor fucked around with this message at 05:14 on Jan 14, 2024 |
# ? Jan 14, 2024 05:12 |
|
FlapYoJacks posted:And floats for some reason. don't they? Python code:
|
# ? Jan 14, 2024 05:14 |
|
anyone want to make a new compiler for me? my idea is that it should have 100% compatibility with existing python code but compile down into small binary executables and run faster than c in most benchmarks. ill give you partial credit for implementing my idea so you can put it on your resume
|
# ? Jan 14, 2024 05:32 |
|
fart simpson posted:anyone want to make a new compiler for me? my idea is that it should have 100% compatibility with existing python code but compile down into small binary executables and run faster than c in most benchmarks. ill give you partial credit for implementing my idea so you can put it on your resume https://cython.readthedocs.io/en/latest/src/tutorial/cython_tutorial.html
|
# ? Jan 14, 2024 05:34 |
|
Internet Janitor posted:it's a syntactically valid composition in k, too, but it doesn't do anything useful what
|
# ? Jan 14, 2024 06:23 |
|
rjmccall posted:openmp is meant to be a performance optimization, and supporting it well so that it’s actually, y’know, faster requires major system and toolchain integration work. this is the real heart of the matter right here: it’s not just something where a switch can be flipped and it makes code faster, but its adopters expect to behave that way (and the language in OP’s post seems to imply that’s how they see it) it would take a large amount of work to actually have it implemented in a way that will provide the expected benefit, and the code in the wild that could take advantage of that is pretty sparse
|
# ? Jan 14, 2024 06:48 |
|
Captain Foo posted:what each character is a function boolean less-than -> odometer -> grade-down -> distinct so as far as I can tell: the less-than will output 0 or 1 it's fed into odometer which counts up from 0 but since the input is 0 or 1 the output is a list containing 0 that's fed into grade-down which tells you how to sort numbers, which doesn't do anything useful with odometer ever, but in this particular situation also outputs a list containing 0 then distinct gives you every distinct element in a list, so it also outputs a list containing 0
|
# ? Jan 14, 2024 08:59 |
|
2Fast2Nutricious posted:how do you even become a compiler developer? i dont even know what skills you need to have to be one it’s just code, it’s not magic
|
# ? Jan 14, 2024 12:36 |
|
Visions of Valerie posted:don't they? Sorry, I meant precision: Python code:
quote:print(f"0x{255:8.8X}")
|
# ? Jan 15, 2024 19:03 |
|
FlapYoJacks posted:Sorry, I meant precision: Oh, that. Yeah that sucks
|
# ? Jan 15, 2024 21:58 |
|
Dylan16807 posted:each character is a function Visions of Valerie posted:Oh, that. Yeah that sucks
|
# ? Jan 15, 2024 22:27 |
|
The Something Awful Forums > Discussion > Serious Hardware/Software Crap > YOSPOS > PL thread:Visions of Valerie posted:Oh, that. Yeah that sucks
|
# ? Jan 15, 2024 22:40 |
|
Brain Candy posted:please don't mention the m-word matlab
|
# ? Jan 17, 2024 05:48 |
|
mathematica maple
|
# ? Jan 17, 2024 06:12 |
|
merl
|
# ? Jan 17, 2024 06:58 |
|
MUMPS
|
# ? Jan 17, 2024 07:06 |
|
CPColin posted:MUMPS you don’t get in on it
|
# ? Jan 17, 2024 07:20 |
|
keep that poo poo in wisconsin
|
# ? Jan 17, 2024 07:20 |
|
fart simpson posted:matlab indexing my arrays from 1, achieving smoothest brain possible
|
# ? Jan 17, 2024 11:43 |
|
one-indexing is contrarian but acceptable, but column-major?? get the gently caress out of here
|
# ? Jan 17, 2024 14:43 |
|
many are the crimes of matlab, including cells (vectors, matrices, or tensors of pointers) and “every N-dimensional matrix is also a column-vector.” MATLAB OOP also seems totally gross. However, their datatable implementation and interface is actually pretty good; I’d be very happy to have it instead of the pandas equivalent— assuming the MATLAB table was reimplemented in Python. never messed with polars yet but it looked very pandas-ish.
|
# ? Jan 17, 2024 15:48 |
|
1-index column-major is a fortran thing, surely that's where matlab got it from
|
# ? Jan 17, 2024 19:48 |
|
lua is also one indexed
|
# ? Jan 17, 2024 20:32 |
|
we should not go one-indexed *now* as the retraining would be ridiculous, but having done both extensively there's for sure more off-by-ones doing 0-indexed.
|
# ? Jan 17, 2024 20:35 |
|
Perl can be 1-based indexing, but, you know, it’s up to you
|
# ? Jan 17, 2024 20:44 |
|
i have to deal with mixed indexed code, where im dealing with data in a zero indexed python environment but it will be interpreted in a 1 indexed environment on the other side
|
# ? Jan 17, 2024 20:44 |
|
having a hard time reading the python complaints from a few pages back as someone who used to get paid to maintain perl written by EE's "oooh my modules took me an hour to sort out file paths" there were functions with no call sites, they'd just bodge up the name on the spot and eval() it. you'd weep
|
# ? Jan 17, 2024 21:21 |
|
column-major matrix layout is a perfectly reasonable thing, and a lot of algorithms are written for it. it’s unfortunate that it doesn’t match the natural layout of nested arrays, but nested arrays are usually a lazy way to implement 2D matrices anyway
|
# ? Jan 17, 2024 21:36 |
|
|
# ? May 20, 2024 06:24 |
Clearly the solution is to use Haskell's Arrays, where you decide at construction time how to index the arrays. You can do 0-indexed, 1-indexed, 2-indexed, or even tuple-indexed (great for mapping 2D matrices onto contiguous memory)!
|
|
# ? Jan 17, 2024 21:38 |