Beispiel #1
0
QString HPACK::unpackLiteral(bool huffman, uchar length, const uchar* ptr)
{
    if (huffman) {
        QByteArray ary(reinterpret_cast<const char*>(ptr), length);
        if (type_ == CONNECTION_CLIENT) {
            return Huffman::Response.decode(ary);
        }
        else {
            return Huffman::Requst.decode(ary);
        }
    }
    else {
        return QString::fromUtf8(reinterpret_cast<const char*>(ptr), length);
    }
}
Beispiel #2
0
void largestPalindromPrime(int n)
{
	std::vector<int> ary(n,0);
	isPrimeArray(ary);//generates the prime number array

	for(int i=n;i--;)
	{
		if(isPalindrome(i) && ary[i])
		{
			std::cout<<i<<std::endl;
			break;
		}

	}
}
Beispiel #3
0
void drawLabels(){
  TLatex l;
  l.SetTextSize(0.04);
  l.DrawLatex(500,50,"-z");
  l.DrawLatex(500,1430,"+z");
  l.DrawLatex(900,330,"TIB L1");
  l.DrawLatex(900,1000,"TIB L2");
  l.DrawLatex(1300,330,"TIB L3");
  l.DrawLatex(1300,1000,"TIB L4");
  l.DrawLatex(1700,330,"TOB L1");
  l.DrawLatex(1700,1000,"TOB L2");
  l.DrawLatex(2100,330,"TOB L3");
  l.DrawLatex(2100,1000,"TOB L4");
  l.DrawLatex(2500,330,"TOB L5");
  l.DrawLatex(2500,1000,"TOB L6");
  TArrow arx(2900,1190,2900,1350,0.01,"|>");
  l.DrawLatex(2915,1350,"x");
  TArrow ary(2900,1190,2790,1190,0.01,"|>");
  l.DrawLatex(2790,1210,"y");
  TArrow arz(2790,373,2790,672,0.01,"|>");
  l.DrawLatex(2820,667,"z");
  TArrow arphi(2790,511,2447,511,0.01,"|>");
  l.DrawLatex(2433,520,"#Phi");
  arx.SetLineWidth(3);
  ary.SetLineWidth(3);
  arz.SetLineWidth(3);
  arphi.SetLineWidth(3);
  arx.Draw();
  ary.Draw();
  arz.Draw();
  arphi.Draw();

  //FIXME : when tkmaps with taxis in color palette, introduce this
  TGaxis* axis = new TGaxis(3060,hmin,3060,hmax,0,100,510,"+L");
  axis->SetLabelSize(0.02);
  axis->Draw();

  canvas->Update();
}