This document discusses recursion in Erlang. It begins with examples of basic recursive functions like factorial and length. It then covers tail recursion and how to convert regular recursion to tail recursion using an accumulator. Finally, it provides more examples of recursive functions like reverse, sublist, zip, and quicksort. The key points are that recursion is the primary looping mechanism in Erlang, base cases are needed to stop infinite recursion, and tail recursion avoids stacking function calls.
elrang, a general-purpose, concurrent, functional programming language. (https://en.wikipedia.org/wiki/Erlang_(programming_language)
this slide describe the language, based on this book.
learn you some erlang - (http://learnyousomeerlang.com/)
this slide covers -
chapter 0 (introduction)
chapter 1 (startingout)
chapter 2 (modules)
The document discusses several ways to write recursive functions in Swift, including functions to calculate the factorial of a number, find the nth Fibonacci number, and determine if a number contains the digit 7. It also provides examples of using tail recursion to iterate over an array and reduce it to a single value, as well as using tail recursion with custom functions.
This document summarizes the simple and complex data types, constants, schemas, operators, and relational operators in Pig Latin. It provides information on loading, storing, filtering, joining, grouping, and transforming data using Pig Latin statements.
This document provides an overview of functional programming concepts in ES6 including:
1. Array methods like filter, map, reduce, and destructuring for manipulating arrays in a functional style with no side effects.
2. Methods for comparing, merging, and transforming arrays like finding differences, intersections, and unions.
3. Working with nested/deep arrays through functions like deepFindItem to search nested objects.
4. Functional rules like purity, immutability, and composition are discussed in contrast with imperative programming.
5. Examples of chaining array operations through function composition are provided.
Clips basics how to make expert system in clips | facts adding | rules makin...NaumanMalik30
AOA #CS607 k is tutorials ma meny #clips programming ma ES bnana sikhaya
Facebook: https://web.facebook.com/Nauman1
.Here is my #slideshare #link for downloading slides..
Asssignments k lia facebook link per contact krain
umeed hai ki aapko ye video achi lgi.
Please Share, Support, follow , Subscribe!!! or if u Need help me?
Facebook: https://web.facebook.com/Nauman1
Linkedin : https://bit.ly/2DYFgTg
Download #Artificial_intelligence_slides https://bit.ly/2HTb3dD
Subscribe Nauman Malik channel: https://bit.ly/2t1P3Dd
Cs607 #playlist on Youtube: https://bit.ly/2DNUjQM
Instagram: https://www.instagram.com/nauman_mlik/
Google Plus: https://bit.ly/2MSJq3n
BLOGspot https://naumanai.blogspot.com/
About : Nauman Malik is actually a YouTube Channel, where you will find #University
courses videos #Artificial_intelligence #cs607 #robotic technological videos in Urdu_
Hindi, #keep in touch for your Future #needs So don’t forgot to subscribe :)
Unit, functional, and integration tests are great first steps towards improving the quality of your python project. Ever wonder if there’s even more you can do? Maybe you've heard of property-based testing, fuzzing, and mutation testing but you're unsure exactly how they can help you. In this talk we’ll cover additional types of tests that can help improve the quality and robustness of your python projects: property-based testing, fuzz testing, stress testing, long term reliability testing, and mutation testing.
We’ll also go beyond just covering what these tests are. For each of the test types above, I’ll give you real world examples from open source software that I maintain that shows you the types of bugs each test type can find. I’ll also show you how you can integrate these tests into your Travis CI and/or Jenkins environment.
elrang, a general-purpose, concurrent, functional programming language. (https://en.wikipedia.org/wiki/Erlang_(programming_language)
this slide describe the language, based on this book.
learn you some erlang - (http://learnyousomeerlang.com/)
this slide covers -
6. higher order functions
7. errors and exceptions
Closure, Higher-order function in SwiftSeongGyu Jo
This document discusses closures and higher-order functions in Swift. It provides examples of using closures as parameters, including sorting an array by passing a closure. It also gives examples of common higher-order functions like map, filter and reduce. Map transforms elements by applying a closure, filter filters elements by a closure condition, and reduce combines elements using a closure.
elrang, a general-purpose, concurrent, functional programming language. (https://en.wikipedia.org/wiki/Erlang_(programming_language)
this slide describe the language, based on this book.
learn you some erlang - (http://learnyousomeerlang.com/)
this slide covers -
chapter 0 (introduction)
chapter 1 (startingout)
chapter 2 (modules)
The document discusses several ways to write recursive functions in Swift, including functions to calculate the factorial of a number, find the nth Fibonacci number, and determine if a number contains the digit 7. It also provides examples of using tail recursion to iterate over an array and reduce it to a single value, as well as using tail recursion with custom functions.
This document summarizes the simple and complex data types, constants, schemas, operators, and relational operators in Pig Latin. It provides information on loading, storing, filtering, joining, grouping, and transforming data using Pig Latin statements.
This document provides an overview of functional programming concepts in ES6 including:
1. Array methods like filter, map, reduce, and destructuring for manipulating arrays in a functional style with no side effects.
2. Methods for comparing, merging, and transforming arrays like finding differences, intersections, and unions.
3. Working with nested/deep arrays through functions like deepFindItem to search nested objects.
4. Functional rules like purity, immutability, and composition are discussed in contrast with imperative programming.
5. Examples of chaining array operations through function composition are provided.
Clips basics how to make expert system in clips | facts adding | rules makin...NaumanMalik30
AOA #CS607 k is tutorials ma meny #clips programming ma ES bnana sikhaya
Facebook: https://web.facebook.com/Nauman1
.Here is my #slideshare #link for downloading slides..
Asssignments k lia facebook link per contact krain
umeed hai ki aapko ye video achi lgi.
Please Share, Support, follow , Subscribe!!! or if u Need help me?
Facebook: https://web.facebook.com/Nauman1
Linkedin : https://bit.ly/2DYFgTg
Download #Artificial_intelligence_slides https://bit.ly/2HTb3dD
Subscribe Nauman Malik channel: https://bit.ly/2t1P3Dd
Cs607 #playlist on Youtube: https://bit.ly/2DNUjQM
Instagram: https://www.instagram.com/nauman_mlik/
Google Plus: https://bit.ly/2MSJq3n
BLOGspot https://naumanai.blogspot.com/
About : Nauman Malik is actually a YouTube Channel, where you will find #University
courses videos #Artificial_intelligence #cs607 #robotic technological videos in Urdu_
Hindi, #keep in touch for your Future #needs So don’t forgot to subscribe :)
Unit, functional, and integration tests are great first steps towards improving the quality of your python project. Ever wonder if there’s even more you can do? Maybe you've heard of property-based testing, fuzzing, and mutation testing but you're unsure exactly how they can help you. In this talk we’ll cover additional types of tests that can help improve the quality and robustness of your python projects: property-based testing, fuzz testing, stress testing, long term reliability testing, and mutation testing.
We’ll also go beyond just covering what these tests are. For each of the test types above, I’ll give you real world examples from open source software that I maintain that shows you the types of bugs each test type can find. I’ll also show you how you can integrate these tests into your Travis CI and/or Jenkins environment.
elrang, a general-purpose, concurrent, functional programming language. (https://en.wikipedia.org/wiki/Erlang_(programming_language)
this slide describe the language, based on this book.
learn you some erlang - (http://learnyousomeerlang.com/)
this slide covers -
6. higher order functions
7. errors and exceptions
Closure, Higher-order function in SwiftSeongGyu Jo
This document discusses closures and higher-order functions in Swift. It provides examples of using closures as parameters, including sorting an array by passing a closure. It also gives examples of common higher-order functions like map, filter and reduce. Map transforms elements by applying a closure, filter filters elements by a closure condition, and reduce combines elements using a closure.
The document discusses mathematical relations and functions. It defines Cartesian products and relations. Cartesian products combine elements from two sets into ordered pairs. Relations are subsets of Cartesian products that satisfy a given condition. The document provides examples of calculating Cartesian products and defining relations for given sets. It also establishes properties of Cartesian products, such as A × (B ∪ C) = (A × B) ∪ (A × C) and discusses domains and ranges of relations.
Giordano Scalzo introduces himself as an iOS developer and provides a swift introduction to the Swift programming language. He demonstrates various Swift features through code examples, including functions, closures, classes, structs, enums, generics, and operator overloading. He also discusses unit testing support in Swift through XCTest and Quick. To conclude, he proposes coding a reverse polish notation calculator to demonstrate applying these Swift concepts.
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...ssuserd6b1fd
C programming language notes for beginners and Collage students. Written for beginners. Colored graphics. Function by Function explanation with complete examples. Well commented examples. Illustrations are made available for data dealing at memory level.
The document provides information about Python programming language:
- Python was created in the late 1980s and became widely popular in the early 2000s.
- It is a high-level, general-purpose, interpreted programming language that can be used for web, desktop, game development, data science, and more.
- Some key features of Python include dynamic typing, automatic memory management, and being multi-paradigm supporting object-oriented, imperative, functional programming styles.
This document discusses PHP arrays, including indexed arrays, associative arrays, multi-dimensional arrays, and various functions for manipulating arrays. It covers printing arrays with print_r() and var_dump(), iterating through arrays with foreach loops, unravelling arrays into individual variables using list(), and performing operations like merging, comparing, sorting, and randomizing arrays. A variety of array functions are also described such as count(), is_array(), array_key_exists(), in_array(), array_flip(), array_reverse(), sort(), asort(), and more.
Richardson's extrapolation is a technique for improving the accuracy of numerical approximations of derivatives by using calculations with progressively smaller step sizes. It involves computing approximations using different step sizes h, h/2, h/4, etc. and extrapolating the results to estimate the derivative as the step size approaches zero. The document provides an overview of Taylor series and how they can be used to derive formulas for approximating first and second derivatives. It also discusses the orders of error in forward, backward, and central difference formulas and how Richardson's extrapolation can improve the accuracy of the approximations.
The document introduces various SQL techniques for limiting and filtering result sets using the WHERE clause, including compound criteria with AND and OR operators, comparisons, ranges, wildcards, escape characters, and pattern matching. Key topics covered include filtering rows by state, combining multiple filters, using operators like BETWEEN, LIKE with wildcards, and matching patterns within brackets.
A spreadsheet error in a 2010 research paper by Carmen Reinhart and Kenneth Rogoff undermined their conclusion that high debt-to-GDP ratios correlate with lower economic growth. Specifically, the paper incorrectly excluded several countries with debt over 90% GDP from its analysis, weakening the claimed relationship between high debt and slow growth that was influential in policymaking. The error was revealed in 2013 through independent research, demonstrating how easily mistakes can propagate in spreadsheets and the importance of transparent data and methodology.
2 BytesC++ course_2014_c2_ flow of control kinan keshkeh
This document summarizes key concepts from a computer science lecture, including boolean expressions, precedence rules, if/else statements, loops, and operators like comma. Boolean expressions evaluate to true or false. Precedence rules define the order of operations. Conditionals like if/else and switch statements allow for branching based on boolean tests. Loops like while and do-while iterate until a condition is met.
Here are the steps to translate the DNA sequence to its reverse complement using a dictionary and string translation:
1. Define a dictionary that maps DNA nucleotides to their complement (A->T, C->G, etc.)
2. Use the maketrans() string method to generate a translation table
3. Use the translate() string method to translate the sequence
4. Reverse the translated sequence using slicing
Putting it together:
1. complements = {"A":"T", "T":"A", "C":"G", "G":"C"}
2. table = str.maketrans("ACGT", "TGCA")
3. translated = sequence.translate(table)
Haskell is a non-strict, purely functional programming language with strong static type inference. It supports recursive data types like Color, recursive functions on those types, parametric polymorphism with types like lists and Maybe, type classes for concepts like equality and ordering, and default definitions for type class methods. Type classes provide ad-hoc polymorphism and are more static than object-oriented classes.
Codice legacy, usciamo dal pantano! @iad11Stefano Leli
Avete mai provato la sensazione di essere immersi in una melma di codice putrido e maleodorante e di non riuscire a venirne fuori nonostante tutti i vostri sforzi?
In questo workshop si cercherà di simulare proprio questo scenario proponendovi un esempio di progetto mal scritto e che sarete chiamati in prima persona a rifattorizzare.
Nel nostro ruolo di coach vi faremo capire come riconoscere il codice che ha bisogno di essere migliorato, ed applicando i solid principles verrete guidati verso un buon design in grado di portarvi in acque più sicure e pulite.
This document discusses syntax definition and provides examples using various syntax definition formalisms including Backus-Naur Form (BNF), Extended Backus-Naur Form (EBNF), and SDF3. It introduces concepts of lexical syntax, context-free syntax, abstract syntax, disambiguation, and testing syntax definitions. Specific examples are provided for defining the syntax of an expression language using BNF, EBNF, and SDF3. Testing syntax definitions using Spoofax is also discussed with examples of test cases for lexical and context-free syntax.
02 of 03 parts
Get Part 1 from https://www.slideshare.net/ArunUmrao/notes-for-c-programming-for-bca-mca-b-sc-msc-be-amp-btech-1st-year-1
Get Part 3 from https://www.slideshare.net/ArunUmrao/notes-for-c-programming-for-bca-mca-b-sc-msc-be-amp-btech-1st-year-3
C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, while a static type system prevents unintended operations. C provides constructs that map efficiently to typical machine instructions and has found lasting use in applications previously coded in assembly language. Such applications include operating systems and various application software for computers, from supercomputers to PLCs and embedded system.
Perl 6 for Concurrency and Parallel ComputingAndrew Shitov
This document discusses parallel and concurrent features in Perl 6. It covers implicit parallelism enabled by operators like hyper operators and junctions. Explicit parallelism using feeds, channels, and promises is also discussed. Promises allow asynchronous and parallel execution, and examples are given using Promise.in to run code in threads and the sleep sort algorithm. Further parallel constructs like schedulers, suppliers, signals, threads, atomic operations, locks and semaphores are also mentioned for additional exploration.
The document discusses what's new in Perl 5.14, including new syntax features like given and (?^...) switches, improvements to regular expressions with modifiers like /a and /r, and changes to how arrays and hashes are handled when referenced. It also mentions bug fixes, performance enhancements, and new modules/pragmas in Perl 5.14. The document encourages users to upgrade from older versions of Perl like 5.10 due to ending of support.
The document discusses operator precedence parsing, which is a bottom-up parsing technique for operator grammars. It describes operator precedence grammars as grammars where no RHS has a non-terminal and no two non-terminals are adjacent. An operator precedence parser uses a parsing table to shift or reduce based on the precedence relations between terminals. It provides an example of constructing a precedence parsing table and parsing a string using the operator precedence parsing algorithm.
elrang, a general-purpose, concurrent, functional programming language. (https://en.wikipedia.org/wiki/Erlang_(programming_language)
this slide describe the language, based on this book.
learn you some erlang - (http://learnyousomeerlang.com/)
this slide covers -
11. more on multi processing
12. errors and processes
elrang, a general-purpose, concurrent, functional programming language. (https://en.wikipedia.org/wiki/Erlang_(programming_language)
this slide describe the language, based on this book.
learn you some erlang - (http://learnyousomeerlang.com/)
this slide covers -
9. A short visit to common data structures
10. the hitchhiker's guide to concurrency
The document describes designing a concurrent event notification application in Erlang. It discusses defining the roles of an event server, events, and clients. The event server accepts event subscriptions from clients, adds and cancels events, and forwards notifications. Events are spawned as processes that notify the server when their deadline is reached. The server design, event and client protocols, and code for implementing an event module and server are covered in detail.
Morfologia de proceso de aparatos genitalesKevin Cázares
El documento describe la morfología del aparato reproductor masculino y femenino. El aparato femenino incluye órganos externos como el clítoris, labios mayores y menores, y monte de Venus, así como órganos internos como los ovarios, útero, vagina y trompas de Falopio. El aparato masculino consiste en los testículos, que producen espermatozoides y hormonas, el epidídimo, conductos deferentes y la uretra. Ambos aparatos cumplen funciones reproductivas como la produ
The document discusses mathematical relations and functions. It defines Cartesian products and relations. Cartesian products combine elements from two sets into ordered pairs. Relations are subsets of Cartesian products that satisfy a given condition. The document provides examples of calculating Cartesian products and defining relations for given sets. It also establishes properties of Cartesian products, such as A × (B ∪ C) = (A × B) ∪ (A × C) and discusses domains and ranges of relations.
Giordano Scalzo introduces himself as an iOS developer and provides a swift introduction to the Swift programming language. He demonstrates various Swift features through code examples, including functions, closures, classes, structs, enums, generics, and operator overloading. He also discusses unit testing support in Swift through XCTest and Quick. To conclude, he proposes coding a reverse polish notation calculator to demonstrate applying these Swift concepts.
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...ssuserd6b1fd
C programming language notes for beginners and Collage students. Written for beginners. Colored graphics. Function by Function explanation with complete examples. Well commented examples. Illustrations are made available for data dealing at memory level.
The document provides information about Python programming language:
- Python was created in the late 1980s and became widely popular in the early 2000s.
- It is a high-level, general-purpose, interpreted programming language that can be used for web, desktop, game development, data science, and more.
- Some key features of Python include dynamic typing, automatic memory management, and being multi-paradigm supporting object-oriented, imperative, functional programming styles.
This document discusses PHP arrays, including indexed arrays, associative arrays, multi-dimensional arrays, and various functions for manipulating arrays. It covers printing arrays with print_r() and var_dump(), iterating through arrays with foreach loops, unravelling arrays into individual variables using list(), and performing operations like merging, comparing, sorting, and randomizing arrays. A variety of array functions are also described such as count(), is_array(), array_key_exists(), in_array(), array_flip(), array_reverse(), sort(), asort(), and more.
Richardson's extrapolation is a technique for improving the accuracy of numerical approximations of derivatives by using calculations with progressively smaller step sizes. It involves computing approximations using different step sizes h, h/2, h/4, etc. and extrapolating the results to estimate the derivative as the step size approaches zero. The document provides an overview of Taylor series and how they can be used to derive formulas for approximating first and second derivatives. It also discusses the orders of error in forward, backward, and central difference formulas and how Richardson's extrapolation can improve the accuracy of the approximations.
The document introduces various SQL techniques for limiting and filtering result sets using the WHERE clause, including compound criteria with AND and OR operators, comparisons, ranges, wildcards, escape characters, and pattern matching. Key topics covered include filtering rows by state, combining multiple filters, using operators like BETWEEN, LIKE with wildcards, and matching patterns within brackets.
A spreadsheet error in a 2010 research paper by Carmen Reinhart and Kenneth Rogoff undermined their conclusion that high debt-to-GDP ratios correlate with lower economic growth. Specifically, the paper incorrectly excluded several countries with debt over 90% GDP from its analysis, weakening the claimed relationship between high debt and slow growth that was influential in policymaking. The error was revealed in 2013 through independent research, demonstrating how easily mistakes can propagate in spreadsheets and the importance of transparent data and methodology.
2 BytesC++ course_2014_c2_ flow of control kinan keshkeh
This document summarizes key concepts from a computer science lecture, including boolean expressions, precedence rules, if/else statements, loops, and operators like comma. Boolean expressions evaluate to true or false. Precedence rules define the order of operations. Conditionals like if/else and switch statements allow for branching based on boolean tests. Loops like while and do-while iterate until a condition is met.
Here are the steps to translate the DNA sequence to its reverse complement using a dictionary and string translation:
1. Define a dictionary that maps DNA nucleotides to their complement (A->T, C->G, etc.)
2. Use the maketrans() string method to generate a translation table
3. Use the translate() string method to translate the sequence
4. Reverse the translated sequence using slicing
Putting it together:
1. complements = {"A":"T", "T":"A", "C":"G", "G":"C"}
2. table = str.maketrans("ACGT", "TGCA")
3. translated = sequence.translate(table)
Haskell is a non-strict, purely functional programming language with strong static type inference. It supports recursive data types like Color, recursive functions on those types, parametric polymorphism with types like lists and Maybe, type classes for concepts like equality and ordering, and default definitions for type class methods. Type classes provide ad-hoc polymorphism and are more static than object-oriented classes.
Codice legacy, usciamo dal pantano! @iad11Stefano Leli
Avete mai provato la sensazione di essere immersi in una melma di codice putrido e maleodorante e di non riuscire a venirne fuori nonostante tutti i vostri sforzi?
In questo workshop si cercherà di simulare proprio questo scenario proponendovi un esempio di progetto mal scritto e che sarete chiamati in prima persona a rifattorizzare.
Nel nostro ruolo di coach vi faremo capire come riconoscere il codice che ha bisogno di essere migliorato, ed applicando i solid principles verrete guidati verso un buon design in grado di portarvi in acque più sicure e pulite.
This document discusses syntax definition and provides examples using various syntax definition formalisms including Backus-Naur Form (BNF), Extended Backus-Naur Form (EBNF), and SDF3. It introduces concepts of lexical syntax, context-free syntax, abstract syntax, disambiguation, and testing syntax definitions. Specific examples are provided for defining the syntax of an expression language using BNF, EBNF, and SDF3. Testing syntax definitions using Spoofax is also discussed with examples of test cases for lexical and context-free syntax.
02 of 03 parts
Get Part 1 from https://www.slideshare.net/ArunUmrao/notes-for-c-programming-for-bca-mca-b-sc-msc-be-amp-btech-1st-year-1
Get Part 3 from https://www.slideshare.net/ArunUmrao/notes-for-c-programming-for-bca-mca-b-sc-msc-be-amp-btech-1st-year-3
C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, while a static type system prevents unintended operations. C provides constructs that map efficiently to typical machine instructions and has found lasting use in applications previously coded in assembly language. Such applications include operating systems and various application software for computers, from supercomputers to PLCs and embedded system.
Perl 6 for Concurrency and Parallel ComputingAndrew Shitov
This document discusses parallel and concurrent features in Perl 6. It covers implicit parallelism enabled by operators like hyper operators and junctions. Explicit parallelism using feeds, channels, and promises is also discussed. Promises allow asynchronous and parallel execution, and examples are given using Promise.in to run code in threads and the sleep sort algorithm. Further parallel constructs like schedulers, suppliers, signals, threads, atomic operations, locks and semaphores are also mentioned for additional exploration.
The document discusses what's new in Perl 5.14, including new syntax features like given and (?^...) switches, improvements to regular expressions with modifiers like /a and /r, and changes to how arrays and hashes are handled when referenced. It also mentions bug fixes, performance enhancements, and new modules/pragmas in Perl 5.14. The document encourages users to upgrade from older versions of Perl like 5.10 due to ending of support.
The document discusses operator precedence parsing, which is a bottom-up parsing technique for operator grammars. It describes operator precedence grammars as grammars where no RHS has a non-terminal and no two non-terminals are adjacent. An operator precedence parser uses a parsing table to shift or reduce based on the precedence relations between terminals. It provides an example of constructing a precedence parsing table and parsing a string using the operator precedence parsing algorithm.
elrang, a general-purpose, concurrent, functional programming language. (https://en.wikipedia.org/wiki/Erlang_(programming_language)
this slide describe the language, based on this book.
learn you some erlang - (http://learnyousomeerlang.com/)
this slide covers -
11. more on multi processing
12. errors and processes
elrang, a general-purpose, concurrent, functional programming language. (https://en.wikipedia.org/wiki/Erlang_(programming_language)
this slide describe the language, based on this book.
learn you some erlang - (http://learnyousomeerlang.com/)
this slide covers -
9. A short visit to common data structures
10. the hitchhiker's guide to concurrency
The document describes designing a concurrent event notification application in Erlang. It discusses defining the roles of an event server, events, and clients. The event server accepts event subscriptions from clients, adds and cancels events, and forwards notifications. Events are spawned as processes that notify the server when their deadline is reached. The server design, event and client protocols, and code for implementing an event module and server are covered in detail.
Morfologia de proceso de aparatos genitalesKevin Cázares
El documento describe la morfología del aparato reproductor masculino y femenino. El aparato femenino incluye órganos externos como el clítoris, labios mayores y menores, y monte de Venus, así como órganos internos como los ovarios, útero, vagina y trompas de Falopio. El aparato masculino consiste en los testículos, que producen espermatozoides y hormonas, el epidídimo, conductos deferentes y la uretra. Ambos aparatos cumplen funciones reproductivas como la produ
The document requests feedback on various marketing activities including market visits, leafleting, banners, posters, and business associates. It asks the respondent to provide any kind of feedback related to ideas, problems, questions or praise for these activities in a structured format.
14/12/2016; impreza: Wykład w ramach projektu „Akademia Sztuk Wszelakich”; organizacja: Kujawsko-pomorskie Centrum Kultury w Bydgoszczy; miejsce: Kujawsko-pomorskie Centrum Kultury w Bydgoszczy, Bydgoszcz.
Francis Lunda has over 10 years of experience in safety, health, environmental management and warehouse operations. He holds degrees in international relations and pedagogy as well as certificates in English, first aid, and inventory management. Currently he works as a stores supervisor at Mutanda Mine in Kolwezi, DRC, where his responsibilities include stock record keeping, processing receiving and shipping information, and ensuring policies are followed. Previously he was a safety officer focused on training, compliance, awareness programs and incident reporting.
RabbitMQ/ActiveMQ 와 같은 비동기 메시징 미들웨어를 이용하여 다량의 서버를 orchestration(command & control) 할 수 있는 mcollective에 대한 한글 ppt 자료입니다. 상세한 내용은 http://wiki.tunelinux.pe.kr/x/LQAy 를 참고하시면 됩니다.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise causes chemical changes in the brain that may help boost feelings of calmness and well-being.
Diagnostic Medical Sonography STEPS SessionReference Desk
This document provides information about the Diagnostic Medical Sonography program at HGTC, including admission requirements and prerequisites. The 4 semester program begins each fall at the Grand Strand campus. Applicants must complete 11 prerequisite courses with a minimum 2.5 GPA, submit their application by March 15, and obtain at least 49 points on the weighted criteria scale which considers factors like GPA, residency status, and healthcare experience/certifications. Accepted students must also complete background checks, drug screens, immunizations, and CPR certification at their own expense before the program start date.
자동화된 인프라 구축
Building an Automated Infrastructure
2009년 https://groups.google.com/forum/#!forum/sysadminstudy 에서 발표했던 자료입니다.
출처 : http://wiki.tunelinux.pe.kr/pages/viewpage.action?pageId=884766
Pankaj saharia the essentials of project successPankaj Saharia
A structural engineer by profession, Pankaj Saharia was part of the team of engineers who helped come up with the Overhead Coverage System (OCS) in Iraq. The OCS was designed to withstand, among other things, rocket attacks in dangerous regions, thus, providing physical protection to troops during combat missions. The design and implementation of OCS have received several awards worldwide.
DEVOPS 전반적인 것에 대해서 소개를 한 자료입니다.
http://wiki.tunelinux.pe.kr/display/sysadmin/DEVOPS
https://groups.google.com/forum/#!topic/sysadminstudy/g4bM_xbZPC8
DevOps 시작
DevOps 정의
Dev vs Ops 충돌
DevOps 유래
참고자료
애자일 방법론
ITIL
린스타트업
린 생산방식
애자일을 OPS로 확장
DevOps 관점 : 측정지표 관점, 프로세스 관점, 기술 관점
DevOps가 아닌 것은?
DevOps 소개
프로젝트 세팅 : 전통적인 프로젝트 세팅, 애자일 프로세스 세팅
하나의 팀
핵심
가치와 목적
프로세스
도구
DevOps 구성하기
측정지표 : cycle time, 변경(change)
흐름 개선하기
배포 개선 및 가속화 : batch size 줄이고 더 자주 배포하여 cyclle time 줄이기.
못 다한 이야기 : Metrics and Measurement View / Process View / Technical View
Top 11 Things About DevOps
DevOps의 기초 원리 : 전체 시스템적인 사고, 피드백 루프를 확대하기, 지속적인 실헝과 학습
자동화 도구
이상적인 프로젝트란?
버전관리
티켓관리
지속적인 통합(CI)
지속적인 배포(CD)
프로비저닝 툴체인
OS설치
설정
오케스트레이션(배포)/워크플로우
이제 무엇을 할까?
나가면서
참고자료
This document summarizes the use of various editing tools in Final Cut Pro X and Photoshop. It describes how the trim tool, color correction tool, zoom tool, and import tool in Final Cut Pro X allow editing of video clips. The adjustment tool in Photoshop allows editing pictures by adjusting brightness, contrast, and levels. The layer tool in Photoshop controls the order of images and allows placing images on top of each other.
This document provides an introduction to the Elixir programming language. It discusses what Elixir and Erlang are, how to install Elixir, manage packages and environments with Mix, set up a new project, run code, and work with basic data types like integers, floats, booleans, strings, lists, tuples, and maps. It also covers conditionals, functions, modules, debugging, exercises, and suggests topics to learn next like iterating, mapping, recursion, OTP, Phoenix, Ecto, and Nerves.
The document discusses Python functions. Some key points covered include:
- Functions are reusable blocks of code defined using the def keyword that can accept parameters and return values.
- To execute a function, it must be called by name with appropriate arguments.
- Functions can call themselves, which is known as recursion.
- Functions can have default, variable, and keyword parameters to provide flexibility in how they are called.
PHP is a server-side scripting language that is embedded into HTML files. The goal is to generate client-side code like HTML, CSS, and JavaScript. PHP files are executed on the web server and must be saved in a subdirectory that is accessible to the server, like /var/www. PHP allows variables, operators, conditional statements, loops, functions, and arrays. Sessions and cookies can be used to store and retrieve information across multiple requests.
This document provides an overview of functional programming concepts in Ruby. It discusses the history and advantages of functional programming, comparing the functional and object-oriented paradigms. It introduces functional programming concepts like pure functions, recursion, immutable data, and higher-order functions. It demonstrates how these concepts can be applied in Ruby using functions, closures, currying, composition, and the Enumerable module. Overall, the document serves as a high-level introduction to thinking functionally in Ruby.
Can't Miss Features of PHP 5.3 and 5.4Jeff Carouth
If you're like me you remember the days of PHP3 and PHP4; you remember when PHP5 was released, and how it was touted to change to your life. It's still changing and there are some features of PHP 5.3 and new ones coming with PHP 5.4 that will improve your code readability and reusability. Let's look at some touted features such as closures, namespaces, and traits, as well as some features being discussed for future releases.
A lot of people using PHPunit for testing their source code. While I was observing my team
I recognized most of them are only using the standard ssertions like 'assertEquals()' or
'assertTrue()' and are complaining about how hard it is to test the code even when the tests are written first. This talk is about all the stuff not used on a daily basis. It shows you some nice features of PHPUnit and how to use them for your benefit.
Python quickstart for programmers: Python Kung Fuclimatewarrior
The document provides an overview of key Python concepts including data types, operators, control flow statements, functions, objects and classes. It discusses lists in depth, covering creation, iteration, searching and common list methods. It also briefly touches on modules, exceptions, inheritance and other advanced topics.
The document discusses functions in C programming. It provides examples of functions that return values, functions that accept arguments, and functions that call other functions. It also discusses concepts like scope of variables, passing arguments by value, and returning values from functions. Functions are defined as blocks of code that perform a specific task and can be reused. The examples demonstrate how to write functions and call them from other parts of the code.
This document discusses six Python packages that are useful to know:
1. First - A utility for selecting the first successful result from a sequence of functions.
2. Parse - A library for parsing Python format strings and extracting values.
3. Filecmp - A module for comparing files and directories.
4. Bitrot - A tool for detecting silent data corruption in files.
5. Docopt - A tool for generating command-line interfaces from a docstring.
6. Six - A library for writing code that is compatible with both Python 2 and Python 3.
Knolx Session : Built-In Control Structures in ScalaAyush Mishra
Scala has only a handful of built-in control structures including if, while, for, try, match, and function calls. These control structures can be used in both an imperative style by modifying program state, as well as a functional style by returning new values. For example, a for loop can iterate over a sequence and return a new collection with the results of the body expression.
The document discusses various features and capabilities of PHPUnit for testing PHP code. It covers command line options for PHPUnit like filters and coverage reports. It also covers different types of assertions for validating test expectations, using annotations to organize tests, and special tests for things like exceptions. The document aims to explain some of the more advanced but lesser known aspects of using PHPUnit for testing.
The document discusses recursion and provides examples of recursive functions and algorithms including:
1) A recursive function to calculate the sum of an arithmetic series. It breaks the problem down into smaller sub-problems by recursively calling itself to calculate successive terms until the base case is reached.
2) Binary search illustrated recursively by dividing the search space in half on each recursive call until the target value is found or the space is empty.
3) Mergesort explained as a divide and conquer algorithm that recursively sorts sublists until lists of size 1 are reached and then merges the sorted sublists.
Wrong provides a general assert method that takes a predicate block. Assertion failure messages are rich in detail. The Wrong idea is to replace all those countless assert\_this, assert\_that, should\_something library methods which only exist to give a more useful failure message than "assertion failed". Wrong replaces all of them in one fell swoop, since if you can write it in Ruby, Wrong can make a sensible failure message out of it.
This document provides an important notice about final project milestones, links to slides about front end web development (FEWD), instructions for setting up a GitHub repository and copying code files for this week's lesson, and an agenda for reviewing variables, conditionals, functions, and working with arrays and collections of data. Students are instructed to begin writing pseudo code and drafting HTML/CSS for their application and submit it by the end of the 7th week.
This document summarizes built-in predicates in Prolog including:
- Utility goals like help and halt
- Loading and testing types of Prolog programs
- Arithmetic, equality, and database manipulation predicates
- Input/output predicates for writing, reading, and file handling
- Control predicates for negation, conjunction, disjunction
- Finding all solutions with findall, bagof, and setof
Functions allow programmers to organize and reuse code. There are three types of functions: built-in functions, modules, and user-defined functions. User-defined functions are created using the def keyword and can take parameters and arguments. Functions can return values and have different scopes depending on if a variable is local or global. Recursion is when a function calls itself, and is useful for breaking down complex problems into simpler sub-problems. Common recursive functions calculate factorials, Fibonacci numbers, and generate the Pascal's triangle.
The document discusses functional programming and pattern matching. It provides examples of using pattern matching in functional programming to:
1. Match on algebraic data types like lists to traverse and operate on data in a recursive manner. Pattern matching allows adding new operations easily by adding new patterns.
2. Use pattern matching in variable declarations to destructure data like tuples and case class objects.
3. Perform pattern matching on function parameters to selectively apply different logic based on the patterns, like filtering even numbers from a list. Everything can be treated as values and expressions in functional programming.
Function Programming in Scala.
A lot of my examples here comes from the book
Functional programming in Scala By Paul Chiusano and Rúnar Bjarnason, It is a good book, buy it.
This document discusses functional programming concepts in PHP 7 including lambda functions, closures, higher-order functions, currying, partial application, point-free style, and immutability. Examples are provided to demonstrate how these concepts can be applied to writing validation logic in a functional way using functions like pipe(), ifElse(), anyPass(), and has(). The talk encourages adopting a functional programming style for PHP code to write more reusable and composable functions.
Similar to learn you some erlang - chap3 to chap5 (20)
SOCRadar's Aviation Industry Q1 Incident Report is out now!
The aviation industry has always been a prime target for cybercriminals due to its critical infrastructure and high stakes. In the first quarter of 2024, the sector faced an alarming surge in cybersecurity threats, revealing its vulnerabilities and the relentless sophistication of cyber attackers.
SOCRadar’s Aviation Industry, Quarterly Incident Report, provides an in-depth analysis of these threats, detected and examined through our extensive monitoring of hacker forums, Telegram channels, and dark web platforms.
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
Measures in SQL (SIGMOD 2024, Santiago, Chile)Julian Hyde
SQL has attained widespread adoption, but Business Intelligence tools still use their own higher level languages based upon a multidimensional paradigm. Composable calculations are what is missing from SQL, and we propose a new kind of column, called a measure, that attaches a calculation to a table. Like regular tables, tables with measures are composable and closed when used in queries.
SQL-with-measures has the power, conciseness and reusability of multidimensional languages but retains SQL semantics. Measure invocations can be expanded in place to simple, clear SQL.
To define the evaluation semantics for measures, we introduce context-sensitive expressions (a way to evaluate multidimensional expressions that is consistent with existing SQL semantics), a concept called evaluation context, and several operations for setting and modifying the evaluation context.
A talk at SIGMOD, June 9–15, 2024, Santiago, Chile
Authors: Julian Hyde (Google) and John Fremlin (Google)
https://doi.org/10.1145/3626246.3653374
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesQuickdice ERP
Explore the seamless transition to e-invoicing with this comprehensive guide tailored for Saudi Arabian businesses. Navigate the process effortlessly with step-by-step instructions designed to streamline implementation and enhance efficiency.
When it is all about ERP solutions, companies typically meet their needs with common ERP solutions like SAP, Oracle, and Microsoft Dynamics. These big players have demonstrated that ERP systems can be either simple or highly comprehensive. This remains true today, but there are new factors to consider, including a promising new contender in the market that’s Odoo. This blog compares Odoo ERP with traditional ERP systems and explains why many companies now see Odoo ERP as the best choice.
What are ERP Systems?
An ERP, or Enterprise Resource Planning, system provides your company with valuable information to help you make better decisions and boost your ROI. You should choose an ERP system based on your company’s specific needs. For instance, if you run a manufacturing or retail business, you will need an ERP system that efficiently manages inventory. A consulting firm, on the other hand, would benefit from an ERP system that enhances daily operations. Similarly, eCommerce stores would select an ERP system tailored to their needs.
Because different businesses have different requirements, ERP system functionalities can vary. Among the various ERP systems available, Odoo ERP is considered one of the best in the ERp market with more than 12 million global users today.
Odoo is an open-source ERP system initially designed for small to medium-sized businesses but now suitable for a wide range of companies. Odoo offers a scalable and configurable point-of-sale management solution and allows you to create customised modules for specific industries. Odoo is gaining more popularity because it is built in a way that allows easy customisation, has a user-friendly interface, and is affordable. Here, you will cover the main differences and get to know why Odoo is gaining attention despite the many other ERP systems available in the market.
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
UI5con 2024 - Bring Your Own Design SystemPeter Muessig
How do you combine the OpenUI5/SAPUI5 programming model with a design system that makes its controls available as Web Components? Since OpenUI5/SAPUI5 1.120, the framework supports the integration of any Web Components. This makes it possible, for example, to natively embed own Web Components of your design system which are created with Stencil. The integration embeds the Web Components in a way that they can be used naturally in XMLViews, like with standard UI5 controls, and can be bound with data binding. Learn how you can also make use of the Web Components base class in OpenUI5/SAPUI5 to also integrate your Web Components and get inspired by the solution to generate a custom UI5 library providing the Web Components control wrappers for the native ones.
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
Microservice Teams - How the cloud changes the way we workSven Peters
A lot of technical challenges and complexity come with building a cloud-native and distributed architecture. The way we develop backend software has fundamentally changed in the last ten years. Managing a microservices architecture demands a lot of us to ensure observability and operational resiliency. But did you also change the way you run your development teams?
Sven will talk about Atlassian’s journey from a monolith to a multi-tenanted architecture and how it affected the way the engineering teams work. You will learn how we shifted to service ownership, moved to more autonomous teams (and its challenges), and established platform and enablement teams.
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
8 Best Automated Android App Testing Tool and Framework in 2024.pdfkalichargn70th171
Regarding mobile operating systems, two major players dominate our thoughts: Android and iPhone. With Android leading the market, software development companies are focused on delivering apps compatible with this OS. Ensuring an app's functionality across various Android devices, OS versions, and hardware specifications is critical, making Android app testing essential.
2. 3. SYNTAX IN FUNCTIONS
PATTERN MATCHING
▸ greet without patten matching
function greet(Gender,Name)
if Gender == male then
print("Hello, Mr. %s!", Name)
else if Gender == female then
print("Hello, Mrs. %s!", Name)
else
print("Hello, %s!", Name)
end
4. 3. SYNTAX IN FUNCTIONS
PATTERN MATCHING
▸ disusing / using
function(X) ->
Expression;
function(Y) ->
Expression;
function(_) ->
Expression.
function(Args)
if X then
Expression
else if Y then
Expression
else
Expression
5. 3. SYNTAX IN FUNCTIONS
PATTERN MATCHING
▸ example
head([H|_]) -> H.
second([_,X|_]) -> X.
same(X,X) ->
true;
same(_,_) ->
false.
6. 3. SYNTAX IN FUNCTIONS
PATTERN MATCHING
▸ how’s it works?
▸ error occurs unless the new value is the same as the old
one
7. 3. SYNTAX IN FUNCTIONS
PATTERN MATCHING
▸ example2
▸ functions head’s ‘=‘ operator
valid_time({Date = {Y,M,D}, Time = {H,Min,S}}) ->
io:format("The Date tuple (~p) says today is: ~p/~p/~p,~n”,
[Date,Y,M,D]),
io:format("The time tuple (~p) indicates: ~p:~p:~p.~n”,
[Time,H,Min,S]);
valid_time(_) ->
io:format("Stop feeding me wrong data!~n").
8. 3. SYNTAX IN FUNCTIONS
PATTERN MATCHING
▸ example2
▸ prob: It also recv just tuple! and too precise sometimes.
4> c(functions).
{ok, functions}
5> functions:valid_time({{2011,09,06},{09,04,43}}).
The Date tuple ({2011,9,6}) says today is: 2011/9/6,
The time tuple ({9,4,43}) indicates: 9:4:43.
ok
6> functions:valid_time({{2011,09,06},{09,04}}).
Stop feeding me wrong data!
9. 3. SYNTAX IN FUNCTIONS
GUARDS,GUARDS!
▸ needs expressive way on sometimes…
▸ range of value
▸ not limited as certain types of data
10. 3. SYNTAX IN FUNCTIONS
GUARDS,GUARDS!
▸ impractical vs practical
old_enough(0) -> false;
old_enough(1) -> false;
old_enough(2) -> false;
...
old_enough(14) -> false;
old_enough(15) -> false;
old_enough(_) -> true.
ok
old_enough(X) when X >= 16 -> true;
old_enough(_) -> false.
11. 3. SYNTAX IN FUNCTIONS
GUARDS,GUARDS!
▸ simillar with andalso (little diff aspect on exceptions)
▸ orelse
right_age(X) when X >= 16, X =< 104 ->
true;
right_age(_) ->
false.
wrong_age(X) when X < 16; X > 104 ->
true;
wrong_age(_) ->
false.
12. 3. SYNTAX IN FUNCTIONS
GUARDS,GUARDS!
▸ in guard, You will be
▸ able to use functions like
▸ A*B/C >= 0
▸ is_integer/1, is_atom/1 …
▸ unable to use user defined function
▸ because of side-effect
13. 3. SYNTAX IN FUNCTIONS
WHAT THE IF!?
▸ similiar with guard but outside of function clauses head
▸ different from other language
14. 3. SYNTAX IN FUNCTIONS
WHAT THE IF!?
-module(what_the_if).
-export([heh_fine/0]).
heh_fine() ->
if 1 =:= 1 ->
works
end,
if 1 =:= 2; 1 =:= 1 ->
works
end,
if 1 =:= 2, 1 =:= 1 ->
fails
end.
15. 3. SYNTAX IN FUNCTIONS
WHAT THE IF!?
1> c(what_the_if).
./what_the_if.erl:12: Warning: no clause will ever match
./what_the_if.erl:12: Warning: the guard for this clause evaluates to
'false'
{ok,what_the_if}
2> what_the_if:heh_fine().
** exception error: no true branch found when evaluating an if
expression
in function what_the_if:heh_fine/0
16. 3. SYNTAX IN FUNCTIONS
WHAT THE IF!?
▸ true branch
oh_god(N) ->
if N =:= 2 -> might_succeed;
true -> always_does %% this is Erlang's if's 'else!'
end.
4> what_the_if:oh_god(2).
might_succeed
5> what_the_if:oh_god(3).
always_does
17. 3. SYNTAX IN FUNCTIONS
WHAT IS IF!?
▸ why not else ?
▸ both branch should be avoided
▸ if is usually easier
▸ guard has only limited set
18. 3. SYNTAX IN FUNCTIONS
IN CASE … OF
▸ example
insert(X,[]) ->
[X];
insert(X,Set) ->
case lists:member(X,Set) of
true -> Set;
false -> [X|Set]
end.
19. 3. SYNTAX IN FUNCTIONS
IN CASE … OF
▸ pattern matching + guard
beach(Temperature) ->
case Temperature of
{celsius, N} when N >= 20, N =< 45 ->
'favorable';
{kelvin, N} when N >= 293, N =< 318 ->
'scientifically favorable';
{fahrenheit, N} when N >= 68, N =< 113 ->
'favorable in the US’;
_ ->
'avoid beach'
end.
20. 3. SYNTAX IN FUNCTIONS
IN CASE … OF
▸ instead, we can replace with bunch of functions.
beachf({celsius, N}) when N >= 20, N =< 45 ->
'favorable';
...
beachf(_) ->
'avoid beach'.
21. 3. SYNTAX IN FUNCTIONS
WHICH TO USE?
▸ function call vs case of
▸ same way at a lower level
▸ only one difference when arg is more than one
case {A,B} of
Pattern Guards -> ...
end.
22. 3. SYNTAX IN FUNCTIONS
WHICH TO USE?
▸ function call vs case of
▸ arguably cleaner
insert(X,[]) ->
[X];
insert(X,Set) ->
case lists:member(X,Set) of
true -> Set;
false -> [X|Set]
end.
23. 3. SYNTAX IN FUNCTIONS
WHICH TO USE?
▸ if vs if through guard?
▸ use where doesn’t need whole pattern matching
▸ personal preference
24. 4. TYPES (OR LACK OF THERE OF)
DYNAMITE-STRONG TYPING
▸ as you’ve seen, no need to type Type!
▸ elang is dynamically typed
▸ compiler won't always yell at you
▸ statically typed language is safer..?
▸ elang is reported as nine nine (99.999 % available)
▸ strongly typed
1> 6 + "1".
25. 4. TYPES (OR LACK OF THERE OF)
DYNAMITE-STRONG TYPING
▸ type conversion
<type>_to_<type>
1> erlang:list_to_integer("54").
54
2> erlang:integer_to_list(54).
"54"
3> erlang:list_to_integer("54.32").
** exception error: bad argument in function list_to_integer/1
called as list_to_integer("54.32")
26. 4. TYPES (OR LACK OF THERE OF)
TYPE CONVERSION
▸ type conversion
<type>_to_<type>
4> erlang:list_to_float("54.32").
54.32
5> erlang:atom_to_list(true).
"true"
6> erlang:list_to_bitstring("hi there").
<<"hi there">>
7> erlang:bitstring_to_list(<<"hi there">>).
"hi there"
27. 4. TYPES (OR LACK OF THERE OF)
TO GUARD A DATA TYPE
▸ type check
▸ why not typeof
▸ force user to make program that surely knowing the effect
▸ can used in guard expression
is_atom/1 is_binary/1
is_bitstring/1 is_boolean/1 is_builtin/3
is_float/1 is_function/1 is_function/2
is_integer/1 is_list/1 is_number/1
is_pid/1 is_port/1 is_record/2
is_record/3 is_reference/1 is_tuple/1
28. 4. TYPES (OR LACK OF THERE OF)
FOR TYPE JUNKIES
▸ briefly describe tools used to do static type analysis
▸ first try in 1997
▸ success type
▸ will not exact type every expression
▸ type it infers are right, type errors it finds are really error
29. 4. TYPES (OR LACK OF THERE OF)
FOR TYPE JUNKIES
▸ success type
and(_,_) -> bool()
and(false, _) -> false;
and(_, false) -> false;
and(true,true) -> true.
30. 4. TYPES (OR LACK OF THERE OF)
FOR TYPE JUNKIES
▸ if you interested
$ typer --help
$ dialyzer --help
34. 5. RECURSION
LENGTH
▸ we need
▸ simplest - empty list
a base case;
a function that calls itself;
a list to try our function on.
fac(0) -> 1;
fac(N) when N > 0 -> N*fac(N-1).
37. 5. RECURSION
LENGTH OF A TAIL RECURSION
▸ it is problematic
▸ keep millions of numbers in memory for such a simple
calculation.
▸ let’s tail recursion
38. 5. RECURSION
LENGTH OF A TAIL RECURSION
▸ linear -> iterative one
▸ need to be alone
▸ additional is stacked
▸ accumulator
▸ need to extra variable to hold the intermediate result
39. 5. RECURSION
LENGTH OF A TAIL RECURSION
▸ using accumulator
tail_fac(N) -> tail_fac(N,1).
tail_fac(0,Acc) -> Acc;
tail_fac(N,Acc) when N > 0 -> tail_fac(N-1,N*Acc).
tail_fac(4) = tail_fac(4,1)
tail_fac(4,1) = tail_fac(4-1, 4*1)
tail_fac(3,4) = tail_fac(3-1, 3*4)
tail_fac(2,12) = tail_fac(2-1, 2*12)
tail_fac(1,24) = tail_fac(1-1, 1*24)
tail_fac(0,24) = 24
41. 5. RECURSION
MORE RECURSIVE FUNCTIONS
▸ After all, recursion being the only looping construct that
exists in Erlang
▸ except list comprehension
▸ duplicate
duplicate(0,_) ->
[];
duplicate(N,Term) when N > 0 ->
[Term|duplicate(N-1,Term)].
42. 5. RECURSION
MORE RECURSIVE FUNCTIONS
▸ duplicate
tail_duplicate(N,Term) ->
tail_duplicate(N,Term,[]).
tail_duplicate(0,_,List) ->
List;
tail_duplicate(N,Term,List) when N > 0 ->
tail_duplicate(N-1, Term, [Term|List]).
function(N, Term) ->
while N > 0 ->
List = [Term|List],
N = N-1
end,
List.
43. 5. RECURSION
MORE RECURSIVE FUNCTIONS
▸ true nightmare which is not tail recursion
reverse([]) -> [];
reverse([H|T]) -> reverse(T)++[H].
reverse([1,2,3,4]) = [4]++[3]++[2]++[1]
↑ ↵
= [4,3]++[2]++[1]
↑ ↑ ↵
= [4,3,2]++[1]
↑ ↑ ↑ ↵
= [4,3,2,1]
48. 5. RECURSION
MORE RECURSIVE FUNCTIONS
▸ TCO (tail call optimization)
▸ vm does eliminate current stack frame
▸ LCO (last call optimization)
▸ more general
51. 5. RECURSION
QUICK, SORT!
▸ as two parts
▸ partioning
▸ apply the partitioning to each parts, and glue
quicksort([]) -> [];
quicksort([Pivot|Rest]) ->
{Smaller, Larger} = partition(Pivot,Rest,[],[]),
quicksort(Smaller) ++ [Pivot] ++ quicksort(Larger).
60. 5. RECURSION
MORE THAN LISTS
▸ using example
4> tree:lookup("Anita Bath", Addresses).
{ok, "abath@someuni.edu"}
5> tree:lookup("Jacques Requin", Addresses).
undefined
61. 5. RECURSION
THINKING RECURSIVELY
▸ our approach is more declarative
▸ consise algorithm easy to understand
▸ divide - and - conquer!
▸ you will learn how to abstract, next time.