Friday, August 4, 2017

Rave - Custom Function. How to squeeze code per 8000 character limit

Method 1. Use Notepadd++, "Edit" option, "Remove Unnecessary Blank and EOL"

Tuesday, November 6, 2012

Rave - Custom Function, find duplicated record, C#

How to find a duplicated record in Rave, will you write 2 for loops and make sure the query fire correctly? "TWO FOR LOOP"? not sounds smart for me, how about to use 2 array lists to implement it?

ArrayList ECGFindList = new ArrayList();
ArrayList ECGFindDupList = new ArrayList();
for (int i = 1; i < dpgEcg.Records.Count; i++)
{
if (!dpgEcg.Records[i].Active)
continue;

DataPoint dpECGFinding =
dpgEcg.Records[i].DataPoints.FindByFieldOID(ECGFIND_FIELDOID);

if (!ECGFindList.Contains(dpECGFinding.Data) )
ECGFindList.Add(dpECGFinding.Data);
else
ECGFindDupList.Add(dpECGFinding.Data);

}
//-----------------------------------------------------------------
//close all query
for (int i = 1; i < dpgEcg.Records.Count; i++)
{
DataPoint dpECGFinding =
dpgEcg.Records[i].DataPoints.FindByFieldOID(ECGFIND_FIELDOID);

CustomFunction.PerformQueryAction(QUERYTEXT, SITE_BY_SYSTEM, false, false, dpECGFinding, false, afp.CheckID, afp.CheckHash);
}
//-----------------------------------------------------------------
for (int i = 1; i < dpgEcg.Records.Count; i++)
{
if (!dpgEcg.Records[i].Active)
continue;

DataPoint dpECGFinding =
dpgEcg.Records[i].DataPoints.FindByFieldOID(ECGFIND_FIELDOID);

if (ECGFindDupList.Contains(dpECGFinding.Data))
CustomFunction.PerformQueryAction(QUERYTEXT, SITE_BY_SYSTEM, false, false, dpECGFinding, true, afp.CheckID, afp.CheckHash);

}


Monday, May 3, 2010

How to let tesseract (OCR) to only recognize "Digits" ?

Recently, I am playing around the OCR(Optical character recognition)
http://en.wikipedia.org/wiki/Optical_character_recognition

tesseract is a good open source that I play first, but it lacks documents, a little bit annoying. Some people asked how to let tesseract to only recognize "Digits", you may find some hints at FAQ of tesseract's wiki or README, but I shared what I found.

Environment : Ubuntu 8.04
1.Add a file (digit) to /usr/local/share/tessdata/configs/
2."a file(digit)"
filename : digit
file content : tessedit_char_whitelist 0123456789
3.Change your tesseract command as below
Ex:
./tesseract ~/image.tif ~/output nobatch digits

Have Fun, honestly, not so good to recognize "DIGITS" as I thought

Tuesday, June 30, 2009

Before/After "BellKor's Pragmatic Chaos" appear


"BellKor's Pragmatic Chaos" submitted a prediction which has a 10% improvement than Cinematch on June/26/2009, that means they can grab $1M if nobody can beat them after 30days, so due day is July/26/2009, and the world become more interesting and energetic !!

Before
1.Michael Jackson died on June/25/2009 (my pop idol..)

After
2.Netflix Leaderboard only show top 100, but June/30/2009, it can show top 20,50,100,250,1000.
3."Grand Prize Team" pass "PragmaticTheory" on June/30/2009
4."xlvector" pass "Progress Prize 2008" and became No.6 on June/29/2009
5."Vandelay Industries !" became No.9 and go up 12 position on June/29/2009
6."Vandelay Industries !" became No.7 on July/01/2009
7."Vandelay Industries !" suddenly disappear on July/02/2009, does it violate the rule?

What a wonderful world :],
suddenly everyone become a super man or they already hide for a long time and need a push sign..

Thursday, May 14, 2009

Pearson Correlation of Netflix Prize

This week I start to learn "Pearson Correlation", "KNN", for Netflix prize, and summarized all related information as below. My biggest question is about running time(it happens again, in my previous SVD algorithm, running time was a big issue), some body said it can be finished all movie-to-movie Pearson Correlation (calculate 17770*17770, or about 316 million Pearson correlations) within 2 minutes(I know you can just calculate the upper triangle correlation matrix). Two minutes:( Is it just for attracting people's eyes? In my stupid brute force program to calculate only one(Movie 30(Something's Gotta Give) : size(2.3MB) : total ratings : 118413), needs 7 hours, so honestly, I don't 100% believe how can you calculate all within 2 minutes.

Calculating 316 million movie correlations in 2 minutes (down from 2.5 hours)
Calculating 316 million movie correlations in 2 minutes (down from 2.5 hours), Updated on June/11/2009

Fast way to compute correlations?
My kNN source code for Icefox's framework