merged
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 27 Jun 2013 00:13:23 +0300
changeset 1501 b9fa2b857249
parent 1500 fc0212fe5080 (current diff)
parent 1497 c01be7e7545f (diff)
child 1502 73e40e83592a
child 1505 8f63432518d2
merged
--- a/emacs.rst	Thu Jun 27 00:04:20 2013 +0300
+++ b/emacs.rst	Thu Jun 27 00:13:23 2013 +0300
@@ -52,11 +52,11 @@
 Evaluating elisp expression on the fly.
 ---------------------------------------
 
-Type M-: than lisp expression than type RET.
+Type ``M-:`` than lisp expression than type ``RET``.
 
-Or in any buffer place point at the end of lisp expression and type C-x C-e.
+Or in any buffer place point at the end of lisp expression and type ``C-x C-e``.
 
-Or invoke elisp "shell" by M-x ielm.
+Or invoke elisp "shell" by ``M-x ielm``.
 
 What functions and variables Emacs load and from which files?
 -------------------------------------------------------------
@@ -65,6 +65,8 @@
 
   (symbol-file 'c-mode)
   (find-lisp-object-file-name 'c-mode (symbol-function 'c-mode))
+  load-history
+  (locate-library "gnus.el")
 
 Using edebug.
 -------------
@@ -93,17 +95,16 @@
 How debug ini file?
 -------------------
 
-When your ini has a bug, or when you load external files that cause
-errors, the bug is often hard to find, because the Emacs Lisp reader does not
-know about line numbers and files - it just knows an error happened, and
-that's it.
+When your ini has a bug, or when you load external files that cause errors, the
+bug is often hard to find, because the Emacs Lisp reader does not know about
+line numbers and files - it just knows an error happened, and that's it.
 
 Try run Emacs with ``--debug-init`` to see backtrace.
 
 How debug long running command?
 -------------------------------
 
-M-x debug-on-quit RET`` and then just hit `C-g`` next time it gets ``stuck``
+``M-x debug-on-quit RET`` and then just hit ``C-g`` next time it gets ``stuck``
 somewhere.
 
 Check if bug in ini file not in Emacs itself.
@@ -137,9 +138,9 @@
 Elisp debug tips.
 -----------------
 
- - Use a keyboard macro that moves forward one expression (sexp) and evaluates
+ * Use a keyboard macro that moves forward one expression (sexp) and evaluates
    it.
- - Try C-x check-parens.
+ * Try C-x check-parens.
 
 Enable debug mode (also on loading).
 ------------------------------------
@@ -192,9 +193,9 @@
 Text based WWW browser.
 -----------------------
 
-  http://en.wikipedia.org/wiki/W3m
-  http://emacs-w3m.namazu.org/
-  http://www.gnu.org/software/w3/
+ * http://en.wikipedia.org/wiki/W3m
+ * http://emacs-w3m.namazu.org/
+ * http://www.gnu.org/software/w3/
 
 Tricks.
 =======
@@ -321,7 +322,7 @@
 From sources.
 -------------
 
-  http://ftp.gnu.org/pub/gnu/emacs
+ * http://ftp.gnu.org/pub/gnu/emacs
 
 Windows.
 --------
@@ -353,6 +354,7 @@
 
 Long lines.
 ===========
+::
 
   (setq longlines-show-hard-newlines t)
   (setq longlines-wrap-follows-window-size t)
@@ -360,6 +362,7 @@
 
 Printing Emacs structures.
 ==========================
+::
 
   (message "%S" '(a b 123 "hello" 'set))
   (pp '(a b 123 "hello" 'set))
@@ -375,7 +378,7 @@
 File manager.
 =============
 
-  http://www.emacswiki.org/emacs/Sunrise_Commander
+ * http://www.emacswiki.org/emacs/Sunrise_Commander
 
 Semantic.
 =========
@@ -387,6 +390,7 @@
 
 Debugging C code.
 =================
+::
 
   -*- mode: grep; mode: auto-revert-tail; default-directory: "~/devel/proj" -*-
 
@@ -444,9 +448,9 @@
 
 Highlighting, autocompletion, and auto-insertion of closing tags.
 
-  http://www.emacswiki.org/emacs/HtmlHelperMode
-  http://savannah.nongnu.org/projects/baol-hth/
-  http://www.nongnu.org/baol-hth/
+ * http://www.emacswiki.org/emacs/HtmlHelperMode
+ * http://savannah.nongnu.org/projects/baol-hth/
+ * http://www.nongnu.org/baol-hth/
 
 Source.
 =======
@@ -466,12 +470,12 @@
 
 See:
 
-  http://www.emacswiki.org/emacs/BzrForEmacsDevs
+ * http://www.emacswiki.org/emacs/BzrForEmacsDevs
 
 Emacs Git mirror.
 -----------------
 
-  http://www.emacswiki.org/emacs/EmacsFromGit
+ * http://www.emacswiki.org/emacs/EmacsFromGit
 
 Patch.
 ======
@@ -483,8 +487,7 @@
 How report bug.
 ===============
 
-Visit http://debbugs.gnu.org or M-x report-emacs-bug.
-
+Visit http://debbugs.gnu.org or ``M-x report-emacs-bug``.
 
 Finding emacs packages.
 =======================
@@ -502,8 +505,6 @@
 
 ELPA goal is to make it simple to install, use, and upgrade Emacs Lisp packages.
 
-
-
 Currently (2011-02-15) available such sources::
 
   (setq package-archives '(("ELPA" . "http://tromey.com/elpa/")
@@ -524,15 +525,15 @@
 Emacswiki.
 ----------
 
-  http://www.emacswiki.org/emacs/ElispArea
-  http://www.emacswiki.org/emacs/WikifiedEmacsLispList
+ * http://www.emacswiki.org/emacs/ElispArea
+ * http://www.emacswiki.org/emacs/WikifiedEmacsLispList
 
 emacsmirror.
 ------------
 
-  https://github.com/emacsmirror/p/wiki
-  http://www.emacsmirror.org/
-  http://www.emacswiki.org/emacs/Emacsmirror
+ * https://github.com/emacsmirror/p/wiki
+ * http://www.emacsmirror.org/
+ * http://www.emacswiki.org/emacs/Emacsmirror
 
 Funny Emacs modes.
 ==================
--- a/fs.rst	Thu Jun 27 00:04:20 2013 +0300
+++ b/fs.rst	Thu Jun 27 00:13:23 2013 +0300
@@ -161,3 +161,17 @@
   UUID=D474CB9874CB7C2C /mnt/winbin ntfs-3g rw,default_permissions,gid=1000,fmask=113,dmask=002,noatime,silent 0 0
   ...
 
+Stop fsck running every 27 boots.
+=================================
+
+Check current settings::
+
+  $ tune2fs -l /dev/$DISK
+
+and tune them::
+
+  $ tune2fs -c 0 /dev/$DISK
+  $ tune2fs -i 2w /dev/$DISK
+
+Or disable checks in ``/etc/fstab`` completely (by setting last colon to ``0``
+value)!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mplayer.rst	Thu Jun 27 00:13:23 2013 +0300
@@ -0,0 +1,25 @@
+.. -*- coding: utf-8; -*-
+.. include:: HEADER.rst
+
+==========
+ mplayer.
+==========
+.. contents::
+
+Increase volume above sound cards maximum volume.
+=================================================
+::
+
+  $ mplayer -af volume=<v>:<sc> media.avi
+
+``<v>`` is the desired gain in dB for all channels in the stream from -200dB to
++60dB, where -200dB mutes the sound completely and +60dB equals a gain of 1000
+(default: 0).
+
+``<sc>`` Turns soft clipping on (1) or off (0). Soft-clipping can make the sound
+more smooth if very high volume levels are used. Enable this option if the
+dynamic range of the loudspeakers is very low.
+
+Maximizes the volume without distorting the sound::
+
+  $ mplayer −af volnorm media.avi
--- a/oracle.rst	Thu Jun 27 00:04:20 2013 +0300
+++ b/oracle.rst	Thu Jun 27 00:13:23 2013 +0300
@@ -27,6 +27,20 @@
                 Oracle Reports is a tool for developing reports against data
                 stored in an Oracle database.
 
+Useful PL/SQL stub.
+===================
+::
+
+  set serveroutput on;
+  set autotrace on statistics;
+  set timing on;
+
+  declare
+  begin
+    null;
+  end;
+  /
+
 Информация о таблицах в БД Oracle.
 ==================================
 
@@ -60,3 +74,75 @@
 
   select distinct tablespace_name from user_tables;
 
+Profiling.
+==========
+
+Timing info about last queries::
+
+  select LAST_LOAD_TIME, ELAPSED_TIME, MODULE, SQL_TEXT elasped from v$sql
+    order by LAST_LOAD_TIME desc
+
+Improved version of above code::
+
+  column LAST_LOAD_TIME format a20;
+  column TIME format a20;
+  column MODULE format a10;
+  column SQL_TEXT format a60;
+
+  set autotrace off;
+  set timing off;
+
+  select * from (
+    select LAST_LOAD_TIME, to_char(ELAPSED_TIME/1000, '999,999,999.000') || ' ms' as TIME, MODULE, SQL_TEXT from SYS."V_\$SQL"
+      where SQL_TEXT like '%BATCH_BRANCHES%'
+      order by LAST_LOAD_TIME desc
+    ) where ROWNUM <= 5;
+
+In SQL/Plus::
+
+  SET TIMING ON;
+  -- do stuff
+  SET TIMING OFF;
+
+or::
+
+  set serveroutput on
+  variable n number
+  exec :n := dbms_utility.get_time;
+  select ......
+  exec dbms_output.put_line( (dbms_utility.get_time-:n)/100) || ' seconds....' );
+
+See:
+
+  http://docs.oracle.com/cd/B19306_01/server.102/b14237/dynviews_2113.htm
+                $SQL lists statistics on shared SQL area without the GROUP BY
+                clause.
+
+Last table modification time.
+=============================
+::
+
+  select max(scn_to_timestamp(ora_rowscn)) from TBL;
+
+  select timestamp from all_tab_modifications where table_owner = 'OWNER';
+  select timestamp from all_tab_modifications where table_name = 'TABLE';
+
+List of Oracle Reserved Words.
+==============================
+
+ * http://docs.oracle.com/cd/B19306_01/em.102/b40103/app_oracle_reserved_words.htm
+
+Adjust date format.
+===================
+::
+
+  column parameter format a32;
+  column value format a32;
+  select parameter, value from v$nls_parameters;
+
+  alter session set NLS_DATE_FORMAT = 'yyyy-mm-dd HH:MI:SS';
+  alter session set NLS_TIMESTAMP_FORMAT = 'MI:SS.FF6';
+  alter session set NLS_TIME_FORMAT = 'HH24:MI:SS.FF6';
+
+  select sysdate from dual;
+
--- a/rst.css	Thu Jun 27 00:04:20 2013 +0300
+++ b/rst.css	Thu Jun 27 00:13:23 2013 +0300
@@ -15,5 +15,10 @@
     background-color: LightYellow;
     overflow: auto;
 }
+tt.literal {
+    background: LightYellow;
+    outline: 1px dotted orange;
+    padding: 1px;
+}
 table { border-collapse:collapse; margin-left:auto; margin-right:auto; }
 table, tr, td { padding: 3px; border: 1px dotted maroon; background-color: cornsilk; }
--- a/xml.rst	Thu Jun 27 00:04:20 2013 +0300
+++ b/xml.rst	Thu Jun 27 00:13:23 2013 +0300
@@ -78,6 +78,12 @@
 
 Validation of xml files.
 ========================
+::
+
+  $ jing schema.rng in.xml
+  $ xmllint --relaxng schema.rng in.xml
+
+See:
 
   http://infohost.nmt.edu/tcc/help/xml/lint.html
                 xmllint: A validator for XML files