Creating a Facebook Clone - Part XXXVIII.pdfShaiAlmog1
Â
The document discusses the implementation of posts, media, and comments for a Facebook clone application. Key points include:
- A Post entity supports one media file per post, comments, likes, and attachments through relationships to other entities.
- The PostDAO converts Post entities to plain Java objects for transferring data to and from the client.
- The PostService allows creating and sharing posts to friends' newsfeeds through repositories for posts, users, newsfeeds, comments, and media.
- The MediaService supports getting media attachments by ID, checking permissions and returning file data and metadata.
The Duck Teaches Learn to debug from the masters. Local to production- kill ...ShaiAlmog1
Â
The document outlines an agenda for a workshop on debugging techniques. The workshop covers installing tools, flow and breakpoints debugging, watching variables, Kubernetes debugging, and developer observability. Key techniques discussed include tracepoints, memory debugging, exception breakpoints, object marking, and logs, snapshots, and metrics for observability. The goal is to teach practical debugging skills that can be applied at scale in production environments like Kubernetes.
The document describes code for implementing the server-side functionality of a WhatsApp clone. It includes classes for representing users, messages, and server connections. The Server class initializes user and message data from files, handles login/signup, and establishes a websocket connection for real-time messaging. It can send and receive messages when connected, or queue messages when offline.
Creating a Facebook Clone - Part XXXVIII.pdfShaiAlmog1
Â
The document discusses the implementation of posts, media, and comments for a Facebook clone application. Key points include:
- A Post entity supports one media file per post, comments, likes, and attachments through relationships to other entities.
- The PostDAO converts Post entities to plain Java objects for transferring data to and from the client.
- The PostService allows creating and sharing posts to friends' newsfeeds through repositories for posts, users, newsfeeds, comments, and media.
- The MediaService supports getting media attachments by ID, checking permissions and returning file data and metadata.
The Duck Teaches Learn to debug from the masters. Local to production- kill ...ShaiAlmog1
Â
The document outlines an agenda for a workshop on debugging techniques. The workshop covers installing tools, flow and breakpoints debugging, watching variables, Kubernetes debugging, and developer observability. Key techniques discussed include tracepoints, memory debugging, exception breakpoints, object marking, and logs, snapshots, and metrics for observability. The goal is to teach practical debugging skills that can be applied at scale in production environments like Kubernetes.
The document describes code for implementing the server-side functionality of a WhatsApp clone. It includes classes for representing users, messages, and server connections. The Server class initializes user and message data from files, handles login/signup, and establishes a websocket connection for real-time messaging. It can send and receive messages when connected, or queue messages when offline.
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Jeffrey Haguewood
Â
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on automated letter generation for Bonterra Impact Management using Google Workspace or Microsoft 365.
Interested in deploying letter generation automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
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.
Digital Marketing Trends in 2024 | Guide for Staying AheadWask
Â
https://www.wask.co/ebooks/digital-marketing-trends-in-2024
Feeling lost in the digital marketing whirlwind of 2024? Technology is changing, consumer habits are evolving, and staying ahead of the curve feels like a never-ending pursuit. This e-book is your compass. Dive into actionable insights to handle the complexities of modern marketing. From hyper-personalization to the power of user-generated content, learn how to build long-term relationships with your audience and unlock the secrets to success in the ever-shifting digital landscape.
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 .
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.
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Â
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
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.
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
Â
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
Dive into the realm of operating systems (OS) with Pravash Chandra Das, a seasoned Digital Forensic Analyst, as your guide. 🚀 This comprehensive presentation illuminates the core concepts, types, and evolution of OS, essential for understanding modern computing landscapes.
Beginning with the foundational definition, Das clarifies the pivotal role of OS as system software orchestrating hardware resources, software applications, and user interactions. Through succinct descriptions, he delineates the diverse types of OS, from single-user, single-task environments like early MS-DOS iterations, to multi-user, multi-tasking systems exemplified by modern Linux distributions.
Crucial components like the kernel and shell are dissected, highlighting their indispensable functions in resource management and user interface interaction. Das elucidates how the kernel acts as the central nervous system, orchestrating process scheduling, memory allocation, and device management. Meanwhile, the shell serves as the gateway for user commands, bridging the gap between human input and machine execution. đź’»
The narrative then shifts to a captivating exploration of prominent desktop OSs, Windows, macOS, and Linux. Windows, with its globally ubiquitous presence and user-friendly interface, emerges as a cornerstone in personal computing history. macOS, lauded for its sleek design and seamless integration with Apple's ecosystem, stands as a beacon of stability and creativity. Linux, an open-source marvel, offers unparalleled flexibility and security, revolutionizing the computing landscape. 🖥️
Moving to the realm of mobile devices, Das unravels the dominance of Android and iOS. Android's open-source ethos fosters a vibrant ecosystem of customization and innovation, while iOS boasts a seamless user experience and robust security infrastructure. Meanwhile, discontinued platforms like Symbian and Palm OS evoke nostalgia for their pioneering roles in the smartphone revolution.
The journey concludes with a reflection on the ever-evolving landscape of OS, underscored by the emergence of real-time operating systems (RTOS) and the persistent quest for innovation and efficiency. As technology continues to shape our world, understanding the foundations and evolution of operating systems remains paramount. Join Pravash Chandra Das on this illuminating journey through the heart of computing. 🌟
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.
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.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Â
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und ĂĽberflĂĽssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
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.
2. setProps(user, u);
if (u.getPassword() != null) {
u.setPassword(encoder.encode(user.getPassword()));
}
users.save(u);
}
public byte[] getAvatar(String userId) {
User u = users.findById(userId).get();
if (u.getAvatar() != null) {
return u.getAvatar().getData();
}
return null;
}
public void setAvatar(String authToken, String mediaId) {
Media m = medias.findById(mediaId).get();
User u = users.findByAuthtoken(authToken).get(0);
u.setAvatar(m);
users.save(u);
}
public void sendFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
UserService
3. setProps(user, u);
if (u.getPassword() != null) {
u.setPassword(encoder.encode(user.getPassword()));
}
users.save(u);
}
public byte[] getAvatar(String userId) {
User u = users.findById(userId).get();
if (u.getAvatar() != null) {
return u.getAvatar().getData();
}
return null;
}
public void setAvatar(String authToken, String mediaId) {
Media m = medias.findById(mediaId).get();
User u = users.findByAuthtoken(authToken).get(0);
u.setAvatar(m);
users.save(u);
}
public void sendFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
UserService
4. setProps(user, u);
if (u.getPassword() != null) {
u.setPassword(encoder.encode(user.getPassword()));
}
users.save(u);
}
public byte[] getAvatar(String userId) {
User u = users.findById(userId).get();
if (u.getAvatar() != null) {
return u.getAvatar().getData();
}
return null;
}
public void setAvatar(String authToken, String mediaId) {
Media m = medias.findById(mediaId).get();
User u = users.findByAuthtoken(authToken).get(0);
u.setAvatar(m);
users.save(u);
}
public void sendFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
UserService
5. setProps(user, u);
if (u.getPassword() != null) {
u.setPassword(encoder.encode(user.getPassword()));
}
users.save(u);
}
public byte[] getAvatar(String userId) {
User u = users.findById(userId).get();
if (u.getAvatar() != null) {
return u.getAvatar().getData();
}
return null;
}
public void setAvatar(String authToken, String mediaId) {
Media m = medias.findById(mediaId).get();
User u = users.findByAuthtoken(authToken).get(0);
u.setAvatar(m);
users.save(u);
}
public void sendFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
UserService
6. setProps(user, u);
if (u.getPassword() != null) {
u.setPassword(encoder.encode(user.getPassword()));
}
users.save(u);
}
public byte[] getAvatar(String userId) {
User u = users.findById(userId).get();
if (u.getAvatar() != null) {
return u.getAvatar().getData();
}
return null;
}
public void setAvatar(String authToken, String mediaId) {
Media m = medias.findById(mediaId).get();
User u = users.findByAuthtoken(authToken).get(0);
u.setAvatar(m);
users.save(u);
}
public void sendFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
UserService
7. u.setAvatar(m);
users.save(u);
}
public void sendFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
him.getFriendRequests().add(me);
users.save(him);
notifications.sendNotification(him,
new NotificationDAO(null, me.getDAO(),
"wants to be friends",
"uE7FC", 0x587EBE,
0, true, null, null));
}
public void acceptFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
if (me.getFriendRequests().contains(him)) {
me.getFriendRequests().remove(him);
me.getFriends().add(him);
him.getFriendRequests().remove(me);
him.getFriends().add(me);
UserService
8. u.setAvatar(m);
users.save(u);
}
public void sendFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
him.getFriendRequests().add(me);
users.save(him);
notifications.sendNotification(him,
new NotificationDAO(null, me.getDAO(),
"wants to be friends",
"uE7FC", 0x587EBE,
0, true, null, null));
}
public void acceptFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
if (me.getFriendRequests().contains(him)) {
me.getFriendRequests().remove(him);
me.getFriends().add(him);
him.getFriendRequests().remove(me);
him.getFriends().add(me);
UserService
9. u.setAvatar(m);
users.save(u);
}
public void sendFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
him.getFriendRequests().add(me);
users.save(him);
notifications.sendNotification(him,
new NotificationDAO(null, me.getDAO(),
"wants to be friends",
"uE7FC", 0x587EBE,
0, true, null, null));
}
public void acceptFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
if (me.getFriendRequests().contains(him)) {
me.getFriendRequests().remove(him);
me.getFriends().add(him);
him.getFriendRequests().remove(me);
him.getFriends().add(me);
UserService
10. u.setAvatar(m);
users.save(u);
}
public void sendFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
him.getFriendRequests().add(me);
users.save(him);
notifications.sendNotification(him,
new NotificationDAO(null, me.getDAO(),
"wants to be friends",
"uE7FC", 0x587EBE,
0, true, null, null));
}
public void acceptFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
if (me.getFriendRequests().contains(him)) {
me.getFriendRequests().remove(him);
me.getFriends().add(him);
him.getFriendRequests().remove(me);
him.getFriends().add(me);
UserService
11. u.setAvatar(m);
users.save(u);
}
public void sendFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
him.getFriendRequests().add(me);
users.save(him);
notifications.sendNotification(him,
new NotificationDAO(null, me.getDAO(),
"wants to be friends",
"uE7FC", 0x587EBE,
0, true, null, null));
}
public void acceptFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
if (me.getFriendRequests().contains(him)) {
me.getFriendRequests().remove(him);
me.getFriends().add(him);
him.getFriendRequests().remove(me);
him.getFriends().add(me);
UserService
12. User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
him.getFriendRequests().add(me);
users.save(him);
notifications.sendNotification(him,
new NotificationDAO(null, me.getDAO(),
"wants to be friends",
"uE7FC", 0x587EBE,
0, true, null, null));
}
public void acceptFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
if (me.getFriendRequests().contains(him)) {
me.getFriendRequests().remove(him);
me.getFriends().add(him);
him.getFriendRequests().remove(me);
him.getFriends().add(me);
users.saveAll(Arrays.asList(me, him));
}
}
public void uploadContacts(String auth, List<ShadowUserDAO> contacts) {
UserService
13. User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
him.getFriendRequests().add(me);
users.save(him);
notifications.sendNotification(him,
new NotificationDAO(null, me.getDAO(),
"wants to be friends",
"uE7FC", 0x587EBE,
0, true, null, null));
}
public void acceptFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
if (me.getFriendRequests().contains(him)) {
me.getFriendRequests().remove(him);
me.getFriends().add(him);
him.getFriendRequests().remove(me);
him.getFriends().add(me);
users.saveAll(Arrays.asList(me, him));
}
}
public void uploadContacts(String auth, List<ShadowUserDAO> contacts) {
UserService
14. User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
him.getFriendRequests().add(me);
users.save(him);
notifications.sendNotification(him,
new NotificationDAO(null, me.getDAO(),
"wants to be friends",
"uE7FC", 0x587EBE,
0, true, null, null));
}
public void acceptFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
if (me.getFriendRequests().contains(him)) {
me.getFriendRequests().remove(him);
me.getFriends().add(him);
him.getFriendRequests().remove(me);
him.getFriends().add(me);
users.saveAll(Arrays.asList(me, him));
}
}
public void uploadContacts(String auth, List<ShadowUserDAO> contacts) {
UserService
15. User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
him.getFriendRequests().add(me);
users.save(him);
notifications.sendNotification(him,
new NotificationDAO(null, me.getDAO(),
"wants to be friends",
"uE7FC", 0x587EBE,
0, true, null, null));
}
public void acceptFriendRequest(String auth, String userId) {
User me = users.findByAuthtoken(auth).get(0);
User him = users.findById(userId).get();
if (me.getFriendRequests().contains(him)) {
me.getFriendRequests().remove(him);
me.getFriends().add(him);
him.getFriendRequests().remove(me);
him.getFriends().add(me);
users.saveAll(Arrays.asList(me, him));
}
}
public void uploadContacts(String auth, List<ShadowUserDAO> contacts) {
UserService
16. }
}
public void uploadContacts(String auth, List<ShadowUserDAO> contacts) {
Long c = shadows.countByUser(auth);
User u = users.findByAuthtoken(auth).get(0);
if (c == null || c == 0) {
List<ShadowUser> shadowList = new ArrayList<>();
for (ShadowUserDAO d : contacts) {
shadowList.add(new ShadowUser(d, u));
updatePeopleYouMayKnow(d, u);
}
shadows.saveAll(shadowList);
} else {
for (ShadowUserDAO d : contacts) {
List<ShadowUser> results = shadows.findByFullName(auth, d.
getFullName());
if (!results.isEmpty()) {
shadows.save(new ShadowUser(d, u));
} else {
ShadowUser current = results.get(0);
current.setEmail(d.getEmail());
current.setPhone(d.getPhone());
current.setSecondaryPhone(d.getSecondaryPhone());
UserService
17. }
}
public void uploadContacts(String auth, List<ShadowUserDAO> contacts) {
Long c = shadows.countByUser(auth);
User u = users.findByAuthtoken(auth).get(0);
if (c == null || c == 0) {
List<ShadowUser> shadowList = new ArrayList<>();
for (ShadowUserDAO d : contacts) {
shadowList.add(new ShadowUser(d, u));
updatePeopleYouMayKnow(d, u);
}
shadows.saveAll(shadowList);
} else {
for (ShadowUserDAO d : contacts) {
List<ShadowUser> results = shadows.findByFullName(auth, d.
getFullName());
if (!results.isEmpty()) {
shadows.save(new ShadowUser(d, u));
} else {
ShadowUser current = results.get(0);
current.setEmail(d.getEmail());
current.setPhone(d.getPhone());
current.setSecondaryPhone(d.getSecondaryPhone());
UserService
18. }
}
public void uploadContacts(String auth, List<ShadowUserDAO> contacts) {
Long c = shadows.countByUser(auth);
User u = users.findByAuthtoken(auth).get(0);
if (c == null || c == 0) {
List<ShadowUser> shadowList = new ArrayList<>();
for (ShadowUserDAO d : contacts) {
shadowList.add(new ShadowUser(d, u));
updatePeopleYouMayKnow(d, u);
}
shadows.saveAll(shadowList);
} else {
for (ShadowUserDAO d : contacts) {
List<ShadowUser> results = shadows.findByFullName(auth, d.
getFullName());
if (!results.isEmpty()) {
shadows.save(new ShadowUser(d, u));
} else {
ShadowUser current = results.get(0);
current.setEmail(d.getEmail());
current.setPhone(d.getPhone());
current.setSecondaryPhone(d.getSecondaryPhone());
UserService
19. }
}
public void uploadContacts(String auth, List<ShadowUserDAO> contacts) {
Long c = shadows.countByUser(auth);
User u = users.findByAuthtoken(auth).get(0);
if (c == null || c == 0) {
List<ShadowUser> shadowList = new ArrayList<>();
for (ShadowUserDAO d : contacts) {
shadowList.add(new ShadowUser(d, u));
updatePeopleYouMayKnow(d, u);
}
shadows.saveAll(shadowList);
} else {
for (ShadowUserDAO d : contacts) {
List<ShadowUser> results = shadows.findByFullName(auth, d.
getFullName());
if (!results.isEmpty()) {
shadows.save(new ShadowUser(d, u));
} else {
ShadowUser current = results.get(0);
current.setEmail(d.getEmail());
current.setPhone(d.getPhone());
current.setSecondaryPhone(d.getSecondaryPhone());
UserService
20. List<ShadowUser> shadowList = new ArrayList<>();
for (ShadowUserDAO d : contacts) {
shadowList.add(new ShadowUser(d, u));
updatePeopleYouMayKnow(d, u);
}
shadows.saveAll(shadowList);
} else {
for (ShadowUserDAO d : contacts) {
List<ShadowUser> results = shadows.findByFullName(auth, d.
getFullName());
if (!results.isEmpty()) {
shadows.save(new ShadowUser(d, u));
} else {
ShadowUser current = results.get(0);
current.setEmail(d.getEmail());
current.setPhone(d.getPhone());
current.setSecondaryPhone(d.getSecondaryPhone());
shadows.save(current);
updatePeopleYouMayKnow(d, u);
}
}
}
}
UserService