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
#!/usr/bin/env sh | |
# check for command - here example with nestjs | |
# shellcheck disable=SC2039 | |
if ! command -v nest &> /dev/null | |
then | |
echo "nest could not be found. install with 'npm install --global @nestjs/cli'" | |
exit | |
fi |
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
$remoteport = bash.exe -c " hostname -I | awk '{print $1}'" | |
# $remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '" | |
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; | |
if( $found ){ | |
$remoteport = $matches[0]; | |
} else{ | |
echo "The Script Exited, the ip address of WSL 2 cannot be found"; | |
exit; | |
} |
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
const N = parseInt(readline()); | |
console.log("#".repeat(N)); | |
for(var i = 1; i < (N * 2); i+=2){ | |
console.log(" ".repeat((N*2 - i) / 2) + "#".repeat(i)); | |
} | |
for(var i = N * 2 - 1; i > 0; i-=2){ | |
console.log(" ".repeat((N*2 - i) / 2) + "#".repeat(i)); | |
} |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
char *add(const char *a, const char *b) { | |
size_t pos_1, pos_2, pos_3, len_3; | |
unsigned int carry; | |
pos_1 = strlen(a); | |
pos_2 = strlen(b); |
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
n = parseInt(readline()); | |
n -= 2 | |
result = 9 | |
result *= 10 ** ~~((n + 1) / 2) | |
console.log(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
a=gets.chomp | |
h=gets.to_i.times.flat_map{s,t=gets.split | |
{t=>[s],s=>[]}}.reduce{|s,n|s.merge(n){|_,v,w|v+w}} | |
l=->(r){r+r.flat_map{|a|l[h[a]]}} | |
r=l[h[a]] | |
puts r[0]?r.sort: :Nobody | |
# example | |
# Emesse |
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
eval"p %d.gcd(%d)<2"%[*$<] |
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
require'prime' | |
gets | |
$<.map{|s|p (s.to_i..s[/ .+/].to_i).count{|n|n>0&&n.prime_division[1]}} |
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
n=int(input()) | |
f=[0,1,1] | |
for i in range(3,n+1): | |
f.append(f[f[i - 1]] + f[i - f[i - 1]]) | |
print(*f[1:n+1]) |
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
tr ACGT TGCA |
NewerOlder