Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
#if _WIN32_WINNT < 0x0500 | |
# error "should be NT" | |
#endif | |
#include <windows.h> | |
#include <tlhelp32.h> | |
#include <winternl.h> | |
#include <stdio.h> | |
DWORD getppid() | |
{ |
;; | |
;; NS CHEATSHEET | |
;; | |
;; * :require makes functions available with a namespace prefix | |
;; and optionally can refer functions to the current ns. | |
;; | |
;; * :import refers Java classes to the current namespace. | |
;; | |
;; * :refer-clojure affects availability of built-in (clojure.core) | |
;; functions. |
define -mem-heap-dump-chunk | |
printf "%#016x: ", $mem_addr | |
printf "%016lu %016lu %#02x ", ((long *)$mem_addr)[0], ((long *)$mem_addr)[1] & ~3, ((long*)$mem_addr)[1] & 3 | |
printf "%016x %016x\n", ((long *)$mem_addr)[2], ((long *)$mem_addr)[3] | |
set $mem_addr = $mem_addr + ((long *)$mem_addr)[1] & ~3 | |
end | |
document -mem-heap-dump-chunk | |
!!! FOR INTERNAL USE ONLY - DO NOT CALL !!! | |
end |
#include <Python.h> // Must be first | |
#include <vector> | |
#include <stdexcept> | |
#include "PyUtils.h" | |
using namespace std; | |
// ===== | |
// LISTS | |
// ===== |
use std::fmt::Show; | |
use std::default::Default; | |
use std::ops::Add; | |
struct SegmentTree<T> { | |
size: uint, | |
root: Node<T> | |
} | |
struct Node<T> { |
defprotocol
: defines an interfacedeftype
: create a bare-bones object which implements a protocoldefrecord
: creates an immutable persistent map which implements a protocolTypically you'll use defrecord
(or even a basic map
);
unless you need some specific Java inter-op,
where by you'll want to use deftype
instead.
Note:
defprotocol
allows you to add new abstractions in a clean way Rather than (like OOP) having polymorphism on the class itself,
From N1256: (See http://port70.net/~nsz/c/c99/n1256.html#J.2)
main
using one of the specified forms (5.1.2.2.1).Source material: | |
http://security.stackexchange.com/questions/24444/what-is-the-most-hardened-set-of-options-for-gcc-compiling-c-c | |
https://wiki.gentoo.org/wiki/Hardened_Gentoo | |
https://wiki.debian.org/Hardening | |
================================================================================================================> | |
GCC Security related flags and options: | |
CFLAGS="-fPIE -fstack-protector-all -D_FORTIFY_SOURCE=2" | |
LDFLAGS="-Wl,-z,now -Wl,-z,relro" |