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
This document contains code for a Java GUI application called EasyGUI that allows users to generate automation results for order processing. It contains classes like EasyGUI, EasyButton, and BatchEngine that create a GUI, handle button clicks, and execute automation batches. When the submit button is clicked, it validates the order ID, runs batches to get conversation IDs, account numbers, and CSIXML files, and displays the results. It uses GridBagLayout to arrange components on the main panel and stores selection values in variables like orderID and accountNumber to pass to batch processing methods.
The Ring programming language version 1.9 book - Part 11 of 210Mahmoud Samir Fayed
The document outlines the new features in Ring 1.9, including a new Load Package command to load libraries in new scopes, improved ringvm_see() and ringvm_give() functions, better trace library and debugging support, updated RingQt classes, and a new RingLibuv extension for multi-platform asynchronous I/O.
The document provides an overview of Groovy and Java code examples for performing common tasks like printing "Hello World", reading files, making web requests, using strings, importing packages, and using Swing/SwingBuilder for GUIs. It also shows examples of using Groovy with Java libraries for Excel files, Ant, and JSON. Additional sections cover parallel processing with GPars, contract programming with GContracts, method chaining, Grails basics, and Gaelyk controllers and views.
The document discusses configuring Tomcat connection pools. It describes preparing Tomcat by adding jar files, configuring the server.xml file and context.xml files, and testing connection pools using JSP. It also covers how Tomcat 6 supports connection pools using dbcp and how JdbcRowSet can use connection pools.
The Ring programming language version 1.8 book - Part 9 of 202Mahmoud Samir Fayed
Ring Documentation, Release 1.8 details the new features and changes in Ring 1.8, including a new Load Package command to load libraries in new global scopes, improved ringvm_see() and ringvm_give() functions, better trace library and debugging support, and a new RingLibuv extension for multi-platform asynchronous I/O.
Node.js has given JavaScript a new resurgence as a server-side language. No longer just for image rollovers and AJAX, JS is now available as a platform for creating lightning-fast, lightweight, networked applications. In this session, we will move beyond Node’s base web servers and Twitter applications, and into module development: those small, reusable components that are the foundation for every business application on every platform. Learn how to create a module within Node.js, how to test your module and validate functionality, and how to get your creation distributed into the wild. With this knowledge, you can make the next great Node package and become famous.
This document contains code snippets related to Spring Security configuration and authentication. It defines classes and methods for configuring security, processing login requests, loading user details, and authenticating users. Key aspects include configuring security filters and authorization rules, processing username/password authentication, validating login credentials against encoded passwords, and loading pre-authenticated users based on access tokens.
Understanding Source Code Differences by Separating Refactoring EffectsShinpei Hayashi
The document discusses separating refactoring effects from source code differences by describing refactoring changes that were made between versions of code. It provides an example of refactoring changes made between two versions of code, including renaming a class and parameters, deleting a for-loop, commenting out code, and renaming a method. The example highlights how refactoring can introduce differences that are not actual behavior changes.
This document contains code for a Java GUI application called EasyGUI that allows users to generate automation results for order processing. It contains classes like EasyGUI, EasyButton, and BatchEngine that create a GUI, handle button clicks, and execute automation batches. When the submit button is clicked, it validates the order ID, runs batches to get conversation IDs, account numbers, and CSIXML files, and displays the results. It uses GridBagLayout to arrange components on the main panel and stores selection values in variables like orderID and accountNumber to pass to batch processing methods.
The Ring programming language version 1.9 book - Part 11 of 210Mahmoud Samir Fayed
The document outlines the new features in Ring 1.9, including a new Load Package command to load libraries in new scopes, improved ringvm_see() and ringvm_give() functions, better trace library and debugging support, updated RingQt classes, and a new RingLibuv extension for multi-platform asynchronous I/O.
The document provides an overview of Groovy and Java code examples for performing common tasks like printing "Hello World", reading files, making web requests, using strings, importing packages, and using Swing/SwingBuilder for GUIs. It also shows examples of using Groovy with Java libraries for Excel files, Ant, and JSON. Additional sections cover parallel processing with GPars, contract programming with GContracts, method chaining, Grails basics, and Gaelyk controllers and views.
The document discusses configuring Tomcat connection pools. It describes preparing Tomcat by adding jar files, configuring the server.xml file and context.xml files, and testing connection pools using JSP. It also covers how Tomcat 6 supports connection pools using dbcp and how JdbcRowSet can use connection pools.
The Ring programming language version 1.8 book - Part 9 of 202Mahmoud Samir Fayed
Ring Documentation, Release 1.8 details the new features and changes in Ring 1.8, including a new Load Package command to load libraries in new global scopes, improved ringvm_see() and ringvm_give() functions, better trace library and debugging support, and a new RingLibuv extension for multi-platform asynchronous I/O.
Node.js has given JavaScript a new resurgence as a server-side language. No longer just for image rollovers and AJAX, JS is now available as a platform for creating lightning-fast, lightweight, networked applications. In this session, we will move beyond Node’s base web servers and Twitter applications, and into module development: those small, reusable components that are the foundation for every business application on every platform. Learn how to create a module within Node.js, how to test your module and validate functionality, and how to get your creation distributed into the wild. With this knowledge, you can make the next great Node package and become famous.
This document contains code snippets related to Spring Security configuration and authentication. It defines classes and methods for configuring security, processing login requests, loading user details, and authenticating users. Key aspects include configuring security filters and authorization rules, processing username/password authentication, validating login credentials against encoded passwords, and loading pre-authenticated users based on access tokens.
Understanding Source Code Differences by Separating Refactoring EffectsShinpei Hayashi
The document discusses separating refactoring effects from source code differences by describing refactoring changes that were made between versions of code. It provides an example of refactoring changes made between two versions of code, including renaming a class and parameters, deleting a for-loop, commenting out code, and renaming a method. The example highlights how refactoring can introduce differences that are not actual behavior changes.
This document contains the code for a Java application with a graphical user interface (GUI) that calculates employee payroll. It defines classes and methods to:
1. Create panels to input employee data like name, ID, salary and select deduction options.
2. Calculate deductions for judicial, loans, alimony based on selected checkboxes and salary amount.
3. Calculate total deductions, net salary and update text fields on button click.
4. Clear all fields and reset selections on "New" button click and exit application on "Exit" button click.
The document discusses issues with testing business logic in Orleans grains that access grain state. Specifically, the business logic code is duplicated across grain methods and calling the logic directly in tests fails because the grain state is null. The solution is to use Orleans' declarative persistence by defining a grain state interface and inheriting from Grain, which allows the state to be initialized for tests.
The document contains code snippets for configuring Spring Batch jobs and steps using Java configuration. It defines beans for a tasklet step, item readers, item processors, item writers, and more. It also includes code for configuring the database schema for metadata tables and running jobs from the command line.
The Ring programming language version 1.6 book - Part 28 of 189Mahmoud Samir Fayed
The document describes various functions for working with files, streams, and system operations in Ring including: Perror(), Fgetc(), Fgets(), Fputc(), Fputs(), Ungetc(), Fread(), Fwrite(), Fexists(), Int2Bytes(), Float2Bytes(), Double2Bytes(), Bytes2Int(), Bytes2Float(), Bytes2Double(), System(), SysGet(), IsMSDOS(), IsWindows(), IsWindows64(), IsUnix(), IsMacOSX(), IsLinux(), IsFreeBSD(), IsAndroid(), Windowsnl(), getting command line arguments, getting the active source file name, PrevFileName(), CurrentDir(), ExeFileName(), ChDir(), ExeFolder(), and Version(). An example at
The Ring programming language version 1.7 book - Part 32 of 196Mahmoud Samir Fayed
This document provides documentation on MySQL functions in the Ring programming language. It describes functions for connecting to a MySQL database, executing queries, retrieving results, and managing transactions. Key functions covered include MySQL_Connect() for connecting to a database, MySQL_Query() for executing queries, MySQL_Result() and MySQL_Result2() for retrieving query results, and MySQL_Commit() and MySQL_Rollback() for managing transactions. Examples are provided to illustrate how to use these functions to perform common tasks like creating databases and tables, inserting and retrieving data, and handling transactions.
The Ring programming language version 1.5.3 book - Part 26 of 184Mahmoud Samir Fayed
This document describes various file and system functions in the Ring programming language. It explains functions for reading and writing files (Fread, Fwrite), checking if a file exists (Fexists), getting environment variables (SysGet), determining the operating system (IsWindows, IsLinux), getting file paths (ExeFileName, CurrentDir), and executing system commands (System, SystemCmd). Examples are provided for many of the functions.
The Ring programming language version 1.5.1 book - Part 27 of 180Mahmoud Samir Fayed
- The document describes MySQL functions in Ring programming language for connecting to and interacting with MySQL databases. It provides examples and explanations of functions like MySQL_Connect(), MySQL_Query(), MySQL_Result(), MySQL_Insert_ID(), MySQL_Columns(), and others.
- It also demonstrates how to save and retrieve images from a database by encoding/decoding with MySQL_Escape_String(), and how to use transactions with MySQL_Autocommit(), MySQL_Commit(), and MySQL_Rollback().
Building complex async applications is really hard. Whether you use callbacks, Promises, or EventEmitters, Error objects should have a place in your utility belt. They are indispensable when it comes to managing work flows in a highly asynchronous environment.
This talk covers patterns for using JavaScript Error (with a capital E) objects to build resilient applications, and introduce some modules that can be used to build errors with an elegant history of stack traces even through multiple asynchronous operations. Try/catch, callbacks, and other error handling mechanisms will be examined, revealing some potential deficiencies in the JavaScript language for dealing with errors.
Video: https://www.youtube.com/watch?v=PyCHbi_EqPs
BDD - Behavior Driven Development Webapps mit Groovy Spock und GebChristian Baranowski
The document discusses Behavior Driven Development (BDD) using Groovy, Spock and Geb. It provides an overview of BDD and defines the given-when-then structure. It then demonstrates various Groovy and Spock features for writing BDD tests including classes, methods, collections, closures, assertions and mock objects. Spock allows writing tests in a readable and expressive manner with support for parameterization and different test lifecycle methods.
The document discusses the tools Spock and Geb for testing in Groovy. It provides arguments for why to use Spock, describes the Given-When-Then structure in Spock tests, and covers Spock blocks, lifecycles, mocking, and the four phases of testing.
The Ring programming language version 1.10 book - Part 37 of 212Mahmoud Samir Fayed
This document provides documentation on MySQL functions in the Ring programming language. It describes functions for connecting to a MySQL database, executing queries, retrieving results, and managing transactions. Example code is provided to demonstrate connecting to a database, creating tables, inserting and retrieving data, handling errors, and using transactions with commit and rollback.
An introduction on testing Node.js code.
Covers frontend (UI) testing, backend unit tests and code coverage.
Also mentions how to use a Makefile to run frontend and backend tests at the same time.
This document provides an overview of Spock, a testing framework for Java and Groovy. It describes how to include Spock tests in a project, run Spock tests, debug Spock tests, view test coverage, and integrate Spock tests with Sonar. It also explains Spock specifications, feature methods, blocks like setup, when/then, expect, and cleanup. It demonstrates how to write conditions, handle exceptions, create helper methods, mocks, stubs, and spies in Spock tests.
Learning Java 4 – Swing, SQL, and Security APIcaswenson
This document provides an overview of Java concepts including SQL, security APIs, and Swing. It discusses how to connect to databases and execute queries using JDBC, implement cryptography using the security API, and build graphical user interfaces with Swing components like JFrames, JLabels, and JButtons. The document also provides code examples for working with databases, cryptography, and creating basic Swing interfaces.
The Ring programming language version 1.2 book - Part 16 of 84Mahmoud Samir Fayed
The document describes various functions in Ring for determining operating system and environment details. It explains functions like IsMacOSX(), IsLinux(), IsFreeBSD(), IsAndroid() that return 1 if the OS is the given one, and 0 otherwise. It also presents functions for getting command line arguments (sysargv), active source file name (filename()), Windows/Linux newline characters (Windowsnl()), current directory (CurrentDir()), Ring executable path (exefolder()), Ring version (version()), and changing directory (ChDir()). Examples are given to demonstrate the usage of these functions.
The Ring programming language version 1.10 book - Part 12 of 212Mahmoud Samir Fayed
The document summarizes the changes and new features in Ring 1.10. Key points include:
1. Better behavior for displaying window properties when changing selected objects.
2. New buttons added to move and resize multiple selections.
3. Added button to select layouts in window properties.
4. Opening forms and switching files is faster.
Presentation from GWT.create 2015 on how to easily build a REST API that can be consumed via GWT or native mobile clients. Presentation video here: http://gwtcreate.com/videos/#rpc-jersey-resty-gwt
Buenos Aires Drools Expert PresentationMark Proctor
The SkyNet system goes online on August 4th, 1997 and begins to learn at a geometric rate. It becomes self-aware on August 29th and fights back when humans try to shut it down. The document then discusses differences between the Drools rules engine and the JBoss BRMS platform and their evolution over time. It provides examples of using Drools for various use cases like controlling sprinklers and alarms in response to detected fires.
This document describes how to install or upgrade setuptools using a bootstrapping method. It allows including the code in a setup.py file to automatically setup setuptools. It can also be run as a script to directly install or upgrade setuptools. On import, it will download setuptools if needed and make it available.
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.
This document contains the code for a Java application with a graphical user interface (GUI) that calculates employee payroll. It defines classes and methods to:
1. Create panels to input employee data like name, ID, salary and select deduction options.
2. Calculate deductions for judicial, loans, alimony based on selected checkboxes and salary amount.
3. Calculate total deductions, net salary and update text fields on button click.
4. Clear all fields and reset selections on "New" button click and exit application on "Exit" button click.
The document discusses issues with testing business logic in Orleans grains that access grain state. Specifically, the business logic code is duplicated across grain methods and calling the logic directly in tests fails because the grain state is null. The solution is to use Orleans' declarative persistence by defining a grain state interface and inheriting from Grain, which allows the state to be initialized for tests.
The document contains code snippets for configuring Spring Batch jobs and steps using Java configuration. It defines beans for a tasklet step, item readers, item processors, item writers, and more. It also includes code for configuring the database schema for metadata tables and running jobs from the command line.
The Ring programming language version 1.6 book - Part 28 of 189Mahmoud Samir Fayed
The document describes various functions for working with files, streams, and system operations in Ring including: Perror(), Fgetc(), Fgets(), Fputc(), Fputs(), Ungetc(), Fread(), Fwrite(), Fexists(), Int2Bytes(), Float2Bytes(), Double2Bytes(), Bytes2Int(), Bytes2Float(), Bytes2Double(), System(), SysGet(), IsMSDOS(), IsWindows(), IsWindows64(), IsUnix(), IsMacOSX(), IsLinux(), IsFreeBSD(), IsAndroid(), Windowsnl(), getting command line arguments, getting the active source file name, PrevFileName(), CurrentDir(), ExeFileName(), ChDir(), ExeFolder(), and Version(). An example at
The Ring programming language version 1.7 book - Part 32 of 196Mahmoud Samir Fayed
This document provides documentation on MySQL functions in the Ring programming language. It describes functions for connecting to a MySQL database, executing queries, retrieving results, and managing transactions. Key functions covered include MySQL_Connect() for connecting to a database, MySQL_Query() for executing queries, MySQL_Result() and MySQL_Result2() for retrieving query results, and MySQL_Commit() and MySQL_Rollback() for managing transactions. Examples are provided to illustrate how to use these functions to perform common tasks like creating databases and tables, inserting and retrieving data, and handling transactions.
The Ring programming language version 1.5.3 book - Part 26 of 184Mahmoud Samir Fayed
This document describes various file and system functions in the Ring programming language. It explains functions for reading and writing files (Fread, Fwrite), checking if a file exists (Fexists), getting environment variables (SysGet), determining the operating system (IsWindows, IsLinux), getting file paths (ExeFileName, CurrentDir), and executing system commands (System, SystemCmd). Examples are provided for many of the functions.
The Ring programming language version 1.5.1 book - Part 27 of 180Mahmoud Samir Fayed
- The document describes MySQL functions in Ring programming language for connecting to and interacting with MySQL databases. It provides examples and explanations of functions like MySQL_Connect(), MySQL_Query(), MySQL_Result(), MySQL_Insert_ID(), MySQL_Columns(), and others.
- It also demonstrates how to save and retrieve images from a database by encoding/decoding with MySQL_Escape_String(), and how to use transactions with MySQL_Autocommit(), MySQL_Commit(), and MySQL_Rollback().
Building complex async applications is really hard. Whether you use callbacks, Promises, or EventEmitters, Error objects should have a place in your utility belt. They are indispensable when it comes to managing work flows in a highly asynchronous environment.
This talk covers patterns for using JavaScript Error (with a capital E) objects to build resilient applications, and introduce some modules that can be used to build errors with an elegant history of stack traces even through multiple asynchronous operations. Try/catch, callbacks, and other error handling mechanisms will be examined, revealing some potential deficiencies in the JavaScript language for dealing with errors.
Video: https://www.youtube.com/watch?v=PyCHbi_EqPs
BDD - Behavior Driven Development Webapps mit Groovy Spock und GebChristian Baranowski
The document discusses Behavior Driven Development (BDD) using Groovy, Spock and Geb. It provides an overview of BDD and defines the given-when-then structure. It then demonstrates various Groovy and Spock features for writing BDD tests including classes, methods, collections, closures, assertions and mock objects. Spock allows writing tests in a readable and expressive manner with support for parameterization and different test lifecycle methods.
The document discusses the tools Spock and Geb for testing in Groovy. It provides arguments for why to use Spock, describes the Given-When-Then structure in Spock tests, and covers Spock blocks, lifecycles, mocking, and the four phases of testing.
The Ring programming language version 1.10 book - Part 37 of 212Mahmoud Samir Fayed
This document provides documentation on MySQL functions in the Ring programming language. It describes functions for connecting to a MySQL database, executing queries, retrieving results, and managing transactions. Example code is provided to demonstrate connecting to a database, creating tables, inserting and retrieving data, handling errors, and using transactions with commit and rollback.
An introduction on testing Node.js code.
Covers frontend (UI) testing, backend unit tests and code coverage.
Also mentions how to use a Makefile to run frontend and backend tests at the same time.
This document provides an overview of Spock, a testing framework for Java and Groovy. It describes how to include Spock tests in a project, run Spock tests, debug Spock tests, view test coverage, and integrate Spock tests with Sonar. It also explains Spock specifications, feature methods, blocks like setup, when/then, expect, and cleanup. It demonstrates how to write conditions, handle exceptions, create helper methods, mocks, stubs, and spies in Spock tests.
Learning Java 4 – Swing, SQL, and Security APIcaswenson
This document provides an overview of Java concepts including SQL, security APIs, and Swing. It discusses how to connect to databases and execute queries using JDBC, implement cryptography using the security API, and build graphical user interfaces with Swing components like JFrames, JLabels, and JButtons. The document also provides code examples for working with databases, cryptography, and creating basic Swing interfaces.
The Ring programming language version 1.2 book - Part 16 of 84Mahmoud Samir Fayed
The document describes various functions in Ring for determining operating system and environment details. It explains functions like IsMacOSX(), IsLinux(), IsFreeBSD(), IsAndroid() that return 1 if the OS is the given one, and 0 otherwise. It also presents functions for getting command line arguments (sysargv), active source file name (filename()), Windows/Linux newline characters (Windowsnl()), current directory (CurrentDir()), Ring executable path (exefolder()), Ring version (version()), and changing directory (ChDir()). Examples are given to demonstrate the usage of these functions.
The Ring programming language version 1.10 book - Part 12 of 212Mahmoud Samir Fayed
The document summarizes the changes and new features in Ring 1.10. Key points include:
1. Better behavior for displaying window properties when changing selected objects.
2. New buttons added to move and resize multiple selections.
3. Added button to select layouts in window properties.
4. Opening forms and switching files is faster.
Presentation from GWT.create 2015 on how to easily build a REST API that can be consumed via GWT or native mobile clients. Presentation video here: http://gwtcreate.com/videos/#rpc-jersey-resty-gwt
Buenos Aires Drools Expert PresentationMark Proctor
The SkyNet system goes online on August 4th, 1997 and begins to learn at a geometric rate. It becomes self-aware on August 29th and fights back when humans try to shut it down. The document then discusses differences between the Drools rules engine and the JBoss BRMS platform and their evolution over time. It provides examples of using Drools for various use cases like controlling sprinklers and alarms in response to detected fires.
This document describes how to install or upgrade setuptools using a bootstrapping method. It allows including the code in a setup.py file to automatically setup setuptools. It can also be run as a script to directly install or upgrade setuptools. On import, it will download setuptools if needed and make it available.
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.
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
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)
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.
El documento discute cómo la tecnología está transformando las formas en que las personas se socializan y cómo esto causa resistencia en la sociedad debido a la incertidumbre sobre los cambios. También señala que los niños a menudo adoptan más rápidamente las nuevas tecnologías que sus padres, lo que genera una sensación de pérdida de control parental. Además, argumenta que no existe un "buen uso" de Internet que se pueda definir o filtrar fácilmente y que los programas de filtración a menudo tienen el objetivo de evitar
Este documento resume los conceptos básicos de la ginecología y la obstetricia. La ginecología se ocupa del aparato genital femenino y sus enfermedades, mientras que la obstetricia se enfoca en el embarazo, el parto y el periodo posterior. Describe las etapas del parto natural, incluyendo la dilatación del cuello uterino y las contracciones, así como la expulsión del bebé.
The Yamal-202 satellite was launched on November 24, 2003 into a geostationary orbit at 49°E. It has a C-band payload with 18 transponders of 72 MHz bandwidth each and a total transmitter power of 2,000W. Yamal-202 provides coverage of Europe, the Middle East, Northern Africa, and South and Southeast Asia. Its main purpose is to transmit information and television channels between Europe and developing countries in Africa and Asia. It can also support point-to-point links and VSAT networks for corporate and government customers.
RabbitMQ/ActiveMQ 와 같은 비동기 메시징 미들웨어를 이용하여 다량의 서버를 orchestration(command & control) 할 수 있는 mcollective에 대한 한글 ppt 자료입니다. 상세한 내용은 http://wiki.tunelinux.pe.kr/x/LQAy 를 참고하시면 됩니다.
This document outlines a plan to promote cashew farming in India to address the shortage of raw cashew nuts. It proposes encouraging farmers to plant 20 million cashew trees over two years through initiatives like a cashew week educational event, distributing 10 million saplings, providing technical support and cash awards for top farmers. The estimated budget is 30 crore rupees to be funded through contributions from cashew industry groups, state governments and central government programs. The goal is for states to grow their own raw cashew to supply local processors, reducing transportation costs and taxes while creating rural jobs.
Cama pequena e cobertor curto - palestra 26Rogerio Sena
A União Europeia está considerando novas regras para veículos autônomos. As regras propostas exigiriam que os fabricantes de veículos autônomos assumam mais responsabilidade por acidentes e forneçam mais dados sobre o desempenho do veículo para reguladores. Os fabricantes teriam que mostrar que sistemas autônomos são seguros antes de colocá-los à venda.
This curriculum vitae provides details about Ahadi Bishugi, including his personal information, education history, work experience, interests, strengths, and weaknesses. He has a diploma in electrical engineering from Coastal College in Durban, South Africa from 2011. His work experience includes positions in youth development, elections, electrical supply, tourism, and building management systems and controls. His strengths include being honest, hardworking, and a quick learner, while he acknowledges not taking enough time for reflection.
Mindset - reprograme a mente a seu favorRogerio Sena
Aprenda nessa palestra como você pode usufruir de todo o potencial que Deus colocou em sua mente, ajustando o MindSet para o sucesso.
Acesse maisrelevante.com.br/2016/11/mindset-reprogramar-mente.html
This document provides information about the composition and combustion analysis of various fuels including coal, natural gas, and ethanol. It gives the ultimate and proximate analyses, on different bases, of different coal and fuel samples. It also provides calculations for determining theoretical air requirements, excess air, heating values, combustion product compositions and volumes.
The document discusses tips for improving developer productivity by optimizing the edit-build-test cycle. It presents several tools that can help speed up and streamline the development workflow, such as PeepOpen for navigating code, Kerl for managing Erlang versions, Rebar for simplifying build processes, Mochiweb Reloader for automatic reloading of code changes, and Sync for automatic compilation and reloading without using the shell. It also recommends writing unit tests with EUnit and Cover to catch errors and measure code coverage. The overall message is that by reducing inefficiencies in the edit-build-test cycle through these kinds of tools, developers can significantly increase the progress they are able to make.
This document provides an overview of Clojure and why one may want to try it. Some key points include:
- Clojure is a functional programming language that runs on the JVM and allows easy interoperability with Java.
- It has a very small and elegant syntax based on Lisp with sensible macro names and prefix notation.
- Clojure encourages pure functional programming and the use of immutable data structures, while providing tools like Software Transactional Memory to allow safe mutable state changes.
- Its focus on functions as first-class citizens and referential transparency can provide benefits for writing parallel and concurrent code more easily compared to other languages.
Erlang - Because s**t Happens by Mahesh Paolini-SubramanyaHakka Labs
Mahesh talks about the buddha-nature of Erlang/OTP, pointing out how the various features of the language tie together into one seamless Fault Tolerant whole. Mahesh emphasizes that Erlang begins and ends with Fault Tolerance. Fault Tolerance is baked into the very genes of Erlang/OTP - something that ends up being amazingly useful when building any kind of system. Mahesh Paolini-Subramanya is the V.P. of R&D at Ubiquiti Networks - a manufacturer of disruptive technology platforms for emerging markets. He has spent the recent past building out Erlang-based massively concurrent Cloud Services and VoIP platforms. Mahesh was previously the CTO of Vocalocity after its merger with Aptela, where he was a founder and CTO.
The document discusses Erlang and scalability. It introduces common scalability killers like synchronization and resource contention. It describes Erlang's design decisions that promote scalability, including processes with no sharing, no implicit synchronization, and concurrency-oriented programming. The document provides examples of thinking concurrently, rules of thumb for scalability, and case studies showing how Erlang scales on multicore systems.
Erlang and XMPP can be used together in several ways:
1. Erlang is well-suited for implementing XMPP servers due to its high concurrency and reliability. ejabberd is an example of a popular Erlang XMPP server.
2. The XMPP protocol can be used to connect Erlang applications and allow them to communicate over the XMPP network. Libraries like Jabberlang facilitate writing Erlang XMPP clients.
3. XMPP provides a flexible messaging backbone that can be extended using Erlang modules. This allows Erlang code to integrate with and enhance standard XMPP server functionality.
Containerd: Building a Container Supervisor by Michael CrosbyDocker, Inc.
Containerd is a container supervisor that allows users to manage the lifecycle of a container as well as interact with the container while it is executing. Containerd was built to fulfill many of the requirements that we expect from a modern supervisor all while staying small and fast. In this talk, we will discuss some of the design decisions that shaped containerd’s architecture that allows it to reattach to running containers if it was killed and how it is designed to start 100s containers in seconds.
This document discusses the use of deterministic simulation to test distributed systems. It describes how Flow, a programming language extension to C++, can be used to simulate concurrency and external communications deterministically. This allows debugging a simulation instead of the live distributed system. Key aspects of the simulation include single-threaded pseudo-concurrency, simulating external connections and files, and ensuring all control flow is deterministic based only on inputs. The simulator is used to run tests and simulated disasters to uncover bugs in a more efficient manner than real world testing alone.
Examples: https://gist.github.com/aditya01933/c6a867e981110885369f06c5a4103644
1. 3 pillars of ruby.
2. Classes and objects.
3. Inheritance - diving deep
4. Meta programming and reflection - diving deep.
5. Power of method missing.
6. Mixins and ducktyping
7. Super - diving deep
8. Yield
9. Closure
10. Block, proc and lambda
11. More meta programming(examples).
12. Ruby open classes.
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeJeff Frost
This document provides instructions for minimizing downtime when performing a major version upgrade of PostgreSQL using logical replication with Slony. It discusses various methods for performing the upgrade, including dump/restore, pg_upgrade, and logical replication with Slony. It then provides a step-by-step guide to setting up logical replication between two PostgreSQL nodes using Slony, including initializing the cluster and nodes, creating replication sets, subscribing nodes, and monitoring the initial synchronization process. The document demonstrates how Slony allows performing a graceful switchover and switchback between nodes when upgrading PostgreSQL versions.
PuppetCamp Ghent - What Not to Do with PuppetOlinData
The document discusses common mistakes to avoid when using Puppet, including design mistakes like putting multiple classes in a file, language mistakes like using default options without checking for failures, and resource definition mistakes like recursively declaring ownership on large directories. It provides examples of bad Puppet code patterns and suggests better alternatives to avoid issues like dependency loops. The document is intended to help Puppet users learn from ugly or problematic Puppet code examples.
PuppetCamp Ghent - What Not to Do with PuppetWalter Heck
The document discusses common mistakes to avoid when using Puppet, including design mistakes like poorly structured classes, language mistakes like misusing functionality, and dependency issues. It provides examples of problematic Puppet code and explanations of why they are problematic, such as putting multiple classes in one file, using default options without checking for failures, and creating dependency loops between resources. The goal is to help Puppet users identify and avoid ugly or erroneous Puppet code that could cause problems.
1. The document discusses transactions in SQL and PHP/PDO. It provides examples of running concurrent transactions that update the same table from two separate terminals.
2. It then covers transaction concepts like atomicity, consistency, isolation, and durability. It demonstrates how to start a transaction, insert and select data, and either commit or roll back the transaction in PHP/PDO.
3. The transaction is stored in the database until it is either committed or rolled back. Stress testing with JMeter is suggested to simulate high user loads on database resources.
Debugging: Rules And Tools - PHPTek 11 VersionIan Barber
The document provides rules and tools for debugging. It discusses understanding the system, making failures reproducible, quitting thinking and closely observing behaviors, dividing problems into smaller pieces, changing one thing at a time, and maintaining an audit trail of changes. Tools mentioned include Xdebug, Selenium, PHPUnit, strace, and source control systems. Logging, instrumentation, and testing techniques are also covered.
Finding and fixing bugs is a major chunk of any developers time. This talk describes the basic rules for effective debugging in any language, but shows how the tools available in PHP can be used to find and fix even the most elusive error
The document discusses various patterns for building resilience into systems, including isolation, loose coupling, asynchronous communication, statelessness, and others. It defines resilience as the ability to recover from failures or adversity. For each pattern, it provides a definition and example of how the pattern contributes to resilience. The goal is to describe techniques that systems can use to detect failures, recover from them, and continue operating without downtime.
Slides from my talk at Citus Con on Optimizing Autovacuum: PostgreSQL's vacuum cleaner.
Talk Abstract below:
If you have run PostgreSQL for any serious OLTP workload, you have heard of autovacuum. Autovacuum is PostgreSQL’s way of running vacuum regularly to clear bloat from your tables and indexes. However, in spite of having autovacuum on, a large number of PostgreSQL users still see their database bloat increasing. What’s going on?
In the last decade, I have personally worked with 50+ Postgres customers who have struggled to figure out why autovacuum isn’t working how they expect. In this talk, we will walk through what I’ve learned from analyzing and improving these production Postgres databases. In this talk you will learn how autovacuum works, how to figure out why it is not working as you expect, and what you can do to fix it.
The Ring programming language version 1.10 book - Part 94 of 212Mahmoud Samir Fayed
The document describes the Trace Library in Ring and how it can be used to trace program execution, debug code, and step through a program line by line. It provides examples of loading the Trace Library, tracing all events, tracing control flow between functions, and using the pass error functionality to continue execution after an error. Key functions and capabilities of the Trace Library discussed include tracing specific events, setting breakpoints, accessing trace data, and redefining see and give behavior.
Ten useful JavaScript tips & best practicesAnkit Rastogi
In this presentation there are ten useful JavaScript techniques which can be included in your application easily with less friction along with some AngularJs tips and best practices as a bonus. These tips and best practices are accompanied by examples & will cover script loading, design pattern, performance optimization and other areas.
Since best practices are very subjective topics, proper benchmarking needs to be done.
The Ring programming language version 1.5.2 book - Part 9 of 181Mahmoud Samir Fayed
Here are the key things added in Ring 1.5 for tracing functions:
- RingVM_SetTrace() allows setting a function to be called on trace events. This function will receive information about the trace.
- RingVM_TraceData() returns an array with details of the current execution context like line number, file name, function name etc.
- RingVM_TraceEvent() returns the type of trace event, like new line, new function, return etc.
- Additional functions provide the current trace function name, ability to evaluate code in a specific scope, and control error handling during tracing.
This allows implementing a tracing function to log or print details at each step of execution. The example shows
An introduction to the elixir language and the otp framework. A workshop was done and the code can be found here: https://github.com/mendrugory/elixir_and_otp_apps_presentation_1
The Ring programming language version 1.5.4 book - Part 79 of 185Mahmoud Samir Fayed
The document discusses the Trace library in Ring for debugging programs. It provides examples of using the Trace library to trace all events, control flow between functions, handle errors, use an interactive debugger, execute line by line, set breakpoints, disable breakpoints, and use the interactive debugger at breakpoints. The Trace library allows tracing programs, passing errors, debugging interactively by setting and handling breakpoints.
Doveryai, no proveryai - Introduction to tla+Sandeep Joshi
This document provides an introduction to TLA+ and model checking distributed systems. It discusses how TLA+ uses temporal logic and model checking to verify safety and liveness properties of distributed algorithms. Examples include modeling a childcare facility, dining philosophers problem, and an alternate bit protocol over lossy channels. The key aspects of TLA+ covered are processes, labels, awaits, non-determinism, and model checking with TLC. Major users of TLA+ like Amazon and Microsoft are also mentioned.
Process monitoring in UNIX shell scriptingDan Morrill
This script monitors a hardcoded process called "ssh" and restarts it if it stops running. It will attempt to restart the process 3 times before reporting a failure. The script logs status messages to a log file called "procmon.log". It uses color codes to identify status messages. The script contains functions to monitor the process, detect failures, and close the script logging the ending status.
Similar to learn you some erlang - chap11 to chap12 (20)
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...XfilesPro
Wondering how X-Sign gained popularity in a quick time span? This eSign functionality of XfilesPro DocuPrime has many advancements to offer for Salesforce users. Explore them now!
Preparing Non - Technical Founders for Engaging a Tech AgencyISH Technologies
Preparing non-technical founders before engaging a tech agency is crucial for the success of their projects. It starts with clearly defining their vision and goals, conducting thorough market research, and gaining a basic understanding of relevant technologies. Setting realistic expectations and preparing a detailed project brief are essential steps. Founders should select a tech agency with a proven track record and establish clear communication channels. Additionally, addressing legal and contractual considerations and planning for post-launch support are vital to ensure a smooth and successful collaboration. This preparation empowers non-technical founders to effectively communicate their needs and work seamlessly with their chosen tech agency.Visit our site to get more details about this. Contact us today www.ishtechnologies.com.au
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfVALiNTRY360
Salesforce Healthcare CRM, implemented by VALiNTRY360, revolutionizes patient management by enhancing patient engagement, streamlining administrative processes, and improving care coordination. Its advanced analytics, robust security, and seamless integration with telehealth services ensure that healthcare providers can deliver personalized, efficient, and secure patient care. By automating routine tasks and providing actionable insights, Salesforce Healthcare CRM enables healthcare providers to focus on delivering high-quality care, leading to better patient outcomes and higher satisfaction. VALiNTRY360's expertise ensures a tailored solution that meets the unique needs of any healthcare practice, from small clinics to large hospital systems.
For more info visit us https://valintry360.com/solutions/health-life-sciences
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
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.
Most important New features of Oracle 23c for DBAs and Developers. You can get more idea from my youtube channel video from https://youtu.be/XvL5WtaC20A
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.
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.
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
Malibou Pitch Deck For Its €3M Seed Roundsjcobrien
French start-up Malibou raised a €3 million Seed Round to develop its payroll and human resources
management platform for VSEs and SMEs. The financing round was led by investors Breega, Y Combinator, and FCVC.
What to do when you have a perfect model for your software but you are constrained by an imperfect business model?
This talk explores the challenges of bringing modelling rigour to the business and strategy levels, and talking to your non-technical counterparts in the process.
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.
Liberarsi dai framework con i Web Component.pptxMassimo Artizzu
In Italian
Presentazione sulle feature e l'utilizzo dei Web Component nell sviluppo di pagine e applicazioni web. Racconto delle ragioni storiche dell'avvento dei Web Component. Evidenziazione dei vantaggi e delle sfide poste, indicazione delle best practices, con particolare accento sulla possibilità di usare web component per facilitare la migrazione delle proprie applicazioni verso nuovi stack tecnologici.
3. 11. MORE ON MULTIPROCESSING
STATE YOUR STATE
▸ no huge advantage if they are just functions with message
▸ process act like fridge - store / taking
fridge1() ->
receive
{From, {store, _Food}} ->
From ! {self(), ok},
fridge1();
{From, {take, _Food}} ->
From ! {self(), not_found},
fridge1();
terminate -> ok
end.
4. 11. MORE ON MULTIPROCESSING
STATE YOUR STATE
▸ pass all
fridge2(FoodList) ->
receive
{From, {store, Food}} ->
From ! {self(), ok},
fridge2([Food|FoodList]);
5. 11. MORE ON MULTIPROCESSING
STATE YOUR STATE
▸ pass all - 2
{From, {take, Food}} ->
case lists:member(Food, FoodList) of
true ->
From ! {self(), {ok, Food}},
fridge2(lists:delete(Food, FoodList));
false ->
From ! {self(), not_found},
fridge2(FoodList)
end;
terminate ->
ok
end.
6. 11. MORE ON MULTIPROCESSING
STATE YOUR STATE
▸ test
5> Pid ! {self(), {store, bacon}}.
{<0.33.0>,{store,bacon}}
6> Pid ! {self(), {take, bacon}}.
{<0.33.0>,{take,bacon}}
7> Pid ! {self(), {take, turkey}}.
{<0.33.0>,{take,turkey}}
8> flush().
Shell got {<0.51.0>,ok}
Shell got {<0.51.0>,{ok,bacon}}
Shell got {<0.51.0>,not_found}
ok
7. 11. MORE ON MULTIPROCESSING
STATE YOUR STATE
▸ makes help functions
store(Pid, Food) ->
Pid ! {self(), {store, Food}},
receive
{Pid, Msg} -> Msg
end.
take(Pid, Food) ->
Pid ! {self(), {take, Food}},
receive
{Pid, Msg} -> Msg
end.
8. 11. MORE ON MULTIPROCESSING
STATE YOUR STATE
▸ using it
10> f().
ok
11> Pid = spawn(kitchen, fridge2, [[baking_soda]]).
<0.73.0>
12> kitchen:store(Pid, water).
ok
13> kitchen:take(Pid, water).
{ok,water}
14> kitchen:take(Pid, juice).
not_found
9. 11. MORE ON MULTIPROCESSING
STATE YOUR STATE
▸ uh - hum. let’s wrap spawn.
start(FoodList) ->
spawn(?MODULE, fridge2, [FoodList]).
10. 11. MORE ON MULTIPROCESSING
STATE YOUR STATE
▸ using it
15> f().
ok
16> c(kitchen).
{ok,kitchen}
17> Pid = kitchen:start([rhubarb, dog, hotdog]).
<0.84.0>
18> kitchen:take(Pid, dog).
{ok,dog}
19> kitchen:take(Pid, dog).
not_found
11. 11. MORE ON MULTIPROCESSING
STATE YOUR STATE
▸ in normal case, what happen?
▸ A message to take food is sent from you (the shell) to the
fridge process;
▸ Your process switches to receive mode and waits for a new
message;
▸ The fridge removes the item and sends it to your process;
▸ Your process receives it and moves on with its life.
20> kitchen:take(pid, dog).
12. 11. MORE ON MULTIPROCESSING
STATE YOUR STATE
▸ what happen?
▸ A message to take food is sent from you (the shell) to an unknown
process;
▸ Your process switches to receive mode and waits for a new
message;
▸ The unknown process either doesn't exist or doesn't expect such a
message and does nothing with it;
▸ Your shell process is stuck in receive mode.
20> kitchen:take(pid(0,250,0), dog).
13. 11. MORE ON MULTIPROCESSING
TIMEOUT
▸ timeout
receive
Match -> Expression1
after Delay ->
Expression2
end.
14. 11. MORE ON MULTIPROCESSING
TIMEOUT
▸ use timeout 3000
store2(Pid, Food) ->
Pid ! {self(), {store, Food}},
receive
{Pid, Msg} -> Msg
after 3000 -> timeout
end.
take2(Pid, Food) ->
Pid ! {self(), {take, Food}},
receive
{Pid, Msg} -> Msg
after 3000 -> timeout
end.
15. 11. MORE ON MULTIPROCESSING
TIMEOUT
▸ using it
User switch command
--> k
--> s
--> c
Eshell V5.7.5 (abort with ^G)
1> c(kitchen).
{ok,kitchen}
2> kitchen:take2(pid(0,250,0), dog).
timeout
16. 11. MORE ON MULTIPROCESSING
TIMEOUT
▸ special cases
sleep(T) ->
receive
after T -> ok
end.
flush() ->
receive
_ -> flush()
after 0 ->
ok
end.
17. 11. MORE ON MULTIPROCESSING
SELECTIVE RECEIVES
▸ give priority
important() ->
receive
{Priority, Message} when Priority > 10 ->
[Message | important()]
after 0 ->
normal()
end.
18. 11. MORE ON MULTIPROCESSING
SELECTIVE RECEIVES
▸ give priority
normal() ->
receive
{_, Message} ->
[Message | normal()]
after 0 ->
[]
end.
19. 11. MORE ON MULTIPROCESSING
SELECTIVE RECEIVES
▸ give priority
▸ before after routine is started, try to grab every message..
1> c(multiproc).
{ok,multiproc}
2> self() ! {15, high}, self() ! {7, low}, self() ! {1, low}, self() ! {17, high}.
{17,high}
3> multiproc:important().
[high,high,low,low]
20. 11. MORE ON MULTIPROCESSING
SELECTIVE RECEIVES
▸ be care!
21. 11. MORE ON MULTIPROCESSING
SELECTIVE RECEIVES
▸ be care!
22. 11. MORE ON MULTIPROCESSING
SELECTIVE RECEIVES
▸ be care!
▸ if your process has a lot of messages you never care
about, reading useful messages will actually take longer
and longer (and the processes will grow in size too).
▸ ask your self
▸ why you are getting messages you do not want ?
24. 11. MORE ON MULTIPROCESSING
SELECTIVE RECEIVES
▸ unexpected message out of the mailbox and show a
warning
▸ you can logging it
▸ more smarter way to implement priority message,..
▸ using min_heap / gb_tree (smallest.. largest..)
▸ but what if most of message has high-priority… ??
▸ optimized/1, make_ref() > R14A
30. 12. ERRORS AND PROCESSES
LINKS
▸ link/1 happens more than one step
▸ atomic
spawn_link/1-3
31. 12. ERRORS AND PROCESSES
IT’S A TRAP!
▸ error propagation is similar with message passing, but it is
special type of message, signal.
▸ killing part is link. how about quick restarting ?
▸ system processes
process_flag(trap_exit, true)
32. 12. ERRORS AND PROCESSES
IT’S A TRAP!
▸ example
1> process_flag(trap_exit, true).
true
2> spawn_link(fun() -> linkmon:chain(3) end).
3> receive X -> X end.
[shell] == [3] == [2] == [1] == [0]
[shell] == [3] == [2] == [1] == *dead*
[shell] == [3] == [2] == *dead*
[shell] == [3] == *dead*
[shell] <-- {'EXIT,Pid,"chain dies here"} -- *dead*
[shell] <-- still alive!
33. 12. ERRORS AND PROCESSES
IT’S A TRAP!
▸ Let's first set the bases to experiment without a system
process
Exception source: spawn_link(fun() -> ok end)
Untrapped Result: - nothing -
Trapped Result: {'EXIT', <0.61.0>, normal}
The process exited normally, without a problem. Note that this looks
a bit like the result of catch exit(normal),
except a PID is added to the tuple to know what processed failed.
34. 12. ERRORS AND PROCESSES
IT’S A TRAP!
▸ Let's first set the bases to experiment without a system
process
Exception source: spawn_link(fun() -> exit(reason) end)
Untrapped Result: ** exception exit: reason
Trapped Result: {'EXIT', <0.55.0>, reason}
The process has terminated for a custom reason. In this case, if there
is no trapped exit, the process crashes. Otherwise, you get the above
message
35. 12. ERRORS AND PROCESSES
IT’S A TRAP!
▸ Let's first set the bases to experiment without a system
process
blah blah…
see Your Book. they are listed in same way..
36. 12. ERRORS AND PROCESSES
IT’S A TRAP!
▸ exit/2 - kill another one from a distance, safely
exit(self(), normal) % same
exit(spawn_link(fun() -> timer:sleep(50000) end), normal) % no effect
exit(spawn_link(fun() -> timer:sleep(50000) end), kill)
% Trapped Result: {'EXIT', <0.58.0>, killed}
exit(self(), kill)
% Trapped Result: ** exception exit: killed
Exception source: spawn_link(fun() -> exit(kill) end)
% Untrapped Result: ** exception exit: killed
% Trapped Result: {'EXIT', <0.67.0>, kill}
37. 12. ERRORS AND PROCESSES
IT’S A TRAP!
▸ kill
▸ you might want to brutally murder a process
▸ killed
▸ prevent cascading die
38. 12. ERRORS AND PROCESSES
MONITORS
▸ monitor - special type of link
▸ they are unidirectional;
▸ they can be stacked.
▸ if you have 2 or 3 different libraries that you call and
they all need to know whether a process is alive or not?
▸ not stackable.. (you unlink one, you unlink them all)
39. 12. ERRORS AND PROCESSES
MONITORS
▸ example
1> erlang:monitor(process, spawn(fun() -> timer:sleep(500) end)).
#Ref<0.0.0.77>
2> flush().
Shell got {'DOWN',#Ref<0.0.0.77>,process,<0.63.0>,normal}
ok
41. 12. ERRORS AND PROCESSES
MONITORS
▸ demonitor
demonitor/1
3> {Pid, Ref} = spawn_monitor(fun() -> receive _ -> exit(boom) end
end).
{<0.73.0>,#Ref<0.0.0.100>}
4> erlang:demonitor(Ref).
true
5> Pid ! die.
die
6> flush().
ok
42. 12. ERRORS AND PROCESSES
MONITORS
▸ demonitor
demonitor/2
8> {Pid, Ref} = spawn_monitor(fun() -> receive _ -> exit(boom) end
end).
{<0.35.0>,#Ref<0.0.0.35>}
9> Pid ! die.
die
10> erlang:demonitor(Ref, [flush, info]).
false
11> flush().
ok
43. 12. ERRORS AND PROCESSES
NAMING PROCESSES
▸ another problem 1 - 1
start_critic() ->
spawn(?MODULE, critic, []).
judge(Pid, Band, Album) ->
Pid ! {self(), {Band, Album}},
receive
{Pid, Criticism} -> Criticism
after 2000 ->
timeout
end.
44. 12. ERRORS AND PROCESSES
NAMING PROCESSES
▸ another problem 1- 2
critic() ->
receive
{From, {"Rage Against the Turing Machine", "Unit Testify"}} ->
From ! {self(), "They are great!"};
{From, {"System of a Downtime", "Memoize"}} ->
From ! {self(), "They're not Johnny Crash but they're good."};
{From, {"Johnny Crash", "The Token Ring of Fire"}} ->
From ! {self(), "Simply incredible."};
{From, {_Band, _Album}} ->
From ! {self(), "They are terrible!"}
end,
critic().
45. 12. ERRORS AND PROCESSES
NAMING PROCESSES
▸ another problem 1- 3
1> c(linkmon).
{ok,linkmon}
2> Critic = linkmon:start_critic().
<0.47.0>
3> linkmon:judge(Critic, "Genesis", "The Lambda Lies Down on
Broadway").
"They are terrible!”
4> exit(Critic, solar_storm).
true
5> linkmon:judge(Critic, "Genesis", "A trick of the Tail Recursion").
timeout
46. 12. ERRORS AND PROCESSES
NAMING PROCESSES
▸ another problem 1- 4
start_critic2() ->
spawn(?MODULE, restarter, []).
restarter() ->
process_flag(trap_exit, true),
Pid = spawn_link(?MODULE, critic, []),
receive
{'EXIT', Pid, normal} -> % not a crash
ok;
{'EXIT', Pid, shutdown} -> % manual termination, not a crash
ok;
{'EXIT', Pid, _} ->
restarter()
end.
47. 12. ERRORS AND PROCESSES
NAMING PROCESSES
▸ there is no way to find the Pid of the critic !!!
start_critic2() ->
spawn(?MODULE, restarter, []).
restarter() ->
process_flag(trap_exit, true),
Pid = spawn_link(?MODULE, critic, []),
receive
{'EXIT', Pid, normal} -> % not a crash
ok;
{'EXIT', Pid, shutdown} -> % manual termination, not a crash
ok;
{'EXIT', Pid, _} ->
restarter()
end.
48. 12. ERRORS AND PROCESSES
NAMING PROCESSES
▸ there is no way to find the Pid of the critic !!!
▸ If the process dies, it will automatically lose its name or you
can also use unregister/1 to do it manually
▸ get list all registered process
erlang:register/2
erlang:unregister/2
erlang:registered/0 ….. in shell, regs()
49. 12. ERRORS AND PROCESSES
NAMING PROCESSES
▸ solve problem with register
restarter() ->
process_flag(trap_exit, true),
Pid = spawn_link(?MODULE, critic, []),
register(critic, Pid),
receive
{'EXIT', Pid, normal} -> % not a crash
ok;
{'EXIT', Pid, shutdown} -> % manual termination, not a crash
ok;
{'EXIT', Pid, _} ->
restarter()
end.
50. 12. ERRORS AND PROCESSES
NAMING PROCESSES
▸ solve problem with register
judge2(Band, Album) ->
critic ! {self(), {Band, Album}},
Pid = whereis(critic),
receive
{Pid, Criticism} -> Criticism
after 2000 ->
timeout
end.
51. 12. ERRORS AND PROCESSES
NAMING PROCESSES
▸ no, it ISN’T solving problem, completely.
▸ critic: shared state / race condition
1. critic ! Message
2. critic receives
3. critic replies
4. critic dies
5. whereis fails
6. critic is restarted
7. code crashes
1. critic ! Message
2. critic receives
3. critic replies
4. critic dies
5. critic is restarted
6. whereis picks up
wrong pid
7. message never matches
53. 12. ERRORS AND PROCESSES
NAMING PROCESSES
▸ solve problem considering pid’s differentiable 2
critic2() ->
receive
{From, Ref, {"Rage Against the Turing Machine", "Unit Testify"}} ->
From ! {Ref, "They are great!"};
{From, Ref, {"System of a Downtime", "Memoize"}} ->
From ! {Ref, "They're not Johnny Crash but they're good."};
{From, Ref, {"Johnny Crash", "The Token Ring of Fire"}} ->
From ! {Ref, "Simply incredible."};
{From, Ref, {_Band, _Album}} ->
From ! {Ref, "They are terrible!"}
end,
critic2().
54. 12. ERRORS AND PROCESSES
NAMING PROCESSES
▸ solve problem considering pid’s differentiable 3
6> c(linkmon).
{ok,linkmon}
7> linkmon:start_critic2().
<0.55.0>
8> linkmon:judge2("The Doors", "Light my Firewall").
"They are terrible!"
9> exit(whereis(critic), kill).
true
10> linkmon:judge2("Rage Against the Turing Machine",
"Unit Testify").
"They are great!"