пятница, 28 августа 2009 г.

SyntaxHighlighter - подсветка кода (плагин для MaxSite CMS)

SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript.

http://alexgorbatchev.com/wiki/SyntaxHighlighter

Возможности

Подсветка 21-го языка (список тут), поддержка css-тем оформления (6 штук в комплекте).

Украинский перевод в комплекте :)

Требования

MaxSite CMS 0.334+

Использование

Заключить код в один из следующих тэгов:
  • <pre lang=язык> </pre>
  • <code lang=язык> </code>
  • [pre lang=язык] [/pre]
  • [code lang=язык] [/code]

Примеры работы

syntaxhighlighter screenshot

Лог работ

29.08.09 - β-beta версия
  • изменения на странице настройки плагина - сделал более по-человечески :)
28.08.09 - α-alpha версия
  • initial release, так сказать :)

Скачать

четверг, 27 августа 2009 г.

Chili - подсветка кода (плагин для MaxSite CMS)

Маленький плагин для MaxSite CMS - подсветка кода. Основан на Chili 2.2.

Chili is the jQuery code highlighter plugin.
Copyright (c) Andrea Ercolino
Published under the MIT License, and the GPL License.

Features

  • Very fast highlighting, trivial setup, fully customizable, thoroughly documented, and MIT licensed

  • Renders identically on IE, Firefox, Mozilla, Opera, and Safari

  • Comes bundled with recipes for C++, C#, CSS, Delphi, Java, JavaScript, LotusScript, MySQL, PHP, and XHTML

  • Many configuration options: Static, Dynamic, Automatic, Manual, Ad-Hoc, with Metaobjects

  • Provides fine control over which elements get highlighted by means of a jQuery selector or the mithical jQuery chainability.

  • Fully supports javascript regular expressions, including backreferences

  • The replacement format gives full control on what HTML is used for highlighting

  • Provides examples which show setups and features




Как использовать


Нужно заключить свой код между элементами CODE с параметром lang как у языка кода, т.е.


<code lang="html">
<!-- какой-то html код -->
</code>


также можно использовать bb-код: [code lang="html"] и [/code].

Скриншот


chili scrshot

Лог работ


27.08.09



  • Начало (alpha)



Загрузить плагин Chili (zip, 46KB)

понедельник, 24 августа 2009 г.

Роза ветров в gnuplot

Розы ветров (нарисованные с помощью gnuplot) для городов Ровно (Рівне), Сарны (Сарни) и Луцк (Луцьк) в зависимости от повторяемости направлений ветра и средней скорости ветра по направлениям.

Розы ветров (повторяемость направлений ветра)


роза ветров г. Ровно (повторяемость направлений ветра) роза ветров г. Сарны (повторяемость направлений ветра) роза ветров г. Луцк (повторяемость направлений ветра)

Розы ветров (средняя скорость ветра по направлениям)


роза ветров г. Ровно (средняя скорость ветра по направлениям) роза ветров г. Сарны (средняя скорость ветра по направлениям)  роза ветров г. Луцк (средняя скорость ветра по направлениям)

Графики построены по данным из СНиП 2.01.01-82. Строительная климатология и геофизика

UPD 06.01.2010:

Скрипт гнуплот:

set title "Роза ветров, г. Ровно\n(повторяемость направлений ветра, %)" font "CALIBRI.TTF,16"
set encoding default

set polar
set angles degrees

set size square
unset border
set xtics axis nomirror
set ytics axis nomirror
set grid polar 45
set xrange [-30:30]
set yrange [-30:30]

set key right bottom
#set style line 1 lt 2 lw 3
#set key box

# labels
set label "С" at graph 0.52, 0.95 font "CALIBRI.TTF,14"
set label "СВ" at graph 0.80, 0.85 font "CALIBRI.TTF,14"
set label "В" at graph 0.95, 0.52 font "CALIBRI.TTF,14"
set label "ЮВ" at graph 0.80, 0.15 font "CALIBRI.TTF,14"
set label "Ю" at graph 0.52, 0.05 font "CALIBRI.TTF,14"
set label "ЮЗ" at graph 0.17, 0.15 font "CALIBRI.TTF,14"
set label "З" at graph 0.05, 0.52 font "CALIBRI.TTF,14"
set label "СЗ" at graph 0.17, 0.85 font "CALIBRI.TTF,14"

set label "lokee, http://lokee.rv.ua" at graph 0, 0 font "CALIBRI.TTF,8"

set terminal png small size 800,800 font "CALIBRI.TTF,10"

# line styles
set style line 1 linetype 1 linewidth 2 linecolor rgb "blue"
set style line 2 linetype 1 linewidth 2 linecolor rgb "red"

# wind rose
#load "wr-rivne-labels-jan.plt"
set output "wr-rivne.png"
plot "wr-rivne.dat" using 2:3 with lines linestyle 1 title "Январь"

set output "wr-rivne.png"
replot "wr-rivne.dat" using 2:4 with lines linestyle 2 title "Июль"

# роза ветров (скорость ветра)
unset title
set title "Роза ветров, г. Ровно\n(средняя скорость ветра по направлениям, м/с)" font "CALIBRI.TTF,16"

unset xrange
unset yrange
set xrange [-10:10]
set yrange [-10:10]
set xtics 2
set ytics 2

set output "wsr-rivne.png"
plot "wr-rivne.dat" using 2:5 with lines linestyle 1 title "Январь"

set output "wsr-rivne.png"
replot "wr-rivne.dat" using 2:6 with lines linestyle 2 title "Июль"


wr-rivne.dat

# - направл.. % - - скорость. м/с -
# напр. угол Январь Июль Январь Июль
В 0 8 5 4.5 2.8
СВ 45 5 7 3.9 3.3
С 90 7 10 4.9 4.0
СЗ 135 12 23 6.5 4.9
З 180 27 29 7.5 4.6
ЮЗ 225 14 11 6.1 3.7
Ю 270 14 7 5.1 3.4
ЮВ 315 13 8 5.4 3.2
В 360 8 5 4.5 2.8

суббота, 22 августа 2009 г.

Настройка 3G (UMTS) интернета Utel под Debian GNU/Linux

Дано:

  • Телефон SE K660i
  • USB шнурок из комплекта
  • Опсос Utel
  • Debian GNU/Linux



$ cat /etc/chatscripts/utel-connect
TIMEOUT 10
ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "ERROR"
ABORT "NO DIALTONE"
"" ATZ
OK 'AT+CGDCONT=1,"IP","3g.utel.ua"'
OK ATDT*99#
CONNECT



$ cat /etc/ppp/peers/utel
/dev/ttyACM0
#115200
#230400
#460800
921600
noauth
defaultroute
replacedefaultroute
unit 1
#usepeerdns
persist
noipdefault
lock
connect '/usr/sbin/chat -v -f /etc/chatscripts/utel-connect'
novjccomp
nopcomp
noaccomp
nodeflate
novj
linkname utel

maxfail 5


Поднять/лог/разорвать соединение:

# pon utel
# plog
# poff utel

пятница, 21 августа 2009 г.

Сокращения дней в календаре в Gnome

Чтоб вместо Вск, Пнд, Чтв были привычные сокращения нужно редактировать свою локаль в /usr/share/i18n/locales. Для ru_UA еще дополнительно нужно изменить день начала недели (в ru_RU норм).


$ diff ru_UA.org ru_UA
104,110c104,110
< abday "<U0412><U0441><U043A>";/

< "<U041F><U043D><U0434>";/
< "<U0412><U0442><U043E>";/

< "<U0421><U0440><U0434>";/

< "<U0427><U0442><U0432>";/
< "<U041F><U0442><U043D>";/

< "<U0421><U0443><U0431>"
---

> abday "<U0412><U0441>";/
> "<U041F><U043D>";/
> "<U0412><U0442>";/

> "<U0421><U0440>";/

> "<U0427><U0442>";/
> "<U041F><U0442>";/
> "<U0421><U0431>"
143a144,145

> first_weekday 2

> first_workday 2


После изменений нужно сгенерировать заново локали:

$ sudo locale-gen


И перезапустить иксы.

Скриншоты до и после:
gnome calendar gnome calendar

Избранные сообщения

Тест летних шин

За Рулем №3 (2013) [185/60 R14, 175/70 R13] - http://bit.ly/ZPeFvQ Автоцентр №11 (2013) [205/55 R16] - http://bit.ly/XeXfY7

Популярные сообщения