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
#include <sys/signal.h> | |
#include <unistd.h> | |
void handler() | |
{ | |
write(2, "a\n", 2); | |
} | |
int main(void) { | |
signal(SIGSEGV, handler); |
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
include(ECMFindModuleHelpersStub) | |
ecm_find_package_version_check(XKBCommon) | |
# Note that this list needs to be ordered such that any component | |
# appears after its dependencies | |
set(XKBCommon_known_components | |
XKBCommon | |
X11) |
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
# - find where dlopen and friends are located. | |
# DL_FOUND - system has dynamic linking interface available | |
# DL_INCLUDE_DIR - where dlfcn.h is located. | |
# DL_LIBRARY - libraries needed to use dlopen | |
include(CheckFunctionExists) | |
find_path(DL_INCLUDE_DIR NAMES dlfcn.h) | |
find_library(DL_LIBRARY NAMES dl) | |
if(DL_LIBRARY) |
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
# - Try to find the GETTEXT-PO libraries | |
# Once done this will define | |
# | |
# GETTEXTPO_FOUND - system has GETTEXT-PO | |
# GETTEXTPO_INCLUDE_DIR - the GETTEXT-PO include directory | |
# GETTEXTPO_LIBRARIES - GETTEXT-PO library | |
# | |
# Copyright (c) 2012 Yichao Yu <yyc1992@gmail.com> | |
# Copyright (c) 2015 Weng Xuetian <wengxt@gmail.com> | |
# |
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
/* | |
* Copyright (C) 2015~2015 by CSSlayer | |
* wengxt@gmail.com | |
* | |
* This library is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser General Public License as | |
* published by the Free Software Foundation; either version 2 of the | |
* License, or (at your option) any later version. | |
* | |
* This library is distributed in the hope that it will be useful, |
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
#include <QObject> | |
#include <QDebug> | |
class FactoryBase | |
{ | |
public: | |
virtual QObject* create() = 0; | |
}; | |
QMap<QString, FactoryBase*> factoryMap; |
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
#!/bin/bash | |
# Libtool does not support spaces in dependency_libs entries so we won't worry | |
# overly about them either. | |
NEWLINE=" | |
" | |
has() { | |
[[ " ${*:2} " == *" $1 "* ]] |
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
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <algorithm> | |
int main() { | |
std::string s = "13579"; | |
int result = 0; | |
std::for_each(s.begin(), s.end(), [&](char n){result = result * 10 + n - '0'; }); |
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
#include "mainwindow.h" | |
#include <QSlider> | |
MainWindow::MainWindow(QWidget *parent) : | |
QMainWindow(parent) | |
{ | |
setStyleSheet("QSlider::handle:horizontal {" | |
"background-image: url(/usr/share/wallpapers/stripes.png);" | |
"}"); |
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
#include <iostream> | |
#include <string> | |
#include <vector> | |
#define CASE 1 | |
class A { | |
public: | |
A(const std::string& _s): s(_s) { | |
} |