−1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
int main(void)
{
char a[8], b[8];
char *a_ptr = a+8;
char *b_ptr = b;
printf("a_ptr = %p, b_ptr = %p\n", a_ptr, b_ptr);
if (a_ptr != b_ptr)
{
printf("a_ptr != b_ptr\n");
}
else
{
printf("a_ptr == b_ptr\n");
}
if ((uintptr_t)a_ptr != (uintptr_t)b_ptr)
{
printf("(uintptr_t)a_ptr != (uintptr_t)b_ptr\n");
}
else
{
printf("(uintptr_t)a_ptr == (uintptr_t)b_ptr\n");
}
return EXIT_SUCCESS;
}
Что по-вашему тут происходит?
j123123,
02 Февраля 2019
+2
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
// https://www.tutorialspoint.com/Read-a-character-from-standard-input-without-waiting-for-a-newline-in-Cplusplus
// A portable solution doesn't exist for doing this. On windows, you can use the getch() function from the conio(Console I/O) library to get characters pressed. For example,
#include<iostream>
#include<conio.h>
using namespace std;
int main() {
char c;
while(1){ // infinite loop
c = getch();
cout << c;
}
}
// This will output whatever character you input to the terminal. Note that this will only work on windows as the conio library exists only on windows. On UNIX, you can achieve this by entering in system raw mode. For example,
#include<iostream>
#include<stdio.h>
int main() {
char c;
// Set the terminal to raw mode
system("stty raw");
while(1) {
c = getchar();
// terminate when "." is pressed
if(c == '.') {
system("stty cooked");
exit(0);
}
std::cout << c << " was pressed."<< std::endl;
}
}
Вариант под UNIX еще и очень секурный, ЕВПОЧЯ
j123123,
22 Января 2019
−2
- 1
- 2
- 3
- 4
Как перенести секцию ресурсов из одного филе в другое? Не корысти ради. Я - преемник робин-гуда.
Я не вор - я всего лишь нищий аристократ.
Ну да-да, заебали, вирь пишу.
Примерчик на пасцале, плз. Других языков я уже не знаю.
Goh,
28 Ноября 2018
0
- 1
- 2
- 3
- 4
Нашёл смешной репозиторий у чувака из майкрософта, который
там делает помершелл грейт эгейн.
https://github.com/bitcrazed/badcase
vistefan,
21 Ноября 2018
+1
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
#include <stdio.h>
int main(void) {
puts("\x05pituh");
puts("\x06COCOCO");
puts("\x0000000005CO-CO");
puts("\00256");
return 0;
}
https://ideone.com/qNn7NF
Ололо, а я-то сразу и не понял в чём дело...
adrnin,
27 Октября 2018
+1
- 1
- 2
- 3
https://pbs.twimg.com/media/Dl4x_P-XsAAPfgC.jpg
https://twitter.com/_inside/status/1035319938641276928 The Apple Watch pride face is hardcoded to not show up if the paired iPhone is using the Russian locale
> Однако 30 октября 2014 года в статье на Bloomberg Businessweek Кук совершил каминг-аут, признавшись в своей гомосексуальности, и выразил надежду, что это признание поможет другим геям принять себя и вдохновит их на борьбу за свои права.
Бабло победило принципы
j123123,
05 Сентября 2018
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
type file;
app (file o) simulation ()
{
simulate stdout=filename(o);
}
foreach i in [0:9] {
file f <single_file_mapper; file=strcat("output/sim_",i,".out")>;
f = simulation();
}
Более другой swift
Desktop,
13 Июля 2018
0
- 1
- 2
- 3
- 4
try:
assert isinstance(tag, bs4.element.Tag)
except AssertionError:
raise TypeError
syoma,
20 Мая 2018
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
def calc ( x ) :
if type ( x ) is not list :
return x
if len ( x ) == 0 :
return x
while type ( x [ 0 ] ) is list :
x = x [ 0 ] + x [ 1: ]
c = x [ 0 ]
print ( x )
if c == 'I' :
if len ( x ) <= 1 :
return x
return calc ( x [ 1: ] )
elif c == 'K' :
if len ( x ) <= 2 :
return x
return calc ( [ x[1] ] + x [ 3: ] )
elif c == 'W' :
if len ( x ) <= 2 :
return x
return calc ( x[1:3] + x[ 2: ] )
elif c == 'S' :
if len ( x ) <= 3 :
return x
return calc ( [ x[1] , x [3] , [ x[2] , x[3] ] ] + x [ 4: ] )
elif c == 'B' :
if len ( x ) <= 3 :
return x
return calc ( [ x[1] , [ x[2] , x[3] ] ] + x[4:] )
elif c == 'C' :
if len ( x ) <= 3 :
return x
return calc ( [ x[1] , x[3] , x[2] ] + x[ 4 : ] )
return [ c ] + calc ( x [ 1: ] )
def parse ( s , n = 0 ) :
res = []
i = n
while i < len ( s ) :
if s [ i ] == '(' :
t = parse ( s , i + 1 )
res.append ( t [ 0 ] )
i = t [ 1 ] - 1
elif s [ i ] == ')' :
return ( res , i + 1 )
else :
res.append ( s [ i ] )
i += 1
return ( res , i )
print ( '>> ' , end = '' )
while True :
for i in calc ( parse ( input() ) [ 0 ] ) :
print ( i , end = '' )
print ( '\n>> ' , end = '' )
Вычисляэ комбинаторныэ термы, и выдаё промежности, типа:
>> S(SKK)(SKK)x
['S', ['S', 'K', 'K'], ['S', 'K', 'K'], 'x']
['S', 'K', 'K', 'x', [['S', 'K', 'K'], 'x']]
['K', 'x', ['K', 'x'], [['S', 'K', 'K'], 'x']]
['x', [['S', 'K', 'K'], 'x']]
['S', 'K', 'K', 'x']
['K', 'x', ['K', 'x']]
['x']
xx
yet_another_one_shit,
16 Апреля 2018
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
function isInteger(i) {
if(i > ~~i == false) return false
alert("тест "+(i > ~~i))
return true
}
alert( isInteger(1) ) // true
alert( isInteger(1.5) ) // false
alert( isInteger(-0.5) ) // false
//Второй вариант с багом
function isInteger(i) {
if(i > ~~i) return false
alert("тест "+(i > ~~i))
return true
}
alert( isInteger(1) ) // true
alert( isInteger(1.5) ) // false
alert( isInteger(-0.5) ) // false //нихуя не фалсе
Это пиздец нахуй, смотрите как легко налажать в js
fuckercoder,
31 Декабря 2017