Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
maratona
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fernando K
maratona
Commits
6de5f588
Commit
6de5f588
authored
1 year ago
by
Fernando K
Browse files
Options
Downloads
Patches
Plain Diff
Arruma o hash
parent
2c3504c7
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
caderno.pdf
+0
-0
0 additions, 0 deletions
caderno.pdf
fontes/1
+0
-11
0 additions, 11 deletions
fontes/1
fontes/hash.sh
+0
-7
0 additions, 7 deletions
fontes/hash.sh
generate.sh
+1
-1
1 addition, 1 deletion
generate.sh
with
1 addition
and
19 deletions
caderno.pdf
+
0
−
0
View file @
6de5f588
No preview for this file type
This diff is collapsed.
Click to expand it.
fontes/1
deleted
100644 → 0
+
0
−
11
View file @
2c3504c7
import subprocess as sp, hashlib as hl, sys
process = lambda a: (a[0], ''.join(sp.run(['cpp', '-dD', '-P', '-fpreprocessed'],
input=a[1], text=True, capture_output=True).stdout.split()))
l, s = list(map(process, enumerate(sys.stdin))), []
for i, line in l:
for c in l[i]:
if c == '{': s.append(i)
elif c == '}': lp = s[-1]; s.pop()
print(hl.md5((process(' '.join(l[lp:][1])).encode()
if l[i] == '}' or l[i] == '};' else l[i][1].encode())).hexdigest()[0:3]
if l[i] else '', line[:-1])
This diff is collapsed.
Click to expand it.
fontes/hash.sh
deleted
100644 → 0
+
0
−
7
View file @
2c3504c7
while
IFS
=
""
read
-r
l
;
do
h
=
$(
echo
"
$l
"
|
sed
'/^#w/d'
|
cpp
-dD
-P
-fpreprocessed
|
tr
-d
'[:space:]'
|
md5sum
|
cut
-c
-3
)
[
-z
"
$l
"
]
&&
h
=
""
echo
"
$h
$l
"
done
This diff is collapsed.
Click to expand it.
generate.sh
+
1
−
1
View file @
6de5f588
...
...
@@ -5,5 +5,5 @@ for arq in fontes/*; do
echo
"WARNING:
$arq
does not end with a newline"
fi
grep
--color
'.\{59\}'
$arq
bash
fontes/hash.
sh
<
$arq
>
fontes-com-hash/
$(
basename
$arq
)
python3
fontes/hash.
py
<
$arq
>
fontes-com-hash/
$(
basename
$arq
)
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment