@AidenChow Other way around: $needle N $haystack (where $needle in this case is the regex). Also, the other nice thing I just realized is that N is lower precedence so you don't need the parentheses: DSO
and then i guess another question: in what context would you use one set of terms over the other? is it entirely 100% arbitrary? or is it like, a meaningful difference
ok ill spill a bit; im deciding on default behaviors for operators/functions missing arguments, but im thinking of having it depend on number of inputs to the program lol
so like if theres an op expecting a list, and theres several inputs, the list it defaults to is the inputs
but if its just one input, it just uses the list of pos ints
It's only as effective as its ability to simplify expressions in that regard, and even SymPy's multiples tens of thousands of SLOC of simplification rules cannot do that with everything
@lyxal Not obviously. It's not really obvious that SymPy has no way of determining if two values are equal.
I just want to be able to represent every computable number with arbitrary precision and operate on them without any incorrect results no matter what, without investing too much time. Is that too much to ask?
In mathematics, Richardson's theorem establishes the undecidability of the equality of real numbers defined by expressions involving integers, π,
ln
2
,
{\displaystyle \ln 2,}
and exponential and sine functions. It was proved in 1968 by mathematician and computer scientist Daniel Richardson of the University of Bath.
Specifically, the class of expressions for which the theorem holds is that generated by rational numbers, the number π, the number ln 2, the variable x, the operations of addition, subtraction, multiplication,...
The best you can ask for from a CAS library is to do enough algebraic simplification and be precise enough so that you can use it in challenges where other golfing languages would have to use way more bytes
@DLosc thank you i just used regenerate for practical purposes; i needed a list of bytes from 00 to ff and i was about to do some Programming but then i realized i could just stick [0-9A-F]{2} down and be done with it :-)
Minimum rotation to get the maximum value
I recently solved a coding challenge in one of challenge papers that my IT teacher gave to us. It was a seemingly simple, but fun challenge, so I thought it will make fun golfing.
The task
Given an input of a 2x2 matrix, like this:
a
b
c
d
We ...
I was writing a questions about keyboard shortcuts when I stumbled across the shortcut tag. It's currently described as:
A route more direct than the one ordinarily taken.
A method or means of doing something more directly and quickly than and often not so thoroughly as by ordinary procedure.
T...
Introduction:
Some times using a 24-hour clock are formatted in a nice pattern. For these patterns, we'll have four different categories:
All the same (pattern AA:AA or A:AA):
0:00
1:11
2:22
3:33
4:44
5:55
11:11
22:22
Increasing (pattern AB:CD or B:CD, where D==C+1==B+2==A+3):
0:12
1:23...
Create a DialFrost simulator code-golfrandom
inspired by this message asked in chat
DialFrost simulator upgraded: to an input, append or prepend (50% chance of each) ":3"
NOTE: no offense to DialFrost, just posted this because I personally found his trademark funny.
So basically, your task is...
Yesterday, I stumbled on a very clever thing.
Yes, that's a working implementation of Tic-Tac-Toe on a user profile page, from @minitech. Of course, the moment I saw it, I had to reverse engineer his idea and one-up him :P
Here's my own example embedded directly in the post. It's a tad buggy ...
@py3_and_c_programmer with regards to your edit, it is unacceptable. you have changed the meaning of the answer, and i wanted it for this specific case, not general
Using built-in functions to do the work
Mathematica is a big one for this, with Fibonacci[n] to calculate the n'th Fibonacci number.... I have no objection to these being posted as a side note within the main answer though - that is interesting and helps me learn different languages capabilities...
The following solution uses my own custom domain-specific programming language which I have called NULL:
3499538
In case you are wondering how this works: My language consists of only of one statment per program. The statement represents a StackOverflow thread ID belonging to a code golf thre...
One of the classic patterns
***
..*
.*
My avatar was created using my version of the Game of Life using this pattern and rule(note that it is not 23/3):
#D Thanks to my daughter Natalie
#D Try at cell size of 1
#R 8/1
#P -29 -29
.*********************************************************
*.***...
@RadvylfPrograms this but with decimal output seems like it could be more interesting especially if you allow the whole "assume arbitrarily many roman numerals"
Yay NMP and NSP are now logging in with the correct accounts :D
And that actually adds extra redundancy two the two-watch-websockets thing; one is owned by each account
So even if the NMP one totally fails to start for some reason, NSP would still watch for posts
(of course, every 24 minutes it would go down for a few seconds, but since NPSP 2.0 can look through the API and room transcripts to see if it missed any new posts while both sockets were down, it won't matter)
there is no feeling better than trying 20 different ways to do something in bash and then having it finally work (in my case I was trying to move all files matching a regex and did it with mv `find -regex <regex>` <dest>