ocehb: (Default)


Boxing day

Boxing day

ocehb: (Default)
Для автоматизации опакечивания модуля в rpm,
в Makefile.PL надо добавить )
ocehb: (Default)
#Create a script which takes a list of numbers from command line and 
#print the same in the compact form. For example, 
#if you pass “1,2,3,4,9,10,14,15,16” then it should print the compact form like “1-4,9,10,14-16”.

решение: )
ocehb: (Default)
Challenge #1

Print all the niven numbers from 0 to 50 inclusive, each on their own line. A niven number is a non-negative number that is divisible by the sum of its digits.

решение: )
ocehb: (Default)
Вышла fc29, и у меня опять возник вопрос несовместимых по ABI модулей:

# perl -MNet::SSLeay -e0
SSLeay.c: loadable library and perl binaries are mismatched (got handshake key 0xde00080, needed 0xce00080)

Моё решение: )
ocehb: (Default)
Команда print имеет два замечательных флага, -P (использование
управляющих последовательностей из prompt), и -f (использование
printf-последовательностей):

# print -f "Pi: %.02f\\n" 3.1415936
Pi: 3.14
# print -P "%D{%D %T}"
10/11/18 15:18:32

Напрямую они не совместимы:

# print -P -f "%D{%D %T} %s\\n" test
print: %D: invalid directive
# print -P -f "%%D{%%D %%T} %s\\n" test
%D{%D %T} test

Но есть трюк! )
ocehb: (Default)
В zsh можно определить несколько функций за раз,
разница будет только в <code>$0</code>: )
ocehb: (Default)

# title="Title for testing"
# print -l $title ${(l:$#title::-::-:):-}
Title for testing
-----------------
# print -P "%U$title%u"
Title for testing
#
ocehb: (Default)

# alias -g TT="|& tee /tmp/file.log; print -s 'less /tmp/file.log'"
# make TT
...
# ↑
# less /tmp/file.log


Расшифровка )
ocehb: (Default)

Нос почесать

Profile

ocehb: (Default)
ocehb

January 2021

S M T W T F S
     12
345 6789
10111213141516
17181920212223
24252627282930
31      

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 29th, 2025 11:40 pm
Powered by Dreamwidth Studios