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
Climbing the Abstract Syntax Tree (Forum PHP 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (php[world] 2019)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (PHP UK 2018)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run. To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before. After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (Midwest PHP 2020)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (ScotlandPHP 2018)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (PHP Russia 2019)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (Forum PHP 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (php[world] 2019)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (PHP UK 2018)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run. To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before. After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (Midwest PHP 2020)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (ScotlandPHP 2018)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (PHP Russia 2019)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (phpDay 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (Southeast PHP 2018)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (DPC 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (IPC Fall 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
A key feature of TYPO3 today is its extendability and flexibility. Writing extensions was never easier since the Kickstarter, and tslib_piBase. But, time doesn't stand still: new programming paradigms other innovative frameworks came up. It's time to take a next step to faster, cleaner extension coding. With the new Version 5 of TYPO3 and its basis FLOW3 the way to develop extensions will change fundamentally. With Extbase - the new framework for extension development introduced in TYPO3 4.3 - you are able to develop with the paradigms of FLOW3 today. During this talk, you get in touch with the features of the framework to understand how it supports your development process. We also address the users perspective by discussing best practices how to migrate to TYPO3 v5.
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)
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 -
3. syntax in functions
4. types
5. recursion
Climbing the Abstract Syntax Tree (phpDay 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (Southeast PHP 2018)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (DPC 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (IPC Fall 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
A key feature of TYPO3 today is its extendability and flexibility. Writing extensions was never easier since the Kickstarter, and tslib_piBase. But, time doesn't stand still: new programming paradigms other innovative frameworks came up. It's time to take a next step to faster, cleaner extension coding. With the new Version 5 of TYPO3 and its basis FLOW3 the way to develop extensions will change fundamentally. With Extbase - the new framework for extension development introduced in TYPO3 4.3 - you are able to develop with the paradigms of FLOW3 today. During this talk, you get in touch with the features of the framework to understand how it supports your development process. We also address the users perspective by discussing best practices how to migrate to TYPO3 v5.
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)
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 -
3. syntax in functions
4. types
5. recursion
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
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 -
13. Designing a concurrent program
14. what is otp?
Caching Strategies for an Erlang Based Web Stackenriquepazperez
Summary of the different caching techniques in a high traffic web architecture, including pros, cons and use cases for each solution. Representative issues spotted in some of the caching approaches will be shared as well.
RabbitMQ/ActiveMQ 와 같은 비동기 메시징 미들웨어를 이용하여 다량의 서버를 orchestration(command & control) 할 수 있는 mcollective에 대한 한글 ppt 자료입니다. 상세한 내용은 http://wiki.tunelinux.pe.kr/x/LQAy 를 참고하시면 됩니다.
WebCamp: Developer Day: N2O: The Most Powerful Erlang Web Framework - Максим ...GeeksLab Odessa
N2O: The Most Powerful Erlang Web Framework
Максим Сохацкий
N2O разрабатывался как многофункциональный WebSocket аппликейшин сервер широкого назначения. Будучи ответвлен изначально от классического сервер-рендер фреймворка Nitrogen, он развился в мощное средство (включающее в том числе и поддержку SPA приложений) обеспечения пула долгоживущих TCP соеднений и доставки кода/даных выступая в качестве высокоемкностного релея, благодаря надежной и высокоустойчивой платформе Erlang/OTP. Соединяя в себе все черты Full-Stack веб фреймворков: Роутинг, Темплейтинг, Pub/Sub, Сессии, Хранилище, REST и поддержка кастомных протоколов; N2O добавляет совершенно уникальные возможности для создания различных DSL: вы можете транслировать бизнес логику, написанную на Erlang языках (Elixir, Erlang, Joxa) в JavaScript, генерировать трансформаций Erlang рекордов в JSON структуры и много другое, специфицировать JavaScript протоколы на языке Erlang. Сейчас N2O развивается в сторону поддержки SVG клиентов и бинарных протоколов.
자동화된 인프라 구축
Building an Automated Infrastructure
2009년 https://groups.google.com/forum/#!forum/sysadminstudy 에서 발표했던 자료입니다.
출처 : http://wiki.tunelinux.pe.kr/pages/viewpage.action?pageId=884766
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설치
설정
오케스트레이션(배포)/워크플로우
이제 무엇을 할까?
나가면서
참고자료
Functional Programming for OO Programmers (part 2)Calvin Cheng
Code examples demonstrating Functional Programming concepts, with JavaScript and Haskell.
Part 1 can be found here - http://www.slideshare.net/calvinchengx/functional-programming-part01
Source code can be found here - http://github.com/calvinchengx/learnhaskell
Let me know if you spot any errors! Thank you! :-)
Installing and Using Python
Basic I/O
Variables and Expressions
Conditional Code
Functions
Loops and Iteration
Python Data Structures
Errors and Exceptions
Object Oriented with Python
Multithreaded Programming with Python
Install/Create and Using Python Library
Compile Python Script
Resources
===========================
and 7 Quizzes
Implementing Glacier's Tree Hash using recursive, functional programming in Perl5. With Keyword::Declare we get clean syntax for tail-call elimination. Result is a simple, fast, functional solution.
This contains all the slides used in Silicon Valley Code Camp presentation on Sunday Oct 4, 10:45 session on "Amazing new features in JavaScript". At the end ut also includes the last year presentation covering ES 5
Elixir & Phoenix - fast, concurrent and explicitTobias Pfeiffer
Elixir and Phoenix are all the hype lately - what's great about them? Is there more to them than "just" fast, concurrent and reliable?
This talk will give a short intro into both Elixir and Phoenix, highlighting strengths, differences from Ruby/Rails and weaknesses.
Functional programming in Scala. Looking at various examples of defining a program first and executing it at some later stage, separating pure functions from side effects.
Similar to learn you some erlang - chap 6 to chap7 (20)
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
How Recreation Management Software Can Streamline Your Operations.pptxwottaspaceseo
Recreation management software streamlines operations by automating key tasks such as scheduling, registration, and payment processing, reducing manual workload and errors. It provides centralized management of facilities, classes, and events, ensuring efficient resource allocation and facility usage. The software offers user-friendly online portals for easy access to bookings and program information, enhancing customer experience. Real-time reporting and data analytics deliver insights into attendance and preferences, aiding in strategic decision-making. Additionally, effective communication tools keep participants and staff informed with timely updates. Overall, recreation management software enhances efficiency, improves service delivery, and boosts customer satisfaction.
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
The European Union Agency for Law Enforcement Cooperation (Europol) has suffered an alleged data breach after a notorious threat actor claimed to have exfiltrated data from its systems. Infamous data leaker IntelBroker posted on the even more infamous BreachForums hacking forum, saying that Europol suffered a data breach this month.
The alleged breach affected Europol agencies CCSE, EC3, Europol Platform for Experts, Law Enforcement Forum, and SIRIUS. Infiltration of these entities can disrupt ongoing investigations and compromise sensitive intelligence shared among international law enforcement agencies.
However, this is neither the first nor the last activity of IntekBroker. We have compiled for you what happened in the last few days. To track such hacker activities on dark web sources like hacker forums, private Telegram channels, and other hidden platforms where cyber threats often originate, you can check SOCRadar’s Dark Web News.
Stay Informed on Threat Actors’ Activity on the Dark Web with SOCRadar!
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...informapgpstrackings
Keep tabs on your field staff effortlessly with Informap Technology Centre LLC. Real-time tracking, task assignment, and smart features for efficient management. Request a live demo today!
For more details, visit us : https://informapuae.com/field-staff-tracking/
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
Accelerate Enterprise Software Engineering with PlatformlessWSO2
Key takeaways:
Challenges of building platforms and the benefits of platformless.
Key principles of platformless, including API-first, cloud-native middleware, platform engineering, and developer experience.
How Choreo enables the platformless experience.
How key concepts like application architecture, domain-driven design, zero trust, and cell-based architecture are inherently a part of Choreo.
Demo of an end-to-end app built and deployed on Choreo.
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
top nidhi software solution freedownloadvrstrong314
This presentation emphasizes the importance of data security and legal compliance for Nidhi companies in India. It highlights how online Nidhi software solutions, like Vector Nidhi Software, offer advanced features tailored to these needs. Key aspects include encryption, access controls, and audit trails to ensure data security. The software complies with regulatory guidelines from the MCA and RBI and adheres to Nidhi Rules, 2014. With customizable, user-friendly interfaces and real-time features, these Nidhi software solutions enhance efficiency, support growth, and provide exceptional member services. The presentation concludes with contact information for further inquiries.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
CyanicLab, an offshore custom software development company based in Sweden,India, Finland, is your go-to partner for startup development and innovative web design solutions. Our expert team specializes in crafting cutting-edge software tailored to meet the unique needs of startups and established enterprises alike. From conceptualization to execution, we offer comprehensive services including web and mobile app development, UI/UX design, and ongoing software maintenance. Ready to elevate your business? Contact CyanicLab today and let us propel your vision to success with our top-notch IT solutions.
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
Into the Box Keynote Day 2: Unveiling amazing updates and announcements for modern CFML developers! Get ready for exciting releases and updates on Ortus tools and products. Stay tuned for cutting-edge innovations designed to boost your productivity.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
2. 6. HIGHER ORDER FUNCTIONS
LET’S GET FUNCTIONAL
▸ in functional programming language…
▸ ability to take function
▸ used like variable within function
▸ THIS IS HIGHER ORDER FUNCTION!
▸ lambda calculus
▸ it is originated from mathematics
▸ system, see everything as function, even numbers
3. ▸ higher order function - add/2
6. HIGHER ORDER FUNCTIONS
LET’S GET FUNCTIONAL
-module(hhfuns).
-compile(export_all).
one() -> 1.
two() -> 2.
add(X,Y) -> X() + Y().
4. ▸ higher order function - add/2
6. HIGHER ORDER FUNCTIONS
LET’S GET FUNCTIONAL
4> hhfuns:add(fun hhfuns:one/0, fun hhfuns:two/0).
3
fun Module:Function/Arity
5. 6. HIGHER ORDER FUNCTIONS
LET’S GET FUNCTIONAL
▸ where comes from it’s strength?
▸ we will change these functions a bit generally.
increment([]) -> [];
increment([H|T]) -> [H+1|increment(T)].
decrement([]) -> [];
decrement([H|T]) -> [H-1|decrement(T)].
6. 6. HIGHER ORDER FUNCTIONS
LET’S GET FUNCTIONAL
▸ look at that!
▸ very smart abstraction!
map(_, []) -> [];
map(F, [H|T]) -> [F(H)|map(F,T)].
incr(X) -> X + 1.
decr(X) -> X - 1.
5> hhfuns:map(fun hhfuns:incr/1, [1,2,3,4,5]).
[2,3,4,5,6]
6> hhfuns:map(fun hhfuns:decr/1, [1,2,3,4,5]).
[0,1,2,3,4]
7. 6. HIGHER ORDER FUNCTIONS
ANONYMOUS FUNCTIONS
▸ function inline
fun(Args1) ->
Expression1, Exp2, ..., ExpN;
(Args2) ->
Expression1, Exp2, ..., ExpN;
(Args3) ->
Expression1, Exp2, ..., ExpN
end
8. 6. HIGHER ORDER FUNCTIONS
ANONYMOUS FUNCTIONS
▸ map with lambda
▸ the loop logic is can be ignored. instead, focused on what
will be done to elements
9> hhfuns:map(fun(X) -> X + 1 end, L).
[2,3,4,5,6]
10> hhfuns:map(fun(X) -> X - 1 end, L).
[0,1,2,3,4]
9. 6. HIGHER ORDER FUNCTIONS
ANONYMOUS FUNCTIONS
▸ closure
11> PrepareAlarm = fun(Room) ->
11> io:format("Alarm set in ~s.~n",[Room]),
11> fun() -> io:format("Alarm tripped in ~s! Call Batman!
~n",[Room]) end
11> end.
#Fun<erl_eval.20.67289768>
12> AlarmReady = PrepareAlarm("bathroom").
Alarm set in bathroom.
#Fun<erl_eval.6.13229925>
13> AlarmReady().
Alarm tripped in bathroom! Call Batman!
ok
10. 6. HIGHER ORDER FUNCTIONS
ANONYMOUS FUNCTIONS
▸ understand scope
▸ F inherits base/1's scope
base(A) ->
B = A + 1,
F = fun() -> A * B end,
F().
11. 6. HIGHER ORDER FUNCTIONS
ANONYMOUS FUNCTIONS
▸ a parent cannot inherits it’s decent’s scope
base(A) ->
B = A + 1,
F = fun() -> C = A * B end,
F(),
C.
13. 6. HIGHER ORDER FUNCTIONS
ANONYMOUS FUNCTIONS
▸ shadowing
base() ->
A = 1,
(fun() -> A = 2 end)().
base() ->
A = 1,
(fun(A) -> A = 2 end)(2).
14. 6. HIGHER ORDER FUNCTIONS
MAPS, FILTERS, FOLDS AND MORE
▸ like map, you can abstract functions like even, old_man..
even(L) -> lists:reverse(even(L,[])).
even([], Acc) -> Acc;
even([H|T], Acc) when H rem 2 == 0 ->
even(T, [H|Acc]);
even([_|T], Acc) -> even(T, Acc).
old_men(L) -> lists:reverse(old_men(L,[])).
old_men([], Acc) -> Acc;
old_men([Person = {male, Age}|People], Acc) when Age > 60 ->
old_men(People, [Person|Acc]);
old_men([_|People], Acc) -> old_men(People, Acc).
15. 6. HIGHER ORDER FUNCTIONS
MAPS, FILTERS, FOLDS AND MORE
▸ extract the common parts
▸ try to get rid of what's always the same and let the
programmer supply in the parts that change.
filter(Pred, L) -> lists:reverse(filter(Pred, L,[])).
filter(_, [], Acc) -> Acc;
filter(Pred, [H|T], Acc) ->
case Pred(H) of
true -> filter(Pred, T, [H|Acc]);
false -> filter(Pred, T, Acc)
end.
16. 6. HIGHER ORDER FUNCTIONS
MAPS, FILTERS, FOLDS AND MORE
▸ use it!
1> c(hhfuns).
2> Numbers = lists:seq(1,10).
3> hhfuns:filter(fun(X) -> X rem 2 == 0 end, Numbers).
[2,4,6,8,10]
4> People = [{male,45},{female,67},{male,66},{female,12},{unknown,
174},{male,74}].
[{male,45},{female,67},{male,66},{female,12},{unknown,174},{male,74}]
5> hhfuns:filter(fun({Gender,Age}) -> Gender == male andalso Age >
60 end, People).
[{male,66},{male,74}]
17. 6. HIGHER ORDER FUNCTIONS
MAPS, FILTERS, FOLDS AND MORE
▸ fold - it reduces to one value
%% find the maximum of a list
max([H|T]) -> max2(T, H).
max2([], Max) -> Max;
max2([H|T], Max) when H > Max -> max2(T, H);
max2([_|T], Max) -> max2(T, Max).
18. 6. HIGHER ORDER FUNCTIONS
MAPS, FILTERS, FOLDS AND MORE
▸ fold - it reduces to one value
%% find the minimum of a list
min([H|T]) -> min2(T,H).
min2([], Min) -> Min;
min2([H|T], Min) when H < Min -> min2(T,H);
min2([_|T], Min) -> min2(T, Min).
19. 6. HIGHER ORDER FUNCTIONS
MAPS, FILTERS, FOLDS AND MORE
▸ fold - it reduces to one value
%% sum of all the elements of a list
sum(L) -> sum(L,0).
sum([], Sum) -> Sum;
sum([H|T], Sum) -> sum(T, H+Sum).
20. 6. HIGHER ORDER FUNCTIONS
MAPS, FILTERS, FOLDS AND MORE
max([H|T]) -> max2(T, H).
max2([], Max) -> Max;
max2([H|T], Max) when H > Max -> max2(T, H);
max2([_|T], Max) -> max2(T, Max).
min([H|T]) -> min2(T,H).
min2([], Min) -> Min;
min2([H|T], Min) when H < Min -> min2(T,H);
min2([_|T], Min) -> min2(T, Min).
sum(L) -> sum(L,0).
sum([], Sum) -> Sum;
sum([H|T], Sum) -> sum(T, H+Sum).
21. 6. HIGHER ORDER FUNCTIONS
MAPS, FILTERS, FOLDS AND MORE
▸ fold - it reduces to one value
fold(_, Start, []) -> Start;
fold(F, Start, [H|T]) -> fold(F, F(H,Start), T).
22. 6. HIGHER ORDER FUNCTIONS
MAPS, FILTERS, FOLDS AND MORE
▸ use it!
6> c(hhfuns).
{ok, hhfuns}
7> [H|T] = [1,7,3,5,9,0,2,3].
[1,7,3,5,9,0,2,3]
8> hhfuns:fold(fun(A,B) when A > B -> A; (_,B) -> B end, H, T).
9
9> hhfuns:fold(fun(A,B) when A < B -> A; (_,B) -> B end, H, T).
0
10> hhfuns:fold(fun(A,B) -> A + B end, 0, lists:seq(1,6)).
21
23. 6. HIGHER ORDER FUNCTIONS
MAPS, FILTERS, FOLDS AND MORE
reverse(L) ->
fold(fun(X,Acc) -> [X|Acc] end, [], L).
map2(F,L) ->
reverse(fold(fun(X,Acc) -> [F(X)|Acc] end, [], L)).
filter2(Pred, L) ->
F = fun(X,Acc) ->
case Pred(X) of
true -> [X|Acc];
false -> Acc
end
end,
reverse(fold(F, [], L)).
24. 6. HIGHER ORDER FUNCTIONS
MAPS, FILTERS, FOLDS AND MORE
▸ U can using it from Standard library
list:map/2, list:filter/2, list:foldl/3, list:foldr/3
all/2, any/2
dropwhile/2, takewhile/2,
partition/2,
flatten/1, flatlength/1, flatmap/2, merge/1, nth/2, nthtail/2, split/2
25. 7. ERRORS AND EXCEPTIONS
NOT SO FAST!
▸ you are probably running into errors
▸ can’t explain all error handling, now
▸ erlang has 2 paradigm
▸ functional / concurrent
▸ even thought, keep it mind that… let it crash~
26. 7. ERRORS AND EXCEPTIONS
A COMPILATION OF ERRORS
▸ syntactic mistake
▸ module.beam:module name does not match file name
‘module’
▸ ./module.erl:2: Warning: function some_function/0 is unused
▸ not export, used with wrong name..
▸ ./module.erl:2: function some_function/1 undefined
▸ wrong name, arity, function could not be compiled..(forgot
period)
27. 7. ERRORS AND EXCEPTIONS
A COMPILATION OF ERRORS
▸ ./module.erl:5: syntax error before: ‘SomeCharacterOrWord'
▸ unclosed parenthesis, wrong expression termination, encoding…
▸ ./module.erl:5: syntax error before:
▸ line termination is not correct (specific case of previous error)
▸ ./module.erl:5: Warning: this expression will fail with a 'badarith'
exception
▸ llama + 5
▸ ./module.erl:5: Warning: variable 'Var' is unused
28. 7. ERRORS AND EXCEPTIONS
A COMPILATION OF ERRORS
▸ ./module.erl:5: head mismatch
▸ function has more than one head, which is different, i.e. arty
▸ ./module.erl:5: Warning: this clause cannot match because a
previous clause at line 4 always matches
▸ ./module.erl:9: variable 'A' unsafe in 'case' (line 5)
▸ using a variable declared within branch of case … of
▸ if you want to use, MyVar = case ... of...
29. 7. ERRORS AND EXCEPTIONS
NO! YOUR LOGIC IS WRONG!
▸ using debug tool
▸ test framework, tracing module…
▸ It's easier to focus on those that make your programs crash
▸ won't bubble up 50 levels from now
30. 7. ERRORS AND EXCEPTIONS
RUNTIME ERRORS
▸ crash your code
▸ function_clause
▸ case_clause
1> lists:sort([3,2,1]).
[1,2,3]
2> lists:sort(fffffff).
** exception error: no function clause matching lists:sort(fffffff)
3> case "Unexpected Value" of
3> expected_value -> ok;
3> other_expected_value -> 'also ok'
3> end.
31. 7. ERRORS AND EXCEPTIONS
RUNTIME ERRORS
▸ if_clause
▸ badmatch
4> if 2 > 4 -> ok;
4> 0 > 1 -> ok
4> end.
** exception error: no true branch found when evaluating an if
expression
5> [X,Y] = {4,5}.
** exception error: no match of right hand side value {4,5}
32. 7. ERRORS AND EXCEPTIONS
RUNTIME ERRORS
▸ badarg
▸ undef
6> erlang:binary_to_list("heh, already a list").
** exception error: bad argument
in function binary_to_list/1
called as binary_to_list("heh, already a list")
7> lists:random([1,2,3]).
** exception error: undefined function lists:random/1
33. 7. ERRORS AND EXCEPTIONS
RUNTIME ERRORS
▸ badarith
▸ badfun
8> 5 + llama.
** exception error: bad argument in an arithmetic expression
in operator +/2
called as 5 + llama
9> hhfuns:add(one,two).
** exception error: bad function one
in function hhfuns:add/2
34. 7. ERRORS AND EXCEPTIONS
RUNTIME ERRORS
▸ badarity
▸ system_limit
▸ atom too large, too many arguments, # of atom is too large…
▸ http://www.erlang.org/doc/efficiency_guide/
advanced.html#id2265856
10> F = fun(_) -> ok end.
#Fun<erl_eval.6.13229925>
11> F(a,b).
** exception error: interpreted function with arity 1 called with two
arguments
35. 7. ERRORS AND EXCEPTIONS
RAISING EXCEPTIONS
▸ let it crash!
▸ 3 kind of exceptions
▸ errors
▸ exits
▸ throws
36. 7. ERRORS AND EXCEPTIONS
RAISING EXCEPTIONS
▸ errors
▸ end execution of current process
▸ include stacktrace
▸ the error what you’ve seen in previous clause.
▸ do not use where user must take care (tree lookup)
▸ {ok, value} / undefined…
erlang:error(Reason)
37. 7. ERRORS AND EXCEPTIONS
RAISING EXCEPTIONS
▸ define you’re own kind of error
▸ can be handled in same manner
1> erlang:error(badarith).
** exception error: bad argument in an arithmetic expression
2> erlang:error(custom_error).
** exception error: custom_error
38. 7. ERRORS AND EXCEPTIONS
RAISING EXCEPTIONS
▸ exits
▸ internal (exit/1) / external (exit/2)
▸ roughly, has same use case with error
▸ what to use ?
39. 7. ERRORS AND EXCEPTIONS
RAISING EXCEPTIONS
▸ understand concept of actors and processes
▸ listen, pass msg
40. 7. ERRORS AND EXCEPTIONS
RAISING EXCEPTIONS
▸ understand concept of actors and processes
▸ communicate exceptions
▸ the real deference is intent (simply error or terminate?)
▸ errors - contain stack trace / exit - not contain stack trace
41. 7. ERRORS AND EXCEPTIONS
RAISING EXCEPTIONS
▸ throws
▸ programmer can be expected to handle
▸ recommend documenting them
▸ used for non-local returns in deep recursion
1> throw(permission_denied).
** exception throw: permission_denied
42. 7. ERRORS AND EXCEPTIONS
DEALING WITH EXCEPTIONS
▸ try…catch
try Expression of
SuccessfulPattern1 [Guards] ->
Expression1;
SuccessfulPattern2 [Guards] ->
Expression2
catch
TypeOfError:ExceptionPattern1 ->
Expression3;
TypeOfError:ExceptionPattern2 ->
Expression4
end.
43. 7. ERRORS AND EXCEPTIONS
DEALING WITH EXCEPTIONS
▸ protected
▸ any exception happening within the call will be caught
▸ replace TypeOfError error, exit, throw..
▸ default is throw
44. 7. ERRORS AND EXCEPTIONS
DEALING WITH EXCEPTIONS
sword(1) -> throw(slice);
sword(2) -> erlang:error(cut_arm);
sword(3) -> exit(cut_leg);
sword(4) -> throw(punch);
sword(5) -> exit(cross_bridge).
black_knight(Attack) when is_function(Attack, 0) ->
try Attack() of
_ -> "None shall pass."
catch
throw:slice -> "It is but a scratch.";
error:cut_arm -> "I've had worse.";
exit:cut_leg -> "Come on you pansy!";
_:_ -> "Just a flesh wound."
end.
45. 7. ERRORS AND EXCEPTIONS
DEALING WITH EXCEPTIONS
▸ example
9> exceptions:black_knight(fun exceptions:talk/0).
"None shall pass."
10> exceptions:black_knight(fun() -> exceptions:sword(1) end).
"It is but a scratch."
11> exceptions:black_knight(fun() -> exceptions:sword(2) end).
"I've had worse."
12> exceptions:black_knight(fun() -> exceptions:sword(3) end).
"Come on you pansy!"
13> exceptions:black_knight(fun() -> exceptions:sword(4) end).
"Just a flesh wound."
14> exceptions:black_knight(fun() -> exceptions:sword(5) end).
"Just a flesh wound."
46. 7. ERRORS AND EXCEPTIONS
DEALING WITH EXCEPTIONS
▸ _:_ patttern catch all
▸ finally - after
▸ cannot get return value from this
try Expr of
Pattern -> Expr1
catch
Type:Exception -> Expr2
after % this always gets executed
Expr3
end
47. 7. ERRORS AND EXCEPTIONS
DEALING WITH EXCEPTIONS
▸ multiple protection
whoa() ->
try
talk(),
_Knight = "None shall Pass!",
_Doubles = [N*2 || N <- lists:seq(1,100)],
throw(up),
_WillReturnThis = tequila
of
tequila -> "hey this worked!"
catch
Exception:Reason -> {caught, Exception, Reason}
end.
48. 7. ERRORS AND EXCEPTIONS
DEALING WITH EXCEPTIONS
▸ when return value is not useful, remove of part
im_impressed() ->
try
talk(),
_Knight = "None shall Pass!",
_Doubles = [N*2 || N <- lists:seq(1,100)],
throw(up),
_WillReturnThis = tequila
catch
Exception:Reason -> {caught, Exception, Reason}
end.
49. 7. ERRORS AND EXCEPTIONS
DEALING WITH EXCEPTIONS
▸ protected part cannot be tail recursive
▸ of - catch space can be tail recursive
50. 7. ERRORS AND EXCEPTIONS
WAIT, THERE’S MORE!
▸ keyword catch
▸ basically captures all types of exceptions on top of the
good results.
1> catch throw(whoa).
whoa
2> catch exit(die).
{'EXIT',die}
53. 7. ERRORS AND EXCEPTIONS
WAIT, THERE’S MORE!
▸ common manner using catch
catcher(X,Y) ->
case catch X/Y of
{'EXIT', {badarith,_}} -> "uh oh";
N -> N
end.
54. 7. ERRORS AND EXCEPTIONS
WAIT, THERE’S MORE!
▸ common manner using catch
7> exceptions:catcher(3,3).
1.0
8> exceptions:catcher(6,3).
2.0
9> exceptions:catcher(6,0).
"uh oh"
55. 7. ERRORS AND EXCEPTIONS
WAIT, THERE’S MORE!
▸ problem 1. parentheses when using with assign
10> X = catch 4+2.
* 1: syntax error before: 'catch'
10> X = (catch 4+2).
6
57. 7. ERRORS AND EXCEPTIONS
WAIT, THERE’S MORE!
▸ problem 3. is it error or…?
one_or_two(1) -> return;
one_or_two(2) -> throw(return).
13> c(exceptions).
{ok,exceptions}
14> catch exceptions:one_or_two(1).
return
15> catch exceptions:one_or_two(2).
return
58. 7. ERRORS AND EXCEPTIONS
TRY A TRY IN A TREE
▸ lookup/2
%% looks for a given value 'Val' in the tree.
has_value(_, {node, 'nil'}) ->
false;
has_value(Val, {node, {_, Val, _, _}}) ->
true;
has_value(Val, {node, {_, _, Left, Right}}) ->
case has_value(Val, Left) of
true -> true;
false -> has_value(Val, Right)
end.
59. 7. ERRORS AND EXCEPTIONS
TRY A TRY IN A TREE
▸ lookup/2
60. 7. ERRORS AND EXCEPTIONS
TRY A TRY IN A TREE
▸ lookup/2 - less annoying
has_value(Val, Tree) ->
try has_value1(Val, Tree) of
false -> false
catch
true -> true
end.
has_value1(_, {node, 'nil'}) -> false;
has_value1(Val, {node, {_, Val, _, _}}) -> throw(true);
has_value1(Val, {node, {_, _, Left, Right}}) ->
has_value1(Val, Left),
has_value1(Val, Right).
61. 7. ERRORS AND EXCEPTIONS
TRY A TRY IN A TREE
▸ lookup/2 - less annoying