This file contains 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
if (a < b) | |
a = b; |
This file contains 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 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]) |
This file contains 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
void drawing(const std::string& command) { | |
if (objectname == "drawCircle") | |
drawCircle() | |
else if (objectname == "drawRectangle") | |
drawRectangle() | |
} |
This file contains 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
class Club { | |
public: | |
// ... | |
private: | |
std::list<Person*> members; | |
}; |
This file contains 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
<?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 |
This file contains 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
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) |
This file contains 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
var baseURL = "http://localhost:9001/" | |
function getDocument(url) { | |
var templateXHR = new XMLHttpRequest(); | |
templateXHR.responseType = "document"; | |
templateXHR.addEventListener("load", function() { pushDoc(templateXHR.responseXML);}, false); | |
templateXHR.open("GET", baseURL + url, true); | |
templateXHR.send(); | |
} |
This file contains 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
var baseURL = "http://localhost:9001/" | |
function getDocument(url) { | |
var templateXHR = new XMLHttpRequest(); | |
templateXHR.responseType = "document"; | |
templateXHR.addEventListener("load", function() { pushDoc(templateXHR.responseXML);}, false); | |
templateXHR.open("GET", baseURL + url, true); | |
templateXHR.send(); | |
} |
This file contains 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
<document> | |
<alertTemplate> | |
<description>This page has been pushed onto the navigation stack.</description> | |
</alertTemplate> | |
</document> |
This file contains 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
var baseURL = "http://localhost:9001/" | |
function getDocument(url) { | |
var templateXHR = new XMLHttpRequest(); | |
templateXHR.responseType = "document"; | |
templateXHR.addEventListener("load", function() {pushDoc(templateXHR.responseXML);}, false); | |
templateXHR.open("GET", url, true); | |
templateXHR.send(); | |
} |