Skip to content

Instantly share code, notes, and snippets.

View sumanstats's full-sized avatar
💭
Nothing special. Its just like yesterday, hoping for something good.

Suman Khanal sumanstats

💭
Nothing special. Its just like yesterday, hoping for something good.
View GitHub Profile
@sumanstats
sumanstats / CMakeLists.txt
Last active September 30, 2023 12:20
Raku nativecall
# cmake configuration to generate dll (dynamic library) in windows
#
# Copyright 2018 The Statslabs Authors.
#
cmake_minimum_required(VERSION 3.16)
project(rmath VERSION 1.0.0 LANGUAGES C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True)
@sumanstats
sumanstats / data.R
Last active April 22, 2020 05:21
function to document dataset
document_data <- function(dataset,R_file) {
initial = "#' WHAT IS THIS DATASET ABOUT
#'
#' WRITE DESCRIPTION OF THIS DATASET
#'
#'
#' @usage HOW TO USE
#'
#' @format Description
#' \\describe{"
my @vals= <1 2 40 40 90 20.5 20.5 20.5 20.5 4 4 6>;
my @new = @vals.BagHash.sort(+*.key);
my $i=1;
for @new {
if .value == 1 {
say .key => $i;
$i+=1
} else {
say .key => $i+(.value - 1)/2;
$i = $i + .value
# Get the first 6 digits of the hash of last commit
# In bash
git ls-remote git://github.com/rakudo/rakudo.git refs/heads/master | cut -f 1 | cut -c1-6
# In powershell
(git ls-remote git://github.com/rakudo/rakudo.git refs/heads/master).Split()[0].SubString(0,6)
# Within repo