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
2023/07/15 09:04:24 models/user/user.go:696:CountUsers() [I] [SQL] SELECT count(*) FROM `user` WHERE type=? [0] - 5.220318ms | |
2023/07/15 09:04:24 .../[email protected]/app.go:524:HandleAction() [I] [SQL] BEGIN TRANSACTION [] - 67.022µs | |
2023/07/15 09:04:24 models/user/user.go:482:IsUserExist() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `email_notifications_preference`, `passwd`, `passwd_hash_algo`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `is_restricted`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `repo_admin_change_team_access`, `diff_view_style`, `theme`, `keep |
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 of reactive() ##### | |
library(shiny) | |
library(dplyr) | |
library(DT) | |
dt <- data.frame( | |
id = c(1, 1, 2), | |
text = c("text1", "text2", "text1") | |
) |
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 is a Shiny web application. You can run the application by clicking | |
# the 'Run App' button above. | |
# | |
# Find out more about building applications with Shiny here: | |
# | |
# http://shiny.rstudio.com/ | |
# | |
library(shiny) |
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
#' @importFrom methods setOldClass setMethod | |
#' @importMethodsFrom DBI dbDataType | |
#' @importClassesFrom RPostgres PqConnection | |
#' Generate SQL for custom data types | |
#' | |
#' SQL for data types as described in [auto_increment()] can be generated | |
#' using [DBI::dbDataType()]. | |
#' | |
#' @param dbObj Object for determining SQL dialect (e.g. connection) |
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
dfs <- function(x, child, parent) { | |
visit <- function(i) { | |
if (perm[i]) { | |
return(NULL) | |
} | |
if (temp[i]) stop("Not a DAG") | |
temp[i] <<- 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
library(reticulate) | |
library(dtw) | |
use_condaenv("dtw") | |
tslearn <- import("tslearn") | |
tslearn$metrics$dtw(rep(0, 3), 1:4) | |
dtw(rep(0, 3), 1:4, keep.internals = T, step.pattern = symmetric1)[ |
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
// compile: clang++ -Wall -std=c++11 -I /usr/local/include mp11.cpp -o mp11 | |
#include <vector> | |
#include <iostream> | |
#include <stdexcept> | |
#include <boost/mp11/list.hpp> | |
#include <boost/mp11/integral.hpp> | |
#include <boost/mp11/algorithm.hpp> |
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 <stdexcept> | |
#include <tuple> | |
#include <iostream> | |
// terminating case to avoid if-constexpr | |
template <template<class> class F, typename R, typename... Ar> | |
R dispatch_impl(int, Ar&&... rgs) { | |
throw std::runtime_error("error"); | |
} |
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
// compile: clang++ -Wall -std=c++11 functor-type-switch.cpp -o functor-type-switch | |
#include <vector> | |
#include <iostream> | |
#include <stdexcept> | |
template <template<typename> class Func, typename ...Ar> | |
auto dispatch_type(size_t type, Ar&&... rg) -> | |
decltype(Func<int>()(std::forward<Ar>(rg)...)) { | |
switch(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
// compile: clang++ -Wall -std=c++14 -I /usr/local/include mp11-type-list-switch.cpp -o mp11-type-list-switch | |
#include <vector> | |
#include <iostream> | |
#include <boost/mp11/list.hpp> | |
#include <boost/mp11/algorithm.hpp> | |
namespace mp11 = boost::mp11; |
NewerOlder