This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = float(input("Nhap vao x: ")); | |
eps = float(input("Nhap so sai so :")) | |
s = 1 | |
t = 1 | |
i = 1 | |
while t > eps: | |
t = t * x / i | |
i = i + 1 | |
s = s + t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.2.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_2_0.dtd"> | |
<service-builder | |
package-path="com.blogspot.chingovan.tutorial.database"> | |
<author>chinv</author> | |
<namespace>database</namespace> | |
<entity name="Foo" local-service="true" remote-service="true"> | |
<!-- PK fields --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.2.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_2_0.dtd"> | |
<service-builder | |
package-path="com.blogspot.chingovan.tutorial.database"> | |
<author>chinv</author> | |
<namespace>database</namespace> | |
<entity name="Student" local-service="true" remote-service="true" table="Student"> | |
<!-- PK fields --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ include file="/html/database/init.jsp"%> | |
<% | |
List<Student> students = StudentLocalServiceUtil.getStudents(QueryUtil.ALL_POS, QueryUtil.ALL_POS); | |
for(Student student : students) { | |
%> | |
<span><%= student.getFullName() %></span> | |
<br /> | |
<%} %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ include file="/html/database/init.jsp"%> | |
<% | |
List<Student> students = StudentLocalServiceUtil.getStudents(QueryUtil.ALL_POS, QueryUtil.ALL_POS); | |
for(Student student : students) { | |
%> | |
<span><%= student.getFullName() %></span> | |
<br /> | |
<%} %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ include file="/html/database/init.jsp"%> | |
<portlet:actionURL var="addStudentURL" name="addStudent"> | |
</portlet:actionURL> | |
<aui:form action="<%=addStudentURL%>" method="post"> | |
<aui:input label="code" name="code" type="text" value="" /> | |
<aui:input label="name" name="fullName" type="text" value="" /> | |
<aui:input label="birthday" name="birthday" type="date" value="" /> | |
<aui:input label="gender" name="gender" type="checkbox" value="" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.blogspot.chingovan.tutorial.database; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import javax.portlet.ActionRequest; | |
import javax.portlet.ActionResponse; | |
import com.blogspot.chingovan.tutorial.database.model.Student; | |
import com.blogspot.chingovan.tutorial.database.service.StudentLocalServiceUtil; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = [5, 2, 7, 3, 8, 1] | |
print(a) | |
b = sorted(a) | |
print("List a :" , a) | |
print("List b : ", b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = [5, 2, 7, 3, 8, 1] | |
print(a) | |
b = sorted(a, reverse = True) | |
print("List a :" , a) | |
print("List b : ", b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = ['life', 'is', 'not', 'fair', 'get', 'used', 'to', 'it'] | |
print(a) | |
b = sorted(a) | |
print("List a :" , a) | |
print("List b : ", b) |