^ Matches at the start of string or start of line if multi-line mode is
enabled. Many regex implementations have multi-line mode enabled by
default.
$ Matches at the end of string or end of line if multi-line mode is enabled.
cubes look like this: | |
e-------f | |
/| /| | |
/ | / | | |
a--|----b | | |
| g----|--h | |
| / | / | |
c-------d |
QTabBar, | |
QTabBar::tab | |
{ | |
font-family: "Noto Sans"; | |
font-size: 11px; | |
height: 16px; | |
padding: 2px; | |
border: 0px; | |
border-bottom: 3px solid palette(dark); | |
background-color: palette(dark); |
# Use multirust to manage multiple Rust builds: | |
# 1. Install multirust | |
curl -sf https://raw.githubusercontent.com/brson/multirust/master/blastoff.sh | sh | |
# 2. Show installed Rust builds | |
multirust list-toolchains | |
# 3. Install new build (stable, beta, nightly) | |
multirust update nightly |
function randomDataSet(dataSetSize, minValue, maxValue) { | |
return new Array(dataSetSize).fill(0).map(function(n) { | |
return Math.random() * (maxValue - minValue) + minValue; | |
}); | |
} |
.' | |
dd | |
0WWWNx,... | |
.:X0WWWWXO:lXx.. | |
.. dNWWd; kWWxc. | |
,XWWKOXWWW0:. | |
.XWWWWWWWWd; | |
.XWWWWWWook0x:. | |
.oNWWWWWWc .;. | |
.dKXWWWWWWl .;o0x;'. |
Imagine this totally hypothetical situation: You're in a boring meeting without internet, play a round of nethack as a rogue, and come across a dwarvish mithril-coat. Should you replace your current leather armor? On the one hand, mithril sounds pretty nifty. On the other hand, it seems a bit out-of-character for a rogue to wear full plate armor, so surely there are some good reasons to keep the leather?
Luckily, you are a professional developer, so you have a local copy of the games' source code.
// One liner. | |
const reverseIt = (string, memo='') => string.length ? reverseIt(string.substr(1), string.substr(0,1) + memo) : memo | |
// same as: | |
function reverseIt2 (string, memo='') { | |
if (string.length) { | |
return reverseIt2(string.substr(1), string.substr(0,1) + memo); | |
} else { | |
return memo; |
Note: This will be a contrived example, but hopefully illustrates some real-world trade-offs.
Example scenario: Suppose you're an independent web developer, and a client asks you to prototype a redesign of their website header. You'll be paid for your time, and if the client likes it, you'll be hired to do the full implementation. Your incentive is to show the client a quick, functional demo of the updated header. The problem is that quick and functional tend to be mutually-exclusive.