layout: true
.header[.grey[© 2018 Vladimir Lysyy | All rights reserved]] .footer[]
class: center, middle
name: title
| /** | |
| * A Ridiculously Simple FSM DSL in Scala, similar to AKKA Actor-based FSM syntax | |
| * | |
| * def MY_STATE(...args...) = state("MY_STATE") { | |
| * ... do something on entry ... | |
| * events { | |
| * case MyEvent => | |
| * ... do something on event ... | |
| * MY_OTHER_STATE(...) | |
| * } |
| #include <boost/asio/io_context.hpp> | |
| #include <boost/asio/post.hpp> | |
| #include <boost/asio/signal_set.hpp> | |
| #include <boost/exception/diagnostic_information.hpp> | |
| #include "logger.hpp" | |
| namespace { |
| package xstreamist; | |
| @XStreamAlias("my-msg") | |
| public class MyXmlMessage { | |
| // ... | |
| }; |
| from __future__ import with_statement | |
| import argparse | |
| import requests | |
| from requests.auth import HTTPBasicAuth | |
| from contextlib import closing | |
| class PyJmx: |
| # Install graphite dependencies | |
| apt-get install -y python3 python3-pip python3-cairo python3-django | |
| apt-get install -y apache2 libapache2-mod-wsgi-py3 | |
| # Install graphite | |
| pip3 install https://github.com/graphite-project/whisper/tarball/master | |
| pip3 install https://github.com/graphite-project/carbon/tarball/master | |
| pip3 install https://github.com/graphite-project/graphite-web/tarball/master | |
| # Setup a vhost by grabbing the example the graphite team released on their repo. |
| [program:activemq] | |
| directory=/path/to/activemq/base | |
| command=/path/to/activemq/base/bin/activemq console | |
| user=activemq | |
| redirect_stderr=true | |
| autostart=true | |
| autorestart=false | |
| stopasgroup=true | |
| killasgroup=true | |
| stdout_logfile=/path/to/activemq.log |
| object StampedLockSyntax { | |
| def syncRead[T](lock: StampedLock)(block: => T): T = { | |
| val stamp = lock.readLock() | |
| try { | |
| block | |
| } finally { | |
| lock.unlockRead(stamp) | |
| } | |
| } |
| ... | |
| subprojects { | |
| ... | |
| apply plugin: 'java' | |
| apply plugin: 'scala' | |
| sourceCompatibility = 1.8 | |
| targetCompatibility = 1.8 |
| <configuration scan="false" debug="true"> | |
| <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | |
| <encoder> | |
| <pattern>%d{HH:mm:ss.SSS} > %-5p > %t > %c > %m%n%rEx{full, | |
| java.lang.reflect.Method, | |
| org.springframework.aop, | |
| org.springframework.transaction, | |
| org.springframework.security, | |
| org.springframework.web, | |
| org.springframework.cglib, |
layout: true
.header[.grey[© 2018 Vladimir Lysyy | All rights reserved]] .footer[]
class: center, middle
name: title