The document describes refactoring legacy code for a push notification daemon. It starts with a single long method that handles both pushing notifications to a queue and processing incoming requests over UDP. It goes through a series of refactoring steps like extracting methods, extracting classes, and replacing methods with objects to break the class into separate concerns and make it more extensible and maintainable. This includes creating separate Worker, UDPServer, and PushDaemon classes with clear responsibilities.
Building Your First Data Science Applicatino in MongoDBMongoDB
Speaker: Robyn Allen, Software Engineer, Central Inventions
Level: 100 (Beginner)
Track: Tutorials
To provide a hands-on opportunity to work with real data, this session will center around a web-hosted quiz application which helps students practice math and memorize vocabulary. After experimenting with a small demonstration dataset (generated by each individual during the workshop), attendees will be guided through working with an anonymized dataset in MongoDB. No prior MongoDB experience is required but attendees are expected to download and install MongoDB Community Edition (available for free from mongodb.com) and have a working Python 3 environment of their choice (e.g., IDLE, free from python.org) installed on a laptop they bring to the workshop.
Prerequisites:
Attendees are expected to bring a laptop with the following software installed:
MongoDB 3.4.x Community Edition
The text editor or IDE of their choice
A working Python 3 environment of their choice
No prior MongoDB experience is required.
What You Will Learn:
- How to load a CSV file into MongoDB using mongoimport and then write queries (using the Mongo shell) to ensure the data appears as expected. Attendees will use a demo version of an online quiz app to generate a small data file of raw session data (which can be accessed via http://strawnoodle.com/api/testdata after logging in to the demo app and answering one or more quiz questions about MongoDB). After studying how the demo app stores session data, attendees will practice using mongoimport to import anonymized session data (provided during the workshop) into MongoDB.
- How to use the aggregation pipeline (in PyMongo) to implement more complicated queries and gain insights from data. Because the sample dataset contains data from a variety of users of different skill levels, queries can be designed which reveal summary statistics for the anonymous user cohort or specific performance of individual users. Participants will receive instruction in using MongoDB aggregation pipelines in order to write powerful, efficient queries with very few lines of code.
- How to write queries to analyze sample data from an online quiz app. Once the sample data has been loaded into MongoDB, participants will be guided in writing basic queries to examine the sample data. Participants will have an opportunity to write queries in the Mongo shell and in Python in order to familiarize themselves with syntax variations and key ideas. Participants will learn how to implement CRUD operations in PyMongo.
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."sjabs
The document discusses Hadoop and its applications. It provides examples of companies like Facebook and their use of Hadoop. It also discusses Hadoop components like HDFS, MapReduce, Pig and HBase. It provides examples of using Hadoop with databases like MongoDB and search engines like Solr. It notes that not every problem requires large-scale solutions and discusses potential use cases for Hadoop including log analysis, indexing documents and building recommendation systems.
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseSages
Szybkie wprowadzenie do technologii Pig i Hive z ekosystemu Hadoop. Prezentacja wykonana w ramach warsztatów Codepot w dniu 29.08.2015. Prezentacja wykonana przez Radosława Stankiewicza oraz Bartłomieja Tartanusa.
Wprowadzenie do technologi Big Data i Apache HadoopSages
The document introduces concepts related to Big Data technology including volume, variety, and velocity of data. It discusses Hadoop architecture including HDFS, MapReduce, YARN, and the Hadoop ecosystem. Examples are provided of common Big Data problems and how they can be solved using Hadoop frameworks like Pig, Hive, and Ambari.
Vielseitiges In-Memory Computing mit Apache Ignite und KubernetesQAware GmbH
IT-Tage 2017, Frankfurt am Main: Vortrag von Mario-Leander Reimer (@LeanderReimer, Cheftechnologe bei QAware)
Abstract:
Mit Apache Ignite steht eine hochperformante, integrierte und verteilte In-Memory-Plattform bereit, die im Zusammenspiel mit Kubernetes zu wahrer Hochform aufläuft. In dieser Kombination lassen sich flexibel skalierbare In-Memory Computing-Systeme elegant realisieren.
In diesem Vortrag stellen wir die wesentlichen Features und die Architektur von Apache Ignite vor. Anhand von anschaulichen Beispielen zeigen wir mögliche Use Cases, wie etwa den Einsatz als Kommunikations-Backbone einer Microservice-Architektur oder als Plattform zur Verarbeitung von kontinuierlichen Event-Daten. Zur Demonstration von Resilienz und Skalierbarkeit des In-Memory Data-Grids werden die Beispiele auf einem Kubernetes Cluster ausgeführt.
It's 10pm: Do You Know Where Your Writes Are?MongoDB
Speaker: Samantha Ritter, Software Engineer, MongoDB
Level: 200 (Intermediate)
Track: How We Build MongoDB
MongoDB 3.6 delivers three new features to help you develop resilient applications: retriable writes, a cluster-wide killOp command, and zombie cursor cleanup. These features share a common base, an idea called a logical session. This new cluster-wide concept of user state is the quiet magic that allows you to know, with certainty, the status of your operations. MongoDB engineer Samantha Ritter will describe the above features in-depth, discuss when and how logical sessions can be used by applications and administrators, and show you how we implemented sessions for large, distributed systems.
What You Will Learn:
- What logical sessions are and how they are implemented in the server
- How to leverage logical sessions for retriable writes
- How to pull the new cluster-wide killOp emergency break
This document discusses cross-platform support and push notifications in Windows Azure Mobile Services. It explains how to send push notifications to different device platforms including Windows Store, Windows Phone, iOS, and Android. It also discusses using service filters and delegating handlers to intercept requests and responses for custom processing like adding versioning information.
This document summarizes a MongoDB live coding session presented by Tobias Trelle. It introduces MongoDB concepts like documents, collections, CRUD operations, queries including geospatial queries, replication, sharding, and the Java and Spring Data APIs. It also advertises MongoDB user groups in Dusseldorf and Frankfurt organized by codecentric AG.
Building Your First Data Science Applicatino in MongoDBMongoDB
Speaker: Robyn Allen, Software Engineer, Central Inventions
Level: 100 (Beginner)
Track: Tutorials
To provide a hands-on opportunity to work with real data, this session will center around a web-hosted quiz application which helps students practice math and memorize vocabulary. After experimenting with a small demonstration dataset (generated by each individual during the workshop), attendees will be guided through working with an anonymized dataset in MongoDB. No prior MongoDB experience is required but attendees are expected to download and install MongoDB Community Edition (available for free from mongodb.com) and have a working Python 3 environment of their choice (e.g., IDLE, free from python.org) installed on a laptop they bring to the workshop.
Prerequisites:
Attendees are expected to bring a laptop with the following software installed:
MongoDB 3.4.x Community Edition
The text editor or IDE of their choice
A working Python 3 environment of their choice
No prior MongoDB experience is required.
What You Will Learn:
- How to load a CSV file into MongoDB using mongoimport and then write queries (using the Mongo shell) to ensure the data appears as expected. Attendees will use a demo version of an online quiz app to generate a small data file of raw session data (which can be accessed via http://strawnoodle.com/api/testdata after logging in to the demo app and answering one or more quiz questions about MongoDB). After studying how the demo app stores session data, attendees will practice using mongoimport to import anonymized session data (provided during the workshop) into MongoDB.
- How to use the aggregation pipeline (in PyMongo) to implement more complicated queries and gain insights from data. Because the sample dataset contains data from a variety of users of different skill levels, queries can be designed which reveal summary statistics for the anonymous user cohort or specific performance of individual users. Participants will receive instruction in using MongoDB aggregation pipelines in order to write powerful, efficient queries with very few lines of code.
- How to write queries to analyze sample data from an online quiz app. Once the sample data has been loaded into MongoDB, participants will be guided in writing basic queries to examine the sample data. Participants will have an opportunity to write queries in the Mongo shell and in Python in order to familiarize themselves with syntax variations and key ideas. Participants will learn how to implement CRUD operations in PyMongo.
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."sjabs
The document discusses Hadoop and its applications. It provides examples of companies like Facebook and their use of Hadoop. It also discusses Hadoop components like HDFS, MapReduce, Pig and HBase. It provides examples of using Hadoop with databases like MongoDB and search engines like Solr. It notes that not every problem requires large-scale solutions and discusses potential use cases for Hadoop including log analysis, indexing documents and building recommendation systems.
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseSages
Szybkie wprowadzenie do technologii Pig i Hive z ekosystemu Hadoop. Prezentacja wykonana w ramach warsztatów Codepot w dniu 29.08.2015. Prezentacja wykonana przez Radosława Stankiewicza oraz Bartłomieja Tartanusa.
Wprowadzenie do technologi Big Data i Apache HadoopSages
The document introduces concepts related to Big Data technology including volume, variety, and velocity of data. It discusses Hadoop architecture including HDFS, MapReduce, YARN, and the Hadoop ecosystem. Examples are provided of common Big Data problems and how they can be solved using Hadoop frameworks like Pig, Hive, and Ambari.
Vielseitiges In-Memory Computing mit Apache Ignite und KubernetesQAware GmbH
IT-Tage 2017, Frankfurt am Main: Vortrag von Mario-Leander Reimer (@LeanderReimer, Cheftechnologe bei QAware)
Abstract:
Mit Apache Ignite steht eine hochperformante, integrierte und verteilte In-Memory-Plattform bereit, die im Zusammenspiel mit Kubernetes zu wahrer Hochform aufläuft. In dieser Kombination lassen sich flexibel skalierbare In-Memory Computing-Systeme elegant realisieren.
In diesem Vortrag stellen wir die wesentlichen Features und die Architektur von Apache Ignite vor. Anhand von anschaulichen Beispielen zeigen wir mögliche Use Cases, wie etwa den Einsatz als Kommunikations-Backbone einer Microservice-Architektur oder als Plattform zur Verarbeitung von kontinuierlichen Event-Daten. Zur Demonstration von Resilienz und Skalierbarkeit des In-Memory Data-Grids werden die Beispiele auf einem Kubernetes Cluster ausgeführt.
It's 10pm: Do You Know Where Your Writes Are?MongoDB
Speaker: Samantha Ritter, Software Engineer, MongoDB
Level: 200 (Intermediate)
Track: How We Build MongoDB
MongoDB 3.6 delivers three new features to help you develop resilient applications: retriable writes, a cluster-wide killOp command, and zombie cursor cleanup. These features share a common base, an idea called a logical session. This new cluster-wide concept of user state is the quiet magic that allows you to know, with certainty, the status of your operations. MongoDB engineer Samantha Ritter will describe the above features in-depth, discuss when and how logical sessions can be used by applications and administrators, and show you how we implemented sessions for large, distributed systems.
What You Will Learn:
- What logical sessions are and how they are implemented in the server
- How to leverage logical sessions for retriable writes
- How to pull the new cluster-wide killOp emergency break
This document discusses cross-platform support and push notifications in Windows Azure Mobile Services. It explains how to send push notifications to different device platforms including Windows Store, Windows Phone, iOS, and Android. It also discusses using service filters and delegating handlers to intercept requests and responses for custom processing like adding versioning information.
This document summarizes a MongoDB live coding session presented by Tobias Trelle. It introduces MongoDB concepts like documents, collections, CRUD operations, queries including geospatial queries, replication, sharding, and the Java and Spring Data APIs. It also advertises MongoDB user groups in Dusseldorf and Frankfurt organized by codecentric AG.
The Ring programming language version 1.4 book - Part 18 of 30Mahmoud Samir Fayed
This document provides code for a simple notepad application created using the Ring programming language and Qt GUI library. The application allows users to open, edit, save, print, find/replace, and run Ring code files. It includes menus, toolbars, and buttons for common editing functions and uses classes like QTextEdit, QFile, and QPrinter. The application stores settings for the active file name, text colors, font, and handles events for opening, saving, printing and running files.
The Ring programming language version 1.5.3 book - Part 77 of 184Mahmoud Samir Fayed
The document describes a simple notepad application developed using RingQt. It initializes variables to store the active file name, text and background colors, font, and other settings. It creates a main window with buttons to handle common file operations like new, open, save, cut, copy, paste. It also includes buttons to change the font and text color. The application executes a Qt event loop to handle user interface events.
MongoDB is the trusted document store we turn to when we have tough data store problems to solve. For this talk we are going to go a little bit off the path and explore what other roles we can fit MongoDB into. Others have discussed how to turn MongoDB’s capped collections into a publish/subscribe server. We stretch that a little further and turn MongoDB into a full fledged broker with both publish/subscribe and queue semantics, and a the ability to mix them. We will provide code and a running demo of the queue producers and consumers. Next we will turn to coordination services: We will explore the fundamental features and show how to implement them using MongoDB as the storage engine. Again we will show the code and demo the coordination of multiple applications.
The Ring programming language version 1.3 book - Part 50 of 88Mahmoud Samir Fayed
This document describes a simple notepad application created using RingQt. The application contains buttons for common editing functions like new, open, save, cut, copy, paste. It allows setting the font, text color, and background color. The application initializes default values for the active file name, text/background colors, font, and contains a search feature to find and replace text.
Distributed systems
1.Write a program for implementing Client Server communication model.
2.Write a program to show the object communication using RMI.
3.Show the implementation of Remote Procedure Call.
4.Show the implementation of web services.
5.Write a program to execute any one mutual exclusion algorithm.
6.Write a program to implement any one election algorithm
7.Show the implementation of any one clock synchronization algorithm.
8.Write a program to implement two phase commit protocol
The Ring programming language version 1.6 book - Part 69 of 189Mahmoud Samir Fayed
This document discusses using the QDesktopWidget class in Qt to center a window on the screen. It shows code to get the screen geometry using QDesktopWidget and then calculate the center point to move the window. It then discusses rotating text using a timer and callbacks. Finally, it provides an example of a simple client-server application in Qt with classes for the client and server.
Presented by Christian Kvalheim, Lead Engineer, MongoDB
From socket to driver, what does it take to write your own MongoDB driver in your favorite language? In this session, we will learn about the wire protocol, how authentication works, how single server, replicaset and mongos connections are handled and how cursors work under the hood.
This document discusses using a multi-model database like ArangoDB for microservices. It explains how ArangoDB can store different data models like key-value, documents, and graphs to support microservices that use different data structures. It provides examples of breaking up a monolithic application into microservices that use different parts of the database, and using Foxx to build REST APIs on top of ArangoDB to integrate microservices.
Dagger is a dependency injection framework that allows injecting collaborators into objects without requiring manual passing of dependencies. RxJava implements reactive programming, allowing observable streams to be manipulated through operators like map and filter. Retrofit makes REST API calls simply by defining an interface and allows results to be easily converted to Java objects. Together these libraries help create testable Android applications by decoupling classes and managing dependencies and asynchronous processes in a declarative way.
Just a few years ago all software systems were designed to be monoliths running on a single big and powerful machine. But nowadays most companies desire to scale out instead of scaling up, because it is much easier to buy or rent a large cluster of commodity hardware then to get a single machine that is powerful enough. In the database area scaling out is realized by utilizing a combination of polyglot persistence and sharding of data. On the application level scaling out is realized by microservices. In this talk I will briefly introduce the concepts and ideas of microservices and discuss their benefits and drawbacks. Afterwards I will focus on the point of intersection of a microservice based application talking to one or many NoSQL databases. We will try and find answers to these questions: Are the differences to a monolithic application? How to scale the whole system properly? What about polyglot persistence? Is there a data-centric way to split microservices?
This document describes how to parse JSON data from a URL and store it in a local SQLite database in an Android application. It includes the following:
1. A JSONParser class that makes HTTP requests and handles SSL certificate verification to retrieve JSON data from a URL.
2. An OrdersActivity class that uses the JSONParser to download order data from a URL, stores it in a local DB, and displays it in a list. It includes asynchronous tasks to download and access the data without blocking the UI.
3. Details on how the JSON data is structured and parsed to extract values and store them in the database using the DBAbaco class.
So in summary, it explains how to retrieve remote
The Ring programming language version 1.5.1 book - Part 63 of 180Mahmoud Samir Fayed
The document discusses using the QDesktopWidget class and centering a window on the desktop. It shows code to get the screen geometry of the primary screen and calculate the center point to move the window. It then discusses using a timer to rotate text in a label by changing the rotation angle each time the timer times out. Finally, it provides an example of changing focus between line edits using the enter key press event.
Wolltest du schon immer die Vorteile und Ideen von Scala in deinen Java oder Kotlin Projekten nutzen? Dann ist Vavr (ehemals Javaslang) genau die richtige Bibliothek für dich.
Anhand echter Projektbeispiele schauen wir uns den Nutzen an, den Vavr mit seinen syntaktischen Erweiterungen und Features bei der täglichen Arbeit bietet. Wir schauen uns Value Types, echte funktionale Datentypen an und werden lernen, wie wir Exceptions sinnvoller behandeln können. Alles für besser wartbaren und sauberen Code!
Vavr bietet die Möglichkeit, die Vorteile objekt-funktionaler Programmierung zu nutzen, ohne Java den Rücken kehren zu müssen.
The document describes how to create a JSON parser class in Android to retrieve data from a web API without certificate checking. It includes creating a JSONParser class with methods to make HTTPS requests and parse the JSON response. It also describes an OrdersActivity that uses an AsyncTask to download order data from the API via JSONParser, save it to a local DB, and display it in a list. The OrdersActivity includes methods for the AsyncTasks to show loading dialogs and populate the list from the DB data on completion.
Intravert Server side processing for CassandraEdward Capriolo
The document provides examples of using CQL (Cassandra Query Language) to create and query tables in Cassandra. It shows how to create tables to store user and video data, insert sample records, and perform queries. It then discusses using the IntraVert library to execute more complex queries directly against Cassandra, such as joins, filters, and multi-table operations, in order to reduce network traffic and processing compared to doing everything on the client side.
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...julien.ponge
The document discusses new features in Java SE 7 including the Fork/Join framework for parallel programming, language evolutions through Project Coin such as try-with-resources statements, and diamond syntax for generic types which simplifies generic class instance creation. It also covers varargs syntax simplification and restrictions on using diamond syntax with anonymous inner classes.
- CTO and lecturer who created Metarhia, an application server for Node.js that focuses on scalability, reliability, and clean architecture principles.
- Metarhia includes packages for SQL, logging, configuration, schemas, and more that work together to provide an isolated and scalable backend.
- It emphasizes simplicity, avoiding middleware and global dependencies, with features like live reloading, graceful shutdown, and automatic dependency injection.
This document summarizes new features and enhancements in Java 7 including Project Coin, NIO.2, invokedynamic, Fork/Join framework, and concurrency utilities. It discusses how these features make threads, parallelism, and concurrency easier to work with in Java. Code examples are provided to illustrate the use of ForkJoinPool, Callable, and try-with-resources statements.
S2Graph is a large-scale graph database built on Hbase that provides storage and graph APIs to enable real-time breadth-first search on large, constantly changing social graphs. It models social network data, such as users, messages, posts, and relationships between them as vertices and edges in a graph. This allows querying the graph through steps that traverse edges between vertices to retrieve related data in real-time with low latency. Some examples demonstrated include messaging, newsfeed, recommendation, and search applications.
This document discusses closures in JavaScript. It defines a closure as a function together with references to its surrounding state (the lexical environment). Closures are created by inner functions that return references to variables in outer scopes. This allows functions to access variables from outer scopes even after they have returned. Closures are useful for handling events and emulating private methods. While they provide data encapsulation, closures can also negatively impact performance due to increased memory usage.
Stacie Springfield has over 25 years of experience as a Shipping and Receiving Manager at LSI Midwest Lighting. She is responsible for all shipping and receiving activities at the warehouse, including developing carrier relationships, managing inbound and outbound shipments, and training and leading a team. Stacie has excellent communication, organizational, and analytical skills and is proficient in Microsoft Office, JD Edwards, and Enterprise One systems. She holds certifications in ISO 9001:2015, 5S, and CPR.
The Ring programming language version 1.4 book - Part 18 of 30Mahmoud Samir Fayed
This document provides code for a simple notepad application created using the Ring programming language and Qt GUI library. The application allows users to open, edit, save, print, find/replace, and run Ring code files. It includes menus, toolbars, and buttons for common editing functions and uses classes like QTextEdit, QFile, and QPrinter. The application stores settings for the active file name, text colors, font, and handles events for opening, saving, printing and running files.
The Ring programming language version 1.5.3 book - Part 77 of 184Mahmoud Samir Fayed
The document describes a simple notepad application developed using RingQt. It initializes variables to store the active file name, text and background colors, font, and other settings. It creates a main window with buttons to handle common file operations like new, open, save, cut, copy, paste. It also includes buttons to change the font and text color. The application executes a Qt event loop to handle user interface events.
MongoDB is the trusted document store we turn to when we have tough data store problems to solve. For this talk we are going to go a little bit off the path and explore what other roles we can fit MongoDB into. Others have discussed how to turn MongoDB’s capped collections into a publish/subscribe server. We stretch that a little further and turn MongoDB into a full fledged broker with both publish/subscribe and queue semantics, and a the ability to mix them. We will provide code and a running demo of the queue producers and consumers. Next we will turn to coordination services: We will explore the fundamental features and show how to implement them using MongoDB as the storage engine. Again we will show the code and demo the coordination of multiple applications.
The Ring programming language version 1.3 book - Part 50 of 88Mahmoud Samir Fayed
This document describes a simple notepad application created using RingQt. The application contains buttons for common editing functions like new, open, save, cut, copy, paste. It allows setting the font, text color, and background color. The application initializes default values for the active file name, text/background colors, font, and contains a search feature to find and replace text.
Distributed systems
1.Write a program for implementing Client Server communication model.
2.Write a program to show the object communication using RMI.
3.Show the implementation of Remote Procedure Call.
4.Show the implementation of web services.
5.Write a program to execute any one mutual exclusion algorithm.
6.Write a program to implement any one election algorithm
7.Show the implementation of any one clock synchronization algorithm.
8.Write a program to implement two phase commit protocol
The Ring programming language version 1.6 book - Part 69 of 189Mahmoud Samir Fayed
This document discusses using the QDesktopWidget class in Qt to center a window on the screen. It shows code to get the screen geometry using QDesktopWidget and then calculate the center point to move the window. It then discusses rotating text using a timer and callbacks. Finally, it provides an example of a simple client-server application in Qt with classes for the client and server.
Presented by Christian Kvalheim, Lead Engineer, MongoDB
From socket to driver, what does it take to write your own MongoDB driver in your favorite language? In this session, we will learn about the wire protocol, how authentication works, how single server, replicaset and mongos connections are handled and how cursors work under the hood.
This document discusses using a multi-model database like ArangoDB for microservices. It explains how ArangoDB can store different data models like key-value, documents, and graphs to support microservices that use different data structures. It provides examples of breaking up a monolithic application into microservices that use different parts of the database, and using Foxx to build REST APIs on top of ArangoDB to integrate microservices.
Dagger is a dependency injection framework that allows injecting collaborators into objects without requiring manual passing of dependencies. RxJava implements reactive programming, allowing observable streams to be manipulated through operators like map and filter. Retrofit makes REST API calls simply by defining an interface and allows results to be easily converted to Java objects. Together these libraries help create testable Android applications by decoupling classes and managing dependencies and asynchronous processes in a declarative way.
Just a few years ago all software systems were designed to be monoliths running on a single big and powerful machine. But nowadays most companies desire to scale out instead of scaling up, because it is much easier to buy or rent a large cluster of commodity hardware then to get a single machine that is powerful enough. In the database area scaling out is realized by utilizing a combination of polyglot persistence and sharding of data. On the application level scaling out is realized by microservices. In this talk I will briefly introduce the concepts and ideas of microservices and discuss their benefits and drawbacks. Afterwards I will focus on the point of intersection of a microservice based application talking to one or many NoSQL databases. We will try and find answers to these questions: Are the differences to a monolithic application? How to scale the whole system properly? What about polyglot persistence? Is there a data-centric way to split microservices?
This document describes how to parse JSON data from a URL and store it in a local SQLite database in an Android application. It includes the following:
1. A JSONParser class that makes HTTP requests and handles SSL certificate verification to retrieve JSON data from a URL.
2. An OrdersActivity class that uses the JSONParser to download order data from a URL, stores it in a local DB, and displays it in a list. It includes asynchronous tasks to download and access the data without blocking the UI.
3. Details on how the JSON data is structured and parsed to extract values and store them in the database using the DBAbaco class.
So in summary, it explains how to retrieve remote
The Ring programming language version 1.5.1 book - Part 63 of 180Mahmoud Samir Fayed
The document discusses using the QDesktopWidget class and centering a window on the desktop. It shows code to get the screen geometry of the primary screen and calculate the center point to move the window. It then discusses using a timer to rotate text in a label by changing the rotation angle each time the timer times out. Finally, it provides an example of changing focus between line edits using the enter key press event.
Wolltest du schon immer die Vorteile und Ideen von Scala in deinen Java oder Kotlin Projekten nutzen? Dann ist Vavr (ehemals Javaslang) genau die richtige Bibliothek für dich.
Anhand echter Projektbeispiele schauen wir uns den Nutzen an, den Vavr mit seinen syntaktischen Erweiterungen und Features bei der täglichen Arbeit bietet. Wir schauen uns Value Types, echte funktionale Datentypen an und werden lernen, wie wir Exceptions sinnvoller behandeln können. Alles für besser wartbaren und sauberen Code!
Vavr bietet die Möglichkeit, die Vorteile objekt-funktionaler Programmierung zu nutzen, ohne Java den Rücken kehren zu müssen.
The document describes how to create a JSON parser class in Android to retrieve data from a web API without certificate checking. It includes creating a JSONParser class with methods to make HTTPS requests and parse the JSON response. It also describes an OrdersActivity that uses an AsyncTask to download order data from the API via JSONParser, save it to a local DB, and display it in a list. The OrdersActivity includes methods for the AsyncTasks to show loading dialogs and populate the list from the DB data on completion.
Intravert Server side processing for CassandraEdward Capriolo
The document provides examples of using CQL (Cassandra Query Language) to create and query tables in Cassandra. It shows how to create tables to store user and video data, insert sample records, and perform queries. It then discusses using the IntraVert library to execute more complex queries directly against Cassandra, such as joins, filters, and multi-table operations, in order to reduce network traffic and processing compared to doing everything on the client side.
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...julien.ponge
The document discusses new features in Java SE 7 including the Fork/Join framework for parallel programming, language evolutions through Project Coin such as try-with-resources statements, and diamond syntax for generic types which simplifies generic class instance creation. It also covers varargs syntax simplification and restrictions on using diamond syntax with anonymous inner classes.
- CTO and lecturer who created Metarhia, an application server for Node.js that focuses on scalability, reliability, and clean architecture principles.
- Metarhia includes packages for SQL, logging, configuration, schemas, and more that work together to provide an isolated and scalable backend.
- It emphasizes simplicity, avoiding middleware and global dependencies, with features like live reloading, graceful shutdown, and automatic dependency injection.
This document summarizes new features and enhancements in Java 7 including Project Coin, NIO.2, invokedynamic, Fork/Join framework, and concurrency utilities. It discusses how these features make threads, parallelism, and concurrency easier to work with in Java. Code examples are provided to illustrate the use of ForkJoinPool, Callable, and try-with-resources statements.
S2Graph is a large-scale graph database built on Hbase that provides storage and graph APIs to enable real-time breadth-first search on large, constantly changing social graphs. It models social network data, such as users, messages, posts, and relationships between them as vertices and edges in a graph. This allows querying the graph through steps that traverse edges between vertices to retrieve related data in real-time with low latency. Some examples demonstrated include messaging, newsfeed, recommendation, and search applications.
This document discusses closures in JavaScript. It defines a closure as a function together with references to its surrounding state (the lexical environment). Closures are created by inner functions that return references to variables in outer scopes. This allows functions to access variables from outer scopes even after they have returned. Closures are useful for handling events and emulating private methods. While they provide data encapsulation, closures can also negatively impact performance due to increased memory usage.
Stacie Springfield has over 25 years of experience as a Shipping and Receiving Manager at LSI Midwest Lighting. She is responsible for all shipping and receiving activities at the warehouse, including developing carrier relationships, managing inbound and outbound shipments, and training and leading a team. Stacie has excellent communication, organizational, and analytical skills and is proficient in Microsoft Office, JD Edwards, and Enterprise One systems. She holds certifications in ISO 9001:2015, 5S, and CPR.
This document discusses REST (Representational State Transfer) and resource-oriented APIs. It notes that REST relies on a stateless and cacheable protocol. Resources can represent any concept that can be referenced, like documents, services, objects, or collections. Typical CRUD APIs use GET, POST, PUT, and DELETE on resources, but PUT can cause problems for complex state changes. Instead of PUT, it's better to POST new "event resources" that represent actions. This allows mutations to be first-class resources and avoids losing context of the original update trigger. Coarse-grained, resource-oriented APIs fit with approaches like event sourcing and CQRS. The granularity of resources is important to consider.
Nikunj Tak ,Project on HTML and CSS (Farming website) ,Final Year BCA ,Dezyne...dezyneecole
Student of Dezyne E'cole College ,doing his Degree Programme in Bachelors Degree in Computer Application. .Along with the Degree programme the student is also updating his industry required skills of IT through the regular work sessions taken during the 365 days of study at college. .This is a work showcase of the work of this student after Two year of his study of Bachelors Degree in Computer Application.
www.dezyneecole.com
Matthew Smull is a mechanical engineering student at Boise State University with relevant experience in HVAC engineering, teaching, and research. He has interned at Musgrove Engineering as an HVAC engineering intern where he assisted with mechanical system designs and load calculations. Additionally, he has taught STEM topics to students and conducted tissue engineering research at Boise State. Smull maintains a 3.77 GPA and is active in the Tau Beta Pi Engineering Honor Society while pursuing a bachelor's degree in mechanical engineering.
Este documento presenta una actividad sobre el análisis de una imagen que muestra la importancia de mantenerse activo físicamente. La imagen usa tres colores principales - verde, azul y los colores de los niños - para crear una sensación de armonía y evitar que se vea violenta. El documento también incluye enlaces a sitios web sobre la combinación efectiva de colores en imágenes y diseños.
This talk is about how to secure your frontend+backend applications using a RESTful approach. As opposed to traditional and monolithic server-side applications (where the HTTP session is used), when your frontend application is running on a browser and not securely from the server, there are few things you need to consider.
In this session Alvaro will explore standards like OAuth or JWT to achieve a stateless, token-based authentication using frameworks like Angular JS on the frontend and Spring Security on the backend.
Video available at https://skillsmatter.com/skillscasts/6058-stateless-authentication-for-microservices
Keynote at Dockercon Europe Amsterdam Dec 4th, 2014.
Speeding up development with Docker.
Summary of some interesting web scale microservice architectures.
Please send me updates and corrections to the architecture summaries @adrianco
Thanks Adrian
Microservices are small services with independent lifecycles that work together. There is an underlying tension in that definition – how independent can you be when you have to be part of a whole? I’ve spent much of the last couple of years trying to understand how to find the right balance, and in this talk/tutorial I’ll be presenting the core seven principles that I think represent what makes microservices tick.
After a brief introduction of what microservices are and why they are important, we’ll spend the bulk of the time looking at the principles themselves, wherever possible covering real-world examples and technology:
- Modelled around business domain – using techniques from domain-driven design to find service boundaries leads to better team alignment and more stable service boundaries, avoiding expensive cross-service changes.
- Culture of automation – all organisations that use microservices at scale have strong cultures of automation. We’ll look at some of their stories and think about which sort of automation is key.
- Hide implementation details – how do you hide the detail inside each service to avoid coupling, and ensure each service retains its autonomous nature?
- Decentralize all the things! – we have to push power down as far as we can, and this goes for both the system and organisational architecture. We’ll look at everything from autonomous self-contained teams and internal open source, to using choreographed systems to handle long-lived business transactions.
- Deploy independently – this is all about being able to deploy safely. So we’ll cover everything from deployment models to consumer-driven contracts and the importance of separating deployment from release.
- Isolate failure – just making a system distributed doesn’t make it more stable than a monolithic application. So what do you need to look for?
- Highly observable – we need to understand the health of a single service, but also the whole ecosystem. How?
In terms of learning outcomes, beginners will get a sense of what microservices are and what makes them different, whereas more experienced practitioners will get insight and practical advice into how to implement them.
This document discusses different approaches to making HTTP requests and parsing JSON responses in Android applications. It first shows the traditional approach using HttpClient and JSONObject, then introduces several popular libraries that simplify these tasks, including Butterknife, Retrofit, Picasso, RoboSpice and Lombok. It focuses on Retrofit, explaining how to define models, services, make requests using callbacks, and convert responses to Java objects using GSON. The document promotes Retrofit as a simple solution for replacing raw HTTP connections and parsing responses. It ends by providing the author's contact details.
The document discusses different ways to implement threading in Java programs. It provides code examples to demonstrate creating threads by extending the Thread class and implementing the Runnable interface. The code examples show printing output from both the main thread and child threads to illustrate threading concepts. Socket programming and RMI examples are also provided with code to implement client-server applications using threads.
This Java code defines classes for a money transfer application on a mobile device. It includes classes to handle registration, login, viewing account details, and transferring money between accounts by connecting to a backend server via HTTP requests. User interface elements like text fields, forms, images and lists are created to display registration/login screens, account information, and menus to select different actions.
This document provides an overview and introduction to Hazelcast, an open source in-memory data grid solution for Java applications. It discusses what Hazelcast is, why it can be used, how it compares to other solutions, code samples, configuration, and internals. The presentation includes sections on distributed data structures, clustering, partitioning, transactions, configuration, and how data is serialized and distributed across nodes.
The document discusses several common Java anti-patterns, including:
1) Approving a task by rejecting it in a method called "approve".
2) Avoiding the use of helper libraries to simplify tasks like file name parsing.
3) Using reflection when direct method calls would suffice.
This document discusses client-server connections for a library application. It provides code for a CustomHttpClient class that defines methods for performing HTTP GET and POST requests. This includes setting connection timeout parameters. It also provides code for connecting to a MySQL database and inserting login credentials and book borrowing history. The code samples show how to connect between the client and server and interface with the backend database.
This document discusses socket programming in Java. It begins by explaining the key classes for socket programming - InetAddress, Socket, ServerSocket, DatagramSocket, DatagramPacket, and MulticastSocket. It then provides examples of TCP client-server applications using Sockets and ServerSockets, UDP client-server applications using DatagramSockets and DatagramPackets, and multicast applications using MulticastSockets. The examples demonstrate how to send and receive data over sockets in both text and binary formats.
This document describes a multi-client chat client-server application created using Java socket programming. It includes the code for the ChatServer.java and ChatClient.java classes. The ChatServer class handles multiple client connections and broadcasts messages to all connected clients. The ChatClient class represents the graphical client interface that connects to the server and allows users to send and receive chat messages. The application allows for multiple clients to simultaneously chat by connecting to a central chat server.
Cascading provides a simpler way to write MapReduce programs through data flows. It uses a pipe and tap metaphor where data flows through pipes and is read from or written to taps. This allows assembling MapReduce jobs as data flow graphs in a more logical way compared to the traditional MapReduce API.
QA Fest 2019. Saar Rachamim. Developing Tools, While TestingQAFest
Our daily work is comprised of testing a product and improve its quality. However, here and there, we can come to a state where we find a need to build a tool, that can make our work easierbetter.
I will share from my experience when I found myself in a situation where building a tool was needed.
We will start with a web application that allows you to know when a food delivery you ordered arrives to the office, and then we will focus on a tool that test the performance of an app from the UI side. We will do a live demo for both of them.
The document discusses various methods for connecting to a network and downloading content in Android, including checking network connectivity, performing long operations off the main thread using AsyncTask, downloading content from URLs, and considerations around using HttpClient versus HttpURLConnection. It provides code examples for tasks like retrieving the device IP address, disabling HTTP connection reuse, and handling gzip encoding.
The document describes Johannes Brodwall's philosophy of "bare-knuckle web development" which advocates for lightweight frameworks, test-driven development, and avoiding unnecessary complexity. It then demonstrates this approach through building a simple phonebook web application in Java using only the bare essentials like servlets and XML parsing. Finally, it discusses further directions this approach could be taken, such as building applications for the Norwegian agricultural authority and power grid operator.
The document contains source code for a client-server chat application written in Java. The client code establishes a socket connection to the server, reads user input and sends messages to the server. The server code initializes a server socket to listen for client connections, spawns a new thread for each client, reads incoming messages and sends responses. The code includes graphical user interface components for selecting the client or server role, composing and displaying messages.
The code examples show source code for a client and server application for a chat program. The client code defines functions for connecting to the server, sending and receiving messages. The server code defines functions for starting the server, accepting new connections from clients, and handling message receives and sends between connected clients. The code implements multi-threaded processing to concurrently handle multiple client connections to the server.
The document contains source code for a client-server application written in Java. The client code establishes a socket connection to the server, allows sending and receiving messages, and closes the connection. The server code starts by binding to a port, accepts new connections from clients, and spawns a new thread to handle each client connection concurrently. It reads and writes data from the socket and closes the connection when the client disconnects. The code includes classes for the client, server, and thread handling each client connection.
Viele performante und gut skalierbare Architekturen setzen auf asynchrone Verarbeitung. Das Testen des asynchronen Codes stellt Entwickler allerdings vor neue Herausforderungen. Dieser Vortrag bietet Orientierung für einige typischen Fragestellungen. Am Beispiel von NodeJS und Mocha wird gezeigt, wie das Testen beim Einsatz einer nicht-blockierenden Event Loop funktioniert. Anschließend illustriert der Vortrag, wie asynchroner Code mit JUnit auf der JVM – einer klassischen Multithreading-Plattform – getestet werden kann. Insbesondere wird darauf eingegangen, welche Synchronisationsmechanismen genutzt werden können und wie Race Conditions durch Unit Tests aufgedeckt werden können.
Code unter: https://github.com/andreassimon/talk-asynchronen-code-testen
The document discusses Opa, an open-source, event-based programming language for building client-server web applications. It highlights two key features of Opa - its static typing that catches errors at compile time, and its type inference capabilities. Examples are provided showing how Opa validates types and infers types to catch errors. Quotes from reviewers praise Opa for its speed of development and potential to transform web development.
Не так давно Гор Нишанов представил свой доклад: C++ Coroutines a negative overhead abstraction. В этом докладе Гор упомянул, что предложенный дизайн корутин позволяет их использовать практически в любых окружениях, в том числе и с "бедным" C++ рантаймом.
Я решил попробовать запустить корутины в следующих окружениях: обычное приложение, драйвер ОС Windows, EFI приложение. Только в одном из этих окружений есть полноценный C++ рантайм и поддержка исключений, в остальных ничего этого нет. Более того, EFI приложение вообще выполняется до старта ОС.
Я хочу рассказать о том, как мне удалось запустить корутины в этих окружениях, поговорим о том, какие проблемы существуют в асинхронном системном программировании и как их можно обойти.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...alexjohnson7307
Predictive maintenance is a proactive approach that anticipates equipment failures before they happen. At the forefront of this innovative strategy is Artificial Intelligence (AI), which brings unprecedented precision and efficiency. AI in predictive maintenance is transforming industries by reducing downtime, minimizing costs, and enhancing productivity.
Trusted Execution Environment for Decentralized Process MiningLucaBarbaro3
Presentation of the paper "Trusted Execution Environment for Decentralized Process Mining" given during the CAiSE 2024 Conference in Cyprus on June 7, 2024.
19. public class PushDaemon {
private final Queue<String> queue;
private final HttpClient httpclient;
private final DatagramSocket socket;
public PushDaemon() throws SocketException {
queue = new LinkedBlockingQueue<>();
httpClient = HttpClients.createDefault();
socket = new DatagramSocket(6889);
}
}
20. public void start() {
Runnable client = new Runnable() {
@Override
public void run() {
while (true) {
String json = queue.poll();
if (json == null || json.length() <= 0) {
try {
sleep(1000);
continue;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
HttpPost post = new HttpPost("https://android.googleapis.com/gcm/send");
post.setHeader("Authorization", "key=AIzaSyCABSTd47XeIH");
post.setHeader("Content-Type", "application/json");
System.out.println("posting " + json);
try {
HttpEntity entity = new StringEntity(json);
post.setEntity(entity);
httpclient.execute(post);
} catch (Exception e) {
e.printStackTrace();
}
}
}
};
Thread t = new Thread(client);
t.start();
while (true) {
try {
byte[] buf = new byte[4096];
DatagramPacket received = new DatagramPacket(buf, buf.length);
socket.receive(received);
String data = new String(received.getData());
String command = data.split("s")[0];
if ("PING".equals(command)) {
byte[] sendData = "PONG".getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, received.getAddress(), received.getPort());
socket.send(sendPacket);
} else if ("SEND".equals(command)) {
String message = data.replace(command, "").trim();
Pattern p = Pattern.compile("([a-zA-Z0-9_-]*) "([^"]*)"");
Matcher matcher = p.matcher(message);
if (matcher.matches()) {
String json = "{"registration_ids" : "" + matcher.group(1) + "", "data" : { "alert" : "" + matcher.group(2) + ""}}";
System.out.println(json);
queue.add(json);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
24. private void spawnWorkers() {
Runnable client = new Runnable() {
@Override
public void run()
while (true) {
String json = queue.poll();
if (json == null || json.length() <= 0) {
try {
sleep(1000);
continue;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
HttpPost post = new HttpPost("https://android.googleapis.com/gcm/send");
post.setHeader("Authorization", "key=AIzaSyCABSTd47XeIH");
post.setHeader("Content-Type", "application/json");
try {
HttpEntity entity = new StringEntity(json);
post.setEntity(entity);
httpclient.execute(post);
} catch (Exception e) {
e.printStackTrace();
}
}
}
};
Thread t = new Thread(client);
t.start();
}
}
25. private void processRequests() {
try {
byte[] buf = new byte[4096];
DatagramPacket received = new DatagramPacket(buf, buf.length);
socket.receive(received);
String data = new String(received.getData());
String command = data.split("s")[0];
if ("PING".equals(command)) {
byte[] sendData = "PONG".getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length,
received.getAddress(), received.getPort());
socket.send(sendPacket);
} else if ("SEND".equals(command)) {
String message = data.replace(command, "").trim();
Pattern p = Pattern.compile("([a-zA-Z0-9_-]*) "([^"]*)"");
Matcher matcher = p.matcher(message);
if (matcher.matches()) {
String json = "{"registration_ids" : "" + matcher.group(1) + "", "data
{ "alert" : "" + matcher.group(2) + ""}}";
queue.add(json);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
26. public class PushDaemon {
private final Queue<String> queue;
private final HttpClient httpclient;
private final DatagramSocket socket;
public PushDaemon() throws SocketException {
queue = new LinkedBlockingQueue<>();
httpclient = HttpClients.createDefault();
socket = new DatagramSocket(6889);
}
public void start() {
spawnWorkers();
while(true){processRequests();}
}
private void processRequests() {
//…
}
private void spawnWorkers() {
//…
}
}
27. Update authorization key
Increase thread pool size
Swap HTTP client
Use a different transport protocol
Modify wire protocol format
Add commands
Add a different push notification service
Move UDP port
Use x-www-urlencoded instead of JSON
Lower maximum payload size
Bind a specific interface address
Update push service URL
30. private void spawnWorkers() {
Runnable client = new Runnable() {
@Override
public void run()
while (true) {
String json = queue.poll();
if (json == null || json.length() <= 0) {
try {
sleep(1000);
continue;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
HttpPost post = new HttpPost("https://android.googleapis.com/gcm/send");
post.setHeader("Authorization", "key=AIzaSyCABSTd47XeIH");
post.setHeader("Content-Type", "application/json");
try {
HttpEntity entity = new StringEntity(json);
post.setEntity(entity);
httpclient.execute(post);
} catch (Exception e) {
e.printStackTrace();
}
}
}
};
Thread t = new Thread(client);
t.start();
}
}
31. public class Worker {
private final Queue<String> queue;
private final HttpClient httpclient;
public Worker() {
queue = new LinkedBlockingQueue<>();
httpclient = HttpClients.createDefault();
}
public void add(String json) {
this.queue.add(json);
}
}
32. public class PushDaemon {
public PushDaemon() throws SocketException {
queue = new LinkedBlockingQueue<>();
httpclient = HttpClients.createDefault();
socket = new DatagramSocket(6889);
}
}
33. public class PushDaemon {
public PushDaemon() throws SocketException {
worker = new Worker();
socket = new DatagramSocket(6889);
}
}
34. private void processRequests() {
try {
byte[] buf = new byte[4096];
DatagramPacket received = new DatagramPacket(buf, buf.length);
socket.receive(received);
String data = new String(received.getData());
String command = data.split("s")[0];
if ("PING".equals(command)) {
byte[] sendData = "PONG".getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length,
received.getAddress(), received.getPort());
socket.send(sendPacket);
} else if ("SEND".equals(command)) {
String message = data.replace(command, "").trim();
Pattern p = Pattern.compile("([a-zA-Z0-9_-]*) "([^"]*)"");
Matcher matcher = p.matcher(message);
if (matcher.matches()) {
String json = "{"registration_ids" : "" + matcher.group(1) + "", "data
{ "alert" : "" + matcher.group(2) + ""}}";
queue.add(json);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
35. private void processRequests() {
try {
byte[] buf = new byte[4096];
DatagramPacket received = new DatagramPacket(buf, buf.length);
socket.receive(received);
String data = new String(received.getData());
String command = data.split("s")[0];
if ("PING".equals(command)) {
byte[] sendData = "PONG".getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length,
received.getAddress(), received.getPort());
socket.send(sendPacket);
} else if ("SEND".equals(command)) {
String message = data.replace(command, "").trim();
Pattern p = Pattern.compile("([a-zA-Z0-9_-]*) "([^"]*)"");
Matcher matcher = p.matcher(message);
if (matcher.matches()) {
String json = "{"registration_ids" : "" + matcher.group(1) + "", "data
{ "alert" : "" + matcher.group(2) + ""}}";
worker.add(json);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
36. public class PushDaemon {
public void start() {
spawnWorkers();
while(true){processRequests();}
}
}
37. public class PushDaemon {
public void start() {
worker.spawn();
while(true){processRequests();}
}
}
38. public class PushDaemon {
public PushDaemon() throws SocketException {
worker = new Worker();
socket = new DatagramSocket(6889);
}
}
39. private void processRequests() {
while (true) {
try {
byte[] buf = new byte[4096];
DatagramPacket received = new DatagramPacket(buf, buf.length);
socket.receive(received);
String data = new String(received.getData());
String command = data.split("s")[0];
if ("PING".equals(command)) {
byte[] sendData = "PONG".getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length,
received.getAddress(), received.getPort());
socket.send(sendPacket);
} else if ("SEND".equals(command)) {
String message = data.replace(command, "").trim();
Pattern p = Pattern.compile("([a-zA-Z0-9_-]*) "([^"]*)"");
Matcher matcher = p.matcher(message);
if (matcher.matches()) {
String json = "{"registration_ids" : "" + matcher.group(1) + "", "data
{ "alert" : "" + matcher.group(2) + ""}}";
worker.add(json);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
40. public class UDPServer {
private final DatagramSocket socket;
public UDPServer() throws SocketException {
socket = new DatagramSocket(6889);
}
}
41. private void processRequests() {
while (true) {
try {
byte[] buf = new byte[4096];
DatagramPacket received = new DatagramPacket(buf, buf.length);
socket.receive(received);
String data = new String(received.getData());
String command = data.split("s")[0];
if ("PING".equals(command)) {
byte[] sendData = "PONG".getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length,
received.getAddress(), received.getPort());
socket.send(sendPacket);
} else if ("SEND".equals(command)) {
String message = data.replace(command, "").trim();
Pattern p = Pattern.compile("([a-zA-Z0-9_-]*) "([^"]*)"");
Matcher matcher = p.matcher(message);
if (matcher.matches()) {
String json = "{"registration_ids" : "" + matcher.group(1) + "", "data
{ "alert" : "" + matcher.group(2) + ""}}";
worker.add(json);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
receive
send
42. public class UDPServer {
private final DatagramSocket socket;
public UDPServer() throws SocketException {
socket = new DatagramSocket(6889);
}
public DatagramPacket receive() throws IOException {
byte[] buf = new byte[4096];
DatagramPacket received = new DatagramPacket(buf, buf.length);
socket.receive(received);
return received;
}
public void send(String message, InetAddress address, int port) throws
IOException {
byte[] sendData = message.getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length,
address, port);
socket.send(sendPacket);
}
}
43. private void processRequests() {
try {
byte[] buf = new byte[4096];
DatagramPacket received = new DatagramPacket(buf, buf.length);
socket.receive(received);
String data = new String(received.getData());
String command = data.split("s")[0];
if ("PING".equals(command)) {
byte[] sendData = "PONG".getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length,
received.getAddress(), received.getPort());
socket.send(sendPacket);
} else if ("SEND".equals(command)) {
String message = data.replace(command, "").trim();
Pattern p = Pattern.compile("([a-zA-Z0-9_-]*) "([^"]*)"");
Matcher matcher = p.matcher(message);
if (matcher.matches()) {
String json = "{"registration_ids" : "" + matcher.group(1) + "", "data
{ "alert" : "" + matcher.group(2) + ""}}";
worker.add(json);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
44. public class PushDaemon {
private final Worker worker;
private final UDPServer server;
public PushDaemon() throws SocketException {
worker = new Worker();
server = new UDPServer();
}
public void start() {
worker.spawn();
while(true){processRequests();}
}
private void processRequests() {
//…
}
}
49. public class PushDaemon {
private final Worker worker;
private final UDPServer server;
public PushDaemon() throws SocketException {
worker = new Worker();
server = new UDPServer();
}
public void start() {
worker.spawn();
processRequests();
}
private void processRequests() {
//…
}
}
50. public class PushDaemon {
private final Worker worker;
private final UDPServer server;
public PushDaemon() throws SocketException {
worker = new Worker();
server = new UDPServer(this);
}
public void start() {
worker.spawn();
processRequests();
}
private void processRequests() {
//…
}
}
51. public class PushDaemon {
private final Worker worker;
private final UDPServer server;
public PushDaemon() throws SocketException {
worker = new Worker();
server = new UDPServer(this);
}
public void start() {
worker.spawn();
while(true){processRequests();}
}
private void processRequests() {
//…
}
}
52. public class PushDaemon {
private final Worker worker;
private final UDPServer server;
public PushDaemon() throws SocketException {
worker = new Worker();
server = new UDPServer(this);
}
public void start() {
worker.spawn();
server.listen(6889);
}
private void processRequests() {
//…
}
}
61. public class Ping {
private UDPServer server;
private DatagramPacket received;
public Ping(UDPServer server, DatagramPacket received) {
this.server = server;
this.received = received;
}
public void run() throws IOException {
server.send("PONG", received.getAddress(), received.getPort());
}
}
62. public void call(DatagramPacket received) {
try {
String data = new String(received.getData());
String command = data.split("s")[0];
if ("PING".equals(command)) {
new Jobs(server, received).run();
} else if ("SEND".equals(command)) {
String message = data.replace(command, "").trim();
Pattern p = Pattern.compile("([a-zA-Z0-9_-]*) "([^"]*)"");
Matcher matcher = p.matcher(message);
if (matcher.matches()) {
String json = "{"registration_ids" : "" + matcher.group(1) +
"", "data" : { "alert" : "" + matcher.group(2) + ""}}";
worker.add(json);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
63. public class Send {
private DatagramPacket received;
public Send(DatagramPacket received) {
this.received = received;
}
public String run() {
String data = new String(received.getData());
String message = data.replace("SEND", "").trim();
Pattern p = Pattern.compile("([a-zA-Z0-9_-]*) "([^"]*)"");
Matcher matcher = p.matcher(message);
if (matcher.matches()) {
return "{"registration_ids" : "" + matcher.group(1) + "", "data" :
{ "alert" : "" + matcher.group(2) + ""}}";
}
return null;
}
}
64. public void call(DatagramPacket received) {
try {
String data = new String(received.getData());
String command = data.split("s")[0];
if ("PING".equals(command)) {
new Ping(server, received).run();
} else if ("SEND".equals(command)) {
String json = new Send(received).run();
worker.add(json);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
65. public class Worker {
private final Queue<String> queue;
private final HttpClient httpclient;
public Worker() {
queue = new LinkedBlockingQueue<>();
httpclient = HttpClients.createDefault();
}
public void add(String json) {
this.queue.add(json);
}
void spawn() {
Runnable client = new Runnable() {
@Override
public void run() {
while (true) {
String json = queue.poll();
if (json == null || json.length() <= 0) {
try {
sleep(1000);
continue;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
HttpPost post = new HttpPost("https://android.googleapis.com/gcm/send");
post.setHeader("Authorization", "key=AIzaSyCABSTd47XeIH");
post.setHeader("Content-Type", "application/json");
System.out.println("posting " + json);
try {
HttpEntity entity = new StringEntity(json);
post.setEntity(entity);
httpclient.execute(post);
} catch (Exception e) {
e.printStackTrace();
}
}
}
};
Thread t = new Thread(client);
t.start();
}
}
66. public class Send {
private DatagramPacket received;
private final HttpClient httpclient;
public Send(DatagramPacket received) {
this.received = received;
this.httpclient = HttpClients.createDefault();
}
public void run() throws IOException {
String data = new String(received.getData());
String message = data.replace("SEND", "").trim();
Pattern p = Pattern.compile("([a-zA-Z0-9_-]*) "([^"]*)"");
Matcher matcher = p.matcher(message);
if (matcher.matches()) {
String json = "{"registration_ids" : "" + matcher.group(1) + "",
"data" : { "alert" : "" + matcher.group(2) + ""}}";
HttpPost post = new HttpPost("https://android.googleapis.com/gcm/
send");
post.setHeader("Authorization", "key=AIzaSyCABSTd47XeIH");
post.setHeader("Content-Type", "application/json");
HttpEntity entity = new StringEntity(json);
post.setEntity(entity);
httpclient.execute(post);
}
}
}
67. public class Worker {
public Worker() {
queue = new LinkedBlockingQueue<>();
}
public void accept(Job job) {
this.queue.add(job);
}
void spawn() {
Runnable client = new Runnable() {
@Override
public void run() {
while (true) {
Job job = queue.poll();
if (job != null) {
try {
job.run();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
};
Thread t = new Thread(client);
t.start();
}
}
68. public interface Job {
void run() throws IOException;
}
public class Ping implements Job {
//…
}
public class Send implements Job {
//…
}
69. public class PushDaemon {
private final Worker worker;
private final UDPServer server;
public PushDaemon() throws SocketException {
worker = new Worker();
server = new UDPServer(this);
}
public void start() throws IOException {
worker.spawn();
server.listen(6889);
}
public void call(DatagramPacket received) {
String data = new String(received.getData());
String command = data.split("s")[0];
Job job = null;
if ("PING".equals(command)) {
job = new Ping(server, received);
} else if ("SEND".equals(command)) {
job = new Send(received);
}
if(job != null) {
worker.accept(job);
}
}
}
71. public interface Job {
public static Job create(DatagramPacket received, UDPServer server) {
String data = new String(received.getData());
String command = data.split("s")[0];
Job job = null;
if ("PING".equals(command)) {
job = new Ping(server, received);
} else if ("SEND".equals(command)) {
job = new Send(received);
}
return job;
}
}
72. public class PushDaemon {
private final Worker worker;
private final UDPServer server;
public PushDaemon() throws SocketException {
worker = new Worker();
server = new UDPServer(this);
}
public void start() throws IOException {
worker.spawn();
server.listen(6889);
}
public void call(DatagramPacket received) {
Job job = Job.create(received, server);
if (job != null) {
worker.accept(job);
}
}
}
73. public class Ping implements Job {
public void run() throws IOException {
server.send("PONG", received.getAddress(), received.getPort());
}
}
public class Send implements Job {
public void run() throws IOException {
String data = new String(received.getData());
String message = data.replace("SEND", "").trim();
Pattern p = Pattern.compile("([a-zA-Z0-9_-]*) "([^"]*)"");
Matcher matcher = p.matcher(message);
if (matcher.matches()) {
String json = "{"registration_ids" : "" + matcher.group(1) +
"", "data" : { "alert" : "" + matcher.group(2) + ""}}";
HttpPost post = new HttpPost("https://android.googleapis.com/gcm/
send");
post.setHeader("Authorization", "key=AIzaSyCABSTd47XeIH");
post.setHeader("Content-Type", "application/json");
HttpEntity entity = new StringEntity(json);
post.setEntity(entity);
httpclient.execute(post);
}
}
}
74. public class Client {
private final InetSocketAddress socketAddress;
public Client(InetSocketAddress socketAddress) {
this.socketAddress = socketAddress;
}
public int port() {
return socketAddress.getPort();
}
public InetAddress address() {
return socketAddress.getAddress();
}
}
75. public class UDPServer {
public UDPServer(PushDaemon app) {
this.app = app;
}
public void listen(int port) throws IOException {
socket = new DatagramSocket(port);
while (true) { app.call(receive()); }
}
}
76. public class UDPServer {
public void listen(int port) throws IOException {
socket = new DatagramSocket(port);
while (true) {
DatagramPacket received = receive();
String message = messageOf(received);
Client client = clientOf(received);
app.call(message, client);
}
}
private String messageOf(DatagramPacket received) {
return new String(received.getData());
}
private Client clientOf(DatagramPacket received) {
return new Client((InetSocketAddress) received.getSocketAddress());
}
}
77. public interface Job {
public static Job create(DatagramPacket received, UDPServer server) {
String data = new String(received.getData());
String command = data.split("s")[0];
Job job = null;
if ("PING".equals(command)) {
job = new Ping(server, received);
} else if ("SEND".equals(command)) {
job = new Send(received);
}
return job;
}
}
78. public interface Job {
public static Job create(Client client, String message, UDPServer server) {
//…
}
}
79. public class Ping implements Job {
private final Client client;
private final String message;
private UDPServer server;
public Ping(Client client, String message, UDPServer server) {
this.client = client;
this.message = message;
this.server = server;
}
public void run() throws IOException {
server.send("PONG", client.address(), client.port());
}
}