Time flies
03 Jan 2015This is the 15th post on this blog. Thankfully, no heart attacks after
the 13th one or anything. So I'll commemorate it with a post on
dealing with dates in calc
.
How much time has passed since I started this blog?
Open
calc
with C-x **:--- Emacs Calculator Mode --- .
Enter
20 Dec 2014
with '<12 20 14RET:--- Emacs Calculator Mode --- 1: <Sat Dec 20, 2014> .
Enter current time with tN:
--- Emacs Calculator Mode --- 2: <Sat Dec 20, 2014> 1: <11:56:27am Sat Jan 3, 2015> .
Subtract with -:
--- Emacs Calculator Mode --- 1: -14.498044 .
This means that, if I want to maintain my one-post-per-day streak, I still have half of a day to post this. Unfortunately, I have only an old version of the blog repository on this machine, and the current one is on a laptop at home. So I'll post this in the evening.
Did you know what 2015 looks like in binary?
In your current calc
session,
Enter 2015 SPC:
--- Emacs Calculator Mode --- 2: -14.498044 1: 2015 .
Switch to binary with d2:
--- Emacs Calculator Mode --- 2: -2#1110.011111110111111111001111110001 1: 2#11111011111 .
Wow, a palindrome. It's too spooky, switch back to decimal with d0:
--- Emacs Calculator Mode --- 2: -14.498044 1: 2015 .
If you're new to calc
, you'll probably wonder why you can't enter
negative numbers with -. It can be done with _,
just like in
J. Find
out more in the
info;
the
interactive tutorial
is absolutely excellent.