View atomic.diff
-#if defined(__ATOMIC_RELAXED) && (!defined(__clang__) || __apple_build_version__ > 4210057)
+#if defined(__ATOMIC_RELAXED) && (!defined(__clang__) || !defined(__APPLE__) || __apple_build_version__ > 4210057)
View normal_prng.c
/* Copyright (C) 2016 Salvatore Sanfilippo. All Rights Resereved.
* This code is released under the BSD 3 clause license. */
#include <math.h>
#include <stdlib.h>
/* Return a random number with normal distribution and the specified
* mean and variance. It uses the "polar method" but does not cache one
* of the previously generated random numbers, it just returns a single
* one per iteration in order for the function to be completely stateless. */
View nnexample.txt
# Create a neural network with 2 inputs, 1 output, 3 hidden units.
127.0.0.1:6379> NR.CREATE net regressor 2 3 -> 1 normalize dataset 50 test 10
(integer) 13
# Feed it with some data.
127.0.0.1:6379> NR.OBSERVE net 1 2 -> 3
1) (integer) 1
2) (integer) 0
View nn.h
#ifndef __NN_H
#define __NN_H
/* Data structures.
* Nets are not so 'dynamic', but enough to support
* an arbitrary number of layers, with arbitrary units for layer.
* Only fully connected feed-forward networks are supported. */
struct AnnLayer {
int units;
double *output; /* output[i], output of i-th unit */
View memorydoctor.md

127.0.0.1:6379> memory doctor

"Hi Sam, I can't find any memory issue in your instance. I can only account for what occurs on this base."

127.0.0.1:6379> flushall

OK

127.0.0.1:6379> memory doctor

View mem.txt
127.0.0.1:6379> memory help
1) "MEMORY USAGE <key> [SAMPLES <count>] - Estimate memory usage of key"
2) "MEMORY OVERHEAD - Show memory usage details"
127.0.0.1:6379> memory overhead
1) "total.allocated"
2) (integer) 1014672
3) "startup.allocated"
4) (integer) 962496
5) "replication.backlog"
View crash.txt
------ DUMPING CODE AROUND EIP ------
Symbol: debugCommand (base: 0x1075e6dd0)
Module: /Users/antirez/hack/redis/src/./redis-server (base 0x10759a000)
$ xxd -r -p /tmp/dump.hex /tmp/dump.bin
$ objdump --adjust-vma=0x1075e6dd0 -D -b binary -m i386:x86-64 /tmp/dump.bin
------
69047:M 09 Sep 10:52:18.277 # dump of function (hexdump of 1360 bytes):
554889e54157415641554154534881ec881000004989fe4c8b251a5207004d8b24244c8965d0418b5e3083fb01752a4c3b65d00f85ee0d0000488d35e973
06004c89f74881c4881000005b415c415d415e415f5de9c7c1fcff4d8b6e38498b45084c8b7808488d35ff7306004c89ffe87ccb050085c00f847f020000
488d35197a06004c89ffe865cb050085c00f843d040000488d350b7a06004c89ffe84ecb050085c00f84a4030000488d35fc7906004c89ffe837cb050085
View gist:25095acfde328bcc139640893e33c11f
----- DUMPING CODE AROUND EIP ------
Symbol: debugCommand (base: 0x4624c0)
Module: ./redis-server *:6379 (base 0x400000)
$ xxd -r -p /tmp/dump.hex /tmp/dump.bin
$ objdump --adjust-vma=0x4624c0 -D -b binary -m i386:x86-64 /tmp/dump.bin
------
21015:M 08 Sep 23:12:22.833 # dump of function (hexdump of 592 bytes):
415741564155415455534889fb4881ec58100000448b673064488b042528000000488984244810000031c04183fc010f847b0300004c8b6f38be22834e00498b4508488b68084889efe852d5fbff85c00f84fa010000be46454f004889efe83dd5fbff85c00f8465010000be4f454f004889efe828d5fbff85c00f8488010000be57454f004889efe813d5fbff85c00f8473010000be1be74f004889efe8fed4fbff85c00f845e040000be69454f004889efe8e9d4fbff85c00f84f10c0000be77454f004889efe8d4d4fbff85c00f84ec030000be9a454f004889efe8bfd4fbff85c00f84d7020000be07874e004889efe8aad4fbff85c00f85420300004183fc030f842b060000be22464f004889efe88bd4fbff85c0750e418d4424fd83f8010f86c9060000be3c464f004889efe86cd4fbff85c0750a4183fc020f8424080000be43464f004889efe851d4fbff85c00f85d90300004183fc030f84c0080000be5b4
View bla.c
dictEntry *dictFind(dict *d, const void *key)
{
dictEntryVector *dv;
unsigned int h, idx, table;
if (d->ht[0].used + d->ht[1].used == 0) return NULL; /* dict is empty */
if (dictIsRehashing(d)) _dictRehashStep(d);
h = dictHashKey(d, key);
for (table = 0; table <= 1; table++) {
idx = h & d->ht[table].sizemask;