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
#!/bin/bash | |
## | |
LBREAK="=====================================================" | |
echo -e "\n" | |
## | |
if [[ -z "$@" ]] | |
then | |
ipCMD="ipinfo.io/" | |
echo Using own public IP Address: | |
curl -s "$ipCMD" |
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 <Rcpp.h> | |
// ColumnBindable | |
// | |
// Provides a common, matrix-like interface | |
// for use in Cbind class. | |
template<int RTYPE, typename T> | |
class ColumnBindable { | |
public: | |
typedef typename Rcpp::traits::storage_type<RTYPE>::type stored_type; |
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 <Rcpp.h> | |
// ColumnBindable | |
// | |
// Provides a common, matrix-like interface | |
// for use in Cbind class. | |
template<int RTYPE, typename T> | |
class ColumnBindable { | |
public: | |
typedef typename Rcpp::traits::storage_type<RTYPE>::type stored_type; |
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
make_cbind_n <- function(n) { | |
if (n == 2) { | |
return("#define CBIND_IMPL_2(T1, T2) (cbind_impl(T1, T2))") | |
} | |
macro_args <- paste0("T", 1:n, collapse = ", ") | |
call_args <- paste0("T", 1:(n-1), collapse = ", ") | |
sprintf( | |
"#define CBIND_IMPL_%i(%s) (CBIND_IMPL_2(CBIND_IMPL_%s(%s), T%i))", | |
n, macro_args, n - 1, call_args, n |
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 <Rcpp.h> | |
template<int RTYPE, typename T> | |
class ColumnBindable { | |
public: | |
typedef typename Rcpp::traits::storage_type<RTYPE>::type stored_type; | |
typedef T VEC_TYPE; | |
private: | |
const VEC_TYPE& vec; |
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
#ifndef CBIND__MACRO__DISPATCH__H | |
#define CBIND__MACRO__DISPATCH__H | |
#define CBIND_IMPL_2(T1, T2) (cbind_impl(T1, T2)) | |
#define CBIND_IMPL_3(T1, T2, T3) (CBIND_IMPL_2(CBIND_IMPL_2(T1, T2), T3)) | |
#define CBIND_IMPL_4(T1, T2, T3, T4) (CBIND_IMPL_2(CBIND_IMPL_3(T1, T2, T3), T4)) | |
#define CBIND_IMPL_5(T1, T2, T3, T4, T5) (CBIND_IMPL_2(CBIND_IMPL_4(T1, T2, T3, T4), T5)) | |
#define CBIND_IMPL_6(T1, T2, T3, T4, T5, T6) (CBIND_IMPL_2(CBIND_IMPL_5(T1, T2, T3, T4, T5), T6)) | |
#define CBIND_IMPL_7(T1, T2, T3, T4, T5, T6, T7) (CBIND_IMPL_2(CBIND_IMPL_6(T1, T2, T3, T4, T5, T6), T7)) |
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 <Rcpp.h> | |
template <int RTYPE> | |
struct CompareTwo { | |
typedef typename Rcpp::traits::storage_type<RTYPE>::type stored_type; | |
typedef Rcpp::Vector<RTYPE> VECTOR; | |
inline static Rcpp::Vector<LGLSXP> | |
apply(const VECTOR& x, stored_type y, stored_type z) { | |
R_xlen_t i = 0, n = x.size(); |
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
USE bizdev | |
-- | |
GO | |
-- | |
SET STATISTICS IO ON; | |
SET STATISTICS TIME ON; | |
-- | |
DECLARE @max INT = 40000; | |
-- | |
SELECT GETDATE() - n.Number |
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 <Rcpp.h> | |
namespace sugar { | |
namespace median_detail { | |
// need to return double for integer vectors | |
// (in case of even-length input vector) | |
// and Rcpp::String for STRSXP | |
// also need to return NA_REAL for | |
// integer vector yielding NA result |
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
saveRDS((v1 <- 1:5), file = "/tmp/v1.RDS"); system("gzip -cd -S=gz /tmp/v1.RDS | hexdump") | |
# 0000000 0a58 0000 0200 0300 0302 0200 0003 0000 | |
# 0000010 0d00 0000 0500 0000 0100 0000 0200 0000 | |
# 0000020 0300 0000 0400 0000 0500 | |
# 000002a | |
saveRDS((v2 <- 6:10), file = "/tmp/v2.RDS"); system("gzip -cd -S=gz /tmp/v2.RDS | hexdump") | |
# 0000000 0a58 0000 0200 0300 0302 0200 0003 0000 | |
# 0000010 0d00 0000 0500 0000 0600 0000 0700 0000 |
OlderNewer