Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
crasher = someBool => { | |
let divZero = Math.min(Infinity ? [] : Infinity, -0) / 0; | |
if (someBool) divZero = -0; | |
return divZero ? 1 : 0 | |
}; | |
crasher(false); | |
for (let i = 0; i < 0x10000; ++i) crasher(false); |
A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.
Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d
Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.
There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.
1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]
struct foo {
struct bar {
int x;
//const tpl = makeTemplate('hello ${name}') | |
//const name = 'world'; | |
//tpl({name}); | |
const makeTemplate = (templateString) => { | |
return (templateData) => new Function(`{${Object.keys(templateData).join(',')}}`, 'return `' + templateString + '`')(templateData); | |
} |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
import { h, Component } from 'preact'; | |
/** Example <Fetch url="/foo.json" /> compositional component. | |
* The key is, instead of passing virtual DOM elements as "children" to this component, | |
* you pass a _function_ that returns virtual DOM elements. Fetch calls that function and passes it the network data. | |
*/ | |
class Fetch extends Component { | |
state = { loading: true }; | |
componentDidMount() { |
import { h, cloneElement, Component } from 'preact'; | |
/** Example <Fetch url="/foo.json" /> compositional component. | |
* Just to demonstrate a compositional component that requires input massaging. | |
*/ | |
class Fetch extends Component { | |
state = { loading: true }; | |
componentDidMount() { | |
this.update(); |