суббота, 21 ноября 2009 г.

perl vs python

perl vs python

мысли по http://michurin.com.ru/python-vs-perl.shtml

На перле работаю несколько лет, на питоне пока непробовал.

Статья в целом очень занимательная.

Обработка исключений, перегрузка операторов, проверка типов -- действительно полезные фичи питона, с которыми в перле мне было бы веселей.

Многие сравнения с перлом проводятся на основе его "по умолчанию",
которые переделываются в "по своему" парой строк на проект.
Например, всегда работаю в "use strict" и объявляю локальные "my" переменные.

В перле можно реализовать любое вообразимое ООП под себя (включая аналоги тех же декоратор-ов),
например с помощью AUTOLOAD и препроцессора.
А вот реализация, изначально и намертво встроенная в другой ООП-язык, скорее всего будет менее гибка.

Синтаксис и грамматика питона выглядит положительно, но тут пробовать надо.

Итог:
Стимул к переползанию с перла выглядит недостаточно сильным.
А вот для начинающих с нуля выбор питона более очевиден.





воскресенье, 15 ноября 2009 г.

linux firefox webdav integration

linux firefox webdav integration

We can integrate firefox with many programs without going deep into system programming using mozplugger.

Install mozplugger; see man; see "about:plugins";
edit /etc/mozpluggerrc or ~/.mozilla/mozpluggerrc:

application/test:test:test
     embed swallow(xeyes) stream: xeyes

application/davmount+xml:davmount:WebDAV
     embed swallow(kkk) stream: plasmoidviewer --name kkk folderview "$fragment"
# links stream: dolphin "$fragment"

To make changes take effect:
$ rm ~/.mozilla/firefox/some.profile/pluginreg.dat

Here we add config to view WebFolder inside the web page;
stream: this command can take an url;
swallow(name): move window with the specified name;
name is obtained by: $ xprop WM_CLASS;
$fragment was used intead of $file, because the $file required to be real one;
multiple embed-s on one page was not working properly.

Page will include a code like this:
<embed
type="application/davmount+xml"
src="#webdav://myhost.ee:8080/pub"
width="600" height="600">
</embed>

Further look:
in X: XReparentWindow(...). XEmbed over it; in Qt QX11EmbedContainer, QX11EmbedWidget; Gtk Socket.

Nice utils was also found:
tabbed manager: http://torjian.blogspot.com/2009/11/tabbed-terminal-xembed.html
wmctrl -l

ActiveState Komodo uses plugins to embed the Scintilla editor in its XUL-based UI.
Search gnash for --disable-kparts / --disable-nsapi, because it supports both kpart and nsplugin
The same (file list?) kpart is used in dolphin and konqueror.
Some integration in new SUSE: http://opensuse.org/OpenSUSE_11.2

вторник, 10 ноября 2009 г.

dual-seat

Hi,

I have dual-head ATI card and want to configure dual-seat for me and Vika.
So that when working alone to use 2 monitors, but when she comes to give the second one to her.
Usually multi-seat implies display manager configuration and multiply instances of Xorg server.
But there was problem to share the card between servers,
and no really need to maintain security between me and her.

So I found, that nested X server can be used here.
Nested X server is a (fullscreen) client of the main one.
Second keyboard and mouse need to be used by the nested server and ignored by the main one

------- actions -------------------------------------------------------------
configure the card, 2 screens for single user, and restart to apply changes:
$ aticonfig --initial=dual-head --resolution=1,1024x768
$ servise gdm restart
install xserver-xephyr
see, what input devices do we have:
$ hal-device
compose /etc/hal/fdi/policy/input.fdi to disable chosen devices
restart hal
replug devices
add .../bin/Xep.sh
use or make shortcut with gksu:
$ sudo Xep.sh
---------- input.fdi -----------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.mouse">
<match key="info.product" contains="Converter">
<merge key="input.x11_driver" type="string"></merge>
</match>
</match>
<match key="info.capabilities" contains="input.keys">
<match key="info.product" contains="Converter">
<merge key="input.x11_driver" type="string"></merge>
</match>
</match>
</device>
</deviceinfo>
------------- Xep.sh -----------------------------------------------------------
#!/bin/bash
DISPLAY=:0.1
Xephyr :1 -fullscreen \
-mouse evdev,,device=/dev/input/by-id/usb-Composite_USB_PS2_Converter_USB_to_PS2_Adaptor_v1.12-event-mouse \
-keybd evdev,,device=/dev/input/by-id/usb-Composite_USB_PS2_Converter_USB_to_PS2_Adaptor_v1.12-event-kbd &
DISPLAY=:1
DBUS_SESSION_BUS_ADDRESS=''
HOME=/home/vika
sleep 2
sudo -u vika startkde
-------------- explain ---------------------------------------------------------
in .fdi we need to reset input.x11_driver from 'evdev' to '',
so Xorg will ignore the device

:0.1 is xserver_number.screen_number --
Xephyr starts as client on :0.1 (main Xorg server) and then serves on :1

/dev/input/eventX are changing,
.../by-id/...-event-... are stable (at least if all devices are different)

kde needed DBUS_SESSION_BUS_ADDRESS and HOME reset and delay to start

test xephyr with input devices by:
$ xeyes -display :1

not yet seen, what is #XAUTHORITY="/var/lib/gdm/:0.Xauth"

not yet able to stop xephyr without killall

not yet tried: xfce4-session

also useful:
cat /proc/bus/input/devices

--------- links ----------------------------------------------------------------

idea to use xephyr for multiseat:
http://netpatia.blogspot.com/search/label/multiseat

xephyr mouse options:
http://lists.freedesktop.org/archives/xorg/2008-November/040253.html

mdm ready solution (not tried):
http://wiki.c3sl.ufpr.br/multiseat/index.php/Live-CD

very good story about xorg, hal, fdi:
http://who-t.blogspot.com/2008/07/input-configuration-in-nutshell.html






This page is powered by Blogger. Isn't yours?

Подпишитесь на каналы Сообщения [Atom]