In Git you can add a submodule to a repository. This is basically a sub-repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| #You may have to tweak some things here | |
| CC = gcc | |
| CXX = g++ | |
| FLAGS = -I/usr/include/python2.7 | |
| CFLAGS = | |
| CXXFLAGS = | |
| LDFLAGS = | |
| #Do not change anything beyond this point | |
| CXXFLAGS += -std=c++11 |
| /* ISO/IEC 9988:1999 grammar (ISO C) */ | |
| %token ID TYPEDEF_NAME INT_CST STRING_CST SIZEOF ; | |
| %token ARROW INC DEC ; | |
| %token LSHIFT RSHIFT ; | |
| %token LE GE ; | |
| %token EQ NE ; | |
| %token ANDAND OROR ; |
This post also appears on lisper.in.
Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.
Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):
The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.
| /******************************************************************************* | |
| * | |
| * A minimal Forth compiler in C | |
| * By Leif Bruder <leifbruder@gmail.com> http://defineanswer42.wordpress.com | |
| * Release 2014-04-04 | |
| * | |
| * Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial | |
| * | |
| * PUBLIC DOMAIN | |
| * |
If you want to add links here, leave a comment or ping me by Twitter or GitHub (@mrcasals on both platforms). You can find my email in my GitHub profile too!
| import math | |
| import numpy | |
| _permutation = numpy.array([ 6, 36, 184, 45, 107, 67, 2, 34, 82, 181, 110, 188, 69, 152, 142, 0, | |
| 224, 154, 236, 203, 157, 73, 171, 115, 138, 66, 252, 165, 155, 60, 229, 95, | |
| 141, 202, 58, 132, 76, 94, 160, 53, 170, 242, 235, 81, 139, 84, 240, 153, | |
| 130, 148, 228, 97, 105, 201, 135, 237, 62, 232, 163, 136, 143, 255, 147, 178, | |
| 204, 127, 227, 249, 253, 77, 145, 91, 19, 72, 24, 108, 144, 233, 101, 40, | |
| 20, 37, 200, 29, 54, 27, 55, 46, 234, 50, 213, 64, 17, 231, 25, 10, | |
| 70, 146, 205, 222, 80, 162, 59, 86, 12, 125, 192, 124, 246, 83, 114, 93, |
sRGB learning curve
https://gamedevdaily.io/the-srgb-learning-curve-773b7f68cf7a#.y9sitvhmm
Color Math
http://www.essentialmath.com/GDC2015/VanVerth_Jim_DoingMathwRGB.pdf
The Importance of Terminology and sRGB Uncertainty
http://colour-science.org/posts/the-importance-of-terminology-and-srgb-uncertainty/