What do you want to save?
Add Code snippet
New code examples
-
C++ 2021-10-01 17:42:06
arduino sprintf float
// On arduino, sprintf does not support formatting floats, but it can be done // with some simple integer formatting: float f = 3.14; sprintf(str, "Float value: %d.%02d", (int)f, (int)(fabsf(f)*100)%100); // str will now be: "Float value... Add solution -
Other 2021-09-28 08:38:03
running chmod command using code
private function chmod_r($dir, $permission) { $dp = opendir($dir); while($file = readdir($dp)) { if (($file == ".") || ($file == "..")) continue; $path = $dir . DIRECTORY_SEPARATOR . $file; $is_dir = is_dir($path); ... Add solution -
Other 2021-09-24 17:56:02
r - check if a column has non numrical values
df <- data.frame(list(A=c(1, 2, 3, 4, 5, 6, 7, 8, 9), B=c("40g", "< 2", "thx", "about 1", "1-2", "1/2", 3, 2.3, "two"))) df$B <- as.character(df$B) myscan <- function(x) { ... Add solution -
Other 2021-09-21 04:51:03
grpc server
flag.Parse() lis, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", *port)) if err != nil { log.Fatalf("failed to listen: %v", err) } var opts []grpc.ServerOption ... grpcServer := grpc.NewServer(opts...) pb.RegisterRout... Add solution -
Other 2021-09-19 16:27:03
int and string concatination cp[
std::string name = "John"; int age = 21; std::string result; // 1. with Boost result = name + boost::lexical_cast<std::string>(age); // 2. with C++11 result = name + std::to_string(age); // 3. with FastFormat.Format fastformat::fmt(resu... Add solution
Best helpers
Ranking is empty