int sz = (m_buffer_size - m_buffer_index) < size ? m_buffer_size - m_buffer_index : size
length()
pass += data[ rand() % data.length() ];
use strict;
/private/key/file
-o PasswordAuthentication=false
-vv
elapsed=$(perl -e "print $end_time - $start_time")
let
let var=a$-$b
let var=$a - $b
int main(){ new Admin[5];
Admin *admins = new Admin[5]; // ... admins[1].setvalues(/* ... */);
dnf
(pw,password) == 0
password
int X[a][b][c]
int X[a*b*c]
struct node
void *
sudo nano
sudo su
-i
-s
sudo -u otheruser -i
default:
switch
getline()
float
double
int
t
870780922
Employee
lsearch()
int/int
ios::out
ios::app
Save_File
using namespace std;
std::numeric_limits<std::streamsize>::max()
void EPF(double)
void CalculateBonus(double)
double DisplayTotalPay(double,double,double)
algorithm
return 0
char *Message = (char *)alloc(count);
free(Message)
count
sizeof(long)
strlen()
extern
-frepo
Voltage::voltage_divider_Calc()
String hey = "Hello"
String hey{"Hello"}
String a = "hello"
realloc()
ptr = realloc(ptr, newsize)
stack.h
stack_impl.cpp
main.cpp
automobile_stacks.cpp
aircraft_stacks.cpp
stack::push(), stack::pop()
stack::push
strerror()
open()
std::uniform_int_distribution
#include<iostream> #include<random> int main() { std::mt19937 rnd(1); for(int i = 0; i < 10; ++i) std::cout << rnd() << '\n'; }
1791095845 4282876139 3093770124 4005303368 491263 550290313 1298508491 4290846341 630311759 1013994432
#include<iostream> #include<random> #include <cstdint> int main() { std::mt19937 gen(1); std::uniform_int_distribution<int64_t> rnd(0, 100); for(int i = 0; i < 10; ++i) std::cout << "rand = " << rnd(gen) << '\n'; }
Linux Windows 42 23 100 25 72 37 94 100 0 100 12 95 30 72 100 14 14 49 23 84
s
List
main
main<code>. As Richard has said, please fill in the details.
for
strcat
C
void*
qsort()
bsearc()
i, x, N
Columna
Renglon
echo `echo system > /sys/firmware/zynqmp/shutdown_scope`
system()
// use system system("echo system > /sys/firmware/zynqmp/shutdown_scope"); // open, write, close FILE FILE *scope = fopen("/sys/firmware/zynqmp/shutdown_scope", "w"); fprintf(scope, "system\n"); fclose(scope);
pope()
std::list<unsigned short>* myList;
myList
(NULL)->push_back(val)
new
char *s = "Hello"
char *s = (char []){ 'H', 'e', 'l', 'l', 'o', '\0'}
int *x = (int []){ 0, 1, 2, 3 };
functionThreee
i
if
while
CLEARING_CYCLE
scanf()
you get the values 7 and 24 printed out, regardless of how much white-space (including new lines) you have in the buffer. So if your format string for scanf ends in any white space, then what scanf is doing is continually trying to consume the ending whitespace to satisfy the format string, which means that you can only proceed to the next input value by entering a non-whitespace character. So using my example code above, if you enter "10 a" (or even "10a"), then scanf can proceed (or as in this case, terminate) when it finds the ''
[k5054@localhost]$ cat example.c #include <stdio.h> #include <stdlib.h> int main() { int n; printf("enter a number: "); scanf("%d\n", &n); printf("n = %d\n", n); return 0; } [k5054@localhost]$ gcc example.c -o example [k5054@localhost]$ ./example.c bash: ./example.c: Permission denied [k5054@localhost]$ ./example enter a number: 10 ^C [k5054@localhost]$ gdb example GNU gdb (GDB) Fedora 10.1-4.fc33 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from example... (No debugging symbols found in example) (gdb) r Starting program: /home/ebacon/tmp/example enter a number: 10 ^C Program received signal SIGINT, Interrupt. 0x00007ffff7ec4442 in __GI___libc_read (fd=0, buf=0x4056b0, nbytes=1024) at ../sysdeps/unix/sysv/linux/read.c:26 26 return SYSCALL_CANCEL (read, fd, buf, nbytes); (gdb) bt #0 0x00007ffff7ec4442 in __GI___libc_read (fd=0, buf=0x4056b0, nbytes=1024) at ../sysdeps/unix/sysv/linux/read.c:26 #1 0x00007ffff7e55122 in _IO_new_file_underflow (fp=0x7ffff7f96800 <_IO_2_1_stdin_>) at libioP.h:948 #2 0x00007ffff7e563a6 in __GI__IO_default_uflow (fp=0x7ffff7f96800 <_IO_2_1_stdin_>) at libioP.h:948 #3 0x00007ffff7e2ed5b in __vfscanf_internal (s=<optimized out>, format=<optimized out>, argptr=argptr@entry=0x7fffffffd930, mode_flags=mode_flags@entry=2) at vfscanf-internal.c:3023 #4 0x00007ffff7e2c712 in __isoc99_scanf (format=<optimized out>) at isoc99_scanf.c:30 #5 0x0000000000401163 in main () (gdb) quit A debugging session is active. Inferior 1 [process 195134] will be killed. Quit anyway? (y or n) y [k5054@localhost]$ [k5054@localhost]$ lsb_release -ir Distributor ID: Fedora Release: 33 [k5054@localhost]$
initscr()
cout
'\n'
std::endl
stdout
std::flush
type qualifiers ignored on function return type
const boolshowAll()
const
const int f(); /* ... */ int x = f();
const int x = f()
()
{}
[]
ball->changeDirection( ( edir ) ( ( rand() %3 ) +4 );
)
changeDirection.
#include "TDU attamp_t.h"
using namepace std
/home/TestC1/ |-- able/ |-- baker/ | |-- alpha/ | |-- beta/ | `-- gamma/ `-- charlie/
Room::AddWindow()
vector::push_back()
#pragma once
netstat -t
TIME_WAIT
int maxIndex = lastMax(n, x); printf("Max value: x[%d] = %d\n", maxIndex, x[maxIndex]);
#include "../include/Calculator.hpp"
cat
sed
sed -e 's/\t//g' sourcefile > destfile
sed -i -e 's/\t//g' sourcefile
getch()
char[20]
char[40]
awk 'BEGIN {sum=0} {sum+=length($0)+1} END {print sum}'
Can't open file for writing
fflush(stdout)
fputs(stdout, "\n")
(float)1/2
(float)1/(int)2
(int)2
(float)2
(float)1
2.71
f
F
l
L
long double
scanf("%c%*s")
getchar()
text
varchar()
main()
07:19:42 $ ./tcp-echo 9999 Server is listening on 9999 ^C 07:19:45 $ ./tcp-echo 9999 Server is listening on 9999 ^C 07:19:47 $ ./tcp-echo 9999 Server is listening on 9999 ^C 07:19:49 $ ./tcp-echo 9999 Server is listening on 9999 ^C 07:19:50 $
kill -9
inet_aton()
_Decimal128 m = 0.199848000000000DL; _Decimal128 n = 4.974384208042620DL; _Decimal128 result = m * n; _Decimal128 expected = 0.99412293432154732337566954206DL; if( r == e ) printf("Good\n"); else printf("Bad\n");
fflush(stderr)
sterror()
errno
perror_cpp
perror()
<< std::flush
ptr = realloc(ptr, new_size);
void *tmp_ptr = realloc(ptr, size); if(tmp_ptr == NULL) { // handle error somehow } else ptr = tmp_ptr; // continue processing
open("my_file.txt", O_RDONLY)
O_CREAT
open
int fd; fd = open("my_file.txt", O_RDONLY) if(fd == -1) /* open failed */ { // handle the error here ... }
dev%02dredirector=
void foo(vector<string> words) { ... } int main() { vector<string> v; foo(v); }
string s; while( !fs.eof() ) { ch = fs.get(); if(ch == ' ') { v.push_back(s); s.erase(); } else { s += ch; } }
(a, b, c, ...)
"%lf"
const char *
&x
double *
0<=x<=90
(0 <= x) <= 90
0 <= x <= 90
if(condition1) { // do something } else if(condition2) { // do something } else { // do something if all other if's fail }
if ("%lf", &x, 0<=x<=90)
NULL
srand()
time()
rand
compare(string1, string2)
compare("2018-08-01", "2019-07-02")
compare("08-01-2018", "07-02-2019")
compare_date(date1, date2)
systemctl status ngix.service
jornalctl -xe
aleatoryNumber
rand()
<random>
aleatoryNumber()
int r1 = aleatoryNumber(10); int r2 = aleatoryNumber(10);
r1 == r2
for(initial;condition;increment)
#include <stdio.h> int main(int argc, char **argv) { if(argc == 1) { return 1; } else { return 1 + main(argc-1, argv+1); } }
b = a + (--a)
#include <stdio.h> int main() { int a = 10; int b = a + --a; printf("%d, %d\n", a, b); return 0; }
9, 18
9, 19
-Wall
http://localhost/Documents/Magazine
make chrome stop redirecting http to https
k5054@debian:~$ echo "the encrypted message is this" | openssl enc -aes-256-cbc -a -salt enter aes-256-cbc encryption password: Verifying - enter aes-256-cbc encryption password: U2FsdGVkX1+SWiZRzt/w0ZkUz3EjOFTiVtibL9m+gEeyrdtpNap3MNLS/SoWhkKP k5054@debian:~$ echo "the encrypted message is this" | openssl enc -aes-256-cbc -a -salt enter aes-256-cbc encryption password: Verifying - enter aes-256-cbc encryption password: U2FsdGVkX19wGMNxrjGSdAXVw6cDCWTlMc9gGbVIOnf+R4DTZ7vRS7Liabcglpm9 k5054@debian:~$ echo "the encrypted message is this" | openssl enc -aes-256-cbc -a -salt enter aes-256-cbc encryption password: Verifying - enter aes-256-cbc encryption password: U2FsdGVkX1/x2Om88MSlWgHtzEuarh8UIMOHo4aA63OA8ruhRbJr4ba6/vPEv1Pr
k5054@debian:~$ echo "U2FsdGVkX190A5FsNTanwTKBdex29SpnH4zWkZN+Ld+MmbJgK4BH1whGIRRSpOJT" | openssl enc -aes-256-cbc -d -a -salt enter aes-256-cbc decryption password: [enter pass] bad decrypt 140066702831680:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:../crypto/evp/evp_enc.c:536: <gibberish removed>k5054@debian:~$
openssl enc -a aes-256-cbc -a -S 0102030405060709 -k pass
long long license = 12345678987654321L; printf("%020lld", license)
CXXFLAGS = -std=c++11 $(shell pkg-config --cflags opencv4) LDLIBS=$(shell pkg-config --libs opencv4)
foo: foo.o bar.o baz.o $(CXX) $^ $(LDFLAGS) -o $@
printf()
fopen()