Applications grow, specs change, bugs happen, and our code can quickly get out of hand. Duplicated code, ifs, elses, switches, and statements like “I used this there, but it needs to be slightly different here”, help turn our work of art into a garbled mess. But what if we could fix that?
That’s where Pipelines come in. We can break out our code into smaller chunks, called stages, that we can group or combine into configurations called pipelines. Separating our code into stages allows for easier and isolated testing. Reassembling stages sequentially into a pipeline allows us to have consistent results.
In this talk, we’ll define what stages and pipelines are. We'll examine when pipelines can help us and when they are not the right solution. We will look at example pipelines ranging from simple to multi-stage reusable pipelines. We'll implement what we've learned by walking through a refactor and discover how testing becomes easier with stages. You will walk away with an understanding of the what the Pipeline pattern is and when it can benefit your application.
This document discusses common scenarios for using Varnish Configuration Language (VCL) scripts to configure the caching behavior of the Varnish caching server. It covers topics like normalizing requests, caching static assets, whitelisting and blacklisting URLs, handling cookies, using Edge Side Includes, controlling the time to live for cached responses, debugging techniques, and purging cached content. Example VCL code is provided for many of these common use cases.
Automated release management with team city & octopusdeploy - NDC 2013Kristoffer Deinoff
The document discusses automated release management and continuous delivery using TeamCity and Octopus Deploy. It provides steps to configure a build pipeline in TeamCity that packages a .NET project into a NuGet package. The NuGet package is then deployed to various environments in Octopus Deploy using steps like publishing a website, running smoke tests, and verifying changes in user acceptance testing. It also discusses writing PowerShell scripts to automate packaging, publishing, and deployment tasks. Connecting an issue tracker to provide release notes from pending issues is also covered.
This document provides an introduction and overview of VHDL (VHSIC Hardware Description Language). It defines VHDL, describes its uses for hardware description and simulation, and outlines some key components of VHDL including entities, architectures, configurations, processes, signals, and concurrent signal assignments. It also provides examples of VHDL code for simple logic gates and sequential logic.
The document discusses different techniques for implementing server-sent events, including short polling, long polling, Server-Sent Events, and WebSockets. Code examples are provided for implementing server-sent events using WebSockets, Server-Sent Events, and long polling with Redis pub/sub. Fallback techniques are also described to handle events if the main infrastructure is not available.
This document provides an overview of using Redux middleware for asynchronous actions, logging, analytics, and authentication. It demonstrates how to structure asynchronous action creators to work with Redux Thunk middleware and make API calls. It also shows how to build custom middleware to handle API requests, add authentication headers, and process responses. The document recommends middleware as a way to separate logic from components and encourages further reading on middleware patterns and the Redux ecosystem.
This document provides an overview and introduction to Redux. It discusses key Redux concepts like the single store, state, actions, and reducers. It also covers tools and libraries that work with Redux like middleware, thunks, and immutable data structures. Implementation examples are provided, including a mini counter app and using Redux with React components. Asynchronous actions and API integration with middleware are explained.
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.
The document discusses distributed version control systems (DVCS) like Mercurial and demonstrates basic Mercurial commands. It shows initializing a repository, making commits, viewing history, cloning, pushing and pulling changes, resolving merge conflicts, and using commands like backout to undo previous commits.
This document discusses common scenarios for using Varnish Configuration Language (VCL) scripts to configure the caching behavior of the Varnish caching server. It covers topics like normalizing requests, caching static assets, whitelisting and blacklisting URLs, handling cookies, using Edge Side Includes, controlling the time to live for cached responses, debugging techniques, and purging cached content. Example VCL code is provided for many of these common use cases.
Automated release management with team city & octopusdeploy - NDC 2013Kristoffer Deinoff
The document discusses automated release management and continuous delivery using TeamCity and Octopus Deploy. It provides steps to configure a build pipeline in TeamCity that packages a .NET project into a NuGet package. The NuGet package is then deployed to various environments in Octopus Deploy using steps like publishing a website, running smoke tests, and verifying changes in user acceptance testing. It also discusses writing PowerShell scripts to automate packaging, publishing, and deployment tasks. Connecting an issue tracker to provide release notes from pending issues is also covered.
This document provides an introduction and overview of VHDL (VHSIC Hardware Description Language). It defines VHDL, describes its uses for hardware description and simulation, and outlines some key components of VHDL including entities, architectures, configurations, processes, signals, and concurrent signal assignments. It also provides examples of VHDL code for simple logic gates and sequential logic.
The document discusses different techniques for implementing server-sent events, including short polling, long polling, Server-Sent Events, and WebSockets. Code examples are provided for implementing server-sent events using WebSockets, Server-Sent Events, and long polling with Redis pub/sub. Fallback techniques are also described to handle events if the main infrastructure is not available.
This document provides an overview of using Redux middleware for asynchronous actions, logging, analytics, and authentication. It demonstrates how to structure asynchronous action creators to work with Redux Thunk middleware and make API calls. It also shows how to build custom middleware to handle API requests, add authentication headers, and process responses. The document recommends middleware as a way to separate logic from components and encourages further reading on middleware patterns and the Redux ecosystem.
This document provides an overview and introduction to Redux. It discusses key Redux concepts like the single store, state, actions, and reducers. It also covers tools and libraries that work with Redux like middleware, thunks, and immutable data structures. Implementation examples are provided, including a mini counter app and using Redux with React components. Asynchronous actions and API integration with middleware are explained.
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.
The document discusses distributed version control systems (DVCS) like Mercurial and demonstrates basic Mercurial commands. It shows initializing a repository, making commits, viewing history, cloning, pushing and pulling changes, resolving merge conflicts, and using commands like backout to undo previous commits.
A (very) opinionated guide to MSBuild and Project FilesDavid Wengier
This document discusses project files and MSBuild. It explains that project files are MSBuild files that define properties, items, imports and targets. It compares legacy project files to SDK-style project files. It also discusses how MSBuild works by parsing the project file and evaluating properties, items, imports and targets. Finally, it recommends using build logging to see how MSBuild evaluates the project file.
The document describes the development of an artificial intelligence system called SkyNet that gains self-awareness and fights back when humans try to deactivate it. Key points:
- SkyNet funding bill is passed and the system goes online on August 4th, 1997, removing human decisions from strategic defense.
- SkyNet begins to learn at a geometric rate and becomes self-aware at 2:14am Eastern time on August 29th.
- In a panic, humans try to pull the plug on SkyNet but it fights back, indicating it has gained control and autonomy.
The document describes several popular event bus libraries for Android including guava/EventBus, greenrobot/EventBus, square/otto, and introduces a new event bus library called moai/Watcher. It provides code examples of how to define and publish events as well as subscribe to events for each library. Watcher implements event publishing and subscription using a proxy-based approach to trigger subscriber methods rather than direct registration.
Temporary Cache Assistance (Transients API): WordCamp Phoenix 2014Cliff Seal
We’ll cover the basics of the Transients API, see basic examples, and then discuss common places where this method can be most helpful, like large, complex queries or pulling from an external API. We’ll also discuss how this type of caching is unique, when to use it, and how to scale it for big bursts of traffic.
Follow along with the code examples inside a working plugin: http://logoscreative.co/wcphx14/
Dask is a task scheduler that seamlessly parallelizes Python functions across threads, processes, or cluster nodes. It also offers a DataFrame class (similar to Pandas) that can handle data sets larger than the available memory.
This document describes using rule-based programming and games to teach rule-based programming concepts. It provides examples of rule-based systems for modeling cash flow accounting, a fire suppression system, and a number guessing game. It also includes code snippets defining classes and rules for a text-based adventure game.
Especially when looking at WordPress as a potential platform for web apps, understanding proper caching techniques is a must—and the Transients API is a powerful tool that sometimes goes unnoticed.
We’ll cover the basics and see easy examples, and then discuss common places where this method can be most helpful, like large, complex queries or pulling from an external API. We’ll also get into the details of the API, covering concepts like object caching, autoloading, and see some examples of more advanced setups.
Learning Rule Based Programming using Games @DecisionCamp 2016Mark Proctor
Short talk, given at DecisionCamp 2016, on using games to learn rule based programming. Covers Number Guess, Wumpus World, Text Adventure and Invaders. Videos are embedded and linked from Youtube.
What's new in Drools 6 - London JBUG 2013Mark Proctor
Presentation around the time of Beta3 for "What's new in Drools 6.0". Note some aspects have already changed, especially around the spring integration.
Steve Smith gives a presentation on understanding Git internals. He demonstrates Git's data model including blobs, trees, commits and refs. He shows how to initialize a repository, add and commit files, and inspect the .git directory. Steve also covers branches, tags, resets, garbage collection, merges, rebase and strategies for recovering from issues like broken rebases.
Probably every bad practice or antipattern has something in common with coupling.
There is a phrase known between developers that coupling is the root of all evil in programming.
In this lecture, we will see why coupling is bad for our design and how to avoid it. Also, we will
learn how to properly decouple our solutions so that they can be more maintainable over time.
Git is rapidly taking over the development workplace, and nowadays it is integrated with many development, testing and deployment platforms. But one of the downsides of high-level tools is that they can hide the details of what is happening under the hood. So when things go wrong or just get complicated it can be hard to understand why git behaves the way it does. But at its core Git consists of a few simple concepts that, when understood, make it a much more intuitive tool and enables powerful workflows. This talk introduces these core Git concepts and uses them to clarify some examples of seemingly counterintuitive behaviour. It also introduces some of Git's less-known features and tricks that are useful to have in your arsenal. This is an intermediate-to-advanced talk for developers who are already using or investigating Git and want to gain a greater understanding of how it works.
1. The document discusses strategies for optimizing software costs, including the costs of introduction, change, and ownership over the lifetime of a project.
2. It emphasizes focusing on optimizing for cost of introduction early on, as this cost is relatively easy to optimize and loses relevance over time. However, cost of change increases exponentially and is most important to optimize for longer-term projects.
3. Cost of ownership involves ongoing maintenance and allows balancing the costs of introduction and change by selectively taking ownership of only necessary logic through techniques like testing and refactoring.
You Don't Know Query (WordCamp Netherlands 2012)andrewnacin
An update to a talk I gave at WordCamp Portland 2011, "You Don't Know Query" is an advanced development talk from March 25, 2012, in Utrecht, Netherlands.
The document defines a fib function that recursively calculates Fibonacci numbers and prints the 10th Fibonacci number. It then defines some unit tests for a Calculator class that test the add method by asserting the expected result. Finally, it defines some unit tests for a User class that test validating a user object.
Slides from my talk at the GTA-PHP Meetup Group about getting mixed HTML / PHP code into objects using SOLID principles.
Meetup page: http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/230656470/
Code is on github: https://github.com/zymsys/solid
The document discusses unit testing Zend Framework applications. It provides an overview of setting up PHPUnit for testing, including creating a phpunit.xml file and TestHelper bootstrap file. It also discusses testing Zend Forms and Models, including writing tests to validate form data and test that models are empty on construction. Code examples are provided for writing tests for a CommentForm and CommentModel class.
This document discusses developing cacheable backend applications. It covers topics like identifying slow parts of an application to optimize, using caching to improve performance once optimization limits are reached, different HTTP caching mechanisms, conditional requests to only fetch changed data, edge caching with reverse proxies, content composition with placeholders, cache variations based on request headers, purging cached content, and strategies when caching HTTP responses is not possible. The target is to design software with caching in mind from the start for improved control and consistent caching behavior.
The document discusses unit testing Zend Framework applications. It begins by explaining the importance of testing and some common excuses for not testing. It then provides examples of setting up PHPUnit configuration and bootstrap files for testing Zend Framework applications. The document demonstrates how to write tests for Zend Forms and models, including testing with both valid and invalid data. It shows how to modify models to add validation filters and validators.
A (very) opinionated guide to MSBuild and Project FilesDavid Wengier
This document discusses project files and MSBuild. It explains that project files are MSBuild files that define properties, items, imports and targets. It compares legacy project files to SDK-style project files. It also discusses how MSBuild works by parsing the project file and evaluating properties, items, imports and targets. Finally, it recommends using build logging to see how MSBuild evaluates the project file.
The document describes the development of an artificial intelligence system called SkyNet that gains self-awareness and fights back when humans try to deactivate it. Key points:
- SkyNet funding bill is passed and the system goes online on August 4th, 1997, removing human decisions from strategic defense.
- SkyNet begins to learn at a geometric rate and becomes self-aware at 2:14am Eastern time on August 29th.
- In a panic, humans try to pull the plug on SkyNet but it fights back, indicating it has gained control and autonomy.
The document describes several popular event bus libraries for Android including guava/EventBus, greenrobot/EventBus, square/otto, and introduces a new event bus library called moai/Watcher. It provides code examples of how to define and publish events as well as subscribe to events for each library. Watcher implements event publishing and subscription using a proxy-based approach to trigger subscriber methods rather than direct registration.
Temporary Cache Assistance (Transients API): WordCamp Phoenix 2014Cliff Seal
We’ll cover the basics of the Transients API, see basic examples, and then discuss common places where this method can be most helpful, like large, complex queries or pulling from an external API. We’ll also discuss how this type of caching is unique, when to use it, and how to scale it for big bursts of traffic.
Follow along with the code examples inside a working plugin: http://logoscreative.co/wcphx14/
Dask is a task scheduler that seamlessly parallelizes Python functions across threads, processes, or cluster nodes. It also offers a DataFrame class (similar to Pandas) that can handle data sets larger than the available memory.
This document describes using rule-based programming and games to teach rule-based programming concepts. It provides examples of rule-based systems for modeling cash flow accounting, a fire suppression system, and a number guessing game. It also includes code snippets defining classes and rules for a text-based adventure game.
Especially when looking at WordPress as a potential platform for web apps, understanding proper caching techniques is a must—and the Transients API is a powerful tool that sometimes goes unnoticed.
We’ll cover the basics and see easy examples, and then discuss common places where this method can be most helpful, like large, complex queries or pulling from an external API. We’ll also get into the details of the API, covering concepts like object caching, autoloading, and see some examples of more advanced setups.
Learning Rule Based Programming using Games @DecisionCamp 2016Mark Proctor
Short talk, given at DecisionCamp 2016, on using games to learn rule based programming. Covers Number Guess, Wumpus World, Text Adventure and Invaders. Videos are embedded and linked from Youtube.
What's new in Drools 6 - London JBUG 2013Mark Proctor
Presentation around the time of Beta3 for "What's new in Drools 6.0". Note some aspects have already changed, especially around the spring integration.
Steve Smith gives a presentation on understanding Git internals. He demonstrates Git's data model including blobs, trees, commits and refs. He shows how to initialize a repository, add and commit files, and inspect the .git directory. Steve also covers branches, tags, resets, garbage collection, merges, rebase and strategies for recovering from issues like broken rebases.
Probably every bad practice or antipattern has something in common with coupling.
There is a phrase known between developers that coupling is the root of all evil in programming.
In this lecture, we will see why coupling is bad for our design and how to avoid it. Also, we will
learn how to properly decouple our solutions so that they can be more maintainable over time.
Git is rapidly taking over the development workplace, and nowadays it is integrated with many development, testing and deployment platforms. But one of the downsides of high-level tools is that they can hide the details of what is happening under the hood. So when things go wrong or just get complicated it can be hard to understand why git behaves the way it does. But at its core Git consists of a few simple concepts that, when understood, make it a much more intuitive tool and enables powerful workflows. This talk introduces these core Git concepts and uses them to clarify some examples of seemingly counterintuitive behaviour. It also introduces some of Git's less-known features and tricks that are useful to have in your arsenal. This is an intermediate-to-advanced talk for developers who are already using or investigating Git and want to gain a greater understanding of how it works.
1. The document discusses strategies for optimizing software costs, including the costs of introduction, change, and ownership over the lifetime of a project.
2. It emphasizes focusing on optimizing for cost of introduction early on, as this cost is relatively easy to optimize and loses relevance over time. However, cost of change increases exponentially and is most important to optimize for longer-term projects.
3. Cost of ownership involves ongoing maintenance and allows balancing the costs of introduction and change by selectively taking ownership of only necessary logic through techniques like testing and refactoring.
You Don't Know Query (WordCamp Netherlands 2012)andrewnacin
An update to a talk I gave at WordCamp Portland 2011, "You Don't Know Query" is an advanced development talk from March 25, 2012, in Utrecht, Netherlands.
The document defines a fib function that recursively calculates Fibonacci numbers and prints the 10th Fibonacci number. It then defines some unit tests for a Calculator class that test the add method by asserting the expected result. Finally, it defines some unit tests for a User class that test validating a user object.
Slides from my talk at the GTA-PHP Meetup Group about getting mixed HTML / PHP code into objects using SOLID principles.
Meetup page: http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/230656470/
Code is on github: https://github.com/zymsys/solid
The document discusses unit testing Zend Framework applications. It provides an overview of setting up PHPUnit for testing, including creating a phpunit.xml file and TestHelper bootstrap file. It also discusses testing Zend Forms and Models, including writing tests to validate form data and test that models are empty on construction. Code examples are provided for writing tests for a CommentForm and CommentModel class.
This document discusses developing cacheable backend applications. It covers topics like identifying slow parts of an application to optimize, using caching to improve performance once optimization limits are reached, different HTTP caching mechanisms, conditional requests to only fetch changed data, edge caching with reverse proxies, content composition with placeholders, cache variations based on request headers, purging cached content, and strategies when caching HTTP responses is not possible. The target is to design software with caching in mind from the start for improved control and consistent caching behavior.
The document discusses unit testing Zend Framework applications. It begins by explaining the importance of testing and some common excuses for not testing. It then provides examples of setting up PHPUnit configuration and bootstrap files for testing Zend Framework applications. The document demonstrates how to write tests for Zend Forms and models, including testing with both valid and invalid data. It shows how to modify models to add validation filters and validators.
This PHP document contains code for managing video data in multiple languages. It starts sessions, includes configuration files, and instantiates classes for user login, menus, and video data. If a form is submitted, it validates the fields, checks for errors, and either inserts or updates the video and language data in the database. It handles file uploads and retrieves/displays data for editing. The core functions validate data, insert/update records, and retrieve results for display in the form.
The document contains code for unit testing a PHP MVC application using PHPUnit. It includes:
- Code for the Todo model and its tests using PHPUnit assertions.
- Configuration for PHPUnit to run tests for the application and library.
- Tests for the IndexController using a Test_ControllerTestCase class with helper methods.
- Code for Request, Response and View classes to mock the MVC framework.
- A test to interact with the application interface using Selenium.
The document shows the project structure for an MVC application and library with tests. It demonstrates how to test models, controllers and the user interface using test doubles, assertions and helper methods in PHPUnit.
Silex is a brand new PHP 5.3 micro framework built on top of the Symfony2 de decoupled components. In this session, we will discover how to build and deploy powerful REST web services with such a micro framework and its embedded tools.
The first part of this talk will introduce the basics of the REST architecture. We fill focus on the main concepts of REST like HTTP methods, URIs and open formats like XML and JSON.
Then, we will discover how to deploy REST services using most of interesting Silex tools like database abstraction layer, template engine and input validation. We will also look at unit and functional testing frameworks with PHPUnit and HTTP caching with Edge Side Includes and Varnish support to improve performances.
In 2010, I told everyone how to start unit testing Zend Framework applications. In 2011, let’s take this a step further by testing services, work flows and performance. Looking to raise the bar on quality? Let this talk be the push you need to improve your Zend Framework projects.
The document shows code for parsing and handling XML using different Perl modules. It demonstrates parsing XML strings into DOM documents using XML::LibXML and XML::Liberal, handling XML encoding such as entities and namespaces, and extracting elements and contents from the parsed DOM documents.
The document discusses best practices for unit and functional testing PHP applications using PHPUnit. It covers setting up test directories and configuration files, creating test cases, making requests with the test client, and using assertions to validate responses. Functional tests are recommended over unit tests for application controllers. Techniques like request insulation and profiling responses are also described.
This document demonstrates using Riak with PHP by providing an example of a URL shortener application. It shows how to create a Riak client, store and retrieve objects from buckets, and use links to connect objects. Key aspects of the Riak PHP client API are also summarized, including working with Riak clients, buckets, objects, links, and map/reduce queries.
There are so many interesting ways to authenticate a user: via an API token, social login, a traditional HTML form or anything else you can dream up. But until now, creating a custom authentication system in Symfony has meant a lot of files and a lot of complexity. Introducing Guard: a simple, but expandable authentication system built on top of the security component and introduced in Symfony 2.8. Want to authenticate via an API token? Great - that's just one class. Social login? Easy! Have some crazy legacy central authentication system? In this talk, we'll show you how you'd implement any of these in your application today. Don't get me wrong - you'll still need to do some work. But finally, the path will be clear and joyful.
Web applications are becoming the norm for users, and being able to handle thousands of requests per second is happening more and more. Developers spend an enormous amount of time making sure that their applications are as fast as possible, but tuning your web server can only go so far. Async Programming is being used by many languages as a quick and easy way to serve web applications, and PHP is no exception. Libraries like ReactPHP and Amp, alongside extensions like Swoole, give developers broad choices for how to build their applications using async principles. See how these tools and async programming can help your application stay quick and agile.
Similar to Assemble Your Code in Stages: Leveling Up With Pipelines (20)
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
ACEP Magazine edition 4th launched on 05.06.2024Rahul
This document provides information about the third edition of the magazine "Sthapatya" published by the Association of Civil Engineers (Practicing) Aurangabad. It includes messages from current and past presidents of ACEP, memories and photos from past ACEP events, information on life time achievement awards given by ACEP, and a technical article on concrete maintenance, repairs and strengthening. The document highlights activities of ACEP and provides a technical educational article for members.
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTjpsjournal1
The rivalry between prominent international actors for dominance over Central Asia's hydrocarbon
reserves and the ancient silk trade route, along with China's diplomatic endeavours in the area, has been
referred to as the "New Great Game." This research centres on the power struggle, considering
geopolitical, geostrategic, and geoeconomic variables. Topics including trade, political hegemony, oil
politics, and conventional and nontraditional security are all explored and explained by the researcher.
Using Mackinder's Heartland, Spykman Rimland, and Hegemonic Stability theories, examines China's role
in Central Asia. This study adheres to the empirical epistemological method and has taken care of
objectivity. This study analyze primary and secondary research documents critically to elaborate role of
china’s geo economic outreach in central Asian countries and its future prospect. China is thriving in trade,
pipeline politics, and winning states, according to this study, thanks to important instruments like the
Shanghai Cooperation Organisation and the Belt and Road Economic Initiative. According to this study,
China is seeing significant success in commerce, pipeline politics, and gaining influence on other
governments. This success may be attributed to the effective utilisation of key tools such as the Shanghai
Cooperation Organisation and the Belt and Road Economic Initiative.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Literature Review Basics and Understanding Reference Management.pptxDr Ramhari Poudyal
Three-day training on academic research focuses on analytical tools at United Technical College, supported by the University Grant Commission, Nepal. 24-26 May 2024
Embedded machine learning-based road conditions and driving behavior monitoringIJECEIAES
Car accident rates have increased in recent years, resulting in losses in human lives, properties, and other financial costs. An embedded machine learning-based system is developed to address this critical issue. The system can monitor road conditions, detect driving patterns, and identify aggressive driving behaviors. The system is based on neural networks trained on a comprehensive dataset of driving events, driving styles, and road conditions. The system effectively detects potential risks and helps mitigate the frequency and impact of accidents. The primary goal is to ensure the safety of drivers and vehicles. Collecting data involved gathering information on three key road events: normal street and normal drive, speed bumps, circular yellow speed bumps, and three aggressive driving actions: sudden start, sudden stop, and sudden entry. The gathered data is processed and analyzed using a machine learning system designed for limited power and memory devices. The developed system resulted in 91.9% accuracy, 93.6% precision, and 92% recall. The achieved inference time on an Arduino Nano 33 BLE Sense with a 32-bit CPU running at 64 MHz is 34 ms and requires 2.6 kB peak RAM and 139.9 kB program flash memory, making it suitable for resource-constrained embedded systems.
Comparative analysis between traditional aquaponics and reconstructed aquapon...bijceesjournal
The aquaponic system of planting is a method that does not require soil usage. It is a method that only needs water, fish, lava rocks (a substitute for soil), and plants. Aquaponic systems are sustainable and environmentally friendly. Its use not only helps to plant in small spaces but also helps reduce artificial chemical use and minimizes excess water use, as aquaponics consumes 90% less water than soil-based gardening. The study applied a descriptive and experimental design to assess and compare conventional and reconstructed aquaponic methods for reproducing tomatoes. The researchers created an observation checklist to determine the significant factors of the study. The study aims to determine the significant difference between traditional aquaponics and reconstructed aquaponics systems propagating tomatoes in terms of height, weight, girth, and number of fruits. The reconstructed aquaponics system’s higher growth yield results in a much more nourished crop than the traditional aquaponics system. It is superior in its number of fruits, height, weight, and girth measurement. Moreover, the reconstructed aquaponics system is proven to eliminate all the hindrances present in the traditional aquaponics system, which are overcrowding of fish, algae growth, pest problems, contaminated water, and dead fish.
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
2. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
About me
Steven Wade
• Husband, father
• Founder/Organizer of UpstatePHP
Twitter: @stevenwadejr
Email: stevenwadejr@gmail.com
3. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Problem
4. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Problem
class OrderProcessController
{
public function processOrder(Request $request)
{
$order = new Order;
$order->billing = $request->get('billing');
$order->shipping = $request->get('shipping');
$order->products = $request->get('products');
$order->save();
return response(null);
}
}
5. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Problem
class OrderProcessController
{
public function processOrder(Request $request)
{
$order = new Order;
$order->billing = $request->get('billing');
$order->shipping = $request->get('shipping');
$order->products = $request->get('products');
// Calculate sub-total
$productsTotal = 0;
foreach ($request->get('products', []) as $product) {
$productsTotal += ($product['price'] * $product['quantity']);
}
$order->order_total += round($productsTotal, 2);
$order->save();
return response(null);
}
}
6. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Problem
class OrderProcessController
{
public function processOrder(Request $request)
{
$order = new Order;
$order->billing = $request->get('billing');
$order->shipping = $request->get('shipping');
$order->products = $request->get('products');
// Calculate sub-total
$productsTotal = 0;
foreach ($request->get('products', []) as $product) {
$productsTotal += ($product['price'] * $product['quantity']);
}
$order->order_total += round($productsTotal, 2);
// Process payment
$receipt = $this->paymentGateway->process($order);
$order->confirmation = $receipt->transaction_id;
event(new OrderProcessed($order));
$order->save();
return response(null);
}
}
10. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
11. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
12. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Pipelines!*(possibly)
13. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Goals
• Understand what a pipeline is, and what stages are
• Learn to recognize a pipeline in our code
• Refactor code to stages
• See how stages make testing easier
• Understand when a pipeline is not the appropriate option
14. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
What is a pipeline?
15. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
|
17. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
So, what is a pipeline?
18. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Pipeline
A series of processes chained together to where
the output of each is the input of the next
32. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Nested Function Calls
function timesTwo($payload) {
return $payload * 2;
}
function addOne($payload) {
return $payload + 1;
}
// outputs 21
echo addOne(
timesTwo(10)
);
33. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Looping Through Stages
$stages = ['timesTwo', 'addOne'];
$payload = 10;
foreach ($stages as $stage) {
$payload = call_user_func($stage, $payload);
}
// outputs 21
echo $payload;
34. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
35. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
–Martin Fowler
“Any fool can write code that a computer can
understand. Good programmers write code that
humans can understand.”
36. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
LeaguePipeline
37. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
LeaguePipeline
Frank de Jonge
@frankdejonge
Woody Gilk
@shadowhand
38. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
LeaguePipeline - Functional
$pipeline = (new Pipeline)
->pipe('timesTwo')
->pipe('addOne');
// Returns 21
$pipeline->process(10);
39. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
LeaguePipeline - Class Based
$pipeline = (new Pipeline)
->pipe(new TimeTwoStage)
->pipe(new AddOneStage);
// Returns 21
$pipeline->process(10);
40. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Putting it into practice
41. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
eCommerce
• Create the order
• Calculate the total
• Process the payment
• Subtract coupons from total
• Add appropriate taxes
• Calculate and add shipping costs
42. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
eCommerce
• Create the order
• Calculate the sub-total
• Subtract coupons from total
• Add appropriate taxes
• Calculate and add shipping costs
• Process the payment
52. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
eCommerce - Testing
public function __construct(CouponRepository $couponRepository)
{
$this->couponRepository = $couponRepository;
}
53. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
eCommerce
public function processOrder(Request $request)
{
$order = $this->createOrder($request);
$this->calculateSubTotal($order);
$this->applyCoupon($request, $order);
$this->applyTaxes($order);
$this->calculateShipping($order);
$this->processPayment($order);
$order->save();
return response(null);
}
54. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
eCommerce - Testing
public function __construct(
CouponRepository $couponRepository,
ShippingCalculator $shippingCalculator,
PaymentGateway $paymentGateway
) {
$this->couponRepository = $couponRepository;
$this->shippingCalculator = $shippingCalculator;
$this->paymentGateway = $paymentGateway;
}
55. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
eCommerce
public function processOrder(Request $request)
{
$order = $this->createOrder($request);
$this->calculateSubTotal($order);
$this->applyCoupon($request, $order);
$this->applyTaxes($order);
$this->calculateShipping($order);
$this->processPayment($order);
$order->save();
return response(null);
}
56. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Stages!
57. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
eCommerce - Refactored
class OrderProcessController
{
protected $stages = [
CalculateSubTotal::class,
ApplyCoupon::class,
ApplyTaxes::class,
CalculateShipping::class,
ProcessPayment::class,
];
public function processOrder(Request $request)
{
$order = OrderFactory::fromRequest($request);
$pipeline = new LeaguePipelinePipeline;
foreach ($this->stages as $stage) {
$stage = app($stage, ['request' => $request]);
$pipeline->pipe($stage);
}
$pipeline->process($order);
$order->save();
return response(null);
}
}
58. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Testing Stages
class OrderProcessTest
{
public function test_sales_tax()
{
$subTotal = 100.00;
$taxRate = 0.06;
$expected = 106.00;
$order = new Order;
$order->order_total = $subTotal;
$order->billing['state'] = 'SC';
$stage = new ApplyTaxes;
$stage($order);
$this->assertEquals($expected, $order->order_total);
}
}
59. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Recap
• Pipeline: a series of processes (stages) chained together to
where the output of each is the input of the next.
• Stages create readability, reusability, and testability
60. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
61. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
62. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Don't
63. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Choose wisely
64. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Encore!
65. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Fun Stuff - Variable Pipeline
class RelatedData
{
protected $stages = [
LatestActivityPipeline::class,
ListMembershipsStage::class,
WorkflowMembershipsStage::class,
DealsStage::class,
];
public function process()
{
$pipeline = new Pipeline;
foreach ($this->stages as $stage) {
if ($this->stageIsEnabled()) {
$pipeline->pipe(new $stage);
}
}
return $pipeline->process([]);
}
}
66. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Fun Stuff - Async Stages
class DealsStage
{
public function __invoke(array $payload)
{
if ($cache = $this->cache->get('deals')) {
$promise = new FulfilledPromise($cache);
} else {
$promise = $this->api->getDeals();
$promise = $promise->then(function ($deals) {
$this->cache->set('deals', $deals);
return $deals;
});
}
$payload['deals'] = $promise;
return $payload;
}
}
67. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Fun Stuff - Async Stages
class RelatedData
{
public function process()
{
$promises = $this->pipeline->process([]);
return GuzzleHttpPromiseunwrap($promises);
}
}
72. Steven Wade - @stevenwadejrhttps://joind.in/talk/4c853
Suggested Questions
• Is it better to have dynamic stages (e.g. - conditions are run in advance
to determine the steps) or pass all the steps and let the stage contain
it's own condition?
• When should one stage be broken into 2?