Skip to content

Instantly share code, notes, and snippets.

@mkevac
mkevac / gist:a4cb823a560c13c9bfe914c395666828
Created December 16, 2018 14:34
YouTube subscriptions
Science
----
15x4 Talks: https://www.youtube.com/channel/UCMAr-94KkdtiSqHoRJCPK1Q
3Blue1Brown: https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw
minutephysics: https://www.youtube.com/channel/UCUHW94eEFW7hkUMVaZz4eDg
Real Engineering: https://www.youtube.com/channel/UCR1IuLEqb6UEA_zQ81kwXfg
SmarterEveryDay: https://www.youtube.com/channel/UC6107grRI4m0o2-emgoDnAA
Vihart: https://www.youtube.com/channel/UCOGeU-1Fig3rrDjhm9Zs_wg
Vsauce: https://www.youtube.com/channel/UC6nSFpj9HTCZ5t-N3Rm3-HA
diff --git a/main.go b/main.go
index 7970001..0bdf8e5 100644
--- a/main.go
+++ b/main.go
@@ -42,9 +42,8 @@ func saWatch(s *service.WatchEntry) {
// TODO(rushba): add GetServiceByPrefix to Service interface ?
lakafka := services.GetServiceById(sa.SaServiceT_LAKAFKA)
- err := lakafka.UpdateServicesMap(s)
diff --git a/src/importer.c b/src/importer.c
index bf005b19..ef68bd5a 100644
--- a/src/importer.c
+++ b/src/importer.c
@@ -74,7 +74,7 @@ static int importer___user_add(struct importer_s *importer, struct user_s **u_,
return 0;
}
- if (0 > user_item_allocate(u_, user->n_custom_parameters)) {
+ if (0 > user_item_allocate(u_)) {
diff --git a/src/importer.c b/src/importer.c
index bf005b19..ef68bd5a 100644
--- a/src/importer.c
+++ b/src/importer.c
@@ -74,7 +74,7 @@ static int importer___user_add(struct importer_s *importer, struct user_s **u_,
return 0;
}
- if (0 > user_item_allocate(u_, user->n_custom_parameters)) {
+ if (0 > user_item_allocate(u_)) {
diff --git a/src/importer.c b/src/importer.c
index bf005b19..ef68bd5a 100644
--- a/src/importer.c
+++ b/src/importer.c
@@ -74,7 +74,7 @@ static int importer___user_add(struct importer_s *importer, struct user_s **u_,
return 0;
}
- if (0 > user_item_allocate(u_, user->n_custom_parameters)) {
+ if (0 > user_item_allocate(u_)) {
diff --git a/gophersearch/search/search.go b/gophersearch/search/search.go
index e1441979..4dbc4276 100644
--- a/gophersearch/search/search.go
+++ b/gophersearch/search/search.go
@@ -3,6 +3,7 @@ package search
import (
"badoo/gophersearch/geo"
"badoo/gophersearch/user"
+
"github.com/davidreynolds/gos2/s2"
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go
index 6f07731a49..30d64531db 100644
--- a/src/runtime/malloc.go
+++ b/src/runtime/malloc.go
@@ -587,7 +587,7 @@ func mallocgc(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
}
// Charge the allocation against the G. We'll account
// for internal fragmentation at the end of mallocgc.
- assistG.gcAssistBytes -= int64(size)
+ assistG.gcAssistBytes = 1024
<?php
if (!extension_loaded('pcntl')) {
if (!dl('pcntl.so')) {
Error::add(ER_ERR.'-xxxx-'.__CLASS__, 'unable to load pcntl extension', NULL, NULL, __LINE__);
}
}
for ($i = 0; $i < 20; $i++) {
$pid = pcntl_fork();
marko@marko-virtual ~/badoo/temp $ gcc builtin_test.c -o test -O3 --std=gnu99
marko@marko-virtual ~/badoo/temp $ ./test
generating flags... 5 s
using cycle... 8 s
11929711 11926960 11926934 11925219 11928833 11923393 11923177
11924621 11924564 11928647 11921652 11924644 11926105 11929288
11929690 11924292 11923555 11922419 11925611 11924387 11928793
11926351 11928699 11927228 11922918 11921752 11927864 11926735
11927322 11923573 11932816 11930695
using builtin... 1 s
@mkevac
mkevac / gist:3018264
Created June 29, 2012 14:27
Speed test
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
#define HOWMUCH 100000000
#define RANDOMBITS 4
static uint64_t stats[32];
static uint64_t stats2[32];