First open Anaconda, then launch the jupyter notebook. Then create new python 3 file. Here we will discuss NumPy arrays and codes. Let's print an array. Oh ! Was it easy ? Yes .It was. Now we will import numpy and use that to assign the array to a variable, and some other things also will try ... Here, I created an array . Then I imported NumPy as np . Then I used np to set the array to the variable arr. 2D array NumPy There are 2 braces in the beginning so 2D array.3 rows 3 columns. arrange is used to quickly generate an array in NumPy of certain condition or in normal as per above example. link space --------------: here the third argument is considered as no of points as you want where as arrange take it as steps as you want. identity matrix randn() shows a standard normal distribution. randn() in 2 Dimension Printing random integer using randint() max() for finding the highest number in the array and min() for the lowest number. argmax() used to show the index of the max...
package com.mgt.springdemo; import org.springframework.context.support.ClassPathXmlApplicationContext; public class SpringApp { public static void main(String[] args) { // load the spring configuration file ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); // retrieve bean from spring container Book b= context.getBean("myBook", Book.class); // call methods on the bean System.out.println(b.getBookDetail()); // close the context context.close(); } }
Bonus: Deploying your App to Tomcat as a Web Application Archive (WAR) file When you deploy your Java web apps, you can make use of a Web Application Archive (WAR) file. The Web Application Archive (WAR) file is a compressed version of your web application. It uses the zip file format but the file has the .war extension. If you are using Eclipse, then the best way to visualize it is think of your "WebContent" directory being compressed as a zip file with the .war extension. This includes all of your web pages, images, css etc. It also includes the WEB-INF directory which includes your classes in WEB-INF/classes and supporting JAR files in WEB-INF/lib. The WAR file format is part of the Java EE / Servlet specification. As a result, all Java EE servers support this format (ie jboss, weblogic, websphere, glassfish and tomcat). Below, I provide steps on how to create a WAR file in Eclipse. I also show how to deploy the WAR file on Tomcat. --- 1. In Eclipse, stop ...
Comments
Post a Comment