Skip to content

Commit

Permalink
Add Chiba.pm #2 slide
Browse files Browse the repository at this point in the history
  • Loading branch information
hideo55 committed Mar 23, 2013
1 parent 6bae1da commit c0a3779
Show file tree
Hide file tree
Showing 4 changed files with 978 additions and 0 deletions.
64 changes: 64 additions & 0 deletions slides/chiba.pm_2/chibapm2.md
@@ -0,0 +1,64 @@
Chiba.pm #2
===

2013-03-23

\チバ/
---

About me
---
<!-- data-rotz=90 -->

* Hideaki Ohno
* Twitter: @hide_o_55
* Hatena: id:hide_o_55
* github: hideo55
* [http://hideo55.github.com/](http://hideo55.github.com/)
* Favorite Programing Language
* Perl/C/C++/JavaScript

<!-- data-roty=90 -->

初めてXSモジュールをCPANに上げた話
---

XSとは?
---

* PerlとC言語との拡張インタフェースを作るための仕組み
* 主に以下のような用途で使われる
* Cで書かれたライブラリのバインディング
* Perlだと遅い箇所をCで高速化
* Perlコードから触れないPerl内部のハック

XSって難しい?
---
* C言語の読み書きが出来れば難しくない
* XS特有の作法を覚えるだけ
* Perl内部のハックの場合は当然Perl内部の知識が必要

今回作ったモジュール
---

* Algorithm::HyperLoglog
* HyperLogLogアルゴリズムの実装
* ある集合内の異なりの数(cardinality)を省メモリで推定するアルゴリズム
* PurePerlでも動く

M::B::Pluggable使ってみた
---
* べんり!
* XSビルドのサポート
* M::B::Pluggable::XSUtil
* cpanfile対応
* M::B::Pluggable::CPANfile
* ただし、他にフックしたい箇所がある場合はDirty Hackの必要あり
* M::B::Pluggableが既にM::B->subclassしているため


参考にしたもの
---
* perlxs, perlguts, perlapi
* [XS基礎文法最速マスター](http://d.hatena.ne.jp/gfx/20100202/1265091606)
* [Digest::BLAKE2作成で学ぶモダンPerl XSモジュール作成と、挫折](http://blog.wktk.co.jp/archives/331)
188 changes: 188 additions & 0 deletions slides/chiba.pm_2/css/mosho.css
@@ -0,0 +1,188 @@
/**
* This is a stylesheet for a demo presentation for mosho.js
*
* It is not meant to be a part of mosho.js and is not required by mosho.js.
* I expect that anyone creating a presentation for mosho.js would create their own
* set of styles.
*/


/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}

body {
font-family: "Josefin Sans";
font-size: 32px;
line-height: 48px;
color: #fff;
height: 100%;
background: #000;
background: -webkit-radial-gradient(center, ellipse cover, #222 0%, #222 80%, #1a1a1a 100%);
background: -khtml-radial-gradient(center, ellipse cover, #222 0%, #222 80%, #1a1a1a 100%);
background: -moz-radial-gradient(center, ellipse cover, #222 0%, #222 80%, #1a1a1a 100%);
background: -ms-radial-gradient(center, ellipse cover, #222 0%, #222 80%, #1a1a1a 100%);
background: -o-radial-gradient(center, ellipse cover, #222 0%, #222 80%, #1a1a1a 100%);
background: radial-gradient(center, ellipse cover, #222 0%, #222 80%, #1a1a1a 100%);
background-attachment: fixed;
}

h1, h2, h3 {
font-family: "Actor";
font-weight: normal;
}
h1 { font-size: 96px; line-height: 128px; }
h2 { font-size: 72px; line-height: 96px; }
h3 { font-size: 64px; line-height: 72px; }

aside {
font-size: 48px;
}

a {
display: inline-block;
padding: 6px;
-webkit-border-radius: 12px;
-khtml-border-radius: 12px;
-moz-border-radius: 12px;
-ms-border-radius: 12px;
-o-border-radius: 12px;
border-radius: 12px;
color: #acd;
background: rgba(0,0,0,0.15);
font-weight: bold;
text-decoration: none;
-webkit-transition: all 1s ease;
-khtml-transition: all 1s ease;
-moz-transition: all 1s ease;
-ms-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}
a:hover {
background: rgba(0,0,0,0.25);
}

.mosho-slide {
width: 920px;
padding: 20px;
-webkit-border-radius: 16px;
-khtml-border-radius: 16px;
-moz-border-radius: 16px;
-ms-border-radius: 16px;
-o-border-radius: 16px;
border-radius: 16px;
text-align: center;
-webkit-text-shadow: 0 0 16px #fff; /* shadows to simulate blur, why not? */
-khtml-text-shadow: 0 0 16px #fff;
-moz-text-shadow: 0 0 16px #fff;
-ms-text-shadow: 0 0 16px #fff;
-o-text-shadow: 0 0 16px #fff;
text-shadow: 0 0 16px #fff;
color: rgba(255,255,255,0);
opacity: 0.2;
-webkit-transition: all 0.5s ease; /* ease into state changes */
-khtml-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}

.mosho-slide.mosho-active {
-webkit-text-shadow: none;
-khtml-text-shadow: none;
-moz-text-shadow: none;
-ms-text-shadow: none;
-o-text-shadow: none;
text-shadow: none;
color: rgba(255,255,255,1);
opacity: 1.0;
}

.mosho-slide ul {
list-style: circle;
text-align: left;
width: 650px;
margin: 0 auto;
padding-left: 30px;
}

.mosho-slide ol {
list-style: decimal;
padding-left: 50px;
}

.mosho-slide li {
word-wrap: break-word;
}

.mosho-slide pre {
width: 800px;
text-align: left;
overflow: auto;
white-space: pre-wrap;
word-wrap: break-word;
background-color: #ffffff;
color: #000000;
padding: 5px;
border-radius: 10px;
margin: 15px auto;
line-height: 36px;
}

.mosho-slide p {
margin-bottom: 20px;
}


/* Pretty printing styles. Used with prettify.js. */

.str { color: #080; }
.kwd { color: #008; }
.com { color: #800; }
.typ { color: #606; }
.lit { color: #066; }
.pun { color: #660; }
.pln { color: #000; }
.tag { color: #008; }
.atn { color: #606; }
.atv { color: #080; }
.dec { color: #606; }
pre.prettyprint { padding: 2px; border: 1px solid #888; }

@media print {
.str { color: #060; }
.kwd { color: #006; font-weight: bold; }
.com { color: #600; font-style: italic; }
.typ { color: #404; font-weight: bold; }
.lit { color: #044; }
.pun { color: #440; }
.pln { color: #000; }
.tag { color: #006; font-weight: bold; }
.atn { color: #404; }
.atv { color: #060; }
}

138 changes: 138 additions & 0 deletions slides/chiba.pm_2/index.html
@@ -0,0 +1,138 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Chiba.pm #2</title>
<link href="http://fonts.googleapis.com/css?family=Open+Sans:regular,semibold,italic,italicsemibold|PT+Sans:400,700,400italic,700italic|PT+Serif:400,700,400italic,700italic" rel="stylesheet" />
<link href="css/mosho.css" rel="stylesheet" />
<script type="text/javascript" src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js"></script>
</head>
<body>
<div id="mosho">
<div id="title" class="mosho-slide" data-y="0" data-x="0">
<h1>Chiba.pm #2</h1>

<p>2013-03-23</p>

</div>
<div class="mosho-slide" data-y="0" data-x="1200">
<h2>\チバ/</h2>

</div>
<div data-roty="90" class="mosho-slide" data-rotz="90" data-y="0" data-x="2400">
<h2>About me</h2>

<!-- data-rotz=90 -->

<ul>
<li>Hideaki Ohno
<ul>
<li>Twitter: @hide_o_55</li>
<li>Hatena: id:hide_o_55</li>
<li>github: hideo55</li>
<li><a href="http://hideo55.github.com/">http://hideo55.github.com/</a></li>
</ul></li>
<li>Favorite Programing Language
<ul>
<li>Perl/C/C++/JavaScript</li>
</ul></li>
</ul>

<!-- data-roty=90 -->

</div>
<div class="mosho-slide" data-y="0" data-x="3600">
<h2>初めてXSモジュールをCPANに上げた話</h2>

</div>
<div class="mosho-slide" data-y="0" data-x="4800">
<h2>XSとは?</h2>

<ul>
<li>PerlとC言語との拡張インタフェースを作るための仕組み</li>
<li>主に以下のような用途で使われる
<ul>
<li>Cで書かれたライブラリのバインディング</li>
<li>Perlだと遅い箇所をCで高速化</li>
<li>Perlコードから触れないPerl内部のハック</li>
</ul></li>
</ul>

</div>
<div class="mosho-slide" data-y="800" data-x="0">
<h2>XSって難しい?</h2>

<ul>
<li>C言語の読み書きが出来れば難しくない</li>
<li>XS特有の作法を覚えるだけ</li>
<li>Perl内部のハックの場合は当然Perl内部の知識が必要</li>
</ul>

</div>
<div class="mosho-slide" data-y="800" data-x="1200">
<h2>今回作ったモジュール</h2>

<ul>
<li>Algorithm::HyperLoglog
<ul>
<li>HyperLogLogアルゴリズムの実装 </li>
<li>ある集合内の異なりの数(cardinality)を省メモリで推定するアルゴリズム</li>
<li>PurePerlでも動く</li>
</ul></li>
</ul>

</div>
<div class="mosho-slide" data-y="800" data-x="2400">
<h2>M::B::Pluggable使ってみた</h2>

<ul>
<li>べんり!</li>
<li>XSビルドのサポート
<ul>
<li>M::B::Pluggable::XSUtil</li>
</ul></li>
<li>cpanfile対応
<ul>
<li>M::B::Pluggable::CPANfile</li>
</ul></li>
<li>ただし、他にフックしたい箇所がある場合はDirty Hackの必要あり
<ul>
<li>M::B::Pluggableが既にM::B->subclassしているため</li>
</ul></li>
</ul>

</div>
<div class="mosho-slide" data-y="800" data-x="3600">
<h2>参考にしたもの</h2>

<ul>
<li>perlxs, perlguts, perlapi</li>
<li><a href="http://d.hatena.ne.jp/gfx/20100202/1265091606">XS基礎文法最速マスター</a></li>
<li><a href="http://blog.wktk.co.jp/archives/331">Digest::BLAKE2作成で学ぶモダンPerl XSモジュール作成と、挫折</a></li>
</ul>

</div>

</div>
<script src="js/mosho.js"></script>
<script type="text/javascript">
mosho.plugin({
name: "scaleActiveSlide",
preShow: function (evt) {
prv = evt.detail.prevSlide;
nxt = evt.detail.nextSlide;
if (prv) { prv.scale(0.25) }
if (nxt) { nxt.scale(4) }
}
});
mosho.init();

try{
window.addEventListener("load",prettyPrint,false);
}catch(e){
window.attachEvent("onload",prettyPrint);
}
</script>
</body>
</html>

0 comments on commit c0a3779

Please sign in to comment.