Skip to content

Instantly share code, notes, and snippets.

View pcdinh's full-sized avatar

Pham Cong Dinh pcdinh

View GitHub Profile
SELECT
MAX(CASE
WHEN checked_status = 0 THEN doc_count
ELSE 0
END) file_not_existed,
MAX(CASE
WHEN checked_status = 1 THEN doc_count
ELSE 0
END) file_existed,
MAX(CASE
<?php
/**
* A test case defines the fixture to run multiple tests. To define a test case
* 1. implement a subclass of TinyTestCase
* 2. define instance variables that store the state of the fixture
* 3. initialize the fixture state by overriding setUp()
* 4. clean-up after a test by overriding tearDown().
*
* @author pcdinh
<?php
/**
* Class to control the indexing operation.
*
* @author pcdinh
* @since July 25, 2009
* @version $Id$
*/
class IndexerController
<?php
include_once './FileNameComponent.php';
/**
* Provides methods to parse file name into meaningful parts.
*
* @author pcdinh
* @since July 25, 2009
* @version $Id$
<?php
/**
* This class provides page controller service for handling requests to the index page.
*
* @author pcdinh
* @since June 18, 2009
* @version $Id: IndexController.php 250 2009-07-02 10:40:22Z pcdinh $
*/
class IndexController
<?php
/**
* A set of methods to manipulate files.
*
* @author pcdinh
* @since June 18, 2009
* @version $Id: SearchController.php 407 2009-07-22 04:51:07Z hanhnt83 $
*/
class SearchController
UPDATE documents
SET doc_code = REGEXP_REPLACE(doc_code, '.Q[[:digit:]]{1}.',
(CASE
WHEN REGEXP_LIKE(doc_code, '.(E|L).(10|11|12){1}.') THEN '.4.'
WHEN REGEXP_LIKE(doc_code, '.(E|L).0(7|8|9){1}.') THEN '.3.'
WHEN REGEXP_LIKE(doc_code, '.(E|L).0(4|5|6){1}.') THEN '.2.'
WHEN REGEXP_LIKE(doc_code, '.(E|L).0(1|2|3){1}.') THEN '.1.'
END ))
WHERE REGEXP_LIKE(doc_code, '.Q[[:digit:]]{1}.')
WITH PostList AS (
SELECT row_number() OVER (ORDER BY p.PostID DESC) Row,
p.PostID, p.ThreadID, p.ParentID, p.SortOrder,
p.PostDate, p.Subject, p.SectionID ForumID, p.PostAuthor UserName,
p.UserID UserID, p.IPAddress, t.ThreadDate, cast(p.[Body] as text) Body
FROM cs_Posts p
INNER JOIN cs_Threads t ON t.ThreadID = p.ThreadID
INNER JOIN cs_Sections s ON s.SectionID = p.SectionID
WHERE s.ApplicationType = 0
)
package lucene1;
import java.io.StringReader;
import org.apache.lucene.analysis.Token;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
/**
* @see Lucene 2.4.1
SELECT * INTO OUTFILE "users.txt"
FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'
FROM cms.webusers
WHERE MONTH(created_time) = '01' AND YEAR(created_time) = '2009';