sum of factorials of digits

I want to find 3digit number that the sum of the factorials of it’s digits is the same as that number. what is the problem in my codes since nothing shows. Thank u so much. Test function gives each digit and fact funtion compute the factorial. #include <iostream> using namespace std; int fact(int y); int… Read More sum of factorials of digits

cannot cast to jsonb if non-negative numeric vlaue have plus sign

the following command working select ‘[0,1, -2, -0.3444, 5.6]’::jsonb; However the following 3 not working. select ‘[0,1, -2, (+0.3444), 5.6]’::jsonb; select ‘[0,1, -2, +0.3444, 5.6]’::jsonb; select ‘[0,1, -2, +0, 5.6]’::jsonb; The following working. select +0.1; select (+0.1)::text; >Solution : The first working example is a string containing a valid JSON document being cast as JSONB;… Read More cannot cast to jsonb if non-negative numeric vlaue have plus sign

continue loop even if one host is not available

import time import paramiko import sys from getpass import getpass #First Unifi AP IP Address firstip=3 fistdigits = ‘10.0.0.’ #how can we prevent from crashing if 10.0.0.19 is not an available device while firstip<=100: host= f'{fistdigits}{firstip}’ #first one will be 10.0.0.3 then 10.0.0.4 etc username="username" password="password" session= paramiko.SSHClient() session.set_missing_host_key_policy(paramiko.AutoAddPolicy()) session.connect(hostname=host, username=username, password=password) #upgradeurl="https://dl.ui.com/unifi/firmware/U7PG2/4.3.13.11253/BZ.qca956x.v4.3.13.11253.200430.1420.bin&quot; #stdin, stdout,… Read More continue loop even if one host is not available

Retrive only replacement template of regex in C#

can i get only the substitution of the Regex.Replace? Example. String text = @"asdfgs sda gsa ga s SECTOR:124 NAME:Ricko asdfgs sda gsa ga s"; String regex = "^SECTOR:(\d+) NAME:(\w+)"; String substitution = "$2 $1"; String result = Regex.Replace(text, regex, substitution); Console.WriteLine(result); Normal result asdfgs sda gsa ga s Ricko 124 Wanted result Ricko 124… Read More Retrive only replacement template of regex in C#