25 const double& BinFactor = 2,
const double& MinYVal = 1);
27 const double& BinFactor = 2,
const double& MinYVal = 1);
71 #if defined(SW_WRITEN)
74 extern int WriteN(
int fd,
char *ptr,
int nbytes);
80 template <
class TVal,
class TSizeTy>
85 TSizeTy Vals = V.
Len();
86 int ChunkSize = 25600;
88 r = WriteN(FileDesc, (
char *) &Vals, (
int)
sizeof(TSizeTy));
94 r = WriteN(FileDesc, (
char *) &Vals, (
int)
sizeof(TSizeTy));
100 for (TSizeTy ValN = 0; ValN < Vals; ValN += ChunkSize) {
102 if ((Vals - ValN) < ChunkSize) {
105 r = WriteN(FileDesc, (
char *) &V[ValN], (
int) (n*
sizeof(TVal)));
119 template <
class TVal,
class TSizeTy>
121 TSizeTy N =Vec64.Len();
125 r = WriteN(FileDesc, (
char *) &N, (
int)
sizeof(TSizeTy));
131 r = WriteN(FileDesc, (
char *) &N, (
int)
sizeof(TSizeTy));
138 r = SendVec(*it, FileDesc);
String helper functions and utilities. Quick and ditry!
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)
TSizeTy Len() const
Returns the number of elements in the vector.
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)
static void MakeExpBins(const TFltPrV &XYValV, TFltPrV &ExpXYValV, const double &BinFactor=2, const double &MinYVal=1)
static void RemoveHtmlTags(const TChA &HtmlStr, TChA &TextStr)
static bool GetXmlTagNmVal2(TXmlLx &XmlLx, TChA &TagNm, TChA &TagVal, const bool &TakeTagNms)
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)
static void GetCCdf(const TIntPrV &PdfV, TIntPrV &CCdfV)
static TStr GetStdName(TStr AuthorName)
Puts person's name (fist middle last) in a standard form: _ ...
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 TChA GetCleanStr(const TChA &ChA)
static bool StripEnd(const TChA &Str, const TChA &SearchStr, TChA &NewStr)
static void GetAddWIdV(TStrHash< TInt > &StrH, const char *CStr, TIntV &WIdV)