SlideShare una empresa de Scribd logo
1 de 44
Descargar para leer sin conexión
Time Travel!
Predicting the Future !
and Surviving a Parallel Universe !
                                      Hossam Karim!
The Free Lunch is Over!!
Welcome to the Real World!
Concurrency!
It’s Pretty Hard!
Concurrency Pain!
Doubled-Checked Locking Problem


!"#$%&!&$'((!"#$%&'()'*+',-#*+./0!1!
!!
!!!!)%*'+,!234'/5.6'7'5#$8*'!'34'/5.6'7'5#$8*'9!
!!
!!!!"#$%&!234'/5.6'7'5#$8*'!0':234'/5.6'7'5#$*';<!1!
!!!!!%-!;'34'/5.6'7'5#$8*'!==!."$$<!
!!!!!!!'34'/5.6'7'5#$8*'!=!.,/!234'/5.6'7'5#$8*';<9!
!!!!!),+").!'34'/5.6'7'5#$8*'9!
!!!>!
!!
!>!
Doubled-Checked Locking Problem


!"#$%&!&$'((!"#$%&'()'*+',-#*+./0!1!
!!
!!!!)%*'+,!234'/5.6'7'5#$8*'!'34'/5.6'7'5#$8*'9!
!!
!!!!"#$%&!234'/5.6'7'5#$8*'!0':234'/5.6'7'5#$*';<!1!
!!!!!%-!;'34'/5.6'7'5#$8*'!==!."$$<!1!
!!!!!!!(/.&0)1.%2,3!;"#$%&'()'*+',-#*+./0>&$'((<!1
!!!!!!!!!'34'/5.6'7'5#$8*'!=!.,4!234'/5.6'7'5#$8*';<9!
!!!!!!!?!
!!!!!?!
!!!!!),+").!'34'/5.6'7'5#$8*'9!
!!!?!
!!
!?!
Doubled-Checked Locking Problem

!"#$%&!&$'((!"#$%&'()'*+',-#*+./0!1!
!!
!!!!)%*'+,!234'/5.6'7'5#$8*'!'34'/5.6'7'5#$8*'9!
!!
!!!!"#$%&!234'/5.6'7'5#$8*'!0':234'/5.6'7'5#$*';<!1!
!!!!!%-!;'34'/5.6'7'5#$8*'!==!."$$<!1!
!!!!!!!(/.&0)1.%2,3!;"#$%&'()'*+',-#*+./0>&$'((<!1!
!!!!!!!!!%-!;'34'/5.6'7'5#$8*'!==!."$$<!
!!!!!!!!!!!'34'/5.6'7'5#$8*'!=!!
!!!!!!!!!!!!!!!.,4!234'/5.6'7'5#$8*';<9!
!!!!!!!?!
!!!!!?!
!!!!!),+").!'34'/5.6'7'5#$8*'9!
!!!?!
!!
!?!
!!
!
Doubled-Checked Locking Problem




                                      volatile




Thread A



Thread B

                          Processor               Main
                            Cache                Memory

           synchronized
Doubled-Checked Locking Problem

!"#$%&!&$'((!"#$%&'()'*+',-#*+./0!1!
!!
!)%*'+,!*-$'+%$,!234'/5.6'7'5#$8*'!'34'/5.6'7'5#$8*'9!
!!
!!!!"#$%&!234'/5.6'7'5#$8*'!0':234'/5.6'7'5#$*';<!1!
!!!!!%.!;'34'/5.6'7'5#$8*'!==!/"$$<!1!
!!!!!!!(0/&1)-/%2,3!;"#$%&'()'*+',-#*+./0>&$'((<!1!
!!!!!!!!!%.!;'34'/5.6'7'5#$8*'!==!/"$$<!
!!!!!!!!!!!'34'/5.6'7'5#$8*'!=!!
!!!!!!!!!!!!!/,4!234'/5.6'7'5#$8*';<9!
!!!!!!!?!
!!!!!?!
!!!!!),+")/!'34'/5.6'7'5#$8*'9!
!!!?!
!!
!?!
Scala
!"#$$!"#$%$&'(()*+,%(-.(#/(01*#/234!5!
!!!!
!!!"#%&!'#"!(67(3829(:(8*+'#(!;!()*!<67(3829(:(8*+'#(!
!!
=!


!
                                                                 Decompiled into Java
!!"#$$!"#$%$&'(()*+,%(-.(#/(01*#/234!%&'"(&()*$!!"#$#%&'(")!5!
!!!'+%,#*(!678(392:(;(9*+'#(!(78(392:(;(9*+'#(<!
!!!'-."%!!,/"#*%"(!%)*!,2=>$8?@<!
!!
!!!'-."%!!678(392:(;(9*+'#(!(78(392:(;(9*+'#(AB!5!
!!!!!%0!AA*1%$C,2=>$8?@!D!@7EB!FF!@B!
!!!!!$2)!1+/)%3(4!A*1%$B!5!
!!!!!!!%0!AA*1%$C,2=>$8?@!D!@7EB!FF!@B!5!
!!!!!!!!!*1%$C(78(392:(;(9*+'#(!F!)(5!678(392:(;(9*+'#(AB<!
!!!!!!!!!*1%$C,2=>$8?@!GF!E<!
!!!!!!!H!
!!!!!!!+(*-+)!*1%$C(78(392:(;(9*+'#(<!
!!!!!H!
!!!H!
!H!
!!
!
Concurrency Models!
Concurrency Models




                           !"#$%&&'#()*&"+&,--.#+)
                                   /"0'1




                !"--%#.$,(."#                  23#$4&"#.5,(."#




24,&'0)/'-"&3     /'66,+')*,66.#+             7%6389,.(.#+            71"$:.#+




                                                             2'-,;4"&'6          /"#.("&6
Multi-threading Approach!
Thread Pools and Executors
!
!!!"#!"#$%&'()%*&+,,-./#0%12!34/5!4'()%*&12!34/6!7!
!!!!!$%&!8,,-!9!:$%;</,)1=4%>?#$%&'()%*&+,,-.4'()%*&16!
!!!!!$%&!)%1<-/!9!@%4;(0*)A./#0%')*B%-C%"#4#/#,46!7!
!!!!!!!#48</!!!
!!!!!!!!!#'(!.D!E!F!/,!/#0%16!7!
!!!!!!!!!!!8,,-=%$%;</%!7!
!!
!!!!!!!!!!!!!)"*!!"##$%&'!7!
!!!!!!!!!!!!!!!!"#!)<4.6!7!
!!!!!!!!!!!!!!!!!%4;&%;.#48</6!
!!!!!!!!!!!!!!!G!
!!!!!!!!!!!!!G!
!!
!!!!!!!!!!!G!
!!!!!!!!!G!
!!!!!!!!!8,,-=1(</&,>4.6!
!!!!!!!!!8,,-=*>*#/'%)0#4*/#,4.F5!()*'+#),=H3IJ':K6!
!!!!!G!
!!!!!-,L=#4",.M"#$%&'()%*&+,,-2!C,4%!N&!O,@1!<1#4L!N&!'()%*&1!#4!N&!01M=!
!!!!!!!",)0*/./#0%15!4'()%*&15!)%1<-/=/#0%H#--#166!
!!G!
!!
Java Fork-Join Framework!
Fork-Join Framework


                                                       join
                                      fork
                                                               join
ForkJoinTask                  fork
                fork

                                                                          join



                                  Deque                            Worker
                             per Worker Thread                   Thread Pool


                   !"#$%                         !&!%'()*+,%
         fork
                 -./0
                '*)*+,%     Work
                           Stealing

                                                 !&!%'()*+,%
                   !"#$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!!!!!!!!!!!"#$+7/,$-0*./B@7.*-3!$-0*./B/'+-L'..'088!
!!!
!G!
!!
!
Parallel Collections!
Parallel Collections - Mathematica

            ParametricPlot3D CosΦ SinΘ, SinΦ SinΘ, CosΘ,
 In[1]:=   plotSpherefactor_ :

             Φ, 0, 2 Π, Θ, 0, Π, PlotPoints  100, Mesh  None,
             ColorFunction  Functionx, y, z, Φ, Θ,
               HueSinfactor Φ Sinfactor Θ, ColorFunctionScaling  False,
             Axes  None, Boxed  False, ImageSize  100
           LaunchKernels
           DistributeDefinitionsplotSphere

Out[2]=    KernelObject1,   local,   KernelObject2,   local,
            KernelObject3,   local,   KernelObject4,   local,
            KernelObject5,   local,   KernelObject6,   local,
            KernelObject7,   local,   KernelObject8,   local

Out[3]=    plotSphere
Parallel Collections - Mathematica
Parallel Collections - Mathematica
Scala Parallel Collections

!!!#!#$%#'$()#*+!#',!-#%'*+!$%'().+!*+%,/#'0!1!2!
!!!!!-./!(34%56'),!78%94%56').!1!
!!!!!!!:'5%8*()#*;#$%+!=.;!
!!!!!!!!!34(!
!!!!!!!!!!!-#'!!!(0!#'(?@$A@$?;-8*34%()#*;B'%C4%6,!-#'...;!
!!!!!!!!!4*%#%#87(;B'%D43';'7)$E#%6(-#%'*..!
!!
!!!!!-./!56#)F#*'5%8*#'$!1!78%94%56');4BB*'B4%'(:'5%8*;'3%G/#'0.(!
!!!!!2!
!!!!!!!(H'5%8*,!-#'.!!!
!!!!!!!!!'#!(-#';#$F#*'5%8*G.!H'5%8*!+I!-#'!/1!H'5%8*!
!!!!!J!
!!!!!,!!II!.!
!!
!!!!!34%56')!II!56#)F#*'5%8*#'$;-8)K'-%(:'5%8*;'3%G/#'0.!2!
!!!!!!!(H'5%8*,!)#*.!!!H'5%8*!II!#$%#'$()#*,!-#%'*.!
!!!!!J!
!!!J!
Scala Parallel Collections
!!!#$%'()!
!!!!#!%*#+%(*,()-!
!!!!!$)).!$%'(/+%(01!2%'*.!$%'(/+%(01!3%#('.!)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/#'0!!!
!!!!!!!!!'#!+/#'#$F#*'2%3*G0!H'2%3*!-I!/#'!,/!H'2%3*!
!!!!!J!
!!!!!.!=!II!=0!
!!!!!8)%29',!II!29#,F#*'2%3*#'$-+/)%;)?+#$%#'$()*)'+=.!/#%'*00!
!!!J!
!!
!
Scala Parallel Collections
Message Passing!
Akka Actors

                                                              !#$%'(#)*




                                            !#$%                   !#$%                           !#$%
2%$3/)456$%7




                                                                                                                    '()%*+,$%,
 8%)970$:1




                       ,9/9#+$1
                       ;),($1,)




                                                                                                                     -.+/0%)1
                                    !#$%           !#$%   !#$%           !#$%           !#$%           !#$%




                             !
                                                                                3).9*+$%@      !#$%
                                                                      %))+*)
               !#$%
                                                            =9+/3$?
                                     =),,9)                                                   %)(/A@4),,9)
Akka Actors
!
!#$%!#$$!#$%'('))#*'+$'))#*',!'()*+,-!
!!
!
!
!-%.!).$%'/01234)1'$+-!5!
!!!!!/#!)4)1'$!6!/01234)1'$+7$#.8/01234)1'$7-!
!
!!!!!/#!)#$%'/0123!6!!
!!!!!!!)4)1'$9#0123:;+32%)=#$%'/0123?!8#$'!6!7)#$%'/01237-!
!
!!!!!/#!@''*#1'/0123!6!!
!!!!!!!)4)1'$9#0123:;+32%)=A''*#1'/0123?!8#$'!6!7@''*#1'/01237-!
!
!!!!!)#$%'/0123!B!7C'27!
!!!!!)#$%'/0123!B!#$%'('))#*'+7DAEFGHIG7-!
!
!!!!!)4)1'$9)CJ1@2K8+-!
!L!
!!
!
!
Akka Actors

!
!!#$$!#$%'()*+,!%'%()$!!#$%!-!
!!
!!!*#!+.!/!0+..12.3)+2*'4*5676*'$8!'+,$9!
!!
!!!*#!:''.#*'()*+,!/!!
!!!!!!)+2*'4*5#)*+,;+,3#==#??$#12()*+,76*'$?@6',?:''.#*'()*+,9!
!
!!!)%-!,')'1A'!/!-!
!!!!!!#$%!6!.'/,(0!!!
!!!!!!!+.512B+369!
!
!!!!!!#$%!+*C',!!!!!!!
!!!!!!!+.512B+3D#2E*!C#2:'!*C16!+2'8!F1!:''.#*'!*+!#2+*C',!#)*+,9!
!!!!!!!:''.#*'()*+,!G!+*C',!
!!!H!
!H!
!!
!
Akka Actors

!
!!#$$!#$#%'#()'*+!%'%()$!!#$%!,!
!!!*#!$*%!-!.*%%/0%1)*0'#2'3454'#67!'+,$8!
!!
!!!)%-!+#)#/9#!-!,!
!!
!!!!!!#$%!:6;$##44%#16#44%#8!!!
!!!!!!!$*%3/0=*1?#)#/9#@!6#44%#!A43=*+6'16#44%#88!
!!
!!!B!
!B!
!!
!
Akka Futures




                 ./0$1-$2!#$%3)*4,$5
                                                   !#$%+,*$-



                   !#$%3)*4,$./0$1--)6(%

!#$%'#(()(*
                                          76(%4#-(189$:4$%-




 9$16;;$(2-)6(%                                    3)((1)#
                                                   76(%4#-(-%
Akka Futures

                                                              !
                                                              !!#!#$#%'$%($)*+,!!#$%-'(#-'$%($).'/0$*1233!4!
                                                              !!!$%!5!
                                %#$%+,*$-./-0,              !!!!!'(/+6*)#%78(/#9!:!!
                                                              !!!!!!!7+(/+;(%)$0$1%!=!'(/+6*)#%?#+$7'()!@($99AB(C;1-'(/+6*)#%3!
                                                              !!!!!!!!!+$%($)*+!:!!
                                                              !!!!!!!!!!!6#$#%A$%(8%+7012+#/$(20.0$1%+97!
                                                              !!!!!!!!!!!!!(0$1%!!!7(0$1%!=!'$%($).?#+$78(/#99AB(C;1-'$%($).'/0$*1239!
        !#$%1)*2,$3$42$%-
                                                              !!!D!*+(#,!+$%($)*+!
                                                              !!
                             !#$%1)*2,$                      -!#!#$#%01BB2E($*12+,!!#$%-'(#-)#$*#%+,33!4!
                                                              !!!#$#%'$%($)*+AB(C7!
                                                              !!!!!/*+$F'$%($).'/0$*12!!
                                                              /*+$F'$%($).'/0$*12A/($G(C7HA%01BB2E($*12+99!
                                                              !!
  !#$%'#(()(*               !-,-$*53$42$%-           !




3$/066$(7-)0(%                       /0(%2#-(/5./-0,



                                                             /0(%2#-(/5./-0,




                                                                                /0(%2#-(/5./-0,
Akka Futures
!
!!#!#$#%'$%($)*+,!!#$%-'(#-'$%($).'/0$*1233!4!
!!!$%!5!
!
!!!!!'(/+6*)#%78(/#9!:!!
!!!!!!!7+(/+;(%)$0$1%!=!'(/+6*)#%?#+$7'()!@($99AB(C;1-'(/+6*)#%3!
!
!!!!!+$%($)*+!:!!
!!!!!!!6#$#%A$%(8%+7012+#/$(20.0$1%+97!
!!!!!!!!!!!!!(0$1%!!!7(0$1%!=!'$%($).?#+$78(/#99AB(C;1-'$%($).'/0$*1239!
!
!!!D!*+(#,!+$%($)*+!
!!
-!#!#$#%01BB2E($*12+,!!#$%-'(#-)#$*#%+,33!4!
!!!#$#%'$%($)*+AB(C7!
!!!!!/*+$F'$%($).'/0$*12!!
/*+$F'$%($).'/0$*12A/($G(C7HA%01BB2E($*12+99!
!!
!
                                                                 Akka Promises
!!!!#$!!%##!#$#%'($)%*+!'()*+,!
!!
!!!!%##!-.(*/01*0#!2!!
!!!!!,%!3#*1!4!56#./3#*1'7$88$7,!
!!!!!)-.%)!)'!,%!*6!4!3#*19:;$#6=*/!!
!!
!!!!!/$0!)*$**))?@%/A%#%/*+!!#$%'B#$#%C!4!2!
!!!!!!!,%!D.(*/01*0#E/.1;*!4!E/.1;*B#$#%C',!
!!!!!!!A%#%/*!2!:..1*FG#/*1*)3H$/:#%II'D.(*/01*0#E/.1;*,!J!
!!!!!!!).D9;0I.'7K*L/*!#=*!D.(*/01*0#M!:.0L#!6$))!%M!N*!N;))!6$))!3.%7,!
!!!!!!!D.(*/01*0#E/.1;*!
!!!!!J!
!!
!!!!!/$0!:..1*FG#/*1*)3H$/:#%II'/.1;*+!!#$%'B#$#%C,!2!
!!!!!!!).D9;0I.'!
!!!!!!!!!7K*L/*!#=*!D.(*/1*0#M!N*!);(*!;0!$!$/$))*)!N./):!6$))*:+!O79!
!!!!!!!!!!!I./1$#'=/*$:96%//*0#=/*$:',9D*#P$1*,,!
!!!!!!!).D9;0I.'!
!!!!!!!!!7K*L/*!#=*!D.(*/01*0#M!N*L/*!D.;0D!#.!)**!I./!$!N=;)*7,!
!!!!!!!=/*$:9)**'QRRR,!
!!!!!!!/.1;*9%66*'#$#%'7K.0:*/I%)7,,!
!!!!!J!
!!
!!!!!/$0!#=$08503N$3',!2!
!!!!!!!3#*19=%#:.N0',!
!!!!!J!
!!!J!
!!
!
Akka Promises

!
!!!!#!#$%'()*+,-!.!
!!
!!!!!$%!/)0$#*1$*(!2!'(!3)0$#*1$*(!
!!
!!!!!$%!/)0$#*1$*(4#)1+$!2!/)0$#*1$*(56$7+$8$669+:;#;(;#$!
!!
!!!!!6)/5*=),?$@#$!(A$!$)6$B!C$!7+D$%!E);!7!F;$+()*-!
!!
!!!!!!!#$%'()*+$*,-./%0+1-+12($2+$$-34)%*)%/05$$6)--3-3!
!!!!!GC7(5#$7%E,/)0$#*1$*(4#)1+$B!HI!+$')*%+-!!!%/786-5/1!
!!
!!!!!/)0$#*1$*(4#)1+$!)*J;''$++!.!
!!!!!!!)%*!J(7(;+,076;$-!!!
!!!!!!!!!6)/5*=),!
!!!!!!!!!!:;#!/)0$#*1$*(!=*766E!#$6$%B!(A$E!+7E!(@+!K+5=)#17(,076;$--!
!!!!!L!)*76;#$!.!
!!!!!!!)%*!$!!!
!!!!!!!!!6)/5$##)#,:)+B!+)##E5!3))%!6;'D!*$M(!(1$!N--!
!!!!!L!
!!
!!!!!/)0$#*1$*(5(A7*D+G*EC7E,-!
!!!L!
!!
!!
!
Relations to Functional Programming!
Selected	
  Topics	
  
Monoid




                                            !#$%'()




                                            !*%%$+,-.,/,.0)




                                            !12(3.,.0)




!#$#%'(('!)#*#+          !#$#%#)#*#+

,!#$'(('!%#)-'(('!*#+   !#$#%#)#*#+
!#$'((',!%#)'(('!*#+-

!#$#%'(('!               !#$#%
!'(('!#$#%
Monoid



 !#$%




'()*%+
,-.+.//%/0




 1%+2%
Immutable Data Structures – Google’s Guava
!
!!#$%!!#$#$%'()!**+$,-./01../2$1'345!6!
!!!!!!#$#$%'()!3$%'(3!7!
!!!!!!!%'$()*+!#$8#$%'())'*,+-458!
!!!!!!!!!,994:;11(./3:58!
!!!!!!!!!,994:;+,=,:58!
!!!!!!!!!,994:+.9/%3:58!
!!!!!!!!!-+.945?!
!!!!!..#$-/0#1(,,2345$675##)*+389!
!!!!!'()'*!3$%'(3?!
!!!@!
!!
   h.p://code.google.com/p/memory-­‐measurer/wiki/ElementCostInDataStructures	
  
!
                                                  Immutable Data Structures – Scala
!
!!#!#$%$''()$*%+,-)!.!
!!!/0#$%$/!11!/''()$*%+/!11!/,-)/!11!2-%!
!!
!   h.p://en.wikipedia.org/wiki/Persistent_data_structure	
  
Persistent Data Structures
                !

    %      '   !!#!#$%$'()$*+!,!-.-!//!-0-!//!-1-!//!-2-!//!3$(!
                !!!!!!
                !!#!4)$*+!,!-5-!//!#$%$'()$*+!
                !!
!               !!#!6)$*+!,!#$%$'()$*+!$%'!7!
                !!!!()!89':!//!+'$(!!!-;-!//!+'$(!


                !!!!()!!!!!!!!!!!!!!!-;-!//!3$(!
                !=!
                !!!!!!

#
                !!#!)$*+!,!#$%$'()$*+!$%'!7!
                !!!!()!?$#*+!//!*9@:!//!+'$(!!!-A-!//!+'$(!
                !!!!()!!!!!!!!!!!!!!!!!!!!!!!!!!-A-!//!3$(!

$               !=!
                !!
                !
Thank You!

Más contenido relacionado

La actualidad más candente

Evolving systems and the link to service orientation
Evolving systems and the link to service orientationEvolving systems and the link to service orientation
Evolving systems and the link to service orientationAngelo van der Sijpt
 
Observatoire des taxes foncières - Période 2012 / 2017
Observatoire des taxes foncières - Période 2012 / 2017Observatoire des taxes foncières - Période 2012 / 2017
Observatoire des taxes foncières - Période 2012 / 2017Monimmeuble.com
 
NantKwest Chairman & CEO Dr. Patrick Soon-Shiong to Present Vision for Next G...
NantKwest Chairman & CEO Dr. Patrick Soon-Shiong to Present Vision for Next G...NantKwest Chairman & CEO Dr. Patrick Soon-Shiong to Present Vision for Next G...
NantKwest Chairman & CEO Dr. Patrick Soon-Shiong to Present Vision for Next G...JillHollister
 
Articulo 416 LeCrim. La dispensa de la Obligación de Declarar.
Articulo 416 LeCrim. La dispensa de la Obligación de Declarar.Articulo 416 LeCrim. La dispensa de la Obligación de Declarar.
Articulo 416 LeCrim. La dispensa de la Obligación de Declarar.owaj
 
EDUTEC-e: "Innovando en la Educación para la empleabilidad y el desarrollo de...
EDUTEC-e: "Innovando en la Educación para la empleabilidad y el desarrollo de...EDUTEC-e: "Innovando en la Educación para la empleabilidad y el desarrollo de...
EDUTEC-e: "Innovando en la Educación para la empleabilidad y el desarrollo de...Alba Santa
 
Massive device deployment - EclipseCon 2011
Massive device deployment - EclipseCon 2011Massive device deployment - EclipseCon 2011
Massive device deployment - EclipseCon 2011Angelo van der Sijpt
 
دراسة تحليلة لمشروع التصميم الحضري لمنطقة سد كمران
دراسة تحليلة لمشروع التصميم الحضري لمنطقة سد كمراندراسة تحليلة لمشروع التصميم الحضري لمنطقة سد كمران
دراسة تحليلة لمشروع التصميم الحضري لمنطقة سد كمرانTaha Farwan
 
Intergrating OER in Educational Practice: Practitioner Stories
Intergrating OER in Educational Practice: Practitioner StoriesIntergrating OER in Educational Practice: Practitioner Stories
Intergrating OER in Educational Practice: Practitioner StoriesShironica Karunanayaka
 
WestEd Evaluation of Hawaii Special Education Program
WestEd Evaluation of Hawaii Special Education ProgramWestEd Evaluation of Hawaii Special Education Program
WestEd Evaluation of Hawaii Special Education ProgramHonolulu Civil Beat
 
Aar fourmile fire_dct-vct_jan2011_pdf
Aar fourmile fire_dct-vct_jan2011_pdfAar fourmile fire_dct-vct_jan2011_pdf
Aar fourmile fire_dct-vct_jan2011_pdfBrandon Williams
 
Accessing and Using Food Data to Support Collaborative Policy Decisions - Pow...
Accessing and Using Food Data to Support Collaborative Policy Decisions - Pow...Accessing and Using Food Data to Support Collaborative Policy Decisions - Pow...
Accessing and Using Food Data to Support Collaborative Policy Decisions - Pow...Community Food Security Coalition
 
Os Pruett Sessionnotes
Os Pruett SessionnotesOs Pruett Sessionnotes
Os Pruett Sessionnotesoscon2007
 

La actualidad más candente (18)

Evolving systems and the link to service orientation
Evolving systems and the link to service orientationEvolving systems and the link to service orientation
Evolving systems and the link to service orientation
 
Observatoire des taxes foncières - Période 2012 / 2017
Observatoire des taxes foncières - Période 2012 / 2017Observatoire des taxes foncières - Période 2012 / 2017
Observatoire des taxes foncières - Période 2012 / 2017
 
Ipad gump
Ipad gumpIpad gump
Ipad gump
 
Catch this pitch!
Catch this pitch!Catch this pitch!
Catch this pitch!
 
NantKwest Chairman & CEO Dr. Patrick Soon-Shiong to Present Vision for Next G...
NantKwest Chairman & CEO Dr. Patrick Soon-Shiong to Present Vision for Next G...NantKwest Chairman & CEO Dr. Patrick Soon-Shiong to Present Vision for Next G...
NantKwest Chairman & CEO Dr. Patrick Soon-Shiong to Present Vision for Next G...
 
Articulo 416 LeCrim. La dispensa de la Obligación de Declarar.
Articulo 416 LeCrim. La dispensa de la Obligación de Declarar.Articulo 416 LeCrim. La dispensa de la Obligación de Declarar.
Articulo 416 LeCrim. La dispensa de la Obligación de Declarar.
 
Amidds Wbc 2013
Amidds Wbc 2013Amidds Wbc 2013
Amidds Wbc 2013
 
EDUTEC-e: "Innovando en la Educación para la empleabilidad y el desarrollo de...
EDUTEC-e: "Innovando en la Educación para la empleabilidad y el desarrollo de...EDUTEC-e: "Innovando en la Educación para la empleabilidad y el desarrollo de...
EDUTEC-e: "Innovando en la Educación para la empleabilidad y el desarrollo de...
 
52 ways to_lose_weight_all_year
52 ways to_lose_weight_all_year52 ways to_lose_weight_all_year
52 ways to_lose_weight_all_year
 
Massive device deployment - EclipseCon 2011
Massive device deployment - EclipseCon 2011Massive device deployment - EclipseCon 2011
Massive device deployment - EclipseCon 2011
 
دراسة تحليلة لمشروع التصميم الحضري لمنطقة سد كمران
دراسة تحليلة لمشروع التصميم الحضري لمنطقة سد كمراندراسة تحليلة لمشروع التصميم الحضري لمنطقة سد كمران
دراسة تحليلة لمشروع التصميم الحضري لمنطقة سد كمران
 
Device deployment
Device deploymentDevice deployment
Device deployment
 
Paneles
PanelesPaneles
Paneles
 
Intergrating OER in Educational Practice: Practitioner Stories
Intergrating OER in Educational Practice: Practitioner StoriesIntergrating OER in Educational Practice: Practitioner Stories
Intergrating OER in Educational Practice: Practitioner Stories
 
WestEd Evaluation of Hawaii Special Education Program
WestEd Evaluation of Hawaii Special Education ProgramWestEd Evaluation of Hawaii Special Education Program
WestEd Evaluation of Hawaii Special Education Program
 
Aar fourmile fire_dct-vct_jan2011_pdf
Aar fourmile fire_dct-vct_jan2011_pdfAar fourmile fire_dct-vct_jan2011_pdf
Aar fourmile fire_dct-vct_jan2011_pdf
 
Accessing and Using Food Data to Support Collaborative Policy Decisions - Pow...
Accessing and Using Food Data to Support Collaborative Policy Decisions - Pow...Accessing and Using Food Data to Support Collaborative Policy Decisions - Pow...
Accessing and Using Food Data to Support Collaborative Policy Decisions - Pow...
 
Os Pruett Sessionnotes
Os Pruett SessionnotesOs Pruett Sessionnotes
Os Pruett Sessionnotes
 

Similar a Time Travel - Predicting the Future and Surviving a Parallel Universe - JDC2012

WALA Tutorial at PLDI 2010
WALA Tutorial at PLDI 2010WALA Tutorial at PLDI 2010
WALA Tutorial at PLDI 2010Julian Dolby
 
Why Everyone Needs Credit Repair
Why Everyone Needs Credit RepairWhy Everyone Needs Credit Repair
Why Everyone Needs Credit Repairsemerson22
 
What Is Social Media
What Is Social MediaWhat Is Social Media
What Is Social MediaHAL
 
Est ce que la mise au point d'un vaccin changerait les stratégies de lutte co...
Est ce que la mise au point d'un vaccin changerait les stratégies de lutte co...Est ce que la mise au point d'un vaccin changerait les stratégies de lutte co...
Est ce que la mise au point d'un vaccin changerait les stratégies de lutte co...Institut Pasteur de Madagascar
 
Writing Sample Press Relaease
Writing Sample Press RelaeaseWriting Sample Press Relaease
Writing Sample Press Relaeasetbartlett21
 
New Year. Healthy Choices.
New Year. Healthy Choices.New Year. Healthy Choices.
New Year. Healthy Choices.Isabel Tuna
 
El color
El colorEl color
El colorlcarber
 
Ssijialiye
SsijialiyeSsijialiye
Ssijialiyerenata7
 
Critical thinking rubric
Critical thinking rubricCritical thinking rubric
Critical thinking rubricTimothy Welsh
 
illustration art market report illustrated gallery
illustration art market report illustrated galleryillustration art market report illustrated gallery
illustration art market report illustrated galleryIngrid Bond
 
Apprentice Power-Point Presentation/What is Apprenticeship Recruitment
Apprentice Power-Point Presentation/What is Apprenticeship Recruitment Apprentice Power-Point Presentation/What is Apprenticeship Recruitment
Apprentice Power-Point Presentation/What is Apprenticeship Recruitment The Pathway Group
 

Similar a Time Travel - Predicting the Future and Surviving a Parallel Universe - JDC2012 (20)

WALA Tutorial at PLDI 2010
WALA Tutorial at PLDI 2010WALA Tutorial at PLDI 2010
WALA Tutorial at PLDI 2010
 
Apple and pear strudel
Apple and pear strudelApple and pear strudel
Apple and pear strudel
 
Why Everyone Needs Credit Repair
Why Everyone Needs Credit RepairWhy Everyone Needs Credit Repair
Why Everyone Needs Credit Repair
 
What Is Social Media
What Is Social MediaWhat Is Social Media
What Is Social Media
 
Est ce que la mise au point d'un vaccin changerait les stratégies de lutte co...
Est ce que la mise au point d'un vaccin changerait les stratégies de lutte co...Est ce que la mise au point d'un vaccin changerait les stratégies de lutte co...
Est ce que la mise au point d'un vaccin changerait les stratégies de lutte co...
 
Writing Sample Press Relaease
Writing Sample Press RelaeaseWriting Sample Press Relaease
Writing Sample Press Relaease
 
New Year. Healthy Choices.
New Year. Healthy Choices.New Year. Healthy Choices.
New Year. Healthy Choices.
 
El color
El colorEl color
El color
 
Munne ki laash
Munne ki laashMunne ki laash
Munne ki laash
 
Victoria sponge
Victoria spongeVictoria sponge
Victoria sponge
 
Ssijialiye
SsijialiyeSsijialiye
Ssijialiye
 
Macaroons
MacaroonsMacaroons
Macaroons
 
Que es la ingenieria
Que es la ingenieriaQue es la ingenieria
Que es la ingenieria
 
Critical thinking rubric
Critical thinking rubricCritical thinking rubric
Critical thinking rubric
 
Carrot cake
Carrot cakeCarrot cake
Carrot cake
 
illustration art market report illustrated gallery
illustration art market report illustrated galleryillustration art market report illustrated gallery
illustration art market report illustrated gallery
 
Memes heddy
Memes heddyMemes heddy
Memes heddy
 
Raspberry mousse
Raspberry mousseRaspberry mousse
Raspberry mousse
 
New earth leaders brazilie 2011
New earth leaders brazilie 2011New earth leaders brazilie 2011
New earth leaders brazilie 2011
 
Apprentice Power-Point Presentation/What is Apprenticeship Recruitment
Apprentice Power-Point Presentation/What is Apprenticeship Recruitment Apprentice Power-Point Presentation/What is Apprenticeship Recruitment
Apprentice Power-Point Presentation/What is Apprenticeship Recruitment
 

Último

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Último (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

Time Travel - Predicting the Future and Surviving a Parallel Universe - JDC2012