What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-10-23 02:52:07
how to remove NULL values in array PHP
<?php $arr = array('1', '', '2', '3', '0'); // Incorrect: print_r(array_filter($arr)); // Correct: print_r(array_filter($arr, 'strlen')); //Custom print_r(array_filter($arr, function ($val) {if ($val > 0) {return true;} else {return false;}})); Add solution -
C 2021-10-22 11:32:07
convert string to uppercase in c
For those of you who want to uppercase a string and store it in a variable (that was what I was looking for when I read these answers). #include <stdio.h> //<-- You need this to use printf. #include <string.h> //<-- You need this to u... Add solution -
Other 2021-10-21 23:59:05
validate rsa id number
# NB--> Language: Perl use Scalar::Util 'looks_like_number'; sub Validate_IdNum($); sub GetLuhnDigit($); #----------------------------------------------------------------# # Validates the id number being parsed and returns a boolean, # If the id numb... Add solution -
C 2021-10-20 21:57:03
C count occurrences of a substring
#include <stdio.h> #include <string.h> int count(const char *str, const char *sub) { int sublen = strlen(sub); if (sublen == 0) return 0; int res = 0; for (str = strstr(str, sub); str; str = strstr(str + sublen, sub)) ... Add solution -
Python 2021-10-20 01:56:06
Azure Synapse Analytics failed to execute the JDBC query produced by the connector
synapseDF.write \ .format("com.databricks.spark.sqldw") \ .option("url", connStr ) \ .mode( "append" ) \ .option("tempDir", synapse_tempDir ) \ .option("forwardSparkAzureStorageCredenti... Add solution -
PHP 2021-10-19 07:31:06
program-generate-random-alphabets using php
function generateRandomString($length = 25) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $rando... Add solution -
C 2021-10-17 10:33:08
how to make recursive function in C
// Basic Recursive function // It works in all languages but lets try with C // lets make a greedy strlen int my_recursive_strlen(int index, char *str) // note that index must be set at 0 to work in this case { if (str[index] == '\0') return index... Add solution