Name | Ownership | Copyable | Movable | Sharing | Lifetime | Semantics |
---|---|---|---|---|---|---|
unique_ptr | Unique | ❌ | ✅ | ❌ | Lexical | Reference |
shared_ptr | Shared | ✅ | ✅ | Reference | Reference-counted | Reference |
weak_ptr | ❌ | ✅ | ✅ | ❌ | Non-extending | Optional-reference |
value_ptr | Unique | ✅ | ✅ | Value | Lexical | Value |
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
## Provides utility methods to make working with bit manipulations | |
## easier and less error prone | |
const | |
validBitfieldType = ["int", "int8", "int16", "int32", "int64", "uint", | |
"uint8", "uint16", "uint32", "uint64", "bool"] | |
macro bitfield(values: varargs[stmt]): stmt = | |
## Creates a bitfield with the given fields | |
# Validate and initial parameter processing | |
if values.len %% 3 != 0: | |
error("Each field requires three values") |
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
(ns logic.y | |
(:refer-clojure :exclude [== reify inc]) | |
(:use [clojure.core.logic minikanren prelude | |
nonrel match])) | |
(defna findo [x l o] | |
([_ [[?y :- o] . _] _] | |
(project [x ?y] (== (= x ?y) true))) | |
([_ [_ . ?c] _] (findo x ?c o))) |
This is a bash script, as an example, on how to do click-testing GUI based on finding components based on how they look.
- opencv
- scrot
- findimage
- xdotool
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 | |
export AUDIO_DEFAULT_CAPTURE=hw:PCH | |
export AUDIO_DEFAULT_PLAYBACK=hw:PCH | |
execd() { | |
echo "$@" >&2 | |
"$@" | |
} |
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
(in-package :yobabank) | |
(defparameter *1pw-secure-note-name* "Yobabank Data") | |
(defparameter *1pw-vault* "Personal") | |
(defun 1pw-get-field (object name) | |
(when (typep object 'st-json:jso) | |
(st-json:getjso name object))) | |
(defun 1pw-get-id (object) |
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
import macros | |
proc procToLambda(input: PNimrodNode): PNimrodNode {.compiletime.} = | |
# Ident !"foo" | |
# Empty | |
# Empty | |
# FormalParams | |
# Ident retType | |
# IdentDefs | |
# ... |
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
/*! | |
* jQuery JavaScript Library v2.1.1pre | |
* http://jquery.com/ | |
* | |
* Includes Sizzle.js | |
* http://sizzlejs.com/ | |
* | |
* Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors | |
* Released under the MIT license | |
* http://jquery.org/license |
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
;; based on core.logic 0.8-alpha2 or core.logic master branch | |
(ns sudoku | |
(:refer-clojure :exclude [==]) | |
(:use clojure.core.logic)) | |
(defn get-square [rows x y] | |
(for [x (range x (+ x 3)) | |
y (range y (+ y 3))] | |
(get-in rows [x y]))) |
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
# This makefile will let the Android NDK build a | |
# libchipmunk.so to go with your 2D Android game. | |
# download the Chipmunk sources and do | |
# $ cd <chipmunk-physics> | |
# $ git checkout Chipmunk-6.0.3 # if you downloaded from source | |
# $ mkdir -p modules/chipmunk && cd modules/chipmunk | |
# $ cat >Android.mk <<EOF | |
LOCAL_HOME := $(dir $(lastword $(MAKEFILE_LIST))) |
OlderNewer