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 https://www.linuxquestions.org/questions/programming-9/removing-duplicate-lines-with-sed-276169/ | |
| # $!N | |
| # if not in the last line, append the next line of input | |
| # pattern space (no duplicates): line1\nline2 | |
| # stdout: null | |
| # | |
| # /^\(.*\)\n\1$/ | |
| # does the pattern space (eg. line1\nline2) contains duplicate lines (eg. line1 == line2)? | |
| # | |
| # /<REGEX>/!P |
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
| OVERVIEW: LLVM 'Clang' Compiler: http://clang.llvm.org | |
| USAGE: clang -cc1 [options] <inputs> | |
| OPTIONS: | |
| -### Print the commands to run for this compilation | |
| --analyze Run the static analyzer | |
| --migrate Run the migrator | |
| --relocatable-pch Build a relocatable precompiled header | |
| --serialize-diagnostics <value> |
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
| /** | |
| * \file | |
| * Trace and log functions and macros | |
| */ | |
| // Licensed under the MIT License <http://opensource.org/licenses/MIT>. | |
| // SPDX-License-Identifier: MIT | |
| // Copyright (c) 2007 - 2023 Vladimir Ivanov <knebekaizer@gmail.com>. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy |
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
| template <typename T1, typename T2> | |
| typename std::enable_if<std::is_same<T1,T2>::value, bool>::type | |
| test(T1 a = {}, T2 b = {}) { | |
| log_trace << "Not implemented, or template parameter types are not supported: " | |
| "T1: " << typeid(T1).name() << "; T2: " << typeid(T2).name(); | |
| return false; | |
| } | |
| template <typename T1, typename T2> | |
| typename std::enable_if<!std::is_same<T1,T2>::value, bool>::type |
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 <stdio.h> | |
| int main(void) | |
| { | |
| int i, j, n; | |
| for (i = 0; i < 11; i++) { | |
| for (j = 0; j < 10; j++) { | |
| n = 10 * i + j; | |
| if (n > 108) break; |
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
| # output binary | |
| BIN := x | |
| # source files | |
| SRCS := \ | |
| x.c | |
| # files included in the tarball generated by 'make dist' (e.g. add LICENSE file) | |
| DISTFILES := $(BIN) |
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
| template <bool retainAutorelease> | |
| static ALWAYS_INLINE id Kotlin_ObjCExport_refToObjCImpl(ObjHeader* obj) { | |
| if (obj == nullptr) return nullptr; | |
| if (obj->has_meta_object()) { | |
| id associatedObject = GetAssociatedObject(obj); | |
| if (associatedObject != nullptr) { | |
| return retainAutorelease ? objc_retainAutoreleaseReturnValue(associatedObject) : associatedObject; | |
| } | |
| } |
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
| Also, please write good git commit messages. A good commit message | |
| looks like this: | |
| Header line: explain the commit in one line (use the imperative) | |
| Body of commit message is a few lines of text, explaining things | |
| in more detail, possibly giving some background about the issue | |
| being fixed, etc etc. | |
| The body of the commit message can be several paragraphs, and |
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 <thread> | |
| #include <future> | |
| #include <iostream> | |
| #include <chrono> | |
| #include <vector> | |
| #include <array> | |
| #include <cassert> | |
| #include <cstdlib> // _Exit() "stdlib.h" | |
| #include <unistd.h> // sleep() |
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
| /* | |
| * Copyright (c) 2009-2017, Farooq Mela | |
| * All rights reserved. | |
| * | |
| * Redistribution and use in source and binary forms, with or without | |
| * modification, are permitted provided that the following conditions are met: | |
| * | |
| * 1. Redistributions of source code must retain the above copyright | |
| * notice, this list of conditions and the following disclaimer. | |
| * 2. Redistributions in binary form must reproduce the above copyright |
NewerOlder