This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am amirmasoudabdol on github. | |
* I am amirmasoudabdol (https://keybase.io/amirmasoudabdol) on keybase. | |
* I have a public key whose fingerprint is 9ED9 378E EC7B DE99 30B9 17F4 B687 5E7E 3688 939C | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
void read_csv(int row, int col, char *filename, double **data){ | |
FILE *file; | |
file = fopen(filename, "r"); | |
int i = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code will reproduce the production-ready plot reperested in following blogpost, https://panic.com/blog/mystery-of-the-slow-downloads/ | |
# There might be some slight misplacements due to the font spacing, I've used Nitti Grotesk. | |
library(tidyverse) | |
library(lubridate) | |
library(ggthemes) | |
library(showtext) | |
# font_add("Nitti Grotesk", "Typefaces/Nitti Grotesk/NittiGrotesk-Normal.otf") | |
# font_add("Nitti Grotesk Bold", "Typefaces/Nitti Grotesk/NittiGrotesk-Bold.otf") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stat_sand <- function(mapping = NULL, | |
data = NULL, | |
position = 'identity', | |
na.rm = FALSE, | |
show.legend = NA, | |
inherit.aes = TRUE, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stat_sand <- function(mapping = NULL, | |
data = NULL, | |
position = 'identity', | |
na.rm = FALSE, | |
show.legend = NA, | |
inherit.aes = TRUE, | |
...) { | |
layer( | |
stat = StatSand, | |
geom = GeomSand, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from functools import wraps | |
def profiling_decorator(f): | |
@wraps(f) | |
def wrapped_f(*args, **kwargs): | |
start_time = time.time() | |
res = f(*args, **kwargs) | |
end_time = time.time() | |
elapsed_time = end_time - start_time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <random> | |
#include <iostream> | |
#include <armadillo> | |
#include "boost/math/distributions/normal.hpp" | |
using boost::math::normal; | |
// Truncated Normal Distribution | |
template <class _RealType = double> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(is_cmake_bundle_identifier_given | |
AND is_xcode_bundle_identifier_given | |
AND NOT existing_cmake_bundle_identifier STREQUAL existing_xcode_bundle_identifier) | |
message(WARNING | |
"MACOSX_BUNDLE_GUI_IDENTIFIER and XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER " | |
"are set to different values. You only need to set one of them. " | |
"Use 'MACOSX_BUNDLE_GUI_IDENTIFIER' for maximum compatibility. ") | |
endif() | |
if(NOT is_xcode_bundle_identifier_given |