by shigemk2

当面は技術的なことしか書かない

イミュータブルなオブジェクトはスレッドセーフ

ということ。中身が不変なので、マルチスレッド処理中にロックをかける必要がないから。

Immutable objects greatly simplify your program, since they:

  • are simple to construct, test, and use
  • are automatically thread-safe and have no synchronization issues
  • don't need a copy constructor
  • don't need an implementation of clone
  • allow hashCode to use lazy initialization, and to cache its return value
  • don't need to be copied defensively when used as a field
  • make good Map keys and Set elements (these objects must not change state while in the collection)
  • have their class invariant established once upon construction, and it never needs to be checked again
  • always have "failure atomicity" (a term used by Joshua Bloch): if an immutable object throws an exception, it's never left in an undesirable or indeterminate state

www.javapractices.com

ブログを毎日書き始めて丸5年が経った

f:id:shigemk2:20160919184127p:plain

へっぽこ日記を毎日書き始めてまる5年になりました。

5年になったからと言って、別に何があるわけではないのですが。

田舎の大学で国際関係学を学んでて、ろくでもない大学生活を送ってて、就活失敗してプータローのまま大学を卒業して、人生のレールから外れました。

大学卒業してから友人に勧められてプログラミングを独学で始めて丸6年。上司に勧められるままブログを書くようになって、丸5年。

今も毎日ブログを書いていますし、今もプログラマとして生きていられています。ありがとうございます。

人並みのコミュニケーション能力があって、世間に対して割りきれてれば、今頃はメガバンクや大手マスコミとかに就職して、今より高い収入を得てて、結婚して子供もいたかもしれません。 プログラミングを始めたのも、ブログを始めたのも、周りに勧められたからです。でも、今の生活も今の人生も今の職業も悪くないと思っています。

いつまでエンジニアを続けられるか、ブログを続けられるかわかりませんが、もう少し頑張ってみようと思います。

Emacs 25.1.1をインストール(Ubuntu)

  • ubuntu 16.04
  • emacs 25.1.1

  • ダウンロード GNU Emacs download - GNU Project

  • configure ここでerror: No X toolkit could be found.などと言われたら、./configure --with-x-toolkit=noするかgtkをちゃんと入れるなどする

sudo apt-get install build-essential texinfo libx11-dev libxpm-dev libjpeg-dev libpng-dev libgif-dev libtiff-dev libgtk2.0-dev libncurses-dev libxpm-dev automake autoconf (いろいろぶっこんだけど、都度インストールすればよかったかも) askubuntu.com

Markdownから資料を作りたい人生は、pandocとbeamerのコンボでなんとかなりそう

タイトルがすべてを物語っていた。

apt-get install pandoc
apt-get install texlive # pdf変換にtexliveがひつよう
pandoc  -t beamer -V theme:AnnArbor -o slides-annarbor.pdf  memo.md

テーマについては、beamer themeなどで調べるといいかも。

日本語での紹介 rcmdnk.github.io pandoc Pandoc - Getting started with pandoc beamerテーマ Beamer theme gallery

Remark雑感

マークダウンでパワポやimpress.jsみたいなスライドを作ろうという試み。

  • HTML
  • マークダウン

必要なのはこの2つだけ。だけなんだけど、

  • マークダウンの中にクラスを書かないといけない
  • マークダウンだけでスライド資料を作りたかった

などの理由により、自分からしたら微妙で汎用的じゃなくてつらいので却下。

HTMLを用意する

<DOCTYPE html>
<html>
<head><title>Presentation</title></head>
<body>
  <script src="http://gnab.github.io/remark/downloads/remark-latest.min.js" type="text/javascript"></script>
  <script type="text/javascript">
    var slideshow = remark.create({sourceUrl: "sample.md"});
  </script>
</body>
</html>

マークダウンを用意する

class: center,middle
Remark
# サンプル

---
class: center,middle
# @shigemk2

github.com

MRAID

MRAID(Mobile Rich Media Ad Interface Definitions)は、モバイルアプリに配信されるリッチメディア広告向けの業界標準の API です。リッチメディアのデベロッパーは、HTML5 や JavaScript で MRAID API を使用して、広告とアプリ間の通信や特定のデバイス機能へのアクセスを行うことができます。

読もう。

www.iab.com

support.google.com