Nighttime hacks: playful creativity as a form of relaxation
 
 
Go to file
Mike Gerwitz 338bb0cdf0
base10-mul.sed: Multiply two base-10 numbers using regexes
This was a pretty fun hack---it looks esoteric and sounds impressive (or
even impossible to some), but is really easy given the proper
intuition.  Perhaps at some point I'll write more on DFAs and some of the
theory and limitations behind this, but for now, that's beyond the scope of
what I had intended for this repo.  (I suspect that my intentions are
shifting.)

Enjoy!

* regex/base10-inc.sed: Reference new script.
* regex/base10-mul.sed: New script.
2018-11-24 00:02:26 -05:00
regex base10-mul.sed: Multiply two base-10 numbers using regexes 2018-11-24 00:02:26 -05:00
COPYING Initial commmit with fall script 2018-11-24 00:02:15 -05:00
COPYING.CCBYSA Initial commmit with fall script 2018-11-24 00:02:15 -05:00
README Initial commmit with fall script 2018-11-24 00:02:15 -05:00

README

Nighttime Hacks
===============
A repository of miscellaneous hacks.[0]

This repository is so named because I usually only have free time at night
after the kids are in bed.

The inspiration for this repository is largely entertainment: sometimes I
get burned out, and one tempting way to unwind is to play some sort of
game.  The problem is, although it's useful for unwinding, most games aren't
productive, so I feel that my limited time is wasted.

I found that my burnout isn't necessarily related to programming or research
as an act in itself---the burnout is caused from doing too similar of things
for extended periods of time.  But hacking is enjoyable, and can easily be
considered a game; as long as it's different than what caused me to burn
out, then it's a suitable alternative to playing games, and more rewarding.

On top of that, it can produce examples that are useful for others to learn
from.  I hope you find some of these as entertaining as I did.


[0]: The term ``hacking'' refers to playful creativity, not breaking
     security (which we refer to as ``cracking'').  For a good overview of
     the distinction, see <https://stallman.org/articles/on-hacking.html>.


Hack Criteria
-------------
I constrain myself to these criteria:

  1. The hack should be something that I wouldn't normally do;
  2. It has to have hack value; and
  3. It should be able to be done in small (e.g. 30m) increments.

#3 is particularly important so that these small hacks don't turn into
projects.  If it gets to that point, then they should be forked as such
rather than continuing to live here.

There may be much easier ways of accomplishing some of the hacks in this
repository.  For example, rather than a sed script trying to treat text as a
character matrix using regular expressions, I could write a trivial (and
significantly faster) C program.  But that wouldn't be a hack---it'd be a
trivial C program doing what C is good at doing.


License
-------
All programs in this repository are free/libre software.  See COPYING and
the header of each program for more information.

Free software refers to freedom, not price.
<https://www.gnu.org/philosophy/free-sw.en.html>



Copyright (C) 2018 Mike Gerwitz

This file is released under the Creative Commons Attribution-ShareAlike 4.0
International License.  See COPYING.CCBYSA for more information.