stuckisimon / progc Goto Github PK
View Code? Open in Web Editor NEWExercises for PROGC module as part of computer science at zhaw
License: MIT License
Exercises for PROGC module as part of computer science at zhaw
License: MIT License
Currently there are usages of unchecked string operations.
E.g.
progc/ss04-word-sort/src/main.c
Line 25 in 3ae64b8
See this stackoverflow question.
One should therefore use
strncmp
instead of strcmp
strncpy
instead of strcpy
and so on...
There are unchecked calls to malloc
.
E.g.:
They must be checked using something like:
if (pointer == NULL) {
return EXIT_FAILURE;
}
It is standard for CLIs and bash scripts to return non-zero return codes in case of error and 0
in case of success.
Therefore this snippet is not straightforward:
if (hasFailed == 1) {
return 0;
}
return 1;
from ss04-word-sort/src/main.c
This does comply with the standard:
if (RETURN_CODE == 0) {
// do sth in case of success
}
return RETURN_CODE;
One exception from this rule:
In case the name of the function is a predicate one can use "boolean
s" to indicate truthiness.
Currently no Makefile uses phony targets. This especially affects the make doc
command.
Therefore proper phony targets must be configured.
e.g.:
.PHONY: doc
Check out this nice documentation to see how and why phony targets are required: https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
Currently Makefiles reference a non-existing Doxyfile
. This obviously does not work on machines with a different folder structure.
Doxyfile
must be at the repository root.
progc/ss01-fahrenheit-to-celcius/Makefile
Line 34 in 27a4b49
Furthermore all references must be updated.
Currently usages of scanf are prone to buffer overflow which is a potential security risk.
See these two occurences:
progc/ss03-notenstatistik/src/main.c
Line 32 in d60e5b9
progc/ss04-word-sort/src/main.c
Line 57 in d60e5b9
For informations about how to fix this, have a look at this stackoverflow question: https://stackoverflow.com/questions/12306591/read-no-more-than-size-of-string-with-scanf
According to the code style guide:
Underscores shall be used to separate words in names e.g. count_active_users()
Currently the method names use camel case.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.