This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %% Spin up the supervisor; prune ring files as necessary | |
| case riak_core_sup:start_link() of | |
| {ok, Pid} -> | |
| riak_core:register(riak_core, [{stat_mod, riak_core_stat}]), | |
| ok = riak_core_ring_events:add_guarded_handler(riak_core_ring_handler, []), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| init([]) -> | |
| Children = lists:flatten( | |
| [?CHILD(riak_core_sysmon_minder, worker), | |
| ?CHILD(riak_core_vnode_sup, supervisor, 305000), | |
| ?CHILD(riak_core_eventhandler_sup, supervisor), | |
| ?CHILD(riak_core_ring_events, worker), | |
| ?CHILD(riak_core_ring_manager, worker), | |
| ?CHILD(riak_core_vnode_proxy_sup, supervisor), | |
| ?CHILD(riak_core_node_watcher_events, worker), | |
| ?CHILD(riak_core_node_watcher, worker), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| start_link() -> | |
| supervisor:start_link({local, ?MODULE}, ?MODULE, []). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Car { | |
| def fillTankWith(fuel: Int) { | |
| println(f"tank is full with $fuel litres") | |
| } | |
| def driveTo(place: String) { | |
| println(f"heading to $place") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| scala> def guessMyReturnType = "should say string on the line below" | |
| guessMyReturnType: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| scala> val names = List("Jonas Boner", "Ian Battersby", "Rob Bowley") | |
| names: List[String] = List(Jonas Boner, Ian Battersby, Rob Bowley) | |
| scala> names.map(_.reverse) | |
| res0: List[String] = List(renoB sanoJ, ybsrettaB naI, yelwoB boR) | |
| scala> names.map(name => name.reverse) | |
| res1: List[String] = List(renoB sanoJ, ybsrettaB naI, yelwoB boR) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Plate { | |
| var ingredients = List() | |
| def >>:(ingredient: String) { | |
| ingredients ++ ingredient | |
| } | |
| def tellMeWhatYouveGot() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package dbus_demo | |
| import org.freedesktop.dbus.{DBusInterface, DBusConnection} | |
| import dbus_demo.client.Handler | |
| object PublisherApp { | |
| def main(args: Array[String]) { | |
| val connection = DBusConnection.getConnection(DBusConnection.SESSION) // connect to bus | |
| connection.requestBusName("dbus_demo.publisher") // register this application on the bus |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package dbus_demo.client | |
| import org.freedesktop.dbus.DBusInterface | |
| trait Handler extends DBusInterface { | |
| def handle(message: String) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package dbus_demo | |
| import org.freedesktop.dbus.{DBusInterface, DBusConnection} | |
| import dbus_demo.client.Handler | |
| object ScalaClient { | |
| def main(args: Array[String]) { | |
| val connection = DBusConnection.getConnection(DBusConnection.SESSION) |