Skip to content

Instantly share code, notes, and snippets.

[220896.280] (EE)
[220896.280] (EE) Backtrace:
[220896.386] (EE) 0: /usr/bin/X (xorg_backtrace+0x48) [0x582028]
[220896.386] (EE) 1: /usr/bin/X (0x400000+0x185ed9) [0x585ed9]
[220896.387] (EE) 2: /lib64/libc.so.6 (0x7f2d170e1000+0x352a0) [0x7f2d171162a0]
[220896.387] (EE) 3: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d1335d000+0xe58b2) [0x7f2d134428b2]
[220896.387] (EE) 4: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d1335d000+0xf393e) [0x7f2d1345093e]
[220896.387] (EE) 5: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d1335d000+0xf4c93) [0x7f2d13451c93]
[220896.387] (EE) 6: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d1335d000+0xf5aab) [0x7f2d13452aab]
[220896.387] (EE) 7: /usr/bin/X (DRI2SwapBuffers+0x1b0) [0x554870]
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
(defvar theo-phrases
'("Write more code."
"Make more commits."
"That's because you have been slacking."
"slacker!"
"That's what happens when you're lazy."
@xy4n
xy4n / euler12.rkt
Last active October 16, 2015 18:59
#lang racket
(define (count-divisors n [count 0] [start 1])
(cond
[(> start (sqrt n)) (* 2 count)]
[(= start (sqrt n)) (+ (* 2 count) 1)]
[(zero? (remainder n start)) (count-divisors n (+ count 1) (+ start 1))]
[else (count-divisors n count (+ start 1))]))
(define (triangle-number n)
(if (<= n 1)
(loop for counter from 1
for triangle = counter
then (+ counter triangle)
for factors = (loop for i from 1 to (sqrt triangle)
counting (zerop (mod triangle i)) into fac
finally (return (* 2 fac)))
when (> factors 500)
return triangle)
(defun dots (msg)
(interactive "sText: ")
(let ((dot "❤")
(colours '(10 11 12 2 6 13 4 7 8 9 3 4))
(message (s-trim msg)))
(insert
(s-join
""
(list
(mapconcat
@xy4n
xy4n / test.c
Created October 22, 2015 14:08
#include <stdio.h>
#include <string.h>
int main(int argc, char* argv[]) {
if(argc < 2)
return 1;
int i, j;
char* str = argv[1];
for(i = 0; i < (2*strlen(str)); i++) {
if (i<strlen(str)) {
@xy4n
xy4n / test.c
Created October 23, 2015 19:22
#include <stdio.h>
#include <string.h>
int main(int argc, char* argv[]) {
if(argc < 2)
return 1;
int i, j;
char* str = argv[1];
for(i = 0; i < (2*strlen(str)-1); i++) {
if (i<strlen(str)) {