Aviation and Erlang

  • 1,074 views
Uploaded on

"Aviation and Erlang" is a presentation that I gave during BarCamp Shanghai on June 12, 2010. I talked about two fields that I am interested in and I tried to link them together. For the second part …

"Aviation and Erlang" is a presentation that I gave during BarCamp Shanghai on June 12, 2010. I talked about two fields that I am interested in and I tried to link them together. For the second part of the presentation I was showing some code examples, that are not part of the slide show itself.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,074
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
16
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide




























Transcript

  • 1. Aviation and Erlang Thomas Karsten barcamp Shanghai, 2010-06-12
  • 2. About me • Thomas Karsten • Hometown: Berlin, Germany • Current location: Shanghai, China • Developer and scrum master at The NetCircle • Aviation, long distance cycling
  • 3. Introduction • Aviation • Wind Correction Angle • Glidepath • Erlang Server • TCP Connection • Erlang Interface • Aviation and Erlang • Storage Application
  • 4. 1 Aviation • All about aircrafts • Design, Operation, Navigation
  • 5. 1 Aviation Wind Correction Angle (wca)
  • 6. 1 Aviation Wind Correction Angle (wca)
  • 7. 1 Aviation Wind Correction Angle (wca) vw v
  • 8. 1 Aviation Wind Correction Angle (wca) vw v
  • 9. 1 Aviation Wind Correction Angle (wca) vw wca v
  • 10. 1 Aviation Wind Correction Angle (wca) vw wca=atan(vw/v) with v=150kt, vw=20kt: wca=7.6 wca v
  • 11. 1 Aviation Wind Correction Angle (wca) vw v
  • 12. 1 Aviation Wind Correction Angle (wca) vw v
  • 13. 1 Aviation Wind Correction Angle (wca) vw vw90 vw90=sin(wta)*vw v
  • 14. 1 Aviation Wind Correction Angle (wca) vw vw90 wca=atan(vw90/v) v
  • 15. 1 Aviation Glidepath
  • 16. 1 Aviation Glidepath 120kt=120nm/h=2nm/min t=10.3nm/2nm/min t=5.15min
  • 17. 1 Aviation Glidepath 5000ft/5.15min=971ft/min
  • 18. 1 Aviation Glidepath 5000ft/5.15min=971ft/min
  • 19. 1 Aviation Glidepath (5000ft-1416ft)/5.15min=696ft/min
  • 20. 1 Aviation
  • 21. 2 Erlang Server Erlang • Developed at Ericsson 1986 • Open source since 1998 • Distributed, fault-tolerant applications • Processes are lightweight • RabbitMQ, ejabberd
  • 22. 2 Erlang Server TCP Connection -module(server). -export([start/0, stop/0]). -export([listen/0]). listen() -> case gen_tcp:listen(Port, ?TCP_OPTIONS) of {ok, LSocket} -> NewState=State#state{lsocket=LSocket}, case gen_tcp:accept(LSocket) of {ok, Socket} -> do_something(Socket), {error, Reason} -> {error, Reason} end {ok, NewState}; {error, Reason} -> {stop, Reason} end.
  • 23. 2 Erlang Server Erlang Interface -module(listen). -export([start/0, stop/0]). -export([listen/0]). start() -> register(?MODULE, spawn(fun() -> listen() end)). stop() -> ?MODULE ! stop. listen() -> receive {Pid, Request} -> io:format("From: ~p~nReceived: ~p~n", [Pid, Request]); Any -> io:format("Received: ~p~n", [Any]) end.
  • 24. 2 Erlang Server Erlang Interface int main(int ac, char** av) { erl_init(NULL, 0); if (erl_connect_init(1, cookie, 0) == -1) erl_err_quit("err_connect_init"); if ((fd=erl_connect(node)) < 0) erl_err_quit("erl_connect: Cannot connect to node"); tuple=create_tuple(); erl_reg_send(fd, RECIPIENT, tuple); return 0; }
  • 25. 3 Aviation and Erlang Code examples
  • 26. 4 Storage Application Code examples
  • 27. Lessons learned • How to land an airplane in cross-wind • Different communication types in Erlang • How to program a server in Erlang
  • 28. Aviation and Erlang Thank you very much for listening Any questions?