Skip to content

Instantly share code, notes, and snippets.

View ExpHP's full-sized avatar

Michael Lamparski ExpHP

View GitHub Profile
@ExpHP
ExpHP / the-error.txt
Created April 2, 2017 17:08
save-excursion: wrong number of arguments
save-excursion: Wrong number of arguments: (1 . 1), 0
^ the number of arguments is... A DOTTED PAIR!?
am I reading this right!? O_o
#[cfg(test)]
mod test_parsing {
// NOTES:
// OptionStore holds the defined options for a program.
// The function being tested canonicalizes arguments like getopt.
//
// .add_short() and .add_long() take a "number of option arguments" argument, (e.g. Precisely(2))
// because I mistakenly thought that options were allowed to take more than one.
// YOU CAN IGNORE ANY TEST WHERE THE INPUT SUPPLIES AN OPTION THAT TAKES MULTIPLE ARGUMENTS
diff --git a/src/common/json/json.hpp b/src/common/json/json.hpp
index ed33b37..a579d43 100644
--- a/src/common/json/json.hpp
+++ b/src/common/json/json.hpp
@@ -8,6 +8,7 @@
#include "common/json/json_serializable_t.hpp"
#include "common/enums.hpp"
+#include <cstdlib>
#include <string>

June 26 2017 - RELAXATION OR BUST

ABA/ABC: Try the automatic lattice parameter minimization.

For a baseline of comparison. Also, just in case things have somehow improved.

Result of relaxing ABC VDW

input layer sep
3.35 A; same as AB-stacked BLG
input parameter a
2.46 A; same as graphene
relaxed layer sep
3.3737 A (same for both pairs of adjacent layers)

June 26 2017 - RELAXATION OR BUST

ABA/ABC: Try the automatic lattice parameter minimization.

For a baseline of comparison. Also, just in case things have somehow improved.

Result of relaxing ABC VDW

input layer sep
3.35 A; same as AB-stacked BLG
input parameter a
2.46 A; same as graphene
relaxed layer sep
3.3737 A (same for both pairs of adjacent layers)
@ExpHP
ExpHP / error
Created July 3, 2017 20:40
CLASS --> TYPE
West/Para_kernel/class_idistribute.f90:37:14:
PROCEDURE :: copyto => idistribute_copyto
1
Error: Non-polymorphic passed-object dummy argument of ‘idistribute_copyto’ at (1)
West/Para_kernel/class_idistribute.f90:35:14:
PROCEDURE :: g2l => idistribute_g2l
1
Error: Non-polymorphic passed-object dummy argument of ‘idistribute_g2l’ at (1)
@ExpHP
ExpHP / gsv_instrumented.py
Created August 15, 2017 16:54
gsv instrumented
def _get_equivalent_smallest_vectors_simple(frac_vector,
reduced_bases,
symprec):
def get_lattice_points():
return np.array([
[i, j, k] for i in (-1, 0, 1)
for j in (-1, 0, 1)
for k in (-1, 0, 1)
])
@ExpHP
ExpHP / xdg-open-trace
Created August 20, 2017 03:41
xdg-open trace
$ bash -x $(which xdg-open) org-protocol:///capture://L/a/b/c
+ check_common_commands org-protocol:///capture://L/a/b/c
+ '[' 1 -gt 0 ']'
+ parm=org-protocol:///capture://L/a/b/c
+ shift
+ case "$parm" in
+ '[' 0 -gt 0 ']'
+ '[' -z '' ']'
+ unset XDG_UTILS_DEBUG_LEVEL
+ '[' 0 -lt 1 ']'
@ExpHP
ExpHP / open-xdg-always-generic.patch
Created August 20, 2017 15:16
open-xdg always generic patch
--- /usr/bin/xdg-open 2017-05-30 17:23:44.243430717 -0400
+++ /home/lampam/bin/xdg-open 2017-08-20 11:09:15.153327227 -0400
@@ -974,52 +974,4 @@
;;
esac
-case "$DE" in
- kde)
- open_kde "$url"
- ;;
@ExpHP
ExpHP / xdg-generic-test.md
Last active January 21, 2019 04:33
xdg open_generic test

Testing setup

I improved my testing setup a bit from what I used in this comment. Now you can see when argdebug gets called multiple times.

$HOME/bin/argdebug

#!/bin/sh
echo >&2 'argdebug'
for x in "$@"; do