Skip to content

Instantly share code, notes, and snippets.

@yasu47b
yasu47b / iris.csv
Last active October 19, 2017 12:42
manipulate data with c3 and d3
sepal_length sepal_width petal_length petal_width class
5.1 3.5 1.4 0.2 Iris-setosa
4.9 3.0 1.4 0.2 Iris-setosa
4.7 3.2 1.3 0.2 Iris-setosa
4.6 3.1 1.5 0.2 Iris-setosa
5.0 3.6 1.4 0.2 Iris-setosa
5.4 3.9 1.7 0.4 Iris-setosa
4.6 3.4 1.4 0.3 Iris-setosa
5.0 3.4 1.5 0.2 Iris-setosa
4.4 2.9 1.4 0.2 Iris-setosa

Unicode文字列の表示

\N{} を使う

perl -E 'say "\N{U+03a0}"'

pack を使う

DBの実データサイズを調べる

SQLでデータベースのoidを確認し、データベースの実体が配置されているディレクトリの容量を調べる。

SQLによるoidの確認

select datid, datname from pg_stat_database

ディレクトリの容量を確認

#!/usr/bin/env perl
use strict;
use warnings;
use v5.10;
my $arr = [[1,2,3],[4,5,[6,7,[8,9,[1,2,3]]]]];
my @arr = ([1,2,3],[4,5,[6,7,[8,9,[1,2,3]]]]);
sub flatten {
my $arg = @_ > 1 ? [@_] : shift;
@yasu47b
yasu47b / mojo_lite_excel_writer.pl
Last active March 16, 2017 05:10
Mojolciious Excel Writer sample
```
#!/usr/bin/env perl
use Mojolicious::Lite;
use Excel::Writer::XLSX;
use Cwd;
app->static->paths->[0] = getcwd;
# Documentation browser under "/perldoc"
plugin 'PODRenderer';

テーブル一覧を取得

select name from sysobjects where xtype = 'U

登録テンプレートの確認

select * from hosts where status=3;
select hostid, host, name from hosts where status=3;

テンプレートのアイテムを確認

確認したいテンプレートのhostidが10105の場合

Environment

  • CentOS 6.7
  • DB2 Express v10.5

Connection Setting

DB2 connection setting to allow external connection using TCP/IP.

# edit service file
reset max of y axis
```
chart.internal.config.axis_y_max=undefined;
```