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.2 book - Part 18 of 84Mahmoud Samir Fayed
This document describes MySQL functions in Ring for interacting with MySQL databases, including functions for:
- Initializing and closing connections
- Executing queries and retrieving results
- Getting error and info messages
- Escaping strings, committing transactions, and more
It provides the syntax for each function and examples of their use for common tasks like connecting, querying, inserting and retrieving data.
With the ever more frequent use of multiple servers and worker processes, issues which only occur when specific tasks are running in parallel become ever more likely to happen.
In this talk Marcos talks about some rails concurrency limitations you need to be aware of, including why you should never trust rails to check for uniqueness, why mysql can't do optimistic locking with retrying by default and how to fix it, how to properly choose between optimistic and pessimistic locking, how parallel processes can cause deadlocks even if you're not using locks, why you should never have serialized attributes in rows that might be edited in parallel, and why rails commits your transactions before they finish in case your multi threaded process is killed and how to prevent it from leaving your database on an inconsistent state.
The document discusses Scala as a potential replacement for Java on the JVM. It provides quotes from several influential Java developers who express their view that Scala is the most capable replacement for Java currently available on the JVM, and the momentum behind Scala is growing. The document also briefly outlines an agenda for introducing Scala, covering basic syntax, patterns, functions, classes and traits.
The Ring programming language version 1.3 book - Part 20 of 88Mahmoud Samir Fayed
This document provides documentation on using SQLite database functions in Ring. It introduces the sqlite_init(), sqlite_open(), sqlite_execute(), and sqlite_close() functions for initializing a SQLite object, opening a database, executing SQL statements, and closing the database. An example shows how to create a table, insert records, and retrieve data using these functions. The example creates a 'COMPANY' table, inserts 4 records, then selects and prints the records.
The Ring programming language version 1.5.2 book - Part 28 of 181Mahmoud Samir Fayed
This document describes MySQL functions available in the Ring programming language. It provides examples of using various MySQL functions such as MySQL_Info(), MySQL_Init(), MySQL_Connect(), MySQL_Query(), MySQL_Insert_ID(), MySQL_Result(), MySQL_Columns(), MySQL_Escape_String(), MySQL_AutoCommit(), MySQL_Commit(), and MySQL_Rollback(). It also shows how to connect to a MySQL database, execute queries, retrieve and print results, handle errors, and work with transactions.
The Ring programming language version 1.5.3 book - Part 29 of 184Mahmoud Samir Fayed
This document describes various functions for security, encryption, hashing and internet usage in the Ring programming language. It covers functions for calculating hashes using MD5, SHA1, SHA256 and SHA512. It also covers functions for encryption/decryption and generating random bytes. Additionally, it describes functions for downloading content from the internet and sending emails.
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.
The document contains 17 Java code snippets that provide solutions to common programming problems and examples. Some of the problems addressed include: reversing an integer, checking if two words are anagrams, palindrome checking, merging two sorted arrays, left rotation of an array, sorting an array of 0s, 1s and 2s, counting character occurrences in a string, factorial, Fibonacci series, prime number checking, bubble sort, and substring searching. The code snippets provide full programs or methods to solve each problem in 1-5 steps or lines of code each.
The Ring programming language version 1.2 book - Part 18 of 84Mahmoud Samir Fayed
This document describes MySQL functions in Ring for interacting with MySQL databases, including functions for:
- Initializing and closing connections
- Executing queries and retrieving results
- Getting error and info messages
- Escaping strings, committing transactions, and more
It provides the syntax for each function and examples of their use for common tasks like connecting, querying, inserting and retrieving data.
With the ever more frequent use of multiple servers and worker processes, issues which only occur when specific tasks are running in parallel become ever more likely to happen.
In this talk Marcos talks about some rails concurrency limitations you need to be aware of, including why you should never trust rails to check for uniqueness, why mysql can't do optimistic locking with retrying by default and how to fix it, how to properly choose between optimistic and pessimistic locking, how parallel processes can cause deadlocks even if you're not using locks, why you should never have serialized attributes in rows that might be edited in parallel, and why rails commits your transactions before they finish in case your multi threaded process is killed and how to prevent it from leaving your database on an inconsistent state.
The document discusses Scala as a potential replacement for Java on the JVM. It provides quotes from several influential Java developers who express their view that Scala is the most capable replacement for Java currently available on the JVM, and the momentum behind Scala is growing. The document also briefly outlines an agenda for introducing Scala, covering basic syntax, patterns, functions, classes and traits.
The Ring programming language version 1.3 book - Part 20 of 88Mahmoud Samir Fayed
This document provides documentation on using SQLite database functions in Ring. It introduces the sqlite_init(), sqlite_open(), sqlite_execute(), and sqlite_close() functions for initializing a SQLite object, opening a database, executing SQL statements, and closing the database. An example shows how to create a table, insert records, and retrieve data using these functions. The example creates a 'COMPANY' table, inserts 4 records, then selects and prints the records.
The Ring programming language version 1.5.2 book - Part 28 of 181Mahmoud Samir Fayed
This document describes MySQL functions available in the Ring programming language. It provides examples of using various MySQL functions such as MySQL_Info(), MySQL_Init(), MySQL_Connect(), MySQL_Query(), MySQL_Insert_ID(), MySQL_Result(), MySQL_Columns(), MySQL_Escape_String(), MySQL_AutoCommit(), MySQL_Commit(), and MySQL_Rollback(). It also shows how to connect to a MySQL database, execute queries, retrieve and print results, handle errors, and work with transactions.
The Ring programming language version 1.5.3 book - Part 29 of 184Mahmoud Samir Fayed
This document describes various functions for security, encryption, hashing and internet usage in the Ring programming language. It covers functions for calculating hashes using MD5, SHA1, SHA256 and SHA512. It also covers functions for encryption/decryption and generating random bytes. Additionally, it describes functions for downloading content from the internet and sending emails.
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.
The document contains 17 Java code snippets that provide solutions to common programming problems and examples. Some of the problems addressed include: reversing an integer, checking if two words are anagrams, palindrome checking, merging two sorted arrays, left rotation of an array, sorting an array of 0s, 1s and 2s, counting character occurrences in a string, factorial, Fibonacci series, prime number checking, bubble sort, and substring searching. The code snippets provide full programs or methods to solve each problem in 1-5 steps or lines of code each.
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().
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.4 book - Part 29 of 185Mahmoud Samir Fayed
The document describes various SQLite functions in Ring for working with SQLite databases. It shows how to initialize a SQLite object, open a database, execute SQL statements to create a table, insert data, and retrieve results. Code examples demonstrate creating a database "mytest.db", adding records to a table, and selecting all records to display the names.
The Ring programming language version 1.6 book - Part 46 of 189Mahmoud Samir Fayed
This document summarizes code from the Ring documentation related to user registration, login, and database classes. It describes classes for users, models, views, controllers, and languages that allow for user registration, login, form views, and routing. It also summarizes the Database, ModelBase, and ControllerBase classes that provide functionality for connecting to databases, executing queries, and managing model data.
The document contains code for an image processing program that:
1) Loads a series of images from a file into memory and analyzes frame differences to determine scene changes.
2) Applies frame transformations to adjust for motion between images.
3) Generates a reduced set of frames to display by selecting key frames around detected scene changes.
The program analyzes histograms, motion vectors, and color differences between frames to evaluate scene changes and filter out unnecessary frames.
The Ring programming language version 1.4 book - Part 7 of 30Mahmoud Samir Fayed
Here are the key functions for connecting and interacting with an ODBC database in Ring:
- odbc_init() - Creates an ODBC handle
- odbc_drivers()/odbc_datasources() - Get available drivers/data sources
- odbc_connect() - Connect to a data source using a connection string
- odbc_execute() - Execute an SQL statement
- odbc_colcount() - Get number of columns in result set
- odbc_fetch() - Fetch rows from result set
- odbc_getdata() - Get data from columns
- odbc_close() - Close connection and release resources
Some additional functions:
- odbc_
Developing Applications with MySQL and Java for beginnersSaeid Zebardast
A presentation about Developing Applications with MySQL and Java for beginners. It includes the following topics:
- Requirements
- MySQL Data Definitions
- Java Classes
- MySQL Connector (JDBC)
- Define Methods
- Compile and Run
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 art of reverse engineering flash exploitsPriyanka Aash
"Adobe Flash is one of the battlegrounds of exploit and mitigation methods. As most of the Flash exploits demonstrate native memory layer exploit technique, it is valuable to understand the memory layout and behavior of Adobe Flash Player. We developed fine-grained debugging tactics to observe memory exploit technique and the way to interpret them effectively. This eventually helps defenders to understand new exploit techniques that are used for current targets quickly. This information is also valuable in deciding which area should defenders focus on for mitigation and code fixes. Adobe Flash Player was one of the major attack targets in 2015. We observed at least 17 effective zero-days or 1-day attacks in the wild. Flash is not just used by exploit kits like Angler, it has also been commonly used for advanced persistent threat (APT) attacks. The bug class ranges from simple heap overflows, uninitialized memory to type confusion and use-after-free. At Microsoft, understanding exploits in-the-wild is a continuous process. Flash exploit is one of the hardest to reverse-engineer. It often involves multi-layer obfuscation, and by default, is highly obfuscated and has non-decompilable codes. The challenge with Flash exploit comes from the lack of tools for static and dynamic analysis. Exploits are written with ActionScript programming language and obfuscated in bytecode level using commercial-grade obfuscation tools. Understanding highly obfuscated logic and non-decompilable AVM bytecode is a big challenge. Especially, the lack of usable debuggers for Flash file itself is a huge hurdle for exploit reverse engineers. It is just like debugging PE binaries without using Windbg or Olly debugger. The ability of the researcher is highly limited.
With this presentation, I want to deliver two things: 1. The tactics and debugging technique that can be used to reverse engineer exploits. This includes using existing toolsets and combining them in an effective way. 2. The detailed exploit code reverse engineering examples that can help you understand what's the current and past status of attack and mitigation war. You might have heard of Vector corruption, ByteArray corruption and other JIT manipulation technique. Technical details will be discussed on how the exploits are using these and how the vendor defended against these."
(Source: Black Hat USA 2016, Las Vegas)
The Ring programming language version 1.9 book - Part 36 of 210Mahmoud Samir Fayed
The document describes SQLite functions in Ring for connecting to and interacting with a SQLite database. It includes functions for initializing a SQLite object, opening a database connection, executing SQL statements, and closing the connection. An example shows how to create a database, insert records, retrieve data via a SELECT statement, and display the results.
The Ring programming language version 1.5.3 book - Part 27 of 184Mahmoud Samir Fayed
This document discusses Ring's ODBC functions for connecting to databases. It describes functions for initializing an ODBC connection, getting lists of ODBC drivers and data sources, connecting to and executing queries on a data source, and closing an ODBC connection. Examples are given to print lists of available ODBC drivers and data sources on a system.
The Ring programming language version 1.4.1 book - Part 8 of 31Mahmoud Samir Fayed
The document discusses various hashing and encryption functions available in the Ring programming language for security purposes. It describes functions like MD5(), SHA1(), SHA256(), SHA512() etc to calculate hashes of strings. It also discusses the Encrypt() and Decrypt() functions for encrypting and decrypting data along with the Randbytes() function for generating random bytes. Functions from the internetlib library like Download() and SendEmail() are also mentioned. Examples are provided to demonstrate calculating hashes of strings using different hashing algorithms.
The Ring programming language version 1.5 book - Part 5 of 31Mahmoud Samir Fayed
Load the ODBC library. Initialize an ODBC connection handle. Connect to a data source using the handle. Execute SQL statements and process the results. Close the ODBC connection when done.
Recentrer l'intelligence artificielle sur les connaissancesMathieu d'Aquin
The document appears to contain rules for assigning values to variables (x[n]) based on logical conditions. It includes 14 rules using comparisons of the variable values, logical operators, and numeric values. It also reports the training and test accuracies of the rules as 92.13% and 89.3% respectively.
How to Become a Tree Hugger: Random Forests and Predictive Modeling for Devel...Matt Harrison
Python makes data science easy. In this deck we walk through a complete example of creating and evaluating a predictive model using Decision Trees and Random Forests. All of the code is included in the slides.
The document discusses various techniques in Django including:
- Using model inheritance and mixins to add common fields and functionality to models
- Monkey patching the model save method to add additional keyword arguments
- Handling null values across deep dictionary lookups
- Using locals() to pass additional context when rendering templates
- Defining choices as classes to avoid hardcoding in models
- Adding operators to choice values to customize display
- Conditionally including fields and methods based on settings
- Injecting context from other files using execfile
Analysis of Fatal Utah Avalanches with Python. From Scraping, Analysis, to In...Matt Harrison
I gave this presentation at Code Camp. As a data scientist and backcountry skier, I was interested in looking at fatal avalanche data. This covers scraping the data, analysis with Python, pandas and IPython Notebook. The final result is an infographic
The Ring programming language version 1.2 book - Part 32 of 84Mahmoud Samir Fayed
The document discusses user registration and login functionality in Ring. It describes classes for users (Model, View & Controller), form views for registration and login, and code to handle registration, login, and checking authentication. It also summarizes classes for database access (Database), model objects (ModelBase), and controllers (ControllerBase).
Manchester Social Media Surgery Events: an IntroductionChi-chi Ekweozor
A slide deck documenting our discussions about monthly Manchester Social Media Surgery events at Social Media Cafe Manchester, #smc_mcr on 1st Dec 2009.
The document discusses using social media for marketing. It provides examples of how businesses and individuals have used social media successfully. Some key points covered include:
- Social media allows for two-way interaction between brands and customers as opposed to traditional one-way broadcast media.
- Major social media platforms like Facebook have grown rapidly, with 18 million UK users on Facebook alone last month.
- Case studies are presented showing how a movie studio used social media to build an audience for a film and how artists have promoted and sold their work online.
- Tips are provided on setting up social media profiles and engaging with audiences. The importance of listening to customers and giving credit to others is stressed.
MobiWeb provides two-factor authentication through one-time PINs (OTPs) sent via SMS. This adds security over simple usernames and passwords and helps reduce fraud. The process works by MobiWeb generating an OTP when a user tries to login, sending it via SMS to the user's phone, and validating the OTP when the user enters it. This solution has benefits like increased security, reduced fraud losses, and a better customer experience compared to hardware tokens. MobiWeb has been providing global SMS services since 1999 through direct connections to mobile networks worldwide.
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().
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.4 book - Part 29 of 185Mahmoud Samir Fayed
The document describes various SQLite functions in Ring for working with SQLite databases. It shows how to initialize a SQLite object, open a database, execute SQL statements to create a table, insert data, and retrieve results. Code examples demonstrate creating a database "mytest.db", adding records to a table, and selecting all records to display the names.
The Ring programming language version 1.6 book - Part 46 of 189Mahmoud Samir Fayed
This document summarizes code from the Ring documentation related to user registration, login, and database classes. It describes classes for users, models, views, controllers, and languages that allow for user registration, login, form views, and routing. It also summarizes the Database, ModelBase, and ControllerBase classes that provide functionality for connecting to databases, executing queries, and managing model data.
The document contains code for an image processing program that:
1) Loads a series of images from a file into memory and analyzes frame differences to determine scene changes.
2) Applies frame transformations to adjust for motion between images.
3) Generates a reduced set of frames to display by selecting key frames around detected scene changes.
The program analyzes histograms, motion vectors, and color differences between frames to evaluate scene changes and filter out unnecessary frames.
The Ring programming language version 1.4 book - Part 7 of 30Mahmoud Samir Fayed
Here are the key functions for connecting and interacting with an ODBC database in Ring:
- odbc_init() - Creates an ODBC handle
- odbc_drivers()/odbc_datasources() - Get available drivers/data sources
- odbc_connect() - Connect to a data source using a connection string
- odbc_execute() - Execute an SQL statement
- odbc_colcount() - Get number of columns in result set
- odbc_fetch() - Fetch rows from result set
- odbc_getdata() - Get data from columns
- odbc_close() - Close connection and release resources
Some additional functions:
- odbc_
Developing Applications with MySQL and Java for beginnersSaeid Zebardast
A presentation about Developing Applications with MySQL and Java for beginners. It includes the following topics:
- Requirements
- MySQL Data Definitions
- Java Classes
- MySQL Connector (JDBC)
- Define Methods
- Compile and Run
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 art of reverse engineering flash exploitsPriyanka Aash
"Adobe Flash is one of the battlegrounds of exploit and mitigation methods. As most of the Flash exploits demonstrate native memory layer exploit technique, it is valuable to understand the memory layout and behavior of Adobe Flash Player. We developed fine-grained debugging tactics to observe memory exploit technique and the way to interpret them effectively. This eventually helps defenders to understand new exploit techniques that are used for current targets quickly. This information is also valuable in deciding which area should defenders focus on for mitigation and code fixes. Adobe Flash Player was one of the major attack targets in 2015. We observed at least 17 effective zero-days or 1-day attacks in the wild. Flash is not just used by exploit kits like Angler, it has also been commonly used for advanced persistent threat (APT) attacks. The bug class ranges from simple heap overflows, uninitialized memory to type confusion and use-after-free. At Microsoft, understanding exploits in-the-wild is a continuous process. Flash exploit is one of the hardest to reverse-engineer. It often involves multi-layer obfuscation, and by default, is highly obfuscated and has non-decompilable codes. The challenge with Flash exploit comes from the lack of tools for static and dynamic analysis. Exploits are written with ActionScript programming language and obfuscated in bytecode level using commercial-grade obfuscation tools. Understanding highly obfuscated logic and non-decompilable AVM bytecode is a big challenge. Especially, the lack of usable debuggers for Flash file itself is a huge hurdle for exploit reverse engineers. It is just like debugging PE binaries without using Windbg or Olly debugger. The ability of the researcher is highly limited.
With this presentation, I want to deliver two things: 1. The tactics and debugging technique that can be used to reverse engineer exploits. This includes using existing toolsets and combining them in an effective way. 2. The detailed exploit code reverse engineering examples that can help you understand what's the current and past status of attack and mitigation war. You might have heard of Vector corruption, ByteArray corruption and other JIT manipulation technique. Technical details will be discussed on how the exploits are using these and how the vendor defended against these."
(Source: Black Hat USA 2016, Las Vegas)
The Ring programming language version 1.9 book - Part 36 of 210Mahmoud Samir Fayed
The document describes SQLite functions in Ring for connecting to and interacting with a SQLite database. It includes functions for initializing a SQLite object, opening a database connection, executing SQL statements, and closing the connection. An example shows how to create a database, insert records, retrieve data via a SELECT statement, and display the results.
The Ring programming language version 1.5.3 book - Part 27 of 184Mahmoud Samir Fayed
This document discusses Ring's ODBC functions for connecting to databases. It describes functions for initializing an ODBC connection, getting lists of ODBC drivers and data sources, connecting to and executing queries on a data source, and closing an ODBC connection. Examples are given to print lists of available ODBC drivers and data sources on a system.
The Ring programming language version 1.4.1 book - Part 8 of 31Mahmoud Samir Fayed
The document discusses various hashing and encryption functions available in the Ring programming language for security purposes. It describes functions like MD5(), SHA1(), SHA256(), SHA512() etc to calculate hashes of strings. It also discusses the Encrypt() and Decrypt() functions for encrypting and decrypting data along with the Randbytes() function for generating random bytes. Functions from the internetlib library like Download() and SendEmail() are also mentioned. Examples are provided to demonstrate calculating hashes of strings using different hashing algorithms.
The Ring programming language version 1.5 book - Part 5 of 31Mahmoud Samir Fayed
Load the ODBC library. Initialize an ODBC connection handle. Connect to a data source using the handle. Execute SQL statements and process the results. Close the ODBC connection when done.
Recentrer l'intelligence artificielle sur les connaissancesMathieu d'Aquin
The document appears to contain rules for assigning values to variables (x[n]) based on logical conditions. It includes 14 rules using comparisons of the variable values, logical operators, and numeric values. It also reports the training and test accuracies of the rules as 92.13% and 89.3% respectively.
How to Become a Tree Hugger: Random Forests and Predictive Modeling for Devel...Matt Harrison
Python makes data science easy. In this deck we walk through a complete example of creating and evaluating a predictive model using Decision Trees and Random Forests. All of the code is included in the slides.
The document discusses various techniques in Django including:
- Using model inheritance and mixins to add common fields and functionality to models
- Monkey patching the model save method to add additional keyword arguments
- Handling null values across deep dictionary lookups
- Using locals() to pass additional context when rendering templates
- Defining choices as classes to avoid hardcoding in models
- Adding operators to choice values to customize display
- Conditionally including fields and methods based on settings
- Injecting context from other files using execfile
Analysis of Fatal Utah Avalanches with Python. From Scraping, Analysis, to In...Matt Harrison
I gave this presentation at Code Camp. As a data scientist and backcountry skier, I was interested in looking at fatal avalanche data. This covers scraping the data, analysis with Python, pandas and IPython Notebook. The final result is an infographic
The Ring programming language version 1.2 book - Part 32 of 84Mahmoud Samir Fayed
The document discusses user registration and login functionality in Ring. It describes classes for users (Model, View & Controller), form views for registration and login, and code to handle registration, login, and checking authentication. It also summarizes classes for database access (Database), model objects (ModelBase), and controllers (ControllerBase).
Manchester Social Media Surgery Events: an IntroductionChi-chi Ekweozor
A slide deck documenting our discussions about monthly Manchester Social Media Surgery events at Social Media Cafe Manchester, #smc_mcr on 1st Dec 2009.
The document discusses using social media for marketing. It provides examples of how businesses and individuals have used social media successfully. Some key points covered include:
- Social media allows for two-way interaction between brands and customers as opposed to traditional one-way broadcast media.
- Major social media platforms like Facebook have grown rapidly, with 18 million UK users on Facebook alone last month.
- Case studies are presented showing how a movie studio used social media to build an audience for a film and how artists have promoted and sold their work online.
- Tips are provided on setting up social media profiles and engaging with audiences. The importance of listening to customers and giving credit to others is stressed.
MobiWeb provides two-factor authentication through one-time PINs (OTPs) sent via SMS. This adds security over simple usernames and passwords and helps reduce fraud. The process works by MobiWeb generating an OTP when a user tries to login, sending it via SMS to the user's phone, and validating the OTP when the user enters it. This solution has benefits like increased security, reduced fraud losses, and a better customer experience compared to hardware tokens. MobiWeb has been providing global SMS services since 1999 through direct connections to mobile networks worldwide.
Bootstrap |> Elixir - Easy fun for busy developersDavid Schmitz
The document provides an overview of the Elixir programming language. It discusses key features of Elixir like processes, concurrency, fault tolerance using supervision trees, and distribution across nodes. It also briefly compares Elixir to other languages like Ruby, Erlang, and Clojure, highlighting reasons why one may choose each. The document demonstrates concepts like GenServers, testing with ExUnit, and macros. Overall it promotes Elixir as a good choice for building scalable and fault tolerant applications.
Flowex: Flow-Based Programming with Elixir GenStage - Anton MishchukElixir Club
This document discusses flow-based programming (FBP) and how it can be implemented using Elixir and the Flowex library. FBP defines applications as networks of independent processes that exchange data via message passing. Railway-oriented programming (ROP) is a design pattern that structures programs as a sequence of functions that pass data along. Railway FBP combines these concepts by implementing each function as an independent process. The Flowex library allows defining Elixir modules as processing pipelines and running them concurrently using GenStage to enable parallelism. It provides an easy way to build reusable and independently running process components.
Bottleneck in Elixir Application - Alexey Osipenko Elixir Club
This document appears to be a presentation in a foreign language (not English) about performance bottlenecks in Elixir applications. It introduces the presenter, Alexey, and mentions that while Elixir has advantages over JavaScript for asynchronous programming, high loads can still cause performance problems. It concludes by thanking the audience and providing Alexey's contact information.
The document discusses concurrency in Elixir using OTP (Open Telecom Platform). OTP provides libraries and design principles for writing concurrent applications in Erlang/Elixir. It includes components like supervisors, applications, agents, tasks and GenServers that help manage concurrency. Supervisors oversee worker processes in a supervision tree, restarting them based on configured restart strategies if they fail. State is managed by agents and GenServers. This allows applications to have many concurrent processes that are fault tolerant and can seamlessly spread across machines.
Elixir Elevated: The Ups and Downs of OTP at ElixirConf2014Greg Vaughn
The document discusses OTP (Open Telecom Platform) and Elixir. It provides an overview of OTP including that it is mature, battle tested for 16-18 years, and uses actors, object orientation, and design patterns. It then discusses behaviors and callback modules in OTP, the importance of initialization steps and parameter/return value contracts, using supervisors and strategies, and handling failures in Elixir applications. Code examples are provided for GenServers and supervisors.
The document provides an introduction to Elixir and OTP (Open Telecom Platform). It discusses key aspects of Elixir including its functional and meta-programming capabilities. It also covers OTP including processes as the concurrency model, and common behaviors like GenServer, Supervisor, and Application. GenServer is used for building servers, Supervisor supervises child processes, and Application initializes everything at the top level. Overall the document serves as a high-level overview of the Elixir language and OTP framework for building distributed, fault-tolerant applications.
The document describes setting up an Elixir project to perform optical character recognition (OCR) using the Google Vision API. It goes through initializing a new Mix project, adding dependencies like Credo for code analysis and HTTPoison for making HTTP requests, and creating modules to call the Google Vision API and provide a facade. Code examples are provided for creating a GoogleVision module that handles making requests to Google Vision and extracting text from responses. The overall goal is to build an OCR module that extracts quotes from memes by leveraging the Google Vision API.
This talk explains how to deploy Elixir in a real-world production setting, including releases, rolling and hot upgrades, rollbacks, clustering, and fault tolerance. Mentioned in detail are some of the numerous gotchas the Elixir developer may encounter on the way to creating a bulletproof service.
Elixir – Peeking into Elixir's Processes, OTP and SupervisorsBenjamin Tan
The document discusses key concepts in Elixir including processes, OTP framework, and supervisors. It provides an overview of processes as Elixir's basic concurrency primitive. It then explains OTP as a framework for building fault-tolerant and scalable applications, including behaviors like GenServer and common patterns. Finally, it covers supervisors and how they provide fault tolerance and recovery through restarting processes based on different strategies. Code examples are provided to demonstrate processes, GenServers, and supervisors.
A short introduction to Elixir presented by Chi-chi Ekweozor at Manchester UK's MadLab on 20 February.
Learn how to use the ubiquitous pipeline operator |> to consume functions as data, pattern matching, modules, lists and other language constructs.
Elixir is a functional programming language that is well-suited for building scalable and fault-tolerant applications. The document provides an introduction to Elixir by discussing its roots in Erlang and how it builds upon Erlang's strengths like concurrency, distribution, and fault tolerance. It also demonstrates some basic Elixir concepts like functions, pattern matching, recursion, and the BEAM virtual machine. Finally, it provides examples of real-world applications of Elixir like building Phoenix web applications and developing embedded hardware projects with Nerves.
Elixir is a dynamic, functional language designed for building scalable and maintainable applications. It leverages the Erlang VM, known for running low-latency, distributed and fault-tolerant systems. Elixir compiles to Erlang bytecode and provides developers' productivity through amazing tooling and documentation while enabling concurrency programming without locks or semaphores. The document then provides examples of Elixir types, functions, macros, and tools like Mix and Phoenix.
Haskell is a pure functional programming language that is statically typed and implements immutable data structures. It uses recursion extensively in place of loops. Some key features include:
- Functional programming with immutable values and functions as first-class citizens
- Static typing with type inference
- Recursion instead of loops for iteration
- List comprehensions and pattern matching
It has compilers like GHC and interpreters like Hugs. Code examples demonstrate list handling, recursion, and functional concepts like currying, partial application, and let/in bindings. Haskell has advantages for learning functional programming but also has disadvantages like initial complexity and lack of performance of other languages.
This document provides an introduction to the Julia programming language. It discusses key features of Julia such as writing code that is readable like Python but runs as fast as C. Examples are given showing Julia's dynamic typing, numeric types, operators, control flow statements like if/else and while loops, and arrays. The document ends with a rock-paper-scissors game example that demonstrates functions, conditionals, and refactoring code for simplicity.
A slightly-modified version of my IPRUG talk, this time for the BT DevCon5 developer conference at Adastral Park on 25 May 2012.
The main changes are the addition of the Ruby section and the increased number of HHGTTG references in honour of towel day.
This document provides an overview of key Java concepts including:
- Java is an object-oriented, platform-independent programming language similar to C++ in syntax. It was developed by Sun Microsystems.
- Java features include automatic memory management, type safety, multi-threading, and network programming capabilities. Code is compiled to bytecode that runs on the Java Virtual Machine.
- Core Java concepts discussed include primitive types, variables, operators, control flow statements, methods, classes, objects, arrays, inheritance, polymorphism and encapsulation.
- Additional topics covered are packages, access modifiers, constructors, overloading, overriding, and inner classes.
Technical operations is plagued with an unhealthy infatuation of typically untested, imperative code with a high reliance on shared mutable state using dynamically typed languages such as Ruby, Python, Bash, and - ugh - remember Perl? :) In an age where building reliable infrastructure to elastically scale applications and services are paramount to business success, we need to start rethinking the infrastructure engineer’s toolkit and guiding principles. This talk will take a look at applying various functional techniques to building and automating infrastructure. From functional package management and congruent configuration to declarative cloud provisioning we’ll see just how practical these techniques typically used in functional programming for applications can be used to help build more robust and predictable infrastructures. While specific code examples will be given, the emphasis of the talk will be on guiding principles and functional design.
This document provides an introduction to the R programming language. It discusses R as both a statistical analysis tool and a programming language. Key aspects of R covered include interacting with R in an interactive way, assigning variables and basic data types like vectors and factors, performing basic statistics and visualization, and R's object-oriented programming approach with generic functions and class-specific methods. Examples are provided throughout to demonstrate basic R syntax and capabilities.
This document provides an introduction and overview of Matlab. It discusses (1) vectors, matrices and arithmetic operations in Matlab, (2) plotting functions, and (3) flow control structures like if/else statements and for loops. Some key aspects covered include how to define vectors and matrices, perform element-wise and standard matrix operations, create plots of data, and write programs with basic programming constructs. The document also lists some useful Matlab commands and functions.
This document provides an introduction and overview of Matlab. It discusses (1) vectors, matrices and arithmetic operations in Matlab, (2) plotting capabilities, and (3) flow control structures like if/else statements and for loops. Some key aspects covered include how to define vectors and matrices, perform element-wise and standard matrix operations, create plots of data, and write programs with basic programming constructs. The document also provides examples of plotting commands and symbolic math operations in Matlab.
This document compares and contrasts Clojure and Elixir programming languages. It provides an overview of their origins, syntax, concurrency models, macro systems, and further reading recommendations. Key points include Clojure running on the JVM while Elixir runs on the BEAM VM, both having Lisp-like syntax with differences in collection types, and both supporting metaprogramming through macros while having different macro expansion approaches.
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.
Presentation given at the 2013 Clojure Conj on core.matrix, a library that brings muli-dimensional array and matrix programming capabilities to Clojure
Parallel R in snow (english after 2nd slide)Cdiscount
This presentation discusses parallelizing computations in R using the snow package. It demonstrates how to:
1. Create a cluster with multiple R sessions using makeCluster()
2. Split data across the sessions using clusterSplit() and export data to each node
3. Write functions to execute in parallel on each node using clusterEvalQ()
4. Collect the results, such as by summing outputs, to obtain the final parallelized computation. As an example, it shows how to parallelize the likelihood calculation for a probit regression model, reducing the computation time.
Introducing Elixir and OTP at the Erlang BASHdevbash
This document provides an overview of Elixir and OTP (Open Telephony Platform). It defines Elixir as a dynamic, functional language designed for building scalable applications that leverages the Erlang VM. It discusses some key aspects of Elixir including Mix for project management, macros, protocols, and pipelines. It also covers OTP principles like behaviors, supervision trees, and error handling. Common patterns in Elixir like GenServers, Agents, Tasks and Task Supervisors are explained.
- Install Python 2.5 or 2.6 and SQLAlchemy 0.5 using easy_install
- Michael Bayer created SQLAlchemy and is a software architect in New York City
- SQLAlchemy allows modeling database queries and relationships between objects in a more Pythonic way compared to raw SQL
This document provides an overview of using Clojure for data science. It discusses why Clojure is suitable for data science due to its functional programming capabilities, performance on the JVM, and rich library ecosystem. It introduces core.matrix, a Clojure library that provides multi-dimensional array programming functionality through Clojure protocols. The document covers core.matrix concepts like array creation and manipulation, element-wise operations, broadcasting, and optional support for mutability. It also discusses core.matrix implementation details like the performance benefits of using Clojure protocols.
This document provides an overview of the Python programming language. It begins with an introduction to running Python code and output. It then covers Python's basic data types like integers, floats, strings, lists, tuples and dictionaries. The document explains input and file I/O in Python as well as common control structures like if/else statements, while loops and for loops. It also discusses functions as first-class objects in Python that can be defined and passed as parameters. The document provides examples of higher-order functions like map, filter and reduce. Finally, it notes that functions can be defined inside other functions in Python.
This document provides an overview of the Elixir ecosystem, fundamental concepts, and runtime. It discusses key tools like IEx, Mix, and Hex. It covers naming conventions, modules, functions, pattern matching, control flow, and error handling. It also describes fundamental Elixir types like strings, lists, tuples, maps, and structs. Finally, it provides an introduction to the BEAM virtual machine and Elixir processes.
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
E-commerce Application Development Company.pdfHornet Dynamics
Your business can reach new heights with our assistance as we design solutions that are specifically appropriate for your goals and vision. Our eCommerce application solutions can digitally coordinate all retail operations processes to meet the demands of the marketplace while maintaining business continuity.
SOCRadar's Aviation Industry Q1 Incident Report is out now!
The aviation industry has always been a prime target for cybercriminals due to its critical infrastructure and high stakes. In the first quarter of 2024, the sector faced an alarming surge in cybersecurity threats, revealing its vulnerabilities and the relentless sophistication of cyber attackers.
SOCRadar’s Aviation Industry, Quarterly Incident Report, provides an in-depth analysis of these threats, detected and examined through our extensive monitoring of hacker forums, Telegram channels, and dark web platforms.
Takashi Kobayashi and Hironori Washizaki, "SWEBOK Guide and Future of SE Education," First International Symposium on the Future of Software Engineering (FUSE), June 3-6, 2024, Okinawa, Japan
WhatsApp offers simple, reliable, and private messaging and calling services for free worldwide. With end-to-end encryption, your personal messages and calls are secure, ensuring only you and the recipient can access them. Enjoy voice and video calls to stay connected with loved ones or colleagues. Express yourself using stickers, GIFs, or by sharing moments on Status. WhatsApp Business enables global customer outreach, facilitating sales growth and relationship building through showcasing products and services. Stay connected effortlessly with group chats for planning outings with friends or staying updated on family conversations.
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
Unveiling the Advantages of Agile Software Development.pdfbrainerhub1
Learn about Agile Software Development's advantages. Simplify your workflow to spur quicker innovation. Jump right in! We have also discussed the advantages.
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemPeter Muessig
Learn about the latest innovations in and around OpenUI5/SAPUI5: UI5 Tooling, UI5 linter, UI5 Web Components, Web Components Integration, UI5 2.x, UI5 GenAI.
Recording:
https://www.youtube.com/live/MSdGLG2zLy8?si=INxBHTqkwHhxV5Ta&t=0
What is Augmented Reality Image Trackingpavan998932
Augmented Reality (AR) Image Tracking is a technology that enables AR applications to recognize and track images in the real world, overlaying digital content onto them. This enhances the user's interaction with their environment by providing additional information and interactive elements directly tied to physical images.
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Crescat
Crescat is industry-trusted event management software, built by event professionals for event professionals. Founded in 2017, we have three key products tailored for the live event industry.
Crescat Event for concert promoters and event agencies. Crescat Venue for music venues, conference centers, wedding venues, concert halls and more. And Crescat Festival for festivals, conferences and complex events.
With a wide range of popular features such as event scheduling, shift management, volunteer and crew coordination, artist booking and much more, Crescat is designed for customisation and ease-of-use.
Over 125,000 events have been planned in Crescat and with hundreds of customers of all shapes and sizes, from boutique event agencies through to international concert promoters, Crescat is rigged for success. What's more, we highly value feedback from our users and we are constantly improving our software with updates, new features and improvements.
If you plan events, run a venue or produce festivals and you're looking for ways to make your life easier, then we have a solution for you. Try our software for free or schedule a no-obligation demo with one of our product specialists today at crescat.io
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
Do you want Software for your Business? Visit Deuglo
Deuglo has top Software Developers in India. They are experts in software development and help design and create custom Software solutions.
Deuglo follows seven steps methods for delivering their services to their customers. They called it the Software development life cycle process (SDLC).
Requirement — Collecting the Requirements is the first Phase in the SSLC process.
Feasibility Study — after completing the requirement process they move to the design phase.
Design — in this phase, they start designing the software.
Coding — when designing is completed, the developers start coding for the software.
Testing — in this phase when the coding of the software is done the testing team will start testing.
Installation — after completion of testing, the application opens to the live server and launches!
Maintenance — after completing the software development, customers start using the software.
5. history
Joe designed erlang
in the 80s, when he
was an Ericsson
engineer, focusing on:
● Scalability
● Fault Tolerance
● Concurrency
6. history
● Moore’s law is almost
over, but it is too easy
to have multicore pc.
● Languages like
Python, Javascript or
Ruby can’t take
advantage of several
CPUs
7. history
Jose Valim tried to
improve Ruby on Rails
framework, but he could
not. Then, he discovered
how Erlang worked, but
he did not like the syntax,
therefore he decided to
create a new language
which will run in the
BEAM (Erlang Virtual
Machine).
12. control flow structures
Case compares a value against many patterns until we find a matching one:
iex> x = {1, 2, 3}
{1, 2, 3}
iex> case x do
...> {2, 3, 4} → “First option”
...> {1, _, 3} → “Second Option”
...> _ → “It always matches”
...> end
“Second Option”
iex> x = {1, 7, 3}
{1, 2, 3}
iex()> case x do
...> {2, 3, 4} → “First option”
...> {1, _, 3} → “Second Option”
...> _ → “It always matches”
...> end
“Second Option”
iex> x = {1, 2, 3}
{1, 2, 3}
iex> case x do
...> {2, 3, 4} → “First option”
...> {1, _, 3} → “Second Option”
...> _ → “It always matches”
...> end
“Second Option”
iex> x = {1, 7, 3}
{1, 2, 3}
iex()> case x do
...> {2, 3, 4} → “First option”
...> {1, _, 3} → “Second Option”
...> _ → “It always matches”
...> end
“Second Option”
You can also use guards in your pattern matching: {1, z, 3} when z > 0 → “guards !!!”
13. control flow structures
Cond allows us to check different conditions until we find the first true.
iex> x = {1, 2, 3}
{1, 2, 3}
iex> cond do
...> x == {2, 3, 4} → “First option”
...> is_list(x) → “It is a list !!”
...> 2 + 5 == x → “ it is 7 !!”
...> true → “It always matches”
...> end
“It always matches”
iex> x = {1, 2, 3}
{1, 2, 3}
iex> cond do
...> x == {2, 3, 4} → “First option”
...> is_list(x) → “It is a list !!”
...> 2 + 5 == x → “ it is 7 !!”
...> true → “It always matches”
...> end
“It always matches”
14. control flow structures
If and unless are macros, but you can normally use them ;).
iex> x = {1, 2, 3}
{1, 2, 3}
iex> if {1, 2, 3} == x do
...> “Yes, it is”
...> else
...> “No, it is not”
...> end
“Yes, it is”
iex> unless {1, 2, 3} == x do
...> “No, it is not”
...> else
...> “Yes, it is”
...> end
“Yes, it is”
iex> x = {1, 2, 3}
{1, 2, 3}
iex> if {1, 2, 3} == x do
...> “Yes, it is”
...> else
...> “No, it is not”
...> end
“Yes, it is”
iex> unless {1, 2, 3} == x do
...> “No, it is not”
...> else
...> “Yes, it is”
...> end
“Yes, it is”
15. functions
Functions are first citizens in elixir. Don’t forget the “.” if it is an anonymous one.
iex> square = fn x → x*x end
Function<6.52032458/1 in :erl_eval.expr/5>
iex> square.(2)
4
iex>my_very_difficult_algo = fn x -> square.(x) end
#Function<6.52032458/1 in :erl_eval.expr/5>
iex> my_very_difficult_algo.(2)
4
iex> square = fn x → x*x end
Function<6.52032458/1 in :erl_eval.expr/5>
iex> square.(2)
4
iex>my_very_difficult_algo = fn x -> square.(x) end
#Function<6.52032458/1 in :erl_eval.expr/5>
iex> my_very_difficult_algo.(2)
4
16. modules
The functions are grouped in Modules.
iex> defmodule MyCalculator do
...> def square(x) do
...> x * x
...> end
...> end
{:module, MyCalculator,
<<70, 79, 82, 49, 0, 0, 4, 212, 66, 69, 65, 77, 69,
120, 68, 99, 0, 0, 0, 147,
131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105,
114, 95, 100, 111, 99, 115,
95, 118, 49, 108, 0, 0, 0, 4, 104, 2, ...>>, {:square,
1}}
iex> MyCalculator.square(2)
4
iex> defmodule MyCalculator do
...> def square(x) do
...> x * x
...> end
...> end
{:module, MyCalculator,
<<70, 79, 82, 49, 0, 0, 4, 212, 66, 69, 65, 77, 69,
120, 68, 99, 0, 0, 0, 147,
131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105,
114, 95, 100, 111, 99, 115,
95, 118, 49, 108, 0, 0, 0, 4, 104, 2, ...>>, {:square,
1}}
iex> MyCalculator.square(2)
4
17. modules
Elixir has a lot of standard modules that you will take advantage of them.
● Enum
● List
● Map
● Stream
● String
● Integer
● Process
● ...
18. modules
But Elixir works in the BEAM, so we can also use all the standard modules of Erlang.
● :os
● :calendar
● :rand
● :ets
● :crypto
● :global
● ...
20. Processes
Elixir (and Erlang)
follows the actor
model paradigm.
● Every process (Erlang
process) has his own
mailbox and it
communicates using
messages
21. Processes
Self communication !!
iex> Process.send(self(), “Hello from Process.send()”, [])
iex> send(self(), “Hello send()”)
iex> receive do
...> msg → msg
...> end
"Hello from Process.send()"
iex> receive do
...> msg → msg
...> end
"Hello from send()"
iex> Process.send(self(), “Hello from Process.send()”, [])
iex> send(self(), “Hello send()”)
iex> receive do
...> msg → msg
...> end
"Hello from Process.send()"
iex> receive do
...> msg → msg
...> end
"Hello from send()"
22. Processes
Communication from outside !!
iex> spawn(fn -> send(parent, {:hello, self()}) end)
#PID<0.48.0>
iex> receive do
...> {:hello, pid} -> "Got hello from #{inspect pid}"
...> end
Got hello from #PID<0.48.0>
iex> spawn(fn -> send(parent, {:hello, self()}) end)
#PID<0.48.0>
iex> receive do
...> {:hello, pid} -> "Got hello from #{inspect pid}"
...> end
Got hello from #PID<0.48.0>
23. Processes
I highly recommend to use Task !!
iex> Task.start(fn -> send(parent, {:hello, self()}) end)
{:ok, #PID<0.48.0>}
iex> receive do
...> {:hello, pid} -> "Got hello from #{inspect pid}"
...> end
Got hello from #PID<0.48.0>
iex> task = Task.async(fn -> 2 + 2 end)
%Task{owner: #PID<0.80.0>, pid: #PID<0.82.0>, ref:
#Reference<0.0.1.211>}
iex> middle_sum = 3 + 5
8
iex> result = middle_sum + Task.await(task)
12
iex> Task.start(fn -> send(parent, {:hello, self()}) end)
{:ok, #PID<0.48.0>}
iex> receive do
...> {:hello, pid} -> "Got hello from #{inspect pid}"
...> end
Got hello from #PID<0.48.0>
iex> task = Task.async(fn -> 2 + 2 end)
%Task{owner: #PID<0.80.0>, pid: #PID<0.82.0>, ref:
#Reference<0.0.1.211>}
iex> middle_sum = 3 + 5
8
iex> result = middle_sum + Task.await(task)
12
24. processes
● Linked Processes: If one process dies, the other dies as well
●
Monitored Process: If a monitored process dies, the monitor process will receive a
notification.
● Linking: You can start a process with the function start_link() instead of start or just use
Process.link(pid) from one process indicating the pid of the other process.
● Monitoring: Execute Process.monitor(pid) from one process indicating the pid of the other process.
25.
26. scalability
We have already talk
about vertical
scalability, but I love
this gift
Vertical scalability
means: “If you have a
‘bigger’ server, your SW
will take advantage of
it.”
27. scalability
Vertical scalability can
reach some
limitations, but we
need to scale, the
solution can be
horizontal scalability,
or adding more
servers. It also
implies distribution.
28. fault tolerance
The only SW that has not bug is the SW that has
never been executed.
SWs which run indefinitely have to be fault tolerance.
The only SW that has no bug is the SW that has
never been executed.
SWs which run indefinitely have to be fault tolerance.
Really good
Exampe !!
29. concurrency
Although we are able
to scale in order to
use more CPU cores,
sure that you will
have more tasks than
cores, so you need
concurrency.
30. history
Having all this things in
mind, the Ericsson guys
developed OTP which
is a collection of useful
middle-ware, libraries,
and tools written in
Erlang programming
language.
Ericsson OTP Team
Twitter: @erlang_org
31. behaviours
Behaviours in Elixir (and Erlang) are a way to separate and abstract the generic part
of a component (which becomes the behaviour module) from the specific part (which
becomes the callback module).
The following are provided by OTP (and some new ones from Elixir):
● Supervisor
● GenServer
●
GenStage
● Agent
● GenEvent
32. behaviours
A Supervisor is a process which supervises other
processes, which are referred to as child processes. (Do
you remember the linking/monitoring actions?)
# Import helpers for defining supervisors
import Supervisor.Spec
# Supervise the Stack server which will be started with
# a single argument [:hello] and the default registered
# name of MyStack.
children = [
worker(MyProcess, [[:hello], [name: :my_process]])
]
# Start the supervisor with our child
{:ok, pid} = Supervisor.start_link(children, strategy:
:one_for_one)
# Import helpers for defining supervisors
import Supervisor.Spec
# Supervise the Stack server which will be started with
# a single argument [:hello] and the default registered
# name of MyStack.
children = [
worker(MyProcess, [[:hello], [name: :my_process]])
]
# Start the supervisor with our child
{:ok, pid} = Supervisor.start_link(children, strategy:
:one_for_one)
34. behaviours
A GenServer is a process like any other Elixir process and it can be used to
keep state, execute code asynchronously and other interesting stuffs providing
a standard set of interface functions and include functionality for tracing and
error reporting. It will also fit into a supervision tree.
defmodule Stack do
use GenServer
# Callbacks
def handle_call(:pop, _from, [h | t]) do
{:reply, h, t}
end
def handle_cast({:push, item}, state) do
{:noreply, [item | state]}
end
end
# Start the server
{:ok, pid} = GenServer.start_link(Stack, [:hello])
# This is the client
GenServer.call(pid, :pop)
#=> :hello
GenServer.cast(pid, {:push, :world})
#=> :ok
GenServer.call(pid, :pop)
#=> :world
defmodule Stack do
use GenServer
# Callbacks
def handle_call(:pop, _from, [h | t]) do
{:reply, h, t}
end
def handle_cast({:push, item}, state) do
{:noreply, [item | state]}
end
end
# Start the server
{:ok, pid} = GenServer.start_link(Stack, [:hello])
# This is the client
GenServer.call(pid, :pop)
#=> :hello
GenServer.cast(pid, {:push, :world})
#=> :ok
GenServer.call(pid, :pop)
#=> :world
35. behaviours
● GenStage provides the interface to create a distributed set
of producer, producer-consumer and consumer processes
with back-pressure mechanism. It is based on GenServer.
Producer
Consumer
Consumer
Consumer
Consumer
Prod-ConsProd-Cons
Prod-Cons
36. ets
ETS is a cache system which allows us to
store any Elixir term in an in-memory table.
iex> table = :ets.new(:my_table, [:named_table])
:my_table
iex> :ets.insert(table, {"foo", self})
true
iex> :ets.lookup(table, "foo")
[{"foo", #PID<0.80.0>}]
iex> :ets.delete(table, "foo")
true
iex> table = :ets.new(:my_table, [:named_table])
:my_table
iex> :ets.insert(table, {"foo", self})
true
iex> :ets.lookup(table, "foo")
[{"foo", #PID<0.80.0>}]
iex> :ets.delete(table, "foo")
true
37. mix
Mix is a build
tool that ships
with Elixir that
provides tasks
for creating,
compiling,
testing your
application,
managing its
dependencies
and much more
$> mix new my_project --sup
* creating README.md
* creating .gitignore
* creating mix.exs
* creating config
* creating config/config.exs
* creating lib
* creating lib/my_project.ex
* creating test
* creating test/test_helper.exs
* creating test/my_project_test.exs
Your Mix project was created
successfully.
You can use "mix" to compile it, test
it, and more:
cd my_project
mix test
Run "mix help" for more commands.
$> mix new my_project --sup
* creating README.md
* creating .gitignore
* creating mix.exs
* creating config
* creating config/config.exs
* creating lib
* creating lib/my_project.ex
* creating test
* creating test/test_helper.exs
* creating test/my_project_test.exs
Your Mix project was created
successfully.
You can use "mix" to compile it, test
it, and more:
cd my_project
mix test
Run "mix help" for more commands.
$> cat my_project/mix.exs
defmodule MyProject.Mixfile do
use Mix.Project
def project do
[app: :my_project,
version: "0.1.0",
elixir: "~> 1.3",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps()]
end
# Configuration for the OTP application
#
# Type "mix help compile.app" for more information
def application do
[applications: [:logger],
mod: {MyProject, []}]
end
# Dependencies can be Hex packages:
#
# {:mydep, "~> 0.3.0"}
#
# Or git/path repositories:
#
# {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag:
"0.1.0"}
#
# Type "mix help deps" for more examples and options
defp deps do
[]
end
end
$> cat my_project/mix.exs
defmodule MyProject.Mixfile do
use Mix.Project
def project do
[app: :my_project,
version: "0.1.0",
elixir: "~> 1.3",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps()]
end
# Configuration for the OTP application
#
# Type "mix help compile.app" for more information
def application do
[applications: [:logger],
mod: {MyProject, []}]
end
# Dependencies can be Hex packages:
#
# {:mydep, "~> 0.3.0"}
#
# Or git/path repositories:
#
# {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag:
"0.1.0"}
#
# Type "mix help deps" for more examples and options
defp deps do
[]
end
end