- Build and install https://github.com/cquery-project/cquery. It will require cmake to build
- Generate the compile_commands.json compiler database for the project
- Copy compile_commands.json to the root of the project
- Configure the editor as per https://github.com/cquery-project/cquery/wiki/Editor-configuration
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
(defun make-modifieable-adder (initial-factor) | |
"Creates a pair of 2 functions - one to update | |
multiplication factor and one to add 2 numbers and multiply | |
by the multiplication factor" | |
(let ((mul-factor initial-factor)) | |
(cons | |
(lambda (new-mul-factor) | |
(setf mul-factor new-mul-factor)) | |
(lambda (x y) | |
(* (+ x y) mul-factor))))) |
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
int id = 0; | |
printf("Id: %d, name: %s\n", id, spec[id]); | |
printf("Name: %s, Id: %d\n", spec[id], id); | |
printf("Name: %s\n", spec[id]); | |
printf("Id: %d\n", id); | |
// output: | |
// Id: 0, name: first | |
// Name: first, Id: 4243464 |
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
We are aiming for players to play with pings as close as possible to the pings they used to in their practice games. Some games will be played with a higher ping than usual, however for the European players one should be able to play with a maximum ping 38ms (or at least 52ms in worst cases) for BOTH players. | |
In general the game can be played on any server both players agree to play on. The tournament Admins insist that the players' server-choice is done with common sense and that pings are kept as low as possible. | |
However if the players don't agree, the server is determined by the following procedure: | |
1. Both players have to show their lowest possible ping they can get on 1on1 servers from the list of accredited* servers (see the table below). | |
2. After that a server has to be found where both players get a ping calculated by the following formula: P1 + N vs P2 + N, where P1 and P2 - best pings to the accredited servers, N is the equal increase of the ping for both players (N could vary in 1-2ms) | |
Example 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
I find the following diff flags helpful: --ignore-space-change -u -F '\''^(def'\'' |
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
#-:LISPWORKS-PERSONAL-EDITION (load-all-patches) | |
#+(and LISPWORKS-PERSONAL-EDITION MSWINDOWS) (load "C:/apps/asdf/asdf.lisp") | |
;;; The following lines added by ql:add-to-init-file: | |
#-quicklisp | |
(let ((quicklisp-init #+:MSWINDOWS "C:/apps/quicklisp/setup.lisp" | |
#-:MSWINDOWS (merge-pathnames ".quicklisp/setup.lisp" | |
(user-homedir-pathname)))) | |
(format *standard-output* "ql init: ~s" quicklisp-init) | |
(when (probe-file quicklisp-init) |
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
CL-USER 12 > (compile-file "c:/Sources/lisp/test-undefined.lisp") | |
;;; Compiling file c:/Sources/lisp/test-undefined.lisp ... | |
;;; Safety = 3, Speed = 1, Space = 1, Float = 1, Interruptible = 1 | |
;;; Compilation speed = 1, Debug = 2, Fixnum safety = 3 | |
;;; Source level debugging is on | |
;;; Source file recording is on | |
;;; Cross referencing is on | |
; (top-level-form 0) | |
; crap | |
;; Processing Cross Reference Information |
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
(defmacro def-log-fun ((name &rest params) &body body) | |
(let* ((result-name (gensym)) | |
(params-list | |
(loop for iter-var in params | |
collect `(format t ,(concatenate 'string (symbol-name iter-var) ": ~a~%") ,iter-var)))) | |
`(defun ,name (,@params) | |
(progn | |
(format t "params:~%") | |
,@params-list | |
(let ((,result-name ,@body)) |
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
;; use Esc to close temporary windows | |
(let ((hotkey | |
(if window-system (kbd "<escape>") "\M-q"))) | |
(global-set-key hotkey 'txm-close-temporary-window) | |
;; in cc-modes M-q redefined | |
(define-key c-mode-map hotkey 'txm-close-temporary-window) | |
(define-key c++-mode-map hotkey 'txm-close-temporary-window)) | |
(defun txm-close-temporary-window () | |
"Close all temporary windows in current frame. |
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
;; Use ctrl up/down to move between users phrases of different users | |
(define-key erc-mode-map [C-up] 'txm-goto-previous-phrase) | |
(define-key erc-mode-map [C-down] 'txm-goto-next-phrase) | |
(defun txm-goto-previous-phrase () | |
"Go to the previous phrase" | |
(interactive) | |
;; first go to the beginning of the line | |
(goto-char | |
(line-beginning-position)) |
NewerOlder