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
diff --git a/src/x11_platform.h b/src/x11_platform.h | |
index 7b46025..b48968f 100644 | |
--- a/src/x11_platform.h | |
+++ b/src/x11_platform.h | |
@@ -112,6 +112,7 @@ typedef struct _GLFWwindowX11 | |
XIC ic; | |
GLFWbool overrideRedirect; | |
+ GLFWbool visuallyMapped; | |
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 <Eigen/Dense> | |
#include <mtao/types.h> | |
#include <mtao/eigen/stack.h> | |
#include <iostream> | |
#include <numeric> | |
mtao::RowVectorX<int> range(int n) { | |
mtao::RowVectorX<int> ret(n); | |
std::iota(ret.data(),ret.data()+n,0); | |
return ret; |
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 <map> | |
#include <tuple> | |
#include <iostream> | |
template <typename IteratorType> | |
struct enumerate { | |
using value_type = std::pair<int,std::remove_pointer_t<IteratorType>>; | |
struct enum_iter { | |
IteratorType it; | |
int idx = 0; |
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 <map> | |
#include <iostream> | |
int main() { | |
std::map<int,int> pairs; | |
pairs[0] = 1; | |
pairs[1] = 5; | |
pairs[2] = 4; | |
pairs[3] = 3; |
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 <array> | |
#include <iostream> | |
int main() { | |
std::array<int,2> size = {640,480}; | |
auto [w,h] = size; | |
std::cout << w << " " << h << std::endl; |
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 <iostream> | |
void run() { | |
if(static bool f = false; f) { | |
std::cout << "true!" << std::endl; | |
f = false; | |
} else { | |
std::cout << "false!" << std::endl; | |
f = true; |
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 <iostream> | |
#include <condition_variable> | |
#include <thread> | |
#include <chrono> | |
#include <mutex> | |
#include <atomic> | |
std::condition_variable activity_cv; | |
std::mutex activity_mutex; | |
std::atomic<bool> run_daemon = false; |
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 <tuple> | |
#include <functional> | |
#include <iostream> | |
template <int N> | |
struct int_c {constexpr static int value = N;}; | |
template <typename CallType> | |
void f() {}; |
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 <vector> | |
#include <algorithm> | |
#include <numeric> | |
#include <set> | |
#include <iterator> | |
#include <iostream> | |
bool is_nqueens(const std::vector<int>& pos) { | |
//assume row and col safety | |
std::set<int> diag1; |
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> | |
#include <unistd.h> | |
#define NUM_ROWS 50 | |
#define NUM_COLS 50 | |
int wrap(int i, int max) { | |
return ((i) % max + max) % max; | |
} |