]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
Merge lftp configuration repository.
authorSimon Ruderich <simon@ruderich.org>
Sun, 24 Mar 2013 14:36:09 +0000 (15:36 +0100)
committerSimon Ruderich <simon@ruderich.org>
Sun, 24 Mar 2013 14:36:09 +0000 (15:36 +0100)
Conflicts:
.gitignore
setup.sh

.gitignore
gdbinit [new file with mode: 0644]
maxima/maxima-init.lisp [new file with mode: 0644]
maxima/maxima-init.mac [new file with mode: 0644]
perl/perlcriticrc [new file with mode: 0644]
setup.sh

index b96f5b6098782bcc9e2302dc445c0c35554ee33e..42531eb38dd80ea11829a0144a7c6fe0a5ad2e83 100644 (file)
@@ -1,4 +1,4 @@
-# Ignore lftp log and history files.
 /lftp/cwd_history
 /lftp/rl_history
 /lftp/transfer_log
+/maxima/maxout.gnuplot_pipes
diff --git a/gdbinit b/gdbinit
new file mode 100644 (file)
index 0000000..b179e63
--- /dev/null
+++ b/gdbinit
@@ -0,0 +1,29 @@
+# GDB (GNU debugger) configuration file.
+
+# Copyright (C) 2011-2012  Simon Ruderich
+#
+# This file is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+
+
+# Save command history.
+set history save on
+# And save more entries.
+set history size 10000
+
+
+# Always disassemble next command/instruction. Very useful when debugging code
+# without debug information.
+set disassemble-next-line on
+
+# vim: ft=gdb
diff --git a/maxima/maxima-init.lisp b/maxima/maxima-init.lisp
new file mode 100644 (file)
index 0000000..fefdadd
--- /dev/null
@@ -0,0 +1,24 @@
+; Maxima (computer algebra system) configuration file, lisp part.
+;
+; Also have a look at maxima/maxima-init.mac.
+
+; Copyright (C) 2011-2012  Simon Ruderich
+;
+; This file is free software: you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation, either version 3 of the License, or
+; (at your option) any later version.
+;
+; This file is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with this file.  If not, see <http://www.gnu.org/licenses/>.
+
+
+; Set directory for temporary files to ~/.maxima (used for plotting for
+; example). Thanks to rootzlevel in #faui2k9 on IRCnet (2011-05-28 21:52 CET).
+(setf *maxima-tempdir*
+      (namestring (merge-pathnames ".maxima/" (user-homedir-pathname))))
diff --git a/maxima/maxima-init.mac b/maxima/maxima-init.mac
new file mode 100644 (file)
index 0000000..1dedac1
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Maxima (computer algebra system) configuration file, Maxima part.
+ *
+ * Also have a look at maxima/maxima-init.lisp.
+ *
+ * Notes:
+ *
+ * Solve Ax = b, thanks to Florian.
+ *
+ * A : matrix([1,2,0],[0,2,3],[0,0,4])$
+ * b : matrix([1],[3],[5])$
+ * linsolve_by_lu(A,b);
+ */
+
+/*
+ * Copyright (C) 2011-2012  Simon Ruderich
+ *
+ * This file is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+/* CUSTOM FUNCTIONS */
+
+/* Didn't find any euclid norm in Maxima, so here it is. */
+norm(x) := sqrt(transpose(x) . x);
+
+/* Maxima's mat_norm() can't calculate the 2-norm. Thanks to Wolfgang Lindner
+ * (http://www.ma.utexas.edu/pipermail/maxima/2007/006300.html) for an
+ * improved version. */
+mat_norm2(x) := sqrt(lmax(eigenvalues(transpose(conjugate(x)) . x)[1]));
+
+/* Shortcut to perform lu factorization. */
+lu(x) := block(x : lu_factor(x), get_lu_factors(x));
+
+/* vim: ft=maxima */
diff --git a/perl/perlcriticrc b/perl/perlcriticrc
new file mode 100644 (file)
index 0000000..ce49d50
--- /dev/null
@@ -0,0 +1,62 @@
+# perlcritic configuration file
+
+# Copyright (C) 2012  Simon Ruderich
+#
+# This file is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+
+
+# Be strict about errors in ~/.perlcriticrc.
+profile-strictness = fatal
+
+# Display all errors/warnings by default.
+severity = brutal
+
+# Use colored output.
+color = 1
+
+
+# IMHO 'x' is more readable than q{x}, so ignore this warning.
+[-ValuesAndExpressions::ProhibitNoisyQuotes]
+# Same for '', ignore it too.
+[-ValuesAndExpressions::ProhibitEmptyQuotes]
+
+# I know how /s, /x and /m work (and expect that from others), ignore these
+# warnings.
+[-RegularExpressions::RequireDotMatchAnything]
+[-RegularExpressions::RequireExtendedFormatting]
+[-RegularExpressions::RequireLineBoundaryMatching]
+
+# I prefer exact line numbers in errors, allow die instead of croak. I don't
+# develop perl modules so it shouldn't be a problem.
+[-ErrorHandling::RequireCarping]
+
+# IMHO "print $FH ..." is readable enough, "print {$FH} ..." is not necessary.
+[-InputOutput::RequireBracedFileHandleWithPrint]
+
+# Don't require checks for print's return value. I check the return value of
+# other functions like open() or close(), but checking every print is just a
+# waste of time.
+[InputOutput::RequireCheckedSyscalls]
+functions = :builtins
+exclude_functions = print
+
+# IMHO punctuation variables are more readable than their English counterparts
+# (and faster in some cases). So allow the ones I use often.
+[Variables::ProhibitPunctuationVars]
+allow = $0 $! $? $. $@ $/ $" $+
+
+# Allow the usage of ".." when '..' occurs inside the string, e.g. in strings
+# like ".. '..' ..".
+[ValuesAndExpressions::ProhibitInterpolationOfLiterals]
+allow_if_string_contains_single_quote = 1
index ac253c3ffcf7a09e57af569278ac380b3d05ed78..f64aa37c572a3a1b4217ae1917fea03aafbdf469 100755 (executable)
--- a/setup.sh
+++ b/setup.sh
@@ -1,8 +1,8 @@
 #!/bin/sh
 
-# Setup script for lftp configuration files.
+# Setup script for miscellaneous configuration files.
 
-# Copyright (C) 2009-2013  Simon Ruderich
+# Copyright (C) 2009-2012  Simon Ruderich
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,6 +22,22 @@ set -e
 
 . ../lib.sh
 
+# gdb, GNU debugger.
+if installed gdb; then
+    link gdbinit ~/.gdbinit
+fi
+
+# Powerful FTP client.
 if installed lftp; then
     link lftp ~/.lftp
 fi
+
+# Maxima, a symbolic algebra program.
+if installed maxima; then
+    link maxima ~/.maxima
+fi
+
+# perlcritic to check Perl programs for common problems.
+if installed perlcritic; then
+    link perl/perlcriticrc ~/.perlcriticrc
+fi