 Hello everyone, this is Amol Hattwar with me, our colleagues from JP Morgan, JSN company. We are here to answer your questions from the weekly recording. So that's mainly Python, test-driven development, HTTP APIs, microservices, Git, software, development, lifecycle, and so on and so forth. So if you have had any questions and you've not had a chance to put it on the discussion forums, now is the time to ask. Before we continue like usual, everything that me and my colleagues say over here is from their personal and professional experience and it doesn't reflect the position or the opinion of our companies. So let's get started. What questions we'll take first? Python and TDD? Yeah. So whoever has any questions, please press the hand raise button. Please press the hand raise button. If anyone has any questions or we will select people randomly. So I hope all of you have gone through the different courses that we recorded and if there are any questions on or maybe we can take specific topics or we can go through the different universities and then we can take questions from those universities. So let's start with some university. So let's start with GH Raishoni College. Let's see if they have any questions. So GH Raishoni is in Nagpur, I guess, right? How's the weather there, very hot? Hello. Hello. Yeah, so. Hello, sir. Yeah. So do you have any questions on? I'm from GH Raishoni College of Engineering and Nagpur. Yeah. Please go ahead. Does the class have any questions? Wait, I'm asking to the students. Yeah, yeah, I'm asking to the students. So the question is only technical regarding if you had the question only technical part. Yes, yes, sure. Any question at all? One minute. Yeah, we're waiting. Looks like GH Raishoni College has disconnected. Let's go to Walshian Institute of Technology. Any questions on any topics that you have seen, be it artificial intelligence, blockchain, Python, TDD, gate? Sir, in previous, earlier presentation, you told about DMAT account. Yes. I want to know what is DMAT account, what is the difference between saving account and that DMAT account? Okay. So the answer is actually very simple. So in the olden days, when you would get shares or you would buy shares, the company will print share certificates on paper. Okay, it's like your certificate of ownership or any other kind of degree certificate, right? And that certificate would mention your name and how many shares you held, okay? Now if you want to sell that share to someone else, that someone else will also have to get his name attested on that share certificate. So he will send a share certificate to the company, say that I purchased the share certificate from so on and so, and then the company will send him a new share certificate. Now the problem is these certificates could be forged. Okay, you can make duplicate share certificates and so on and so forth, right? And whether the person really has the shares or doesn't have the shares, that also has to be verified by the company. So, and the process, the trading process will take a lot of time. So from the actual buying to the actual transfer of shares, the trading process would take a lot of time. So what happens is when you have a DMAT account, you get rid of the share certificates. So instead of having a share certificate that tells you that so and so person holds so many number of shares, now you have the DMAT account which keeps a track of how many shares you held, when did you buy them? And for how long you have? So when you sell the shares to someone else, it's a DMAT account to DMAT account transfer. So in that sense, the DMAT account is keeping a track of your shares and the certificates paper is gotten rid of. And in the bank account, similar thing, they are keeping a track of your money and whenever you want a currency or a currency note or coins or whatever, you go to your bank account and withdraw them. So you can think of DMAT account in the same way. So whenever you want to transfer your shares to someone else, you tell your DMAT account that this thing have to be transferred or your broker or your exchange will tell, they'll coordinate with the DMAT account to get that share transferred to somebody else. Does that answer your question? Thank you, sir. My question is related to technical. Okay. Does MVC apply only to web? Not true. MVC applies to a lot of other places as well. For example, if you've seen Microsoft Excel, right? Your model is basically rows and columns, right? And you can change those rows and columns into graphs, right? Or a pie chart, okay? So that's your view. And whatever you're doing using a mouse and keyboard, that is taken care by the controller layer. So it's not only related to web, but there are other applications also. Subin, you want to add something? So MVC is a very popular architecture. There are different kinds of MVC, MVC one, two, and so on and so forth. You can probably look it up. But it's not compulsory that it has to be on the web. So anything that has a view, user interface, I think that's where MVC can be applicable, right? As Ambul mentioned in case of Excel, Excel is also a user interface, right? If you look at it in that way. And it has a view and it has a controller, as you explained, and a model attached to it. So it's a paradigm and it can be applicable to anything that has these three properties. Okay, sir. Next question is, what are filters in MVC? Want to take this? I can take it. Okay. So depending on where you are applying filters, right? So filters are generally applied on the view side. So if your model has too much of data, right? And you do not want to display all that data on the view, right? So you would put some filtering logic on the view side or on the controller side. For example, if your model has data like, you know, what are the marks all the students got, okay? For a particular topic, okay? And your view is only displaying the average. You don't want to display all the marks. So you'll write a filter, either in the controller or in the view or probably even in the model that will just return the average. And that you will propagate through your chain and display it accordingly. So that's the basis of filters. Filters can also be applied on the input side. So if you're taking something from the user and storing it in a database, okay? So you might want to filter that input, take out extra spaces, verify whether it's a proper email address or not, or figure out whether it's a strong password or not. And you know, you can apply filters there as well. Just to add to Amul's response, filters are also applicable in the web server where there are kind of servlets, right? Which intercept the request that comes from the front end. You can have a filter at that place as well to kind of filter certain things. Like for example, if you want to do some added security, right, whatever request is coming and you want to do some security checks before you pass the request to the web server or to the application server, you can do those things in the filter. So in that sense, also a filter is applicable. Another question is, what is the difference between MVC and ASP.NET web API? So ASP.NET web API is something that Microsoft makes. You can, and MVC on the other hand, is something that is an industry norm. It's a design pattern. It is something that you can adhere to. So using ASP.NET web APIs, you can implement something like an MVC framework, okay? So what basically the main difference is that MVC is a concept, okay? And ASP.NET web API is something that you can use to implement something like a MVC framework, so on and so forth. So the main concept to understand here is, just like you have SQL, right? And SQL will work in Postgre, SQL, MySQL, Oracle, DB2, so on and so forth. So SQL is a standard on a conceptual level and different vendors come in, implement that standard for their RDBMS. So you can look at ASP.NET web API as something that you can use to implement something like a MVC kind of conceptual model. Thank you, sir. Hello, sir. Yes. My question is, does applications such as OLX works on OTC, where negotiation takes place? Is it true? Hello, we lost you. Can you repeat the question? Hello, sir. Yeah. Does application such as OLX works on OTC? What do you mean by OTC? Over the counter? Over the counter. Okay. Okay, so I don't think we are OLX engineers. We don't know what happens inside. Does anybody else? Okay. Can you take it in the forum? Because we are not sure, you know, the person who gave the previous presentation is no longer here. So maybe she can answer it on the forums. Thank you, sir. Yeah, sorry. Very sorry for that. MediCabs Institute? Just two of you. Thank you for coming. Hello, sir. Hello. Hello, good afternoon, sir. Good afternoon. Sir, I want to ask that I'm in pre-final year and now currently I have to submit a project. So I'm thinking to make a project using a machine learning concept. Okay. And for the front end, I want to use development. So can I use bootstrap, your HTML, CSS, plus with machine learning in backend? Yes, you can. So how can I proceed to, how can I use it? One second. So I think your question can be taken with a larger answer. And also we may answer to some of the questions that were asked from the previous university. In any software system, you have data, you have processing, and you typically have a way of distributing the data either through a file or an HTTP mechanism to other systems or you want to show it to some user. That is what makes that data useful. So when you divide up your application, you have different functionalities and tools and frameworks and methodologies that you apply to all these three things. You can store and process data in different ways from databases, from in-memory databases going all the way to big memory and big data databases. For processing, you can use a server or you can use very distributed systems that are in the cloud. And then finally for viewing the data, you've got many technologies, server-side rendering or rendering your data on the website in a browser or inside a different application that is proprietary. So for example, when you code for mobile, you may not want to choose web. You could choose a native interface like Android or Apple or if anyone else exists. So coding for the UI, the processing and the data, three separate things. And you can code anything as a visualization in a UI that points to a small database or in big database that is doing machine learning. You can do the processing in any language whether it's Java or C-Sharp or Python. And we might recommend that some languages are more suited for ML, let's say Python, because not because Python is a good language to code in, they, you know, all languages are good to code in, but because Python has some libraries that will help you do it faster. Similarly for ML, you might choose any sort of data platform that makes you most productive based on what sort of resources like hardware or cloud info are available to you. So you can easily code the visualization in web or if you want to do it on mobile, you can do it on Android. For web, there are definitely many tools that are out there like D3 or I'm not sure like in ML, how you're going to present the results. But you can do any sort of UI in a web browser. So don't think of it all as one big stack. And just to answer then that same question that was asked on MVC, see MVC started in the days of a language called small talk. And in those days when we used to code UIs, we would code the UI, the processing and the data access all in the same class or the same data structure. And this made changes in database and updating the UIs very, very messy. So the MVC pattern was then evolved that said let us separate out the layers which is view, controller and model. And model typically refers to processing and database where controller refers to just a layer that controls the flow of data between view and processing and database. And the view is obviously the view in Android, the view is that XML in browser, it is HTML. Right, so you can make many different views using the same controller. So that is also the difference between something like when we say MVC is a pattern versus ASP is a framework to apply MVC. So I hope that answers your question in a long, long-rounded, in a long way. Hello. Yes. Sir, I want to ask that for some week ago, I have made a project using a servlet and for front-end bus, but instead of using this, I want to use Python. Just like that too. So when you say servlet, I assume you meant Java, right? Yes, sir. So, see, regardless of the language, what happens internally is everything is getting converted into machine code. Now, essentially, whether it's Python, Java or Golang or something in the future you might be using or Ruby, you are hosting a server which is listening on a port for requests coming from an HTTP browser or an Android application or an Apple application. So you're doing the same thing. You are not trading anything for Java or for Python. If you feel you are very productive in Python, then definitely go for it. I mean, do you like Python? Yes, sir. Then go for it. Yes, sir. Thank you, sir. Thank you. You're welcome. IIS University, please check your mic. Hello, any questions? You're not audible. Please check your mic. Good afternoon, sir. Good afternoon. Go ahead. Sir, I wanted to ask the question about DDD. What is the purpose of DDD? Did you say DDD or TDD? TDD. Test-driven. DDD, domain-driven design. Okay, domain-driven design. So, basically, domain-driven design is kind of a concept where you focus more on the domain. You understand the domain well before you start designing the system. So, there is a concept of a ubiquitous language which this paradigm promotes. The ubiquitous language is basically the same language that everyone is speaking. Because typically what happens in a software development process is that the person who is giving the requirements is speaking one language. The person who is taking the requirements who is most probably the developer or the one who is going to design the system is speaking another language. So, we kind of arrive at a common language which is called the ubiquitous language. And that's what the domain-driven design promotes. And then once we come on that common platform, then we start speaking the same language. And then we start taking the requirements and start designing the system. So, this concept was kind of envisaged by a person called Eric Evans, a domain-driven design. He had also written a book on it. So, there are a few key ideas that he promulgated as part of this domain-driven design. So, he said that in any system there are these common things which kind of are always there, like entities, right? So, for example, if you are designing a banking system, what will be your entities? Your entities will be like bank, account, customer. So, these will be your entities. Then you want to always do something on data, right? So, you will be storing those entities in some data store. Now, when you are going to store those entities in those data store, you would also be retrieving them at a later point in time. So, all this retrieval logic, you put this retrieval logic in something known as a repository, okay? Typically, what happens in software systems is that as time goes by, right, people start writing data access logic in different pieces of code, and then it starts getting pretty dirty. So, that is why domain-driven design kind of says that, you know, you put all your data access logic in a common component called the repository. Then if you come a little bit ahead, then we have something known as domain services, okay? So, for example, a domain service will only focus on a particular domain concept. For example, you might have an account service. So, account service will only deal with accounts. It will not deal with customers. It might take a customer, but it will not specialize in customers as such, okay? It will specialize more in accounts. And then if you come a little bit to the upper level, then there is something known as the application service, okay? So, domain service, and then on top of that, you have an application service. So, you can think of an application service as some sort of an orchestrator, where the request is coming from the user or from the front end, and it is kind of orchestrating it by using different domain services. So, one application service might deal with multiple domain services. For example, it might deal with a customer service. It might deal with an account service. And then each domain service, in turn, uses the repository to basically persist the entities or retrieve the entities. Now, there are many other advanced concepts in domain-driven design like aggregates. So, if there is an entity, an entity is kind of very standalone, but you can have a group of entities which makes a complete whole, right? So, that is called an aggregate. For example, a car. A car might have wheels. A car might have an engine. So, that forms the aggregate. Car, the engine and the wheels. So, again to kind of summarize what I have said, domain-driven design kind of promotes this ubiquitous language, so that everyone comes on the same page, same platform, and they talk the same thing. They do not talk in terms of Java. They do not talk in terms of Python. They talk only in terms of the domain, so that what comes out is something really useful. Otherwise, if everyone is talking in a different language, you do not know English, right? And you are talking to me in Hindi and I do not know Hindi, then we are not going to go anywhere. So, the same concept applies here, that everyone talks the same language and in order to aid that process, there are certain things that we use like class diagrams, sequence diagrams, right? But they are tools, but the concept is the domain. So, I hope I have kind of answered your question. If not, then you can please. Thank you, sir. Namaskar, sir. Namaskar. Please go ahead. Sir, can you brief us about lazy loading, concept of lazy loading? Sure. So, before we understand lazy loading, let us understand eager loading, right? So, let us say that we are basically loading some data, okay? Now, we need some data to do some work, right? And there is some data which is associated with that data as well, okay? When we do eager loading, we also load that data that is associated with the main data. For example, let's say that I have a customer, a customer has many accounts. So, suppose I am loading a customer. Now, eager, if I am loading eagerly, I would also load all the accounts of the customer, whether I need them or not, right? So, what is the problem in this mechanism? You only need the customer, but you have actually loaded all the accounts as well. So, that is an expensive operation, right? Even though you don't need them. So, the concept of lazy loading says that you load data only when you need it. So, you become kind of lazy, right? You don't fetch everything eagerly, you kind of fetch everything lazily. So, when you need it, you load it. So, that's what lazy loading is all about. So, it is, yeah. So, another concrete example for lazy loading is when you do some kind of search on Amazon or Google or something of that sort. You get a lot of results. Now, the choice is to keep all the results in memory, because all the results are not going to be displayed at the same time, right? You just display the top 15 or the top 20 depending on what is the page limit. And when you click next, then you will get results from 21 to 40 and so on and so forth. This is an eager candidate for lazy loading. So, you can load only when it is requested by the view. Otherwise, don't load that entire result set in memory and hog resources, right? Because at the end of the day, no matter how much money you throw, RAM is computer memory will always be limited, processing power will always be limited, disk will always be limited. So, you only load the data when you need to display it. So, that is lazy loading. This is a concrete example where lazy loading is used. If you want to add, yeah. Does that answer your question? Thank you, sir. Good afternoon, sir. Sir, how Python is different from other languages? Saurabh is our expert here for Python. I will talk about the other languages but I will let Saurabh talk about Python. So, all languages kind of are more or less similar. It is not that Python is the best language. It all depends on how you want to take it forward, right? It depends on what your predilection is. Some people like Java, that doesn't mean that Python is a bad language or some people like Python, right? That doesn't make all every other language unusable. So, it all depends on you but there are certain things, right, which kind of stand out with respect to Python. One of the most important things is that it's very easy to develop code in Python, okay? So, in Python less is more. That is the concept that it is based on. Less is more. You have to write little code and you can do a lot in that little code. On the other hand, if you look at languages like Java, for example, they are quite verbose in that sense, right? You have to do a lot of plumbing, a lot of verbosities introduced in order to do a simple thing, like maybe reading a file. But if you look at the same piece of code in Python, it's quite concise in that sense. So, Python really improves developer productivity because of this less is more concept. It has, you know, the code is very, very beautiful to look at because it does away with a lot of syntactic sugar which is present in other languages. For example, just to give you an example, Python, the way indentation works in Python is by tap spacing. It doesn't have curly braces, it doesn't have square braces, nothing of that sort. It just has, it indentation is through tap spacing. So, it makes it very easy to read the code. And it has a lot of community support today, right? Almost as good as Java now because Java used to be the language of choice for a long time, right? When I started developing code around 18 years back almost, Java was the only de facto standard. Of course, there is the .NET world as well but other than the .NET world, Java was the de facto standard for most companies. But we see that changing now with languages like Python coming up and R and all those things which are bringing a lot to the table, right? So, to cut this long story short, I think why you would use Python is because if you want to kind of improve developer productivity, then you would want to go for Python. It has a lot of community support as well. Lot of libraries out of the box, right? Which basically means that you do not have to reinvent the wheel because most of the stuff is already there in the libraries. You can just reuse them and the community support, of course. So, whatever problem you are facing, you can quickly go on the internet and there are a lot of communities, right? Throughout the net which and whatever problem you are facing, I am sure you will easily get a solution to that problem. If anyone wants to add. So, I will give a different point of view and this covers all languages and I hope this is going on to all the universities we are answering this question. First of all, when you want to program in a language, think about the philosophy of that language and why it was developed. C is a system programming language. So, when you program things like an operating system, you would not use Python regardless of anything that the Python community might say and nowadays C is being replaced by Rust by Go. So, this is why Java is a general purpose programming language. It was built to run on many different operating systems and processors but staying agnostic for the developers, right? So, it has a runtime that is specifically targeted to an architecture but you have the same code and this is why Java became popular. Java also introduced garbage collection. Python is an interpreted language. Ruby is interpreted and dynamic. So, when you look at the philosophy of Ruby, Ruby is used for making things like domain-specific languages because you can redefine the language itself in Ruby and Groovy. So, each of these languages were targeted for a particular purpose. Scala was targeted at being a multi-core friendly language even though it uses Java, it forces you to code as if there are many processors and your systems are distributed. So, do not pick up a language because you think that a language is fashionable, okay? And do not be religious in terms of technology. You need to use the best tool for the problem that you have at hand. If you have a machine learning problem, you might use Python or R or Scala. If you use a different problem like big data, think about the languages that you will code in based on the tool sets that are available out there. There are only some very high-level differences. There are two types generally of known paradigms of programming language. There is imperative style and there is data flow. So, I am not going to go into that but I would say keep that as some sort of homework that you should go back and do. What is imperative style of programming? Why do all languages today that we use use that kind of style? And another language coming up is Golang which I would recommend you to look at because it is a compile language whereas others are interpreted so performance is important to you. And finally, in terms of productivity, this is a very contentious topic. Is the language productive or is the programmer productive? And when we go through all the tools that we talked about in this course, test-driven development, agile methodology and you should ask some questions on agile and APIs. All these patterns are devised so that you develop code with the least amount of bugs in it. And literally when it comes to productivity, the most amount of time lost is not in coding or typing characters. It is in solving bugs. So you should look at any sort of tooling as part of the language stack that helps you achieve the most amount of testing and coverage in a productive way. So another perspective from my side so whenever you are dealing with problems, right? For example, you have let's say a college management or a university management application. So there the things in your problem will deal with students, with professors, with classrooms, with scheduling, with fees and so on and so forth. So these are the concepts that are there in your problem space. Then we come to how do you solve this problem? If you are using a computer, the solution space will involve stuff like classes or objects. If the language doesn't give you classes on objects, let's say you are programming in assembly, then all you have is bits in certain operations like JNZ, add, mull, subtract. The difference between your solution space and your problem space, if you are I'm not saying that you can't make a college management system in assembly, you can. But the difference between your solution space and your problem space becomes very huge. If you come one level above, let's say you want to do this and see again it's possible, but you will not get object oriented features and so on and so forth. You can do it in C++, you can do it in Python, you can do it in Java. So what you have to measure is what is the distance between my solution space and my problem space? And you should choose a route that allows you to address your problem space from the solution space in the quickest with the least effort possible. Having said that, many general programming languages like Java, Python, Ruby, all of them will work well and you should also focus on learning stuff that will allow you to address a lot of problem domains. So just by learning Python, I can do object oriented programming, I can do ML, I can do web programming, I can do GTK programming, I can do GUIs, I can paint stuff on the screen on Linux and other kind of operating systems where you get appropriate GTK kind of toolkits. So you should always try to look at programming languages as tools and not as a religion like Zubin says. And you should always look at how to make your own life easier. And at the end of the day, every language is going to have variables, assignments, if, different kinds of looping structures. Unless you go into some crazy languages like Haskell or Erlang which will not have variable assignments and so on and so forth. So what I want to say is that you should look at languages as tools and you should select a tool that allows you to go from your solution space to the problem space in the shortest possible time and effort. Does that make sense? One more question. How Python helps in recognizing pattern in media files? How Python helps in recognizing patterns in media files? Media files. So what kind of patterns do you mean? Biometric, for recognizing biometric patterns or sound waves, video recognition image processing. So Python as per doesn't have any inbuilt functionality to do this but Intel has a toolkit called as OpenCV. So OpenCV is short for Open Computer Vision. For example I know of a project where students would keep different kinds of coins on the table, there would be a video camera that would look at the coins and depending on the size of the coins, it will not only give you a number of the coins on the table but also the value. So if you have let's say a 10 rupee coin, a 5 rupee coin and a 2 rupee coin, they will tell you that there are 3 coins on the table and they all add up to the value of 17. So they actually made a coin counting machine using Python and OpenCV. So detecting patterns you might want to use external libraries to Python. OpenCV is a popular one and I love you to detect patterns when it comes to image and media files and things like that and it can also do some audio stuff but if you just want to do pure audio stuff, then you know maybe you might want to search for other libraries. Thank you sir. Lucky Ready College Andhra Pradesh Good evening sir. Good evening. So my question is, why do we have to invest in Bitcoin when Microsoft talks about Bitcoin? I mean, why Bitcoin gives no returns? Let me know the process of Bitcoin exchange. Your question is related to Bitcoin? Can you repeat the question? Why we have to invest in Bitcoins that is why Bitcoin gives more returns compared to stocks and mutual funds? Let me know the process of Bitcoin exchange. So your question is if I get it correctly is why would you invest in Bitcoin compared to other different coins and stock exchanges? Okay. So don't take this as an investment advice. People say that Bitcoin is a cryptocurrency but let me advise you against it. The basic property of a currency is to not be volatile. So you look at the most volatile physical currency and you plot the volatility of that currency against the volatility of Bitcoin and you will see that the most volatile currency on planet earth which happens to be the currency of Zimbabwe that appears as a flat line and the Bitcoin volatility by volatility I mean the ups and downs in the price So by definition a currency has to be stable. If the currency is volatile that means it cannot be trusted as a currency so that makes Bitcoin not a currency you can look at it as a cryptographic asset which has some value Now why would you want to invest in it? I don't know you have to find out that reason yourself maybe but then as I like I tell you you want to kind of invest in anything you have to whether or not whether you are buying first you always have to buy cheap and sell at a higher price So if you want to invest in a house with the goal of selling it then you will buy at a lower price and sell at a higher price If you want to invest in stocks you want to buy at a lower price and sell at a higher price If you don't do that you are not going to make a profit So as of now the way Bitcoin is growing and the way it has crashed it's very volatile I would not recommend anybody to invest anything in cryptocurrencies unless you exactly know what you are doing and compared to Bitcoin stock markets are a safer choice because stock markets are regulated Bitcoin exchanges are not regulated as of now you can put money in a Bitcoin exchange and tomorrow if the exchange goes away your Bitcoins or whatever Ethereum or Ethos are lost that will not happen in the stock exchange The other thing is that to give you something tangible you have become an owner in the company Bitcoin has no kind of tangible value attached to it that's one reason where we feel that the cryptocurrency space is very young and evolving I don't know where it goes but as of now unless you exactly know what you are doing do not invest in any kind of cryptocurrency and always there are investments that are well regulated rather than making speculative investments you want to add something Zubin? does that answer your question? yes sir I have another question how the process of exchange because related to general stock exchange how is the how the Bitcoin exchange depends on general stock exchange general stock exchange okay if I get your question properly you are asking the difference between a general stock exchange and a Bitcoin exchange so fundamentally both of them are actually very similar the stock exchange will have different kind of back end functions to deal with banks and agencies that allow for dematerialization and so on and so forth the exchange will actually deal with the blockchain and with banks and credit cards so that's it the matching engines for both of them are very similar but at the end of the day you have to look at the scrutiny that a stock exchange will undergo from regulators for India it is SEBI for other countries there are other regulators in the US it is SEC so maybe your code will be audited the stock exchange security will have to be much much higher the number of trades per second that it is allowed it should be able to do will be much much higher whereas in Bitcoin there are no regulations so maybe somebody very young or very inexperienced can just get together and write an exchange and go live tomorrow without any regulation but what if the code has bugs what if the code has security holes those things are not known that person is going to make a huge loss if many people end up trusting him so though the matching engines and the fundamental concepts of order types orders and so on and so forth might be the same but when it comes from a regulatory standpoint the matching engines and the processes inside a traditional stock exchange are much much stronger because they are supposed to be much much stronger than what is not regulated as you were talking about how it will be taught excuse me did not I am sorry I cannot currency yes I am not sure I understand your question can you type it somewhere can you type it on chat yes B.L.D.A college B.Japur good afternoon my question is how can B.H.U. multi-threading in python sir want to take it ok so python you know it is a quite contentious topic multi-threading in python because there is an inherent design pattern in python known as the global interpreter lock GIL ok so the designer of the python language said that multi-threading kind of creates a lot of problems so that is why they designed it in such a manner that at one point in time no two threads can run can ever run ok but there are of course caveats to that which we will get into later but at a very basic level there is nothing nothing that can run parallel or concurrently in python so at any point in time because of the global interpreter lock a CPU will always service only one thread ok so now someone might ask the question how do we achieve parallelism? if there are multiple cores in the CPU then how can you ever exploit all those cores so python the multi-threading in python if at all you are doing some IO operation then at that time the global interpreter lock is released so only computations that happen that require the CPU they cannot happen in parallel but if at all you are doing some IO operation for example if you are getting data from a database if you are going to another API and getting data from that API so all these are IO operations so at that point in time the global interpreter lock is released and concurrent operations can happen but if you are doing some computations which require CPU activity then only one and only one thread can ever run now again come back to the same question how do we achieve parallelism in that case in which you can do that there is a concept called multiprocessing in python there is a package called multiprocessing or a module called multiprocessing so the way it works is it spawns of multiple processes and all those processes can truly run in parallel but again it also comes with its own set of problems if you want to ever do kind of communication between those multiple processes then you have to use queues and all that kind of gets into a dirty zone so if you don't have anything that is shared between those processes then yes you can use it but if at all you want to share something then you have to be very very careful because you can get into problems because of that inter process communication so I hope that answers your question one more question is python important corporate world sorry very much lot of companies and organizations are using python I am not sure if I am allowed to take names but companies like facebook google, amazon they are using python in a big way even our company the company that I work in uses python so yes python in that sense is being used a lot in organizations it is not just for college projects for simple main programs or something like that it is being used in enterprise level projects as well hello, please go ahead hi sir before in my last project I worked with Cordova and I use RESTFULK API and use get method in that after my completing that I face a error that the RESTFULK is I can't get the RESTFULK from the RESTFULK so when I search for the solution I get that RESTFULK API can't send a big amount of data is it correct or the solution and I use get method am I right or should I use put method I understand your question right here you are saying that RESTFULK API cannot take big amount of data is that your question yes I am sorry can you please repeat the question a little louder my question is while we are using RESTFULK API with json can we use get method is it apt for that and is there any problem using RESTFULK API when the data is bigger it can respond or not okay so a get you do not use json you get only works on the URL parameters in the request so in the request you might say that I am hitting a particular internet address and there are some query parameters that you put like maybe account is equal to and name is equal to and user ID is equal to there will be something about authentication that you can put in the header a get request can carry the optional body but it is always ignored no server ever reads the body for a get request if you want to have a very very large body for a get request you essentially cannot do it and you must question what you are trying to do so maybe you can use post or put but if you are trying to get some data from a server you should not have to give it a large amount of data in the first place so json can come as a response if you have to send json to server you must use post or put or delete or any of the other operations based on what you are trying to do I think your mic is off you are not audible hello thank you good evening sir good evening sir good evening am I audible to you sir I want to ask that what is the difference between microservices and api okay so they are not the same thing at all and api is and it expands to application programming interface and api is one of the reasons but ultimately the purpose of technology and programmers is to give business functionality and the money is made on the business functionality and the people are using that functionality and the developer the business of uber is the cabs and not developing anything in python if you are in twitter and you are writing something machine learning but the purpose of twitter is to provide tweets and advertising and similarly if you are going to do financial programming of stock exchange the purpose of that is to match stocks it is not to teach everybody and make python popular in the best language in the world so it may be that and you might feel strongly about a particular language but ultimately the industry has got so many languages used because the industry is trying to solve different problems and these languages were each invented to solve different problems I will add on to that answer a little bit in many cases you know you find that things are almost unsolvable and there are quite few languages that are used to do difficult stuff by difficult stuff I mean let's say for an example you are sending a satellite into space to let's say land on mars and by the time you land on mars maybe 5 years or 6 years have gone by and within that 5 or 6 years you have discovered that your software has a bug which will not allow it to enter the atmosphere of mars now your requirement has changed now when the satellite is actually on its way to mars you have to change the code while the code is running not all languages support that there is a very mathematics oriented language called as Erlang that is used for this kind of purposes where you can change the code while the code is running so this is you know you can look at it as changing the jet engine of an aircraft while the aircraft is flying and Erlang is widely used in the telecom sector where things cannot be allowed to fail and similarly there is another language called as Haskell Haskell is used where mathematical provability is required basically you need to prove using mathematics that your software actually works and is bug free so there are different niche areas where you know very esoteric different kinds of languages are used that said the computer language is always designed for a particular purpose either it is general purpose like python and java or c++ or you might have some language just for programming a certain kind of small set of problems you might have languages that require special properties like share transaction memory and mathematical probability and so on so forth so that's a reason why because the industry has so many languages because there are different kinds of problems and one language cannot solve them all you have mic problems you are not audible hello sir hello my question is in an escrow example we require an agent between two end user to make smart contract actually no we can eliminate the kind of roles and responsibilities the agent plays but because our smart contract is based on the property of we need two signers out of three so those two signers could be the buyer and the seller or it could be the seller and the escrow agent or it could be the buyer and the escrow agent so because the way our smart contract is designed to allow for two out of three signers we can't really eliminate the escrow agent but we can make sure that the escrow agent doesn't have too much of a burden of our responsibilities so look at it in this way for example the buyer has put the money in the escrow and the seller has shipped the goods but if the buyer did not get the goods or if the buyer got a bar of soap in a packet of let's say an iPhone or something of that sort then the buyer can send the pics to the escrow agent and the escrow agent will be happy that the buyer has reported that he did not get the goods so though the buyer has sent and signed the contract and the seller might not the escrow agent will not sign it and the seller if he signs the money will not get transferred because the buyer has not signed it also you can look it from the seller's point of view for example if the buyer is promising to pay the money the money is with the escrow and the seller has shipped the goods and if the buyer is saying no that these goods are not proper then the escrow agent will go and investigate if he says that okay the shipping bill looks okay the material when it left the seller's factory look okay maybe the buyer is cheating and on investigation if the escrow agent finds that you know the buyer is really cheated then the escrow agent will sign and the seller will sign and the money will get transferred so the reason why escrow is being used is because the buyer does not know the seller and the seller does not know the buyer so obviously they don't trust each other the escrow agent is brokering trust so that's the fundamental of the escrow agent because both the buyer and the seller trust the escrow agent so escrow agents cannot be replaced but their responsibilities and the way they go about their jobs can be reduced to a good degree using smart contracts ishya pacific institute good afternoon can you repeat your question with the mic a little closer to your mouse how servlet communicates with jsp, java bean and the base and servles like tomcat web sphere and web logic so your question is how do servlets communicate with jsp java beans and with servlets like web logic tomcat is that correct did i get the question right yes sir so first of all let's understand what servlets are so servlets are basically components which are deployed in servers like web logic and tomcat you can think of them as servlet containers in which you can deploy these components with servlets and once you deploy those servlets in those containers then you can start using those servlets basically you can start sending data to those servlets and the servlets will then basically process that data and then return a response to you so in that sense a servlet is kind of a reusable component through which you can communicate you can send data to it over http you can send any kind of data to it you can send data in xml format or you can send it as url parameters as well you might have seen on the browser there is a url and then there is a question mark and then you send certain key value parameters x equal to something y equal to something and so on so these are url parameters so those parameters can also be intercepted by servlets so why do we need servlets basically you can think of them as the gateways into your application whenever you want to interact with your application server either through the frontend or through some other system you can make a call to the servlet and that servlet will then take that request and process it and return the response to you now what are java beans java beans are nothing but simple java objects you can also call them pojos plain old java objects they have basically some state they might not necessarily have behavior but you can also have behavior if you want to but generally we do not put behavior in pojos then they are not called pojos they are called entities so typically the way a software system is built is that you know on the frontend you take user input and then you convert it into some sort of message payload either it is json or xml send it to the servlet the servlet will then convert that xml payload or json payload into a object generally if your application is built on java you would want to deal with objects you would not want to massage xml in your application xml is just the means of communicating with your application so once it gets converted into object it then becomes a pojo or a java bean and then you can pass it around your application you can do stuff with it you can get data set data on it and then return it back and when it is returned back either xml or json and then get sent back to the caller now I missed out one thing which is the jsp that you spoke about so jsp is nothing but if you see jsp is actually compiled into a servlet the only difference is that you can write html code inside a jsp so in that sense jsp also acts as a view as well as a controller and lastly you said tomcat and weblogic so tomcat and weblogic are more or less the difference between weblogic and tomcat is that tomcat is only a web container but weblogic is also an application container it can also host enterprise application archives like er files message beans, message queues and all that while tomcat container will not be able to do so it's more or less just a servlet container I hope that answers your question I have a lot of questions what is the significance of a deployment descriptor in java, java web application deployment descriptor you said deployment descriptor right so in a war file you will have servlets and all right in your typical war file so the deployment descriptor basically describes it is a way of declaratively describing what are those different components and for example let's take a servlet so you have a class which will intercept the request for a servlet and it will have a fully qualified class name so you would configure that in your deployment descriptor so that when the web application starts up it knows which class to call when a call comes for this particular servlet so all those things are configured in your deployment descriptor there are other things also like data sources message queues and all that so basically a deployment descriptor kind of tells your web container after the application is deployed how to find things right so if a request is coming for a particular servlet at a particular URL which component should it call when a request comes on this URL so that all is configured in the deployment descriptor I have another doubt why service methods are protected Java web applications have protected service methods why service methods are protected you said sure so let's say that you have a base class which is acting as a service and you might want to kind of extend that and extend the behavior of that base class right so why you would make classes or methods protected is if you want to call that method, that protected method from a derived class then you would want to make it protected so if you make it private then you cannot call it from a derived class as well and you don't want to make it public because you don't want it to be called from any other external component right so that is the only reason why you would want to make it protected external component why cannot we make it public sorry what do you mean by external component why cannot we make it public yeah so your class right is kind of deployed in a bigger application and this particular method you don't want to expose it outside that is the whole concept of information hiding and object oriented programming right certain methods you do not want to be exposed to the outside world you wanted them to be kept private so and there are certain methods which need to be called from a derived class because the derived classes know how to call those methods and know how to make use of them proper use of them so those methods are declared as protected okay so it is one level above private okay but it is one level below public so it is sitting between public and private okay it is not public it is not private but you have the capability to call it from a derived class or classes which are in the same package in case of Java can you give me any real life example sure so let's say that I have a class called say account right which is a base class and I have some derived classes for that account class say savings account and current account now savings account has a different behavior and current account has a much different behavior right but there is something that I want to reuse from the base class okay which is quite common to both but that method that behavior should not be exposed to the outside world it should only be callable from the derived classes that is how I have designed the system so that method I can declare as protected and whenever in the processing of the derived class I need to make use of that functionality or that behavior I can simply call super dot that method which is protected and make use of that so I don't need to code it