Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael L. Collard mlcollard

View GitHub Profile
View command.sh
git grep -h "@TODO" | cut -d'/' -f3- | sort | uniq -c | sort -r
View rest-delete-request.xml
DELETE /todo/items/124 HTTP/2
Host: mlcollard.net
View position.cpp
int position(int key, int elemArray[]) {
int bottom = 0;
int top = elemArray.length - 1;
while (bottom <= top) {
int midpoint = (top + bottom) / 2;
// found it
if (key == elemArray[midpoint])
View ControlCoupling.cpp
void drawing(const std::string& command) {
if (objectname == "drawCircle")
drawCircle()
else if (objectname == "drawRectangle")
drawRectangle()
}
View Aggregation.hpp
class Club {
public:
// ...
private:
std::list<Person*> members;
};
@mlcollard
mlcollard / calls_direct.xsl
Last active Oct 1, 2018
Static Analysis with srcML and XSLT
View calls_direct.xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.srcML.org/srcML/src"
xmlns:src="http://www.srcML.org/srcML/src"
version="1.0">
<!--
calls_direct.xsl
Direct calls from every function in CSV format
View Test.txt
func sendChat() {
// convert the string message into Data
guard let msg = self.messageField.text?.data(using: .utf8) else {
print("Error: ", #line)
return
}
// send the converted message
try? self.session.send(msg, toPeers: self.session.connectedPeers, with: .unreliable)