: ) wonderful world ( :

the metasyntactic variable

Archive for March 2009

data matrix

without comments

grault

grault

I’ve tried "Data Matrix" technology today with my cellphone and i-nigma reader. It works.

Written by grault

March 25, 2009 - 4:10 pm at March 25, 2009 - 4:10 pm

Posted in noise, notes, random

connecting grepping into sed

with 5 comments

I use grep and sed mostly as the following pattern

cat file | grep some-pattern | sed s/other-pattern/replacement/

 

But what if some-pattern and other-pattern is the same, moreover you want to refer groups in replacement. Here’s what sed offers for this:

cat file | sed -e 's/pattern/replacement/p; d'

Written by grault

March 24, 2009 - 5:24 pm at March 24, 2009 - 5:24 pm

Posted in command line, linux, notes

uuid.el

without comments

I’ve downloaded uuid.el for purposes which are subject to upcoming posts. There were #B01000000-like binary number representations in it, foreign to my installed XEmacs (saying Invalid read syntax: “#”). Version is the same as in this post. Anyway,

$ diff uuid.el.orig uuid.el
94c94
<           (logior #B01000000 (logand #B01111111 (nth 7 bytes))))
---
>           (logior 64 (logand 127 (nth 7 bytes))))
96c96
<           (logior #B01000000 (logand #B01001111 (nth 8 bytes))))
---
>           (logior 64 (logand 79 (nth 8 bytes))))
$

Written by grault

March 14, 2009 - 11:22 pm at March 14, 2009 - 11:22 pm

Posted in lisp

windows vista, xemacs, emms

with one comment

Additional comments to this site on EMMS. I got the same “don’t know how to play track” message discussed on the page. First of all I played with emms source in a *scratch*. I realized that I did’t have executable-find, so I copied one from here which didn’t work, so I’ve extended it a little like this:

(defun executable-find (command)
  (or (executable-find-orig command)
      (executable-find-orig (concat command ".exe"))))

(defun executable-find-orig (command)
  (let ((list exec-path)
	file)
    (while list
      (setq list (if (and (setq file (expand-file-name command (car list)))
			  (file-executable-p file)
			  (not (file-directory-p file)))
		     nil
		   (setq file nil)
		   (cdr list))))
    file))

 

Now it works. By the way, this post was inspired by this blog entry. XEmacs was [version 21.4.21; October 2007] downloaded in an installer exe file yesterday from www.xemacs.org.

 

Best Regards

Written by grault

March 10, 2009 - 5:22 pm at March 10, 2009 - 5:22 pm

Posted in lisp