text:
When will Brexit happen?
Well, Brexit happened. And Sky News, being the geniuses they are, have decided to create a countdown on the side of a bus.

Your job is to do something similar. The UK leaves the the EU on 31st of March 2019 and you have to create a digital countdown for this that changes every second (with a 0.05 second deviation allowed).
Input
Your program should take absolutely no input. It is banned!
Output
It should output the time until Brexit in the format ddd:hh:mm:ss. Leading and trailing newlines are allowed but the display should stay in the same place each time. It should look as though it is actually decreasing in place. As pointed out by @AnthonyPham this doesn't mean printing enough newlines to "clear" the screen, this means that you must actually clear the screen.
An output like this isn't allowed:
100:20:10:05
100:20:10:04

Neither is this
100:20:10:05
*A thousand newlines*
100:20:10:04

as they're on more than one line.
You don't have to worry about after Brexit. Your program only has to work up to 31/3/2019
Rules

Standard loopholes are disallowed
This is code-golf so shortest code in bytes wins.
Error messages (although I can't think how) are disallowed
The code should be able to be run in 2 years time (when the UK leaves the EU) and should display the actual time and not start from 730 again (see below)

Countdown rule
The countdown should not be hard-coded and should be able to run at any time before Brexit finishes and still produce the correct result. When a new day is begun the hour should follow the below format
712:00:00:01
712:00:00:00
711:23:59:59

Let me say again, the date Brexit finishes is 31/3/2019 at midnight for convenience (31:3:19 00:00:00 or 31:3:2019 00:00:00 or any other format you want)
NB: I think I have everything but I didn't post this in the Sandbox, otherwise the timing could have been off. Feel free to post any suggestions for improvements because it isn't perfect.

Can I run it every millisecond but still give the appearance of updating every second? This is just to make my code shorter.

@DavidArchibald it only says that the display has to change every second. It's just that most answers will find it easier to run every second.

ahh. Well I have to put 1000 if I want it to change once a second. Thanks

Are leading zeros required?

@Shaggy yes leading 0s are required.

does the text theoretically being shown count? my console clears the screen too fast for it to be seen, but it definitely does get printed.

@ConnorLSW I've run your program and can make out the countdown so it should be fine.

Half a second before Brexit, what should be the output? Are both 00:00:00:00 and 00:00:00:01 acceptable?

@EricDuminil It should be 000:00:00:01 because it still (theoretically) is still in the delay. Although in reality the world will explode at that very instant so we don't need to worry about that.

Midnight what timezone: UCT or GMT? Do we have to take that into account?

JavaScript, 134 129 113 bytes

setInterval("d=-new Date;document.body.innerHTML=`<pre>${d/864e5+17986|0}:`+new Date(d).toJSON().slice(11,19)",1)

Edit: Saved 2 bytes thanks to @Shaggy. Saved 11 bytes thanks to @l4m2.

Why not use <a id=0>? Or something like that?

Or even document.body.innerHTML instead of o.innerHTML

I wanted it to be monospace to ensure that the display stays in the same place, but I guess I could save a byte and use <tt>.

You could save 2 bytes by running the code every millisecond (or 2, or 3 ...).

setInterval("d=-new Date;document.body.innerHTML=(d/864e5+17986|0)+':'+new Date(d).toJSON().slice(11,19)",1)

PowerShell, 70 63 55 53 Bytes
Excluded double quotes, easy -2 thanks to @Joey
for(){cls;(date 31Mar19)-(date)|% T* ddd\:hh\:mm\:ss}

Running this with sleep adds 8 bytes, but the input is mostly invisible if it is run without them, version (63 bytes) with sleep:
for(){cls;(date 31/3/19)-(date)|% T* ddd\:hh\:mm\:ss;sleep 1}

for() is an infinite loop, and within that loop..
cls to clear the screen,
get 31/3/19 as a DateTime object, and - the current date from it, to give the time remaining, then .ToString() (|% T*) that with the correct format.
this will display negative time after brexit.

This is also sensitive to local date format. Though the UK dd/m/yy format is appropriate, imo, it won't run as-is on US machines. I'm curious how the T* works. I'm not familiar with that.

@JoelCoehoorn It's a nice trick, the % foreach actually picks up the ToString object, and will accept the next string as its argument. regarding the datetime format why won't it run on US machines? I thought the dd etc were culture-insensitive.

It's trying to find month #31 on my machine. Works fine if I change it to 3/31/19. Would also work 2019-03-31 anywhere, but that costs you a few bytes.

@JoelCoehoorn ah right - sorry I was thinking of the output, Updated to 31Mar19 instead of 31/3/19 which should hopefully fix it?

I think I get it for T*. * is a wild card that would match the first function or property starting with T, which happens to be ToString() ?

@JoelCoehoorn Yep! there's a nice writeup here which should explain it in detail.

I was playing with this, and I got the carriage-return (\r) trick used by others to work, but it's back at 70 bytes: for(){[Console]::Write("``r{0:ddd\:hh\:mm\:ss}",(date 3/31/19)-(date))}

@JoelCoehoorn one of the issues is that powershell sticks newlines in on all 'default' outputs, so the \r only resets that line, I don't see a way of getting it shorter without using [Console]::Write or Write-Host -NoNewLine etc.

But cls;;sleep 1 is 12 bytes on it's own, which Write() would obviate if there were a shorter way to call it. Of course, skipping the ;sleep 1 helps.

@JoelCoehoorn I don't think you'll beat the 4 bytes of cls; - "r"` on its own is the same length, and implicit output is free compared to the minimums required for a single-line write.

You can lose the quotes around the format string, as command argument parsing applies.

Python 3.6, 146 bytes
from datetime import*
x=datetime
while 1:d=x(2019,3,31)-x.now();s=d.seconds;a=s%3600;print(end=f"\r{d.days:03}:{s//3600:02}:{a//60:02}:{s%60:02}")

same bytecount: while 1:d=x(2019,3,31)-x.now();h,s=divmod(d.seconds,3600);print(end=f"\r{d.days:03}:{h:02}:{s//60:02}:{s%60:02}")

Excel VBA, 91 84 82 bytes
Saved 7 bytes thanks to JoeMalpass pointing out that Excel sees dates as numbers.
Saved 2 bytes thanks to JoeMalpass
Sub b()
Do
t=CDec(43555-Now)
Cells(1,1)=Int(t) &Format(t,":hh:mm:ss")
Loop
End Sub

Output is to cell A1 in the active Excel sheet.

-6 bytes by swapping ("2019-3-31") with (43555). When I try running this in Excel however, it freezes after about 5-6 seconds...

@JoeMalpass Thanks, that's a good point. It looks up after a few seconds for me, too, because it's calculating way faster than 1/second. Adding delays, though, adds bytes and the OP doesn't say it has to be able to continuously count down from now until Brexit without setting anything on fire.

Apparently Now works without the () too...

C#, 173 172 156 150 127 bytes
using System;class P{static void Main(){for(;;)Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:d\\:hh\\:mm\\:ss}  ");}}

Saved 16 bytes thanks to @Bob
Saved 6 bytes thanks to @Søren D. Ptæus
Formatted version:
using System;

class P
{
    static void Main()
    {
        for (;;)
            Console.Write($"\r{new DateTime(2019, 3, 31) - DateTime.Now:d\\:hh\\:mm\\:ss}  ");
    }
}

Can you do (TimeSpan)0? On phone, can't test right now. You can still drop the clear as the carriage return takes care of it: it puts the cursor back at the start of the line.

Thought: relying on the CR might fail if the length changes (less than 100 days). Fix: add two extra spaces on end.

@Bob I forgot to remove the Clear! Silly me. And no can't convert int to TimeSpan I'd already tried that one.

You can save 6 bytes writing (t = new DateTime(2019, 3, 31) - DateTime.Now).Ticks > 0.

@SørenD.Ptæus Good idea didn't even think of that one

AHK, 145 Bytes
This is not the shortest answer but the result gives a very nice feeling of doom, I think. I originally tried to send the keystrokes Ctrl+A followed by DEL and then whatever the time was but the refresh rate was too slow and it would destroy whatever environment you were in. Instead, then, I went with the GUI. It turned out to take less bytes to completely destroy the window and recreate it than it did to update the control over and over so I went with that. It's a nice effect.
Loop{
s=20190331000000
s-=A_Now,S
d:=t:=20000101000000
t+=s,S
d-=t,D
d*=-1
FormatTime f,%t%,:HH:mm:ss
GUI,Destroy
GUI,Add,Text,,%d%%f%
GUI,Show
}

JavaScript ES5, 320 319 316 305 295 284 bytes

setInterval(function(){a=Math,b=a.floor,c=console,d=Date,e="00",f=new d(2019,2,31),g=a.abs(f-new d)/1e3,h=b(g/86400);g-=86400*h;var i=b(g/3600)%24;g-=3600*i;var j=b(g/60)%60;g-=60*j,c.clear(),c.log((e+h).slice(-3)+":"+(e+i).slice(-2)+":"+(e+j).slice(-2)+":"+(e+a.ceil(g)).slice(-2))})

Thanks to @Fels for referencing Math, @dgrcode for referencing console
Un-golfed

setInterval(function() {

  var math = Math, floor = math.floor, c = console, d = Date;

  var leadings = "00";

  // set our brexit date
  var brexit = new d(2019, 2, 31);

  // get total seconds between brexit and now
  var diff = math.abs(brexit - new d()) / 1000;

  // calculate (and subtract) whole days
  var days = floor(diff / 86400);
  diff -= days * 86400;

  // calculate (and subtract) whole hours
  var hours = floor(diff / 3600) % 24;
  diff -= hours * 3600;

  // calculate (and subtract) whole minutes
  var minutes = floor(diff / 60) % 60;
  diff -= minutes * 60;

  // what's left is seconds

  // clear the console (because OP said it must print in the same place)
  c.clear();

  // log the countdown, add the leadings and slice to get the correct leadings 0's
  c.log((leadings + days).slice(-3) + ":" + (leadings + hours).slice(-2) + ":" + (leadings + minutes).slice(-2) + ":" + (leadings + math.ceil(diff)).slice(-2));

});

You can save a bit my renaming Math like g=Math;

It looks like aliasing Math can still save 2 bytes, right?

You can save a bit more by using arrow functions and getting rid of var. Also, pick shorter names for variables, like h instead of hours, or m instead of minutes. Probably doing c=console will save a couple more bytes. Also 1e3 instead of 1000

PHP, 84 bytes
for(;$c=DateTime;)echo(new$c('@1553990400'))->diff(new$c)->format("\r%a:%H:%I:%S ");

Fairly straightforward. 1553990400 is the timestamp for 31-3-2019 00:00:00 in UTC. It loops infinitely, using DateTime->diff()->format() to output how much time is left. After Brexit has happened, it will start counting up from 0.
Commented / more readable version:
// Infinite loop, assign DateTime (as a string) to $class
for (; $class = DateTime;) {
    echo (new $class('@1553990400')) // Create a new DateTime object for the brexit date/time.
            ->diff(new $class) // Caulculate the difference to the current date/time.
            ->format("\r%a:%H:%I:%S "); // Format it according to the specification, starting with a \r character to move to the start of the line and overwrite the previous output.
}

New here, and about to post my own answer. A few things: 1. Are we allowed to omit the <? tag here? 2. I think your parenthesis are wrong, right now you're calling ->diff on the echo rather than the DateTime object. 3. echo works without parenthesis anyway. 4. Even after fixing this, this doesn't work for me, but I'm new to golfing so that could just be me being an idiot.

2 more things, without flushing, wouldn't this just run forever and never display anything? And if not, I'm pretty sure this would keep building a massive string rather than refreshing the timer as per the questions requirements

Just run it and see, it works fine, as per the requirements. There is no need to flush when running PHP from the command line. There's a \r at the beginning of the string to move the cursor to the start of the line, it keeps overwriting the previously outputted time. It's the same method that many other answers here are using.

Sorry, I missed your first comment. Yes, we are allowed to omit the opening tags, unless there is a requirement to supply a full program. The parenthesis are just fine the way they are. Yes, echo works without it, but calling diff on the DateTime object does not work without them. It runs fine here, what PHP version are you using and how are you running the program? :)

You might want to check out some posts here: https://codegolf.meta.stackexchange.com/questions/tagged/php

That just about covers it, thanks for the insight :)

I have added a more readable version of the code with some explanation. Perhaps that clear things up a bit =)

@SworrubWehttam omitting the <? is possible by use of php -r which implicitly adds it avywyay. Since command line flags are counted as a different language it should be added to the header: PHP + `-r`  or something similar. Hope that helps!

CJam, 69 62 59 57 bytes
Saved 7 bytes by converting to time format differently
Saved 3 bytes thanks to Martin Ender's suggestions
Saved 2 bytes by using a carriage return instead of backspaces
{15539904e5esm1e3/{60md\}2*24md\]W%{sYTe[}%':*CTe[oDco1}g

Can't be run on TIO for obvious reasons.
It rewrites the display constantly in an infinite loop so the text kind of flashes in and out (at least in my console), although it only actually updates the time once per second.
This 70-byte version only prints once per second:
{15539904e5es:Xm1e3/{60md\}2*24md\]W%{sYTe[}%':*CTe[oDco{esXm1e3<}g1}g

Explanation
{                           e# Begin a while loop
  15539904e5                e#  The timestamp on which Brexit will occur
  es                        e#  The current timestamp
  m                         e#  Subtract
  1e3/                      e#  Integer divide by 1000, converting to seconds from ms
  {                         e#  Run this block twice
   60md                     e#   Divmod by 60
   \                        e#   Swap top elements
  }2*                       e#  (end of block)
                            e#    This block divmods the timestamp by 60, resulting in
                            e#    the remaining minutes and seconds. Then the minutes get
                            e#    divmod-ed by 60, to get hours and minutes remaining
  24md\                     e#  Divmod hours remaining by 24 and swap top elements, to get
                            e#    the hours left and days left.
  ]                         e#  Wrap the entire stack in an array
  W%                        e#  Reverse it since it's currently in the wrong order
  {                         e#  Apply this block to each element of the array
   s                        e#   Cast to string (array of digit characters)
   YTe[                     e#   Pad to length 2 by adding 0s to the left
  }%                        e#  (end of map block)
  ':*                       e#  Join with colons
  CTe[                      e#  Pad to length 12 by adding 0s to the left, dealing with the
                            e#    special case of the day being 3 digits.
  o                         e#  Pop and print the resulting string, which is the time
  Dco                       e#  Print a carriage return, moving the cursor back to the start
  1                         e#  Push 1
}g                          e# Pop 1, if it's true, repeat (infinite loop)

Can't test right now, but you can probably replace Ab with s, and save a byte by doing 1e3/ first and then divide in the opposite order 60md\60md\24md\]W%.

@MartinEnder Yep, they both work. Thanks

Oh and {60md\}2* saves another.

C#6, 149 bytes
Thanks to Bob for saving 57 bytes!
using System;class P{static void Main(){DateTime a,x=new DateTime(2019,3,31);while((a=DateTime.Now)<x)Console.Write($"\r{x-a:ddd\\:hh\\:mm\\:ss}");}}

Ungolfed program:
using System;

class P
{
    static void Main()
    {
        DateTime a,
                x = new DateTime(2019, 3, 31);
        while ( (a = DateTime.Now) < x)
            Console.Write($"\r{x-a:ddd\\:hh\\:mm\\:ss}");
    }
}

C#, 210 206 159 bytes
Thanks to Bob for saving another 47 bytes!
Thanks to Martin Smith for saving 4 bytes!
using System;class P{static void Main(){DateTime a,x=new DateTime(2019,3,31);while((a=DateTime.Now)<x)Console.Write("\r"+(x-a).ToString(@"ddd\:hh\:mm\:ss"));}}

Ungolfed program:
using System;

class P
{
    static void Main()
    {
        DateTime a,
                x = new DateTime(2019, 3, 31);
        while ( (a = DateTime.Now) < x)
            Console.Write("\r" + (x - a).ToString(@"ddd\:hh\:mm\:ss"));
    }
}

new DateTime(2019,3,31) is shorter.

You can save a bit by doing namespace System{} instead of using System; (which lets you remove the System. on the sleep call).

You can also remove the Console.Clear and instead prepend "\r" to the string, e.g. "\r"+(x-a)...

More improvements: (x-a).ToString(@"d\:hh\:mm\:ss") is equivalent to  String.Format("\r{0:d\\:hh\\:mm\\:ss}",x-a) is equivalent to $@"{x-a:d\:hh\:mm\:ss}" (shorter, interpolated string in C# 6.0). If you do that, you can then further shorten the full "\r"+$@"{x-a:d\:hh\:mm\:ss}" into $"\r{x-a:d\\:hh\\:mm\\:ss}".

@Bob The OP states that you must clear the screen.

@TheLethalCoder I took that as simply not allowing a "fake" multi-newline approach. A carriage return still overwrites the only thing on the screen. At least one other answer also uses this approach. Also can remove the sleep as it's only important that the display changes once per second, with non-changing updates allowed (see question comments). edit: actually, question comments also explicitly allow the CR...

@Bob Sorry I read your suggestion as a new line, my mistake. But yeah the sleep can be removed

@Bob I used your interpolation suggestion in my answer, it works well :)

I think you can save bytes by using a for loop and declaring the variables in that, not sure though.

I saved 24 more (125 total) by not caring what happens after Brexit, tightening up the loop, and using the format overload for Console.Write() rather than declaring variables. I was starting from SLC's answer and couldn't edit, so I posted it to my own answer. But it's the same basic \r trick that makes it possible, which I wouldn't have found on my own

Python 3.5 (118 Bytes)
import datetime as d,os
d=d.datetime
while 1:os.system("cls");e=str(d(2019,3,31)-d.today());print(e[:3]+':'+e[-15:-7])

Ruby (83 bytes)
loop{h=431664-Time.now.to_r/3600;$><<['%02d']*4*?:%[h/24,h%24,h%1*60,h*3600%60]+?\r}

Ungolfed
loop do
  seconds = 1553990400 - Time.now.to_r

  print (["%02d"] * 4).join(':') % [
    seconds / 24 / 60 / 60     ,
    seconds      / 60 / 60 % 24,
    seconds           / 60 % 60,
    seconds                % 60,
  ] + "\r"
end

Basically one of the Python submissions, with some improvements. We just emit an "\r" to go beginning of the string before re-rendering. And for the string format of "%03d:%02d:%02d:%02d", we really don't care about the width on the first specifier… so we can just do "%02d"*4, and emit a backspace and a space to clear the extra unnecessary colon.
Also, I found a two-character shorter print: $><<. $> is a shorthand global for $defout, which is the output stream for print and printf and defaults to STDOUT. IO#<< writes the right hand side of it to the stream. How is that two characters shorter? Well, I can now omit the space that led before the parenthesis wrapping the format string.
At this point I genuinely think there is no possible way to shorten this program further in Ruby.
Edit: I was wrong. Instead of the first Time.new(2019,3,31), we can just use the raw UNIX time: 1553990400.
Edit 2: I've tried playing around with factoring out minutes, and dividing the UNIX timestamp by that constant, but it doesn't actually wind up saving any bytes. :(
Edit 3: Turns out caching h=3600 actually hurt me by two bytes. Whoops.
Edit 4: Saved 3 bytes thanks to @EricDuminill. He used floats, but rationals work without loss of precision!
Edit 5: Array#* as an alias for Array#join, with the Ruby ?-syntax for individual characters!

Working with hours instead of seconds seems to save 3 bytes : loop{h=431664-Time.now.to_f/3600;$><<('%02d:'*4+"\b \r")%[h/24,h%24,h%1*60,3600*h%60]} Seconds might be off by 1 though, due to rounding.

Thanks! Tied with PHP now. :) I used to_r instead of to_f to preserve precision.

You're welcome. This clock might still be 1s early though, even with .to_r instead of .to_f

@StephenTouset You can move +"\r" to the right of the array. This enables you to use ['%02d']*4*?: instead of '%02d:'*4+"\b " so you can lose the parentheses, which nets you one byte. Save yet another byte by writing +?\r instead of +"\r".

Excellent discovery!

C, 104 bytes
main(x){for(;x=1553990400-time(0);)printf("\n%03d:%02d:%02d:%02d\e[1A",x/86400,x/3600%24,x/60%60,x%60);}

Breakdown
main(x){
    for(;x=1553990400-time(0);)             // Seconds remaining
        printf("\n%03d:%02d:%02d:%02d\e[1A",// Move cursor and print:
            x/86400,                        // Days
            x/3600%24,                      // Hours
            x/60%60,                        // Minutes
            x%60);                          // Seconds
    puts("Now we can stop talking about it forever."); // Wishful thinking
}

Relies on time returning number of seconds since 01/01/1970, which is the case for me (using Clang/GCC on macOS) and should be the case for most UNIX stuff.
Uses bash terminal escape sequences to move the cursor around (<esc>[1A moves the cursor up 1 line). It would be nicer to be able to simply use \r, but printf won't flush until it sees a newline, and flushing it manually takes a lot more.
Probably the most CPU intensive countdown I've ever seen. Runs in a hot loop to make sure it's always as accurate as can be. If run after the deadline, it will produce some pretty weird stuff (negatives everywhere!)

@TobySpeight sure, corrected. I think of them as bash because I always use this reference page: http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html

Are there any rules for the form of main in C? In C90: omitting return from main causes UB in case the caller (OS) will use the return value. In standard C: main(x) is not a valid form of main, implicit int has been removed from the language. I believe the minimal, safe version is int main(){}.

@Lundin in code golf, languages are defined by their implementation (i.e. if you can find a publicly available compiler which compiles the code how you want, you can do it, but if it needs non-standard flags setting, those flags count towards your bytecount). You're correct that this is nowhere near standards compliant (as well as the things you've noticed, there's implicitly defined functions due to no imports and the reliance on time returning a number of seconds since 01/01/1970). Take a look at meta for the (rather disperse) rules people follow around here.

Part of the fun of code golf challenges is discovering bizarre language hacks and obsolete features!

C#, 128 127 Bytes
using System;class P{static void Main(){for(;;)Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}");}}

Ungolfed code:
using System;
class P
{
    static void Main()
    {
        for(;;)
            Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}");
    }
}

I would not have figured out the \r trick without help from the other C# answers here.
For anyone looking for further improvement, you can also put the Write() expression inside the for loop. Seems like I should be able to save a byte somehow here, because that saves me the semi-colon for that statement, but it works out to the same number because you can't have a fully empty body:
using System;class P{static void Main(){for(;;Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}"));}}

Welcome to PPCG!

You can still save a single character by using an interpolated string ;) Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}");

Well played, I tried to find a way to have a while (true) loop in the shortest possible code! I'll remember that trick. You may need to add a couple of spaces like I did though to your write otherwise when the days goes from 3 digits to 2 digits, it won't overwrite the last character of your time string and you'll get a weird output

You can save a byte by using an interpolated string like in my answer. Your format of dddpads the zeroes, looks better than the two spaces method nice.

Updated for the interpolated string.

Bash + GNU date, 128 bytes
2 bytes shaved off thanks to @muru, and 2 off earlier thanks to @This Guy.
C=:%02d;while sleep 1;do D=$[B=3600,A=24*B,1553990400-`date +%s`];printf "%03d$C$C$C\r" $[D/A] $[D%A/B] $[D%A%B/60] $[D%60];done

Ungolfed
DAY=86400
HOUR=3600
while sleep 1 ; do
 DIFF=$[1553990400-`date +%s`]
 printf "%03d:%02d:%02d:%02d\r" \
         $[DIFF/DAY] \
         $[DIFF%DAY/HOUR] \
         $[DIFF%DAY%HOUR/60] \
         $[DIFF%60]
done

Never golfed in Bash before but can you remove the spaces at the while: while[1]?

Fair point, have now given that a try but it yields line 1: [1]: command not found error.  Spaces are mandatory it seems :-(

Assign 3600 to a variable to save 2 bytes? You might also be able to change B=3600;A=86400 to B=3600;A=24*B for another byte?

3600 variable now done, thx.  24*B would need A=$[24*B] so not possible there though

that's a shame. I'm used to python so...

C=:%02d;printf "%03d$C$C$C\r" to save a byte? And move the assignments to A and B in the arithmetic context: D=$[B=3600,A=24*B,1553990400-`date +%s`] to save another?

JavaScript+HTML, 136+7=143 bytes
setInterval("d=1553990400-new Date/1e3|0;w.innerText=[60,60,24,999].map(z=>(q='00'+d%z,d=d/z|0,q.slice(z<61?-2:-3))).reverse().join`:`")

<a id=w

Does the score make it a... love byte?

C#, 142 bytes
using System;class P{static void Main(){a:Console.Write($"\r{(new DateTime(2019,3,31)-DateTime.Now).ToString("d\\:h\\:mm\\:ss  ")}");goto a;}}

Ungolfed program:
using System;
class P
{
    static void Main()
    {
        a: Console.Write($"\r{(new DateTime(2019, 3, 31) - DateTime.Now).ToString(@"d\:h\:mm\:ss  ")}"); goto a;
    }
}

This won't stop printing when it hits brexit, not sure if that's a problem

@TheLethalCoder That's legal. The instructions specifically state the code only has to work until 31/3/2019, and what happens after that doesn't matter. If you can save bytes by having weird output or even exceptions after that date, then more power to you.

Also: I suspect it will be possible to get this even shorting by skipping the ToString() bytes and instead build the formatting into the Write() method, or maybe an interpolated string

Okay... it's definitely possible. I have it down to 127 bytes. I'm appending it below your original, so you still get credit for the basic goto idea.

My edit go wiped :( Guess I'll have to post my own answer.

Have it even shorter now without the goto, so I've earned my own answer anyway.

Always new goto was a hidden gem of good programming

@SLC I don't think code gold is good programming, just clever haha

MATL, 45 bytes
737515`tZ'-tkwy-':HH:MM:SS'XOw'%03d'YDwYcDXxT

TIO apparently doesn't support clearing the output, but thankfully MATL Online does!
At 2 bytes more, a bit more CPU-friendly version that does a pause (sleep) every second:
737515`tZ'-tkwy-':HH:MM:SS'XOw'%03d'YDwYcDT&XxT

Try this on MATL Online
737515 is "31st of March 2019" represented MATLAB's default epoch format - number of days from January 0, 0000, optionally including a fractional part to represent the time of day. (I tried to shorten this by calculating it somehow, but its only factors are 5 and another six digit number (147503), and I couldn't figure out a way to do it in less than 6 bytes.)
`    % start do-while loop
tZ`- % duplicate Brexit date, get current date (& time), subtract
tk   % duplicate the difference, get the floor of it (this gives number of days left)
w    % switch stack to bring unfloored difference to top
y    % duplicate the floored value on top of that
-    % subtract to get fractional part representing time
':HH:MM:SS'XO % get a datestr (date string) formatted this way
w    % switch to bring number of days back on top
'%03d'YD      % format that to take 3 places, with 0 padding if needed
wYc  % switch to bring time string back on top, concatenate date and time
D    % display the concatenated result!
T&Xx % clear screen after a 1 second pause (the pause is optional, without it the call is `Xx`)
T    % push True on stack to continue loop

Phooey, 101 bytes
-1(>"\e[H"~t/1000;1554004800@%60>&/60@%60>&/60@%24>&/24@@/100{$i}&/10{$i}&$i<(_1":"@/10{$i}&$i<)"
"#1)
\e represents the ESC nonprintable, hex 0x1B. Requires your average Linux terminal (and I believe it may work on Windows with a recent command prompt). Phooey does not support C-style escapes, the bytes must be verbatim or you must use $cN.
-1            # set sentinel cell
(             # do {..} while (*cell) (infinite loop)
  >           #   move past our sentinel
  "\e[H"     #   print "clear" ANSI escape code
  ~t          #   get current Unix time in milliseconds
  /1000       #   convert to seconds
  ;1554004800 #   31 Mar 2019 in Unix time - *cell
  @           #   Push a copy
  %60         #   Store seconds in the first cell
  >&          #   Move to the next cell
  /60         #   Convert to minutes
  @           #   Push a copy
  %60         #   Store minutes in the second cell
  >&/60@%24>  #   ya get the point
  &/24        #   get the number of days
  @@          #   begin ugly zero pad code
  /100{$i}    #   if intdiv(days, 100) == 0, print 0
  &/10{$i}    #   repeat for tens place
  &$i         #   print value
  <           #   go to hours place
  (_1         #   do {..} while not -1 (our sentinel)
    ":"       #     print ":"
    @/10{$i}  #     zero pad
    &$i       #     print digit
    <         #     go to prev cell
  )           #   loop till sentinel
  "\n"       #   print new line to flush stdout
  #1          #   wait one second otherwise your terminal will flip out
)             # loop forever
It does fail miserably for dates after Brexit thanks to signed division lul:
-689:0-8:-44:-37

But for dates before Brexit, it is correct.
For a version which sets to zero after Brexit, (at the cost of a memory leak and 9 bytes), here you go:
-1(>"\e[H"~t/1000;1554004800@@&2^{@}&@%60>&/60@%60>&/60@%24>&/24@@/100{$i}&/10{$i}&$i<(_1":"@/10{$i}&$i<)"
"#1)
Specifically, this code uses some fancy math to check for negative.
@@&2^{@}&

(Or *@ to patch the memory leak which pops, multiplies by zero, then pushes)
It uses the pow operator.
Specifically, ^ does this:
    *cell = (int64_t)pow(*cell, op);

So, in equivalent C, this code would be:
int64_t positive_or_zero(int64_t val)
{
    int64_t pwr = (int64_t)pow(2, val);
    if (pwr == 0) {
        val = pwr;
    }
    return val;
}

pow is a function which accepts and returns double, however, we downcast this.
People who are familiar with how double conversion works will know that infinity converts to 0x8000000000000000, and fractions between 0 and 1 will be zero.
Additionally, \${2}^{x}\$ will always be a number greater than 1 if \$x >= 0\$, and a positive fraction less than 1 if \$x < 0\$.
Therefore, if ^ returns 0, we know that \$x\$ is negative. Then, we just push it to the stack.

PHP, 64 bytes
while($d=1553990401-time())echo--$d/86400|0,date(":H:i:s\r",$d);

This will count exactly until 0:00:00:00 and then break/exit. Run with -r.
-2 bytes if I wouldn´t have to print the 0.

RPL, 83 78 bytes
Assuming your HP48, or similar, is setup with correct (UK) time and date, mm/dd date format, and 24h time format:
WHILE 1REPEAT DATE 3.302019DDAYS":"1.1 24TIME HMS- TSTR 15 23SUB + + 1DISP END

I was surprised to be able to save 2 bytes by removing spaces around ":". 1.1 is the shortest valid date, later dumped by SUB.
Be careful with emulators, the time may run faster or slower (or not at all) than your wall clock. With a real HP, you can stop this program by pressing the ON key … or wait for empty batteries.

SlimSharp, 56 bytes
for(;;)P($"{TP("2019-3-31")-T.Now:ddd\\:hh\\:mm\\:ss}");

PHP, 102 95 90 bytes
Saved 7 bytes thanks to @TheLethalCoder & by not factoring
Saved another 5 bytes by concatenating
<? $b=1553990400-time();echo floor($b/$d=86400).date(':H:i:s', $b%$d);header('Refresh:1');

This is my first golf, so I'm probably missing quite a few tricks, but here you are regardless.
As for @chocochaos' PHP answer that would otherwise trump this, I believe it is flawed for reasons I have explained in my comments, but as I'm new here I might be wrong. Or I'm just a newbie :)

You may need a closing tag? (Not sure on that). You only use $a once so might as well use the number in place. I'm not too familiar with php but looks like there could be more improvements

What do you mean by flawed because of reasons stated in the comments? If you mean the comments on their answer, you're the only one who's commented.

@TheLethalCoder No closing tag needed. And nice one!

@ThisGuy Yes, I mean "as shown in my comments", I'll edit to satisfy your pedantry :)

You can save ~7 bytes by using a <?= opening tag and dropping the echo, assigning $b in the place you first use it. Additionally you can save 3 bytes using ^0 instead of floor. It's bitwise or and involves a cast to int, it's the shortest way to cast to int I've seen.

My answer runs just fine :) Also, you might want to read up on some posts here: https://codegolf.meta.stackexchange.com/questions/tagged/php
There's no need for opening tags either. I would really recommend to write your solution in such a way that it would run from the command line, then you would not have to mess around with headers to refresh. That refresh will also cause your solution to "miss" a second once in a while, because it does not take into account the time lost on the request itself.

AWK, 78 bytes
BEGIN{for(;v=1552953600-systime();printf"\r%d:%s",v/86400,strftime("%T",v)){}}

Try it online!
Was longer before I realized I could precalculate the end time. Sometimes it pays to be a bit late to the game and get ideas from others.
FYI, the TIO link doesn't work very well, since it doesn't implement \r properly.

F#, 142 bytes
open System
let f=
 let t=DateTime(2019,3,31)
 while DateTime.Now<=t do Console.Clear();t-DateTime.Now|>printf"%O";Threading.Thread.Sleep 1000

I grew up in Ireland about half a kilometre from the border. Apart from a "Welcome to Fermanagh" sign and the road markings changing you wouldn't know you'd entered another country. Used to cross it twice on the way to school.

c, gcc 114 bytes
main(s){system("clear");if(s=1553900399-time(0)){printf("%d:%d:%d:%d\n",s/86400,s/3600%24,s/60%60,s%60);main(s);}}

Nothing omitted, full program. The program compiles in gcc on Ubuntu. The countdown will not show a long trail of print statements because of the system call to clear and halts when the countdown reaches 0 seconds.
UnGolfed
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>

//Brexit countdown timer
int main(){
  int sec = 1553900400 - time(0);//seconds remaining until Brexit
  if(sec){
    sleep(1);
    system("clear");
    printf("Brexit Countdown\n");
    printf("days Hours Mins Secs\n");
    printf("%d:  %d:    %d:  %d\n",
            sec/86400, sec/3600%24,
            sec/60%60, sec%60);
    main();
  }
}


text:
Straight Line to Text
Input:
2 numbers, x and y.
Output:
Output a text block where x is the width of the text block and y is the height of the text block. Then there will be a straight line going from the top left to the bottom right and to show it, there should be a # where the line should cross.
The # should be generated using the straight line equation, y = mx + c where m is the gradient of the line which can be retrieved through making m as y divided by x. x is the current line index. c is the height intercept and can be found by multiplying the gradient by the x value and adding the y value. So, in short, it would be (y/x) * lineIndex + (y/x * x + h). This would all be rounded to the nearest position in the current line.
Rules:

there can only be 1 # per line
it has to be in the form of a string/whatever the equivalent in your language of choice. This has to be able to cover multiple lines as well.
in text block, after the # there does not need to be more spaces. Just initial ones to offset the #

Examples:
(don't mind the |, they are where the lines start and stop)
Where x is 9 and y is 1:
|        #|

Where x is 1 and y is 5:
|#|
|#|
|#|
|#|
|#|

where x is 9 and y is 5:
| #       |
|   #     |
|    #    |
|      #  |
|        #|

where x is 5 and y is 9:
|#    |
|#    |
| #   |
| #   |
|  #  |
|  #  |
|   # |
|   # |
|    #|

where x is 9 and y is 2:
|   #     |
|        #|

where x is 9 and y is 3:
|  #      |
|     #   |
|        #|

Edit: More detail in the output. Added 3rd rule. Added 5th and 6th example
Edit2: Fixed errors in the given examples (Sorry!). Revised over the output to make it much clearer v. sorry for any confusion :S

How exactly is the position of # per line determined? How would the output for 9 and 2 look?

Editted the main post but the position of the # should be determined by using the straight line equation, y = mx + c. you can find the examples for both 9, 2 and 9, 3 in the post

You have four examples with x=9, and the first one (with y=1) is incompatible with the last three (and I'm not convinced that the second one, with y=5, is compatible with the last two). The instruction "The straight line should use the straight line equation, y = mx + c" is not sufficiently precise.

very sorry about all the confusion, hopefully made it clearer now but do let me know if you find anything unclear so i can make it easy to understand.

Can we choose to output more than 1 # per line if it helps save bytes?

@Kritixis Lithios What do you mean by that? also can you provide what the output would be if it was allowed?

C, 74 70 bytes
Thanks to @Johan du Toit for saving 4 bytes!
i;f(x,y){for(i=y;i--;)printf("%*c\n",(int)round((i-y)/(-1.*y/x)),35);}

Try it online!

Nice! You can save a couple of bytes by using -1.*y/x instead of -y/(float)x

PHP, 66 Bytes
for([,$x,$y]=$argv;$i<$y;)printf("%".round(++$i*$x/$y)."s\n","#");

no need to init $i. 2. save 1 byte (and fix) with printf("%".round(++$i*$x/$y)."s\n","#");

JavaScript (ES6), 77 bytes
x=>y=>[...Array(y).keys()].map(a=>" ".repeat(0|((a+1)/(y/x))+.5)+"#").join`
`

f=x=>y=>[...Array(y).keys()].map(a=>" ".repeat(0|((a+1)/(y/x))+.5)+"#").join`
`

console.log(f(9)(5));

Python, 64 63 bytes
1 byte saved thanks to @Cole
def f(x,y):[print(' '*round((i+1)*x/y-1)+'#')for i in range(y)]

Try it online!

Using a list comprehension is 1 byte shorter (tested in Python 3.5.2): def f(x,y):[print(' '*round((i+1)*x/y-1)+'#')for i in range(y)]

@Cole am  I allowed to return garbage (Nones)? (I thought about yielding the lines, but the output rules seemed to be strictly stdout here)

Does a function implicitly return the result of the list comprehension? I'm pretty sure if you saved it in a file and ran it (which afaik is the standard way; you'd specify if it had to be done in a REPL) it would only print out the desired output. If I'm wrong then by all means ignore my suggestion.

@Cole Sorry, my bad. I guess I was confusing it with lambdas.

Japt, 21 bytes
ÆSpºX+1 /(U/V  r)+"#

Try it online!
Input is in the format of y x. +1 byte for the -R flag.

AWK, 55 44 bytes
 {for(;++j<=$2;)printf"%*c\n",$1/$2*j+0.5,35}

Using hints from @manatwork and the solution from @Steadybox
The previous code is handy as an example of using an sprintf within a printf
{for(;++j<=$2;)printf sprintf("%%%.0fs\n",$1/$2*j),"#"}

Example usage:
awk '{for(;++j<=$2;)printf"%*c\n",$1/$2*j+0.5,35}' <<< "9 3"

Not verified all test cases, but wouldn't {for(;++j<=$2;)printf"%*s\n",$1/$2*j+.5,"#"} do it?

What case did it fail on? And I've never tried using the * with printf in AWK

@manatwork It's good to learn new things :)

source: Stack Exchange

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

sort: votes


text:
Perfect License Plates
Perfect License Plates
Starting a few years ago, I made myself a little game while driving around: checking if nearby license plates are "perfect". It's relatively rare, but exciting when you find one.
To check if a license plate is perfect:

Sum up the characters, with A = 1, B = 2, ...  Z = 26.
Take each consecutive chunk of numerals, and sum them; multiply each of these sums together.

If the values in part 1 and part 2 are equal, congratulations! You've found a perfect license plate!
Examples
License plate: AB3C4F

Digits -> 3 * 4
        = 12
Chars  -> A + B + C + F
        = 1 + 2 + 3 + 6
        = 12
12 == 12 -> perfect!

License plate: G34Z7T

Digits -> (3 + 4) * 7
        = 49
Chars  -> G + Z + T
        = 7 + 26 + 20
        = 53
49 != 53 -> not perfect!

License plate: 10G61

Digits -> (1 + 0) * (6 + 1)
        = 7
Chars  -> G
        = 7
7 == 7 -> perfect!

The Challenge
I used license plates of length 5 and 6 as examples, but this procedure is valid for any plate length. Your challenge is, for a given length N, return the number of perfect license plates of that length. For the purposes of the challenge, a valid license plate is any combination of digits 0-9 and characters A-Z. The plate must contain both a character and a numeral to be considered potentially perfect. For checking purposes, here are the values I got (though I can't be 100% about their correctness, hahaha)
N < 2: 0
N = 2: 18
N = 3: 355
N = 4: 8012

Notes
If somehow it makes the problem simpler in your language, you may output the proportion of perfect license plates for a given N, to at least 2 significant digits.
N < 2: 0
N = 2: 0.0138888...
N = 3: 0.0076088...
N = 4: 0.0047701...

OR, you may output the equivalent value mod 256
N < 2: 0
N = 2: 18
N = 3: 99
N = 4: 76

Shortest wins!

Welcome to the site! I think this is a good challenge, but the additional permitted outputs make it hard to actually score answers. PPCG looks for objective winning criteria, and it's hard to do that when there are so many freedoms; this doesn't only change the output format, this actually changes what you're allowed to output. I would recommend editing out the other options and just making it required to output the number of perfect license plates for N.

I would personally enjoy this challenge a lot more if it was simply validating whether a given licence plate is perfect or not (especially because you don't have definitive numbers for the test cases. It's probably ok though, as long as the potential calculated results are reduced. Not sure about how other people feel though. Nice idea though!

I agree with Mistah Figgins; I feel like this way it's more about finding a pattern, which is still an interesting challenge, but I think it might attract more answers if it were just a validation check. Nice challenge though!

I get N=2:18, N=3:355 and N=4:8012. Anyone else to verify those numbers?

@Dada Paper and pen, my friend. Paper and pen.

@Okx What? I'm not going to check 350 numbers by hand. I'm hoping someone else will implement a solution to this challenge and come up with either my numbers or OP's numbers.

@Dada Same here, also 28% into the N=5 case.

Perhaps @Willbeing should post his implementation. The test cases need to be correct, so it's important to know whether N=4 is currently wrong or not. At this time, it appears that 8012 is probably the correct answer.

@Dada I verify those numbers with my solution as well.

I think that we need a [tag:license-plate] tag ;)

y'all are absolutely right, my test implementation used something, uh, a little nonsensical for pulling out the numerals. I switched to using regex and got your numbers, lemme change it :)
Also with regards to changing the challenge for simply checking if a license plate is perfect, I like that idea. I assume since people are already answering, this is more of a "in the future" kind of suggestion?

@Willbeing I'm pretty sure you can make another challenge, though it might be considered duplicate, but yes, it's more for the future. I still see the other input formats; could you remove those? Nobody has used those yet and it's confusing because you have multiple allowed output formats.

"The plate must contain both a character and a numeral to be considered potentially perfect." - it would have been more pleasant without this special case

I have posted a closely related challenge, hoping that it will draw attention on this wonderful question, as well as simplifying this a bit, only checking for (nearly) perfect licence plate.

Awr, my state can't have perfect plates. All the letters are grouped up. :(

I'll extend the bounty if not claimed by the expiration date. I've spent like 3 hours of my own time trying to mathematically do this, and I'm stumped.

I'm not convinced there is a way to do that doesn't at some point somewhere entail counting or evaluating different factorizations of a number. I would be surprised if there is a constant time method to this. (please someone make a chat room for this challenge)

@carusocomputing I tried my best but came up empty. I sent it to my math teacher and he is empty so far

@carusocomputing I may have gone from Ω(exp(sqrt(n)) to polynomial and be able to compute f(50)=1841915557862572657366350825010485722223950961479824748648944192448338932 in 36 seconds, but I see no path to linear or even constant time. And giving such an answer here would be problematic anyway, as the original question is code-golf. My answer already got a downvote, probably for not being golfy enough.

@carusocomputing I think I might be getting somewhere by observing a pattern with n-simplex numbers and partitioning numbers to get section 1, but it seems to not be getting anywhere close to anything better than O(n^2) or worse.

@christiansievers if there's no improvement on other answers, I'll be giving the bounty to you.

@HyperNeutrino if you edit your answer with this version (as a supplemental answer, not a replacement of your current) and a proof of quadratic time, I'll award the bounty to you instead.

@carusocomputing Alright, thanks. I'll ping you when (if) I'm done. It looks like it might end up turning out to be O(n^3) though... :( I'll finish it and see what it turns out to be.

I'm working on it too, I think my complexity so far is about O(n^4*log(n)) or lower; I get the result for n=100 in about 1 minute.

@aditsu That's about the same speed I get. On reasonable hardware (i5-4590S) my latest GAP program that I talked about above computes f(100)=2428...9962 in 53 seconds, a C++ version of the code needs 31 seconds, saving less than I expected.

Python 3.6, 150 bytes
f=lambda n,t=-1,p=-1,a=0:sum(f(n-1,*((t,c+p*(p>=0),a),((t<0 or t)*(p<0 or p),-1,a-c))[c<0])for c in range(-26,10))if n else 0<(t<0 or t)*(p<0 or p)==a

results:
f(2) = 18
f(3) = 355
f(4) = 8012
f(5) = 218153

Ungolfed version with explanation:
digits=[*range(10)]
letters=[*range(1,27)]

def f(n, dt=-1, dp=-1, lt=0):
    if n:
        for d in digits:
            yield from f(n - 1,
                         dt,
                         d if dp < 0 else dp + d,
                         lt
                         )

        for l in letters:
            yield from f(n - 1,
                         dp if dt < 0 else dt if dp < 0 else dt*dp,
                         -1,
                         lt + l
                         )
    else:
        yield 0 < lt == (dt<0 or dt)*(dp<0 or dp)

The problem boils down to searching a tree in which each level of the tree corresponds to a position in a license plate number and each node has 36 children (10 digits and 26 letters).  The function does a recursive search of the tree, accumulating the values for the digits and letters as it goes.
n is the number of levels to search.
dp accumulates the sum of a group of digits.
dt accumulates the product of the digit sums.
lt accumulates the sum of the letter values.

For dp and dt, a value < 0 indicates it is not initialized.

Golf included, converting the for loops to sums of generators:
sum(f(n-1,
      dt,
      d if dp < 0 else dp + d,
      lt) for d in digits)
+
sum(f(n-1,
      dp if dt<0 else dt if dp<0 else dt*dp,
      -1,
      lt+l) for l in letters)

Then combining the generators.  Encode letters, A to Z, as -1 to -26 and digits as 0 to 9.  So the sum becomes:
sum(f(n-1, *args) for c in range(-26, 10)),

where args is:
((dp if dt<0 else dt if dp<0 else dt*dp, -1, lt-l) if c <0 else
 (dt, d if dp<0 else dp+d, lt))

The rest of the golfing is converting the function to a lambda, shortening variable names, and simplifying expressions.

This is an eloquent solution, what would the runtime be? n*n*log(n) or something similar?

@carusocomputing Thanks.  The solution still generates all possible permutations of the given length, so it has the same complexity as the other solutions.  Something like k**n, where k is the number of symbols in the alphabet (e.g., 10 digits + 26 letters = 36) and n is the number of symbols on a license plate.  Running it for n = 5 requires checking 36^5 = 60,466,176 permutations and took a minute or two (memoization might speed it up, but would cost a lot of bytes ;-)  ).

Dyalog APL, 57 56 bytes
+/(+/0⌈a-9)=×/c*⍨-2-/0,⌈\(+\a×b)×c←2>/0,⍨b←9≥a←↑1↓,⍳⎕⍴36

(assumes ⎕io←0)
a matrix of all valid licence plates (except 00...0) encoded with: 0-9 for digits, 10-35 for letters
b bitmask for where digits occur
c bitmask for the last digit in every group of consecutive digits

Try it online for 1-4 needs more memory for 4, but there are ways around that too!

Python 2, 359 295 bytes
Rather long; this is the trivial solution. I'm confident this is correct, though it does not match the test cases in the challenge. The solutions I'm getting match Dada's answers.
import itertools as i,re as r,string as s
print len([''.join(x)for x in i.product(s.lowercase+s.digits,repeat=input())if(lambda t:r.search('\\D',t)and r.search('\\d',t)and reduce(int.__mul__,[sum(map(int,k))for k in r.split('\\D+',t)if k])==sum([k-96 for k in map(ord,t) if k>96]))(''.join(x))])

-64 bytes thanks to suggestions from @numbermaniac

You can save about three bytes in c(x) and the last line; remove a space between 96 and for; between map(ord,x) and if; and in the last line, between .join(x) and for. I think you can also save even more if you redefine the functions to lambdas.

@numbermaniac Thanks! (64 bytes total)

Python 2, 291 287 276 273 bytes
lambda n:sum(1for x in s.product(y+z,repeat=n)if(lambda p,s=set:reduce(int.__mul__,[sum(map(int,i))for i in re.findall(r"\d+",p)],1)==sum(ord(i)-64for i in p if ord(i)>64)and s(p)&s(y)and s(p)&s(z))(''.join(x)))
import re,itertools as s,string as t
y=t.uppercase
z=t.digits

Try it online!

Results:
0 0
1 0
2 18
3 355
4 8012

Perl 5, 117 bytes
116 bytes of code + -p flag.
$"=",";@F=(A..Z,0..9);map{$r=1;$r*=eval s/./+$&/gr for/\d+/g;$r+=64-ord for/\pl/g;$\+=!$r*/\pl/*/\d/}glob"{@F}"x$_}{

Try it online!
It feels quite suboptimal, but I 'm out of ideas right now.
The code itself is very inefficient as it computes every permutation of a..z,0..9 of length n (it takes roughly 1 second for n=3, ~15 seconds for n=4 and ~7 minutes for n=5).
The algorithm is quite straight forward: for every possible plate of size n (generated with glob"{@F}"x$_ - the glob operator is quite magic), $r*=eval s/./+$&/gr for/\d+/g; computes the product of every chunk of digits, and $r+=64-ord for/\pl/g subtract to it the weight of the letters. Then, we increment the counter $\ if the $r is 0 (!$r) and if the plate contains numbers and letters (/\pl/*/\d/). $\ is implicitly printed at the end thanks to -p flag.
Note that the numbers I obtain are n=2 -> 18, n=3 -> 355, n=4 -> 8012, n=5 -> 218153. I'm pretty sure these are the right ones, but I might be mistaken, in which case let me know and I'll deleted this answer.

APL (Dyalog), 71 bytes
Full program body. Prompts for N. N≥4 requires huge amounts of memory and computation.
+/((+/⊢⍳∩)∘⎕A=(×/'\d+'⎕S{+/⍎¨⍵.Match}))¨l/⍨∧⌿∨/¨c∘.∊l←,(∊c←⎕D⎕A)∘.,⍣⎕⊂⍬

Try it online!

GAP, 416 bytes
Won't win on code size, and far from constant time, but uses math to speed up a lot!
x:=X(Integers);
z:=CoefficientsOfUnivariatePolynomial;
s:=Size;

f:=function(n)
 local r,c,p,d,l,u,t;
 t:=0;
 for r in [1..Int((n+1)/2)] do
  for c in [r..n-r+1] do
   l:=z(Sum([1..26],i->x^i)^(n-c));
   for p in Partitions(c,r) do
    d:=x;
    for u in List(p,k->z(Sum([0..9],i->x^i)^k)) do
     d:=Sum([2..s(u)],i->u[i]*Value(d,x^(i-1))mod x^s(l));
    od;
    d:=z(d);
    t:=t+Binomial(n-c+1,r)*NrArrangements(p,r)*
         Sum([2..s(d)],i->d[i]*l[i]);
   od;
  od;
 od;
 return t;
end;

To squeeze out the unnecessary whitespace and get one line with 416 bytes, pipe through this:
sed -e 's/^ *//' -e 's/in \[/in[/' -e 's/ do/do /' | tr -d \\n

My old "designed for Windows XP" laptop can calculate f(10) in less than one minute and go much further in under an hour:
gap> for i in [2..15] do Print(i,": ",f(i),"\n");od;
2: 18
3: 355
4: 8012
5: 218153
6: 6580075
7: 203255386
8: 6264526999
9: 194290723825
10: 6116413503390
11: 194934846864269
12: 6243848646446924
13: 199935073535438637
14: 6388304296115023687
15: 203727592114009839797

How it works
Suppose that we first only want to know the number of perfect license
plates fitting the pattern LDDLLDL, where L denotes a letter and
D denotes a digit. Assume we have a list l of numbers such that
l[i] gives the number of ways the letters can give the value i,
and a similar list d for the values we get from the digits. Then the
number of perfect licence plates with common value i is just
l[i]*d[i], and we get the number of all perfect licence plates with
our pattern by summing this over all i. Let's denote the operation
of getting this sum by l@d.
Now even if the best way to get these lists was to try all
combinations and count, we can do this independently for the letters
and the digits, looking at 26^4+10^3 cases instead of 26^4*10^3
cases when we just run through all plates fitting the pattern. But we
can do much better: l is just the list of coefficients of
(x+x^2+...+x^26)^k where k is the number of letters, here 4.
Similarly, we get the numbers of ways to get a sum of digits in a run
of k digits as the coefficients of (1+x+...+x^9)^k. If there is
more than one run of digits, we need to combine the corresponding
lists with an operation d1#d2 that at position i has as value the
sum of all d1[i1]*d2[i2] where i1*i2=i. This is the Dirichlet
convolution, which is just the product if we interpret the lists as
coefficients of Dirchlet series. But we have already used them as
polynomials (finite power series), and there is no good way to
interpret the operation for them. I think this mismatch is part of
what makes it hard to find a simple formula. Let's use it on
polynomials anyway and use the same notation #. It is easy to
compute when one operand is a monomial: we have p(x) # x^k = p(x^k).
Together with the fact that it is bilinear, this gives a nice (but not
very efficient) way to compute it.
Note that k letters give a value of at at most 26k, while k
single digits can give a value of 9^k. So we will often get unneeded
high powers in the d polynomial. To get rid of them, we can compute
modulo x^(maxlettervalue+1). This gives a big speed up and, though I
didn't immediately notice, even helps golfing, because we now know
that the degree of d is not bigger then that of l, which
simplifies the upper limit in the final Sum. We get an even better
speed up by doing a mod calculation in the first argument of Value
(see comments), and doing the whole # computation at a lower level
gives an incredible speed up. But we're still trying to be a
legitimate answer to a golfing problem.
So we have got our l and d and can use them to compute the number
of perfect licence plates with pattern LDDLLDL. That is the same
number as for the pattern LDLLDDL. In general, we can change the
order of the runs of digits of different length as we like,
NrArrangements gives the number of possibilities. And while there
must be one letter between the runs of digits, the other letters are
not fixed. The Binomial counts these possibilities.
Now it remains to run through all possible ways of having lengths of
runs digits. r runs through all numbers of runs, c through all
total numbers of digits, and p through all partitions of c with
r summands.
The total number of partitions we look at is two less than the number
of partitions of n+1, and the partition functions grows like
exp(sqrt(n)). So while there are still easy ways to improve the
running time by reusing results (running through the partitions in a
different order), for a fundamental improvement we need to avoid
looking at each partition seperately.
Computing it fast
Note that (p+q)@r = p@r + q@r. On its own, this just helps avoid
some multiplications. But together with (p+q)#r = p#r + q#r it means
that we can combine by simple addition polynomials corresponding to
different partitions. We can't just add them all, because we still
need to know with which l we have to @-combine, which factor we
have to use, and which #-extensions are still possible.
Let's combine all polynomials corresponding to partitions with the same
sum and length, and already account for the multiple ways of
distributing the lengths of runs of digits. Different from what I
speculated in the comments, I don't need to care about the smallest
used value or how often it is used, if I make sure that I won't extend
with that value.
Here is my C++ code:
#include<vector>
#include<algorithm>
#include<iostream>
#include<gmpxx.h>

using bignum = mpz_class;
using poly = std::vector<bignum>;

poly mult(const poly &a, const poly &b){
  poly res ( a.size()+b.size()-1 );
  for(int i=0; i<a.size(); ++i)
    for(int j=0; j<b.size(); ++j)
      res[i+j]+=a[i]*b[j];
  return res;
}

poly extend(const poly &d, const poly &e, int ml, poly &a, int l, int m){
  poly res ( 26*ml+1 );
  for(int i=1; i<std::min<int>(1+26*ml,e.size()); ++i)
    for(int j=1; j<std::min<int>(1+26*ml/i,d.size()); ++j)
      res[i*j] += e[i]*d[j];
  for(int i=1; i<res.size(); ++i)
    res[i]=res[i]*l/m;
  if(a.empty())
    a = poly { res };
  else
    for(int i=1; i<a.size(); ++i)
      a[i]+=res[i];
  return res;
}

bignum f(int n){
  std::vector<poly> dp;
  poly digits (10,1);
  poly dd { 1 };
  dp.push_back( dd );
  for(int i=1; i<n; ++i){
    dd=mult(dd,digits);
    int l=1+26*(n-i);
    if(dd.size()>l)
      dd.resize(l);
    dp.push_back(dd);
  }

  std::vector<std::vector<poly>> a;
  a.reserve(n);

  a.push_back( std::vector<poly> { poly { 0, 1 } } );
  for(int i=1; i<n; ++i)
    a.push_back( std::vector<poly> (1+std::min(i,n+i-i)));
  for(int m=n-1; m>0; --m){
    //    std::cout << "m=" << m << "\n";
    for(int sum=n-m; sum>=0; --sum)
      for(int len=0; len<=std::min(sum,n+1-sum); ++len){
        poly d {a[sum][len]} ;
        if(!d.empty())
          for(int sumn=sum+m, lenn=len+1, e=1;
              sumn+lenn-1<=n;
              sumn+=m, ++lenn, ++e)
            d=extend(d,dp[m],n-sumn,a[sumn][lenn],lenn,e);
      }
  }
  poly let (27,1);
  let[0]=0;
  poly lp { 1 };
  bignum t { 0 };
  for(int sum=n-1; sum>0; --sum){
    lp=mult(lp,let);
    for(int len=1; len<=std::min(sum,n+1-sum); ++len){
      poly &a0 = a[sum][len];
      bignum s {0};
      for(int i=1; i<std::min(a0.size(),lp.size()); ++i)
        s+=a0[i]*lp[i];
      bignum bin;
      mpz_bin_uiui( bin.get_mpz_t(), n-sum+1, len );
      t+=bin*s;
    }
  }
  return t;
}

int main(){
  int n;
  std::cin >> n;
  std::cout << f(n) << "\n" ;
}

This uses the GNU MP library. On debian, install libgmp-dev. Compile
with g++ -std=c++11 -O3 -o pl pl.cpp -lgmp -lgmpxx. The program
takes its argument from stdin. For timing, use echo 100 | time ./pl.
At the end a[sum][length][i] gives the number of ways in which sum
digits in length runs can give the number i. During computation,
at the beginning of the m loop, it gives the number of ways that can
be done with numbers greater than m. It all starts with
a[0][0][1]=1.
Note that this is a superset of the numbers we need to compute the
function for smaller values. So at almost the same time, we could
compute all values up to n.
There is no recursion, so we have a fixed number of nested loops. (The
deepest nesting level is 6.) Each loop goes through a number of values
that is linear in n in the worst case. So we need only polynomial
time. If we look closer at the nested i and j loops in extend,
we find an upper limit for j of the form N/i. That should only
give a logarithmic factor for the j loop. The innermost loop in f
(with sumn etc) is similar. Also keep in mind that we compute with
numbers that grow fast.
Note also that we store O(n^3) of these numbers.
Experimentally, I get these results on reasonable hardware (i5-4590S):
f(50) needs one second and 23 MB, f(100) needs 21 seconds and 166
MB, f(200) needs 10 minutes and 1.5 GB, and f(300) needs one hour
and 5.6 GB. This suggests a time complexity better than O(n^5).

As this is a code golf challenge, this answer needs to be golfed. Sorry.

@Riker While I don't think my code was overly verbose to start with, I golfed some more and took the burden of determining its size when whitespace is squeezed out.

What's the runtime of this? I'm trying to calculate it but am less than familiar with the language. Seems like you did do a lot of optimization that I'm not seeing in other answers though, but it also still seems quadratic or perhaps even cubic?

@carusocomputing I'm afraid it's much worse. I'm handling separately each case of distributing digits among runs of digits, like there is one run of three digits, or there is one run of two digits and one single digit, or there are three single digits, but for n=5, there is no case with a run of two digits and two single digits, because then we don't have enough letters to separate the numbers. This is what the three outer for loops do: run through all useful partitions of numbers <n. (And I just realized I also allow n digits. By sheer luck another optimization counts this as 0).

@carusocomputing Note that for numbers <n/2, all partitions are useful. And the remaining computations still take their non-constant time. To see what is going on, you could add Print(p,"\n"); at the beginning of the body of the for p... loop. - I got an idea for using one loop less, but it will only help code size.

@ChristianSievers I still think this is the fastest algorithm so far.

Saving one loop worked, but didn't reduce code size. - I could avoid a lot of recomputations by visiting the partitions in a different order, 3+2+1 and 3+2+2 directly after 3+2. Even better, I think I can combine some partitions, so that instead of handling 3+3+1+1 and 4+2+1+1 separately, I can extend the combined 3+3+1 and 4+2+1  cases. Combinable partitions need to have the same length, sum, lowest summand and number of appearances of that summand. This might give a polynomial time algorithm. Also, the inner loop computation of d should be faster if done less high level. But code-golf!

I get an amazing speed up by moving the mod (which already helped a lot) into Value, changing it to Value(d mod x^(1+QuoInt(s(l)-1,i-1)),x^(i-1)). That alone allows to compute f(15) in 80 seconds.

Hopefully the +500 will make up for the downvotes due to the length, can tell you put a ton of work into this and it was an interesting follow. I think this can't be solved using pure combinatorics though...

@carusocomputing Oh thanks, I didn't expect your decision so soon. aditsu's results also seemed very promising. It was only one downvote, but while it couldn't stop my interest in the problem, it made me unsure if I should keep my answer at all and so discouraged me from giving more explanations when I had time. I think I should add some of my new code. Are you more interested in the GAP code that computes f(100) in 53 seconds on reasonable hardware, or the same algorithm in C++ (now down to 23 seconds)?

Don't worry, my code is much longer, and not close to your 23 sec result (although I wrote it in java and haven't tried translating it). I was reluctant to post it due to the golfing expectation. I'd like to see your C++ code as well as an assessment of the complexity.

@aditsu I added some explanation, the C++ code and some vague ideas about its complexity. Is your approach similar?

Scala, 265 bytes
(n:Int)=>{val i=('A'to'Z')++('0'to'9');Seq.fill(n)(i).flatten.combinations(n).flatMap(_.permutations).map(_.mkString).count(l=>"(?=.*[A-Z])(?=.*\\d)".r.findAllIn(l).size>0&&l.map(_-64).filter(_>0).sum==l.split("[A-Z]").filter(""<).map(_.map(_-48).sum).reduce(_*_))}

Explanations :
(n:Int) => {
    val i = ('A' to 'Z') ++ ('0' to '9');                       // All license plates available characters.
    Seq.fill(n)(i).flatten                                      // Simulate combination with repetition (each character is present n times)
        .combinations(n)                                        // and generate all combinations of size n (all license plates).
        .flatMap(_.permutations)                                // For each combination, generate all permutations (ex. : Seq('A', '1') => Seq('A', '1') and Seq('1', 'A')), and
        .map(_.mkString)                                        // convert each permutation to String (Seq('A', '1') => "A1").
        .count ( l =>                                           // Then count all strings having :
            "(?=.*[A-Z])(?=.*\\d)".r.findAllIn(l).size > 0 &&   // at least 1 character and 1 digit and
            l.map(_ - 64).filter(_ > 0).sum ==                  // a sum of characters (> 'A' or > 64) equals to
            l.split("[A-Z]").filter(""<)
                .map(_.map(_ - 48).sum)
                .reduce(_*_)                                    // the product of sum of digits groups (split String by letters to get digits groups)
        )
}

Notes :

-64 and -48 are used to transform a Char (respectively letter and digit) to its Int value ('A' - 64 = 1, 'B' - 64 = 2, ..., '9' - 48 = 9)
The filter in l.split("[A-Z]").filter(""<) is used to eliminate "" values if l starts with a letter (example : "A1".split("[A-Z]") => Array("", 1)). There might be a better and shorter solution

Test cases :
val f = (n:Int) => ...  // assign function
(1 to 5).foreach ( i =>
    println(s"N = $i: ${f(i)}")
)

Results :
N = 1: 0
N = 2: 18
N = 3: 355
N = 4: 8012
N = 5: 218153

The function is pretty slow for n > 4 since all combinations must be generated.

Java, 382 365 bytes

Saved 17 bytes, thanks to Kevin Cruijssen

Golfed
int h(String s){int m=0;for(int c:s.toCharArray())m+=c-48;return m;}
int g(String t){int d=1,c=0;for(String s:t.split("[^0-9]"))d*=h(s);for(String s:t.split("[^A-Z]"))c+=s.charAt(0)-65;return d==c?1:0;}
int f(String t,int n){int m=0;if(t.length()==n)return g(t);for(int d=48;d<58;)m+=f(t+d++,n);for(int c=65;c<91;)m+=f(t+c++,n);return m;}
int s(int n){return f("",n);}

Detailed
// return sum of adjecent digits
int h(String s)
{
    int sum = 0;
    for(char c : s.toCharArray()) sum += c-'0';
    return sum;
}

// check if perfect
int g(String t)
{
    int d = 1;
    int c = 0;

    for(String s : t.split("[^0-9]")) d *= h(s);
    for(String s : t.split("[^A-Z]")) c += s.charAt(0)-'A';

    return d == c ? 1 : 0;
}

// tree of enumerations
int f(String t, int n)
{
    // base case
    if(t.length() == n)
    {
        return g(t);
    }

    // enumeration
    int sum = 0;
    for(char d='0'; d<='9'; d++) sum += f(t+d, n);
    for(char c='A'; c<='Z'; c++) sum += f(t+c, n);

    return sum;
}

int s(int n){ return f("",n); }

I think you need a function that only takes n as input.

@ChristianSievers fixed

Some things to golf for your current code: int h(String s){int m=0;for(int c:s.toCharArray())m+=c-48;return m;}int g(String t){int d=1,c=0;for(String s:t.split("[^0-9]"))d*=h(s);for(String s:t.split("[^A-Z]"))c+=s.charAt(0)-65;return d==c?1:0;}int f(String t,int n){int m=0;if(t.length()==n)return g(t);for(int d=48;d<58;)m+=f(t+d++,n);for(int c=65;c<91;)m+=f(t+c++,n);return m;}int s(int n){return f("",n);} (365 bytes) You can compare your current version with this one to see the changes I did (too much to fit in the remainder of this comment). :)

@KevinCruijssen thx, 17 bytes off now

Pyth, 55 bytes
FNQI<xrG1N0=+ZsN).?=+YZ=Z0;qu*G?HH1Y1sm?<xrG1d00hxrG1dQ

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


text:
Integer-Digits of the Arithmetic-Tables
Challenge:
Output the 'integer-digits' of one of the following six arithmetic-tables based on the input:
- addition (+);
- subtraction (-);
- multiplication (*);
- division (/);
- exponentiation (^);
- modulo operation (%).
Rules:

What do I define as 'integer-digits': Every result of the arithmetic operand which is exactly one of the following: 0,1,2,3,4,5,6,7,8,9. This means you exclude every result of 10 or higher, every result of -1 or lower, and every non-integer result.
How do we calculate the arithmetic results: By using the top digit first, and then use the operand with the left digit. You are allowed to do this vice-versa (i.e. y/x instead of x/y), as long as you're consistent for all six of the outputs! (So you aren't allowed to use y-x and x/y in the same answer.)†
We won't output anything for divide by 0 test-cases (for the division and modulo operation tables)
We won't output anything for the edge-case 0^0.

Output:
So output the following (table format is somewhat flexible (see below): so the lines are optional and mainly added for readability of the test cases):
Addition:
+ | 0 1 2 3 4 5 6 7 8 9
-----------------------
0 | 0 1 2 3 4 5 6 7 8 9
1 | 1 2 3 4 5 6 7 8 9
2 | 2 3 4 5 6 7 8 9
3 | 3 4 5 6 7 8 9
4 | 4 5 6 7 8 9
5 | 5 6 7 8 9
6 | 6 7 8 9
7 | 7 8 9
8 | 8 9
9 | 9

Subtraction:
- | 0 1 2 3 4 5 6 7 8 9
-----------------------
0 | 0 1 2 3 4 5 6 7 8 9
1 |   0 1 2 3 4 5 6 7 8
2 |     0 1 2 3 4 5 6 7
3 |       0 1 2 3 4 5 6
4 |         0 1 2 3 4 5
5 |           0 1 2 3 4
6 |             0 1 2 3
7 |               0 1 2
8 |                 0 1
9 |                   0

Multiplication:
* | 0 1 2 3 4 5 6 7 8 9
-----------------------
0 | 0 0 0 0 0 0 0 0 0 0
1 | 0 1 2 3 4 5 6 7 8 9
2 | 0 2 4 6 8
3 | 0 3 6 9
4 | 0 4 8
5 | 0 5
6 | 0 6
7 | 0 7
8 | 0 8
9 | 0 9

Division:
/ | 0 1 2 3 4 5 6 7 8 9
-----------------------
0 |
1 | 0 1 2 3 4 5 6 7 8 9
2 | 0   1   2   3   4
3 | 0     1     2     3
4 | 0       1       2
5 | 0         1
6 | 0           1
7 | 0             1
8 | 0               1
9 | 0                 1

Exponentiation:
^ | 0 1 2 3 4 5 6 7 8 9
-----------------------
0 |   1 1 1 1 1 1 1 1 1
1 | 0 1 2 3 4 5 6 7 8 9
2 | 0 1 4 9
3 | 0 1 8
4 | 0 1
5 | 0 1
6 | 0 1
7 | 0 1
8 | 0 1
9 | 0 1

Modulo:
% | 0 1 2 3 4 5 6 7 8 9
-----------------------
0 |
1 | 0 0 0 0 0 0 0 0 0 0
2 | 0 1 0 1 0 1 0 1 0 1
3 | 0 1 2 0 1 2 0 1 2 0
4 | 0 1 2 3 0 1 2 3 0 1
5 | 0 1 2 3 4 0 1 2 3 4
6 | 0 1 2 3 4 5 0 1 2 3
7 | 0 1 2 3 4 5 6 0 1 2
8 | 0 1 2 3 4 5 6 7 0 1
9 | 0 1 2 3 4 5 6 7 8 0

Challenge rules:

Trailing new-lines and trailing spaces are optional
The horizontal and vertical lines in the test cases are optional. I only added them for better readability.†
The spaces between each result are NOT optional.
The symbol for the arithmetic may be different, as long as it's clear which one it is. I.e. × or · instead of * for multiplication; ÷ instead of / for division; etc.†
And as long as it's a single character, so sorry Python's **.
The input format is flexible. You can choose an index from 0-5 or 1-6 for the corresponding six tables; you could input the operand-symbol; etc. (Unlike what you display in the result, you are allowed to input complete strings, or ** in Python's case.)
Just make sure to state which input-format you use in your answer!

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code.
Also, please add an explanation if necessary.

† Example of valid output without horizontal and vertical lines, ÷ as symbol, and using y/x instead of x/y:
÷ 0 1 2 3 4 5 6 7 8 9
0   0 0 0 0 0 0 0 0 0
1   1
2   2 1
3   3   1
4   4 2   1
5   5       1
6   6 3 2     1
7   7           1
8   8 4   2       1
9   9   3           1

Is giving a result ok for division by zero if that is the result in our language? E.g. in APL, 0÷0 is 1 by default, and N mod-0 is N? One can also chose a different scheme where division by zero is always zero.

Are we allowed more than one space between columns?

@Adám Sorry for the last response. As for your first question: no sorry. I know some languages print 1, other 0, others something else for 0^0 or divide/mod 0, but you'll have to work around that. As for your second question: Yes sure, as long as the digits are still in the same columns/rows you can use as many spaces as you want.

Is the order of arguments important for non-commutative operations?

@Adám So you mean you'll output the grid for y-x, y/x, y^x and y%x instead of x-y, x/y, x^y and x%y? Hmm, I guess that could be fine. I'll edit it in the answer; as long as you'll be consistent for all six of them (so not y-x and x/y in the same answer).

Firstly, I think your tables are backwards compared to most tables. Secondly, for mod(), which is not part of basic arithmetics, who decides the order of arguments?

Following up on your last comment, @KevinCruijssen; does that mean that outputting the transposed table is OK? (Examples)

@Shaggy Yeah, that's indeed what I meant. Those outputs with reversed x/y are fine. I do the same in my 05AB1E answer at the bottom (which I can golf at multiple places I now see..)

That saves me a byte, thanks @KevinCruijssen

Japt, 45 bytes
Collaborated with @ETHproductions
AÆAÇU¥'p«Z«XªOvZ+U+X)+P r"..+"SÃuXÃuAo uU)m¸·

Run it online!
Takes input as:
"+" for addition
"-" for subtraction
"*" for multiplication
"/" for division
"p" for exponentiation
"%" for modulo
Explanation (With expanded shortcuts):
AÆ  AÇ  U¥ 'p«  Z«  Xª OvZ+U+X)+P r"..+"SÃ uXÃ uAo uU)m¸  ·
AoX{AoZ{U=='p&&!Z&&!X||OvZ+U+X)+P r"..+"S} uX} uAo uU)mqS qR

A                                                             // By default, 10 is assigned to A
 o                                                            // Create a range from [0...9]
  X{                                         }                // Iterate through the range, X becomes the iterative item
    Ao                                                        //   Create another range [0...9]
      Z{                                 }                    //   Iterate through the range, Z becomes the iterative item
                                                              //     Take:
        U=='p                                                 //       U (input) =="p"
             &&!Z                                             //       && Z != 0
                 &&!X                                         //       && X != 0
                     ||                                       //     If any of these turned out false, instead take
                       Ov                                     //       Japt Eval:
                         Z+U+X                                //         Z{Input}X
                              )+P                             //     Whichever it was, convert to a string
                                  r"..+"S                     //     Replace all strings of length 2 or more with " "
                                                              //     (this makes sure the result !== "false" and has length 1)
                                           uX                 //   Insert X (the row number) into the front of the row
                                               u              // Insert at the beginning the first row:
                                                Ao            //   [0...9]
                                                   uU)        //   with the input inserted at the beginning
                                                      mqS     // Join each item in the final array with " "
                                                          qR  // Join the final array with "\n"

JavaScript (ES7), 128 bytes

f=
c=>[...c+`0123456789`].map((r,_,a)=>a.map(l=>l==c?r:r==c?l:/^\d$/.test(l=c<`^`?eval(l+c+r):l|c?l**r:l/r)?l:` `).join` `).join`
`
<select onchange=o.textContent=f(this.value)><option>><option>+<option>-<option>*<option>/<option>%<option>^<option>&<option>,<option>.</select><pre id=o>

Special-casing 0^0 cost me 8 bytes.

Very cool how you've added additional operands like OR and AND to your test-snippet. +1

@KevinCruijssen I had to remove OR to save a byte (all the other operators sort before ^), but thanks!

Operation Flashpoint scripting language, 343 333 303 301 bytes
f={o=_this;s=o+" 0 1 2 3 4 5 6 7 8 9\n";i=0;while{i<10}do{j=0;s=s+format["%1",i];if(i<1&&(o=="/"||o=="%"||o=="^"))then{if(o=="^")then{if(j<1)then{s=s+"  ";j=1}}else{s=s+"\n1";i=1}};while{j<10}do{r=call format["%1%2%3",j,o,i];if(r>9||r<0||r%1>0)then{r=" "};s=s+format[" %1",r];j=j+1};s=s+"\n";i=i+1};s}

Call with:
hint ("+" call f)

Ungolfed:
f=
{
    o=_this;
    s=o+" 0 1 2 3 4 5 6 7 8 9\n";
    i=0;
    while{i<10}do
    {
        j=0;
        s=s+format["%1",i];
        if(i<1&&(o=="/"||o=="%"||o=="^"))then
        {
            if(o=="^")then{if(j<1)then{s=s+"  ";j=1}}
            else{s=s+"\n1";i=1}
        };
        while{j<10}do
        {
            r=call format["%1%2%3",j,o,i];
            if(r>9||r<0||r%1>0)then{r=" "};
            s=s+format[" %1",r];
            j=j+1
        };
        s=s+"\n";
        i=i+1
    };
    s
}

Output:
operator +
operator -
operator *
operator /
operator ^
operator %

Python 2, 240 231 226 224 203 202 200 197 bytes
a=i=input()
R=range(10)
for z in R:a+=' '+`z`
print a
for x in R:
 try:
	d=`x`
	for b in R:c=eval("b%s(x*1.)"%('**',i)[i<'^']);d+=' '+(' ',`int(c)`)[(i<'^'or x+b>0)and c in R]
 except:pass
 print d

Try it online!
Takes input as one of "+", "-", "*", "/", "^" or "%".
Edits
-9 -16 with thanks to @FelipeNardiBatista for some great hints
Down to 221 with more help from @FelipeNardiBatista and then down to 203 by losing and E(c)==int(E(c)). If we are checking if E(c) is in range(10) it will always be an integer if it is there. No need for the duplicate check.
This has to go below 200 without switching to Python 3 and declaring P=print. Any ideas? I am always happy to learn.
Yesss! I knew it could be done. 197. Time for bed now. I have spent enough time on this one. Thanks for the interesting challenge @KevinCruijssen.

('**',i)[i<'^'] and (i<'^'or x>0 or b>0) saves 4 bytes

a=i=input() with for z in R:a+=' '+\z`for some extra bytes saved vsa=i+' 0 1 2 3 4 5 6 7 8 9'`

1. vs 1.0 and E(c)in R vs -1<E(c)<10 for 2 bytes

Hey now this is getting down to some really cool tricks! Thanks. Will update with your suggestions when I get time.

x+b>0 vs x>0 or b>0 and "b%s(x*1.)"%('**',i)[i<'^'] vs "b"+('**',i)[i<'^']+"(x*1.)"

there is one set of extra paren (,) in your join for 223 bytes

Not sure how I missed that one. Thanks again!

rearanged your conditions for 1 byte + changed your output method for 221 bytes: https://tio.run/nexus/python2#PY7BCoMwEETv@YogSDZGRK@225s/4FWURGtLSomS2pL689ZE6GlhZnbmbQo1ajO/F@CkRqvMfYQi5@Q2WbpSbWhdKoGMMiFXSWarzUIVqXD8qGcIuSNE6GK/5YBRH7/AJUXGoxhYkrBU80afWcfaU/jeq7LHpA000slWNLALqdwNqGDgXPLGX8S/oswVQoEfE/0l9wr1lh9uPUMfGFpO6OiGcV7Kg9NtW9RFPw

Java 10, 312 305 297 238 bytes
o->{var r="+-*/^%".charAt(o)+" 0 1 2 3 4 5 6 7 8 9\n";for(int i=-1;++i<10;r+="\n"){r+=i+" ";for(double j=-1d,t;++j<10;r+=t%1!=0|t<0|t>9?"  ":((int)t)+" ")t=o<1?j+i:o<2?j-i:o<3?j*i:o<4&i>0?j/i:o<5&j!=-i?Math.pow(j,i):i>0?j%i:-1;}return r;}

Uses no horizontal/vertical lines, and the characters are as displayed in the challenge-examples (+-*/^%).
Uses an index of 0-5 for the six mathematical operands as input.
-7 bytes thanks to @Frozn.
-8 bytes thanks to @ceilingcat.
Explanation:
o->{                       // Method with integer parameter and String return-type
  var r="+-*/^%".charAt(o) //  Get the current mathematical operand character based
                           //  on the input index
        +" 0 1 2 3 4 5 6 7 8 9\n";
                           //  Append the column header and a new-line
  for(int i=-1;++i<10;     //  Loop `i` in the range (-1,10):
      r+="\n"){            //    After every iteration: append a newline to the result
    r+=i+" ";              //   Append the left-side row-nr
    for(double j=-1d,t;++j<10;
                           //   Inner loop over the cells of the current row
        r+=                //     After every iteration: append the result String with:
           t%1!=0          //      If `t` has decimal values
           |t<0            //      Or `t` is below 0
           |t>9?           //      Or `t` is above 9:
             "  "          //       Append an empty cell
           :               //      Else:
             ((int)t)+" ") //       Append `t` as integer in the current cell
      t=                   //    Set `t` to:
        o<1?               //     If the given operand is 0 ("+"):
          j+i              //      Add `j` and `i` together
        :o<2?              //     Else-if the operand is 1 ("-"):
          j-i              //      Subtract `i` from `j`
        :o<3?              //     Else-if the operand is 2 ("*"):
          j*i              //      Multiply `j` by `i`
        :o<4               //     Else-if the operand is 3 ("/")
         &i>0?             //     And `i` is larger than 0:
          j/i              //      Divide `j` by `i`
        :o<5               //     Else-if the operand is 4 ("^")
         &j!=-i?           //     And `j` is not `-i`:
          Math.pow(j,i)    //      Take `j` to the power `i`
        :                  //     Else (the operand is 5 ("%")):
         i>0?              //      If `i` is larger than 0:
           j%i             //       Take `j` modulo-`i`
         :                 //      Else:
           -1;}            //       Set `t` to -1 instead
  return r;}               //  After the loops, return the result-String

Maybe you could pass b as a double to p and get rid of r by assigning the value of the chained ternary to b.

@ceilingcat Thanks. I've just removed the separated method completely to save another ~60 bytes. :)

Python 3, 343 335 363 362 bytes
The saddest part about this is that a Java answer is beating me... I'll golf this more in the morning.
o=input()
r=range(10)
g=[['']*10 for i in r]
for x in r:
 for y in r:exec('if"/"!=o and(o!="%"or x)and(o!="**"or x or y):k=str(y'+o+'x);g[x][y]=k')
if'/'==o:
 for x in r:
  for y in r:
   if x and y%x<1:g[x][y]=str(round(y/x))
if'**'==o:o='^'
print('\n'.join([' '.join([o]+list(map(str,r)))]+[' '.join([str(q)]+[' 'if len(x)!=1else x for x in g[q]])for q in r]))

ReplIT
-8 bytes by switching to list comprehension rather than a double loop
+28 bytes to avoid edge case 0 ^ 0. -.-
-1 byte by changing ==0 to <1 thanks to @StewieGriffin

"The saddest part about this is that a Java answer is beating me..." This part made me giggle.. xD I like how you're checking the length of the number to determine if it's in the range of 0-9. Btw, umm.. I noticed one error in your Repl. It currently outputs ** instead of ^ for exponentiation. (Also, you are allowed to input **, but not to output it in the result-table. Currently you have it the other way around.)

@KevinCruijssen Whoops. Fixed successfully, no byte count change. Thanks for pointing that out!

@StewieGriffin Yes. Thank you.

Mathematica, 150 bytes
r=0~Range~9;p=Prepend;±i_:=Grid@p[p[If[0<=#<=9,#]/._@__->""&/@<|Thread[Characters@"+-*/^%"->{Plus,#-#2&,1##&,#/#2&,Power,Mod}]|>[i][r,#],#]&/@r,r~p~i]

Defines a unary function ± taking one of the characters +-*/^% as its input i (so for example, ±"^"), and returning a Grid object that looks exactly like the last output in the OP.
<|Thread[Characters@"+-*/^%"->{Plus,#-#2&,1##&,#/#2&,Power,Mod}]|> associates, to each possible input character, the corresponding (listable) binary function (where #-#2&,1##&,#/#2& are golfed versions of Subtract,Times,Divide); therefore <|...|>[i][r,#] calculates the binary operation with all possible first arguments and # as the second argument. If[0<=#<=9,#]/._@__->""& converts each result to a Null or "" if it's not a single-digit result (/._@__->"" is necessary because some results like 1/0 can't be processed by the inequalities 0<=#<=9). Finally, we prepend the various headers and footers and display the answer.

Nice answer and explanation. Do you perhaps have a Try-it-online link? And one question/note, I don't see any mention of the edge-case rule: "We won't output anything for the edge-case 0^0." Does Mathematica output nothing on default for this edge-case?

I added a link above. Mathematica evaluates 0^0 to Indeterminate, which gives us an unhappy unevaluated result If[0<=Indeterminate<=9, Indeterminate] mid-computation; but /._@__->"" is a rule that takes any unevaluated function and its arguments and changes it to an invisible string.

Ah ok, so Mathematica correctly returns that two conflicting rules #^0=1 and 0^#=0are occurring for0^0`. Good to now, and convenient for this challenge. :) Btw, your link doesn't seem to work. I get an error that I have no permission to access it.

Ok, you'll have to go to http://sandbox.open.wolframcloud.com and paste the code in yourself, then call it with a command like ±"^".

Haskell, 230 199 182 + 53 47 46 + 1 byte of separator = 284 247 232 229  bytes
f=head.show
g=[0..9]
h=(:" ")
y(%)s=unlines$(s:map f g>>=h):[f y:[last$' ':[f(x%y)|x%y`elem`g]|x<-g]>>=h|y<-g]
0?0=10;a?b=a^b
a!0=10;a!b|(e,0)<-a`divMod`b=e|1>0=10
a&0=10;a&b=mod a b

Function is (zipWith y[(+),(-),(*),(!),(?),(&)]"+-*/^%"!!), which alone takes up 53 bytes, where 0 is addition, 1 is subtraction, 2 is multiplication, 3 is division, 4 is exponentiation, and 5 is modulo.
Try it online!
Explanation
Coming later (possibly) . . . . For now some little tidbits: ? is the exponentiation operator, ! is the division operator, and & is the mod operator.
EDIT: Part of the bulk might be because most (?) of the other answers use eval, which Haskell doesn't have without a lengthy import.
EDIT2: Thanks Ørjan Johansen for -31 bytes (Wow!) off the code and -6 bytes off the function! Also changed some of the 11s to 10s for consistency purposes. Try the updated version online!
EDIT3: Same person, seventeen more bytes! Try the updated, updated version online!

Shorter ! tests: e<-a`div`b,e*b==a=e or (e,0)<-a`divMod`b=e.

Shorter function: (zipWith(#)"+-*/^%"[(+),(-),(*),(!),(?),(&)]!!)

Reversing tests + a "standard" golfing trick gives last$f k:[' '|k<0||k>9]. Finally (maybe), [0..9] is just long enough that it pays to define it as a name when using it twice.

Nah, one more: k<-[o x y] is shorter than a let.

One word: Wow! :)

If you make o an operator instead, then it no longer pays to define k at all: s#(%)=unlines$(s:['0'..'9']>>=h):[f y:[last$f(x%y):[' '|x%y<0||x%y>9]|x<-l]>>=h|y<-l];l=[0..9]

Now ['0'..'9'] is shorter as map f l.

Sorry if I'm being overwhelming here.

nah, it's absolutely fine

Oh and now it's a byte shorter to use an alphanumeric name instead of #, if you swap its arguments.

Still missed something: last$' ':[f(x%y)|x%y`elem`g]

Python 2, 197 bytes
p=input()
r=range(10)
s=' '
print p+s+s.join(map(str,r))
for i in r:print str(i)+s+s.join(eval(("s","str(j"+p+"i)")[i and(j%i==0 and'/'==p or'%'==p)or p in'**+-'and eval("j"+p+"i")in r])for j in r)

Try it online!
Input: Python 2
'+'  Addition
'-'  Sbtraction
'*'  Multiplication
'/'  Division
'**' Exponentiation
'%'  Modulo
Python 3, 200 bytes
p=input()
r=range(10)
s=' '
print(p+s+s.join(map(str,r)))
for i in r:print(str(i)+s+s.join(eval(("s","str(j"+p+"i)")[i and(j%i==0 and'/'in p or'%'==p)or p in'**+-'and eval("j"+p+"i")in r])for j in r))

Try it online!
Input: Python 3
+  Addition
-  Sbtraction
*  Multiplication
//  Division
** Exponentiation
%  Modulo
Explanation
storing range(10) to a variable r, we can get the first line of output of the format
operator 0 1 2 3 4 5 6 7 8 9

by mapping every int in r to string and joining the string list['0','1','2','3','4','5','6','7','8','9'] with space s with p operator
p+s+s.join(map(str,r)

With that,
for every i in r(range), for every j evaluate i and j with your operator
eval("j"+p+"i")

here, an exception might be thrown if unhandled - division or modulus by 0. To handle this case(i and(j%i==0 and'/'==p or'%'==p)) and the output format by described in the problem statement(the result for each evaluation shouldn't be a negative number nor a number greater than 10 - eval("j"+p+"i")in r),
i and(j%i==0 and'/'==p or'%'==p)or p in'**+-'and eval("j"+p+"i")in r

Thus printing the arithmetic-table!
Happy Coding!

Nice Python 2 answer. Guess at 197 that makes us equal. It took me a few more attempts though. Well done. Slight problem. For / the table shows .0 and not integers. Sure that is easily corrected :)

Sorry but have retracted my upvote once I saw that, Will add it again once you have had the chance to correct it :)

Thank you! But Python 2 prints int and python 3 prints float if you use '/' as input. Fir python 3 you have to use '//'. I have clearly mentioned that.

And it seems that someone is editing my link and te python 2 link have been changed to python 3. I've reverted it now.

I've had this problem before. It is because you have 2 TOI links on the same page. When you click either link it will open the first link definition that it finds. Get round it by renaming the second link to "try it online 3" or something and also rename the link definition. Should work fine then.

APL (Dyalog), 68 76 bytes
Requires ⎕IO←0 which is default on many systems. Prompts for input and expects a single character representing the operand.
t←'|'=w←⎕
(w,n),n⍪⍉⍣t∘.{(⍺w⍵≡0'*'0)∨(t∧⍵≡0)∨⍺w≡0'÷':⍬
n∊⍨r←⍵(⍎w)⍺:r
⍬}⍨n←⍳10

Try it online!
Much of the code is to circumvent that APL's results for ÷0 and 0*0 and to counteract that APL's modulo (|) has its arguments reversed compared to most other languages. Would have been only 41 bytes otherwise:
w←⎕
(w,n),n⍪∘.{0::⍬
÷n∊⍨r←⍵(⍎w)⍺:r}⍨n←⍳10

Try it online!

Wow! and after all my hard work on my Python answer. Fair play.

R, 194 177 bytes
-17 bytes switching to manipulating matrix output
function(o){s=0:9
y=sapply(s,function(x)Reduce(o,x,init=s))
dimnames(y)=list(s,rep('',10))
y[!y%in%s|!is.finite(y)]=' '
if(o=='^')y[1]=' '
cat(substr(o,1,1),s)
print(y,quote=F)}

Try it online!
Changing to this approach has some downsides, namely it can't be optimised by using pryr and is a little clunky to set up the original matrix, but it can be output perfectly with some trailing spaces on the first line.
I still have to use the substr trick because of the %% mod operator. Will continue to trim this when I get a chance, it still feels very clunky dealing with the special cases.

138 bytes with outer and a few other golfs...

Japt -R, 37 35 bytes
Look, Ma, no eval!
Was hoping to do a little better than Oliver than this but special-casing 0**0 kicked my ass. Will take another pass at it later on see if I can make any further improvements.
Uses p for exponentiation. Tables are transposed for subtraction, division and modulo.
Ao
ïNg)£øX «Nø²|Y?X:SÃòA íi iUiN)m¸

Try it (or use this version to see the transposed tables with dividing lines, as they appear in the spec) or run all test cases (with transposed tables).
Ao\nïNg)£øX «Nø²|Y?X:SÃòA íi iUiN)m¸     :Implicit input of string U
A                                        :10
 o                                       :Range [0,A)
  \n                                     :Reassign to U
    ï                                    :Cartesian product with itself reduced by
     N                                   :  Array of all inputs
      g                                  :  First element (the original input string)
       )                                 :End Cartesian product
        £                                :Map each X at 0-based index Y
         øX                              :  Does U contain X
            «                            :  Logical AND with logical NOT of
             Nø                          :  Does N contain
               ²                         :  "p"
                |Y                       :  Bitwise OR with Y
                  ?X                     :  If truthy, return X
                    :S                   :  Else return space
                      Ã                  :End map
                       òA                :Partitions of length U
                          í              :Pair with 0-based indices
                           i             :  Prepend index to array
                             i           :Prepend
                              UiN        :  U prepended with N
                                 )       :End prepend
                                  m      :Map
                                   ¸     :  Join with spaces
                                         :Implicit output, joined with newlines

PHP, 191 Bytes
** instead of ^ as input + - / % * **
echo$k=$argn,$k=="**"?"":" ",join(" ",$d=range(0,9));foreach($d as$r){echo"\n$r";foreach($d as$c){echo" ";($k=="/"|($m=$k=="%"))&$r<1?print" ":eval("echo in_array($c$k$r,\$d)?$c$k$r:' ';");}}

Online Version of both Versions
PHP, 245 Bytes without eval
input + - / % * ^
use bcpowmod($c,1,$r) instead of bcmod($c,$r) because I need a third parameter in the division input.  $c**1%$r==$c%$r
BC Math Functions
echo$k=$argn," ".join(" ",$d=range(0,9));foreach($d as$r){echo"\n$r";foreach($d as$c)echo" ",in_array($s=($k=="/"|($m=$k=="%"))&$r<1?-1:("bc".["+"=>add,"-"=>sub,"/"=>div,"*"=>mul,"^"=>pow,"%"=>powmod][$k])($c,$m?1:$r,$m?$r:9),$d)?round($s):" ";}

05AB1E, 56 55 bytes
9ÝDãεðýì„/%Iåyθ_*I'mQyO_*~iðë.VD9ÝQàiïëð]«TôεN<š}®I:ðý»

Outputs without lines and with reversed x and y. Input/output are using +, -, *, /, m, %.
Try it online or verify all tables.
21 bytes are used to fix edge cases /0, %0 and 0^0, which result in 0, 0, and 1 respectively in 05AB1E.. Here without that part (34 bytes):
9ÝDãεðýì.VD9ÝQàiïëð]«TôεN<š}®I:ðý»

Try it online or try all tables.
Explanation:
9Ý                     # Push list [0,1,2,3,4,5,6,7,8,9]
  D                    # Duplicate it (for the header later on)
   ã                   # Take the cartesian product with itself (creating all pairs):
                       #  [[0,0],[0,1],[0,2],...,[9,7],[9,8],[9,9]]
ε                      # Map each pair `y` to:
 ðý                    #  Join the pairs with a space
   ì                   #  Prepend it before the (implicit) input-char
 „/%Iå                 #   If the input is "/" or "%"
         *             #   and
      yθ_              #   The last value of the pair is exactly 0
                  ~    #  OR
          I'mQ        '#   If the input is "m"
                 *     #   and
              yO_      #   The sum of the pair is exactly 0 (thus [0,0])
 i                     #  If that is truthy:
  ð                    #   Push a space character " "
 ë                     #  Else:
  .V                   #   Execute the string as 05AB1E code
    D                  #   Duplicate the result
     9ÝQài             #   If it's in the list [0,1,2,3,4,5,6,7,8,9]:
          ï            #    Cast it to an integer to remove any trailing ".0"
                       #    (since dividing always results in a float)
         ë             #   Else:
          ð            #    Push a space character " "
]                      # Close both the if-else clauses and the map
 «                     # Merge the resulting list with the duplicated [0,1,2,3,4,5,6,7,8,9]
  Tô                   # Split the list in parts of size 10
    ε   }              # Map each list to:
     N<                #  Get the map-index + 1
       š               #  And prepend it at the front of the list
         ®I:           # Then replace the "-1" with the input-character
ðý                     # And finally join every inner list by spaces
  »                    # And join the entire string by newlines (which is output implicitly)

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