Blog 2019/1/25
<- previous | index | next ->
Browsing solutions to the same problem is a great way to compare languages!
// Uncompressed version of dungeon generator, backported for MS Visual Studio 2008 | |
// Original work: https://gist.github.com/munificent/b1bcd969063da3e6c298be070a22b604 | |
// Original uncompressed version: https://gist.github.com/Joker-vD/cc5372a349559b9d1a3b220d5eaf2b01 | |
// Tested with Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64 | |
#include <time.h> // Robert Nystrom | |
#include <stdio.h> // @munificentbob | |
#include <stdlib.h> // for Ginny | |
// #include <stdbool.h> // 2008-2019 | |
typedef int bool; |
#include <stdio.h> | |
#include <stdlib.h> | |
const int H = 40; | |
const int W = 80; | |
char map[H][W]; | |
int rnd(int max) { | |
return rand() % max; |
#include <time.h> // Robert Nystrom | |
#include <stdio.h> // @munificentbob | |
#include <stdlib.h> // for Ginny | |
#define r return // 2008-2019 | |
#define l(a, b, c, d) for (i y=a;y\ | |
<b; y++) for (int x = c; x < d; x++) | |
typedef int i;const i H=40;const i W | |
=80;i m[40][80];i g(i x){r rand()%x; | |
}void cave(i s){i w=g(10)+5;i h=g(6) | |
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u |
Blog 2019/1/25
<- previous | index | next ->
Browsing solutions to the same problem is a great way to compare languages!
Blog 2019/1/25
<- previous | index | next ->
Browsing solutions is a great way to quickly familiarize yourself with a new language!
<application> | |
<component name="RainbowSettings"> | |
<option name="rainbowifyHTMLInsideJS" value="true" /> | |
<option name="version" value="5.1" /> | |
<option name="lightRoundBracketsColors"> | |
<array> | |
<option value="0x263238" /> | |
<option value="0x455a64" /> | |
<option value="0x607d8b" /> | |
<option value="0x90a4ae" /> |
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
/* | |
Parallel processing with ordered output in Go | |
(you can use this pattern by importing https://github.com/MarianoGappa/parseq) | |
This example implementation is useful when the following 3 conditions are true: | |
1) the rate of input is higher than the rate of output on the system (i.e. it queues up) | |
2) the processing of input can be parallelised, and overall throughput increases by doing so | |
3) the order of output of the system needs to respect order of input | |
- if 1 is false, KISS! |
/* | |
This snippet is an example of backpressure implementation in Go. | |
It doesn't run in Go Playground, because it starts an HTTP Server. | |
The example starts an HTTP server and sends multiple requests to it. The server starts denying | |
requests by replying an "X" (i.e. a 502) when its buffered channel reaches capacity. | |
This is not the same as rate-limiting; you might be interested in https://github.com/juju/ratelimit | |
or https://godoc.org/golang.org/x/time/rate. |
[![Latest NPM release][npm-badge]][npm-badge-url]
[![TravisCI Build Status][travis-badge-url]][travis-project-url]
[![CircleCI Build Status][circle-badge]][circle-badge-url]
[![Test Coverage][coveralls-badge]][coveralls-badge-url]
[![Code Climate][codeclimate-badge]][codeclimate-badge-url]
[![Ember Observer Score][ember-observer-badge]][ember-observer-badge-url]
[![License][license-badge]][license-badge-url]
[![Dependencies][dependencies-badge]][dependencies-badge-url]
[![Dev Dependencies][devDependencies-badge]][devDependencies-badge-url]