Hello everyone, I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So after a few days like I'm back on this CNC++ coding bootcamp. So I was busy with other bootcamp so was not able to continue sessions. So now we have day 22 for this bootcamp and in today's session, I will be explaining an important topic which is functions in C, right? So if you are a programmer and you want to build some solution with the help of coding stuff, so you should know how to write functions in programming. So the way we write functions in C programming, in the similar way we write functions in other programming languages as well, okay? So I'm jumping on to the next slide. So this is about me. So I hope if you are following all the sessions of the bootcamp, you know about me. But if you are a new beginner and you are like attending any session for the first time on this channel, so with the help of this slide, you will be able to know about me. So I have total 16 plus years of experience and it is mixed off education industry and IT industry and working in Salesforce ecosystem and whenever anybody wants to become a developer, so they need to understand the base of programming. So that's why I'm conducting this C and C++ bootcamp so that beginners can understand the basic concepts of programming languages. So moving forward, be consistent whatever you are doing because consistency is the key and if you are following all the sessions or do regular practice and scan this QR code for this C and C++ coding bootcamp telegram group. So here, lots of folks are connected and if you face any difficulty, so I will be there to help you out. And these are social media handles for Sanjay Gupta Tech School if you want to receive timely notification and if you want to receive any update related to the bootcamp sessions or like whatever video I am producing. So all those updates you will find on these platforms and the session tracker link is available in the description of the video. So from there you can have it. Okay, so let's discuss about functions in C programming. So what functions are and if you want to implement some solutions with the help of functions or how you can do that. So first I will be covering the theoretical concepts related to function and then we'll be implementing some programs. So basically a function is a collection of one or more than like one or more than one related instructions which are implemented to perform a particular task. So suppose you have lots of requirement that you need to implement through coding. So instead of writing one function, we split those requirements and for particular requirement, we build a function, right? So this is very important to know because in all the programming languages no matter whether it is C, C++, Java, Python, PHP, Salesforce, APEX, so whatever language you are learning, you are implementing code. So in every programming language, you need to build functions and there are two types of functions available with every programming language one. Some are predefined or library functions and some are user-defined functions that we implement as per our need. Okay, so now we need to understand the need of function, why we need to implement functions in programming languages, right? So if you want to implement function-oriented approach because normally like if you implement solution in one block, so it will be difficult to identify like which line of code, group of code is basically solving which problem. If you have different, different functions because in functions we provide some name as well to those functions. So it will be very easy to identify like which function will be doing what particular operation. Then we have reusability of code. So if you want to reuse codes that you have implemented, so those codes you can reuse with the help of functions, right? Debugging becomes easy and fast because you have different, different blocks. So generally whenever there is an error, so it comes in particular functions. So you just need to check that particular block of code, not the complete code, right? And compilation and execution of the program becomes faster, right? So last line is specific to certain programming languages. Okay, so now jumping on to the next slide. So here we will be understanding what all different parts we need to implement when we write a function, okay? So if you are implementing a function in any of the programming language, so you mainly focus on what function name should be and what parameters it will be receiving as an input or what output function can produce to another functions, right? So if we have more than one function implemented, so like all the functions can receive some inputs and all the functions can provide some output so that those output can be received as an input from other functions, right? So this way, this function implementation works. So we have three statements. One is declaration, one is calling and one is definition, right? So declaration, we need to provide in few programming languages like in C programming, you need to write declaration, but in some of the programming languages like C++, Java or object-oriented programming languages, you don't need to write the declaration. Declaration is also known as signature of the function, right? So here we have return type, we have function name and we have argument type. So argument type basically works as input, then function name so that we can identify what problem we are solving and return type will be basically working as an output. So other than declaration, calling and definition will be available in every programming language, right? So here we need to call the function, we need to provide some arguments. The result will be stored in particular variable. So this is calling statement. Calling is very important because if you write a calling statement, then only it says like you, whatever function you have implemented that will be executing. Then we have definition, in the definition we write the actual piece of code that will be working whenever you are calling a function, okay? So these three blocks or these three statements basically, we need to implement if we are implementing function-oriented approach. So now I'm going to implement these problems one by one so that you can understand how we can write a function. So first I will be solving like how we can calculate factorial of a number. So let's jump on to the online compiler. So here first of all, I'm going to declare a function factorial and int. So here first int is return type, then factorial is function name and next int is input type, right? So this int, this int which we used in parenthesis will be working as input and factorial is function name and this int is basically return type, okay? So I hope you are able to understand this and I'm breaking it into two comment lines so that it will be readable. Now here I need to implement the code. So basically for factorial calculation, I need to receive input from user as well. So here what I'm going to do, I'm creating a variable and and variable f, then print f, enter a number, then we need to scan it. Now here I will be calling the function and whatever result I will be receiving into f, I'm going to show it. So factorial equals two and the result we are receiving into f. So this is basically function call, which is very much important. This is basically function call. So in function call we are calling this factorial function, we are passing n as input. So here n is input and the result will be received into f variable as an output. Now after implementing this main function, after that we need to define another function which will be factorial and here we'll be receiving the input, right? Then if you need a variable for calculation, a variable for loop implementation, so you can declare them. So this is another block of code. So in this block of code, if you need any variable, so you can declare it. So this way I implemented for loop and here I'm going to write the logic. So f equals two f into i, so factorial logic we already understood in the previous session. So this loop will be repeating n times, so let's say n is five. So this loop will be repeating five times. Five iterations will be there and every time f will be multiplied with i and the result will be stored into f variable. And once this loop is completed, so what we can do, we can write return f. So whatever value will be available into this f variable, it will be returned here. So execution will begin from main, from main whenever you will be calling this function. So from calling control will transferred to this definition. So from calling whatever value of n you are passing, so that value will be stored into this n variable which is available in the definition. And with the help of this loop, the calculations will be done and the result will be available into this f variable. And whenever we write this return f, so return f means the value will be returned and it will be stored into this f variable which is available at line number 10 and this statement is basically function call. And here this you can call as function definition. This is function definition. So this way, if you want to implement more function you can do, right? So this way we implemented one function. So I see Prince, welcome Prince. I recognize like you are from PIT college. I hope now you are doing some job. So now jumping on to the next problem. So here, what we need to do? We need to read two numbers and perform addition and subtraction, okay? So before implementing the second problem, let me implement one more problem that is printing reverse of a number. So whatever number we are receiving here and calculating factorial for the same number I need to print the reverse, right? So what I can do? Here I can declare one more function named as reverse and this reverse function will be receiving an integer and it will be like giving an output in form of integer, okay? Now here I am going to call that function. So I'm creating one more variable that is r and here I'm going to write r equals to reverse of n. So whatever value will be available into n that will be passed into reverse function that we are going to implement next. And then we can write print if reverse equals to percent d and r, okay? So here we have another function call. Here we have another function call. So in the same code, we are going to define one more function. So in the same program, like you have main function, which is calling other functions, then we have factorial function and then I'm going to write one more function that is reverse, okay? Now here we can write the logic of reverse, okay? So this way we basically implement the function. So here I'm creating one variable. So a directly then s is zero. Now here I am implementing while loop while n not equals to zero. So a equals to n modulus 10. Then s equals to s into 10 plus a then n equals to n divided by 10. So this way this while loop will be calculating the result and then I can write return s. So this time result will be available into s variable. So that is why I'm returning s variable from here. So this is my third function. So again you can say this is function definition, okay? So this is one function that I defined here reverse. This is another function that I defined here factorial and this is main function that we already implement, okay? So this way like whenever you are working with any programming language, you need to implement functions, okay? We can add more functions here as per the need. Now I'm going to show you if we want to receive more than one values as input, so how we can do that? So if you read the program, read two numbers and perform addition and subtraction. So I'm going to implement this problem and we have two more problems like Palindrom and Armstrong. So these you can do as part of your practice, okay? So now I'm going to modify this code so that I can show you other implementation. So I am just removing this code, which I already demoed. Now here I'm going to implement declaration of some functions. So we need to receive two inputs because for some we need two values and for subtraction as well. So here two inputs will be passed in form of integer. Now here I am creating variable like N1, N2, then R1, R2. So R1 will be receiving first result, some R2 will be storing second result that is subtraction. Then here I'm going to enter two numbers and then we can call the function. So R1 equals to sum of N1, N2, right? And then we can write printf. So it will display some on output screen, right? So here we are passing two inputs. So this is again function call. This is again function call and then we can have one more function call for subtraction passing the same values. Now here what we can do, we can also reuse R1 variable here also because we are calling functions separately and before calling another function we are displaying the result as well. So you can reuse the variables as per the need. So it should be subtraction and here I am going to display R2. So this way here you can see I am performing another function call, right? So this is main function now. I need to define two definitions. So first time writing some. So here I'm receiving int A into B. Now you might be thinking we are passing N1, N2 from here but we are receiving into A and B. So this is possible. From function call you can use different variable names. In definition you can use different variable names. So here I'm writing C equals to A plus B and then return C. Okay, so this way this function is implemented. So again you can see we are returning C variable and the result will be received into R1 so that is also possible. Then next is subtraction. So subtraction will be receiving two values and here I can write minus sign. So this way some and subtraction two functions are implemented, okay? So I hope you are able to understand these function implementation. Now I'm going to run this code so that I can provide two values. So 10 and five I am putting as an input and you can see some is 15 and subtraction is five. So both the functions are working properly as I call them in the main function. So this way I hope you understood like how we can implement function and this function topic is very much important because in every programming language you need to implement functions. You need to pass some inputs as parameter. You need to receive output. So all those things you need to implement. So practice all these functions properly. Implement these programs with the help of function. So three problems I already showed you how we can implement. Two problems last two problems I didn't solve. Those you will be implementing as part of practice. Okay so that you will be able to understand. So this way in short I demoed you how we can implement function. It is very easy and the problems which we are implementing we already discussed. So logic will be same. The thing you need to understand how we can break your code into pieces and you can create separate function for particular problem, okay? So this is all for today's session. In next session I will be discussing new topics. So I think in one or two sessions the important topics which are related to C programming will be completed and then I will be explaining C++ related sessions, right? So C++ is very much important if you are trying to learn Java and Apex programming. So C++ basically helps you to build a base to write code in object oriented programming way. So maybe in 15, 20 sessions those C++ related topics will be completed so that you can create a good base for you. Okay, so this is it for today's session. Thank you so much for attending. And if you're watching the recording thanks to you as well. I hope whatever I demoed you it makes sense and you are able to understand. Thank you everyone. See you in the next session.


I am Dr. Mokshi Kaal. I am an orthopedic physiotherapist with Malipal group of hospitals based out of Kharadi Pune. A lot of times when I see my patients in OPD, I get a question that is most commonly asked is, my knee crackles, it makes a lot of noises, it pops, is there a problem? Well, for most of the conditions, there is nothing to be worried about. Because this sound in the knee, it comes de novo and goes de novo. But yes, if this crackling or the popping sound is associated with some pain, then there is something you need to be worried about. If the patient is complaining of pain when this crackling sound comes, then the patient may require some investigation as well. The click or the pop in the knee is a very common phenomenon that is experienced by a lot of patients. This is usually seen when patient tries to bend the knee, he tries to twist the knee joint or even tries to extend the joint as well. A lot of causes can be, it can be a loose body, it can be any kind of menisciped here and the most common cause is arthritis, which is a degenerative condition and increases with aging as well. So, the solution for this is to take rest and if the joint is injured or swollen, start with the icing as well. You can also start investigating and have a consultation with your doctor and start your medications. But most importantly, you have to start your physiotherapy rehabilitation of the knee joint which will help in strengthening the muscles around the knee joint and also improve the flexibility as well. So friends, any click, any crackling or any pop in the knee joint that is not associated with pain is a worrisome condition. So come, visit us, get yourself checked and get rid of the knee pain.


Thanks everybody for being here and apologies for the mix-up in the rooms. So if you weren't planning on an AI talk, then maybe you're in the wrong room. You might need to go somewhere else. My name's Josh and today I'm going to talk to you about generative AI. And sort of in the theme of Lord of the Rings from New Zealand, Wellington, is it sort of the one UI that will kind of rule them all? A bit about me. I've been a part of the Drupal community since 2007. I joined AQUIA in 2014. And I've kind of really focused my career around working inside of that enterprise space of Drupal. So I've spent a lot of time with large organisations. They often have lots of different properties that manage data and get things.  You've got a portfolio experience across international news and media, public sector, global sporting events and other major industries. So lots of different spaces and industries where enterprises still have these large sets of data. And so be that in mind with what I'm talking about today. It is sort of thinking about the larger problem, but there's definitely some smaller scopes that this will apply to as well. So let's get into it. Before we really start talking about AI, however, I wanted to just take a current look at the current state of the content user experience for a standard enterprise. So today, digital, when customers go into and experience your brand if you're the customer, you're often going to go across a number of different content silos inside that organisation. So here's a list of some of those things. You might find the organisation through a piece of thought leadership in a blog post. You might find your way to their website and learn about their products and solutions. You might get signed up to a newsletter or a webinar and start getting email marketing campaigns. There'll be at some point legal information, privacy information, that kind of thing. If you want to buy through them online, there's going to be an e-commerce platform. You might need to also have some security information if you're compliant with certain government standards or things like GDPR. Then there's going to be other types of content like how do I do this thing with your products? You're going to need blog posts there. You might need some training, maybe a learning management system as well. There's going to be product documentation, reference manuals. There's going to be a support portal so that you can log tickets and ask for help that way. There'll be a knowledge base system as well, which has maybe some pre-canned ways of dealing with things to prevent support tickets. Often, organizations put something like a federated search layer that sits over the top of that so that, well, maybe I don't know which of those things I need, which types of content I want to get to. But if I can search for it, maybe the search results can help me get to where I want to go. That's kind of how Google functions when you think about it. Then you can also say that the content is a part of a different part of the customer journey. So at the beginning, I'm looking for evaluation, what products might exist to help me deal with my problems. Then if I move into procurement, what sort of things I need to know before I make this purchase. And then finally, I've made the purchase, how do I go about implementing that thing. And so this content actually has a different purpose depending on where that customer is inside that customer journey. Then finally, you have different parts of the organization responsible for managing and maintaining that. So they have sales and marketing that deal with content relating to evaluation and procurement and customer success who would have some sort of role in managing content to do with procurement and implementation. So this is a very loose diagram, but it should reasonably translate between most organizations. They all have some components here and the organizational structure will sort of dictate how the content is managed. But loosely speaking, this is sort of a rough idea of how the digital landscape works for most enterprises today. And there are three UX challenges with that current state that I really want to talk about in address. Number one is that your internal governance equals your external experience. What I mean by that is, well consider this, an organization has independent business units and they have independent budgets. And they buy and build solutions according to the remit that they have inside of that business unit. And so when they go and buy and they go to market and they buy a piece of management software, they really buy within what can that tool do for them and facilitate their business. And then the user experience becomes a byproduct of that purchasing decision. So we end up with lots of different silos of managed software and the customer has to jump from one management system to another management system and the user interface that management system provides to be able to get a holistic user experience. So that's sort of problem number one. Headless applications I'll say have kind of provided an option to get around this, because you can create a headless front end and then have multiple back ends to manage that content. However, that only really works if you have a business unit that focuses on a unified front end. It won't work if that business unit stool is going to deliver within their remit, because they're not going to create the holistic journey. Challenge number two is creating an intuitive experience with sprawl. It's kind of like a pointless statement, you can't. Like sprawl is not a intentional design of user experience. Like who wants to send the user to another sub-domain? Why is that a good idea? We just do that because we have lots of different properties that we need to manage and the only way to really continue the user experience is to send them from the flagship.com to the blog.com to the support desk.com, or whatever that is. That's just a consequence of the sprawl. It's not really a user-centered or UX-centered design decision. The third challenge is getting to the fastest path from question to answer. This is obviously the thing that we've always been chasing in the market when you think about it, and the fastest path to get an answer today is always being search-based. That's why we have that federated search layer that sits over the top of it. That's why Google has been so successful in what it does, but ultimately it's not fast enough. People still end up mixed up inside of your content experience. They don't know how to find the content they want to get. There's a lot of other reasons for that. We might not be really clear on where the content is. Does it sit in product documentation, or is it in the knowledge base, or is it inside the Thought Leadership blog post? Sometimes there's some real big discrepancies between those, and we're all practicing or singing from the same songbook because often different business units are producing different contents. How do we know that we're being consistent and on message? Those are the three challenges. To quickly review them, number one, internal governance is equal to the external experience. The way we want to approach to solve that is to streamline the governance and workflow in an open publishing environment. I'll talk a little bit more about what I mean by that. Number two, that creating an intuitive experience was sprawl. The way that we can approach to solve that is to reduce the sprawl in the UI and optimize for the UX. So it's not about how many UIs you have, it's about what your user experience is. And number three, the fastest path from question to answer. The approach to solve that is through personalization, contextualization, and on-demand responses to questions, which traditionally is like the fastest way we've been able to do that is with things like support tickets, and then a little bit faster with chatbots more recently. And then of course generative AI presents a new opportunity there as well. So let's talk a little bit about generative AI. For those of you who don't know what that term means or have just heard of AI and not heard of the term generative AI, it's the thing that generates content. Things like text, images, and video from a text prompt based on a statistical modeling system and it's trained from prepared data sets. And it's generated off a randomized seed. So it's really kind of important to understand the part that it's statistical modeling. So that means it's always going to predict what has always been. It's not really like a future predictor or anything like that. If you give it a new problem that has never been statistically encountered before then it's not going to really be able to give you an accurate answer, for example. So to give you an example of how generative AI works, you might give it a text prompt, something like, Dreesbytarad is a driplicon. Give that to the generative AI. Voila. Where's the spikes? I thought that too, but then I realized there's a spike right at the top of his head, so they kind of got on point there. All right, so addressing the 3UX challenges with generative AI. So, number one, we're going to make internal governance not equal to the external experience. So organizations can optimize internally for governance without compromising the external experience. That's going to be what we want to do. Number two, we're going to remove the sprawl, access to that sprawl. So sprawl can still exist, might still have to be there, but it doesn't mean that our user experience has to be driven or delegated by it. So maybe we kind of constrain the access to that sprawl. Maybe we can surface it up under a unified UI. That's not something that organizations can just big bang, by the way. They have to work at it over time. As budget allows, as investment allows, you have to prioritize the things you're going to bring underneath that unified UI. But we're going to want to make sure that a goal is to have no cross-domain navigation. There's a lot of reasons for that. Nothing to do with cookies or anything like that, but it just means consistent branding, easy to manage, and ideally one team that is responsible for that user experience. Thirdly, the faster path to answer. Generative AI does the intent analysis, search and response to inquiries, mitigating self-service search and content analysis, reducing the time looking for an answer. It's a huge mouthful. I'll try and go into a bit more detail about that in a moment. But it also increases the availability of just-in-time learning. If you know anything about the learning services or education space, this is sort of a holy grail. Can I get the information a person needs at the time that they need it? Google does a pretty good job of that today. But Generative AI really kind of takes it to a whole other level because it adds a wealth of context based on the question you're asking, not looking for a resource that kind of looks like what you're asking for. So to look at that diagram I showed you earlier, but with a Generative AI idea plugged into it, it might look something like this. We have a user experience, a headless-based UI with a chat prompt that sits inside that UI somewhere, and the headless UI plugs into a series of APIs that connects to all those management portals that we were talking about earlier, but we're able to bring that under that single veneer. At the same time, we also have this Generative AI plugged in and it actually sits on top of the federated search for reasons I'll go into a little bit later, but it helps find the right content that the chat prompt needs to be able to surface back up to that organization and ultimately helping to answer that question. Whatever the question is, at whatever point in the customer journey they're in. You still have sales and marketing and customer service managing the content that sits in all those management silos, but you now have a new UX unit and IT are going to help manage that middle layer because it's IT infrastructure. So there are some challenges with this approach and the biggest one that's really kind of hit right now is that Generative AI can be too generic. If you've ever tried doing some testing with this, it won't take too long to realize it has these issues. So it can't really respond well in organizational contexts. For example, there's ambiguities in our language, so I might talk about something that in our organization that the nomenclature means this, but to chat GBT or whomever, that means something kind of different, more broad, more ambiguous, so that can lead to misdirection and misinformation from the AI. It also hallucinates. It can be very confident in telling you something that is actually quite incorrect and tell your user to go do something, like click in the top right hand button, but the team, product team have moved it to the left or it never was in the right in the first place. Finally, the third kind of issue here is machine learning. Machine learning actually requires really large datasets to do training off of, and it's not just the fact that you need to have the data. You need to have the data that is also with outcomes measured on it so that when you do the training, you can say, was the AI successful or not, and the prediction, and if it wasn't, you need to give that feedback back to it so that it can continue to do that learning process. So you often need quite a high volume of data with quite a high volume of measurements that say whether it was a successful or negative outcome so you can do that training. There's a conundrum in that because chances are good that if you can get, say, a million sets of data that could do this, you've probably built some tooling that has done that prediction for you. So why do you need a large language model when you've already got the business rules that would actually do this? To kind of give you a bit more of an illustration for this. So let's say you have a pool of data. We'll call that language data, but you can think of it as like domain and data, essentially. And you want to turn that into a large language model so you go through a machine learning process. So this would be, you know, I go look at it at a Twitter stream or I look at Wikipedia or I look at a really large volume of data.  However, oh yeah, we will call that generative AI. However, a data's organization is typically a lot smaller than those sets of data that we built the large language model off of. So if we were to kind of go through that same process, it's going to maybe perhaps not be as comprehensive of a large language model, not to mention that there are compile times, delivery times, and there's sort of a state flow. So if I, it takes me, you say, a week to update my large language model and then the content team publish to change, you know, they publish some more content, well, now it's not in the large language model. So there's a latency there that sort of is of a critical issue that you can't really resolve with neural networks that are hard-coded in that nature. So instead, we often do development and produce rules engines. By rules engines, I just mean things in the business that say if this, then that. And if you have enough of them together, it actually resembles a smart capability. I mean, we might call that an AI as well. In fact, in the market, many early definitions of AI were not really machine learning. It was really just rules engines underneath the hood. Google might be a good example of that. But we can actually pull both of these two things together and it's a new type of AI, well, maybe not necessarily new or as new as generative AI is, but this is the, an alternative way of not having to do the learning but being able to, in real time, inject the information from your organization. That's called retrieval augmented generation and it's a sub capability of AI. So by being able to input the right inputs from your organization into an existing open large language model, you're able to create essentially an org level, organizational capable AI. And this addresses those AI challenges I mentioned earlier. So it has now that organizational context. So now that we have that context, we can make sure it's not going to go talk about someone else's product or some other organization that has a similar name or it is existing in a different country or something like that. It's also going to be able to regenerate information based on the content that we retrieved and gave to the AI. So it really mitigates hallucinations because we can constrain the AI to talk about the things that are actually within our content domain. Thirdly, the RAG allows existing rules engines, so things that we've already built inside of our organization, such as a search algorithm that would help determine the relevance of content based on questions asked by the end user as the resources to use to help generate that output back to the customer. So same diagram I showed you before, but with this idea of RAG now plugged in, you can see all of these digital management systems plugging up into a federated search system, tuning that so that it really does give you relative results with the query that you ask, producing those results up to the generative AI and the generative AI then being able to respond accurately based on the question that your customer asked you. So let's review. Optimizing for the external experience. We can use Headless here to help unify the experience that sort of helps with the branding aspects of things that might also help with some other things like search indexing and availability. Trying to head towards a click-less answer from a first transaction for a chat prompt kind of objective. So this means you don't have to kind of navigate through information architecture, trees and menu systems getting across the mains to try and find that information or even doing a federated search. It's just asking the question to the chat prompt and getting the right answer I have irrespective of whether it's in my thought leadership blog or in a support ticket, knowledge base article, whatever. Secondly, we're going to optimize internal governance. The AI is only going to be able to answer questions that you have content for. So do you have the answers for all of your customers' questions? It becomes the next immediate question because you'll start using the AI and you'll test it out and it won't answer things properly. And so you go, why did it do that? You go, oh, it's a content problem. We don't have content for that. We really do need to have content for that. And so we need to start optimizing for a faster content publishing system and a more effective one internally. And if we're taking away the UI for each of those management systems that previously held that responsibility, you really kind of need to double down on why are they still in the organization. So they really ought to provide some level of governance value and streamlined effectiveness in getting the content up to the AI to make that response. Finally, we can integrate large language models with org-level algorithms. So this is the generative AI plus federated search and creating that RAG-based generative AI. And greater content quality is going to equal greater AI responses. So, you know, the content quality is still there. That's not going to go away. In fact, you might need to have more of it, which means you're going to need a content management system, knowledge that will help you keep a management of all of it. All right. So that's the, how are we doing for time? We've got 10 minutes. All right. So that's the general premise of open AI, well, using AI in general as a generative context. And this is a journey that we've been on at Acquia. So my job at Acquia currently is to sort of look at our current enterprise stack and sort of apply the same principles. So, you know, lo and behold, we have a very much, you know, very, very similar kind of content problem. We've acquired a number of companies and over the years, and we've got a number of different places where content resides and it's sending lots of different information. And so we need to kind of improve this and make the experience a lot better and more intuitive. We need to do that across multiple products inside of our organization. So we've kind of decided to start with the customer experience side. So right now, I'm not thinking too much about evaluation. In fact, the last sort of major phase of market business is really focusing on marketing, right? Like a lot of businesses have been investing heavily in marketing capabilities. It makes sure that digital experience for marketing is pretty good at the moment. So we don't really need to touch that too much. So we're going to actually go and look back to the customer experience side of the equation and look to make that better first. So the way that we did is we started with our product documentation site. So Valentine's Day this year, we launched the new docs.acquia.com and we are taking these sort of three steps in this direction. So that launch was phase one or the first step towards this direction. So we're starting to consolidate our content. We have product documentation existing in multiple silos. So we're going to start migrating that all underneath a single Drupal CMS and we're having a headless front end powered by Next.js. The next thing we're doing is removing the barriers to publish content. So today we had, well previously, we were actually publishing content through GitHub. So we were doing static site generation and that was difficult because, let me tell you a couple of problems we had. For one thing, if you wanted to be a content contributor to the doc site, you needed to have a GitHub account. You'd be a part of the Acquia organization to be able to do that. So for someone like a product manager, who's got a managed, let's say, their product, they weren't able to necessarily do that because they weren't technical folks to have GitHub accounts to do that. Even if you did have a GitHub account, someone who's non-technical could do that, you still have to learn a markup language called RST, Restructured Text. And so that wasn't easy, and then if you did learn that, you'd have to go and do an edit and something called VS Code and then if you could do that, you couldn't actually preview your change. Unless you knew Git so you could look at a revision and then you'd have to learn Python to be able to compile the thing. So this was like not a good publishing system. It was for a time, but we'd definitely outgrown it by that stage. And so we decided to move it back to Drupal. We decided to use Next.js. We'd be able to use Next.js as preview mode. But one of the foundational things we decided was to use Jira. How many people don't like Jira? Right? Not quite everyone. Some people like it here. But Jira is foundational to the organization as it turns out. I think almost every team doesn't matter whether you're in development or some other type of business function, they use Jira for their process management. And so I wouldn't have to teach Drupal to everybody if I could, and everybody already knew Jira. I wasn't going to go and rebuild workflow functionality in Drupal since the workflow functionality in Jira was kind of superior. I mean, there, for example, I can have a conversation call to comment. I can't do that if I'm in a revision inside of Drupal. So we built some tight integration here. When I create a revision in Drupal, I automatically create a ticket in Jira. And that Jira then kicks off a workflow that means that we can get editorial review if we need technical review, we can assign somebody to that. If we need legal review, we can assign somebody to that. And all of the links for that content change exist inside of that Jira ticket. So if I'm a lawyer, for example, or our counsel, they can get assigned a ticket. They get an email notification from Jira. It has the preview link inside it. They click it, Google SSO logs them and they see the preview change and they can approve it back on the ticket. The editor comes along, closes the ticket. The change just publishes live in the site. So we really kind of removed the barriers from not even being able to preview something because it was sitting inside of a GitHub pull request to now being able to let the organization move more autonomously. And that means that now with those barriers lowered, people are able to have more freedom in publishing. So someone could be inside of support the organization or in the product organization, whatever they are, they can see a problem with our product documentation. They can just go and make the change. They don't have to report it. And then it will just go through a workflow that will then result in the publishing of that change if that change was good enough. Thirdly, we entered into some search optimization. So as I mentioned earlier, if we're going to put an AI layer on top of the search system, then the search really needs to find the resources that are going to help with the queries that you're sending to it. So we went through some performance improvements. We upgraded search, and we also had to reindex the new side and then follow that through to search trainings, which is still an ongoing journey. But all of this is sort of like foundational work that's going to help us move forward into that next era of being able to introduce a generative AI to our customers. This is what the site looks like today.  It's mobile responsive. There's a different page there, and there's an example of a product page. This is the Drupal backend. So you can see it's the GIN theme. It's got on the right-hand side there the access to Jira tickets. You can see that. Just below the revision log message, there's a Jira issues drop-down. If there's an existing issue open, it'll let you select that. If there's no issue that's related to that node, it'll just say we'll create a new one for you. We also use Tailwind CSS and CK Editor styles inside of the WYSIWYG editor. Because we built with Tailwind on the front end, and because Tailwind is also available from the CDN on the back end, I don't have to pull in a CSS library from the front end to make my WYSIWYG editor look and feel like it is in the front end, because with Tailwind it just kind of works. So I just loaded it in from the CDN, then there's no dependencies on Drupal to have access to the front end site, which is really handy. And no layout management is something worth kind of mentioning here. So even though it's a headless build, layout management in headless is definitely something of interest for developers, but because we're a product documentation site and not a marketing site, the need to control layout is not really a requirement of what we're doing. There is obviously the desire to control content as you're reading the flow of content, but it's not the same as like I need to have a row of three cards here and like a row of four cards in a hero gallery. We don't have that sort of requirement, so it's not really kind of built in here. If it were, I think we'd just use CK editor and something called the embedded content, CK editor embedded content module, which allows you to build sort of paragraph type widgets that you can embed through CK editor instead of having to do that in a structured way. And that turns out to be a pretty good approach. It means from the React side we're just having to deal with a blob of text, a blog of rendered HTML, and we put that through a parsing system and that parsing system allows us to adjust to any conventions we want to write inside of the content and we don't have to worry about like traversing, for example, adjacent structure of data and figuring out how to render it at each point along the way. We don't have to worry about any of those things, so it allows the CMS to be kind of concerned with those things more. We also have preview mode, so there's a yellow bar at the top of the next page here, I'm logged in and now I can see a revision, the revision will change, you see it's sort of orange, and then I've toggled the switch and now it's showing me the diff so I can see what changed between the old state and the new state and then I've also got this options drop down button, so I've got an edit option to go back to the Drupal edit page and I've got the discuss option which would take me to the Jira ticket to post comments or change, transition to workflow or whatever. So from a user experience standpoint, I can go from preview to edit or preview to the Jira ticket and likewise with Jira we have the same thing, so we created three fields, the preview URL field, the edit URL field and the publish URL field is our key so we kind of look up Jira and say is there a node here by this URL that we kind of link things through and then we use the edit URL to get through to the CMS side and then the preview URL which preview is initiated using the next Drupal module integration and so when preview is initiated through the Drupal CMS but lands you on the front end site in a preview or draft mode as it's called in next 14 so we use that and you'll also notice there's a field that might be hard to read especially for the folks in the back but there's a field called publishing actions and set by default to cascade what that means is you can kind of make a group of changes to a group of pages and sort of link them up as you can in Jira to things like epics or some create issue links of some form and then you can say close the parent ticket and then there's a cascading effect that all the other tickets get closed and that has a cascading effect of publishing all the content inside a Drupal so we can sort of bulk publish inside a Drupal as an outcome of doing this through Jira as well and then as I mentioned earlier before there's a lot of different content teams that manage different types of content so we're starting to map a different type of content type to a team to a Jira project and then the underlying management system that runs that and then thinking about how that can then surface up through the UI and it's kind of of notes to mention here that not all systems will use Drupal to manage their content although given the Jira integration we have it's sort of like a great foundational governance system so now I can ask the question why wouldn't we use Drupal because it has a superior governance system for publishing content for our organization and so then we can actually open up multiple business units to use the common platform which you know executive is pretty happy about because then they don't have to spend their budget on it alright so I know we can't how much time is it like at time okay we're over alright so I'm just going to skip through I had some like findings here that we did a whole bunch of like AI research last year so I'll just share one thing here which was we tested a GPT service to see if it could answer support questions that came to Acquia our support desk so as an assistive tool for this was the sort of executive findings as an assistive tool for support engineers a direct GPT tool could surface new and useful insights on Drupal related to support cases 40% of the time likely reducing our response times as a support organization however the competence of the GPT to answer support tickets would likely have a negative impact if we introduced it directly to customers because it couldn't solve the issues 82% of the time so they kind of told us back then they were like oh we still need support engineers it's some good some good job security there but there was there was still much more needed need to kind of really leverage the AI tools down to something more specific organizationally specific I don't have time to go through all of this stuff so what I will do instead is just kind of leave you with these final for takeaways so it's AI and the one UI to rule them all provides better information to users when it gets the context right and that's the key part so you know one example we did some testing asked it how do I reset my password well we haven't have multiple products in that process is different for each product it's going to come back and tell you an answer every time but actually they needed to have the product context before we could properly answer that question Genre of AI is augments existing content today but does not replace them so for a lot of companies who are looking to introduce AI in this way it's going to be in addition to what they already have not something that replaces what they already have user will adjust from 25 years of keyword search to asking for questions we are a generation of people that use keywords to figure out what we want to do on the internet the next generation is not going to be like that and we're going to become more conversational with these AIs for sure and one thing you can know for sure is that definitely coming in their roadmap is transactional features and chat prompts the ability to improve on that in the near future so thank you very much for your time I don't think I've got any time here for questions but come and find me later on


So I'll give everybody a minute to sort of read this. I can read it out loud, but I think I'll take the fun out of it. Hello, everybody. My name is Hussain Jurde. And today I want to talk about progressive web patterns, specifically the purple pattern, what it is, and how you can use it. So simply put, the purple pattern is not a specific tool or technology. It's actually a set of different techniques that you can apply to your web page in order to make it load fast and load reliably. First and foremost, you think of pushing and sending down your most critical assets to your users. And you do this in order to render your initial route as soon as possible. The next thing you can think about is trying to pre-cache all of your remaining resources, as well as lazy loading all of your remaining routes. Now, before we go into the details of how exactly we can apply these techniques in order to have the purple pattern to work, I want to take a step back and talk about mobile for a bit. I think it's safe to say that the vast majority of us in this room and everybody watching on the live stream own a mobile device on some sort. Now, what we do on our mobile devices can vary day to day. But year after year after year, we've been spending a lot more time on our smartphones and our tablets. Here's some data from ComScore that shows a comparison of unique visitor visits between native mobile applications and mobile web pages. Now, there's no denying that as consumers, we tend to spend a lot more time on native apps than we do on the mobile browser. But you can see that in terms of unique visitors by June 2016, we spent about three times more likely to land on a mobile web page than we are a native app we haven't seen before. And that's huge. That just goes to show that we spend a lot of time on the web even on our mobile devices. So how can we make sure that users who visit our web pages on their mobile phones or any device have a great experience? Well, there are a few ways, and we'll go through some of them in this talk. But first, let's talk about the web for a bit. When I open the browser on my mobile phone and type something into the URL bar and press Enter, a request is made to a server somewhere. And after a certain period of time, the server responds with the content that my browser needs. Now, usually, this takes shape of an HTML document. The next thing the browser needs to do is actually parse the contents of the file and find out what other resources that it actually needs. For every external resource it finds, it submits another request and gets a response for it. Now, the web sort of works in this sort of pattern. It makes requests and gets responses. These external resources can be CSS files for styling, JavaScript for dynamic content, or even static images, for example. Now, you can see with a typical web page, multiple round trips are usually needed in order to get the content that the user needs to see. So let's say this is the HTML that was first retrieved on the initial request. You can see that we have a style sheet being referenced as well as a JavaScript file. One thing we can do in order to help the fact that multiple requests are made is to leverage something called preload. Now, preload has a syntax that a lot of us are already familiar with. It's the link HTML tag, and we define the location of the file as an HREF attribute. But we also have a rel attribute where we say a value of preload as well as an as attribute that defines the type of file we want to load. In this context, we're trying to load script.js, which is a JavaScript file, so we're saying it's an as script. So what does preload actually do? Preload allows us to tell the browser... Preload allows us to tell the browser that some resources are so critical that you should try to download them immediately, because once the web page is fully loaded, the user is going to need to see this content without blocking the onload event. So the reason why this can be so useful is that it allows the browser to prioritize some critical resources, and once the page is loaded, it knows to download it as soon as possible. Now, you can use preload for resources like we did in the head of our HTML document, but you're going to get the most bang for your buck using it for resources that are going to be discovered much later. An example could be a font file tucked away deep in one of your CSS files. So you can use preload to preemptively fetch JavaScript files, style sheets, and again, it's the as attribute that defines what type of file you want to load. You can even use preload to preemptively fetch images, fonts, audio, video, and even more. Something else we can also leverage is something called pre-fetch, and it works very similarly to preload, but the only difference is that pre-fetch is actually for resources that are a different navigation route than what the user is currently on. In other words, we're just hinting to the browser that, hey, these are resources that the user might need in the future. Download your critical resources first and then try to download this later. So if you are building a simple static website, adding link preload or pre-fetch tags to the head of your HTML document is pretty straightforward. But if you're building a web application using a module bundler, things get a little trickier. If you happen to be using Webpack, there's a plugin, there's a tool that allows you to do this. And it's built by Adios Mining from the Google Chrome team. It's called preload Webpack plugin. And what it allows you to do is it allows you to add a few lines in your Webpack configurations file in order to inject preload and pre-fetch tags for some or all of your major bundles or chunks. So can we use preload and pre-load right now? Fortunately, Chrome, Safari, and Opera, all the later versions of them support preload. Firefox, as of now, has partial support where only cashable resources can be preloaded. So you can still use it for JavaScript files and style sheet files and so on. Edge, at the moment, is just currently under consideration. So another important point of topic that I also want to discuss here is something called HTTP-2 Server Push. Now, HTTP-2 aims to provide a number of performance improvements over HTTP-1. But the one we're going to focus on here is specifically Server Push. So let's revisit our original scenario again. When I open a browser and type something to URL bar and press Enter, we get that initial request to get the original HTML content. But what HTTP-2 Server Push allows you to do, it allows you to send down some critical assets to the browser at the same time you're sending the HTML file. In other words, we're telling the server, hey, give the browser these files before the browser even knows what it needs. The reason why this can be so useful is that it cuts round trips to the server. So one thing I didn't mention previously was instead of using link HTML tags, you can actually also use link HTTP headers. And what this allows you to do is it also allows you to do a lot of preload for some of your resources. And the format is kind of the same. We define the file location, rel preload as well as an as attribute for the type of file we're trying to load. Now, the majority of servers that support H2 Server Push, when they see a link HTTP header, they automatically try to instantiate pushing those assets down. A good example is Firebase, and it makes it very easy to do. There's a single Firebase JSON file where you type your configurations, and once you add your link HTTP headers for some of your resources, it'll automatically try instantiating pushing those assets down the wire every time you load the page. If you happen to want to use HTTP headers but not rely on Server Push and only use link preload, you can add a no push attribute. And that is essentially the exact same thing as just using link HTML tags. So here's some data from Jeremy Wagner. He wrote a very comprehensive guide into H2 Server Push, so I'll definitely suggest reading it if you're interested. But what he did was he ran a number of tests on a single webpage. I believe he ran each test 25 times with a slightly different set of variables. So you can see at the middle right, the tallest bar, you can see the page load times for what on his webpage with HTTP One without any enhancements. To the right of that, you can see how it gets reduced when he inlines CSS. And to the far right, you can see what happens when he inlines everything. Now we know inlining assets can cut page load times because you're cutting down trips to the server. Your browser doesn't need to go to the server to get those assets. Now to the very far left, you can see what happens when he just switches to HTTP Two but doesn't do anything else. And you can already see that he's noticing some performance gains. H2 provides performance wins because there's a few things it does outside of Server Push. To the right of that, you can see what happens when he pushes only his CSS file. And to the right of that, you can see what happens when he pushes everything. Notice how page load times are actually lower. The average is slightly lower full only when he pushes CSS and not when he pushes everything. So with HTTP Two, you can run into the problem of pushing too much. There's no right number of assets you should be pushing. It really depends on how many assets you're loading as well as the type of application you're building. But it's something to keep in mind that it's still slightly experimental. You don't wanna try pushing everything down the wire because the browser's gonna try to get all those assets at the same time. You most likely will get a better performance if you push just high priority resources. Another mistake you can easily do as well is pushing unused assets. If you're telling the server, hey, push down the CSS file and the browser doesn't need it at all, you're wasting bandwidth. And every single time the user loads the page, the browser's getting this unnecessary file it doesn't need. And what about the cache? Every time I load a page, if the server is pushing something down to the browser, what if the browser's actually cached that resource already? Does it need the server to send it down again and again? It kinda doesn't. We'll talk about a solution to this in a bit. So whether you're using link preload, prefetch, or H2 push or a combination, it's important to try to think of how you can send down some critical resource to your user because you can cut down page load times. So now let's switch gears a bit and let's talk about something that I think a lot of us are familiar with when we use Chrome or any browser and we don't have a proper internet connection. And that's when we see this little thing and that means the web page can't load. So one thing that can actually help with this is something called service workers. A service worker is a script that runs in the background of your web page when you view a browser, background of your browser when you view web page. So how do you add a service worker? One, you can create the logic yourself and you can create the file and write all the logic. Two, you can actually use a library that does it for you. One such library is called Workbox and it's actually built by the Google Chrome team as well. So if you actually wanted to use Workbox, you can install the CLI globally and then you can write a single command, generate SW, to create your service worker file. What happens is that it actually asks you a few questions. What is the root of your web app? What file types would you like to cache? You can say I want to cache all file types or just something. What should the path of your new service worker file be? And the very last question is, do you want to save these settings into a configurations file? If you say yes to the very last question, you're not going to get asked these configuration questions because it already knows to look at to that file. So now running those commands actually creates a service worker file wherever you've asked it to in your project, but we still need to tell the browser how to register that file. And one way to do that is adding a simple script tag into your index HTML. The first thing you can do is check and see if service workers are actually supporting in your browser. If they are, you can make sure to register after the window on load event. You don't want window on load to contend with your service worker being registered. Registering a service worker is as simple as just running navigator service worker register with the location of your file. And if you like, you can actually console log outputs to say it's been successful or if it's been failed. So we've talked about how to install a service worker using Workbox and we've talked about how to register, but we really haven't touched up upon what a service worker does. The very first thing you can think about is a service worker allows you to pre-cache your application shell. Now, like the name suggests, your application shell is essentially the shell of your user interface. It's the HTML, the CSS, the JavaScripts that make up your header, your footer, as well as loading icons or anything else that doesn't actually show actual content. How a service worker works is it acts like a middleman between your browser and your server. Once your app is loaded for the very first time, those assets are retrieved over the network. But your service worker now knows to cache those asset files so the next time your user loads your application again, it doesn't have to go all the way to the network.  So remember how the very last question of when you ran that generate SW command said, hey, do you wanna save these settings to a file? This is the sort of file you see. It's a very simple export object. Glob directory is essentially where your actual project lives. Glob patterns defines what type of files you want to cache. SWDest is where you wanna save your service worker file. You most likely wanna save it where your project is being deployed. A Navigate fallback is useful if you're building a single page application in order to say where your index HTML is. Now, using something like Workbox can be so useful because you run a single command and it creates a service worker file. But it can still pose a bit of an issue if we need to run that command every single time we make a change. If we add a file to our project or remove an image or anything, we'll need to make sure our service worker's up to date in order to cache the correct resources. So a better thing you can do is actually integrate it into your build process. So instead of installing it globally, you can install it as a dev dependency. And then you can add it as part of your build step. And now you know every single time your project's being rebuilt, a new service worker file, a fresh service worker file is being generated. If you happen to be using Webpack as well, there is a Workbox plugin for it that allows you to do the same thing. So we've talked about how a service worker can cache your application shell. But there's something else it can do as well. It can also cache dynamic content. And dynamic content is essentially also information being retrieved from a server. But this time this is information that can actually change. So let's go back to that configuration file we just saw. If you add a runtime caching object or array, you can actually add a URL pattern and define whenever that URL pattern is actually being retrieved or whenever API requests are being hit, you can tell your service worker to store that data as being returned in some specific way. You can see that we have a handler attribute that says network first. What network first allows us to do is say, hey, the service worker will automatically know to always get the content from the network, give that to your browser, but it'll always cache the latest data every single time. If your network happens to fail, let's say your server's down or you're having a bad internet connection, your service worker will just show its information instead instead of not seeing any data at all. Now, network first isn't the only handler you can use. There's also a cache first strategy, which is essentially the opposite. You always only want to get data from your service worker cache, but if that happens to fail, it then rely on the network. There's also the fastest approach where you don't really care where your data is coming from. If it comes from your service worker cache or your network, you just want the data wherever comes fastest. Now, it's going to make sense to use cache first and fastest for applications where you know the data won't change. In other words, you want data to your user as fast as possible. You don't care where it comes from. Cache only works where you only want the data from the service worker cache, and if that happens to fail, don't get data at all. And network only works where you only get the data from the network and never rely on the service worker. Now, I have a hard time trying to understand why someone will set up a service worker and then use network only because it's actually the same thing as just not using one at all, but I'm sure people have reasons that I don't know about yet. So, again, using the service worker allows for two things. It allows you to pre-cache your application shell as well as your dynamic content. And the combination allows for one, faster repeat visits. When you have an application shell cached, the assets that make up your UI or the most of your UI doesn't have to be retrieved from your server every single time. So when your user reloads your app multiple times, that is a lot faster. The loading is a lot faster because the service worker is feeding those files to the browser. It also allows for offline support. Now that we know the data that is not being fetched correctly from your server, your service worker can have older data and provide that to your browser. So can we use service workers right now? If you're using Chrome, Firefox, Opera, you can. The good news is Edge and Safari is currently under development in both platforms. Now, it'll definitely take some time for full service worker functionality to work in both Edge and Safari, but it's still extremely promising because we know that now all major browsers will eventually support service workers. So remember how we talked about H2 push earlier and how it's not cash aware? So this is where service workers can be useful because service worker stores information in a separate cache than the browser's HTTP cache. So let's revisit our original scenario one more time. I load an app for the very first time and I have server push enabled. What happens is the server pushes down some critical assets to your user and you can get a really fast first page load. Now, your service worker is acting as a middleman here, so now it knows to cache that resource if you ask it to. Now, if your user reloads your app for a second time, instead of the request being sent to your network, to the server, the service worker knows that it has the resource and will provide that instead. So not only are we gonna get a very fast first page load, we can also get fast repeat visits and repeat visits won't allow for server push if we don't need it to be. So whether you use a tool like Workbox or another library or you actually want to create the service worker file yourself, pre-caching your resources can be extremely useful. So now let's talk about bundles for a bit. I found a handy, handy gist that somebody actually set up and what he did was he created Hello World programs in a number of different JavaScript frameworks and libraries and some range from four kilobytes, the actual output bundle size, all the way up to 200 kilobytes. And now I know, depending on what tool you're using, there's reasons why there's a larger footprint. But it's something to think about because as applications have been building and become so much more clients heavy, we're starting to see more heavy and larger loads. So one thing we can do in order to help that fact is instead of sending the entire JavaScript bundle to your user on initial load, why not send them what they need for that specific part of the app? For example, let's say I open a social media application and I'm on the login page. Do I need to retrieve all the JavaScript that makes the entire app or only what I essentially need? Once I make it to the account page, why can't I just get the JavaScript for that page then? The concept of giving what the user needs in specific routes is known as lazy loading. If you're using something like Angular, lazy loading's actually built in into the routing system. So when you define your routes, you can create separate modules and if you define a low children attribute, you can define a separate module specifically for that route. What Angular now knows is that when the user goes to this specific route, it'll only get that bundle that makes that module and that specific page. So now you know you're not giving your user everything at the very beginning. If you're using React, for example, you can use something like React loadable and it allows you to do something very similar. It allows you to asynchronously get specific components and the bundles that make up for those components only when the user navigates to that page. Now, if you're thinking of applying code splitting and lazy loading into your application, you most likely want to keep an eye on your bundle and there are a few tools that make it easy. One is Webpack Bundle Analyzer. And what this allows you to do is it allows you to build, like, it's a simple command and you get a very interesting chart that shows how parts of your bundle look and compares to others. You can easily take a look and see what's larger, what parts are larger, which parts are smaller and then have an idea of what you need and what you don't need. Another very useful tool as well is Bundle Size. And way Bundle Size works is that it actually fits right into your CI workflow. You can actually add a threshold and every time someone puts up a pull request or a commit, you can see a message that says, hey, you're crossing that threshold or hey, your bundle is slightly larger than master. So whatever tools you use to actually keep an eye on your bundles, it's still important to try and think of how you can lazy load your routes in order to give the user what it wants only when it reaches that specific page. So again, the whole concept of purple is it's not a specific thing. It's just an acronym that defines a set of different techniques that you can apply to your web application. It doesn't, you can use any tool you like, but it's sort of a method of knowledge that you can think about in order to allow for faster load times, initial page load, as well as more reliable loads and faster repeat visits. Now, I know that a lot of us here who build applications, we most likely use a tool, a library or framework, in order to build our front end. So one thing that's important to think about is when you're trying to improve loading times, whatever tool you're building with, you wanna think of two sort of scenarios, one being first paint. Now, first paint means the actual time it takes for the user to see first meaningful content. The next thing to think about is time to interact. Now, time to interact is essentially the time it takes for your thread to settle down and user can get in contact with the page. Now, I've seen stats online that have said the average time to interact for mobile web applications is 16 seconds, and I've seen another one that says it's 19 seconds, and I feel like the more stats I see, the crazier it gets. I feel like if it takes more than five seconds for your web application to load, keep in mind a lot of your users might give up. So it's something to think about when you're building applications for users with different devices and different network connections. Now, I know a lot of us also, like I mentioned, build things with different tools and frameworks. Now, again, a lot of these frameworks are allowing us to do a lot more on the client side than we could ever do before. We're building more complex logic, and it's causing a lot of your bundles and slower page load times, but a lot of these frameworks are also trying to improve things in terms of progressive enhancements. If you're using React, for example, they've just recently, a few months ago, integrated service worker support right into the Create React tab. Angular, like I mentioned, has lazy loading built in into its routing system. They've also made steps with Angular 4 to reduce the bundle size, and they're actually building their own service worker library, so eventually, you don't have to rely on something like Workbox, you can use their built-in system. If you want to use Preact, it allows you to build UIs with very low footprint. The Preact CLI, which is also recently released, allows you to write a single command and get a Preact app up and running that is fully progressive and has the purple pattern baked in. View and Svelte are two other options that allow you to build complex applications with also relatively low footprint. And Polymer, for people who haven't heard of Polymer before, Polymer is a library that allows you to use web components and makes it easier to do so. Polymer, the Polymer team is actually the first team to coin the term purple, and their starter kit or the toolbox actually has the purple pattern baked in. So I hope you guys enjoyed this talk as much as I enjoyed giving it. My name is Hussain Jarday. I will be happy to answer any questions. Thank you, Hussain. That was fantastic. Thank you. I have a few selected questions here from our wonderful audience. So question one, one thing native apps have going for them is performance. Although you've explained how to get faster startup times, your web app is still running on top of JS, on top of a browser, on top of an OS. Won't that be an issue for certain types of apps? And that's 100% correct. And I feel like one thing about progressive applications or applying progressive enhancements in general is a lot of people make the connection to native apps. And it really depends on the type of application you're trying to build. If you need sort of native performance, if you need iOS and Android functionality, then that's perfectly fine and you should build a native app. But if you're trying to build an application on the web, you can also just add a lot of these enhancements and make sure users who use it on their mobile device as well as other devices get a good experience. So yes, I feel like you can't really compare it with how native performance works, but allows you to use tools on the browser to make your web application just faster and better. Awesome. Speaking of, do you think progressive web will replace native? Short answer, no. Long answer, I don't think it needs to. And again, I feel a lot of people that I've talked to who think about progressive web apps is they sort of see it as a replacement and it always depends on, one, your business use case. If you're thinking of building a web app or a native app and you're not entirely sure, hey, which one should I build first? And you feel like, oh, wow, progressive web apps can do a lot that I need, then sure, in your context, it works. But if you're trying to build something that users need with native functionality, then you have to build a native app. And I think one of the reasons why people always think that progressive web apps can replace native is that there's a lot of things progressive apps apply that allow you to do that I haven't talked about, one, being adding an icon to your home screen so it feels more native and you can load it directly with a splash screen and so forth. But again, it's still a web app and sometimes you think about that it's not trying to replace native, it's just allowing you to make web apps feel a lot more user friendly for users. Fantastic. How would you handle dynamic data with service workers? For example, changing prices on a web shop? So, okay, so it depends, I mean changing prices, I wanna assume if it's changing prices on a web shop that's coming from an external API. Again, if you're using a service worker, there are different handlers and there are different use cases of when you wanna cache dynamic data. If you feel like prices, for example, in this context is not gonna change much and you can cache that information so when the user reloads the app without a network, show the older price, that can work. If you feel like, hey, this is something I don't want the user to see unless it's 100% accurate, then you probably don't wanna cache that information. Awesome. From what you've seen, what is the biggest offender in terms of mobile web slowness? I feel like there's definitely a lot of factors. One thing that I've sort of noticed the most is people sort of, and it doesn't even tie in to lazy loading or code splitting, is a lot of people, a lot of applications that I've worked on include a lot of dependencies that it doesn't need. So even before you think of, hey, let me try lazy loading out and cutting down what the user sees in different routes, and I feel like if they automatically just take a step back and say, do I need a lot that's already in the app and can I just cut down what it's not being used, that could be a huge factor. So for me, I think that's the one thing I've seen the most. Nice. I have another question here. Do service workers have an impact on SEO? Do you know? So I don't know if there's a specific impact. Yeah, that's a very good question actually, and now I'm thinking about it. I feel like, again, a lot of the times service workers are being used for single-page applications, and a lot of single-page applications have issues with SEO on their own. I don't see service workers effecting that at all. If you are using server rendering to server render your content, it could improve SEO. So whether you have a service worker to cache some data and provide that to the user, I don't see that being an effect at all. Awesome. Thank you so much for saying, can I get another round of applause? Thank you.


Okay guys, we've got another epoxy piece, gotta make sure I got my torch, see all those air bubbles and I gotta use the heat to pop all those air bubbles to make it just like glass. Straight glass bro, look at that, so satisfying. So far so good, keep applying the heat and here's the result, smooth like glass bro. And that glitter, let's go baby!


Hi, good morning and welcome to these products and focus well today's the Scottish referendum and last night overnight We also had the FOMC that came out with a statement about reducing their bond buying program by about another 15 billion But also that they wouldn't raise rates before it was the allot of time They kind of basically came out with a rhetoric which was a considerable period of time which didn't go into any details on But the markets have reacted very favorably as to there is still going to be a rate rise sooner rather rather than later So equities to a certain degree bounced up in the news first of all hanging an all-time high for the US 30 Then people took stock of the fact that actually the rhetoric is that they will raise rates based on the on the economic fundamental data The initial response was equities been flying up thinking we're gonna have a later rate rate hike but then after doing a little bit more research and taking stock of things there is a little bit of a Restore of cam before we finish bang on that potential resistance at 17162 the USD is just like just Gone great guns against the basket of currencies. We'll come back to that in a second. So Scottish independence boat today I think there's still the mindset here looking at a lot of a lot of financial markets that there's obviously uncertainty there And we should know more by about 3 and 6 a.m. Tomorrow morning And today is going to be a big day for the for the Union and if Scotland's gonna go independent or not So UK 100 falling in sympathy there certain bookmakers that they're still predicting that there will be a no vote But and and these things you can't really tell until the final votes are counted. So most UK equities Feeling a little bit of pain this morning, but we'll be put over a misery by tomorrow morning So potential support 6774 So moving on to Japan 25 this must be doing quite well because dollar yen has just shut up after FOMC Session yesterday smashing through potential resistance at 59 87 and the next potential Resistance is this tip right here And that's close to sixteen thousand four hundred So this level is the broken resistance now acting as potential support next potential resistance 16400 and the technical indicators are just moving into over bought territory now So look at this dollar yen this trend here very strong When they very bullish yesterday closed that is closed that is high We're still going great guns this morning. We're edging ever closer to 110 spots 77. I hugely overextended move But lots of positive dollar sentiment out there right now So looking at crude oil west Texas Volatile as ever bit of a reversal again on that interest rate hike Potential interest rate a hike when's it going to be is the main question worrying that it's gonna put a dampener on demand Of course because of rumors yesterday morning where that they the Fed was going to be a lot more dovish and Certainly the way that people are interpreting the feds the feds statement is is more hawkish than dovish to be fair But we are at potential support at 93 spot 95 gold It is lowest level and multiple and maybe nine ten months 1218 is a potential support if that breaks I actually ticked below that this morning the next potential support is at eleven eighty So certainly the pressure is heaping on gold right now as equity shot shoot up and the dollar goes rampant Moving on to your dollar your dollar also reached a multi-month low and could even be a Fifteen eighteen month low Next potential support one spot twenty seven forty six on that dollar strength We've got bit of a hammer formation there right now, but the fundamentals seem to be stacked against your dollar in the short term So GBP USD it didn't come off quite as much as you would expect based on the FOMC mainly because we had such a Pressurized move on the Scottish referendum as I said the financial markets to a certain degree are Fighting back against the prospect of an independent Scotland As evidenced by this Significant rebound and we are trading above potential resistance level one spot sixty two sixty five now acting as potential support next potential resistance one spot sixty four sixty three and If we do get a no vote tomorrow Expect cable to be quite volatile if we get yes for expect cable to be volatile So it promises to be an interesting day keep your eye on the chart form and insights and obviously I'll be early early morning You'll know more about the Scottish referendum be wary of the UK 100 GBP USD RBS standard life anything that's got that that Scottish UK tends to headquarters where they're stationed Because obviously those those figures come out early morning and certainly you'll know before 6 a.m. In the morning, I remember a lot of markets trade 24 hours apart from the equities open at 8 a.m.. I come a day wise today UK retail sales US jobless claims Filly Fed index and if you fast forward on the Friday, well actually nothing too exciting to talk about you got German PPI But you know with the Scottish referendum It's all to play for so join us again tomorrow to find out the result. Take care. Bye


And I think I've seemed great, like what's the downside to that and now find ourselves in a world where all the institutions are in trouble. I mean, I don't think there's actually all that media specific. I think there's a decline across institutions and you can get very focused on like, did the New York Times do something wrong? What it is a global sort of cross broad base. Yeah, but I think this moment of technological shift and it turns out I think having trusted institutions is probably pretty valuable. And you look at, I mean, COVID was a good example. Countries like, you know, Australia and South Korea that had really highly trusted institutions seem to have done better than. But yeah, well, we could get into that. But in the United States, we would be right not to trust the institution, right? But here's the thing and the tricky thing. When I'll speak about media, which is like the one I know best, which is we were always right not to trust them. Like, I mean, I was in, we were, I was in newsrooms in, you know, the late 90s. I was in and, and, you know, you could like, I was covering cops in Indianapolis in 1999.  And by the end of the day would have sorted some of that stuff out. And the story that was published the next day would actually be mostly accurate, but occasionally inaccurate and would correct.    It's just like now you can see it, right? And I think that's true of a lot of these institutions.  Well, when you own the mistakes, right? Yeah. And when you can't create this kind of mystique that was never really justified. So let me ask you two questions that relate to Buzzfeed. Part of what we talked about where you guys debunk the mega story, which is that Russian interference in the 2000 election, particularly in places like Facebook, that's what tipped, you know, the balance to Trump who, you know, one with less than 47% of the popular vote, squeaked in, you guys debunk that. But that seems to be a very strong narrative that people still kind of persist in believing. Yes. But then you also made the decision to publish the Steele dossier, which was originally compiled by people who were related to Hillary Clinton's campaign or was used in that term. Most of this annual remember the Steele dossier was the source of the idea that there was a the p-tape of Donald Trump, which I hope for God, even if it's true, it never sees the light of day because I already have nightmares. But, you know, can you talk a little bit about like most of the Steele dossier has been debunked? Yeah. What went into your decision-making to say, okay, we're going with this? And then what's the effect of something like that on trusted media? That's a good question. I think, you know, I certainly came to that decision and in general to, you know, with like the sort of Gawker mindset in a way that we should be saying to our audience the same thing we're saying to each other, that it seems crazy that you and I would have a conversation and then a lawyer, a doctor, a teacher, a construction worker who was in our audience would say, hey, what are you talking about? We'd be like, sorry, you're not smart enough to understand this. And so when we got the dossier, and a lot of journalists have been given the dossier by, it was compiled by actually at that time very well regarded former British spy involved in the FIFA investigations and knew a lot of journalists from that. There's a fantastic book about all of this, too, which is worth reading whose name, of course. Barry Meyer? Yeah. Yeah, great book. And so we like, I think, everybody else. We got the dossier later and threw a weird side door, and so we weren't bound to secrecy. But also we did what I think everybody else did. We sent a reporter to Prague to see if she could figure out if Michael Cohen had been there. She went from hotel to hotel showing his picture. And it's amazing. People at hotels, I guess in Prague, at least, will just check their guest registry for you. Wow. If you're sort of a charming, friendly young reporter, apparently. And went to Moscow to talk to see if anybody at the Ritz-Carlton would discuss this with us. And I think, you know, I was already thinking like, huh, at some point we should, every journalist in Washington has seen this thing, all the intelligence officials, a lot of the senators, Harry Reid has written an open letter to James Comey saying, he knows that Comey has compromising information on Trump, demanding he release it. McCain is acting super weird in a way that you don't really understand unless you know about this. So at some point you're kind of like, this is like, this is the dark matter of Washington and everyone is in on it except for the reader. It's hard to explain what's going on, actually, without some reference to it. And it's starting to bleed into the public a little. And so we're thinking about like, how do we cover it? And then this is where it wasn't really like this grand principle. Like there's a very specific thing that happens, which is CNN reports that this previously secret document has been briefed to two presidents, to the President Obama and President-elect Trump, and that it is full of, and that it alleges that Trump was compromised by the Russians. And at that point to me, it's like I'm holding in my hands a list of suspected communists of the State Department. Like you can't show the document. You cannot report on it, which is where we were, but you can't show it and then say, but it'll burn your eyes out if you look at it. I just think that's not a tenable position, so that's why we published it.