25 const double& BinFactor = 2,
const double& MinYVal = 1);
27 const double& BinFactor = 2,
const double& MinYVal = 1);
89 for (
int i = 0; i <
NEXPS; i++) {
Mins[i] = 100000000000.0; }
127 #if defined(SW_WRITEN)
130 extern int WriteN(
int fd,
char *ptr,
int nbytes);
136 template <
class TVal,
class TSizeTy>
141 TSizeTy Vals = V.
Len();
142 int ChunkSize = 25600;
144 r = WriteN(FileDesc, (
char *) &Vals, (
int)
sizeof(TSizeTy));
150 r = WriteN(FileDesc, (
char *) &Vals, (
int)
sizeof(TSizeTy));
156 for (TSizeTy ValN = 0; ValN < Vals; ValN += ChunkSize) {
158 if ((Vals - ValN) < ChunkSize) {
161 r = WriteN(FileDesc, (
char *) &V[ValN], (
int) (n*
sizeof(TVal)));
175 template <
class TVal,
class TSizeTy>
177 TSizeTy N =Vec64.Len();
181 r = WriteN(FileDesc, (
char *) &N, (
int)
sizeof(TSizeTy));
187 r = WriteN(FileDesc, (
char *) &N, (
int)
sizeof(TSizeTy));
194 r = SendVec(*it, FileDesc);
String helper functions and utilities. Quick and ditry!
static const int NEXPS
The expected number of experiments (must be at least equal to the size of the above list) ...
static TChA GetDomNm(const TChA &UrlChA)
static bool GetNormalizedUrl(const TChA &UrlIn, const TChA &BaseUrl, TChA &UrlOut)
Quick URL nomalization: Remove ending /, /index.html, etc. and strip starting www.
static void GetStdNameV(TStr AuthorNames, TStrV &StdNameV)
Splits a list of people's names.
static TChA GetWebsiteNm(const TChA &UrlChA)
static TChA GetDomNm2(const TChA &UrlChA)
double Tick()
Routines to benchmark table operations.
TSizeTy Len() const
Returns the number of elements in the vector.
double Min(const TExperiment Exp) const
Returns the minimum time of all experiments.
static void GetWIdV(const TStrHash< TInt > &StrH, const char *CStr, TIntV &WIdV)
static int SplitSentences(TChA &ChA, TVec< char * > &SentenceV)
static void GetXmlTagNmVal(TXmlLx &XmlLx, TChA &TagNm, TChA &TagVal)
void Start(const TExperiment Exp)
Start a new experiment.
static void MakeExpBins(const TFltPrV &XYValV, TFltPrV &ExpXYValV, const double &BinFactor=2, const double &MinYVal=1)
static void RemoveHtmlTags(const TChA &HtmlStr, TChA &TextStr)
int Cnt(const TExperiment Exp) const
Returns the number of experiments.
static bool GetXmlTagNmVal2(TXmlLx &XmlLx, TChA &TagNm, TChA &TagVal, const bool &TakeTagNms)
void Stop(const TExperiment Exp)
Stop the current experiment.
void operator=(TStopwatch const &)
static void GetPdf(const TIntPrV &CdfV, TIntPrV &PdfV)
static TChA GetShorStr(const TChA &LongStr, const int MaxLen=50)
static int SplitLines(TChA &ChA, TVec< char * > &LineV, const bool &SkipEmpty=false)
static int CountWords(const char *CStr)
static int SplitOnCh(TChA &ChA, TVec< char * > &WrdV, const char &Ch, const bool &SkipEmpty=false)
static int SplitWords(TChA &ChA, TVec< char * > &WrdV, const bool &SplitOnWs=true)
static TChA GetCleanWrdStr(const TChA &ChA)
static TChA & GetXmlTagVal(TXmlLx &XmlLx, const TChA &TagNm)
static void GetCdf(const TIntPrV &PdfV, TIntPrV &CdfV)
double Max(const TExperiment Exp) const
Returns the maximum time of all experiments.
static void GetCCdf(const TIntPrV &PdfV, TIntPrV &CCdfV)
static TStr GetStdName(TStr AuthorName)
Puts person's name (fist middle last) in a standard form: _ ...
double Avg(const TExperiment Exp) const
Returns the average time of all experiments.
static bool IsLatinStr(const TChA &Str, const double &MinAlFrac)
TIter BegI() const
Returns an iterator pointing to the first element in the vector.
static void Normalize(TFltPrV &PdfV)
static bool GetTmFromStr(const char *TmStr, TSecTm &Tm)
Parses time in many different text formats. See source code for details.
static TStopwatch * GetInstance()
static TChA GetCleanStr(const TChA &ChA)
static bool StripEnd(const TChA &Str, const TChA &SearchStr, TChA &NewStr)
TExperiment
List of all experiments.
double Sum(const TExperiment Exp) const
Returns the total time of all experiments.
static void GetAddWIdV(TStrHash< TInt > &StrH, const char *CStr, TIntV &WIdV)
Routines to benchmark table operations.