Day
No Comments
Seating in pizza pepperoni, waiting for karlsberg and lana. Stupid day, did nothing to remember. Stas in seole (s. Korea). Yossi announced tha he is going to stop seat in searoad’s office permanently: elena got rein.
python: tabs vs space
I have searched trough some sources and here is my findings, regarding what symbols are used for indentation:
- Perl modules mostly (there is some exceptions) written with space indentation
- Python – spaces
- Cakephp – with tabs
I think I’ll dare to use tabs in general programming (bash / perl / python / php). The main reason is this: I really like to change the visible indent at my will during work with vim. This is done by simple command
:set tabstop
To apply the desired behavior my vimrc file for vim has been altered to contain the following lines:
:set tabstops=4
:set shiftwidth=4
“:set expandtab
“:set softtabstop=4
(last two lines are commented out)
In vim plugin (~/.vim/plugin/python.vim) comment out line
:setlocal expandtab
http://vim.wikia.com/wiki/Indenting_source_code
Discussion for tabs / space use in Python:
http://stackoverflow.com/questions/119562/tabs-versus-spaces-in-python-programming
virtualbox: clone vm, alter MAC of NIC
After alteration of NIC MAC address I do the following in the guest OS (Linux):
- login via RDP
- delete /etc/udev/rules.d/70-persistent-net.rules
- restart vm
- check the same file (it will be re-created by the system). Specifically, you want to know what name new interface had been given (eth0 / eth1 etc)
- make a copy of config file (in /etc/sysconfig/network-scripts/ for centos or fedora) for new interface
- restart network
wifi antenna
I had annoying problem with radio link quality in my house. I am determined to avoid multiple AP (access points) design to cover all rooms in both 2 floors. Main problem, as I understand, is the necessity for radio wave to penetrate walls at sharp angles. I alleviated such a curse by moving out the AP away from the house for 3 meters, which didn’t solve the problem entirely anyway. dd-wrt, installed on my AP, allows to boost the output power, which didn’t help either. I’ve replaced stock antennas with parabolic one, which didn’t help much, probably because with such an antenna radio signal is concentrated in one direction, while I wanted to cover wide area in both vertical and horizontal dimensions. So, at the time being very skeptical about fiddling with antenna, I tried collinear antenna, described over here:
http://martybugs.net/wireless/collinear.cgi
It proves to be exactly what I need. While I didn’t get substitution for my wired network (throughput rate is limited to something 1.2-2.5 Mb / per second in most areas of my home), the connection become persistent – I didn’t notice any single annoying interruption within a month, during which new antenna was in operation.
It proves to be very easy to assemble the antenna. I have used, as the author, a length of electrical copper wire. Measurement have been done with standard ruler allowing for mediocre precision at best (I think I did manage to keep to schema measurement within 1-3 mm of given specification). My modification to the original design was just connectors: I’ve utilized existing antenna cable, by cutting one end and soldering it directly to the antenna, leaving connector on the other (AP) side untouched. As some folks says, it shall save some 1-2 dbi. There was no hassle with the alignment of the antenna on installation at all.
I have very little to add to the original article, which is fairly comprehensive. One thing that perhaps might be exposed in greater details is this: shaping the copper wire. I know, while for most of skillful man and women around this task is easy enough, some people might find it useful.
First, bend 90 degree angle. Then, I used spare AAA battery (it will not be crippled, so it can be used than again) to wrap the wire around it. Copper is soft, so no great deal of strength is required.
Here the loop is finished. As the original articles suggests, I’ve avoided the coils to touch each other
Here, kind of ‘final tuning’ of a coil. The final shape is far from catching the eye, not to say pretty ugly, but it is concealed in a plastic pipe, and, most importantly, it works.
Вот такую рекомендацию я вычитал на одном из русских форумов в отношении качества / размера кодированных фильмов:
==================================================
для определения качества обычно высчитывают коэффициент bits/(pixel*frame)
Если он 0.17 – 0.20 (или более), рип будет хорошим. Если меньше – может быть тоже неплохим, но на динамических сценах будут заметны артефакты, типа квадратиков и прочее из-за потери детализации (в пользу меньшего размера).
Теперь посчитаем. Количество кадров 1ч 28м 11с * 29.97 = 158571
Размер звуковой дорожки 448 / 8 * 1ч 28м 11с * 1024 = 289МБ
Размер видео 4.37ГБ – 289МБ = 4397932544 байт
Теперь считаем коэфф
4397932544 * 8 / (1280 * 720 * 158571) = 0.24, что даже несколько избыточно (но делать рип меньше размера болванки не вижу смысла)
Для того рипа, на который ты прислал ссылку (не буду вдаваться в столь детальные расчеты, воспользуюсь программкой ) получим 0.156. Что в принципе тоже неплохо, но ниже уровня качества.
Я редко опускаюсь ниже 0.17. Только для оч длинных фильмов, которые не хочется разбивать на неск-ко болванок.
In open office, there is annoying thing with printing documents: it always print to the default paper tray. The solution was easy: change ‘printer language type’ from ‘PDF’ to ‘Postscript (level from driver)’ – this setting can be found here:
File->Printer settings->Properties->Device tab->Printer language type.
Now, I can select what paper tray printer will take paper from. This problem I had with HP P4014 printer.
Best Practical: Barcelona RT seminar
There were just above 15 of attendants in small class with some supply of coffee, snacks and water during the classes. As far as I remember, most folks were from Spain (obviously), German and Norway (sorry, if I am totally wrong). I was definitely the most hopeless attendee among them. Seminar had been conducted by Kevin Falcon, smart, energetic, very well prepared and very well experienced Best Practical’s engineer. Within 2 days he seemed to touch any existing technical perspective of the Request Tracker. I would want to listen more on tackling specific user cases, implementation of various work flows and conditions. Most probably, it is neither possible nor practicable to combine coverage of low level technical details together with studying of ‘high level’ development methods and approaches. For sure, there were no room for both in 2 working days session.
The seminar provided me with deep and extensive appreciation of RT features and potential (within my abilities, of course). Definitely, my plans in respect of information system, employed in our office, must be, hmm, corrected. A bit.
An extra side note: I’ve never seen this number of Macbooks in a single room .
xfce / keyboard layout switch
I am fed up with new fancy unity environment – the responsiveness of the windows simply deteriorated during the session on my Vaio VPCY11S1E laptop. The unity’s ‘external’ design is promising, but the implementation, imho, is not for long hours workers. 2D alternative lacks basic customization tools (you can’t, for example, change the size of the launcher’s icons), have no handy transparency option by design, so I quit before I tested it any further.
I am also not big fun of new Gnome: I didn’t find the idea to hide out list of open windows contributing to productivity. I would say, I am of quite opposite opinion. And constant multi-pulit zoom in – zoom out upon switching between the windows makes my sleeping acrophobian quirks to annoy me even more.
I am as much disappointed as I was when KDE had introduced their plasma desktop, which pleased the eyes, but made routing working with the desktop miserable.
So, as many I suppose, I opted for XFCE. I’ll not advertise here this gdm – enough to say that I like it, it does have anything I need, it is lightweight and have pleasant outfit. The problems:
XKB keyboard layout plugin. This plugin supposed to provide with switch capabilities, interface for customization and indicator icon in notification area. While the latter probably works fine, the first two unfortunately are not very useful. My current workaround for multi-lingual installation is this:
- Create executable file somewhere (/home/me/bin/set_keyboard):
setxkbmap -layout "us,ru" -option "grp:alt_shift_toggle"
- create file somename.desktop in directory /home/me/.config/autostart
[Desktop Entry] Version=1.0 Encoding=UTF-8 Name=Script Type=Application Exec=/home/me/bin/set_keyboard_layouts Icon= Terminal=false Hidden=false GenericName=
Ubuntu 11.10 / Vaio Y series / VPCY11S1E
Working 3rd day with the new distro. Finding so far:
- backlight / screen brightness is not working. Solution remains the same, as with previous Ubuntu distros (here).
- USB ports are dead on weak up from suspend.
- Virtualbox running WinXP guest machine drops current session after weak up from suspend.
- The display GUI manager works OK except one sequence: after switching from laptop screen to external screen, the latter view is scrambled. If both screen, on laptop and the external are on, there is not problem. Solution: use xrandr to manipulate output of Xserver.
- Sound output to on-board speakers do not switch off if headphones are plugged in.

