Command line

  • POSIX (XCU "Shell & Utilities"): vi(1), awk(1), make(1), bc(1), sed(1), grep(1), sort(1), uniq(1), tee(1), wc(1), etc.
  • GNU Screen (useful to echo exec screen -xR >>~/.profile on a remote host)
  • Git: git-grep(1), git-stash(1), git-bisect(1), etc.
  • Ledger (useful for optimizing both finances and time)
  • Taskwarrior (TODO manager, highly recommended)
  • drive (one of CLIs for Google Drive)
  • Jekyll (generates static websites from markdown)

Web

Chrome OS

  • Google Keep (quite convenient for grocery lists)
  • Google Drive (directly accessible in Chrome OS' Files)
  • Secure Shell (the main SSH client for Chrome OS, supports SFTP in Files and SSH bookmarks, type ssh name@example.com in the address field)
  • Wolfram Alpha (type = universe age in planck times in the address field)

Disclaimer: I'm celebrating five years as a Chromebook user.

http://pubs.opengroup.org/onlinepubs/9699919799/

Только что опубликовали IEEE 1003.1-2008+TC1+TC2.

В список участников TC2 мое имя попало в связи с багами 735-737 против TC1:

https://codedot.dreamwidth.org/166992.html

Теперь грамматика языка Shell не содержит shift/reduce-конфликтов (можно засунуть ее в yacc(1) и убедиться, раньше было пять конфликтов), лишена двух лишних правил, а также корректно описывает произвольное количество команд в скриптах.
Так называемые жесткие комбинаторы принадлежат более узкому классу graph relabeling systems, чем graph rewriting systems, к которым относятся сети взаимодействия в общем случае. По научным меркам, они введены буквально вчера - в нулевых. По их поводу написано полторы статьи, а наивная реализация в современных FPGA/ASIC и для жестких комбинаторов не очень многообещающая, так как агенты одновременно служат и для вычисления и для хранения данных, что слишком затратно для FPGA/ASIC, где суммарный объем памяти регистров всегда на порядок, если не на два, меньше доступной на той же доске встроенной RAM. У последнего неизбежно оказывается бутылочное горлышко.

В определенной перспективе жесткие сети взаимодействия - логичное продолжение развития процессоров. Но на данном этапе этот подход кажется слишком далеким от практики, - возможно, им потребуется еще несколько лет побыть в академических кругах. Впрочем, коммерческие компании типа ARM и сами метят в ту же сторону. К сожалению, пока это только пресс-релизы и провалившиеся проекты, тем не менее, ключевые слова правильные - "clockless computation".

С точки зрения исследований, сети взаимодействия - гораздо более зрелое направление. Первые работы в эту стороны были в конце 80-ых, а первая система взаимодействия (Lamping) решала задачу оптимальной по Levy редукции, даже не называясь собственно системой взаимодействия (Lafont формализовал и обобщил такие системы уже пост-фактум). По данной теме доступны сотни статей, учебник (см. черновой перевод на русский язык соответствующей главы), монография, а также десятки различных программных реализаций, хотя большинство из них представляет собой лишь приложения к публикациям.

В отличие от жестких комбинаторов, сети взаимодействия в чистом виде неприменимы для архитектуры процессоров из-за необходимой перезаписи графов. Однако, возможен совсем другой подход.

Интернет позволяет передавать петабайты данных одновременно по тысячам разных каналов, когда как ни один из существующих суперкомпьютеров не может в одиночку добиться той же суммарной скорости в RAM. Можно посмотреть на интернет как на распределенную RAM. В связи с этим интересно было бы рассмотреть произвольные вычисления с использованием этой памяти.

Если пойти этим путем, естественным образом возникает проблема синхронизации. В случае BOINC она решается наличием серверов, проверяющих корректность работы. В случае Bitcoin проверка работы тривиальна и не отнимает у всех нод никакого существенного времени ценой дублирования десятков гигабайт информации на всех нодах. Заметим, что в обоих упомянутых случаях работа заранее выбрана так, что ее можно легко проверить, а также строго выполняется единая последовательность событий.

Если же мы хотели бы иметь децентрализованную вычислительную сеть для произвольной работы без требования единого timeline, то неизбежно возникают проблемы локальности и конфлюэнтости. К счастью, системы взаимодействия как раз и обладают последними двумя свойствами, давая возможность продолжать вычисления оптимальным образом без необходимости немедленной синхронизации.
What's your status?

Issue 735 Resolved and Accepted.

Issue 736 Needs an Interpretation and Accepted as Marked by Don Cragun:
Interpretation response
------------------------
The standard is unclear on this issue, and no conformance
distinction can be made between alternative implementations
based on this.  This is being referred to the sponsor.

Rationale:
-------------
The following changes make the grammar and text reflect existing
practice.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
On page 2350, lines 74801-74808, change

%start  complete_command
%%
complete_command : list separator
                 | list
                 ;

to:

%start program
%%
program          : linebreak complete_commands linebreak
                 | linebreak
                 ;
complete_commands: complete_commands newline_list complete_command
                 |                                complete_command
                 ;
complete_command : list separator_op
                 | list
                 ;

Cross-volume change to XRAT...

At page 3700 line 126612 section C.2.10 delete:

The start symbol of the grammar (complete_command) represents
either input from the command line or a shell script.  It is
repeatedly applied by the interpreter to its input and represents
a single "chunk" of that input as seen by the interpreter.

Issue 737 Resolved and Accepted.
http://austingroupbugs.net/view.php?id=737

Shell Grammar Rules for compound_list duplicate the definition of linebreak
linebreak        : newline_list
                 | /* empty */
                 ;
which results in four grammar rules for compound_list instead of two.

Desired Action

On page 2350, lines 74834-74838, change
compound_list    :              term
                 | newline_list term
                 |              term separator
                 | newline_list term separator
                 ;
to
compound_list    : linebreak term
                 | linebreak term separator
                 ;
http://austingroupbugs.net/view.php?id=736

An empty Shell program and a program consisting of two or more commands separated with NEWLINE tokens are valid Shell scripts. However, Shell Grammar Rules only accept exactly one single command which results in a syntax error against zero commands and two or more commands separated with NEWLINE tokens.

Desired Action

On page 2350, lines 74801-74808, change
%start  complete_command
%%
complete_command : list separator
                 | list
                 ;
to
%start script
%%
script           : commands linebreak
                 | /* empty */
                 ;
commands         : commands newline_list complete_command
                 |                       complete_command
                 ;
complete_command : list separator_op
                 | list
                 ;
http://austingroupbugs.net/view.php?id=735

When processed by yacc(1), Shell Grammar Rules result in 5 shift/reduce conflicts. These conflicts are all caused by unnecessary linebreak non-terminals in case_item_ns rule after compound_list non-terminals. The linebreak non-terminal are indeed unnecessary because compound_list rule
compound_list    :              term
                 | newline_list term
                 |              term separator
                 | newline_list term separator
                 ;
where
separator        : separator_op linebreak
                 | newline_list
                 ;
itself embeds linebreak definition
linebreak        : newline_list
                 | /* empty */
                 ;
Without the trailing linebreak non-terminals following compound_list, yacc(1) produces no shift/reduce conflicts.

Desired Action

On page 2351, lines 74863-74866, change
case_item_ns     :     pattern ')'               linebreak
                 |     pattern ')' compound_list linebreak
                 | '(' pattern ')'               linebreak
                 | '(' pattern ')' compound_list linebreak
                 ;
to
case_item_ns     :     pattern ')' linebreak
                 |     pattern ')' compound_list
                 | '(' pattern ')' linebreak
                 | '(' pattern ')' compound_list
                 ;

Disaster

Jul. 25th, 2013 01:25 pm
http://ivan-gandhi.livejournal.com/2404418.html?thread=32857666

Her Diary

Tonight, I thought my husband was acting weird. We had made plans to meet at a nice restaurant for dinner. I was shopping with my friends all day long, so I thought he was upset at the fact that I was a bit late, but he made no comment on it. Conversation wasn't flowing, so I suggested that we go somewhere quiet so we could talk. He agreed, but he didn't say much. I asked him what was wrong. He said, "Nothing." I asked him if it was my fault that he was upset. He said he wasn't upset, that it had nothing to do with me, and not to worry about it. On the way home, I told him that I loved him. He smiled slightly, and kept driving. I can't explain his behavior. I don't know why he didn't say, "I love you, too." When we got home, I felt as if I had lost him completely, as if he wanted nothing to do with me anymore. He just sat there quietly, and watched TV. He continued to seem distant and absent. Finally, with silence all around us, I decided to go to bed. About 15 minutes later, he came to bed. But I still felt that he was distracted, and his thoughts were somewhere else. He fell asleep - I cried. I don't know what to do. I'm almost sure that his thoughts are with someone else. My life is a disaster.

His Diary

My code is broken, can't figure out why.
http://iospress.metapress.com/content/l5r8t7n6755286h1/

Universal Hard Interaction for Clockless Computation
Dem Glücklichen schlägt keine Stunde!
Sylvain Lippi

We give a self-contained presentation of Hard Interaction, a rewriting system on fixed graphs. We discuss the universality of natural subclasses of hard systems and highlight the main ideas that lead to a universal system with 7 rules called Hard Combinators.

Keywords: hard interaction nets, abstract machine, asynchronous computation, digital circuits, graph relabeling.
module brain (clk, sensor, effect);
	parameter nbit = 12;
	parameter size = 2 ** nbit;
 
	input clk;
	input [7:0] sensor;
	output [7:0] effect;
 
	reg sig [0:size - 1];
	reg trace [0:size - 1];
	reg [nbit - 1:0] ram [0:size - 1];
 
	assign effect[3:0] = {sig[3], sig[2], sig[1], sig[0]};
	assign effect[7:4] = {sig[7], sig[6], sig[5], sig[4]};
 
	integer i;
 
	initial for (i = 0; i < size; i = i + 1) begin
		trace[i] = 0;
		sig[i] = 0;
		ram[i] = i;
	end
 
	always @(posedge clk) begin
		for (i = 0; i < 8; i = i + 1)
			sig[ram[i]] <= sensor[i];
 
		for (i = 0; i < size; i = i + 1) begin
			case ({trace[i], sig[ram[i]]})
			2'b00: ram[i] <= ram[i] + 1;
			2'b01: sig[i] <= 1;
			2'b10: sig[i] <= 0;
			2'b11: ram[i] <= ram[i] - 1;
			endcase
 
			trace[i] <= sig[ram[i]];
		end
	end
endmodule
 
`ifdef SIM
module sim;
	reg clk = 0;
	reg [7:0] key;
	wire [7:0] led;
 
	brain core(clk, key, led);
 
	integer c;
 
	always begin
		c = $fgetc(32'h8000_0000);
		if (-1 == c)
			$finish;
 
		key = c[7:0];
		#1 clk = ~clk;
		#1 clk = ~clk;
		$displayb(led);
	end
endmodule
`endif
`define OPZ 4'b1111
`define OPA 4'b0001
`define OPL 4'b0010
`define OPN 4'b0100
`define OPS 4'b1000

`define BIT 15
`define SIZE (2 ** `BIT)

module ram0 (clk, op, led);
	input clk;
	input [3:0] op;
	output [7:0] led;

	reg [`BIT - 1:0] ram [0:`SIZE - 1];
	reg [`BIT - 1:0] n, z;

	assign led = z[7:0];

	always @(posedge clk) begin
		case (op)
		`OPZ: z = 0;
		`OPA: z = z + 1;
		`OPL: z = ram[z];
		`OPN: n = z;
		`OPS: ram[n] = z;
		endcase
	end
endmodule

`ifdef SIM
module sim;
	reg clk = 0;
	reg [3:0] op;
	wire [7:0] led;

	ram0 core(clk, op, led);

	integer ch;

	always begin
		ch = $fgetc(32'h8000_0000);
		case (ch)
		"z", "Z": op = `OPZ;
		"a", "A": op = `OPA;
		"l", "L": op = `OPL;
		"n", "N": op = `OPN;
		"s", "S": op = `OPS;
		-1: $finish;
		default: op = 0;
		endcase

		if (op) begin
			#1 clk = ~clk;
			#1 clk = ~clk;
			$displayb(led);
		end
	end
endmodule
`endif
Килобит можно передать одним сообщением по SMS.

При этом его достаточно, чтобы адресовать любую точку пространства-времени с точностью до планковских единиц измерения на протяжении 1027 лет, что в 1017 раз больше, чем уже прошло после момента Большого взрыва. Для сравнения, полкилобита адресуют около ста микросекунд. Для данной оценки использовался гиперобъем гиперконуса, который примерно равен гиперобъему гиперкуба со стороной, равной высоте этого гиперконуса.

Таким образом, килобитных адресов хватает на любую мыслимую на сегодняшний день научную фантастику: с невероятным запасом покрываются нужды однозначной адресации для реализованных и доведенных до совершенства квантового компьютера, телепортации, машины времени и кротовых нор вместе взятых.

Теперь предположим, что у нас есть хэш-функция F, похожая на SHA-2, но с размером хэша и размером блока ровно в один килобит (вместо обычных 256 бит и 512-битных блоков), и способ адресации, подобный .onion-доменам для анонимных сервисов в сети Tor, причем каждый сервис хранит ровно одну килобитную ячейку памяти.

Интересно было бы рассмотреть распределенную RAM0-подобную вычислительную сеть с семантикой команд, измененной следующим образом (предполагается отсутствие коллизиций на килобитных блоках):

#define A	z = F(z)
#define L	z = recvkbit(z)
#define N	n = z
#define S	sendkbit(n, z)

Hidden SSH

May. 3rd, 2013 08:36 pm
root@debian:~# apt-get install tor
Reading package lists... Done
Building dependency tree       
Reading state information... Done
[...]
root@debian:~# grep '^Hidden' /etc/tor/torrc
HiddenServiceDir /var/lib/tor/honey/
HiddenServicePort 22 127.0.0.1:22
root@debian:~# /etc/init.d/tor restart
Stopping tor daemon: tor.
Raising maximum number of filedescriptors (ulimit -n) to 8192.
Starting tor daemon: tor...
[...]
May 03 20:08:30.201 [notice] Opening Socks listener on 127.0.0.1:9050
done.
root@debian:~# torsocks ssh `cat /var/lib/tor/honey/hostname`
root@ohdzjoric6qwtr2c.onion's password: 
Linux debian 2.6.32-5-amd64 #1 SMP Mon Feb 25 00:26:11 UTC 2013 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri May  3 20:10:22 2013 from localhost
root@debian:~# dd if=/dev/urandom of=data count=1k
1024+0 records in
1024+0 records out
524288 bytes (524 kB) copied, 0.081219 s, 6.5 MB/s
root@debian:~# md5sum data
81d52fca4cfe42dca24659850139672a  data
root@debian:~# logout # latency about 1-2 sec.
Connection to ohdzjoric6qwtr2c.onion closed.
root@debian:~# torsocks scp `cat /var/lib/tor/honey/hostname`:data copy
root@ohdzjoric6qwtr2c.onion's password: 
data                                          100%  512KB  28.4KB/s   00:18    
root@debian:~# md5sum copy
81d52fca4cfe42dca24659850139672a  copy
root@debian:~# 
IBM Journal of Research and Development, vol. 5, pp. 183-191 (1961)
Rolf Landauer

It is argued that computing machines inevitably involve devices which perform logical functions that do not have a single-valued inverse. This logical irreversibility is associated with physical irreversibility and requires a minimal heat generation, per machine cycle, typically of the order of kT for each irreversible function. This dissipation serves the purpose of standardizing signals and making them independent of their exact logical history. Two simple, but representative, models of bistable devices are subjected to a more detailed analysis of switching kinetics to yield the relationship between speed and energy dissipation, and to estimate the effects of errors induced by thermal fluctuations.

http://folk.uio.no/feder/Fys3130/Entropy/Landauer1961.pdf

See also discussion of Landauer's principle.
Знаете ли вы, что 256 бит достаточно, чтобы хранить свыше 1016 возрастов Вселенной в планковских единицах измерения времени? Это наименьшая степень двойки, дающая достаточно места, чтобы хранить возраст, диаметр и массу Вселенной в планковских единицах измерения:

http://en.wikipedia.org/wiki/Planck_units

Предлагаю отныне не мелочиться, а выбрать машинное слово размером в 32 байта раз и навсегда.

Тип uint256_t - наше все! В прямом смысле этого слова.

#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <time.h>

main()
{
        uint256_t age = getage();

        printf("Happy %" PRIu256 " Planck times!\n", age);

        return 0;
}
http://www.knosof.co.uk/poschk.html

Applications POSIX.1 conformance testing

Derek Jones
derek@knosof.co.uk
Knowledge Software Ltd
Farnborough, Hants
UK


ABSTRACT

The Standards for POSIX and C were designed to enable the portability of applications across platforms. A lot of work has gone into checking compilers and environments for conformance to these Standards, but almost nothing has been done to check applications conformance. The incorrect assumption being made that the development compiler will warn about any construct that needs looking at. This paper discusses a tool that checks applications software for conformance to these Standards at compile, link and runtime as well as the library interface. Any application that can pass through this checker without producing any warnings is a conforming POSIX program and a strictly conforming C program.

© Copyright 1992,95. Knowledge Software Ltd. All rights reserved;

Presented at the EurOpen & USENIX Spring 1992 Workshop/Conference

Emacs

Jan. 7th, 2013 01:02 am
IEEE 1003.1-2008, C.4.3 Exclusion of Utilities:

emacs

The community of emacs editing enthusiasts was adamant that the full emacs editor not be included in the base documents because they were concerned that an attempt to standardize this very powerful environment would encourage vendors to ship versions conforming strictly to the standard, but lacking the extensibility required by the community. The author of the original emacs program also expressed his desire to omit the program. Furthermore, there were a number of historical UNIX systems that did not include emacs, or included it without supporting it, but there were very few that did not include and support vi.
This script was written on Solaris 11 running inside VirtualBox.

set -Cex

ROOT=/opt/euromake
DEFROUTER=10.0.2.2
NETWORK=17
MIN=10
MAX=99

cd $ROOT

mkdir -p vacant
for p in $(ls vacant); do
	test -d "vacant/$p"
	if echo $$ >"vacant/$p/lock"; then
		POOL=$p
		trap 'rm -f "vacant/$POOL/lock"' INT TERM EXIT
		break
	fi
done

test "$POOL" -ge "$MIN"
test "$POOL" -le "$MAX"

read ZONE <vacant/$POOL/next
test "$ZONE" -ge "$MIN"
test "$ZONE" -le "$MAX"

ZONENAME=$NETWORK.$POOL.$ZONE
ZONEPATH=/zones/clones/$NETWORK/$POOL/$ZONE

# Comment at your own risk!
echo \
zonecfg -z $ZONENAME <<-COMMIT
	create
	set zonepath=$ZONEPATH
	select anet linkname=net0
		set defrouter=$DEFROUTER
		set allowed-address=10.$ZONENAME
	COMMIT
echo \
zoneadm -z $ZONENAME clone origin # from /zones/origin

NEXT=$(($ZONE + 1))
if [ "$NEXT" -le "$MAX" ]; then
	echo $NEXT >|vacant/$POOL/next
	rm -f vacant/$POOL/lock
else
	mkdir -p full
	test ! -e "full/$POOL"
	mv vacant/$POOL full
fi

trap - INT TERM EXIT

Debugging )
Page generated Jul. 6th, 2025 07:41 am
Powered by Dreamwidth Studios