Skip to content

Instantly share code, notes, and snippets.

View chingovan's full-sized avatar

Ngô Văn Chí chingovan

View GitHub Profile
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
<?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 -->
<?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 -->
<%@ 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 />
<%} %>
<%@ 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 />
<%} %>
<%@ 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="" />
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;
a = [5, 2, 7, 3, 8, 1]
print(a)
b = sorted(a)
print("List a :" , a)
print("List b : ", b)
a = [5, 2, 7, 3, 8, 1]
print(a)
b = sorted(a, reverse = True)
print("List a :" , a)
print("List b : ", b)
a = ['life', 'is', 'not', 'fair', 'get', 'used', 'to', 'it']
print(a)
b = sorted(a)
print("List a :" , a)
print("List b : ", b)