id | c0 | c1 | username | version | is_deleted |
---|---|---|---|---|---|
1 | old0 | old1 | Eric | 1 | f |
2 | old2 | old2 | Eric | 1 | f |
This file contains hidden or 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
/* copy t to s ; pointer version 1 */ | |
void strcpy(char *s, char *t) { | |
while (*s++ = *t++) | |
; | |
} |
This file contains hidden or 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
/* copy t to s ; pointer version 2 */ | |
void strcpy(char *s, char *t) { | |
while (*s++ = *t++) | |
; | |
} | |
/* copy t to s ; pointer version 1 */ | |
void strcpy(char *s, char *t) { |
This file contains hidden or 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
/* | |
* @ File name: rect.c | |
* @ Author: unknowntpo at 2020.2.24 (Mon) | |
* @ Title: Check whether a point is in rectangle or not. | |
* @ Short description: | |
* Make two point to form a rectangle called 'screen', | |
* and count the middle point. | |
* then, use ptinrect(middle, screen) function to check that | |
* middle point is in the rectangle. | |
* @ K&R_6.2: structures and functions |
This file contains hidden or 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
int adder(int a, int b) | |
{ | |
int sum = a ^ b; | |
int carry = a & b; | |
if (carry == 0) | |
return sum; | |
return adder(sum, carry << 1); | |
} |
This file contains hidden or 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
"" syntax on | |
set number | |
" set the indent consistant to 4 | |
set tabstop=8 | |
set softtabstop=0 expandtab shiftwidth=4 smarttab | |
set laststatus=2 | |
set clipboard+=unnamed | |
set hlsearch | |
" Folding |
This file contains hidden or 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
create table data ( | |
id serial, | |
c0 text, | |
c1 text, | |
username text, | |
version integer, | |
is_deleted boolean | |
); |
This file contains hidden or 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
create table data ( | |
id serial, | |
c0 text, | |
c1 text, | |
username text, | |
version integer, | |
is_deleted boolean | |
); |
This file contains hidden or 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
CREATE TABLE temp (LIKE data INCLUDING ALL); | |
insert into temp (c0, c1, username, version, is_deleted) values | |
('modified', 'old1', 'Eric', 2, false), | |
('old2', 'old2', 'Eric', 2, false), | |
('new0', 'new1', 'Kevin', 2, false); | |
select * from temp; |
This file contains hidden or 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
select | |
temp.id as temp_id, | |
temp.c0 as temp_c0, | |
temp.c1 as temp_c1, | |
temp.username as temp_username, | |
temp.version as temp_version, | |
data.id as data_id, | |
data.c0 as data_c0, | |
data.c1 as data_c1, | |
data.version as data_version |
OlderNewer