Skip to content

Instantly share code, notes, and snippets.

View chingovan's full-sized avatar

Ngô Văn Chí chingovan

View GitHub Profile
<%@include file="/html/combine/init.jsp"%>
<%
PortletURL portletURL = renderResponse.createRenderURL();
String portletURLString = portletURL.toString();
StudentSearchContainer studentSearchContainer = new StudentSearchContainer(renderRequest, portletURL);
%>
<%@include file="/html/combine/init.jsp"%>
<%
String redirect = ParamUtil.getString(request, "redirect");
StudentSearchContainer searchContainer = (StudentSearchContainer)request.getAttribute("liferay-ui:search:searchContainer");
StudentDisplayTerms displayTerms = (StudentDisplayTerms)searchContainer.getDisplayTerms();
%>
<aui:row>
<?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.combine">
<author>chinv</author>
<namespace>combine</namespace>
<entity name="Student" local-service="true" remote-service="true"
table="Student">
<!-- PK fields -->
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
<%@include file="/html/combine/init.jsp"%>
<%
PortletURL portletURL = renderResponse.createRenderURL();
String portletURLString = portletURL.toString();
StudentSearchContainer studentSearchContainer = new StudentSearchContainer(renderRequest, portletURL);
StudentDisplayTerms displayTerms = (StudentDisplayTerms)studentSearchContainer.getDisplayTerms();
%>
a = [3, 6, 9, 2, 6, 8, 9, 1, 7, 21, 7, 12]
for i in range(1, len(a)):
t = a[i];
index = i;
for j in range(i -1, -1, -1):
if a[j] > t:
a[j + 1] = a[j]
index = j
/*
* insertion_sort.c
*
* Created on: Jul 12, 2015
* Author: chinv
*/
#include "stdio.h"
void printArray(int a[], int n) {
/**
* Copyright 2015 Chi Ngo ([email protected], chingovan.blogspot.com)
*/
package com.blogspot.chingovan.tutorial.hook.events;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
# Quick sort alogrithm
# Author: Chi Ngo ([email protected] - chingovan.blogspot.com)
def quicksort(mylist, sIndex, eIndex):
# Neu chi co mot phan tu hoac eIndex < sIndex
if eIndex <= sIndex:
return
else:
pivot = mylist[int((eIndex + sIndex) / 2)]