#define SG14_FIXED_POINT_H 1
#include "type_traits.h"
#include "bits/common.h"
#define SG14_FIXED_POINT_EXCEPTIONS_ENABLED
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
| // SFINAE, enable_if example | |
| // based on http://stackoverflow.com/questions/257288/is-it-possible-to-write-a-c-template-to-check-for-a-functions-existence | |
| #include <iostream> | |
| #include <type_traits> | |
| class ClassWithToString | |
| { | |
| public: |
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
| #!/bin/bash | |
| # | |
| # Created by Felipe Machado - 2016/02/14 | |
| # | |
| # A retry command for bash | |
| # Retries the given command up to MAX_RETRIES, with an interval of SLEEP_TIME | |
| # between each retry. Just put it on your bash_profile and be happy :) | |
| # Usage: | |
| # retry [-s SLEEP_TIME] [-m MAX_RETRIES] COMMAND_WITH_ARGUMENTS | |
| # |
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
| #include "utf.hpp" | |
| #include <iostream> | |
| #include <string> | |
| int main() | |
| { | |
| // A UTF-8 literal | |
| std::string utf8 = u8"z\u00df\u6c34\U0001d10b"; // or u8"zß水𝄋" | |
| // or "\x7a\xc3\x9f\xe6\xb0\xb4\xf0\x9d\x84\x8b"; |
C++ code style written in markdown.
Astyle code automatic formatting settings
You can use clang-format too.
Use tools like vera++
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
| from time import time, sleep | |
| from functools import wraps | |
| import socket | |
| import unittest | |
| class TimeoutError(socket.timeout): | |
| pass | |
| none_val = lambda x: 0.0 if x is None else float(x) # Returns float(x), or 0 if x is None |
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
| /* | |
| * edtaa3() | |
| * | |
| * Sweep-and-update Euclidean distance transform of an | |
| * image. Positive pixels are treated as object pixels, | |
| * zero or negative pixels are treated as background. | |
| * An attempt is made to treat antialiased edges correctly. | |
| * The input image must have pixels in the range [0,1], | |
| * and the antialiased image should be a box-filter | |
| * sampling of the ideal, crisp edge. |
wget -c http://cdn.sencha.com/ext/gpl/ext-6.2.0-gpl.zip
wget -c http://cdn.sencha.com/cmd/6.2.1/no-jre/SenchaCmd-6.2.1-linux-amd64.sh.zip
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
| // Clang includes | |
| #include "clang/AST/ASTConsumer.h" | |
| #include "clang/AST/ASTContext.h" | |
| #include "clang/AST/Expr.h" | |
| #include "clang/ASTMatchers/ASTMatchFinder.h" | |
| #include "clang/ASTMatchers/ASTMatchers.h" | |
| #include "clang/Basic/Diagnostic.h" | |
| #include "clang/Basic/SourceLocation.h" | |
| #include "clang/Frontend/FrontendAction.h" | |
| #include "clang/Rewrite/Frontend/FixItRewriter.h" |
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
| #include <GLFW/glfw3.h> | |
| #include <yoga/Yoga.h> | |
| #include <stdlib.h> | |
| int main(void) | |
| { | |
| GLFWwindow* window; | |
| /* Initialize the library */ | |
| if (!glfwInit()) |