text:
Encode the date in Christmas Eve format
The day this post was published was Christmas Eve. Tomorrow will be Christmas. Yesterday was Christmas Eve Eve. In two days it will be
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve

.
Your job is to take the date the program is run and encode it in Christmas Eve format.

If your program is run on Christmas, it should output the string "Christmas".
If your program is not run on Christmas, it should output the string "Christmas", followed by the string " Eve" repeated n times, where n is the number of days until Christmas.

Note that this must be based on the next Christmas. For example, if the day is April 26, 2019, you must do your calculation based on December 25, 2019, not any other Christmas.
Remember to count leap days.

Christmas is December 25th of every year.

This is code-golf, so the shortest code wins! Note though that the goal is not to find the shortest program in any language, but to find the shortest program in every particular language. For example, if you find the shortest C++ program, then it wins this contest for C++, even if someone finds a shorter program in Python.

Somehow I knew that this was going to be a PPCG challenge the moment I saw the cartoon - +1 from me

@BlackOwlKai what cartoon?

A xkcd cartoon that was published today. https://imgs.xkcd.com/comics/christmas_eve_eve.png

@BlackOwlKai LMBO I didn't even see that comic until your comment. I had already planned to post this, and was just waiting for Christmas Eve. Great minds think alike, I guess?

You should specify that you mean Dec 25 for "Christmas", unless you want submissions that use a local date or calendar.

@Sparr fixed it

@tsh a quick search suggests that is true in all time zones. Since dates are complicated as it is, you may assume anything that is always true (i.e. you do not need to worry about hypotheticals).

So, is the program supposed to encode a given date, or produce output based on the date it's run?

@Sean oh, it produces output based on the day it runs. I'll fix the post.

Does case matter? Can we output all uppercase or all lowercase?

@Shaggy uhm, we'll say case matters, since the post didn't say otherwise. Too late to change it now.

What about the second holiday? It´s still Christmas on Decmber 26, isn´t it?

@Titus yes, but it is also Christmas Eve*364.

Can the date be a parameter?

@OlivierGrégoire uhm, I'll permit it iff the language does not have the ability to get the current date in another way.

This may be nitpicking, but 25 December is not Christmas (there are, famously, twelve days to the holiday – or more, or fewer, depending on locality), but Christmas Day. It would make more sense to output Christmas Eve(ⁿ) for other days and then Christmas Day on 25 December.

@JanusBahsJacquet okay, I'll edit the question and flag all the current answers as being outdated. On a serious note, I'll keep that in mind in the future, but it's kinda hard to fix now.

We can ignore leap seconds, right?

@ASCII-only I already told someone else not to, so probably not.

https://xkcd.com/2089/

SmileBASIC, 73 71 67 bytes
?"Christmas";
@L?" Eve"*(D!=P);
P=D
DTREAD OUT,M,D
IF M/D-.48GOTO@L

The program prints "Christmas", then prints " Eve" every time a day passes, until it is December 25th. (12/25 = 0.48)
May take up to a year to run.

pure genius ...

This made me Smile...

Nice! One of my JavaScript solutions takes a similar approach. However, in JavaScript the wait time is just a best effort.
How is SmileBASIC faring in this regard?

The code runs continuously (until christmas) and detects the start of each day by checking the date to see if it has changed. I had another version (which was the same length) that used delays instead, but I wasn't sure how reliable it would be.

@12Me21 that would obviously fail due to leap seconds, this version looks much better.

The system that this runs on doesn't have leap seconds (or even daylight savings time; you have to adjust the clock manually). A bigger issue is that the delay function (WAIT) takes a time in frames which are close to 1/60 of a second (but really 1/59.834) and probably isn't as accurate as the clock.

+1 for thinking outside the box and making me laugh.

Best laugh I've had in days +1!

Excel formula, 59 bytes
="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,25)-TODAY())

I think YEAR(TODAY()+6) always returns the correct year, thus avoiding the condition.

Shouldn't it be > (instead of >=) ?

targumon, Yes, that outputs "Christmas" on it's own

Neil, that works nicely: ="Christmas"&REPT(" Eve",DATE(YEAR(TODAY()+6),12,25)-TODAY())

I think YEAR(NOW()+6) works as well with 2 less bytes.

Thanks Engineer Toast, good spot.

I think ="Christmas"&REPT(" Eve",DATE(YEAR(NOW()+6),12,26)-NOW()) is even shorter and I believe it should work.

(How does Excel formula get a byte count, what do you use?)

Just counted the bytes used to express the formula in a text editor

NOW() includes the time, so it won't be an integer and I'm not sure REPT would allow that.

@12Me21 REPT allows it, it floors the given number, which is why I changed the 25 to a 26.

but this does not give "Christmas" on Christmas day. Check ="Christmas"&REPT(" Eve",DATE(YEAR(DATE(2018,12,25)+6),12,26)-DATE(2018,12,25))

Isn't this 59 bytes?

Perl 6, 61 47 bytes
say 'Christmas'~' Eve'x(Date.today...^{.month==12&&.day==25})
say 'Christmas'~' Eve'x(Date.today...^/12\-25/)

Try it online!
-14 bytes (!) thanks to Jo King
Date.today ...^ /12\-25/ is the sequence of dates starting today and ending the day before Christmas.  (The regular expression /12\-25/ is matched against the string representation of the dates.)  The string " Eve" is replicated a number of times equal to the length of that sequence, and is output after the string "Christmas".

Could you do "month>11" to save a byte?

Would /12.25/ work?

@Cowsquack no, because then it might match the year in dates like 12025-12-24

I think it's safe to assume that will never happen

R, 112 106 72 bytes
Via @digEmAll and @J.Doe
x=Sys.Date()-1;cat('Christmas');while(!grepl('12-25',x<-x+1))cat(' Eve')

Try it online!
My original answer was prior to the clarification that the code was to take the date on which the code is run as input. It could be modified as above to save many bytes but I won't bother.
function(x,z=as.Date(paste0(strtoi(format(x,"%Y"))+0:1,"-12-25"))-x)cat("Christmas",rep("Eve",z[z>=0][1]))

Try it online!
Explanation: everyone's at church so I have time to do this. Extract the year, coerce to integer. Make vector of that year's Xmas and the next year's Xmas and subtract the input date to get a vector of two differences between the input date and those two Xmases.
Pick the non-negative one and cat "Christmas" with that many "Eves".

You only use y once so you can just use it directly for 108 bytes.

Also would z[z>=0][1] work instead of min?

73 bytes. According to the last comment, the program must output the text based on the day it runs.
Merry christmas BTW ! :D

Tweaked yours for 72 bytes, @digEmAll. Merry Christmas!

Windows PowerShell, 67 64 63 bytes
for(;1225-'{0:Md}'-f(date|% *ys $i)){$i++}'Christmas'+' eve'*$i

Try it online!
Managed to shave off 3 bytes 4 bytes (thanks Cows quack) by using the -format operator instead of .ToString(), and then subtracting the date string from the numerical value 1225 instead of doing a comparison with -ne. The resulting integer will be interpreted as a boolean for the conditional where 0 (which will happen on Christmas) is interpreted as False (don't enter the loop), and any other value is interpreted as True (enter the loop).
Since the integer is on the left now, the date string will be converted to the integer and math will be done, as opposed to the previous version where the 1225 integer was converted to string for the comparison.
Original Version

Windows PowerShell, 67 bytes
for(;(date|% *ys $i|% tost* Md)-ne1225){$i++};'Christmas'+' eve'*$i

Try it online!
Using a for loop as a while loop basically, because it's shorter. In the loop condition we check the current date (date, a shortened form of Get-Date), piped to ForEach-Object's alias %, using the form that can invoke a method by wildcarded name; in this case the method is AddDays() on the DateTime object, and the value we give it is $i.
This gets piped to ForEach-Object again to invoke the ToString() method, with format string Md (month, then day, minimal digits since we don't care for what comes next). This string is then tested to see if it's not equal -ne to the number 1225, which will be converted to a string for the comparison, saving me the quotes.
This is why it doesn't matter that the months and days are single digits, it will never be ambiguous because there's no other day of the year that would stringify to 1225.
The loop continues until the string is 1225. At the beginning of the program, $i will be zero so it will be comparing today's date, and the loop will never execute, but for any other day $i gets incremented in the loop body, so that we will have a count of how many days until the next Christmas, automatically accounting for leap years and whether or not Christmas passed this year.
After the loop we just output the string Christmas concatenated with the result of multiplying the string eve times the value of $i (which, on Christmas day, will be 0, resulting in no eves).

Apparently the ; after {$i++} is redundant? (also wow you took the lead over bash again)

@Cowsquack nice! how did I not notice that?!

C# (Visual C# Interactive Compiler), 89 bytes
Write("Christmas");for(var t=DateTime.Now;$"{t:Md}"!="1225";t=t.AddDays(1))Write(" Eve");

Try it online!
-3 bytes thanks to @JeppeStigNielsen!
My strategy is pretty straightforward:

Initialize a loop variable t to the current date
Print Eve if t is not Christmas
Add a day to t and repeat

I tried some fancier things, but this way required the fewest bytes.

...do you need to assign t to itself in the incrementor?  I don't have the docs in front of me, but if not, you could save two bytes more.

oh, it's a struct.  Of course it is.  Nevermind.

You can substitute t.Month<12|t.Day!=25 with the shorter $"{t:Md}"!="1225". It uses an interpolated string and a custom DateTime formatting string.

APL (Dyalog Unicode), 76 63 bytesSBCS
Full program. Assumes ⎕IO←0 (zero-indexing).
⎕CY'dfns'
'Christmas',' Eve'⍴⍨4×12 25⍳⍨⍉2↑1↓⍉date(⍳366)+days⎕TS

Try it online!
⎕CY'dfns' copy in the dfns library
⎕TS current time stamp as [year,month,day,hour,min,sec,ms]
days[c] find the number of days[n] since 1899-12-31 00:00:00.000
(⍳366) add the first 366 integers (0…365) to that
date[c] find the dates[n] that correspond to those numbers (366×7 table; one column per unit)
⍉ transpose (7×366 table; one row per unit)
1↓ drop one row (the years)
2↑ take the first two rows (months and days)
12 25⍳⍨ find the index of the first Christmas
4× multiply that by four
' Eve'⍴⍨ use that to reshape the character list
'Christmas ', append that to this
[c] code of that function
[n] notes for that function

T-SQL, 92 88 bytes
PRINT'Christmas'+REPLICATE(' Eve',DATEDIFF(D,GETDATE(),STR(YEAR(GETDATE()+6))+'-12-25'))

Edit: Saved 4 bytes thanks to @BradC.

Nice work. Save 2 with PRINT'Christmas'+... and 2 more by using DATEDIFF(D, instead of DATEDIFF(DAY,

@BradC Nice, thanks!

Python 2, 111 103 bytes
from datetime import*
d=date.today()
print"Christmas"+" Eve"*(date((d+timedelta(6)).year,12,25)-d).days

Try it online!
Update inspired by Richard Crossley's answer.
Explanation:
from datetime import*
# get today as a date, so we don't have to worry about rounding errors due to time
d=date.today()
                              # get the year of the Christmas to compare to
                              # if the current date is after this year's Christmas, the 6 day offset will give the next year
                              # otherwise, returns this year
                              (d+timedelta(6)).year
                         # next Christmas minus the current date
                         date(.....................,12,25)-d
# Christmas, plus (number of days until next Christmas) " Eve"s
print"Christmas"+" Eve"*(...................................).days

Ruby, 80 bytes
require'date'
t=Date.today
puts'Christmas'+' Eve'*(Date.new((t+6).year,12,25)-t)

Try it online!
Thanks to tsh for his idea

77 bytes (i.e., save 3 bytes) by replacing puts with p: Try It Online link

PHP, 61 bytes
Christmas<?for($t=time();date(md,$t+=86400)-1226;)echo" Eve";

Run with -n or try it online.

JavaScript, 135 131 121 92 88 bytes
My first (naïve) solution (135b):
t=new Date();n=new Date();n.setMonth(11);n.setDate(25);'Christmas'+' Eve'.repeat((n>=t?n-t:(n.setFullYear(n.getFullYear()+1)-t))/864e5)

It sets 2 dates: now and Xmas of this year. If the latter hasn't passed yet, it just diffs them, if it has passed, diffs to next year's Xmas. Uses either diffs for the number of repeats.
(Trying to) Think Outside the Box (131b):
i=0;f=_=>{t=new Date();if(t.getMonth()!=11||t.getDate()!=25){i++;setTimeout(f,864e5)}else{alert('Christmas'+' Eve'.repeat(i))}};f()

The challange specifies WHICH output is required when running the program on a given day, but doesn't specify WHEN to return it...
This will just 'sleep' for a day, increment a counter by 1, and repeat till it's Xmas in order to give the output.
Since JavaScript doesn't guarantee the 'sleep' time, the actual result might be off.
It is also ugly for using the alert function, which means wer'e actually not dealing with pure JavaScript, but with browser APIs as well (we can use console.log at the cost of 6 extra bytes).
A better approach (121b):
t=new Date();i=0;while(t.getMonth()!=11||t.getDate()!=25){t=new Date(t.valueOf()+864e5);i++};'Christmas'+' Eve'.repeat(i)

Starting from today, increment the date by a day until it's Xmas, then use that loop's counter for the number of repeats required.
Improving (including going through a minifier and using 12Me21's trick to shave extra 5b) (92b):
for(s='Christmas',t=new Date;t.getMonth()/t.getDate()-.44;)t=new Date(t*1+864e5),s+=' Eve';s

Final touches (88b):
for(s='Christmas',t=new Date;t.getMonth()/(d=t.getDate())-.44;t.setDate(d+1))s+=' Eve';s

For all of the above, REPL is assumed.
See Vadim's submission - much better than mine!

I think you can use t.getMonth()/t.getDate-.48 to check if date is not december 25th

Ooh, that's sneaky! In JavaScript it actually should be .44 because the month is zero-based (but the numerator and denominator are still coprime so the fraction is unique and the idea still holds) Thanks!

Welcome to the site! You can use a 4 space indent to make your code blocks look better.

Welcome to PPCG!

98, print is needed since this is a program not a function, unless 1. you turn it into a lambda or 2. you state that you're using a REPL

t=new Date(+t+864e5) is 1 byte shorter.

Assigning Date to a variable saves couple of bytes too: x=Date;...t=new x and so on

@ASCII-only Actually print is not JS (it's browser API, so won't work on Node.js for example) but you're right! I meant REPL and otherwise we incur 13bytes of console.log().

@AndrewSvietlichnyy - Nice!
@PeteTNT - Not quite... I used Date only twice, so replacing each one with x saves a total of 6bytes. But x=Date; costs us 7bytes...
Anyway, I found another shortcut (see my recent edit). Also see solution by Vadim which is better than mine by 12.5%!

@targumon it's spidermonkey-specific, not browser

spidermonkey is a browser ;-)

Bash +GNU date, 72, 73, 67 bytes
for((d=7;`date +%-j -d$d\day`-1;d++));{ x+=\ Eve;};echo Christmas$x

one byte saved replacing != with -
another removing extra space
fix -3 bytes d=0, because date -dday is date+1 and doesn't work on 25/12
6 bytes saved thanks to Toby Speight using %-j format to avoid 0 padding (and octal conversion) and shorter than %d%m compared to 2512

Try it online

Hmmm, why does =~ not work in the for-loop conditional?

because the for loop  condition is an arithmetic expression, words are coerced to integer also number starting with 0 are assumed in octal, that's why 1 is prepended

Instead of prepending 1 in two places, we could use %-d format (saving 1 byte net).  But we can save more by starting with d=7, and then comparing the Julian day with 1st of January: ((d=7;`date +%-j -d$d\day`-1;d++)) - 67 bytes.

@TobySpeight interesting ideas, updated

Bash, 68 65 61 bytes
Golfed 4 bytes thanks to Nahuel Fouilleul by using `` command substitution and eval in place of sed e and xargs
echo Christmas `eval date\ -d{0..366}day\;|sed /c.25/Q\;cEve`

Try it online!
Inside the `` command substitution, we have
eval run the following string as shell commands

date\ -d{0..366}day\; under brace expansion of {0..366}, this results in the string date -d0day; date -d1day; date -d2day; ... date -d366day;, each command in this string computing the date between 0 and 366 days from present resulting in output of the format Wed Dec 26 18:22:33 UTC 2018, with each in its own line

|sed upon which, call the following sed commands

/c.25/Q if the regex /c.25/ is matched, Quit without printing
\;cEve otherwise change the line to Eve

All the required number of Eves are produced each on its own line. This output is captured in ``, and is subject to word splitting where words are split on newlines. Each word is fed as an argument to echo.
echo Christmas ...
Each argument to echo is printed by being separated by spaces, resulting in the desired output.

There's nothing really bash-specific about this solution.  It requires GNU date, sed and seq though.

-4 bytes

@NahuelFouilleul Thanks, nice trick of using backtick command substitution to avoid xargs and using eval to skip out on seq

Python 2, 128 bytes / Python 3, 130 bytes
of course, two less bytes with Python 2
from datetime import date as D
T=D.today()
Y=T.year
a=(D(Y,12,25)-T).days
print("Christmas"+" Eve"*[a,(D(Y+1,12,25)-T).days][a<0])

105 bytes

@tsh That's an amazing approach!

Python 2 doesn't need a space after print so it's 128 bytes

-2 bytes by implementing as D by yourself

VBA (Excel), 108 bytes
Copy in a blank module. Prints to the Immediate window:
Sub X:s="Christmas":d=Now:For t=1 To (DateSerial(Year(d+6),12,25)-d):s=s &" Eve":Next:Debug.Print s:End Sub

Note: Using : instead of line breaks saves two bytes per line.
Notice that the VBA editor will insert additional spaces between keywords, operators, etc... and parenthesis after the Sub definition, but if you copy and paste this code it will work (I couldn't get rid of that space before the &).
Not bad for VBA (for once).

*Christmas :|

@ASCII-only: removing the space before the & throws an error

-1 bytes. Thanks to @ASCII-only for catching the typo

You can cut this down to 71 chars by converting it to an immediate window function and removing the temporary variable for now. When you do that, it should look something like ?"Christmas";:For i=1To DateSerial(Year(Now+6),12,25)-Now:?" Eve";:Next

Python 3, 106 Bytes
from datetime import*
d=date.today()
print("Christmas"+" Eve"*(date((d+timedelta(6)).year,12,25)-d).days)

Groovy, 66 bytes
d=[]as Date
print'Christmas'+' Eve'*(new Date((d+6).year,11,25)-d)

Try it online!
Courtesy of @ASCII-only

You need to print it out since this is a full program not a function

Chistmas :/

fixed, 149

123

taking your first one and using Groovy 2.5 slims it down to 115.

We'll just need to ask Dennis to update Groovy and we'll get 112 maybe? Hmmmmm

nevermind, if we use crusty java.util.Date we can get it down to 76

You mean 73

What hackery does Groovy use to make that work? Looks like Scala doesn't have a lot of it

Seems like we're not going to get any lower for a while :P you might want to update your answer (protip: in the topbar of TIO, there's a button which opens a page that generates all kinds of formatted links for you, including one that is formatted for PPCG: esc + s + g. If you want to keep showing your previous score(s) just surround each score with  and )

69

66

C (gcc), 157 bytes
I thought that I would be able to avoid including time.h but that just gave segment faults.
#include <time.h>
*t,u;f(){time(&u);t=localtime(&u);t[5]+=t[4]>10&t[3]>25;t[4]=11;t[3]=25;u-=mktime(t);printf("Christmas");for(u/=86400;u++;printf(" Eve"));}

Try it online!

IMO you should leave out the #include <stdlib.h>, not like it does anything at all here

Suggest *t;f(u) instead of *t,u;f() and #import<time.h> instead of #include <time.h> and 5[t=localtime(&u)] instead of t=localtime(&u);t[5]

Scala, 116 113 bytes
var d=new java.util.Date
print("Christmas")
while(!(""+d).contains("c 25")){print(" Eve");d.setDate(d.getDate+1)}

Try it online!
Where c 25 is short for Dec 25.

I think you can use contains("c 25") instead of matches(".*c 25.*")

Thanks, three bytes less!

wow, nicely done, toString of date was nice

JavaScript, 86 77 bytes
Using REPL it would be
for(c='Christmas',d=new Date;!/c 25/.test(d);d=new Date(+d+864e5))c+=' Eve';c

Kudos to ASCII-only for -9 bytes

77

Bravo! You did much better than me. May I offer to shave an extra byte?
for(c='Christmas',d=new Date;!/c 25/.test(d=new Date(+d+864e5));)c+=' Eve';c
or this variant:
for(s='Christmas',t=Date.now();!/c 25/.test(new Date(t+=864e5));)s+=' Eve';s
both are 76 bytes.

Lua, 137 118 bytes.
118 bytes
t,d,month,day=os.time,os.date,1,-6year=d"%Y"+(d"%D">"12/25"and 2or 1)print("Christmas",d" Eve":rep(d("%j",t(_G)-t())))

137 bytes (previous)
t,d=os.time,os.date a=d"*t"a.year,a.month,a.day=a.year+(d"%m%d">"1225"and 1 or 0),12,25 print("Christmas",("Eve "):rep((t(a)-t())/86400))

It's worth noting that it doesn't work in LuaJIT (syntax error)

Welcome to PPCG! Nice first post!

Julia 1.0, 91 bytes
using Dates
t=today()
print(:Christmas," Eve"^~-(tonext(==((12,26))∘monthday,t)-t).value)

Try it online!

-1 byte thanks to @MarcMush: Substitute 1>0 for true
-5 bytes thanks to @MarcMush: Substitute _.value for Dates.value(_)
-1 byte thanks to @amelies: print symbol :Christmas rather than string "Christmas"
-1 byte thanks to @MarcMush: compose functions with ∘
-7 bytes thanks to @MarcMush: use Boxing Day as the end date and subtract one in order to eliminate the same=true parameter

-1 byte with 1>0 instead of true

And I believe you can access the date field directly, x.value maybe instead of Dates.value(x)

use :Christmas symbol instead of string, save one byte, i.e, print(:Christmas," Eve"^(t<etc...>

-1 byte: ==((12,25))∘monthday instead of x->...

remove same=true, go to the 26th and subtract one: " Eve"^~-(tonext(==((12,26))∘monthday,t)-t).value)

MySQL, 102 bytes
pretty much the same as Neil´s T-SQL answer. There seems to be no shorter way in SQL.
select concat("Christmas",repeat(" Eve",datediff(concat(year(now()+interval 6 day),"-12-25"),now())));

Try it online.

Scala, 123 bytes
Thanks to ASCII-only's work.
print("Christmas")
var d=new java.util.Date
while(d.getMonth()<11||d.getDate()!=25){print(" Eve");d.setDate(d.getDate()+1)}

Try it online!
Scala + Joda-Time, 140 bytes
import org.joda.time._
var s="Christmas"
var d=DateTime.now
while(d!=d.withDate(d.year().get(),12,25)){d=d.plusDays(1);s+=" Eve"};println(s)

Does not run in TIO since it requires Joda-Time library.

no joda, 154. sadly can't get java.util.Date to work here :/

148

Ah @ASCII-only I did not count object Main extends App{} chars in my counting (cause I didn't in my other Scala answers either). If we take that out you beat me ^^

The withDate() call is so expensive...

remember you need to specify language as "Scala + Joda-Time" since you use an external library and 2. not going to use my changes? it's shorter plus doesn't need a library :P

Ah yeah thanks, but I thought you post it in a separate answer..? maybe I dreamt

Nah, I haven't posted it yet. I don't really know Scala anyway so I basically just combined your answer and the Groovy answer >_>

I see :) well I'll add your work today. Thanks!

you don't have to do this, but i'd put the shorter answer first so those that have the PPCG-Design userscript see it in the leaderboard

I'll do it nonetheless.

damn, we were beaten :P

yeah, they used date as a string... :D

MATLAB, 91 bytes
n=datetime
x=datetime(year(n+6),12,25)
s='Christmas'
while days(x-n)>=1 n=n+1 s=[s,' Eve'] end

MATLAB Non-looper, 100 bytes
x=datenum(datetime(floor((now+5)/365.2425),12,25))
d=x-now
['Christmas' repmat(' Eve',1,min(d(d>=0)))]

05AB1E, 93 89 87 81 bytes
'ŒÎžfže«Ž9Ú.S©DΘžg+т‰0Kθ4ÖUi390že-X+ë®_i0ë•ΘÏF•º11£®ª₂+ā2QX*+13žf-.£Ože-]Fð'»ˆ}J™

Try it online or Try it online with an emulated self-specified date of 'today'.
Old 93 89 87 bytes approach that loops over the days one by one:
žežfžg)V'ŒÎ[Y¨JŽ9ÚQ#Y`т‰0Kθ4ÖUD<i\28X+ë<7%É31α}‹iY¬>0ëY1¾ǝDÅsD12‹i>1ë\1Dǝ¤>2}}ǝVð'»ˆ}J™

Try it online or Try it online with an emulated self-specified date of 'today'.
Explanation:
05AB1E doesn't have any builtins for dates, except for receiving the current year/month/day/hours/minutes/seconds/microseconds, so most bytes are used for manual calculations.
'ŒÎ           '# Push dictionary string "christmas"
žfže«          # Append the current month and current day together
        .S     # Compare it with
     Ž9Ú       # Compressed integer 1225
               # (1 if >1225; 0 if ==1225; -1 if <1225)
          ©    # Store this comparison in variable `®` (without popping)
D              # Duplicate it
 Θ             # Check if it's equal to 1 (1 if 1; 0 if 0 or -1)
  žf+          # Add the current year to it
     т‰0Kθ4Ö   # Check if this is a leap year:
     т‰        #  Divmod it by 100
       0K      #  Remove the 0s
         θ     #  Only leave the last item
          4Ö   #  Check if it's divisible by 4
            U  # Pop and store this is_leap_year in variable `X`
i              # If the comparison is 1:
 390že-        #  Push 390 minus the current day
               #  (390 is 31 for days in December and 259 for days of Christmas Day)
 X+            #  Add the is_leap_year check from variable `X`
ë®_i           # Else if the comparison is 0:
    0          #  Push 0
ë              # Else (the comparison is -1):
 •ΘÏF•         #  Push compressed integer 5254545
      º        #  Mirror it to 52545455454525
       11£     #  Only leave the first 11: 52545455454
          ®ª   #  Convert it to a list of digits, and append the -1:
               #   [5,2,5,4,5,4,5,5,4,5,4,-1]
            ₂+ #  Add 26 to each: [31,28,31,30,31,30,31,31,30,31,30,25]
 ā             #  Push a list in the range [1,length] (without popping):
               #   [1,2,3,4,5,6,7,8,9,10,11,12]
  2Q           #  Check which is equal to 2: [0,1,0,0,0,0,0,0,0,0,0,0]
    X*         #  Multiply each by the is_leap_year check of variable `X`
      +        #  Add the values at the same positions in the lists together
 13žf-         #  Push 13 minus the current month
      .£       #  Only leave that many items from the end of the list
        O      #  Sum them together
 že-           #  Subtract the current day
]              # Close the if-else statements
 F             # Loop that many times:
  ð            #  Push a space character " "
  '»ˆ         '#  Push dictionary string "eve"
 }J            # After the loop: join the entire stack together
   ™           # Titlecase each word
               # (after which the result is output implicitly)

žežfžg)V   # Get the current [day,month,year] and save it in variable `Y`
'ŒÎ       '# Push dictionary string "christmas"
[          # Start an infinite loop:
 Y¨J       #  Remove the year, and join the month and day together
       Q   #  Check if this is equal to
    Ž9Ú    #  Compressed integer 1225
        #  #   If this is truthy (thus it's December 25th): stop the infinite loop
 Y`т‰0Kθ4ÖUD<i\28X+ë<7%É31α}‹iY¬>0ëY1¾ǝDÅsD12‹i>1ë\1Dǝ¤>2}}ǝV
           #  Go to the next day, and set `Y` to it
 ð         #  Push a space " "
 '»ˆ      '#  Push dictionary string "eve"
}J         # After the infinite loop: join the entire stack together
  ™        # Titlecase each word
           # (after which the result is output implicitly)

See this 05AB1E answer of mine to understand the is_leap_year check.
See this 05AB1E answer of mine to understand how we go to the next day (with the second longer approach).
See this 05AB1E tip of mine (sections How to use the dictionary? and How to compress large integers?) to understand why '»ˆ is "eve"; 'ŒÎ is "christmas"; Ž9Ú is 1225; and •ΘÏF• is 5254545.

Clever golfing!

q, 53 bytes
"Christmas",(4*(not 12 25~`mm`dd$.z.d+)(1+)/0)#" Eve"

k, 50 bytes
"Christmas",(4*(~12 25~`mm`dd$.z.d+)(1+)/0)#" Eve"

Increment counter while the date is not Dec 25th, then take that number of copies of " Eve" and append to "Christmas".

Go, 178 bytes
import(."time";."strings")
func f()string{n:=Now()
y:=n.Year()
if n.Month()>11&&n.Day()>25{y++}
return"Christmas"+Repeat(" Eve",int(Date(y,12,25,0,0,0,0,UTC).Sub(n).Hours())/24)}

Attempt This Online!
And a variant that takes a Time as input, 175 bytes:
import(."time";."strings")
func f(n Time)string{y:=n.Year()
if n.Month()>11&&n.Day()>25{y++}
return"Christmas"+Repeat(" Eve",int(Date(y,12,25,0,0,0,0,UTC).Sub(n).Hours())/24)}

Attempt This Online!

C# (Visual C# Interactive Compiler), 141 bytes
var g=DateTime.Now;Write("Christmas"+string.Concat(Enumerable.Repeat(" Eve",(new DateTime(g.Year+(g.Day>25&g.Month>11?1:0),12,25)-g).Days)));

Try it online!

I don't think this works for the 30th of November...

Fixed now, I forgot to add a check to if it was December or not

Are you sure about Month > 25?

Fixed it now...

Is the ?1:0 nessesary? doesn't & return an integer?

Red, 89 86 84 78 76 bytes
-10 bytes thanks to ASCII-only!
does[a: now prin"Christmas"while[a/3 * 31 + a/4 <> 397][prin" Eve"a: a + 1]]

Try it online!

84

@ASCII-only Hmm, of course! Thank you!

78

76

@ASCII-only Your 76-byte version does not give correct result when run on Christmas: Date as an argument
I feel stupid for not using only now and not now/date. Thank you for your improvements!

Oh yeah, not that it matters at all, but normally to cross out scores people do score1 score2 score3 (no commas, strikethrough doesn't reach across scores). Also, yeah that until loop is just a do...while loop in disguise, huh

76?

@ASCII-only Thanks, nice way to get rid of or.

Perl 5, 68 bytes
print"Christmas";print" Eve"while localtime($i++*86400+time)!~/c 25/

Try it online!
Where c 25 is short for Dec 25.

Japt -S, 39 38 bytes
Ð
f
@f1V° UÎ¶B©25¶Uf}a Æ"Eve"Ãi`CËItµs

Test it
Ð\nf\n@f1V° UÎ¶B©25¶Uf}a Æ"Eve"Ãi`CËItµs
Ð                                            :Create date object for current date
 \n                                          :Assign to variable U
   f                                         :Get date value of U
    \n                                       :Assign to variable V
      @                                      :Function taking an integer X as argument
       f1                                    :  Set the date of U to (modifies U)
         V°                                  :  V, postfix incremented
            UÎ                               :  0-based month value of modified U
              ¶                              :  Check equality with
               B                             :    11
                ©                            :  Logical AND with
                 25¶                         :  Check equality between 25 and
                    Uf                       :    Date value of modified U
                      }                      :End function
                       a                     :Return the first value of X>=0 that returns true
                         Æ                   :Map the range [0,result)
                          "Eve"              :  Literal string
                               Ã             :End map
                                i            :Prepend
                                 `CËItµs     :  Compressed string "Christmas"
                                             :Implicit output joined with spaces

jq -jn, 60 bytes
"Christmas",(now|while(gmtime[1:3]!=[11,25];.+86400)|" Eve")

Try it online!

Lua, 87 bytes
w=io.write w'Christmas't=os.time()while os.date('%d%m',t)~='2512'do t=t+86400w' Eve'end

Try it online!


text:
Eight coins for the fair king
This is a "counterpart" of another puzzle, Eight coins for the fair king on Puzzling.SE.
You can read the above puzzle for the background. The details about this puzzle are as follows.
A set of 8 kinds of coins of different values are created, the king wants you to find out the maximum N such that any number of price from 0 to N can be paid with a combination no more than 8 coins and without charges.
For example, (taken from Glorfindel's answer). If a set of coins of values 1, 2, 5, 13, 34, 89, 233, 610 are given, your program should output 1596, because every number between 0 and 1596 (inclusive) can be represented by the sum of no more than 8 numbers from the given list (numbers may repeat), while 1597 cannot be represented in that way.
In a mathematical way, if the input is a set S consisting of 8 positive integers, the desired output N satisfies that for any number n between 0 and N, there exists x1, x2, x3, ..., x8 such that
$$x_1 + x_2 + ... + x_8 = n \quad\textrm{and}\quad x_1, x_2, ...,x_8 \in \{0\} \cup S$$
Your goal is to write a program, a function, or a snippet that takes 8 numbers as input, and output the maximum N as described above.
Rules:

Flexible I/O allowed, so your program can take the input in any form that's best suitable. You may assume that the input numbers are sorted in the way that best suits your program.

Please state it in your answer if your program depends on input order

Input is a set of 8 different, positive integers (no zeros). The output is one non-negative integer.

In case there's no 1 in the input set, your program should output 0 because any number from 0 to 0 satisfies the requirement.
In the case of invalid input (the set contains zero, negative or duplicate numbers), your program can do anything.

Standard loopholes are forbidden.
Your program should run within a few minutes on a modern computer.

Test cases (mostly taken from the answers under the linked question on Puzzling):
[1, 2, 3, 4, 5, 6, 7, 8] => 64
[2, 3, 4, 5, 6, 7, 8, 9] => 0
[1, 3, 4, 5, 6, 7, 8, 9] => 72
[1, 2, 5, 13, 34, 89, 233, 610] => 1596
[1, 5, 16, 51, 130, 332, 471, 1082] => 2721
[1, 6, 20, 75, 175, 474, 756, 785] => 3356

This is a code-golf, so the shortest program or snippet in each language wins!

Nice puzzle, but I personally think that some more test cases would be helpful in order to test our submissions.

Wouldn't it be better to make input size a parameter? Brute force approaches will struggle with 8

@LuisMendo Brute force approaches don't run within a reasonable amount of time. But I can't find a way to codify this as a rule.

@iBug Do you mean you want to allow such inefficient approaches, or rule them out?

@LuisMendo I want to forbid them

@iBug Then the usual rule is something like "submissions shoud run within a minute in a modern computer". It's fuzzy, but usually good enough, because the difference between brute force and efficient approaches is very large

@LuisMendo OK, thanks. I've added it.

Brute force is still possible with your time limit of "a few minutes". A slightly modified version of my answer runs the last test case in 1m20s on my 7 year old laptop.

@Arnauld Clarified

apparently Brute had a little more force than appreciated, as it seems most  answers are calculating all possible combinations.

Python 3, 113 62 bytes
for i in[1]*3:x|={a+b for a in x for b in x}
while{i+1}&x:i+=1

Here x is the input as a set of ints, and i is the output.
Try it online!
(Thanks: Erik the Outgolfer, Mr. Xcoder, Lynn)

96 bytes.

x=0,*x saves 1 byte. Better yet, x+=0, saves 2.

78 bytes in Python 2.

Jelly, 12 bytes
œċⱮ8Ẏ§ṢQJƑƤS

Try it online!
Takes on average ~3.7 seconds to run all test cases on TIO on my phone, so surprisingly it is quite fast.
Explanation
œċⱮ8Ẏ§ṢQJƑƤS     Monadic link / Full program.
  Ɱ8             Promote 8 to [1 ... 8] and for each value k:
œċ                    Generate all combinations of k elements from the list.
    Ẏ§           Tighten, then sum. Flatten to a 2D list then sum each.
      ṢQ         Sort the result and remove equal entries.
        JƑƤ      For each prefix of this list, return 1 if it is equal to its length range, 0 otherwise.
           S     Finally, sum the result (counts the 1's which is equivalent to what is being asked).

Haskell, 56 50 bytes
g c=[x|x<-[1..],all((/=x).sum)$mapM(0:)$c<$c]!!0-1

Try it online!
A brute force approach. Add 0 to the list of coins and try all combinations of 8 picks. Find the first number n that is not equal to the sum of any of the picks and return n-1.
Takes about 5m30s for [1, 2, 5, 13, 34, 89, 233, 610] on my 7 year old laptop hardware.
Edit: -6 bytes thanks to @Ørjan Johansen
An even shorter version (-2 bytes, again thanks to @Ørjan Johansen) is
Haskell, 48 bytes
g c=[x|x<-[1..],all((/=x).sum)$mapM(:0:c)c]!!0-1

but it uses significantly more memory and runs into heavy paging on my machine and does not finish "within a few minutes".

You can use mapM(0:)$c<$c. (In fact mapM(:0:c)c should work, but times out on TIO for the given test case.)

JavaScript (ES6),  100 88 80  76 bytes
This is essentially a brute-force search, but enhanced with pruning to speed it up. The average execution time for the test cases is close to 1 second on TIO.
Assumes that the input array is sorted from highest to lowest.
a=>[...Array(a[0]*9)].findIndex(g=(i=8,s)=>s*i>0?a.every(x=>g(i-1,s-x)):s)-1

Try it online!
Commented
a =>                      // a[] = input array
  [...Array(a[0] * 9)]    // create an array of 9 * max(a) entries
  .findIndex(             // find the position of the first truthy result
    g = (i = 8, s) =>     // g = recursive function taking a counter i, initialized to 8
                          //     and a sum s, initialized to the position in the above array
      s * i > 0 ?         //   if s is positive and i is not equal to 0:
        a.every(x =>      //     for each value x in a[]:
          g(i - 1, s - x) //       do a recursive call with i - 1 and s - x
        )                 //     end of every()
      :                   //   else:
        s                 //     yield s (s = 0 means success and makes findIndex go on)
  ) - 1                   // end of findIndex(); decrement the result

Jelly, 9 bytes
Żœċ8§ḟ’$Ṃ

Try it online!
How it works
Żœċ8§ḟ’$Ṃ  Main link. Argument: A (array)

Ż          Prepend a 0 to A.
 œċ8       Take all combinations of length 8, with repetitions.
    §      Take the sum of each combination.
       $   Combine the two links to the left into a monadic chain.
      ’      Decrement all sums.
     ḟ       Filterfalse; keep only sums that do not appear in the decremented sums.
        Ṃ  Take the minimum.

Żṗ8§ḟ’$Ṃ saves one byte, but I'm not sure if 8.5 minutes counts as a few.

Wolfram Language (Mathematica), 53 bytes
LengthWhile[CoefficientList[(1+Tr[x^#])^8,x],#>0&]-1&

Try it online!

Python 2, 145 bytes
from itertools import*
x=set(map(sum,reduce(chain,map(combinations_with_replacement,[input()]*9,range(9)))))
print~-min(set(range(1,max(x)+2))-x)

Try it online!

Pari/GP, 57 bytes
a->n=-1;while(polcoeff((1+sum(i=1,8,x^a[i]))^8,n++),);n-1

Try it online!

is this using generating function?

@donbright Yes.

that is awesome.. one of the few answers not brute-forcing the solution. alot of languages probably dont have built in polynomial symbolic features. Pari GP is cool.

Python 2, 125 115 111 bytes
lambda c:sum(i==j for i,j in enumerate(sorted(set(map(sum,product([0]+c,repeat=8))))))-1
from itertools import*

Try it online!
Expects a list of integers as input.
Explanation:
# an anonymous function
lambda c:
                                                          # get all length-8 combinations of values, from (0,0,0,0,0,0,0,0) to (8,8,8,8,8,8,8,8)
                                                          # zero is added to ensure that combinations of fewer than 8 coins are represented Ex:(1,0,0,0,0,0,0,0)
                                                          product([0]+c,repeat=8)
                                                  # for each combination, sum the values
                                                  map(sum,.......................)
                                       # get unique values, then sort them smallest to largest
                                       sorted(set(................................))
             # for each index, value pair, return if the index is equal to the value
             i==j for i,j in enumerate(.............................................)
         # in Python arithmetic, False is 0 and True is 1. So, count how many items match their index.
         # Since zero was added to the list, there will always be one extra match (0==0). So offset by one.
         sum(........................................................................)-1
from itertools import*

Perl6, 65 63 41 bytes (39 37 chars)
{@_=(0,|@_)X+(0,|@_)for ^3;($_ if $_==$++for @_.sort.unique)-1}

Try it online!
This is an anonymous block that gets passed its data as an array.  The (0,|@_) is a quick way to add a 0 to @_, and even though it's done twice, it's still a bit shorter than @_.push: 0; which would then need spaces after the _. This is a brute force approach that cheeses a bit on the fact that it's 8 combinations.  After cross adding, an anonymous list is created for sequential values.  With math operators, lists evaluate to their length, so the -1 pulls double duty: accounting for the 0 and coercing to Int.
This can take its sweet time, but by changing one or both (0,|@_) to (0,|@_.unique) before the first for it can be sped up considerably.  That adds +7 (runtime <60s) or +14 (runtime <10s) to the score if you feel the first is too slow (I did this for the linked code to avoid timeouts after 60 seconds).
Edit: JoKing in the comments improved it (same idea, cross add, then return the last consecutive result) to an astonishing 39 chars (41 bytes):
{(@_=@_ X+0,|@_)xx 3;first *+1∉@_,^∞}

Try it online!
The final tabulation doesn't need a 0, saving a few bytes by only needing to add 0 in once.  The xx 3 mimics the for loop (still cheeses on the coins being a power of 2).  The first sub returns the first number in the infinite list 0..* (^Inf is possible too, but doesn't save space) whose +1 is not a member of the cross added list.  Like mine, it's slow, so add +7 for a unique after the first equals if you feel it's too slow for guidelines.

48 bytes. Technically, the unique is not needed, but it speeds it up a lot

@JoKing nice, I don't know why I didn't think about using xx.  I knew there had to be a way to do the final tabulation in a much shorter way using set functions, but my brain wasn't working.

The xx 1 should be xx 3

@JoKing fixed.  Also I realized two chars (but no bytes) can be saved by using ^∞

Actually, you can save some bytes with (1...*∉@_)-1 instead of using first, (which I realise is the same method I used here)

JavaScript (Node.js), 171 145 115 bytes
f=(s,n=3)=>n?f(s=new Set(a=[0,...s]),n-1,a.map(m=>a.map(n=>s.add(m+n)))):Math.min(...[...s].filter(m=>!s.has(m+1)))

Try it online! Port of @Mark's Python 3 answer. 108 bytes in Firefox 30-57:
f=(s,n=3)=>n?f(new Set((for(n of s=[0,...s])for(m of s)n+m)),n-1):Math.min(...[...s].filter(m=>!s.has(m+1)))

Wolfram Language (Mathematica), 46 bytes
0//.x_/;Min[Tr/@FrobeniusSolve[#,x+1]]<9:>x+1&

Try it online!
Brute force approach: checks integers counting upward until it reaches a value that can't be paid for in 8 coins. Very, very slow (tio times out), but I'm fairly sure the condition is correct.

Clean, 161 bytes
import StdEnv,Data.List
$l=:[1:_]#k=sort(nub(map sum(iter 8(concatMap(\[h:t]=[[e,h:t]\\e<-[0:l]|e>=h]))[[0]])))
=length(takeWhile((>=)1)(zipWith(-)(tl k)k))
$_=0

Try it online!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Corrupting A Binary File By Interpreting It As Text
Using FTP's ASCII mode to transfer binary files is a bad idea. It is likely to corrupt your data. Badly. Let's simulate this corruption!
Your task is to write a program which takes a file as input and outputs the corrupted version of the file. Because how exactly your file gets corrupted is dependent on both the FTP client and server and their systems/implementations, for this challenge, we will use the following rules for corruption, in this order:

Clear the high bit in each byte of the file. (Masking with 0x7F is an option here)
When encountering escape (0x1b) followed by [, delete from the escape character through the next letter character (A-Z and a-z), inclusive.
Escape followed by any other character should remove both the escape and the character following it.
All control codes (characters in the range 0x00-0x1F, inclusive, and 0x7F) other than tab (0x09) and linefeed (0x0a) should be removed.

Other rules

Input and output can be in any convenient format. You do not need to use actual files.
Shortest code wins, of course.
Standard rules and loopholes apply.

How about 0x9B? Should it be interpreted as 0x1B once the most significant bit has been cleared? (I think the answer is yes, according to the description.)

@Arnauld yes, that would be correct. We're pretending to be a really dumb FTP server that just pretends the high bit doesn't exist.

Could we have a test-case?

@wizzwizz4 I was thinking you could use just about any binary file, though I suppose the escape sequences need test cases.

@Beefster You can use just about any binary file, but we need to know what the expected output should be.

What about DEL (0x7F)?

Do multiple ESC characters match greedily or not? For example, what is the expected result of "ESC ESC[0s", "[0s" or ""?

Perl 5, 62 53 bytes
y/\x80-\xff/\0-\c?/;s/\e(\[.*?[a-z]|.)|[^\t\n -~]//gi

Try it online! No, I don't know how to input nonprinting characters, particularly illegal UTF-8 sequences, into TIO. Edit: Saved 10 bytes thanks to @NahuelFouilleul.

\c[ could be changed by \e and \ck by \v, \x7f is missing also /g modifier

sorry seems \v doesnt work in character range (indeed \v matches also \f, \r and \n), but [^\t\n -~] is shorter than [\0-\b\ck-\c_\c?]

@NahuelFouilleul Ah, of course, that's much nicer, thanks!

x86 assembly, 85 bytes
Bytecode:
8d0c244289deb00331dbcd803c0175418024247f8a042401f375203c1b0f94c374e23c09740c3c0a
74083c1f7ed83c7f74d4b00431db43cd80ebcb3c5b75014380e3fe0c203c617cbb3c7a7fb731dbeb
b3b001cd80

Source (with explanation in comments):
.section .text
.globl _start

_start:
    leal (%esp), %ecx  # read to (%esp)
    incl %edx          # read one byte

loop:
    movl %ebx, %esi    # save previous %ebx
loopnosave:
    movb $3, %al       # read
    xorl %ebx, %ebx    # stdin
    int $0x80

    cmpb $1, %al       # exit if we didn't get exactly one byte
    jne quit

    andb $0x7f, (%esp)
    movb (%esp), %al   # moving byte into %al saves bytes later on

    addl %esi, %ebx    # restore previous value of %ebx (currently 0)
                       # we use add instead of mov here to update flags
    jnz ignore         # check if we're in the middle of an esc-sequence

    cmpb $0x1b, %al    # check for esc
    sete %bl           # if it is esc, set the "ignore" flag...
    je loop            # ... and skip the output

    cmpb $0x09, %al    # explicitly output tabs and newlines
    je out
    cmpb $0x0a, %al
    je out

    cmpb $0x1f, %al    # don't output control characters
    jle loopnosave
    cmpb $0x7f, %al
    je loopnosave

out:
    movb $4, %al       # write
    xorl %ebx, %ebx
    incl %ebx          # stdout
    int $0x80

    jmp loopnosave     # we clobbered %ebx, so we don't want to keep it

ignore:
    cmpb $'[', %al     # check if it's [
    jne ok             # skip next instruction if not
    incl %ebx          # set %ebx to anything but 1
ok:
    andb $0xfe, %bl    # clear lowest bit on %ebx
    orb $0x20, %al     # uppercase to lowercase
    cmpb $'a', %al
    jl loop
    cmpb $'z', %al
    jg loop
    xorl %ebx, %ebx    # clear ignore flag if letter found
    jmp loop

quit:
    movb $1, %al
    int $0x80

Try it online! (with testcases)
Overview / general explanation:

The program reads one byte at a time. %al holds the input byte, %ebx holds a flag that gets set when an ESC character is encountered. Since we need %ebx to call sys_read and sys_write, %esi is used as a temporary storage space for its previous value.
The %ebx flag is 0 ordinarily, 1 if the previous character was ESC, and 2 or greater if an ESC[ was found. On every loop, the program first tests if the flag is zero. If it is, we either set the flag (if the next character is ESC) or print the next character and move on.
If it's nonzero, we don't print the character, but instead unset the least significant bit of the flag. This has the effect of zeroing it if it's 1, but it will remain nonzero if it's any other positive integer (signifying a preceding ESC[). Then we set it to zero (by xoring it with itself) if the current character is a letter, terminating the ESC[ sequence.
One trick I'd like to point out: it's a little miraculously convenient that the file descriptor for STDIN happens to be 0. This allows us to postpone moving %esi back to %ebx until the first time we have to check the flag, which happens to be checking whether it's zero. A movl instruction would not update flags, but addl does, and since %ebx was previously set to zero to read from STDIN, the add instruction happens to be equivalent.
Uses many of the same tricks as in my cat program.

providing a hexdump would be in the spirit of the question :)

16/32-bit x86 assembly code, 47 bytes
Bytes:
AC247F3C7F74253C0974203C0A741C3C1B7514497418AC3C5B7511497410AC24DF2C403C1A77F43C1F7601AAE2D2C3
Disassembly:
l1: lodsb ;fetch a byte
    and   al, 7fh    ;clear bit 7
    cmp   al, 7fh
    je    l5         ;skip 0x7F
    cmp   al, 9
    je    l4         ;accept 0x09
    cmp   al, 0ah
    je    l4         ;and 0x0A
    cmp   al, 1bh
    jne   l3         ;branch if not ESC
    dec   ecx
    je    l6         ;exit if out of characters
    lodsb            ;fetch a byte
    cmp   al, '['
    jne   l5         ;skip if not '['
l2: dec   ecx
    je    l6         ;exit if out of characters
    lodsb            ;fetch a byte
    and   al, 0dfh   ;clear bit 6 so lowercase -> uppercase
    sub   al, 40h    ;convert potential uppercase to 0x00-0x1A range
                     ;(lesser values will wrap around)
    cmp   al, 1ah    ;check for 'Z'
    jnbe  l2         ;loop if not less or equal
l3: cmp   al, 1fh
    jbe   l5         ;ignore all other values less or equal to 0x1F
l4: stosb            ;store surviving character
l5: loop  l1         ;loop while characters remain
l6: ret
Input: (E)SI is pointer to input text, (E)DI is pointer to output buffer, (E)CX is length of input.
Replace ECX with CX for 16-bit code.  Code size is not affected.

Python 3, 186 100 84 bytes
lambda s:re.sub(b"␛\[.*?[A-Za-z]|␛.|[^ -~\n␉]",b"",bytes(b&127for b in s))
import re

Applies each filter in turn, with filters 2, 3 and 4 being implemented by a regular expression. (Diagram not to scale.)
-15 bytes thanks to Erik the Outgolfer
Try it online!
Test cases
I assume that my program's doing the right thing here.

f(b"ab\x1b[cde\x1b[;'3GH\x1bIJK\x84\xa2\r\n\t") => b'abdeHJK"\n\t'

the TIO linked is 85 bytes, not 84?

@FlipTack Whoops! Fixed.

Out of curiosity, why is the import at the end?

@SolomonUcko That was Erik's idea. Since I had an f= in the middle, and the policy is to allow programs to be preceded by f= if they're using a lambda, restructuring the source code so that that was possible saved 2 bytes.

I see, that makes sense. I thought you were allowed to use the last expression evaluated, but maybe not.

@SolomonUcko You probably are. It's a while since I kept up with the latest consensus.

Clean, 164 bytes
Escape sequences counted as one byte each, since they're valid code but not valid UTF-8
(so TIO and SE don't like them)
import StdEnv
?[]=[]
?['\33':t]= ?(drop 1((if(t%(0,0)==['['])(dropWhile(not o isAlpha))id)t))
?[h:t]|h<' '&&h<>'	'&&h<>'
'||h>'\176'= ?t=[h: ?t]

?o map(\e|e<'\177'=e=e-'\200')

Try it online!

C (gcc), 116 112 bytes
This program assumes that a second ESC in a row matches as a non-[ (e.g. "ESC ESC [0a" -> "[0a".) So that I can send NUL characters to the function, I provide a counted string to it instead of a standard string.
Thanks to @ceilingcat for the suggestions.
f(t,c,i,s)char*t;{for(s=0;i=*t++&127,c--;)s?s=2*!(s-1?isalpha(i):i-91):i-27?i-9u<2|i>31&&i<127&&putchar(i):s++;}

Try it online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Find equally-weighted complete graphs
Graph theory is used to study the relations between objects. A graph is composed of vertices and edges in a diagram such as this:
A-----B
|    / \
|   /   \
|  /     E
| /     /
|/     /
C-----D

In the above diagram, A is linked to B and C; B is linked to A, C, and E; C is linked to A, B, and D; D is linked to C and E; and E is linked to B and D. As that description was rather wordy, a graph can be represented as a symmetric boolean matrix where a 1 represents a connection and a 0 represents the lack thereof. The above matrix is translated to this:
01100
10101
11010
00101
01010

For the purpose of this problem, the matrix definition can be extended to include the distances or weights of the paths between nodes. If individual ASCII characters in the diagram have weight 1, he matrix would be:
05500
50502
55050
00502
02020

A "complete graph" consists of a set of points such that each point is linked to every other point. The above graph is incomplete because it lacks connections from A to D and E, B to D, and C to E. However, the subgraph between A, B, and C is complete (and equally weighted). A 4-complete graph would look like this:
A---B
|\ /|
| X |
|/ \|
C---D

and would be represented by the matrix:
01111
10111
11011
11101
11110

This problem is as follows: Given a symmetric matrix representing a graph and a positive integer n, find the number of distinct equally-weighted complete subgraphs of size n contained within.
You may assume that the input matrix is numeric and symmetric, and may choose input/output format. An entry in the matrix may be part of multiple equally-weighted subgraphs as long as they are distinct and of equal size. You may assume that n is a positive integer greater than or equal to 3.
The winning criterion for this challenge is code golf. Standard rules apply.

Test cases wouldn't go amiss.

Can complete graphs contain redundant self-connections (e.g. A to A)?

... and if so must they be n too?

@JonathanAllan Complete graphs can but do not necessarily contain self-connections.

... and if so must they be n too?

Jelly,  18 16  15 bytes
Assumes self-connections may be any weight (i.e. they are not necessarily only either \$0\$ or the equal weight).
Jœcṗ2EÐḟœị³EƲ€S

Try it online!
the two subsets of size 3 being ACE and BCD
With n=2 all 10 subsets of size 2 work as its symmetric.
How?
Jœcṗ2EÐḟœị³EƲ€S - Link: list of lists of integers, M; integer, n
J               - range of length of M = [1,2,3,...,length(M)]
 œc             - Combinations of length n e.g. [[1,2,3],[1,2,4],[1,3,4],[2,3,4]]
             €  - for each:
            Ʋ   -   last four links as a monad:
   ṗ2           -     Cartesian power with 2
      Ðḟ        -     discard if:
     E          -       all-equal (i.e. diagonal co-ordinates like [3,3])
        œị      -     multi-dimensional index into:
          ³     -       program's 3rd argument (1st input), M
           E    -     all equal?
              S - sum

Jelly, 16 bytes
ịⱮịŒDḊẎE
Jœcç€⁸S

Try it online!

Python 2, 195 bytes 178 bytes 168 bytes
I'm sure there's a lot more golfing possible here, but for a change I want to get an entry in before there are dozens of other ones. I've provided a couple of test cases on TIO, but would love more examples.
First round of suggested golf steps:  Remove some spaces, be smarter about the import. Shorter way of testing if the single link value in a set is zero (Thanks  to M. XCoder).
Second round: ElPedro points out that in this case a program is shorter than the function.  I was hoping to find a way to package this as a lambda, so was thinking "function" from the start. Thanks.
from itertools import*
r=set()
M,n=input()
for g in set(combinations(range(len(M)),n)):
 s={M[i][j]for i in g for j in g if i>j}
 if len(s)==1and{0}!=s:r.add(g)
print r

Try it online!
A slightly ungolfed version, to clarify logic:
from itertools import combinations
def f3(M,n):
  r = set()
  groups = set(combinations(range(len(M)), n)) # all possible combinations of indexes
  for group in groups:
      # Generate a set of link values associated with the current combination
      # This selects only non-diagonal indexes, assuming matrix symmetry.
      s = {M[i][j]for i in group for j in group if i>j}
      # If the set has only one member, and that's not zero, you have
      # a connected subgraph.
      if len(s) == 1 and 0 not in s:
          r.add(group)
  return r

178 bytes.

172 bytes. A program is cheaper than a function.

@Mr.Xcoder - really like and{0}!=s. Was trying to find a way to shorten that condition but didn't think of that. My suggestion goes to 168 if I use that.

Clean, 152 bytes
import StdEnv,Data.List
$m n=sum[1\\i<-subsequences[0..size m-1]|length i==n,j<-permutations i|case[m.[x,y]\\x<-i&y<-j]of[u:v]=all((==)u)v&&u>0;_=1<0]/2

Try it online!
TIO driver takes n as a command-line argument and the matrix through STDIN (weights up to 9).
The actual function $ :: {#{#Int}} Int -> Int works with any size weights.

Wolfram Language (Mathematica), 90 bytes
There is probably some room to further golf this, after some test cases are posted.
We construct a graph from the unitized adjacency matrix, and then use the FindClique function with All as the third argument to list out the vertices with complete subgraphs.  We then select the submatrices of the original input corresponding to the cliques (which will have zeros along the diagonal) and count the number of distinct elements which should be 2 if the weights are equal.
In this implementation, self connections can have a weight other than zero and the graph will still be considered complete and equal weighted, so long as the weights of all self connections in the subgraph are identical.
Count[Length@*Union@@@(b[[#,#]]&/@FindClique[AdjacencyGraph[Unitize/@(b=#)],{#2},All]),2]&

Try it online!


text:
All the digisibles
A natural number (written in the decimal base) is qualified as digisible if and only if it fulfills the following 3 conditions:

none of its digits is zero,
all the digits that compose it are different,
the number is divisible by all the digits that compose it.

The challenge is to output all the digisibles (there are 548 digisibles).
Examples
1         --> the smallest digisible
24        --> is digisible
2789136   --> is digisible
2978136   --> is digisible
2983176   --> is digisible
3298176   --> is digisible
3678192   --> is digisible
3867192   --> is digisible
3928176   --> is digisible
6387192   --> is digisible
7829136   --> is digisible
7836192   --> is digisible
7892136   --> is digisible
7892136   --> is digisible
9867312   --> the biggest digisible

1653724   --> is not digisible
1753924   --> is not digisible
23        --> is not digisible
2489167   --> is not digisible
5368192   --> is not digisible
60        --> is not digisible
7845931   --> is not digisible
8964237   --> is not digisible
9129      --> is not digisible

Input
No input.
Output
The list (or set) of all digisibles. The output does not have to be sorted.
Complete output
1
2
3
4
5
6
7
8
9
12
15
24
36
48
124
126
128
132
135
162
168
175
184
216
248
264
312
315
324
384
396
412
432
612
624
648
672
728
735
784
816
824
864
936
1236
1248
1296
1326
1362
1368
1395
1632
1692
1764
1824
1926
1935
1962
2136
2184
2196
2316
2364
2436
2916
3126
3162
3168
3195
3216
3264
3276
3492
3612
3624
3648
3816
3864
3915
3924
4128
4172
4236
4368
4392
4632
4872
4896
4932
4968
6132
6192
6312
6324
6384
6432
6912
6984
8136
8496
8736
9126
9135
9162
9216
9315
9324
9432
9612
9648
9864
12384
12648
12768
12864
13248
13824
13896
13968
14328
14728
14832
16248
16824
17248
18264
18432
18624
18936
19368
21384
21648
21784
21864
23184
24168
24816
26184
27384
28416
29736
31248
31824
31896
31968
32184
34128
36792
37128
37296
37926
38472
39168
39816
41328
41832
42168
42816
43128
43176
46128
46872
48216
48312
61248
61824
62184
64128
68712
72184
73164
73248
73416
73962
78624
79128
79632
81264
81432
81624
81936
82416
84216
84312
84672
87192
89136
89712
91368
91476
91728
92736
93168
93816
98136
123648
123864
123984
124368
126384
129384
132648
132864
132984
134928
136248
136824
138264
138624
139248
139824
142368
143928
146328
146832
148392
148632
149328
149832
162384
163248
163824
164328
164832
167328
167832
168432
172368
183264
183624
184392
184632
186432
189432
192384
193248
193824
194328
194832
198432
213648
213864
213984
214368
216384
218736
219384
231648
231864
231984
234168
234816
236184
238416
239184
241368
243168
243768
243816
247968
248136
248976
261384
263184
273168
281736
283416
284136
291384
293184
297864
312648
312864
312984
314928
316248
316824
318264
318624
319248
319824
321648
321864
321984
324168
324816
326184
328416
329184
341928
342168
342816
346128
348192
348216
348912
349128
361248
361824
361872
362184
364128
364728
367248
376824
381264
381624
382416
384192
384216
384912
391248
391824
392184
394128
412368
413928
416328
416832
418392
418632
419328
419832
421368
423168
423816
427896
428136
428736
431928
432168
432768
432816
436128
438192
438216
438912
439128
461328
461832
463128
468312
469728
478296
478632
481392
481632
482136
483192
483216
483672
483912
486312
489312
491328
491832
493128
498312
612384
613248
613824
613872
614328
614832
618432
621384
623184
623784
627984
631248
631824
632184
634128
634872
641328
641832
643128
648312
671328
671832
681432
684312
689472
732648
732816
742896
746928
762384
768432
783216
789264
796824
813264
813624
814392
814632
816432
819432
823416
824136
824376
831264
831624
832416
834192
834216
834912
836472
841392
841632
842136
843192
843216
843912
846312
849312
861432
864312
873264
891432
894312
897624
912384
913248
913824
914328
914832
918432
921384
923184
927864
931248
931824
932184
934128
941328
941832
943128
948312
976248
978264
981432
984312
1289736
1293768
1369872
1372896
1376928
1382976
1679328
1679832
1687392
1738296
1823976
1863792
1876392
1923768
1936872
1982736
2137968
2138976
2189376
2317896
2789136
2793168
2819376
2831976
2931768
2937816
2978136
2983176
3186792
3187296
3196872
3271968
3297168
3298176
3619728
3678192
3712968
3768912
3796128
3816792
3817296
3867192
3869712
3927168
3928176
6139728
6379128
6387192
6389712
6391728
6719328
6719832
6731928
6893712
6913872
6971328
6971832
7168392
7198632
7231896
7291368
7329168
7361928
7392168
7398216
7613928
7639128
7829136
7836192
7839216
7861392
7863912
7891632
7892136
7916328
7916832
7921368
8123976
8163792
8176392
8219736
8312976
8367912
8617392
8731296
8796312
8912736
8973216
9163728
9176328
9176832
9182376
9231768
9237816
9278136
9283176
9617328
9617832
9678312
9718632
9723168
9781632
9782136
9812376
9867312

Rules

The output can be given in any convenient format.
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
If possible, please include a link to an online testing environment so other people can try out your code!
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

@Fatalize question updated

May we instead output a digisible mask for all numbers up to ten million?

@Adám what do you mean by mask?

1,1,1,1,1,1,1,1,1,0,0,1,…

@Adám Is that a convenient format for PPCG?

If your challenge is to output the digisibles then it seems invalid, but if your challenge is to find or determine them, then it seems valid. Up to you.

@Adám In this case a mask is invalid because the answer must output the concrete set of digisibles.

These are the Lynch-Bell numbers, OEIS A115569.

Very closely related. Instead of outputting all of the numbers, that question is a decision problem.

@Okx The top comment links to a duplicate of this question here.

So these are digisible Monday numbers?

@ouflak Digisible Lynch-Bell Monday numbers

Haskell, 83 bytes
-1 byte thanks to @Laikoni, -13 bytes thanks to @H.PWiz!
f=[n|n<-[1..10^7],x<-[show n],and[d>'0'&&n`mod`read[d]<1|d<-x],[a|a<-x,b<-x,a==b]==x]

Try it online!

notElem is in Prelude and saves a byte.

Shorter than notElem '0' is all(/='0'). You can also use x<-[show n]

I've found some more golfs

@H.PWiz Thanks a lot!

Charcoal, 28 23 bytes
ΦＥＸχ⁷Ｉι∧Πι¬Φι∨⁻μ⌕ιλ﹪κＩλ

Try it online! for numbers of up to five digits (too slow for larger numbers). Explanation:
   χ                    Predefined variable 10
  Ｘ                     Raised to power
    ⁷                   Literal 7
 Ｅ                      Map over implicit range
      ι                 Current value
     Ｉ                  Cast to string
Φ                       Filter over list of strings
         ι              Current string
        Π               Digital product (is nonzero)
       ∧                Logical And
          ¬             Logical Not
            ι           Current string
           Φ            Filter over digits as characters
               μ         Inner index
              ⁻          Minus
                ⌕        First position of
                  λ      Current character in
                 ι       Current string
             ∨          Logical Or
                    κ   Outer index
                   ﹪    Modulo
                      λ Current character
                     Ｉ  Cast to integer

@mdahmoune Sorry for the delay; while writing it up I came up with some golfs.

Python 3, 132 bytes
for i in range(1,int(1e7)):
 if '0' not in str(i) and len(set(str(i)))==len(str(i)) and not any([i%int(j) for j in str(i)]):print(i)

Try it online!

Some trivial golfs

@Mr.Xcoder I noticed most of them after posting but I didn't edit the post after the question got locked.


text:
Count the contiguous submatrices
Migrated from chat
Given two non-empty non-negative integer matrices A and B, answer the number of times A occurs as a contiguous, possibly overlapping, submatrix in B.
Examples/Rules
0. There may not be any submatrices
A:
[[3,1],
 [1,4]]
B:
[[1,4],
 [3,1]]
Answer:
0
1. Submatrices must be contiguous
A:
[[1,4],
 [3,1]]
B:
[[3,1,4,0,5],
 [6,3,1,0,4],
 [5,6,3,0,1]]
Answer:
1 (marked in bold)
2. Submatrices may overlap
A:
[[1,4],
 [3,1]]
B:
[[3,1,4,5],
 [6,3,1,4],
 [5,6,3,1]]
Answer:
2 (marked in bold and in italic respectively)
3. A (sub)matrix may be size 1-by-1 and up
A:
[[3]]
B:
[[3,1,4,5],
 [6,3,1,4],
 [5,6,3,1]]
Answer:
3 (marked in bold)
4. Matrices may be any shape
A:
[[3,1,3]]
[[3,1,3,1,3,1,3,1,3]]
Answer:
4 (two bold, two italic)

Brachylog (v2), 10 bytes
{{s\s\}ᵈ}ᶜ

Try it online!
I like how clear and straightforward this program is in Brachylog; unfortunately, it's not that short byte-wise because the metapredicate syntax takes up three bytes and has to be used twice in this program.
Explanation
{{s\s\}ᵈ}ᶜ
  s         Contiguous subset of rows
   \s\      Contiguous subset of columns (i.e. transpose, subset rows, transpose)
 {    }ᵈ    The operation above transforms the first input to the second input
{       }ᶜ  Count the number of ways in which this is possible

Jelly, 7 bytes
ZẆ$⁺€Ẏċ

Try it online!
How it works
ZẆ$⁺€Ẏċ  Main link. Arguments: B, A

  $      Combine the two links to the left into a monadic chain.
Z          Zip; transpose the matrix.
 Ẇ         Window; yield all contiguous subarrays of rows.
   ⁺     Duplicate the previous link chain.
    €    Map it over the result of applying it to B.
         This generates all contiguous submatrices of B, grouped by the selected
         columns of B.
     Ẏ   Tighten; dump all generated submatrices in a single array.
      ċ  Count the occurrences of A.

MATL, 12 bytes
ZyYC2MX:=XAs

Inputs are A, then B.
Try it online! Or verify all test cases.
Explanation
Consider inputs [1,4; 3 1], [3,1,4,5; 6,3,1,4; 5,6,3,1]. The stack is shown with the most recent element below.
Zy    % Implicit input: A. Push size as a vector of two numbers
      % STACK: [2 2]
YC    % Implicit input: B. Arrange sliding blocks of specified size as columns,
      % in column-major order
      % STACK: [3 6 1 3 4 1;
                6 5 3 6 1 3;
                1 3 4 1 5 4;
                3 6 1 3 4 1]
2M    % Push input to second to last function again; that is, A
      % STACK: [3 6 1 3 4 1;
                6 5 3 6 1 3;
                1 3 4 1 5 4;
                3 6 1 3 4 1],
               [1 4;
                3 1]
X:    % Linearize to a column vector, in column-major order
      % STACK: [3 6 1 3 4 1;
                6 5 3 6 1 3;
                1 3 4 1 5 4;
                3 6 1 3 4 1],
               [1;
                3;
                4;
                1]
=     % Test for equality, element-wise with broadcast
      % STACK: [0 0 1 0 0 1
                0 0 1 0 0 1;
                0 0 1 0 0 1;
                0 0 1 0 0 1]
XA    % True for columns containing all true values
      % STACK: [0 0 1 0 0 1]
s     % Sum. Implicit display
      % STACK: 2

Dyalog APL, 6 4 bytes
≢∘⍸⍷

This is nearly a builtin (thanks H.PWiz and ngn).
  ⍷       Binary matrix containing locations of left argument in right argument
≢∘⍸       Size of the array of indices of 1s

Alternative non-builtin:
{+/,((*⍺)≡⊢)⌺(⍴⍺)*⍵}

Dyadic function that takes the big array on right and subarray on left.
                  *⍵       exp(⍵), to make ⍵ positive.
    ((*⍺)≡⊢)⌺(⍴⍺)        Stencil;
                            all subarrays of ⍵ (plus some partial subarrays
                            containing 0, which we can ignore)
               ⍴⍺             of same shape as ⍺
     (*⍺)≡⊢                   processed by checking whether they're equal to exp(⍺).
                           Result is a matrix of 0/1.
   ,                     Flatten
 +/                      Sum.

Try it here.

You should checkout ⍷

you can use compose (∘) to shorten the train: +/∘∊⍷ or even ≢∘⍸⍷

05AB1E, 10 bytes
øŒεøŒI.¢}O

Try it online!
øŒεøŒI.¢}O     Full program. Takes 2 matrices as input. First B, then A.
øŒ             For each column of B, take all its sublists.
  ε     }      And map a function through all those lists of sublists.
   øŒ          Transpose the list and again generate all its sublists.
               This essentially computes all sub-matrices of B.
     I.¢       In the current collection of sub-matrices, count the occurrences of A.
         O     At the end of the loop sum the results.

Uiua,  4  3 bytes
⧻⊚⌕

Try it!
-1 thanks to Razetime
⧻⊚⌕
  ⌕  # find
 ⊚   # where
⧻    # length

⧻⊚⌕ is what adam's apl does

@Razetime Ah, that's clever. Thanks.

Charcoal, 36 27 bytes
ＩΣ⭆η⭆ι⁼θＥ✂ηκ⁺Ｌθκ¹✂νμ⁺Ｌ§θ⁰μ¹

Try it online! Much shorter now that Equals works for arrays again. Explanation:
   η                        Input array B
  ⭆                         Mapped over rows and joined
     ι                      Current row
    ⭆                       Mapped over columns and joined
       θ                    Input array A
      ⁼                     Is equal to
          η                 Input array B
         ✂                  Sliced
                ¹           All elements from
           κ                Current row index to
             Ｌ              Length of
              θ             Input array A
            ⁺               Plus
               κ            Current row index
        Ｅ                   Mapped over rows
                  ν         Current inner row
                 ✂          Sliced
                          ¹ All elements from
                   μ        Current column index to
                     Ｌ      Length of
                       θ    Input array A
                      §     Indexed by
                        ⁰   Literal 0
                    ⁺       Plus
                         μ  Current column index
 Σ                          Digital sum
Ｉ                           Cast to string
                            Implicitly printed

Clean, 118 97 95 bytes
import StdEnv,Data.List
?x=[transpose y\\z<-tails x,y<-inits z]
$a b=sum[1\\x<- ?b,y<- ?x|y==a]

Try it online!

JavaScript (ES6), 93 bytes
Takes input as (A)(B).
a=>b=>b.map((r,y)=>r.map((_,x)=>s+=!a.some((R,Y)=>R.some((v,X)=>v!=(b[y+Y]||0)[x+X]))),s=0)|s

Try it online!

R, 95 bytes
function(A,B,x=dim(A),D=dim(B)-x){for(i in 0:D)for(j in 0:D[2])F=F+all(B[1:x+i,1:x[2]+j]==A);F}

Try it online!

Python 2, 101 bytes
lambda a,b:sum(a==[l[j:j+len(a[0])]for l in b[i:i+len(a)]]for i,L in e(b)for j,_ in e(L))
e=enumerate

Try it online!

Nekomata + -n, 5 bytes
qŤqŤ=

Attempt This Online!
qŤqŤ=
q       Choose a contiguous subsequences
 Ť      Transpose
  q     Choose a contiguous subsequences
   Ť    Transpose
    =   Check equality

-n counts the number of solutions.

Python 2, 211 bytes
a,b=input()
l,w,L,W,c=len(a),len(a[0]),len(b),len(b[0]),0
for i in range(L):
 for j in range(W):
  if j<=W-w and i<=L-l:
   if not sum([a[x][y]!=b[i+x][j+y]for x in range(l)for y in range(w)]):
    c+=1
print c

Try it online!
Fairly straightforward. Step through the larger matrix, and check if the smaller matrix can fit.
The only even slightly tricky step is the list comprehension in the 6th line, which relies on Python's conventions for mixing Boolean and integer arithmetic.

Groovy, 109 bytes
{a,b->(0..<b.size()).sum{i->(0..<b[i].size()).count{j->k=i-1
a.every{l=j;k++
it.every{(b[k]?:b)[l++]==it}}}}}

Try it online!

Scala, 151 bytes
(a,b)=>{(0 to b.size-a.size).map(i=>(0 to b(0).size-a(0).size).count(j=>{var k=i-1
a.forall(c=>{var l=j-1;k+=1
c.forall(d=>{l+=1
b(k)(l)==d})})})).sum}

Try it online!


text:
Most contributing rows
Given a non-empty matrix of non-negative integers, answer which unique rows contribute most to the sum total of elements in the matrix.
Answer by any reasonable indication, for example a mask of the unique rows order of appearance (or sort order), or indices (zero- or one- based) of those, or a submatrix consisting of the rows (in any order) or some kind of dictionary construct… — but do explain it!
Examples
[[1,2,3],[2,0,4],[6,3,0],[2,0,4],[6,3,0],[2,0,4]]:
The unique rows are [1,2,3], [2,0,4], and [6,3,0] each respectively contributing 6, 6, and 9 each time they occur. However, they occur once, thrice and twice respectively, so all of their respective occurrences contribute 6, 18, and 18 to the total (42), so the latter two rows are the ones that contribute most. Valid answers are therefore:
[false,true,true] mask in appearance/sort order or
[1,2]/[2,3] zero/one-based indices of the above or
[[2,0,4],[6,3,0]] the actual rows
⋮

[[1,2],[3,1],[2,3],[1,2],[3,1],[2,3],[1,2]]
[false,false,true](appearance order) / [false,true,false](sort order)
[2]/[3](appearance order) / [1]/[2](sort order)
[[2,3]]
⋮

Jelly, 5 bytes
Ġị§§M

Try it online!
1-based indices of sorted unique elements of input.

Woha, that is short.

R, 64 bytes
function(M)max(x<-tapply(rowSums(M),apply(M,1,toString),sum))==x

Try it online!
Returns a boolean vector with TRUE/FALSE in sort order (lexicographic).
The unique rows are shown as vector names, so it is easy to identify the most contributing ones.

Pyth, 9 bytes
-1 thanks to FryAmTheEggman!
{s.MssZ.g

Try it online!

The final k isn't necessary. Also .M*sZ/QZ{ seems to be a same-length solution then.

@FryAmTheEggman Oh lol how did I forget about auto-complete? Thanks a lot!

Python 3, 153 145 129 bytes
-8 bytes thanks to @Mr. Xcoder!
from itertools import*
def f(l):a=[[sum(map(sum,[*s])),k]for k,s in groupby(sorted(l))];return[v[1]for v in a if v[0]==max(a)[0]]

Try it online!

Haskell, 60 bytes
import Data.Lists
f x=nub$argmaxes(\e->sum e*countElem e x)x

Returns a list of the rows.

Charcoal, 25 bytes
ＩΦθ∧⁼κ⌕θι⁼×№θιΣι⌈Ｅθ×№θλΣλ

Try it online! Link is to verbose version of code. Default output format is each row element on its own line and rows double-spaced. Explanation:
  θ                         Input array
 Φ                          Filtered where
     κ                      Current index
    ⁼                       Equals
      ⌕                     First index of
        ι                   Current row
       θ                    In input array
   ∧                        Logical And
           №                Count of
             ι              Current row
            θ               In input array
          ×                 Multiplied by
              Σ             Sum of
               ι            Current row
         ⁼                  Equals
                ⌈           Maximum of
                  θ         Input array
                 Ｅ          Mapped over rows
                    №       Count of
                      λ     Current row
                     θ      In input array
                   ×        Multiplied by
                       Σ    Sum of
                        λ   Current row
Ｉ                           Cast to string
                            Implicitly printed

Mathematica, 48 bytes
Last[SortBy[Gather[m], Total[Flatten[#]] &]][[1]]

or
TakeLargestBy[Gather[m], Total[#, 2] &, 1][[1, 1]]

where (for example)
m = {{1, 2, 3}, {2, 0, 4}, {7, 9, 5}, {6, 3, 0}, {2, 0, 4},
     {6, 3, 0}, {2, 0, 4}, {7, 9, 5}};

You can use shorthand and remove whitespace to save bytes: SortBy[Gather@m,Total@*Flatten][[-1,1]]

This looks like it takes input from a predefined variable, which is not allowed. Submissions have to be full programs or function by default.

TakeLargestBy[Gather[m], Total[#, 2] &, 1][[1, 1]] /@ m

This is not valid; it only returns one of the rows with greatest values rather than all of them.

JavaScript (ES6), 88 bytes
Outputs an array of Boolean values in appearance order.
m=>m.map(h=o=r=>h=(v=o[r]=~~o[r]+eval(r.join`+`))<h?h:v)&&Object.keys(o).map(x=>o[x]==h)

Try it online!

Groovy, 76 bytes
{l->m=l.toSet().sort().collect{it.sum()*l.count(it)}
m.collect{it==m.max()}}

Try it online!
Returns as booleans in sort order

Scala, 63 bytes
l=>{var m=l.distinct.map(n=>n.sum*l.count(n==))
m.map(m.max==)}

Try it online!
Returns booleans in appearance order

APL (Dyalog Unicode), 12 bytes
(⌈/=⊢)+.×∘⍴⌸

Try it online!
-2 thanks to Adám. -1 thanks to alternate output format.

Now comes the challenge of explanation…

Wolfram Language (Mathematica), 42 bytes
#~Position~Max@#&@(Total[#,2]&/@Gather@#)&

Try it online!

Python 2, 81 78 bytes
lambda a:{u for u in a if a.count(u)*sum(u)==max(a.count(t)*sum(t)for t in a)}

Try it online!
3 bytes thx to Black Owl Kai.
Given a collection of tuples, the output is a set of those tuples having the desired maximal property.

78 bytes

@Black Owl Kai: thx! I missed that...

Japt, 13 11 bytes
-2 bytes from @Shaggy
ü¬®xx
m¥Urw

Try it online!

11 bytes

@Shaggy I came up with the same thing :P

K (ngn/k), 17 bytes
{&a=|/a:+//'x@=x}

Try it online!
{ } function with argument x
=x group - form a dictionary in which the keys are rows and the values are lists of their indices in the matrix
x@ index the original matrix with that. the result is again a dictionary with the rows as keys. the values are multiple copies of the corresponding key
+//' sum until convergence each (acts only on the values; keys remain as they are)
a: assign to a
|/ maximum (of the values)
a=|/a a row-to-boolean dictionary of which rows contribute the most
& "where", i.e. which keys correspond to values of 1

05AB1E, 10 9 bytes
ês{γOOZQÏ

Try it online or verify all test cases.
Explanation:
ê          # Sort and uniquify the (implicit) input list of lists
           #  i.e. [[2,0,4],[1,2,3],[6,3,0],[2,0,4],[6,3,0],[2,0,4]]
           #   → [[1,2,3],[2,0,4],[6,3,0]]
 s         # Swap so the (implicit) input list of lists is at the top again
  {        # Sort it
           #  i.e. [[2,0,4],[1,2,3],[6,3,0],[2,0,4],[6,3,0],[2,0,4]]
           #   → [[1,2,3],[2,0,4],[2,0,4],[2,0,4],[6,3,0],[6,3,0]]
   γ       # Group the sorted list of lists
           #  i.e. [[1,2,3],[2,0,4],[2,0,4],[2,0,4],[6,3,0],[6,3,0]]
           #   → [[[1,2,3]],[[2,0,4],[2,0,4],[2,0,4]],[[6,3,0],[6,3,0]]]
    O      # Take the sum of each inner-most lists
           #  i.e. [[[1,2,3]],[[2,0,4],[2,0,4],[2,0,4]],[[6,3,0],[6,3,0]]]
           #   → [[6],[6,6,6],[9,9]]
     O     # Take the sum of each inner list
           #  i.e. [[6],[6,6,6],[9,9]] → [6,18,18]
      Z    # Get the max (without popping the list of sums)
           #  i.e. [6,18,18] → 18
       Q   # Check for each if this max is equal to the sum
           #  i.e. [6,18,18] and 18 → [0,1,1]
        Ï  # Filter the uniquified list of lists on truthy values (and output implicitly)
           #  i.e. [[1,2,3],[2,0,4],[6,3,0]] and [0,1,1] → [[2,0,4],[6,3,0]]

J, 16 bytes
[:(=>./)+/^:2/.~

Try it online!
A monadic verb that gives the boolean result in appearance order.
How it works
[:(=>./)+/^:2/.~
             /.~  Self-classify; collect identical rows in appearance order
                  For each collected rows (= a matrix),
        +/^:2       Sum all the elements into one value
[:(=>./)          Compute the boolean vector:
    >./             Is the max of the array
   =                equal to this element?

Haskell + hgl, 15 bytes
l2(*)fo<fce>~sB

Sorts the input by how much they contribute, ascending.
Explanation
So first we have sB which sorts the list by some conversion function.  So we want to come up with the correct conversion function.  fo will give the sum of the element and fce will count the number of times the element appears in the matrix.  To get our metric we multiply them.
So put it together and you have:
f x=sB(\y->fo y*fce x y)x

So now we want to get rid of that lambda since it's pretty expensive.  We can do this with l2/(**):
f x=sB(l2(*)fo$fce x)x
f x=sB(ml**fo$fce x)x

Now we want to get rid of the x.  We can do that by using >~, the monadic bind.
f=l2(*)fo<fce>~sB
f=(ml**fo)<fce>~sB

Operator precedence is not in favor of us using (**) so the l2 version is what we go with.
Reflections
I'm pretty happy overall with this.  But some tweaks can be made.

(**) should be given higher precedence.  Right now it's just the default, it should be higher than (<).

C# (Visual C# Interactive Compiler), 126 bytes
n=>{var i=n.OrderBy(a=>a.Sum()*n.Count(a.SequenceEqual));return i.Where((a,b)=>i.Take(b).Count(a.SequenceEqual)<1).Reverse();}

Try it online!

Most of this code is spent taking out all duplicate values, since the default comparer for lists do not compare the values inside the lists. That means that I cannot use Distinct(), GroupBy(), or Contains to filter the list.

Japt, 11 10 bytes
ü¬ü_xxÃÌmâ

Run it online

Gaia, 10 bytes
ȯẋ_¦Σ¦:⌉=¦

Try it online!
Since Gaia doesn't accept lists through inputs very easily, this is a function that accepts a list from the top from the top of the stack and leaves the result on top (as masks of sorted order).
ȯ           Sort the list
 ẋ          Split it into runs of the same element (in this case, runs of the same row)
  _¦        Flatten each sublist
    Σ¦      Sum each sublist
      :⌉    Find the maximum sum
        =¦  Compare each sum for equality with the maximum


text:
Get the date of the nth day of week in a given year and month
Introduction
Often, people refer to dates as the "second Friday in August, 2018" or the "fourth Sunday in March, 2012". But it's hard to tell what date that is! Your task to is to write a program that receives a year, a month, a day of the week, and an integer, and output that date.
Challenge

For input, you will get a year, a month, a day of week, and a number.

You can take input in any reasonable format, like using a string for the day of week or using a zero indexed weekday, or even take the year and month in a single string. Do explain your input format in your answer, though.

The integer that tells you which day of week in the month to target will be an integer from 1-5. The integer will never refer to a day of week that does not exist(e.g. the fifth Friday of February 2019, which doesn't exist).

Years will always be positive.

Your output can be in any reasonable format, including printing your final date. However, please explain your output format un your answer.

Providing the year and month in the output is optional. Also, you may assume the date is valid.

Example Input and Output
Consider this input, with the format being taking in the year as a 4 digit number, month as an integer, day of week as string, and the ordinal number as an integer:

2019, 3, Saturday, 2
2019, 12, Sunday, 1
2019, 9 Saturday, 1

Output:

March 9
December 1
September 7

This is code-golf, so shortest answer wins.

I thought I might be able to use GNU date, but amusingly, the parser has an... interesting interpretation here.

May week number be 0-indexed?

Sure, if it suits your program

Suggested test case: 2018, 12, Sunday 1

Suggested test case: the first Saturday in September 2019

@Shaggy and Adam Added

MediaWiki Template, 19 bytes
{{#time:r|{{{1}}}}}

This is a MediaWiki Template ParserFunctions port of this PHP answer
Note: #time use PHP strtotime internally.

Sample Input

{{#time:r|second saturday of March 2019}}

Sample Output

Sat, 09 Mar 2019 00:00:00 +0000

Japt, 19 15 bytes
Input is: year, 0-based index of month, 0-based index of day of the week (0 is Sunday) & n.
_XµW¶Ze}f@ÐUVYÄ

Try it
                    :Implicit input of U=year, V=month, W=weekday & X=n
       }f           :Output the first element generated by the right function that returns
                    : falsey (0) when passed through the left function
         @          :Right function. Y=0-based index of current iteration
          ÐUVYÄ     :  new Date(U,V,Y+1)
_                   :Left function. Z=date being passed
 Xµ                 :  Decrement X by
   W¶               :   Test W for equality with
     Ze             :    Z.getDay()

Perl 6, 52 48 bytes
{1+($^c+4-Date.new($^a,$^b,1).daycount)%7+$^d*7}

Try it online!
Anonymous code block that takes input as year, month, day of week (Sunday is 0) and week number (0 indexed). Output is a date object.
Old Explanation:
{                                                  } # Anonymous code block
 (   Date.new(         ))   # Create a new date with
              $^a,$^b,1     # With year, month and the first day
  $_=                       # Save in the variable $_
                         +  # Add to this
                           $^c+4                     # The given day plus 4
                          (     -.daycount)          # The number of days since 17 Nov, 1858
                                           %7        # Modulo 7 to get the correct day
                                             +$^d*7  # Plus the 7 times the number of weeks

I think the week number needs to be 1-indexed

@12Me21 The question says that input is flexible, but I've asked whether we an take week number as 0 indexed

This doesn't seem to work for other months. I think you need $^c+4-$!.daycount.

@nwellnhof Ah, I should have thought of that instead of trial and error, lol. Should be fixed now

PHP, 46, 43, 31 bytes
<?=date(d,strtotime($argv[1]));

Try it online!
The program receives as input a string like "second saturday of March 2019"
The program prints the day number.
-12 bytes thanks to Shaggy.

31 bytes

Also, I don't think you need the of in the input.

@Shaggy, I think these are details. There may be many options.

SmileBASIC, 58 51 48 46 45 bytes
READ N,M$DTREAD M$OUT,,D,W?(5-W+D*2)MOD 7+N*7

Input is in the form: week,year/month/weekday

week: week number, 0-indexed
year: year, 4 digits
month: month (1-indexed), 2 digits 0-padded
weekday: day of the week (1-indexed, 1=Sunday), 2 digits 0-padded

Output is the day of the month, 0 indexed.
The 2nd Saturday in March 2019 would be 1,2019/03/07 → 8 (March 9th)
Ungolfed
READ WEEK,M$
DTREAD M$ OUT ,,D,W
'Functions in SB can output multiple values using OUT.
'In this case, we don't need the first 2 values, so no variables are given.

PRINT (5-W+ D*2) MOD 7 +WEEK*7

Explanation
The input form was specifically chosen so that the year/month/weekday could be passed directly to DTREAD, which is a function which parses a YYYY/MM/DD string and returns the year/month/day as numbers, as well as calculating the day of the week.
However, notice that, where DTREAD expects the day of the month, we're giving it the day of the week instead. This complicates things, but also means that there are fewer input values and we don't need to add /01 to the end of the date string.
DTREAD outputs W and D.
W is the weekday, and D is the day-of-the-week of the Wth day of the month.
(So, if you input 7 as the weekday, D will be 7 and W will be whatever day-of-the-week the 7th day of the month is)
The expression (5-W+D*2)MOD 7 is used to get the 1st occurrence of the input weekday, as a 0-indexed day of the month. (I figured this one out mostly through trial and error)
After that, the program just adds WEEK*7.

I really wish there were separate words for "day of the week" and "day of the month".

C# (Visual C# Interactive Compiler), 59 bytes
(y,m,d,w)=>1+(d-(int)new DateTime(y,m,1).DayOfWeek+7)%7+7*w

Try it online!
-27 bytes thanks to @EmbodimentOfIgnorance!
Less golfed code...
// y: year
// m: month
// d: day of week (0 is Sunday)
// w: week number (0 based)
(y,m,d,w)=>
  // start on the first day of the month
  1+
  // determine the number of days to
  // the first occurrence of the
  // requested weekday
  (d-(int)new DateTime(y,m,1).DayOfWeek+7)%7+
  // add the number of requested weeks
  7*w

The return value is an integer for the day of the month of the requested date.

If you only return the day of the month, which is allowed, you can golf this down to 59 bytes

Thanks for the tip again - (that's 2x today ;) I will update my answers.

MATL, 28 27 bytes
'1 'ihYO31:q+t8XOi=!A)i)1XO

This uses three inputs:

String with month and year: 'March 2019'
String with three letters, first capitalized, indicating day of the week: 'Sat'
Number: 2.

Output is a string with day, year and month separated with dashes: 09-Mar-2019.
Try it online!
Explanation
Consider inputs 'March 2019', 'Sat', 2.
'1 '    % Push this string
        % STACK: '1 '
ih      % Input string: month and year. Concatenate
        % STACK: '1 March 2019'
YO      % Convert to serial date number
        % STACK: 737485
31:q+   % Create vector [0 1 2 ... 30] and add element-wise
        % STACK: [737485 737486 737487 ... 737515]
t8XO    % Duplicate. Convert to date format 'ddd': day of week in three letters. Gives
        % a 2D char array
        % STACK: [737485 737486 737487 ... 737515], ['Fri'; 'Sat'; 'Sun'; ...; 'Sun']
i=      % Input string: day of week in three letters. Compare element-wise with broadcast
        % STACK: [737485 737486 737487 ... 737515],
        % [0 0 0; 0 0 0; ...; 1 1 1; 0 0 0; ... 1 1 1; ...]
!A      % True for rows containing only 1
        % STACK: [737485 737486 737487 ... 737515], [0 0 ... 1 ... 0 ... 1 ...]
)       % Index: uses the second vector as a mask into the first
        % STACK: [737486 737493 737500 737507 737514]
i)      % Input number. Index
        % STACK: 737493
1XO     % Convert to date format 'dd-mmm-yyyy'. Implicit display
        % STACK: '09-Mar-2019'

R, 72 69 bytes
function(y,m,d,n,D=as.Date(paste0(y,-m,-1))+0:31)D[weekdays(D)==d][n]

Try it online!
Taking input as :

Year number
Month number (1-12)
Weekday string in the current locale (TIO requires english name with capital letter)
Ordinal number (1-indexed)

Python 3, 92 82 bytes
82 bytes thanks to @Jo King
lambda y,m,d,w:z(y,m)[w-(z(y,m)[0][d]>0)][d]
from calendar import*
z=monthcalendar

Try it online!
Original version, 92 bytes
from calendar import*
def f(y,m,d,w):
 x=monthcalendar(y,m)
 if x[0][d]:w-=1
 return x[w][d]

Try it online!
Takes the year as an integer, month as a 1-indexed integer, day of the week as a 0-index integer where Monday is 0 and Sunday is 6, and week of the month as a 1-indexed integer.
How it works:
# import monthcalendar
from calendar import*
# function with 4 inputs
def f(y,m,d,w):
 # get a 2-D array representing the specified month
 # each week is represented by an array
 # and the value of each element is its date of the month
 # Monday is the 0th element of each week, Sunday is the 6th element
 # days of the first week of the month before the 1st are 0s
 x=monthcalendar(y,m)
 # if the first week of the month includes the desired day of week
 # convert the week of month to 0-index so that it takes into account the first week
 if x[0][d]:w-=1
 # return the weekday of the week number specified
 return x[w][d]

JavaScript (ES6), 49 48 bytes

f=
(a,d,n)=>(d+6-new Date(...a,7).getDay())%7+n*7-6

Year: <input id=y type=number value=2019>
Month: <select id=m><option value=0>Jan<option value=1>Feb<option value=2>Mar<option value=3>Apr<option value=4>May<option value=5>Jun<option value=6>Jul<option value=7>Aug<option value=8>Sep<option value=9>Oct<option value=10>Nov<option value=11>Dec</select>
Day: <select id=d><option value=0>Sun<option value=1>Mon<option value=2>Tue<option value=3>Wed<option value=4>Thu<option value=5>Fri<option value=6>Sat</select>
Count: <input id=n type=number value=1 min=1 max=5>

Takes parameters as f([year, month], day, number). Month and day of week (starting on Sunday) are zero-indexed. Edit: Saved 1 byte thanks to @Shaggy.

Is the day of week in the format Sunday-Saturday or Monday-Sunday?

@EmbodimentofIgnorance Sorry, I knew I had forgotten something. (The snippet now uses select to make it easier.)

@EmbodimentofIgnorance, Sunday is 0 in JS.

Oh. I didn't know that, I'm not that familiar with Javascript.

48 bytes

Groovy, 46 bytes
{y,m,d,w->r=new Date(y,m,7*w)
r-(r.day+7-d)%7}

Try it online!
Input as years since 1900, 0-indexed month, 0-indexed day (Sunday being 0) and week number

Red, 64 60 bytes
func[y m d n][a: to-date[1 m y]d - a/10 - 7 % 7 +(n * 7)+ a]

Try it online!
Takes the year, the month and the weekday as numbers, 1-indexed, Monday is the first day of the week.

huh, to-date is a thing. maybe this would be useful in the christmase eve format challenge

@ASCII-only We used now for that challenge

yeah, but i was thinking of alternative methods (namely, the <repeat " Eve" date2-date1 times> method iirc)

@ASCII-only >> 25-Dec-2019 - 1-1-2019 == 358

Scala, 86 bytes
(y,m,d,w)=>{var r=new java.util.Date(y,m,7*w)
r.setDate(r.getDate-(r.getDay+7-d)%7)
r}

Try it online!

APL (Dyalog Unicode), 36 28 bytesSBCS
Full program. Prompts for [year,month] (January is 1), then for day (Sunday is 0), then for n (first is 1).
¯1⎕DT⎕⊃d/⍨⎕=7|d←(⍳31)+1⎕DT⊂⎕

⎕ prompt console for [year,month] numbers
1⎕DT⊂ days since 1899-12-31 of the 0th of that month
(⍳31)+ add the integers 1…31 to that
d← store in d (for day numbers)
7| division remainder when dividing by 7 (day-of-week with Sunday being 0 due to good epoch)
⎕= prompt console for day-of-week number and get mask where equal the day-of-week numbers
d/⍨ filter d with that mask
⎕⊃ prompt console for n and use that to pick from the list of day numbers
¯1⎕DT datetime stamp (has trailing zeros for hours, minutes, seconds, milliseconds)

TSQL, 106 bytes
DECLARE @ datetime='2019',@m int=3,@w char(2)='saturday',@p int=2

SELECT dateadd(wk,datediff(d,x,dateadd(m,@m-1,@)-1)/7,x)+@p*7FROM(SELECT
charindex(@w,' tuwethfrsasu')/2x)x

Output:
2019-03-09 00:00:00.000

Try it out

Kotlin, 131 84 bytes
47 bytes thanks to ASCII-only's code and comment.
Input: year, monthNumber, weekdayNumber, weekNumber
All integers 1 to maximum on single line. Week day number is Sunday of 1 to Saturday of 7. The main program makes the year lose 1900 for Date class and month and weekday are shifted to start with zero instead of one before calling the lambda. You can enter your arguments in the input text box to try your own dates.
Output: a Date class instance. The main program displays the result like: Sat Mar 09 00:00:00 UTC 2019.
There is an expanded version with comments explaining the code for those wishing to learn more.
{y,m,d,w->val r=java.util.Date(y,m,7*w)
r.setDate(r.getDate()-(r.getDay()+7-d)%7)
r}

Try it online!

74 - uses same method as Scala and Groovy answers

Fixed, 84

No need for the import command anymore so that's not a problem :P

Go, 177 bytes
import."time"
func f(y,m,d string,n int)string{t,_:=Parse("20061",y+m)
D:=Hour*24
for t.Weekday().String()!=d{t=t.Add(D)}
for i:=1;i<n;i++{t=t.Add(D*7)}
return t.Format("Jan2")}

Attempt This Online!
Outputs the month and the day as Jan2.
Explanation
import."time"
func f(y,m,d string,n int)string{
t,_:=Parse("20061",y+m)

Parse the date to get the first of the month. time.Date() is not feasible here because of the need for a location, which we don't need here.
D:=Hour*24

A time constant alias because Go doesn't provide time constants higher than Hour.
for t.Weekday().String()!=d{t=t.Add(D)}

Increment the day until we get the desired day.
for i:=1;i<n;i++{t=t.Add(D*7)}

Add weeks until we get the desired n-th day of the month.
return t.Format("Jan2")}

Return a string of the date, formatted as a 3-letter month and the date.

authors: Кирилл Малышев