text
stringlengths
2
99k
meta
dict
// Copyright 2008 Isis Innovation Limited #include "ptam/MapMaker.h" #include "ptam/MapPoint.h" #include "ptam/Bundle.h" #include "ptam/PatchFinder.h" #include "ptam/SmallMatrixOpts.h" #include "ptam/HomographyInit.h" #include <cvd/vector_image_ref.h> #include <cvd/vision.h> #include <cvd/image_interpolate.h> #include <TooN/SVD.h> #include <TooN/SymEigen.h> #include <gvars3/instances.h> #include <fstream> #include <algorithm> #include <ptam/Params.h> #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include <windows.h> #endif using namespace CVD; using namespace std; using namespace GVars3; //Weiss{ feature statistics //static unsigned int outcount[5]={0,0,0,0,0}; //static unsigned int addcount[5]={0,0,0,0,0}; //static unsigned int kfid=0; //} // Constructor sets up internal reference variable to Map. // Most of the intialisation is done by Reset().. MapMaker::MapMaker(Map& m, const ATANCamera &cam, ros::NodeHandle& nh) : mMap(m), mCamera(cam), octomap_interface(nh) { mbResetRequested = false; Reset(); start(); // This CVD::thread func starts the map-maker thread with function run() GUI.RegisterCommand("SaveMap", GUICommandCallBack, this); //GV3::Register(mgvdWiggleScale, "MapMaker.WiggleScale", 0.1, SILENT); // Default to 10cm between keyframes }; void MapMaker::Reset() { // This is only called from within the mapmaker thread... mMap.Reset(); mvFailureQueue.clear(); while(!mqNewQueue.empty()) mqNewQueue.pop(); mMap.vpKeyFrames.clear(); // TODO: actually erase old keyframes mvpKeyFrameQueue.clear(); // TODO: actually erase old keyframes mbBundleRunning = false; mbBundleConverged_Full = true; mbBundleConverged_Recent = true; mbResetDone = true; mbResetRequested = false; mbBundleAbortRequested = false; } // CHECK_RESET is a handy macro which makes the mapmaker thread stop // what it's doing and reset, if required. #define CHECK_RESET if(mbResetRequested) {Reset(); continue;}; void MapMaker::run() { #ifdef WIN32 // For some reason, I get tracker thread starvation on Win32 when // adding key-frames. Perhaps this will help: SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_LOWEST); #endif const ptam::PtamParamsConfig& pPars = PtamParameters::varparams(); while(!shouldStop()) // ShouldStop is a CVD::Thread func which return true if the thread is told to exit. { CHECK_RESET; sleep(1); // Sleep not really necessary, especially if mapmaker is busy CHECK_RESET; // Handle any GUI commands encountered.. while(!mvQueuedCommands.empty()) { GUICommandHandler(mvQueuedCommands.begin()->sCommand, mvQueuedCommands.begin()->sParams); mvQueuedCommands.erase(mvQueuedCommands.begin()); } if(!mMap.IsGood()) // Nothing to do if there is no map yet! continue; // From here on, mapmaker does various map-maintenance jobs in a certain priority // Hierarchy. For example, if there's a new key-frame to be added (QueueSize() is >0) // then that takes high priority. CHECK_RESET; // Should we run local bundle adjustment? if(!mbBundleConverged_Recent && QueueSize() == 0) //Weiss{ if (pPars.BundleMethod=="LOCAL" || pPars.BundleMethod=="LOCAL_GLOBAL") BundleAdjustRecent(); //} CHECK_RESET; // Are there any newly-made map points which need more measurements from older key-frames? if(mbBundleConverged_Recent && QueueSize() == 0) ReFindNewlyMade(); CHECK_RESET; // Run global bundle adjustment? if(mbBundleConverged_Recent && !mbBundleConverged_Full && QueueSize() == 0) //Weiss{ if (pPars.BundleMethod=="GLOBAL" || pPars.BundleMethod=="LOCAL_GLOBAL") BundleAdjustAll(); //} CHECK_RESET; // Very low priorty: re-find measurements marked as outliers if(mbBundleConverged_Recent && mbBundleConverged_Full && rand()%20 == 0 && QueueSize() == 0) ReFindFromFailureQueue(); CHECK_RESET; HandleBadPoints(); CHECK_RESET; // Any new key-frames to be added? if(QueueSize() > 0) AddKeyFrameFromTopOfQueue(); // Integrate into map data struct, and process } } // Tracker calls this to demand a reset void MapMaker::RequestReset() { mbResetDone = false; mbResetRequested = true; } bool MapMaker::ResetDone() { return mbResetDone; } // HandleBadPoints() Does some heuristic checks on all points in the map to see if // they should be flagged as bad, based on tracker feedback. void MapMaker::HandleBadPoints() { // Did the tracker see this point as an outlier more often than as an inlier? for(unsigned int i=0; i<mMap.vpPoints.size(); i++) { MapPoint &p = *mMap.vpPoints[i]; if(p.nMEstimatorOutlierCount > 20 && p.nMEstimatorOutlierCount > p.nMEstimatorInlierCount) p.bBad = true; } // All points marked as bad will be erased - erase all records of them // from keyframes in which they might have been measured. for(unsigned int i=0; i<mMap.vpPoints.size(); i++) if(mMap.vpPoints[i]->bBad) { //slynen octomap_interface{ octomap_interface.deletePoint(mMap.vpPoints[i]); //} MapPoint::Ptr p = mMap.vpPoints[i]; for(unsigned int j=0; j<mMap.vpKeyFrames.size(); j++) { KeyFrame &k = *mMap.vpKeyFrames[j]; if(k.mMeasurements.count(p)){ //slynen{ reprojection #ifdef KF_REPROJ //if the mapmaker wants to move a point to the trash which we use for keyframe reproj. we select a new point for(unsigned int ibest=0;ibest<k.iBestPointsCount;ibest++){ //check all best points //slynen copy this if(k.apCurrentBestPoints[ibest]==p) //is the point out of range or to be deleted one of our bestPoints? { k.apCurrentBestPoints[ibest].reset(); int mindist = 9999; int tempdist = 0; Vector<2> ptlev0 = LevelZeroPos(p->irCenter, p->nSourceLevel); //to level zero coords for(int iP = k.vpPoints.size()-1; iP>=0; iP--){ //search a nearby point as new bestPoint Vector<2> pt2lev0 = LevelZeroPos(k.vpPoints[iP]->irCenter, k.vpPoints[iP]->nSourceLevel); tempdist = abs(ptlev0[0] - pt2lev0[0]) + abs(ptlev0[1] - pt2lev0[1]); //calc simple dist if(tempdist < mindist && ! k.vpPoints[iP]->bBad){ //if closer and not bad mindist = tempdist; k.apCurrentBestPoints[ibest] = k.vpPoints[iP]; //closest point as new point } } } } #endif //} k.mMeasurements.erase(p); } } } // Move bad points to the trash list. mMap.MoveBadPointsToTrash(); } MapMaker::~MapMaker() { mbBundleAbortRequested = true; stop(); // makes shouldStop() return true cout << "Waiting for mapmaker to die.." << endl; join(); cout << " .. mapmaker has died." << endl; } // Finds 3d coords of point in reference frame B from two z=1 plane projections Vector<3> MapMaker::ReprojectPoint(SE3<> se3AfromB, const Vector<2> &v2A, const Vector<2> &v2B) { Matrix<3,4> PDash; PDash.slice<0,0,3,3>() = se3AfromB.get_rotation().get_matrix(); PDash.slice<0,3,3,1>() = se3AfromB.get_translation().as_col(); Matrix<4> A; A[0][0] = -1.0; A[0][1] = 0.0; A[0][2] = v2B[0]; A[0][3] = 0.0; A[1][0] = 0.0; A[1][1] = -1.0; A[1][2] = v2B[1]; A[1][3] = 0.0; A[2] = v2A[0] * PDash[2] - PDash[0]; A[3] = v2A[1] * PDash[2] - PDash[1]; SVD<4,4> svd(A); Vector<4> v4Smallest = svd.get_VT()[3]; if(v4Smallest[3] == 0.0) v4Smallest[3] = 0.00001; return project(v4Smallest); } // InitFromStereo() generates the initial match from two keyframes // and a vector of image correspondences. Uses the bool MapMaker::InitFromStereo(KeyFrame::Ptr kF, KeyFrame::Ptr kS, vector<pair<ImageRef, ImageRef> > &vTrailMatches, SE3<> &se3TrackerPose) { //Weiss{ //mdWiggleScale = 0.1; const FixParams& pPars = PtamParameters::fixparams(); mdWiggleScale=pPars.WiggleScale; //mdWiggleScale = *mgvdWiggleScale; // Cache this for the new map. //} mCamera.SetImageSize(kF->aLevels[0].im.size()); //Weiss{ if(vTrailMatches.size()<4) { ROS_WARN_STREAM("Too few matches to init."); return false; } /////////////// init alternative: get rotation from SBI and direction from optical flow ///////////////// /////////////// turns out to be slightly faster but much less robuts... ///////////////// // vector<HomographyMatch> vMatches; // TooN::Matrix<> X(vTrailMatches.size(), 3); // SO3<> rotmat = SO3<>::exp(rotvec); // // for(unsigned int i=0; i<vTrailMatches.size(); i++) // { // HomographyMatch m; // m.v2CamPlaneFirst = mCamera.UnProject(vTrailMatches[i].first); // m.v2CamPlaneSecond = mCamera.UnProject(vTrailMatches[i].second); // Vector<3> p1 = makeVector(m.v2CamPlaneFirst[0],m.v2CamPlaneFirst[1],1); // p1=p1/norm(p1); // Vector<3> p2 = rotmat.inverse()*makeVector(m.v2CamPlaneSecond[0],m.v2CamPlaneSecond[1],1); // p2=p2/norm(p2); // Vector<3> of= p2-p1; // // X[i]=makeVector(of[2]*p1[1]-of[1]*p1[2], of[0]*p1[2]-of[2]*p1[0], of[1]*p1[0]-of[0]*p1[1]); // // vMatches.push_back(m); // } // // SVD<> svdX(X); // SE3<> se3; // se3.get_rotation()=rotmat; // Vector<3> trans = makeVector(svdX.get_VT()[2][0],svdX.get_VT()[2][1],svdX.get_VT()[2][2]); // se3.get_translation()= -trans*mdWiggleScale/norm(trans); ////////////////////////////// end alternative init: calculates se3 and populates vMatches ////////////////////////// vector<HomographyMatch> vMatches; for(unsigned int i=0; i<vTrailMatches.size(); i++) { HomographyMatch m; m.v2CamPlaneFirst = mCamera.UnProject(vTrailMatches[i].first); m.v2CamPlaneSecond = mCamera.UnProject(vTrailMatches[i].second); m.m2PixelProjectionJac = mCamera.GetProjectionDerivs(); vMatches.push_back(m); } //Weiss{ if(vMatches.size()<4) return false; //} SE3<> se3; bool bGood; HomographyInit HomographyInit; bGood = HomographyInit.Compute(vMatches, 5.0, se3); if(!bGood) { mMessageForUser << " Could not init from stereo pair, try again." << endl; return false; } // Check that the initialiser estimated a non-zero baseline double dTransMagn = sqrt(se3.get_translation() * se3.get_translation()); if(dTransMagn == 0) { mMessageForUser << " Estimated zero baseline from stereo pair, try again." << endl; return false; } // change the scale of the map so the second camera is wiggleScale away from the first se3.get_translation() *= mdWiggleScale/dTransMagn; KeyFrame::Ptr pkFirst = kF; KeyFrame::Ptr pkSecond = kS; pkFirst->bFixed = true; pkFirst->se3CfromW = SE3<>(); pkSecond->bFixed = false; pkSecond->se3CfromW = se3; // Construct map from the stereo matches. PatchFinder finder; for(unsigned int i=0; i<vMatches.size(); i++) { MapPoint::Ptr p(new MapPoint()); // Patch source stuff: p->pPatchSourceKF = pkFirst; p->nSourceLevel = 0; p->v3Normal_NC = makeVector( 0,0,-1); p->irCenter = vTrailMatches[i].first; p->v3Center_NC = unproject(mCamera.UnProject(p->irCenter)); p->v3OneDownFromCenter_NC = unproject(mCamera.UnProject(p->irCenter + ImageRef(0,1))); p->v3OneRightFromCenter_NC = unproject(mCamera.UnProject(p->irCenter + ImageRef(1,0))); normalize(p->v3Center_NC); normalize(p->v3OneDownFromCenter_NC); normalize(p->v3OneRightFromCenter_NC); p->RefreshPixelVectors(); // Do sub-pixel alignment on the second image finder.MakeTemplateCoarseNoWarp(p); finder.MakeSubPixTemplate(); finder.SetSubPixPos(vec(vTrailMatches[i].second)); bool bGood = finder.IterateSubPixToConvergence(*pkSecond,10); if(!bGood) { continue; } // Triangulate point: Vector<2> v2SecondPos = finder.GetSubPixPos(); p->v3WorldPos = ReprojectPoint(se3, mCamera.UnProject(v2SecondPos), vMatches[i].v2CamPlaneFirst); if(p->v3WorldPos[2] < 0.0) { continue; } // Not behind map? Good, then add to map. p->pMMData = new MapMakerData(); mMap.vpPoints.push_back(p); // Construct first two measurements and insert into relevant DBs: Measurement mFirst; mFirst.nLevel = 0; mFirst.Source = Measurement::SRC_ROOT; mFirst.v2RootPos = vec(vTrailMatches[i].first); mFirst.bSubPix = true; pkFirst->mMeasurements[p] = mFirst; p->pMMData->sMeasurementKFs.insert(pkFirst); Measurement mSecond; mSecond.nLevel = 0; mSecond.Source = Measurement::SRC_TRAIL; mSecond.v2RootPos = finder.GetSubPixPos(); mSecond.bSubPix = true; pkSecond->mMeasurements[p] = mSecond; p->pMMData->sMeasurementKFs.insert(pkSecond); //slynen{ reprojection #ifdef KF_REPROJ pkFirst->AddKeyMapPoint(p); pkSecond->AddKeyMapPoint(p); #endif //} } //Weiss{ if(mMap.vpPoints.size()<4) { ROS_WARN_STREAM("Too few map points to init."); return false; } //} mMap.vpKeyFrames.push_back(pkFirst); mMap.vpKeyFrames.push_back(pkSecond); pkFirst->MakeKeyFrame_Rest(); pkSecond->MakeKeyFrame_Rest(); //Weiss{ // for(int i=0; i<5; i++) /*}*/ BundleAdjustAll(); // Estimate the feature depth distribution in the first two key-frames // (Needed for epipolar search) //Weiss{ if(!RefreshSceneDepth(pkFirst)) { ROS_WARN_STREAM("Something is seriously wrong with the first KF."); return false; } if(!RefreshSceneDepth(pkSecond)) { ROS_WARN_STREAM("Something is seriously wrong with the second KF."); return false; } mdWiggleScaleDepthNormalized = mdWiggleScale / pkFirst->dSceneDepthMean; //check if point have been added const VarParams& pParams = PtamParameters::varparams(); bool addedsome=false; addedsome |= AddSomeMapPoints(3); if(!pParams.NoLevelZeroMapPoints) addedsome |= AddSomeMapPoints(0); addedsome |= AddSomeMapPoints(1); addedsome |= AddSomeMapPoints(2); if(!addedsome) { ROS_WARN_STREAM("Could not add any map points on any level - abort init."); return false; } //} mbBundleConverged_Full = false; mbBundleConverged_Recent = false; //Weiss{ double nloops=0; while(!mbBundleConverged_Full & (nloops<pParams.MaxStereoInitLoops)) { BundleAdjustAll(); if(mbResetRequested | (nloops>=pParams.MaxStereoInitLoops)) return false; nloops++; } //sanity check: if the point variance is too large assume init is crap --> very hacky, assumes flat init scene!! if(((pkFirst->dSceneDepthSigma+pkSecond->dSceneDepthSigma)/2.0>0.5) && pParams.CheckInitMapVar) { ROS_WARN_STREAM("Initial map rejected because of too large point variance. Point sigma: " << ((pkFirst->dSceneDepthSigma+pkSecond->dSceneDepthSigma)/2.0)); return false; } //} // Rotate and translate the map so the dominant plane is at z=0: ApplyGlobalTransformationToMap(CalcPlaneAligner()); mMap.bGood = true; se3TrackerPose = pkSecond->se3CfromW; mMessageForUser << " MapMaker: made initial map with " << mMap.vpPoints.size() << " points." << endl; //slynen octomap_interface{ octomap_interface.addKeyFrame(pkFirst); octomap_interface.addKeyFrame(pkSecond); //} return true; } // ThinCandidates() Thins out a key-frame's candidate list. // Candidates are those salient corners where the mapmaker will attempt // to make a new map point by epipolar search. We don't want to make new points // where there are already existing map points, this routine erases such candidates. // Operates on a single level of a keyframe. void MapMaker::ThinCandidates(KeyFrame::Ptr k, int nLevel) { vector<Candidate> &vCSrc = k->aLevels[nLevel].vCandidates; vector<Candidate> vCGood; vector<ImageRef> irBusyLevelPos; // Make a list of `busy' image locations, which already have features at the same level // or at one level higher. for(meas_it it = k->mMeasurements.begin(); it!=k->mMeasurements.end(); it++) { if(!(it->second.nLevel == nLevel || it->second.nLevel == nLevel + 1)) continue; irBusyLevelPos.push_back(ir_rounded(it->second.v2RootPos / LevelScale(nLevel))); } // Only keep those candidates further than 10 pixels away from busy positions. unsigned int nMinMagSquared = 10*10; for(unsigned int i=0; i<vCSrc.size(); i++) { ImageRef irC = vCSrc[i].irLevelPos; bool bGood = true; for(unsigned int j=0; j<irBusyLevelPos.size(); j++) { ImageRef irB = irBusyLevelPos[j]; if((irB - irC).mag_squared() < nMinMagSquared) { bGood = false; break; } } if(bGood) vCGood.push_back(vCSrc[i]); } vCSrc = vCGood; } // Adds map points by epipolar search to the last-added key-frame, at a single // specified pyramid level. Does epipolar search in the target keyframe as closest by // the ClosestKeyFrame function. bool MapMaker::AddSomeMapPoints(int nLevel) { //Weiss{ bool addedsome=false; //} KeyFrame::Ptr kSrc = (mMap.vpKeyFrames[mMap.vpKeyFrames.size() - 1]); // The new keyframe KeyFrame::Ptr kTarget = ClosestKeyFrame(kSrc); Level &l = kSrc->aLevels[nLevel]; ThinCandidates(kSrc, nLevel); for(unsigned int i = 0; i<l.vCandidates.size(); i++) addedsome|=AddPointEpipolar(kSrc, kTarget, nLevel, i); return addedsome; }; // Rotates/translates the whole map and all keyframes void MapMaker::ApplyGlobalTransformationToMap(SE3<> se3NewFromOld) { for(unsigned int i=0; i<mMap.vpKeyFrames.size(); i++) mMap.vpKeyFrames[i]->se3CfromW = mMap.vpKeyFrames[i]->se3CfromW * se3NewFromOld.inverse(); // SO3<> so3Rot = se3NewFromOld.get_rotation(); for(unsigned int i=0; i<mMap.vpPoints.size(); i++) { mMap.vpPoints[i]->v3WorldPos = se3NewFromOld * mMap.vpPoints[i]->v3WorldPos; mMap.vpPoints[i]->RefreshPixelVectors(); } } // Applies a global scale factor to the map void MapMaker::ApplyGlobalScaleToMap(double dScale) { for(unsigned int i=0; i<mMap.vpKeyFrames.size(); i++) mMap.vpKeyFrames[i]->se3CfromW.get_translation() *= dScale; for(unsigned int i=0; i<mMap.vpPoints.size(); i++) { (*mMap.vpPoints[i]).v3WorldPos *= dScale; (*mMap.vpPoints[i]).v3PixelRight_W *= dScale; (*mMap.vpPoints[i]).v3PixelDown_W *= dScale; (*mMap.vpPoints[i]).RefreshPixelVectors(); } } // The tracker entry point for adding a new keyframe; // the tracker thread doesn't want to hang about, so // just dumps it on the top of the mapmaker's queue to // be dealt with later, and return. void MapMaker::AddKeyFrame(KeyFrame::Ptr k) { k->pSBI = NULL; // Mapmaker uses a different SBI than the tracker, so will re-gen its own mvpKeyFrameQueue.push_back(k); if(mbBundleRunning) // Tell the mapmaker to stop doing low-priority stuff and concentrate on this KF first. mbBundleAbortRequested = true; } // Mapmaker's code to handle incoming key-frames. void MapMaker::AddKeyFrameFromTopOfQueue() { if(mvpKeyFrameQueue.size() == 0) return; KeyFrame::Ptr pK = mvpKeyFrameQueue[0]; mvpKeyFrameQueue.erase(mvpKeyFrameQueue.begin()); //Weiss{ const ptam::PtamParamsConfig& pPars = PtamParameters::varparams(); if (pPars.MaxKF>1) // MaxKF<2 means keep all KFs { while (mMap.vpKeyFrames.size()>(unsigned int)pPars.MaxKF) { // find farthest KF double dFarthestDist = 0; vector<KeyFrame::Ptr>::iterator itFarthest = mMap.vpKeyFrames.begin(); for(vector<KeyFrame::Ptr>::iterator it = mMap.vpKeyFrames.begin();it!=mMap.vpKeyFrames.end();++it) { double dDist = KeyFrameLinearDist(pK, *it); if(dDist > dFarthestDist) { dFarthestDist = dDist; itFarthest = it; } } for (unsigned int i=0;i<mMap.vpPoints.size();i++) if (mMap.vpPoints[i]->pPatchSourceKF==*itFarthest) mMap.vpPoints[i]->bBad=true; if ((*itFarthest)->bFixed) // if we delete the a fix KF, fix the oldest one { mMap.vpKeyFrames.erase(itFarthest); mMap.vpKeyFrames[0]->bFixed=true; } else mMap.vpKeyFrames.erase(itFarthest); } } //} pK->MakeKeyFrame_Rest(); //Weiss{ feature statistics // kfid = pK->ID; //} mMap.vpKeyFrames.push_back(pK); // Any measurements? Update the relevant point's measurement counter status map for(meas_it it = pK->mMeasurements.begin(); it!=pK->mMeasurements.end(); it++) { it->first->pMMData->sMeasurementKFs.insert(pK); it->second.Source = Measurement::SRC_TRACKER; } // And maybe we missed some - this now adds to the map itself, too. ReFindInSingleKeyFrame(pK); bool addedsome=false; addedsome |= AddSomeMapPoints(3); // .. and add more map points by epipolar search. if(!pPars.NoLevelZeroMapPoints) addedsome |= AddSomeMapPoints(0); addedsome |= AddSomeMapPoints(1); addedsome |= AddSomeMapPoints(2); //Weiss{ feature statistics // ROS_WARN_STREAM("\ntotall : " << addcount[4] << " totlvl0: " << addcount[0] << " totlvl1: " << addcount[1] << " totlvl2: " << addcount[2] << " totlvl3: " << addcount[3]); // ROS_WARN_STREAM("\noutall : " << outcount[4] << " outlvl0: " << outcount[0] << " outlvl1: " << outcount[1] << " outlvl2: " << outcount[2] << " outlvl3: " << outcount[3]); //} mbBundleConverged_Full = false; mbBundleConverged_Recent = false; //slynen octomap_interface{ octomap_interface.addKeyFrame(pK); //} } // Tries to make a new map point out of a single candidate point // by searching for that point in another keyframe, and triangulating // if a match is found. bool MapMaker::AddPointEpipolar(KeyFrame::Ptr kSrc, KeyFrame::Ptr kTarget, int nLevel, int nCandidate) { static Image<Vector<2> > imUnProj; static bool bMadeCache = false; if(!bMadeCache) { imUnProj.resize(kSrc->aLevels[0].im.size()); ImageRef ir; do imUnProj[ir] = mCamera.UnProject(ir); while(ir.next(imUnProj.size())); bMadeCache = true; } int nLevelScale = LevelScale(nLevel); Candidate &candidate = kSrc->aLevels[nLevel].vCandidates[nCandidate]; ImageRef irLevelPos = candidate.irLevelPos; Vector<2> v2RootPos = LevelZeroPos(irLevelPos, nLevel); Vector<3> v3Ray_SC = unproject(mCamera.UnProject(v2RootPos)); // direction vector from current camera to the feature? [SW] normalize(v3Ray_SC); Vector<3> v3LineDirn_TC = kTarget->se3CfromW.get_rotation() * (kSrc->se3CfromW.get_rotation().inverse() * v3Ray_SC); // direction vector from target KF camer to the feature? [SW] // Restrict epipolar search to a relatively narrow depth range // to increase reliability double dMean = kSrc->dSceneDepthMean; double dSigma = kSrc->dSceneDepthSigma; //Weiss{ comments marked with [SW] // double dStartDepth = max(mdWiggleScale, dMean - dSigma); // estimated minimal distance of the feature in the current KF? [SW] // double dEndDepth = min(40 * mdWiggleScale, dMean + dSigma); // estimated maximal distance of the feature in the current KF? [SW] // double dStartDepth = max(mdWiggleScale, dMean - dSigma); // estimated minimal distance of the feature in the current KF? [SW] double dStartDepth = max(0.0, dMean - dSigma); // estimated minimal distance of the feature in the current KF? [SW] double dEndDepth = dMean + dSigma; // estimated maximal distance of the feature in the current KF? [SW] //} Vector<3> v3CamCenter_TC = kTarget->se3CfromW * kSrc->se3CfromW.inverse().get_translation(); // The camera of the current camera seen from the target KF? [SW] Vector<3> v3RayStart_TC = v3CamCenter_TC + dStartDepth * v3LineDirn_TC; // start point on the 3D epi-line expressed in the target KF? [SW] Vector<3> v3RayEnd_TC = v3CamCenter_TC + dEndDepth * v3LineDirn_TC; // end point on the 3d epi-line expressed in the target KF? [SW] //Weiss{ ////////////////////////////////// This check is ambiguous as well as the calculation of dStartDepth and dEndDepth /////////////////// // it is mainly to speed up calculation, but breaks on large means (dMean>40), since then v3RayEnd_TC[2] <= v3RayStart_TC[2] // is always true // Note: v3RayEnd_TC[2] <= v3RayStart_TC[2] is still true if the KFs have an angle of 90° or more w.r.t. each other... // this happens rarely though... // if(v3RayEnd_TC[2] <= v3RayStart_TC[2]) // it's highly unlikely that we'll manage to get anything out if we're facing backwards wrt the other camera's view-ray // return false; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //} if(v3RayEnd_TC[2] <= 0.0 ) return false; if(v3RayStart_TC[2] <= 0.0) v3RayStart_TC += v3LineDirn_TC * (0.001 - v3RayStart_TC[2] / v3LineDirn_TC[2]); Vector<2> v2A = project(v3RayStart_TC); Vector<2> v2B = project(v3RayEnd_TC); Vector<2> v2AlongProjectedLine = v2A-v2B; if(v2AlongProjectedLine * v2AlongProjectedLine < 0.00000001) { mMessageForUser << "v2AlongProjectedLine too small." << endl; return false; } normalize(v2AlongProjectedLine); Vector<2> v2Normal; v2Normal[0] = v2AlongProjectedLine[1]; v2Normal[1] = -v2AlongProjectedLine[0]; double dNormDist = v2A * v2Normal; if(fabs(dNormDist) > mCamera.LargestRadiusInImage() ) return false; double dMinLen = min(v2AlongProjectedLine * v2A, v2AlongProjectedLine * v2B) - 0.05; double dMaxLen = max(v2AlongProjectedLine * v2A, v2AlongProjectedLine * v2B) + 0.05; if(dMinLen < -2.0) dMinLen = -2.0; if(dMaxLen < -2.0) dMaxLen = -2.0; if(dMinLen > 2.0) dMinLen = 2.0; if(dMaxLen > 2.0) dMaxLen = 2.0; // Find current-frame corners which might match this PatchFinder Finder; Finder.MakeTemplateCoarseNoWarp(kSrc, nLevel, irLevelPos); if(Finder.TemplateBad()) return false; vector<Vector<2> > &vv2Corners = kTarget->aLevels[nLevel].vImplaneCorners; vector<ImageRef> &vIR = kTarget->aLevels[nLevel].vCorners; if(!kTarget->aLevels[nLevel].bImplaneCornersCached) { for(unsigned int i=0; i<vIR.size(); i++) // over all corners in target img.. vv2Corners.push_back(imUnProj[ir(LevelZeroPos(vIR[i], nLevel))]); kTarget->aLevels[nLevel].bImplaneCornersCached = true; } int nBest = -1; int nBestZMSSD = Finder.mnMaxSSD + 1; double dMaxDistDiff = mCamera.OnePixelDist() * (4.0 + 1.0 * nLevelScale); double dMaxDistSq = dMaxDistDiff * dMaxDistDiff; for(unsigned int i=0; i<vv2Corners.size(); i++) // over all corners in target img.. { Vector<2> v2Im = vv2Corners[i]; double dDistDiff = dNormDist - v2Im * v2Normal; if(dDistDiff * dDistDiff > dMaxDistSq) continue; // skip if not along epi line if(v2Im * v2AlongProjectedLine < dMinLen) continue; // skip if not far enough along line if(v2Im * v2AlongProjectedLine > dMaxLen) continue; // or too far int nZMSSD = Finder.ZMSSDAtPoint(kTarget->aLevels[nLevel].im, vIR[i]); if(nZMSSD < nBestZMSSD) { nBest = i; nBestZMSSD = nZMSSD; } } if(nBest == -1) return false; // Nothing found. // Found a likely candidate along epipolar ray Finder.MakeSubPixTemplate(); Finder.SetSubPixPos(LevelZeroPos(vIR[nBest], nLevel)); bool bSubPixConverges = Finder.IterateSubPixToConvergence(*kTarget,10); if(!bSubPixConverges) return false; // Now triangulate the 3d point... Vector<3> v3New; v3New = kTarget->se3CfromW.inverse() * ReprojectPoint(kSrc->se3CfromW * kTarget->se3CfromW.inverse(), mCamera.UnProject(v2RootPos), mCamera.UnProject(Finder.GetSubPixPos())); MapPoint::Ptr pNew(new MapPoint()); pNew->v3WorldPos = v3New; pNew->pMMData = new MapMakerData(); // Patch source stuff: pNew->pPatchSourceKF = kSrc; pNew->nSourceLevel = nLevel; pNew->v3Normal_NC = makeVector( 0,0,-1); pNew->irCenter = irLevelPos; pNew->v3Center_NC = unproject(mCamera.UnProject(v2RootPos)); pNew->v3OneRightFromCenter_NC = unproject(mCamera.UnProject(v2RootPos + vec(ImageRef(nLevelScale,0)))); pNew->v3OneDownFromCenter_NC = unproject(mCamera.UnProject(v2RootPos + vec(ImageRef(0,nLevelScale)))); normalize(pNew->v3Center_NC); normalize(pNew->v3OneDownFromCenter_NC); normalize(pNew->v3OneRightFromCenter_NC); pNew->RefreshPixelVectors(); mMap.vpPoints.push_back(pNew); mqNewQueue.push(pNew); Measurement m; m.Source = Measurement::SRC_ROOT; m.v2RootPos = v2RootPos; m.nLevel = nLevel; m.bSubPix = true; kSrc->mMeasurements[pNew] = m; m.Source = Measurement::SRC_EPIPOLAR; m.v2RootPos = Finder.GetSubPixPos(); kTarget->mMeasurements[pNew] = m; pNew->pMMData->sMeasurementKFs.insert(kSrc); pNew->pMMData->sMeasurementKFs.insert(kTarget); //slynen{ reprojection #ifdef KF_REPROJ kSrc->AddKeyMapPoint(pNew); kTarget->AddKeyMapPoint(pNew); #endif //} return true; } double MapMaker::KeyFrameLinearDist(KeyFrame::Ptr k1, KeyFrame::Ptr k2) { Vector<3> v3KF1_CamPos = k1->se3CfromW.inverse().get_translation(); Vector<3> v3KF2_CamPos = k2->se3CfromW.inverse().get_translation(); Vector<3> v3Diff = v3KF2_CamPos - v3KF1_CamPos; double dDist = sqrt(v3Diff * v3Diff); return dDist; } vector<KeyFrame::Ptr> MapMaker::NClosestKeyFrames(KeyFrame::Ptr k, unsigned int N) { vector<pair<double, KeyFrame::Ptr > > vKFandScores; for(unsigned int i=0; i<mMap.vpKeyFrames.size(); i++) { if(mMap.vpKeyFrames[i] == k) continue; double dDist = KeyFrameLinearDist(k, mMap.vpKeyFrames[i]); vKFandScores.push_back(make_pair(dDist, mMap.vpKeyFrames[i])); } if(N > vKFandScores.size()) N = vKFandScores.size(); partial_sort(vKFandScores.begin(), vKFandScores.begin() + N, vKFandScores.end()); vector<KeyFrame::Ptr> vResult; for(unsigned int i=0; i<N; i++) vResult.push_back(vKFandScores[i].second); return vResult; } KeyFrame::Ptr MapMaker::ClosestKeyFrame(KeyFrame::Ptr k) { double dClosestDist = 9999999999.9; int nClosest = -1; for(unsigned int i=0; i<mMap.vpKeyFrames.size(); i++) { if(mMap.vpKeyFrames[i] == k) continue; double dDist = KeyFrameLinearDist(k, mMap.vpKeyFrames[i]); if(dDist < dClosestDist) { dClosestDist = dDist; nClosest = i; } } assert(nClosest != -1); return mMap.vpKeyFrames[nClosest]; } double MapMaker::DistToNearestKeyFrame(KeyFrame::Ptr kCurrent) { KeyFrame::Ptr pClosest = ClosestKeyFrame(kCurrent); double dDist = KeyFrameLinearDist(kCurrent, pClosest); return dDist; } bool MapMaker::NeedNewKeyFrame(KeyFrame::Ptr kCurrent) { KeyFrame::Ptr pClosest = ClosestKeyFrame(kCurrent); double dDist = KeyFrameLinearDist(kCurrent, pClosest); //Weiss{ const ptam::PtamParamsConfig& pPars = PtamParameters::varparams(); std::vector<double> medianpixdist; Vector<3> veccam2; Vector<2> cam2,cam1; for(std::map<MapPoint::Ptr, Measurement>::iterator it = kCurrent->mMeasurements.begin();it != kCurrent->mMeasurements.end(); it++) { veccam2 = pClosest->se3CfromW*it->first->v3WorldPos; // rotate in closest KF veccam2 = (kCurrent->se3CfromW*pClosest->se3CfromW.inverse()).get_rotation()*veccam2; // derot in current frame cam2 = mCamera.Project(makeVector(veccam2[0]/veccam2[2],veccam2[1]/veccam2[2])); cam1 = it->second.v2RootPos; medianpixdist.push_back(sqrt((cam2[0]-cam1[0])*(cam2[0]-cam1[0]) + (cam2[1]-cam1[1])*(cam2[1]-cam1[1]))); } std::vector<double>::iterator first = medianpixdist.begin(); std::vector<double>::iterator last = medianpixdist.end(); std::vector<double>::iterator middle = first + std::floor((last - first) / 2); std::nth_element(first, middle, last); // can specify comparator as optional 4th arg double mediandist = *middle; dDist *= (1.0 / kCurrent->dSceneDepthMean); // // const ptam::PtamParamsConfig& pPars = PtamParameters::varparams(); //if(dDist > GV2.GetDouble("MapMaker.MaxKFDistWiggleMult",1.0,SILENT) * mdWiggleScaleDepthNormalized) if(pPars.UseKFPixelDist & (mediandist>pPars.AutoInitPixel)) return true; if(dDist > pPars.MaxKFDistWiggleMult * mdWiggleScaleDepthNormalized) { return true; } return false; //} } // Perform bundle adjustment on all keyframes, all map points void MapMaker::BundleAdjustAll() { // construct the sets of kfs/points to be adjusted: // in this case, all of them set<KeyFrame::Ptr> sAdj; set<KeyFrame::Ptr> sFixed; for(unsigned int i=0; i<mMap.vpKeyFrames.size(); i++) if(mMap.vpKeyFrames[i]->bFixed) sFixed.insert(mMap.vpKeyFrames[i]); else sAdj.insert(mMap.vpKeyFrames[i]); set<MapPoint::Ptr> sMapPoints; for(unsigned int i=0; i<mMap.vpPoints.size();i++) sMapPoints.insert(mMap.vpPoints[i]); BundleAdjust(sAdj, sFixed, sMapPoints, false); } // Peform a local bundle adjustment which only adjusts // recently added key-frames void MapMaker::BundleAdjustRecent() { if(mMap.vpKeyFrames.size() < 8) { // Ignore this unless map is big enough mbBundleConverged_Recent = true; return; } // First, make a list of the keyframes we want adjusted in the adjuster. // This will be the last keyframe inserted, and its four nearest neighbors set<KeyFrame::Ptr> sAdjustSet; //Weiss{ if we only keep N KFs only insert most recently added KF as loose unsigned char nloose = 4; const ptam::PtamParamsConfig& pPars = PtamParameters::varparams(); if (pPars.MaxKF>1) // MaxKF<2 means keep all KFs nloose=0; KeyFrame::Ptr pkfNewest = mMap.vpKeyFrames.back(); sAdjustSet.insert(pkfNewest); vector<KeyFrame::Ptr> vClosest = NClosestKeyFrames(pkfNewest, 4); for(int i=0; i<nloose; i++) if(vClosest[i]->bFixed == false) sAdjustSet.insert(vClosest[i]); //} // Now we find the set of features which they contain. set<MapPoint::Ptr> sMapPoints; for(set<KeyFrame::Ptr>::iterator iter = sAdjustSet.begin(); iter!=sAdjustSet.end(); iter++) { map<MapPoint::Ptr,Measurement> &mKFMeas = (*iter)->mMeasurements; for(meas_it jiter = mKFMeas.begin(); jiter!= mKFMeas.end(); jiter++) sMapPoints.insert(jiter->first); }; // Finally, add all keyframes which measure above points as fixed keyframes set<KeyFrame::Ptr> sFixedSet; for(vector<KeyFrame::Ptr>::iterator it = mMap.vpKeyFrames.begin(); it!=mMap.vpKeyFrames.end(); it++) { if(sAdjustSet.count(*it)) continue; bool bInclude = false; for(meas_it jiter = (*it)->mMeasurements.begin(); jiter!= (*it)->mMeasurements.end(); jiter++) if(sMapPoints.count(jiter->first)) { bInclude = true; break; } if(bInclude) sFixedSet.insert(*it); } BundleAdjust(sAdjustSet, sFixedSet, sMapPoints, true); } // Common bundle adjustment code. This creates a bundle-adjust instance, populates it, and runs it. void MapMaker::BundleAdjust(set<KeyFrame::Ptr> sAdjustSet, set<KeyFrame::Ptr> sFixedSet, set<MapPoint::Ptr> sMapPoints, bool bRecent) { Bundle b(mCamera); // Our bundle adjuster mbBundleRunning = true; mbBundleRunningIsRecent = bRecent; // The bundle adjuster does different accounting of keyframes and map points; // Translation maps are stored: map<MapPoint::Ptr, int> mPoint_BundleID; map<int, MapPoint::Ptr> mBundleID_Point; map<KeyFrame::Ptr, int> mView_BundleID; map<int, KeyFrame::Ptr> mBundleID_View; // Add the keyframes' poses to the bundle adjuster. Two parts: first nonfixed, then fixed. for(set<KeyFrame::Ptr>::iterator it = sAdjustSet.begin(); it!= sAdjustSet.end(); it++) { int nBundleID = b.AddCamera((*it)->se3CfromW, (*it)->bFixed); mView_BundleID[*it] = nBundleID; mBundleID_View[nBundleID] = *it; } for(set<KeyFrame::Ptr>::iterator it = sFixedSet.begin(); it!= sFixedSet.end(); it++) { int nBundleID = b.AddCamera((*it)->se3CfromW, true); mView_BundleID[*it] = nBundleID; mBundleID_View[nBundleID] = *it; } // Add the points' 3D position for(set<MapPoint::Ptr>::iterator it = sMapPoints.begin(); it!=sMapPoints.end(); it++) { int nBundleID = b.AddPoint((*it)->v3WorldPos); mPoint_BundleID[*it] = nBundleID; mBundleID_Point[nBundleID] = *it; //Weiss{ feature statistics // if(kfid==(*it)->pPatchSourceKF->ID) // { // addcount[(*it)->nSourceLevel]++; // addcount[4]++; // } //} } // Add the relevant point-in-keyframe measurements for(unsigned int i=0; i<mMap.vpKeyFrames.size(); i++) { if(mView_BundleID.count(mMap.vpKeyFrames[i]) == 0) continue; int nKF_BundleID = mView_BundleID[mMap.vpKeyFrames[i]]; for(meas_it it= mMap.vpKeyFrames[i]->mMeasurements.begin(); it!= mMap.vpKeyFrames[i]->mMeasurements.end(); it++) { if(mPoint_BundleID.count(it->first) == 0) continue; int nPoint_BundleID = mPoint_BundleID[it->first]; b.AddMeas(nKF_BundleID, nPoint_BundleID, it->second.v2RootPos, LevelScale(it->second.nLevel) * LevelScale(it->second.nLevel)); } } // Run the bundle adjuster. This returns the number of successful iterations int nAccepted = b.Compute(&mbBundleAbortRequested); if(nAccepted < 0) { // Crap: - LM Ran into a serious problem! // This is probably because the initial stereo was messed up. // Get rid of this map and start again! mMessageForUser << "!! MapMaker: Cholesky failure in bundle adjust. " << endl << " The map is probably corrupt: Ditching the map. " << endl; mbResetRequested = true; return; } // Bundle adjustment did some updates, apply these to the map if(nAccepted > 0) { //slynen{ pcl interface std::set<MapPoint::Ptr> mapPointsToUpdate; //copy the data for(map<MapPoint::Ptr,int>::iterator itr = mPoint_BundleID.begin(); itr!=mPoint_BundleID.end(); itr++){ itr->first->v3WorldPos = b.GetPoint(itr->second); mapPointsToUpdate.insert(itr->first); } octomap_interface.updatePoints(mapPointsToUpdate); //} for(map<KeyFrame::Ptr,int>::iterator itr = mView_BundleID.begin(); itr!=mView_BundleID.end(); itr++) itr->first->se3CfromW = b.GetCamera(itr->second); if(bRecent) mbBundleConverged_Recent = false; mbBundleConverged_Full = false; }; if(b.Converged()) { mbBundleConverged_Recent = true; if(!bRecent) mbBundleConverged_Full = true; } mbBundleRunning = false; mbBundleAbortRequested = false; // Handle outlier measurements: vector<pair<int,int> > vOutliers_PC_pair = b.GetOutlierMeasurements(); for(unsigned int i=0; i<vOutliers_PC_pair.size(); i++) { MapPoint::Ptr pp = mBundleID_Point[vOutliers_PC_pair[i].first]; KeyFrame::Ptr pk = mBundleID_View[vOutliers_PC_pair[i].second]; Measurement &m = pk->mMeasurements[pp]; if(pp->pMMData->GoodMeasCount() <= 2 || m.Source == Measurement::SRC_ROOT) // Is the original source kf considered an outlier? That's bad. pp->bBad = true; else { // Do we retry it? Depends where it came from!! if(m.Source == Measurement::SRC_TRACKER || m.Source == Measurement::SRC_EPIPOLAR) mvFailureQueue.push_back(pair<KeyFrame::Ptr,MapPoint::Ptr>(pk,pp)); else pp->pMMData->sNeverRetryKFs.insert(pk); pk->mMeasurements.erase(pp); pp->pMMData->sMeasurementKFs.erase(pk); //Weiss{ feature statistics // if(kfid==pp->pPatchSourceKF->ID) // { // outcount[pp->nSourceLevel]++; // outcount[4]++; // } //} } } } // Mapmaker's try-to-find-a-point-in-a-keyframe code. This is used to update // data association if a bad measurement was detected, or if a point // was never searched for in a keyframe in the first place. This operates // much like the tracker! So most of the code looks just like in // TrackerData.h. bool MapMaker::ReFind_Common(KeyFrame::Ptr k, MapPoint::Ptr p) { // abort if either a measurement is already in the map, or we've // decided that this point-kf combo is beyond redemption if(p->pMMData->sMeasurementKFs.count(k) || p->pMMData->sNeverRetryKFs.count(k)) return false; static PatchFinder Finder; Vector<3> v3Cam = k->se3CfromW * p->v3WorldPos; if(v3Cam[2] < 0.001) { p->pMMData->sNeverRetryKFs.insert(k); return false; } Vector<2> v2ImPlane = project(v3Cam); if(v2ImPlane* v2ImPlane > mCamera.LargestRadiusInImage() * mCamera.LargestRadiusInImage()) { p->pMMData->sNeverRetryKFs.insert(k); return false; } Vector<2> v2Image = mCamera.Project(v2ImPlane); if(mCamera.Invalid()) { p->pMMData->sNeverRetryKFs.insert(k); return false; } ImageRef irImageSize = k->aLevels[0].im.size(); if(v2Image[0] < 0 || v2Image[1] < 0 || v2Image[0] > irImageSize[0] || v2Image[1] > irImageSize[1]) { p->pMMData->sNeverRetryKFs.insert(k); return false; } Matrix<2> m2CamDerivs = mCamera.GetProjectionDerivs(); Finder.MakeTemplateCoarse(p, k->se3CfromW, m2CamDerivs); if(Finder.TemplateBad()) { p->pMMData->sNeverRetryKFs.insert(k); return false; } bool bFound = Finder.FindPatchCoarse(ir(v2Image), k, 4); // Very tight search radius! if(!bFound) { p->pMMData->sNeverRetryKFs.insert(k); return false; } // If we found something, generate a measurement struct and put it in the map Measurement m; m.nLevel = Finder.GetLevel(); m.Source = Measurement::SRC_REFIND; if(Finder.GetLevel() > 0) { Finder.MakeSubPixTemplate(); Finder.IterateSubPixToConvergence(*k,8); m.v2RootPos = Finder.GetSubPixPos(); m.bSubPix = true; } else { m.v2RootPos = Finder.GetCoarsePosAsVector(); m.bSubPix = false; }; if(k->mMeasurements.count(p)) { assert(0); // This should never happen, we checked for this at the start. } k->mMeasurements[p] = m; p->pMMData->sMeasurementKFs.insert(k); //slynen{ reprojection #ifdef KF_REPROJ k->AddKeyMapPoint(p); #endif //} //slynen octomap_interface{ octomap_interface.updatePoint(p); //} return true; } // A general data-association update for a single keyframe // Do this on a new key-frame when it's passed in by the tracker int MapMaker::ReFindInSingleKeyFrame(KeyFrame::Ptr k) { vector<MapPoint::Ptr> vToFind; for(unsigned int i=0; i<mMap.vpPoints.size(); i++) vToFind.push_back(mMap.vpPoints[i]); int nFoundNow = 0; for(unsigned int i=0; i<vToFind.size(); i++) if(ReFind_Common(k,vToFind[i])) nFoundNow++; return nFoundNow; }; // When new map points are generated, they're only created from a stereo pair // this tries to make additional measurements in other KFs which they might // be in. void MapMaker::ReFindNewlyMade() { if(mqNewQueue.empty()) return; int nFound = 0; int nBad = 0; while(!mqNewQueue.empty() && mvpKeyFrameQueue.size() == 0) { MapPoint::Ptr pNew = mqNewQueue.front(); mqNewQueue.pop(); if(pNew->bBad) { nBad++; continue; } for(unsigned int i=0; i<mMap.vpKeyFrames.size(); i++) if(ReFind_Common(mMap.vpKeyFrames[i], pNew)) nFound++; } }; // Dud measurements get a second chance. void MapMaker::ReFindFromFailureQueue() { if(mvFailureQueue.size() == 0) return; sort(mvFailureQueue.begin(), mvFailureQueue.end()); vector<pair<KeyFrame::Ptr, MapPoint::Ptr> >::iterator it; int nFound=0; for(it = mvFailureQueue.begin(); it!=mvFailureQueue.end(); it++) if(ReFind_Common(it->first, it->second)) nFound++; mvFailureQueue.erase(mvFailureQueue.begin(), it); }; // Is the tracker's camera pose in cloud-cuckoo land? bool MapMaker::IsDistanceToNearestKeyFrameExcessive(KeyFrame::Ptr kCurrent) { return DistToNearestKeyFrame(kCurrent) > mdWiggleScale * 10.0; } // Find a dominant plane in the map, find an SE3<> to put it as the z=0 plane SE3<> MapMaker::CalcPlaneAligner() { unsigned int nPoints = mMap.vpPoints.size(); if(nPoints < 10) { mMessageForUser << " MapMaker: CalcPlane: too few points to calc plane." << endl; return SE3<>(); }; //Weiss{ const ptam::PtamParamsConfig& pPars = PtamParameters::varparams(); int nRansacs = pPars.PlaneAlignerRansacs; //int nRansacs = GV2.GetInt("MapMaker.PlaneAlignerRansacs", 100, HIDDEN|SILENT); //} Vector<3> v3BestMean=makeVector(0,0,0); Vector<3> v3BestNormal=makeVector(0,0,0); double dBestDistSquared = 9999999999999999.9; for(int i=0; i<nRansacs; i++) { int nA = rand()%nPoints; int nB = nA; int nC = nA; while(nB == nA) nB = rand()%nPoints; while(nC == nA || nC==nB) nC = rand()%nPoints; Vector<3> v3Mean = 0.33333333 * (mMap.vpPoints[nA]->v3WorldPos + mMap.vpPoints[nB]->v3WorldPos + mMap.vpPoints[nC]->v3WorldPos); Vector<3> v3CA = mMap.vpPoints[nC]->v3WorldPos - mMap.vpPoints[nA]->v3WorldPos; Vector<3> v3BA = mMap.vpPoints[nB]->v3WorldPos - mMap.vpPoints[nA]->v3WorldPos; Vector<3> v3Normal = v3CA ^ v3BA; if(v3Normal * v3Normal == 0) continue; normalize(v3Normal); double dSumError = 0.0; for(unsigned int i=0; i<nPoints; i++) { Vector<3> v3Diff = mMap.vpPoints[i]->v3WorldPos - v3Mean; double dDistSq = v3Diff * v3Diff; if(dDistSq == 0.0) continue; double dNormDist = fabs(v3Diff * v3Normal); if(dNormDist > 0.05) dNormDist = 0.05; dSumError += dNormDist; } if(dSumError < dBestDistSquared) { dBestDistSquared = dSumError; v3BestMean = v3Mean; v3BestNormal = v3Normal; } } // Done the ransacs, now collect the supposed inlier set vector<Vector<3> > vv3Inliers; for(unsigned int i=0; i<nPoints; i++) { Vector<3> v3Diff = mMap.vpPoints[i]->v3WorldPos - v3BestMean; double dDistSq = v3Diff * v3Diff; if(dDistSq == 0.0) continue; double dNormDist = fabs(v3Diff * v3BestNormal); if(dNormDist < 0.05) vv3Inliers.push_back(mMap.vpPoints[i]->v3WorldPos); } // With these inliers, calculate mean and cov Vector<3> v3MeanOfInliers = Zeros; for(unsigned int i=0; i<vv3Inliers.size(); i++) v3MeanOfInliers+=vv3Inliers[i]; v3MeanOfInliers *= (1.0 / vv3Inliers.size()); Matrix<3> m3Cov = Zeros; for(unsigned int i=0; i<vv3Inliers.size(); i++) { Vector<3> v3Diff = vv3Inliers[i] - v3MeanOfInliers; m3Cov += v3Diff.as_col() * v3Diff.as_row(); }; // Find the principal component with the minimal variance: this is the plane normal SymEigen<3> sym(m3Cov); Vector<3> v3Normal = sym.get_evectors()[0]; // Use the version of the normal which points towards the cam center if(v3Normal[2] > 0) v3Normal *= -1.0; Matrix<3> m3Rot = Identity; m3Rot[2] = v3Normal; m3Rot[0] = m3Rot[0] - (v3Normal * (m3Rot[0] * v3Normal)); normalize(m3Rot[0]); m3Rot[1] = m3Rot[2] ^ m3Rot[0]; SE3<> se3Aligner; se3Aligner.get_rotation() = m3Rot; Vector<3> v3RMean = se3Aligner * v3MeanOfInliers; se3Aligner.get_translation() = -v3RMean; return se3Aligner; } // Calculates the depth(z-) distribution of map points visible in a keyframe // This function is only used for the first two keyframes - all others // get this filled in by the tracker bool MapMaker::RefreshSceneDepth(KeyFrame::Ptr pKF) { double dSumDepth = 0.0; double dSumDepthSquared = 0.0; int nMeas = 0; for(meas_it it = pKF->mMeasurements.begin(); it!=pKF->mMeasurements.end(); it++) { MapPoint &point = *it->first; Vector<3> v3PosK = pKF->se3CfromW * point.v3WorldPos; dSumDepth += v3PosK[2]; dSumDepthSquared += v3PosK[2] * v3PosK[2]; nMeas++; } //Weiss{ // assert(nMeas > 2); // If not then something is seriously wrong with this KF!! //agree, but do not kill whole PTAM just because of that... if (nMeas<2) return false; pKF->dSceneDepthMean = dSumDepth / nMeas; pKF->dSceneDepthSigma = sqrt((dSumDepthSquared / nMeas) - (pKF->dSceneDepthMean) * (pKF->dSceneDepthMean)); return true; } void MapMaker::GUICommandCallBack(void* ptr, string sCommand, string sParams) { Command c; c.sCommand = sCommand; c.sParams = sParams; ((MapMaker*) ptr)->mvQueuedCommands.push_back(c); } void MapMaker::GUICommandHandler(string sCommand, string sParams) // Called by the callback func.. { if(sCommand=="SaveMap") { mMessageForUser << " MapMaker: Saving the map.... " << endl; ofstream ofs("map.dump"); for(unsigned int i=0; i<mMap.vpPoints.size(); i++) { ofs << mMap.vpPoints[i]->v3WorldPos << " "; ofs << mMap.vpPoints[i]->nSourceLevel << endl; } ofs.close(); for(unsigned int i=0; i<mMap.vpKeyFrames.size(); i++) { ostringstream ost1; ost1 << "keyframes/" << i << ".jpg"; // img_save(mMap.vpKeyFrames[i]->aLevels[0].im, ost1.str()); ostringstream ost2; ost2 << "keyframes/" << i << ".info"; ofstream ofs2; ofs2.open(ost2.str().c_str()); ofs2 << mMap.vpKeyFrames[i]->se3CfromW << endl; ofs2.close(); } mMessageForUser << " ... done saving map." << endl; return; } mMessageForUser << "! MapMaker::GUICommandHandler: unhandled command "<< sCommand << endl; exit(1); };
{ "pile_set_name": "Github" }
# author: Yasuhiro Matsumoto use Web::Scraper::LibXML; sub init { my $self = shift; $self->{handle} = "/ann/news/"; } sub needs_content { 1 } sub find { my ($self, $args) = @_; my $res = scraper { process "//a[contains(\@href, '300k')]", movie => sub { my ($link) = $_->attr('onClick') =~ /(mms:[^']+)/; $link }; process "//img[contains(\@src, 'pict/')]", thumbnail => '@src'; }->scrape($args->{content}, $args->{url}); my $enclosure = Plagger::Enclosure->new; $enclosure->url($res->{movie}); $enclosure->type("video/x-ms-wmv"); $enclosure->thumbnail({ url => $res->{thumbnail} }); return $enclosure; }
{ "pile_set_name": "Github" }
# CoreData * 要把 `Core Data` 作为一个对象图管理系统来使用,而不是关系型数据库 * `Core Data` 的架构图: ![](https://i.loli.net/2019/06/28/5d14eb260c2f935863.png) - **托管对象**:我们创建的数据模型。 - **托管对象上下文**:托管对象上下文记录了它管理的对象,以及对这些对象的 CRUD,每个被托管的对象都知道自己属于哪个上下文。 - `Core Data` 支持多个上下文。 - 数据底层实际上会被存储在 `SQLite` 数据库里。 * `Core Data` 存储结构化的数据。所以为了使用 `Core Data` 需要先创建一个数据模型来描述我们的数据结构。 * **实体**:一个实体应该代表你的应用程序里有意义的一个部分数据。实体名称以大写字母开头。 * **属性**:属性名称应该以小写字母开头。因为 `Array` 已经遵循里 `NSCoding` 协议,所以可以直接把这样的数组直接存入一个可转换类型的属性 `Transformable` 里。 * 属性选项:**必选属性** `non-optional` 必须要赋给它们恰当的值,才能保存这些数据。把属性标记为可索引时 `indexed`,`Core Data` 会在底层 `SQLite` 数据库表里创建一个索引,可以加速这个属性的搜索和排序,但代价是插入数据时的性能下降和额外的存储空间。 * **托管对象子类**:实体只是面熟了那些数据属于某个对象,为了能够在代码中使用这个数据,还需要一个具有和实体里定义的属性们相对应的属性的类。 - 实体和类都叫同一个名字。 - 不建议使用 `Xcode` 的代码生成工程工具,而是直接手写。 - 代码通常会如下所示: ```swift final class Mood: NSManagedObject { @NSManaged 􏰀leprivate(set) var date: Date @NSManaged 􏰀leprivate(set) var colors: [UIColor] } ``` - `@NSManaged` 标签告诉编译器这些属性由 `Core Data` 来实现。 - 在模型编辑器中选中这个实体,然后在 `data model inspector` 里输入它的类名完成实体和类的关联。 * **设置 `Core Data` 栈** * **获取请求** 每次执行一个获取请求,都会直达文件系统,是一个相对昂贵的操作,可能是一个潜在的性能瓶颈。 * **Fetched Results Controller** - 与 `tableView` 的交互: ![](https://i.loli.net/2019/06/28/5d14f273b221324819.png) * 始终把 `Core Data` 对象交互的代码封装进类似的一个 `block` 里。 * **子实体** - ![](https://i.loli.net/2019/07/18/5d30090a33e8e39794.png) * 在 `Core Data` 的模型编辑器中设置好关系 * 在代码中写入实体关系代码不是必须的,只要在「模型编辑器」中设置好了对应的关系,实际上就可以开始工作了,但为了在代码里直接使用它们,可以定义一下。 * 自定义删除规则。 - 使用 `prepareForDeletion` 方法,该方法会在对象被删除之前被调用。 * CoreData 推荐在大数据集合时,分批处理,最佳的测试结果显示,单批次 1000 个左右比较好 ### 获取请求操作的这两行代码具体做了什么操作? ```swift let request = NSFetchRequest<Mood>(entityName: "Mood") let moods = try! context.fetch(request) ``` * `context` 通过调用 `execute(_request:withcontext:)` 方法把请求转交给它的持久化存储协调器。 * 持久化存储协调器通过调用每个存储的 `execute(_request:withcontext:)` 方法把获取到的请求转发给所有的持久化存储。此时的 `context` 被传递给了持久化存储。 * 持久化存储把获取请求转换成一个 `SQL` 语句,并把这个 `SQL` 语句发送给 `SQLite`。 * `SQLite` 在存储数据库文件里执行该语句,并将所有匹配查询条件的所有行(`row`)返回给存储。`row` 里包括了对象的 `ID` 和其它属性数据(`includesPropertyValues = true`)。 返回的原始数据是由数字、字符串和二进制大对象 (BLOB, Binary Large Objects) 这样 的简单的数据类型组成的。它被存储在持久化存储的行缓存 (row cache) 里,一起存储 的还有对象 ID 和缓存条目最后更新的时间戳。只要在上下文里存在某个特定对象 ID 的 托管对象,含有这个对象 ID 的行缓存条目就会一直存在,无论这个对象是不是惰值 (fault)。 * 持久化存储把它从 `SQLite` 存储接收到的对象 ID 实例化为托管对象,并把这些对象返回给协调器。这些对象默认是**惰性**的。在相同的托管对象上下文里,表示相同数据 * 持久化存储协调器把它从持久化存储拿到的托管对象数组返回给上下文。 * 最后,一个匹配该获取请求的托管对象数组被返回给调用者。 需要注意的是,以上这一切的操作都是**同步**的,而且直到获取请求完成为止,托管对象上下文都会被阻塞。 ![](https://i.loli.net/2019/07/23/5d3725eebeb4390705.png) ### 批量获取 ```swift let request = Mood.sortedFetchRequest(with: moodSource.predicate) request.returnsObjectsAsFaults = false request.fetchBatchSize = 20 ``` 这个查询结果只是一个对象 ID 的列表,而不是与它们相关联的所有数据。持久化存储协调器创建一个特殊的,由这些 ID 组成的数组,并将这个数组返回给上下文,并且这个数组没有被任何数据填充,它只在必要的时候才会去获取数据。 一旦我们访问数组里的数据,Core Data 才会去「按页加载」真正的数据,处理流程如下: 1. 这个分批处理的数组注意到它缺少你正尝试访问的元素的数据,它会要求上下文加载你 请求的索引附近数量为 fetchBatchSize 的一批对象。 2. 像往常一样,这个请求被持久化存储协调器转发到持久化存储,在那里执行适当的SQL 语句来从 SQLite 加载这批数据。原始数据被存储在行缓存里,托管对象则被返回给协 调器。 3. 因为我们已经设置了returnsObjectsAsFaults为false,协调器会要求存储提供全部数 据,然后用这些数据来填充对象,并将这些对象返回给上下文。 4. 这一批次的数组将返回你所请求的对象,并持有本批次里的其他对象,这样接下来如果 你需要使用其中某个对象的话,就不必再次获取了。 当我们在遍历数组去加载数据时,Core Data 会以 LRU 的原则来控制数据集合,也就是以最近使用作为原则来保持少量批次,而较早的批次将会被释放。 ### 异步获取请求 ```swift let fetchRequest = NSFetchRequest<Mood>(entityName: "Mood") let asyncRequest = NSAsynchronousFetchRequest( fetchRequest: fetchRequest) { result in if let result = result.􏰀nalResult { // 获取到结果了 } } try! context.execute(asyncRequest) ``` ### 内存考量 为了减小内存消耗和回应内存警告的处理,可以使用 `context` 的 `refreshAllObject()` 方法来将不包含待保存改变的对象惰值化。 ### 关系的循环引用 ![关系的循环引用](https://i.loli.net/2019/07/24/5d384aab287fe29674.png) 解决以上问题,需要至少刷新一个对象。通过调用上下文的 `refresh(_ object:mergeChanges:)` 方法 ### 对性能影响最大的是获取请求 (fetch request)。 获取请求会遍历整个 Core Data 栈。一个获取请求,按照它的 API 约定,就算是从托管对象上下文中发起的,也会查询到文件系统的 SQLite 存储。 ### 索引 是否添加索引,取决于,在你的应用程序中,获取数据与修改数据频繁程度的比例。如果更新或者插入非常频繁,最好不要添加索引。如果更新或插入不频繁,而查询和搜索非常频繁,那么添加索引会是个好主意。 有一个因素是数据集的大小:如果实体的数目相对较小,添加索引并不能给我们带来多少帮助,因为数据库扫描所有数据也很快。但是如果数量巨大,添加索引就可能可以显著改善性能。 ### 手动管理实体代码生成器 Core Data 默认创建出来的实体是**自动生成代码**,如果我们想要手动管理实体代码,需要按照如下图进行修改 `codegen`: ![手动管理实体代码生成器](https://i.loli.net/2019/07/28/5d3dbd6b7947f91326.png) ### NSFetchResultController 获取数据 * 第一次初始化时,可以通过 `try! fetchedResultsController.performFetch()` 来获取数据,正常执行完方法后即可拿到数据。`NSFetchedResultsController` 既是 fetch request 的包装,也是一个获取数据用的 container,我们可以从中获取到数据。 * 后续再执行增删时,通过代理响应数据变化。
{ "pile_set_name": "Github" }
options.url.description = the URL of the RSS feed options.url.type = java.lang.String options.fixedRate.description = the fixed rate polling interval specified in milliseconds options.fixedRate.default = 5000 options.fixedRate.type = int options.maxMessagesPerPoll.description = the maximum number of messages per poll options.maxMessagesPerPoll.default = 100 options.maxMessagesPerPoll.type = int
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_162) on Sat Apr 25 18:49:58 PDT 2020 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Deprecated List (Jackson-module-parameter-names 2.11.0 API)</title> <meta name="date" content="2020-04-25"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript" src="script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Deprecated List (Jackson-module-parameter-names 2.11.0 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="com/fasterxml/jackson/module/paramnames/package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li><a href="com/fasterxml/jackson/module/paramnames/package-tree.html">Tree</a></li> <li class="navBarCell1Rev">Deprecated</li> <li><a href="index-all.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li> <li><a href="deprecated-list.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 title="Deprecated API" class="title">Deprecated API</h1> <h2 title="Contents">Contents</h2> <ul> <li><a href="#method">Deprecated Methods</a></li> </ul> </div> <div class="contentContainer"><a name="method"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <table class="deprecatedSummary" border="0" cellpadding="3" cellspacing="0" summary="Deprecated Methods table, listing deprecated methods, and an explanation"> <caption><span>Deprecated Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="com/fasterxml/jackson/module/paramnames/ParameterNamesAnnotationIntrospector.html#findCreatorBinding-com.fasterxml.jackson.databind.introspect.Annotated-">com.fasterxml.jackson.module.paramnames.ParameterNamesAnnotationIntrospector.findCreatorBinding(Annotated)</a></td> </tr> <tr class="rowColor"> <td class="colOne"><a href="com/fasterxml/jackson/module/paramnames/ParameterNamesAnnotationIntrospector.html#hasCreatorAnnotation-com.fasterxml.jackson.databind.introspect.Annotated-">com.fasterxml.jackson.module.paramnames.ParameterNamesAnnotationIntrospector.hasCreatorAnnotation(Annotated)</a></td> </tr> </tbody> </table> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="com/fasterxml/jackson/module/paramnames/package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li><a href="com/fasterxml/jackson/module/paramnames/package-tree.html">Tree</a></li> <li class="navBarCell1Rev">Deprecated</li> <li><a href="index-all.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li> <li><a href="deprecated-list.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2020 <a href="http://fasterxml.com/">FasterXML</a>. All rights reserved.</small></p> </body> </html>
{ "pile_set_name": "Github" }
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. #include "CurveKeyEditors/SBoolCurveKeyEditor.h" #include "Styling/SlateTypes.h" #include "Widgets/Input/SCheckBox.h" #include "Curves/KeyHandle.h" #include "ISequencer.h" #include "ScopedTransaction.h" #include "Curves/IntegralCurve.h" #define LOCTEXT_NAMESPACE "BoolCurveKeyEditor" void SBoolCurveKeyEditor::Construct(const FArguments& InArgs) { Sequencer = InArgs._Sequencer; OwningSection = InArgs._OwningSection; Curve = InArgs._Curve; ExternalValue = InArgs._ExternalValue; ChildSlot [ SNew(SCheckBox) .IsChecked(this, &SBoolCurveKeyEditor::IsChecked) .OnCheckStateChanged(this, &SBoolCurveKeyEditor::OnCheckStateChanged) ]; } ECheckBoxState SBoolCurveKeyEditor::IsChecked() const { bool bCurrentValue; if (ExternalValue.IsSet() && ExternalValue.Get().IsSet()) { bCurrentValue = ExternalValue.Get().GetValue(); } else { float CurrentTime = Sequencer->GetLocalTime(); bool DefaultValue = false; bCurrentValue = Curve->Evaluate(CurrentTime, DefaultValue) != 0; } return bCurrentValue ? ECheckBoxState::Checked : ECheckBoxState::Unchecked; } void SBoolCurveKeyEditor::OnCheckStateChanged(ECheckBoxState NewCheckboxState) { FScopedTransaction Transaction(LOCTEXT("SetBoolKey", "Set Bool Key Value")); OwningSection->SetFlags(RF_Transactional); if (OwningSection->TryModify()) { float CurrentTime = Sequencer->GetLocalTime(); bool bAutoSetTrackDefaults = Sequencer->GetAutoSetTrackDefaults(); int32 NewValue = NewCheckboxState == ECheckBoxState::Checked ? 1 : 0; FKeyHandle CurrentKeyHandle = Curve->FindKey(CurrentTime); if (Curve->IsKeyHandleValid(CurrentKeyHandle)) { Curve->SetKeyValue(CurrentKeyHandle, NewValue); } else { if (Curve->GetNumKeys() != 0 || bAutoSetTrackDefaults == false) { // When auto setting track defaults are disabled, add a key even when it's empty so that the changed // value is saved and is propagated to the property. Curve->AddKey(CurrentTime, NewValue, CurrentKeyHandle); } if (Curve->GetNumKeys() != 0) { if (OwningSection->GetStartTime() > CurrentTime) { OwningSection->SetStartTime(CurrentTime); } if (OwningSection->GetEndTime() < CurrentTime) { OwningSection->SetEndTime(CurrentTime); } } } // Always update the default value when auto-set default values is enabled so that the last changes // are always saved to the track. if (bAutoSetTrackDefaults) { Curve->SetDefaultValue(NewValue); } Sequencer->NotifyMovieSceneDataChanged( EMovieSceneDataChangeType::TrackValueChangedRefreshImmediately ); } } #undef LOCTEXT_NAMESPACE
{ "pile_set_name": "Github" }
#!/usr/bin/env node (function() { var fs = require('fs'); var he = require('../he.js'); var strings = process.argv.splice(2); var stdin = process.stdin; var data; var timeout; var action; var options = {}; var log = console.log; var main = function() { var option = strings[0]; var count = 0; if (/^(?:-h|--help|undefined)$/.test(option)) { log( 'he v%s - http://mths.be/he', he.version ); log([ '\nUsage:\n', '\the [--escape] string', '\the [--encode] [--use-named-refs] [--everything] string', '\the [--decode] [--attribute] [--strict] string', '\the [-v | --version]', '\the [-h | --help]', '\nExamples:\n', '\the --escape \\<img\\ src\\=\\\'x\\\'\\ onerror\\=\\"prompt\\(1\\)\\"\\>', '\techo \'&copy; &#x1D306;\' | he --decode' ].join('\n')); return process.exit(1); } if (/^(?:-v|--version)$/.test(option)) { log('v%s', he.version); return process.exit(1); } strings.forEach(function(string) { // Process options if (string == '--escape') { action = 'escape'; return; } if (string == '--encode') { action = 'encode'; return; } if (string == '--use-named-refs') { action = 'encode'; options.useNamedReferences = true; return; } if (string == '--everything') { action = 'encode'; options.encodeEverything = true; return; } if (string == '--decode') { action = 'decode'; return; } if (string == '--attribute') { action = 'decode'; options.isAttributeValue = true; return; } if (string == '--strict') { action = 'decode'; options.strict = true; return; } // Process string(s) var result; if (!action) { log('Error: he requires at least one option and a string argument.'); log('Try `he --help` for more information.'); return process.exit(1); } try { result = he[action](string, options); log(result); count++; } catch(error) { log(error.message + '\n'); log('Error: failed to %s.', action); log('If you think this is a bug in he, please report it:'); log('https://github.com/mathiasbynens/he/issues/new'); log( '\nStack trace using he@%s:\n', he.version ); log(error.stack); return process.exit(1); } }); if (!count) { log('Error: he requires a string argument.'); log('Try `he --help` for more information.'); return process.exit(1); } // Return with exit status 0 outside of the `forEach` loop, in case // multiple strings were passed in. return process.exit(0); }; if (stdin.isTTY) { // handle shell arguments main(); } else { // Either the script is called from within a non-TTY context, or `stdin` // content is being piped in. if (!process.stdout.isTTY) { // The script was called from a non-TTY context. This is a rather uncommon // use case we don’t actively support. However, we don’t want the script // to wait forever in such cases, so… timeout = setTimeout(function() { // …if no piped data arrived after a whole minute, handle shell // arguments instead. main(); }, 60000); } data = ''; stdin.on('data', function(chunk) { clearTimeout(timeout); data += chunk; }); stdin.on('end', function() { strings.push(data.trim()); main(); }); stdin.resume(); } }());
{ "pile_set_name": "Github" }
<?php namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; /** * Stream decorator that prevents a stream from being seeked */ class NoSeekStream implements StreamInterface { use StreamDecoratorTrait; public function seek($offset, $whence = SEEK_SET) { throw new \RuntimeException('Cannot seek a NoSeekStream'); } public function isSeekable() { return false; } }
{ "pile_set_name": "Github" }
{ "dateSelected": "התאריך {date, date, full} שנבחר", "finishRangeSelectionPrompt": "חץ כדי לסיים את בחירת טווח התאריכים", "next": "הבא", "previous": "הקודם", "selectedDateDescription": "התאריך שנבחר: {date, date, full}", "selectedRangeDescription": "הטווח שנבחר: מ-{start, date, long} ועד {end, date, long}", "startRangeSelectionPrompt": "לחץ כדי להתחיל בבחירת טווח התאריכים", "todayDate": "היום, {date, date, full}", "todayDateSelected": "היום, התאריך {date, date, full} שנבחר" }
{ "pile_set_name": "Github" }
/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS ComputeStyle(bond/local,ComputeBondLocal) #else #ifndef LMP_COMPUTE_BOND_LOCAL_H #define LMP_COMPUTE_BOND_LOCAL_H #include "compute.h" namespace LAMMPS_NS { class ComputeBondLocal : public Compute { public: ComputeBondLocal(class LAMMPS *, int, char **); ~ComputeBondLocal(); void init(); void compute_local(); int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); double memory_usage(); private: int nvalues,nvar,ncount,setflag; int singleflag,velflag,ghostvelflag,initflag; int dvar; int *bstyle,*vvar; char *dstr; char **vstr; int nmax; double *vlocal; double **alocal; int compute_bonds(int); void reallocate(int); }; } #endif #endif /* ERROR/WARNING messages: E: Illegal ... command Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. E: Compute bond/local used when bonds are not allowed The atom style does not support bonds. E: Invalid keyword in compute bond/local command Self-explanatory. E: No bond style is defined for compute bond/local Self-explanatory. E: Sanity check on 3 energy components failed UNDOCUMENTED */
{ "pile_set_name": "Github" }
{% extends "FOSUserBundle::layout.html.twig" %} {% block subtitle %}{{ 'change_password.heading'|trans() }}{% endblock %} {% form_theme form 'LadbCoreBundle:Common:_form-theme.twig.twig' %} {% block fos_user_content %} <div class="row"> <div class="col-xs-12 col-sm-6 col-sm-push-3"> <div class="panel panel-default panel-lg"> <div class="panel-heading"> <h1 class="panel-title">{{ 'change_password.heading'|trans() }}</h1> </div> {{ form_start(form, { 'action':path('fos_user_change_password'), 'method':'POST' }) }} <div class="panel-body"> {{ form_widget(form) }} </div> <div class="panel-footer"> <input type="submit" value="{{ 'change_password.submit'|trans() }}" class="btn btn-primary" /> </div> {{ form_end(form) }} </div> </div> <div class="col-xs-12 text-center"> <a href="{{ path('fos_user_resetting_request') }}">{{ 'resetting.request.heading'|trans() }}</a> </div> </div> {% endblock fos_user_content %}
{ "pile_set_name": "Github" }
#import "NSIndexSet+Analysis.h" @implementation NSIndexSet (Analysis) - (BOOL)WB_containsOnlyOneRange { NSUInteger tCount=self.count; if (tCount>0) { NSUInteger tFirstIndex=self.firstIndex; NSUInteger tLastIndex=self.lastIndex; return ((tLastIndex-tFirstIndex+1)==tCount); } return NO; } @end
{ "pile_set_name": "Github" }
easyblock = 'ConfigureMake' name = 'libxc' version = '2.0.1' homepage = 'http://www.tddft.org/programs/octopus/wiki/index.php/Libxc' description = """Libxc is a library of exchange-correlation functionals for density-functional theory. The aim is to provide a portable, well tested and reliable set of exchange and correlation functionals.""" toolchain = {'name': 'ictce', 'version': '5.5.0'} # Results for some functionals (e.g. mgga_c_tpss) deviate with too aggressive optimization settings. toolchainopts = {'lowopt': True} sources = [SOURCE_TAR_GZ] source_urls = ['http://www.tddft.org/programs/octopus/down.php?file=libxc/'] configopts = 'FC="$F77" FCFLAGS="$FFLAGS" FCCPP="$F77 -E" --enable-shared' # From the libxc mailing list # To summarize: expect less tests to fail in libxc 2.0.2, but don't expect # a fully working testsuite soon (unless someone wants to volunteer to do # it, of course ) In the meantime, unless the majority of the tests # fail, your build should be fine. # runtest = 'check' sanity_check_paths = { 'files': ['lib/libxc.a', 'lib/libxc.%s' % SHLIB_EXT], 'dirs': ['include'], } parallel = 1 moduleclass = 'chem'
{ "pile_set_name": "Github" }
package com.easytoolsoft.easyreport.membership.domain; import java.io.Serializable; import java.util.Date; import javax.validation.constraints.Email; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import org.hibernate.validator.constraints.Length; /** * 系统用户(easyreport_member_user表)持久化类 * * @author Tom Deng * @date 2017-03-25 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor(access = AccessLevel.PRIVATE) public class User implements Serializable { /** * 系统用户标识 */ private Integer id; /** * 系统用户所属角色集合(role_id以英文逗号分隔) */ @NotEmpty(message = "{member.user.roles.NotEmpty}") @Length(max = 20, message = "{member.user.roles.Length}") private String roles; /** * 系统用户账号 */ @NotEmpty(message = "{member.user.account.NotEmpty}") @Length(min = 8, max = 20, message = "{member.user.account.Length}") private String account; /** * 系统用户密码 */ @NotEmpty @Length(max = 64) private String password; /** * 加盐 */ private String salt; /** * 系统用户姓名 */ @NotEmpty @Length(max = 20) private String name; /** * 系统用户电子邮箱 */ @Email private String email; /** * 系统用户用户电话号码,多个用英文逗号分开 */ @Length(max = 13) private String telephone; /** * 系统用户的状态,1表示启用,0表示禁用,默认为1,其他保留 */ @NotNull private Byte status; /** * 系统用户备注 */ @NotNull private String comment; /** * 系统用户记录创建时间 */ private Date gmtCreated; /** * 系统用户记录更新时间戳 */ private Date gmtModified; /** * 获取系统用户密码的凭证盐(account+salt) * * @return account+salt */ public String getCredentialsSalt() { return this.account + this.salt; } }
{ "pile_set_name": "Github" }
package dataworks_public //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Follower is a nested struct in dataworks_public response type Follower struct { ProjectName string `json:"ProjectName" xml:"ProjectName"` TableName string `json:"TableName" xml:"TableName"` Id int64 `json:"Id" xml:"Id"` EntityId string `json:"EntityId" xml:"EntityId"` Follower string `json:"Follower" xml:"Follower"` AlarmMode int `json:"AlarmMode" xml:"AlarmMode"` }
{ "pile_set_name": "Github" }
import numpy as np import chainer import argparse def load_np_array_from_file(filename): with open(filename, "r") as f: dims_num = int(f.readline()) shape = tuple(int(d) for d in f.readline().strip().split(" ")) raw_data = [np.float32(d) for d in f.readline().strip().split(" ")] return np.array(raw_data).reshape(shape) def main(): parser = argparse.ArgumentParser(description='generate operator output') parser.add_argument( '--inputs', type=str, nargs="+", help='input file path list') parser.add_argument('--output', type=str, help='output file path') parser.add_argument('--axis', type=int, help='axis index of concat') args = parser.parse_args() print(args) output = chainer.functions.concat( [load_np_array_from_file(input_name) for input_name in args.inputs], axis=args.axis) with open(args.output, "w") as f: f.write(str(len(output.shape))) f.write("\n") f.write(" ".join([str(d) for d in output.shape])) f.write("\n") f.write(" ".join([str(x) for x in output.array.flat])) if __name__ == "__main__": main()
{ "pile_set_name": "Github" }
<component name="CopyrightManager"> <settings> <module2copyright> <element module="All" copyright="Geyser" /> </module2copyright> </settings> </component>
{ "pile_set_name": "Github" }
# # Generate word2vec snapshot model worker # FROM dockermediacloud/common:latest # Install Python dependencies COPY src/requirements.txt /var/tmp/ RUN \ cd /var/tmp/ && \ pip3 install -r requirements.txt && \ rm requirements.txt && \ rm -rf /root/.cache/ && \ true # Copy sources COPY src/ /opt/mediacloud/src/word2vec-generate-snapshot-model/ ENV PERL5LIB="/opt/mediacloud/src/word2vec-generate-snapshot-model/perl:${PERL5LIB}" \ PYTHONPATH="/opt/mediacloud/src/word2vec-generate-snapshot-model/python:${PYTHONPATH}" # Copy worker script COPY bin /opt/mediacloud/bin USER mediacloud CMD ["word2vec_generate_snapshot_model_worker.py"]
{ "pile_set_name": "Github" }
/* Copyright (c) 2011, Intel Corporation. All rights reserved. Copyright (C) 2015 Gael Guennebaud <gael.guennebaud@inria.fr> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************** * Content : Eigen bindings to Intel(R) MKL * MKL VML support for coefficient-wise unary Eigen expressions like a=b.sin() ******************************************************************************** */ #ifndef EIGEN_ASSIGN_VML_H #define EIGEN_ASSIGN_VML_H namespace Eigen { namespace internal { template<typename Dst, typename Src> class vml_assign_traits { private: enum { DstHasDirectAccess = Dst::Flags & DirectAccessBit, SrcHasDirectAccess = Src::Flags & DirectAccessBit, StorageOrdersAgree = (int(Dst::IsRowMajor) == int(Src::IsRowMajor)), InnerSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::SizeAtCompileTime) : int(Dst::Flags)&RowMajorBit ? int(Dst::ColsAtCompileTime) : int(Dst::RowsAtCompileTime), InnerMaxSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::MaxSizeAtCompileTime) : int(Dst::Flags)&RowMajorBit ? int(Dst::MaxColsAtCompileTime) : int(Dst::MaxRowsAtCompileTime), MaxSizeAtCompileTime = Dst::SizeAtCompileTime, MightEnableVml = StorageOrdersAgree && DstHasDirectAccess && SrcHasDirectAccess && Src::InnerStrideAtCompileTime==1 && Dst::InnerStrideAtCompileTime==1, MightLinearize = MightEnableVml && (int(Dst::Flags) & int(Src::Flags) & LinearAccessBit), VmlSize = MightLinearize ? MaxSizeAtCompileTime : InnerMaxSize, LargeEnough = VmlSize==Dynamic || VmlSize>=EIGEN_MKL_VML_THRESHOLD }; public: enum { EnableVml = MightEnableVml && LargeEnough, Traversal = MightLinearize ? LinearTraversal : DefaultTraversal }; }; #define EIGEN_PP_EXPAND(ARG) ARG #if !defined (EIGEN_FAST_MATH) || (EIGEN_FAST_MATH != 1) #define EIGEN_VMLMODE_EXPAND_LA , VML_HA #else #define EIGEN_VMLMODE_EXPAND_LA , VML_LA #endif #define EIGEN_VMLMODE_EXPAND__ #define EIGEN_VMLMODE_PREFIX_LA vm #define EIGEN_VMLMODE_PREFIX__ v #define EIGEN_VMLMODE_PREFIX(VMLMODE) EIGEN_CAT(EIGEN_VMLMODE_PREFIX_,VMLMODE) #define EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE, VMLMODE) \ template< typename DstXprType, typename SrcXprNested> \ struct Assignment<DstXprType, CwiseUnaryOp<scalar_##EIGENOP##_op<EIGENTYPE>, SrcXprNested>, assign_op<EIGENTYPE,EIGENTYPE>, \ Dense2Dense, typename enable_if<vml_assign_traits<DstXprType,SrcXprNested>::EnableVml>::type> { \ typedef CwiseUnaryOp<scalar_##EIGENOP##_op<EIGENTYPE>, SrcXprNested> SrcXprType; \ static void run(DstXprType &dst, const SrcXprType &src, const assign_op<EIGENTYPE,EIGENTYPE> &/*func*/) { \ eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); \ if(vml_assign_traits<DstXprType,SrcXprNested>::Traversal==LinearTraversal) { \ VMLOP(dst.size(), (const VMLTYPE*)src.nestedExpression().data(), \ (VMLTYPE*)dst.data() EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_##VMLMODE) ); \ } else { \ const Index outerSize = dst.outerSize(); \ for(Index outer = 0; outer < outerSize; ++outer) { \ const EIGENTYPE *src_ptr = src.IsRowMajor ? &(src.nestedExpression().coeffRef(outer,0)) : \ &(src.nestedExpression().coeffRef(0, outer)); \ EIGENTYPE *dst_ptr = dst.IsRowMajor ? &(dst.coeffRef(outer,0)) : &(dst.coeffRef(0, outer)); \ VMLOP( dst.innerSize(), (const VMLTYPE*)src_ptr, \ (VMLTYPE*)dst_ptr EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_##VMLMODE)); \ } \ } \ } \ }; \ #define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(EIGENOP, VMLOP, VMLMODE) \ EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),s##VMLOP), float, float, VMLMODE) \ EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),d##VMLOP), double, double, VMLMODE) #define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_CPLX(EIGENOP, VMLOP, VMLMODE) \ EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),c##VMLOP), scomplex, MKL_Complex8, VMLMODE) \ EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),z##VMLOP), dcomplex, MKL_Complex16, VMLMODE) #define EIGEN_MKL_VML_DECLARE_UNARY_CALLS(EIGENOP, VMLOP, VMLMODE) \ EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(EIGENOP, VMLOP, VMLMODE) \ EIGEN_MKL_VML_DECLARE_UNARY_CALLS_CPLX(EIGENOP, VMLOP, VMLMODE) EIGEN_MKL_VML_DECLARE_UNARY_CALLS(sin, Sin, LA) EIGEN_MKL_VML_DECLARE_UNARY_CALLS(asin, Asin, LA) EIGEN_MKL_VML_DECLARE_UNARY_CALLS(sinh, Sinh, LA) EIGEN_MKL_VML_DECLARE_UNARY_CALLS(cos, Cos, LA) EIGEN_MKL_VML_DECLARE_UNARY_CALLS(acos, Acos, LA) EIGEN_MKL_VML_DECLARE_UNARY_CALLS(cosh, Cosh, LA) EIGEN_MKL_VML_DECLARE_UNARY_CALLS(tan, Tan, LA) EIGEN_MKL_VML_DECLARE_UNARY_CALLS(atan, Atan, LA) EIGEN_MKL_VML_DECLARE_UNARY_CALLS(tanh, Tanh, LA) // EIGEN_MKL_VML_DECLARE_UNARY_CALLS(abs, Abs, _) EIGEN_MKL_VML_DECLARE_UNARY_CALLS(exp, Exp, LA) EIGEN_MKL_VML_DECLARE_UNARY_CALLS(log, Ln, LA) EIGEN_MKL_VML_DECLARE_UNARY_CALLS(log10, Log10, LA) EIGEN_MKL_VML_DECLARE_UNARY_CALLS(sqrt, Sqrt, _) EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(square, Sqr, _) EIGEN_MKL_VML_DECLARE_UNARY_CALLS_CPLX(arg, Arg, _) EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(round, Round, _) EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(floor, Floor, _) EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(ceil, Ceil, _) #define EIGEN_MKL_VML_DECLARE_POW_CALL(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE, VMLMODE) \ template< typename DstXprType, typename SrcXprNested, typename Plain> \ struct Assignment<DstXprType, CwiseBinaryOp<scalar_##EIGENOP##_op<EIGENTYPE,EIGENTYPE>, SrcXprNested, \ const CwiseNullaryOp<internal::scalar_constant_op<EIGENTYPE>,Plain> >, assign_op<EIGENTYPE,EIGENTYPE>, \ Dense2Dense, typename enable_if<vml_assign_traits<DstXprType,SrcXprNested>::EnableVml>::type> { \ typedef CwiseBinaryOp<scalar_##EIGENOP##_op<EIGENTYPE,EIGENTYPE>, SrcXprNested, \ const CwiseNullaryOp<internal::scalar_constant_op<EIGENTYPE>,Plain> > SrcXprType; \ static void run(DstXprType &dst, const SrcXprType &src, const assign_op<EIGENTYPE,EIGENTYPE> &/*func*/) { \ eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); \ VMLTYPE exponent = reinterpret_cast<const VMLTYPE&>(src.rhs().functor().m_other); \ if(vml_assign_traits<DstXprType,SrcXprNested>::Traversal==LinearTraversal) \ { \ VMLOP( dst.size(), (const VMLTYPE*)src.lhs().data(), exponent, \ (VMLTYPE*)dst.data() EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_##VMLMODE) ); \ } else { \ const Index outerSize = dst.outerSize(); \ for(Index outer = 0; outer < outerSize; ++outer) { \ const EIGENTYPE *src_ptr = src.IsRowMajor ? &(src.lhs().coeffRef(outer,0)) : \ &(src.lhs().coeffRef(0, outer)); \ EIGENTYPE *dst_ptr = dst.IsRowMajor ? &(dst.coeffRef(outer,0)) : &(dst.coeffRef(0, outer)); \ VMLOP( dst.innerSize(), (const VMLTYPE*)src_ptr, exponent, \ (VMLTYPE*)dst_ptr EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_##VMLMODE)); \ } \ } \ } \ }; EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmsPowx, float, float, LA) EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmdPowx, double, double, LA) EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmcPowx, scomplex, MKL_Complex8, LA) EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmzPowx, dcomplex, MKL_Complex16, LA) } // end namespace internal } // end namespace Eigen #endif // EIGEN_ASSIGN_VML_H
{ "pile_set_name": "Github" }
Promise.request = function(url) { var result = new Promise(); var xhr = new XMLHttpRequest(); var eventHandler = { handleEvent: function(e) { if (e.target.readyState != 4) { return; } xhr.removeEventListener("readystatechange", eventHandler); if (e.target.status == 200) { result.fulfill(e.target.responseText); } else { result.reject(e.target.responseText); } } } xhr.open("get", url, true); xhr.addEventListener("readystatechange", eventHandler); xhr.send(); return result; }
{ "pile_set_name": "Github" }
steps: - name: ":docker: :package: 1.13" plugins: docker-compose#v2.0.0: build: yarpc-go-1.13 image-repository: 027047743804.dkr.ecr.us-east-2.amazonaws.com/uber agents: queue: builders - wait - name: ":go: 1.13 update-deps" command: "etc/bin/update-deps.sh" plugins: docker-compose#v2.0.0: run: yarpc-go-1.13 env: # The script needs the following environment variables in addition # to those provided by the docker-compose. - GITHUB_USER - GITHUB_EMAIL - GITHUB_TOKEN - GITHUB_REPO agents: queue: workers
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <XCTTargetBootstrap/NSObject-Protocol.h> @class NSXPCConnection, NSXPCListener; @protocol NSXPCListenerDelegate <NSObject> @optional - (BOOL)listener:(NSXPCListener *)arg1 shouldAcceptNewConnection:(NSXPCConnection *)arg2; @end
{ "pile_set_name": "Github" }
Aruba.platform.require_matching_files('../file/**/*.rb', __FILE__)
{ "pile_set_name": "Github" }
/* * Copyright 2018-present HiveMQ and the HiveMQ Community * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hivemq.client.internal.mqtt.handler.publish.outgoing; import com.hivemq.client.internal.annotations.CallByThread; import com.hivemq.client.internal.mqtt.MqttClientConfig; import com.hivemq.client.internal.mqtt.exceptions.MqttClientStateExceptions; import com.hivemq.client.internal.mqtt.ioc.ClientComponent; import com.hivemq.client.internal.mqtt.message.publish.MqttPublish; import com.hivemq.client.internal.mqtt.message.publish.MqttPublishResult; import com.hivemq.client.mqtt.mqtt5.message.publish.Mqtt5PublishResult; import io.reactivex.Flowable; import io.reactivex.Single; import io.reactivex.SingleObserver; import io.reactivex.disposables.Disposable; import io.reactivex.internal.disposables.EmptyDisposable; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** * @author Silvio Giebl */ public class MqttAckSingle extends Single<Mqtt5PublishResult> { private final @NotNull MqttClientConfig clientConfig; private final @NotNull MqttPublish publish; public MqttAckSingle(final @NotNull MqttClientConfig clientConfig, final @NotNull MqttPublish publish) { this.clientConfig = clientConfig; this.publish = publish; } @Override protected void subscribeActual(final @NotNull SingleObserver<? super Mqtt5PublishResult> observer) { if (clientConfig.getState().isConnectedOrReconnect()) { final ClientComponent clientComponent = clientConfig.getClientComponent(); final MqttOutgoingQosHandler outgoingQosHandler = clientComponent.outgoingQosHandler(); final MqttPublishFlowables publishFlowables = outgoingQosHandler.getPublishFlowables(); final Flow flow = new Flow(observer, clientConfig, outgoingQosHandler); observer.onSubscribe(flow); publishFlowables.add(Flowable.just(new MqttPublishWithFlow(publish, flow))); } else { EmptyDisposable.error(MqttClientStateExceptions.notConnected(), observer); } } private static class Flow extends MqttAckFlow implements Disposable { private final @NotNull SingleObserver<? super Mqtt5PublishResult> observer; private final @NotNull MqttOutgoingQosHandler outgoingQosHandler; private @Nullable MqttPublishResult result; Flow( final @NotNull SingleObserver<? super Mqtt5PublishResult> observer, final @NotNull MqttClientConfig clientConfig, final @NotNull MqttOutgoingQosHandler outgoingQosHandler) { super(clientConfig); this.observer = observer; this.outgoingQosHandler = outgoingQosHandler; init(); } @CallByThread("Netty EventLoop") @Override void onNext(final @NotNull MqttPublishResult result) { if (result.acknowledged()) { done(result); } else { this.result = result; } } @CallByThread("Netty EventLoop") @Override void acknowledged(final long acknowledged) { final MqttPublishResult result = this.result; assert (acknowledged == 1) && (result != null) : "a single publish must be acknowledged exactly once"; this.result = null; done(result); } @CallByThread("Netty EventLoop") private void done(final @NotNull MqttPublishResult result) { if (setDone()) { final Throwable error = result.getRawError(); if (error == null) { observer.onSuccess(result); } else { observer.onError(error); } } outgoingQosHandler.request(1); } } }
{ "pile_set_name": "Github" }
// // _ _ ______ _ _ _ _ _ _ _ // | \ | | | ____| | (_) | (_) | | | | // | \| | ___ | |__ __| |_| |_ _ _ __ __ _| | | | // | . ` |/ _ \ | __| / _` | | __| | '_ \ / _` | | | | // | |\ | (_) | | |___| (_| | | |_| | | | | (_| |_|_|_| // |_| \_|\___/ |______\__,_|_|\__|_|_| |_|\__, (_|_|_) // __/ | // |___/ // // This file is auto-generated. Do not edit manually // // Copyright 2016 Automatak LLC // // Automatak LLC (www.automatak.com) licenses this file // to you under the the Apache License Version 2.0 (the "License"): // // http://www.apache.org/licenses/LICENSE-2.0.html // #include "JNIIterable.h" namespace jni { namespace cache { bool Iterable::init(JNIEnv* env) { auto clazzTemp = env->FindClass("Ljava/lang/Iterable;"); this->clazz = (jclass) env->NewGlobalRef(clazzTemp); env->DeleteLocalRef(clazzTemp); this->iteratorMethod = env->GetMethodID(this->clazz, "iterator", "()Ljava/util/Iterator;"); if(!this->iteratorMethod) return false; return true; } void Iterable::cleanup(JNIEnv* env) { env->DeleteGlobalRef(this->clazz); } LocalRef<jobject> Iterable::iterator(JNIEnv* env, jobject instance) { return LocalRef<jobject>(env, env->CallObjectMethod(instance, this->iteratorMethod)); } } }
{ "pile_set_name": "Github" }
package net.squanchy.signin import android.app.Activity import dagger.Component import net.squanchy.analytics.Analytics import net.squanchy.injection.ActivityLifecycle import net.squanchy.injection.ApplicationComponent import net.squanchy.injection.applicationComponent fun signInComponent(activity: Activity): SignInComponent = DaggerSignInComponent.builder() .applicationComponent(activity.applicationComponent) .build() @ActivityLifecycle @Component(modules = [SignInModule::class], dependencies = [ApplicationComponent::class]) interface SignInComponent { fun service(): SignInService fun analytics(): Analytics }
{ "pile_set_name": "Github" }
project_path: /web/_project.yaml book_path: /web/fundamentals/_book.yaml description: Dopo aver eliminato le risorse non necessarie, la cosa migliore che possiamo fare per migliorare il tempo di caricamento della pagina è minimizzare la dimensione totale delle risorse da scaricare ottimizzando e comprimendo le risorse rimaste. {# wf_updated_on: 2017-11-10 #} {# wf_published_on: 2014-03-31 #} # Ottimizzazione della codifica e delle dimensioni di trasferimento delle risorse di testo {: .page-title } {% include "web/_shared/contributors/ilyagrigorik.html" %} Dopo l'eliminazione dei download non necessari di risorse, la cosa migliore che possiamo fare per migliorare il tempo di carimanento della pagina è minimizzare la dimensione da scaricare mediante ottimizzazione e compressione delle rimanenti risorse. ## Introduzione alla compressione dei dati Una volta eliminate tutte le risorse non necessarie, è necessario minimizzare le dimensioni totali delle risorse restanti che il browser deve scaricare, ovvero comprimerle. A seconda del tipo di risorsa&mdash;testo, immagine, font e così via&mdash;abbiamo diverse tecniche a nostra disposizione: strumenti generici che possono essere abilitati sul server, procedure di ottimizzazione pre-elaborazione per tipi di contenuto specifici o per specifiche risorse, che richiedono l'intervento del developer. Per garantire le prestazioni migliori, è necessaria una combinazione delle diverse tecniche. ### TL;DR {: .hide-from-toc } * La compressione è una procedura di codifica delle informazioni che utilizza un numero inferiore di bit * L'eliminazione dei dati non necessari consente sempre di raggiungere i risultati migliori * Esistono numerose tecniche e algoritmi di compressione diversi * Per ottenere la compressione ottimale, dovrai avvalerti di più tecniche La procedura di riduzione delle dimensioni dei dati, nota come *compressione dei dati*. Molte persone hanno contribuito ad algoritmi, tecniche e procedure di ottimizzazione per migliorare le percentuali, la velocità di compressione ed i requisiti di memoria dei diversi compressori. Inutile dire che una discussione approfondita su tale argomento esula dal nostro ambito. Tuttavia è comunque importante comprendere ad alto livello come funziona la compressione e le tecniche che abbiamo a disposizione per ridurre le dimensioni di diverse risorse presenti nelle nostre pagine. Per illustrare i principi chiave di tali tecniche, consideriamo il processo di ottimizzazione di un semplice messaggio di testo inventato come esempio: # Il seguente è un messaggio segreto, composto da un gruppo di intestazioni # in formato chiave-valore seguito da un ritorno a capo e dal messaggio # cifrato. format: secret-cipher date: 25/08/16 AAAZZBBBBEEEMMM EEETTTAAA 1. I messaggi possono contenere annotazioni di vario tipo, indicate dal prefisso "#". Le annotazioni non influenzano né il significato, né alcun altro aspetto del messaggio. 1. I messaggi possono contenere delle *intestazioni* composte da coppie di chiave-valore (separate da ":") che compaiono all'inizio del messaggio. 1. I messaggi contengono payload testuale. Come potremmo ridurre le dimensioni del messaggio precedente, attualmente di 200 caratteri? 1. Il commento è interessante, ma sappiamo che non influenza di fatto il significato del messaggio. Per cui lo elimineremo nella trasmissione dello stesso. 1. Vi sono probabilmente alcune tecniche intelligenti che possiamo utilizzare per codificare le intestazioni in modo efficace. Ad esempio, se sappiamo che tutti i messaggi contengono un "format" e un "date", possiamo convertirli in ID interi brevi e inviare solo quelli. Detto ciò, non siamo sicuri che sia questo il caso, per cui lo lasceremo in sospeso per adesso. 1. Il payload è formato da solo testo, e, anche se non sappiamo quale sia il suo reale contenuto (apparentemente, utilizza un "messaggio segreto"), solo osservando il testo sembra che vi sia una notevole ridondanza. Forse, invece di mandare lettere ripetute, possiamo semplicemente contare il numero di esse e codificarle in maniera più efficace? Per esempio "AAA" diventa "3A" che rappresenta una sequenza di tre A. Mettendo assieme le diverse tecniche, arriviamo al risultato seguente: format: secret-cipher date: 25/08/16 3A2Z4B3E3M 3E3T3A Il nuovo messaggio è lungo 56 caratteri, il che significa che siamo riusciti a comprimere il messaggio originale di un sorprendente 72%. Naturalmente, ti chiederai, tutto ciò è fantastico, ma come può aiutarci ad ottimizzare le nostre pagine web? Sicuramente non inventeremo degli algoritmi di compressione, ma come vedrai, utilizzeremo esattamente le stesse tecniche e processi mentali quando ottimizzeremo le diverse risorse sulle nostre pagine: pre-elaborazione, ottimizzazione specifica per il contesto e algoritmi specifici per contenuti diversi. ## Minificazione: pre-elaborazione e ottimizzazione specifica per il contesto ### TL;DR {: .hide-from-toc } - Un'ottimizzazione specifica in base ai contenuti può ridurre considerevolmente le dimensioni delle risorse offerte. - Un'ottimizzazione specifica in base ai contenuti si applica meglio nel ciclo di build/release. Il modo migliore per comprimere dati ridondanti o non necessari consiste nell'eliminarli in un'unica soluzione. Naturalmente, non possiamo semplicemente eliminare dei dati a caso, ma in alcuni contesti in cui disponiamo di una conoscenza specifica del contenuto dei dati e delle relative proprietà, è spesso possibile ridurre significativamente le dimensioni del payload senza inficiarne il significato. <pre class="prettyprint"> {% includecode content_path="web/fundamentals/performance/optimizing-content-efficiency/_code/minify.html" region_tag="full" adjust_indentation="auto" %} </pre> [Prova](https://googlesamples.github.io/web-fundamentals/fundamentals/performance/optimizing-content-efficiency/minify.html){: target="_blank" .external } Considera la semplice pagina HTML precedente e i suoi tre diversi tipi di contenuto: markup HTML, stili CSS e JavaScript. Ciascun tipo di contenuto dispone di norme diverse per quanto riguarda ciò che rappresenta un contenuto valido, differenti regole per indicare commenti, ecc. Come possiamo ridurre le dimensioni di questa pagina? * I commenti all'interno del codice sono i migliori amici di un developer, ma il browser non deve vederli! La semplice eliminazione dei commenti CSS (`/* ... */`), HTML (`<!-- ... -->`) e JavaScript (`// ...`) può ridurre significativamente le dimensioni totali della pagina. * Un compressore CSS "intelligente" potrebbe notare che stiamo utilizzando un metodo inefficace di definizione di regole per ".awesome-container" ed accorpare i due periodi in uno senza influenzare altri stili, risparmiando altri byte. * Gli spazi vuoti (semplici spazi e tab) sono utilizzati per comodità dai developer in HTML, CSS e JavaScript. Un ulteriore compressore potrebbe eliminare tutti i tab e gli spazi. <pre class="prettyprint"> {% includecode content_path="web/fundamentals/performance/optimizing-content-efficiency/_code/minified.html" region_tag="full" adjust_indentation="auto" %} </pre> [Prova](https://googlesamples.github.io/web-fundamentals/fundamentals/performance/optimizing-content-efficiency/minified.html){: target="_blank" .external } Una volta applicate tali passi, la nostra pagina passerà da 406 a 150 caratteri, riducendosi del 63%! Molto probabilmente non sarà molto leggibile, ma d'altronde non deve neanche esserlo: possiamo mantenere la pagina originale come "development version" e poi applicare le procedure precedenti quando saremo pronti a inserire la pagina sul nostro sito web. Facendo un passo indietro, l'esempio precedente illustra un punto importante: anche un compressore generico&mdash;diciamo ideato per comprimere un qualsiasi testo&mdash; potrebbe svolgere un buon lavoro per comprimere la pagina precedente, ma non saprebbe certo come eliminare i commenti, raggruppare le regole CSS o effettuare dozzine di altre procedure di ottimizzazione specifiche. Ecco perché pre-elaborazione/minificazione/ottimizzazione basata sul contesto possono rivelarsi strumenti molto potenti. Note: Nel caso specifico, la development version non compressa della libreria JQuery ha adesso una dimensione di ~300 KB. La stessa libreria minificata (commenti rimossi, ecc...) è più piccola ci quasi un fattore 3x: ~100 KB. Allo stesso modo, le tecniche precedenti possono essere estese a risorse non basate sul solo testo. Immagini, video e altri tipi di contenuti contengono tutti i propri metadati e diversi payload. Ad esempio, ogni volta che scatti una foto con la tua fotocamera, la foto contiene di norma numerose informazioni extra: le impostazioni della fotocamera, il luogo, ecc... A seconda della tua applicazione, tali dati possono essere fondamentali (ad es. il sito di condivisione della foto) o perfettamente inutili; dovrai quindi valutare se valga la pena rimuoverli. In pratica, tali metadati possono aggiungere decine di kilobyte per ogni immagine. In breve, come primo passo nell'ottimizzazione dell'efficienza delle nostre risorse, crea un inventario dei diversi tipi di contenuti e valuta quali tipi di ottimizzazioni specifiche puoi applicare per ridurne le dimensioni; potrai così ottenere risultati significativi! Poi, una volta definito ciò, automatizza tali ottimizzazioni aggiungendole alle procedure build e release; per garantire che vengano sempre effettuate. ## Compressione del testo con GZIP ### TL;DR {: .hide-from-toc } - GZIP funziona meglio su risorse di testo: CSS, JavaScript, HTML. - Tutti i browser moderni supportano la compressione con GZIP e la richiedono automaticamente - Il tuo server deve essere configurato con la compressione GZIP abilitata - Molti CDN richiedono particolare attenzione per assicurarsi che GZIP sia abilitata [GZIP](http://en.wikipedia.org/wiki/Gzip){: .external } è un compressore generico applicabile a qualsiasi stream di byte. Sotto il cofano, ricorda alcuni contenuti visti in precedenza e cerca di individuare e sostituire i frammenti di dati duplicati in maniera efficace. (Se sei curioso, ecco una [spiegazione a basso livello di GZIP](https://www.youtube.com/watch?v=whGwm0Lky2s&feature=youtu.be&t=14m11s).) Tuttavia, in pratica, GZIP funziona meglio su risorse di testo, raggiungendo spesso un tasso di compressione del 70-90% per i file più grossi, mentre su risorse già compresse tramite algoritmi alternativi (ad es. la maggior parte dei formati immagine) consente di avere qualche piccolo se non nessun miglioramento. Tutti gli attuali browser supportano ed negoziano automaticamente la compressione GZIP per ogni richiesta HTTP. Devi solo assicurarti che il server sia configurato correttamente per fornire la risorsa compressa quando il client la richiede. <table> <thead> <tr> <th>Libreria</th> <th>Dimensioni</th> <th>Dimensioni compresse</th> <th>Percentuale di compressione</th> </tr> </thead> <tbody> <tr> <td data-th="library">jquery-1.11.0.js</td> <td data-th="size">276 KB</td> <td data-th="compressed">82 KB</td> <td data-th="savings">70%</td> </tr> <tr> <td data-th="library">jquery-1.11.0.min.js</td> <td data-th="size">94 KB</td> <td data-th="compressed">33 KB</td> <td data-th="savings">65%</td> </tr> <tr> <td data-th="library">angular-1.2.15.js</td> <td data-th="size">729 KB</td> <td data-th="compressed">182 KB</td> <td data-th="savings">75%</td> </tr> <tr> <td data-th="library">angular-1.2.15.min.js</td> <td data-th="size">101 KB</td> <td data-th="compressed">37 KB</td> <td data-th="savings">63%</td> </tr> <tr> <td data-th="library">bootstrap-3.1.1.css</td> <td data-th="size">118 KB</td> <td data-th="compressed">18 KB</td> <td data-th="savings">85%</td> </tr> <tr> <td data-th="library">bootstrap-3.1.1.min.css</td> <td data-th="size">98 KB</td> <td data-th="compressed">17 KB</td> <td data-th="savings">83%</td> </tr> <tr> <td data-th="library">foundation-5.css</td> <td data-th="size">186 KB</td> <td data-th="compressed">22 KB</td> <td data-th="savings">88%</td> </tr> <tr> <td data-th="library">foundation-5.min.css</td> <td data-th="size">146 KB</td> <td data-th="compressed">18 KB</td> <td data-th="savings">88%</td> </tr> </tbody> </table> La tabella precedente illustra il risparmio consentito dalla compressione con GZIP per alcune delle librerie JavaScript e dei framework CSS più noti. Il risparmio va dal 60 all'88%; nota come la combinazione tra file minificati (identificati con “.min” nel nome) più GZIP offra una riduzione ancora maggiore. 1. **Applica prima le ottimizzazioni specifiche per i contenuti: minificatori CSS, JS e HTML.** 2. **Applica GZIP per comprimere il risultato minificato.** L'attivazione di GZIP rappresenta una delle ottimizzazioni più semplici ed efficaci da applicare; sfortunatamente, molte persone si dimenticano ancora di farlo. La maggior parte dei server web comprime i contenuti per nostro conto, e resta solo da verificare che il server sia configurato correttamente per comprimere tutti i contenuti che possano beneficiare della compressione con GZIP. Il progetto HTML5 Boilerplate contiene alcuni [file di configurazione di esempio](https://github.com/h5bp/server-configs) per tutti i principali server, con commenti dettagliati per ogni flag e impostazione di configurazione. Per determinare la configurazione migliore per il tuo server segui i seguenti passi: * Cerca il tuo server preferito nell'elenco. * Vai alla sezione GZIP. * Assicurati che il tuo server sia configurato secondo le impostazioni raccomandate. ![Demo DevTools confronto dimensioni reali vs. trasferite](images/transfer-vs-actual-size.png) Un modo semplice e rapido di vedere GZIP in azione consiste nell'aprire Chrome DevTools e controllare la colonna “Size / Content“ nella scheda Rete: “Size“ indica le dimensioni di trasferimento della risorsa, mentre “Content“ indica le dimensioni espanse della risorsa. Per la risorsa HTML dell'esempio precedente, GZIP ha risparmiato 98.8 KB durante il trasferimento! Note: In alcuni casi GZIP può aumentare le dimensioni di una risorsa. Di norma, ciò accade quando la risorsa è molto piccola e l'overhead del dizionario GZIP è maggiore del risparmio consentito dalla compressione, o se la risorsa è già compressa al massimo. Alcuni server consentono di specificare una dimensione minima per evitare tale problema. Infine, nonostante la maggior parte dei server comprime automaticamente le risorse al posto tuo prima di presentarle all'utente, alcuni CDN richiedono particolare attenzione e un'azione manuale per garantire che gli oggetti GZIP siano serviti. Verifica che le risorse presenti sul tuo sito siano effettivamente [compresse](http://www.whatsmyip.org/http-compression-test/)
{ "pile_set_name": "Github" }
import csv from 'fast-csv'; /** * Saves an array to a CSV file * <p>This method is exclusive to Node.js</p> * @memberof module:bcijs * @function * @name saveCSV * @param {Array} array * @param {string} filename * @returns {Promise} A promise object that resolves when the file has been saved. Does not currently reject on write error. */ export function saveCSV(array, filename) { return new Promise(function (resolve, reject) { csv .writeToPath(filename, array, { headers: false }) .on("finish", function () { resolve(); }); }); }
{ "pile_set_name": "Github" }
{ "farms": [ { "name": "lb01", "family": "ipv4", "virtual-addr": "200.1.1.1", "virtual-ports": "8080", "source-addr": "", "mode": "snat", "protocol": "tcp", "scheduler": "weight", "sched-param": "none", "persistence": "none", "persist-ttl": "60", "helper": "none", "log": "none", "mark": "0x0", "priority": "1", "state": "up", "new-rtlimit": "0", "new-rtlimit-burst": "0", "rst-rtlimit": "0", "rst-rtlimit-burst": "0", "est-connlimit": "0", "tcp-strict": "off", "queue": "-1", "backends": [ { "name": "bck0", "ip-addr": "172.16.138.202", "port": "80", "weight": "5", "priority": "1", "mark": "0x1", "est-connlimit": "0", "state": "up" }, { "name": "bck1", "ip-addr": "172.16.138.203", "port": "80", "weight": "5", "priority": "1", "mark": "0x2", "est-connlimit": "0", "state": "up" } ], "policies": [] } ] }
{ "pile_set_name": "Github" }
package dbplugin import ( "context" "encoding/json" "errors" "time" "google.golang.org/grpc" "github.com/golang/protobuf/ptypes" "github.com/hashicorp/vault/helper/pluginutil" ) var ( ErrPluginShutdown = errors.New("plugin shutdown") ) // ---- gRPC Server domain ---- type gRPCServer struct { impl Database } func (s *gRPCServer) Type(context.Context, *Empty) (*TypeResponse, error) { t, err := s.impl.Type() if err != nil { return nil, err } return &TypeResponse{ Type: t, }, nil } func (s *gRPCServer) CreateUser(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error) { e, err := ptypes.Timestamp(req.Expiration) if err != nil { return nil, err } u, p, err := s.impl.CreateUser(ctx, *req.Statements, *req.UsernameConfig, e) return &CreateUserResponse{ Username: u, Password: p, }, err } func (s *gRPCServer) RenewUser(ctx context.Context, req *RenewUserRequest) (*Empty, error) { e, err := ptypes.Timestamp(req.Expiration) if err != nil { return nil, err } err = s.impl.RenewUser(ctx, *req.Statements, req.Username, e) return &Empty{}, err } func (s *gRPCServer) RevokeUser(ctx context.Context, req *RevokeUserRequest) (*Empty, error) { err := s.impl.RevokeUser(ctx, *req.Statements, req.Username) return &Empty{}, err } func (s *gRPCServer) Initialize(ctx context.Context, req *InitializeRequest) (*Empty, error) { config := map[string]interface{}{} err := json.Unmarshal(req.Config, &config) if err != nil { return nil, err } err = s.impl.Initialize(ctx, config, req.VerifyConnection) return &Empty{}, err } func (s *gRPCServer) Close(_ context.Context, _ *Empty) (*Empty, error) { s.impl.Close() return &Empty{}, nil } // ---- gRPC client domain ---- type gRPCClient struct { client DatabaseClient clientConn *grpc.ClientConn doneCtx context.Context } func (c gRPCClient) Type() (string, error) { resp, err := c.client.Type(c.doneCtx, &Empty{}) if err != nil { return "", err } return resp.Type, err } func (c gRPCClient) CreateUser(ctx context.Context, statements Statements, usernameConfig UsernameConfig, expiration time.Time) (username string, password string, err error) { t, err := ptypes.TimestampProto(expiration) if err != nil { return "", "", err } ctx, cancel := context.WithCancel(ctx) quitCh := pluginutil.CtxCancelIfCanceled(cancel, c.doneCtx) defer close(quitCh) defer cancel() resp, err := c.client.CreateUser(ctx, &CreateUserRequest{ Statements: &statements, UsernameConfig: &usernameConfig, Expiration: t, }) if err != nil { if c.doneCtx.Err() != nil { return "", "", ErrPluginShutdown } return "", "", err } return resp.Username, resp.Password, err } func (c *gRPCClient) RenewUser(ctx context.Context, statements Statements, username string, expiration time.Time) error { t, err := ptypes.TimestampProto(expiration) if err != nil { return err } ctx, cancel := context.WithCancel(ctx) quitCh := pluginutil.CtxCancelIfCanceled(cancel, c.doneCtx) defer close(quitCh) defer cancel() _, err = c.client.RenewUser(ctx, &RenewUserRequest{ Statements: &statements, Username: username, Expiration: t, }) if err != nil { if c.doneCtx.Err() != nil { return ErrPluginShutdown } return err } return nil } func (c *gRPCClient) RevokeUser(ctx context.Context, statements Statements, username string) error { ctx, cancel := context.WithCancel(ctx) quitCh := pluginutil.CtxCancelIfCanceled(cancel, c.doneCtx) defer close(quitCh) defer cancel() _, err := c.client.RevokeUser(ctx, &RevokeUserRequest{ Statements: &statements, Username: username, }) if err != nil { if c.doneCtx.Err() != nil { return ErrPluginShutdown } return err } return nil } func (c *gRPCClient) Initialize(ctx context.Context, config map[string]interface{}, verifyConnection bool) error { configRaw, err := json.Marshal(config) if err != nil { return err } ctx, cancel := context.WithCancel(ctx) quitCh := pluginutil.CtxCancelIfCanceled(cancel, c.doneCtx) defer close(quitCh) defer cancel() _, err = c.client.Initialize(ctx, &InitializeRequest{ Config: configRaw, VerifyConnection: verifyConnection, }) if err != nil { if c.doneCtx.Err() != nil { return ErrPluginShutdown } return err } return nil } func (c *gRPCClient) Close() error { _, err := c.client.Close(c.doneCtx, &Empty{}) return err }
{ "pile_set_name": "Github" }
package org.openstreetmap.atlas.geography.atlas.items.complex.restriction; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.StreamSupport; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; import org.openstreetmap.atlas.geography.atlas.Atlas; import org.openstreetmap.atlas.geography.atlas.builder.text.TextAtlasBuilder; import org.openstreetmap.atlas.geography.atlas.items.Route; import org.openstreetmap.atlas.geography.atlas.items.TurnRestriction; import org.openstreetmap.atlas.geography.atlas.items.TurnRestriction.TurnRestrictionType; import org.openstreetmap.atlas.geography.atlas.items.complex.Finder; import org.openstreetmap.atlas.geography.atlas.items.complex.bignode.BigNode; import org.openstreetmap.atlas.geography.atlas.items.complex.bignode.BigNodeFinder; import org.openstreetmap.atlas.geography.atlas.items.complex.bignode.RestrictedPath; import org.openstreetmap.atlas.streaming.compression.Decompressor; import org.openstreetmap.atlas.streaming.resource.InputStreamResource; import org.openstreetmap.atlas.tags.TurnRestrictionTag; import org.openstreetmap.atlas.utilities.collections.Iterables; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * @author matthieun * @author mgostintsev */ public class ComplexTurnRestrictionTest { private static final Logger logger = LoggerFactory.getLogger(ComplexTurnRestrictionTest.class); @Rule public ComplexTurnRestrictionTestCaseRule rule = new ComplexTurnRestrictionTestCaseRule(); @Test public void testBigNodeWithNoRestrictions() { final Atlas atlas = new TextAtlasBuilder().read(new InputStreamResource( () -> ComplexTurnRestrictionTest.class.getResourceAsStream("bigNode.txt.gz")) .withDecompressor(Decompressor.GZIP).withName("bigNode.txt.gz")); final List<BigNode> bigNodes = Iterables.asList(new BigNodeFinder().find(atlas)); final Optional<BigNode> possibleBigNode = bigNodes.stream() .filter(bigNode -> bigNode.getOsmIdentifier() == 3717537957L).findAny(); Assert.assertTrue(possibleBigNode.isPresent()); final BigNode bigNode = possibleBigNode.get(); Assert.assertTrue(!bigNode.allPaths().isEmpty()); Assert.assertTrue(bigNode.turnRestrictions().isEmpty()); } @Test public void testBrokenRoute() { final List<Integer> counter = new ArrayList<>(); counter.add(0); new ComplexTurnRestrictionFinder(null).find(this.rule.getAtlasBrokenTurnRestrictionRoute(), broken -> counter.set(0, counter.get(0) + 1)).forEach(System.out::println); Assert.assertEquals(new Integer(1), counter.get(0)); } @Test public void testFalsePredicate() { Assert.assertEquals(0, Iterables.count(new ComplexTurnRestrictionFinder(x -> false) .find(this.rule.getAtlasNo(), Finder::ignore), x -> 1L)); } @Test public void testNoRestriction() { final Atlas atlasNo = this.rule.getAtlasNo(); logger.trace("AtlasNo: {}", atlasNo); final Route candidate = Route.forEdges(atlasNo.edge(102), atlasNo.edge(203)); int counter = 0; for (final ComplexTurnRestriction restriction : new ComplexTurnRestrictionFinder() .find(atlasNo, Finder::ignore)) { if (restriction.getTurnRestriction().getTurnRestrictionType() == TurnRestrictionType.NO) { final Route route = restriction.route(); if (candidate.equals(route)) { counter++; } } } Assert.assertEquals(1, counter); int counterRestriction = 0; final Iterable<BigNode> bigNodes = new BigNodeFinder().find(atlasNo, Finder::ignore); for (final BigNode bigNode : bigNodes) { final Set<RestrictedPath> paths = bigNode.turnRestrictions(); for (final RestrictedPath path : paths) { if (path.getRoute().equals(candidate)) { counterRestriction++; } } } Assert.assertEquals(1, counterRestriction); } @Test public void testNullPredicate() { Assert.assertEquals(1, Iterables.count( new ComplexTurnRestrictionFinder(null).find(this.rule.getAtlasNo(), Finder::ignore), x -> 1L)); } @Test public void testOnlyRestriction() { final Atlas atlasOnly = this.rule.getAtlasOnly(); logger.trace("AtlasOnly: {}", atlasOnly); final Route candidate = Route.forEdges(atlasOnly.edge(102), atlasOnly.edge(203)); int counter = 0; for (final ComplexTurnRestriction restriction : new ComplexTurnRestrictionFinder() .find(atlasOnly, Finder::ignore)) { if (restriction.getTurnRestriction() .getTurnRestrictionType() == TurnRestrictionType.ONLY) { final Route route = restriction.route(); if (candidate.equals(route)) { counter++; } } } Assert.assertEquals(1, counter); final Set<RestrictedPath> paths = new HashSet<>(); for (final BigNode bigNode : new BigNodeFinder().find(atlasOnly, Finder::ignore)) { paths.addAll(bigNode.turnRestrictions()); } Assert.assertEquals(3, paths.size()); } @Test public void testPathThroughBigNodeToTurnRestrictionCriteria() { final Atlas atlasNo = this.rule.getAtlasNo(); logger.trace("AtlasNo: {}", atlasNo); // All possible paths through this bigNode final Route path1 = Route.forEdges(atlasNo.edge(102), atlasNo.edge(205)); final Route path2 = Route.forEdges(atlasNo.edge(102), atlasNo.edge(204)); final Route path3 = Route.forEdges(atlasNo.edge(102), atlasNo.edge(203)); final Iterable<BigNode> bigNodes = new BigNodeFinder().find(atlasNo, Finder::ignore); for (final BigNode bigNode : bigNodes) { final Set<Route> allPaths = bigNode.allPaths(); if (allPaths.size() > 0) { final Set<RestrictedPath> restrictions = bigNode.turnRestrictions(); Assert.assertTrue(restrictions.size() == 1); final Route restrictedRoute = restrictions.iterator().next().getRoute(); Assert.assertNotEquals(restrictedRoute, path1); Assert.assertNotEquals(restrictedRoute, path2); // Only one path should be the restricted one as it fully covers the turn // restriction. The other paths all overlap the restriction, but only // partially. Assert.assertEquals(restrictedRoute, path3); } } } @Test public void testTurnRestrictionNoUTurn() { // Test edge as via member final Atlas testAtlas = this.rule.getAtlasNoUTurn(); final Optional<TurnRestriction> possibleTurnRestriction = TurnRestriction .from(testAtlas.relation(1L)); Assert.assertTrue(possibleTurnRestriction.isPresent()); } @Test public void testTurnRestrictionTags() { final Atlas testAtlas = this.rule.getAtlasNo(); final Optional<TurnRestriction> possibleTurnRestriction = TurnRestriction .from(testAtlas.relation(1L)); Assert.assertTrue(possibleTurnRestriction.isPresent()); final TurnRestriction turnRestriction = possibleTurnRestriction.get(); // Make sure both tags exist Assert.assertEquals(2, turnRestriction.getTags().size()); final Optional<String> turnRestrictionTagValue = turnRestriction .getTag(TurnRestrictionTag.KEY); Assert.assertTrue(turnRestrictionTagValue.isPresent()); // The tags defined in the test atlas (and typically in osm) are lower case Assert.assertEquals(TurnRestrictionTag.NO_LEFT_TURN.toString().toLowerCase(), turnRestrictionTagValue.get()); } @Test public void testTurnRestrictionWithTwoViaNodesInRelation() { final Atlas testAtlas = this.rule.getRelationWithTwoViaNodes(); logger.trace("Atlas relation with 2 via nodes: {}", testAtlas); // For more than 1 via nodes in relation for restriction, TurnRestriction will always // return an empty optional final Optional<TurnRestriction> possibleTurnRestriction = TurnRestriction .from(testAtlas.relation(1L)); Assert.assertEquals(Optional.empty(), possibleTurnRestriction); } @Test public void testTurnRestrictionsFromComplexBigNodes() { final int expectedCountOfRestrictedRoutes = 302; // There's an only turn restriction (http://www.openstreetmap.org/relation/6643212) // specifying that 447301069000000 must go to 447301070000000. This route has a corner case // where an otherToOption (-447301069000000) is found before the from edge. Specifically // check to make sure this path is restricted. final String expectedRestrictedRoute = "[Route: 447301065000000, -447301070000000, -447301069000000, 447301069000000, 447301074000000, 447301068000000, 338286211000000]"; final Atlas complexBigNodeAtlas = this.rule.getBigNodeWithOnlyTurnRestrictionsAtlas(); final List<Route> restrictedRoutes = StreamSupport .stream(new BigNodeFinder().find(complexBigNodeAtlas, Finder::ignore).spliterator(), false) .filter(bigNode -> bigNode.getType() == BigNode.Type.DUAL_CARRIAGEWAY) .flatMap(bigNode -> bigNode.turnRestrictions().stream()) .map(RestrictedPath::getRoute).collect(Collectors.toList()); Assert.assertEquals("Verify that the expected number of restricted routes is returned", expectedCountOfRestrictedRoutes, restrictedRoutes.size()); Assert.assertTrue("Verify that this explicit restricted path is returned", restrictedRoutes .stream().anyMatch(route -> route.toString().equals(expectedRestrictedRoute))); } }
{ "pile_set_name": "Github" }
create_ip -name gig_ethernet_pcs_pma -vendor xilinx.com -library ip -module_name gig_ethernet_pcs_pma_0 set_property -dict [list \ CONFIG.Standard {SGMII} \ CONFIG.Physical_Interface {LVDS} \ CONFIG.Management_Interface {false} \ CONFIG.SupportLevel {Include_Shared_Logic_in_Core} \ CONFIG.LvdsRefClk {625} \ ] [get_ips gig_ethernet_pcs_pma_0]
{ "pile_set_name": "Github" }
<?php class BaseClass { protected $protected = [1, 2, 3]; private $private = ['a', 'b', 'c']; } class DerivedClass extends BaseClass { function __get($name) { throw new \Exception('Derived class getter called with: ' . $name); } } try { $test = new DerivedClass(); echo "Statement to break on.\n"; // Breakpoint here } catch (\Exception $e) { echo $e->getMessage(); } echo "Statement after try/catch\n"; ?>
{ "pile_set_name": "Github" }
// // OAMutableURLRequestTest.m // OAuthConsumer // // Created by Jon Crosby on 10/19/07. // Copyright 2007 Kaboomerang LLC. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #import "OAMutableURLRequestTest.h" // supress warnings for private methods @interface OAMutableURLRequest (Private) - (NSString *)_signatureBaseString; - (void)_generateNonce; @end @implementation OAMutableURLRequestTest - (void)setUp { consumer = [[OAConsumer alloc] initWithKey:@"dpf43f3p2l4k3l03" secret:@"kd94hf93k423kf44"]; token = [[OAToken alloc] initWithKey:@"nnch734d00sl2jdk" secret:@"pfkkdhi9sl3r4s00"]; plaintextProvider = [[OAPlaintextSignatureProvider alloc] init]; hmacSha1Provider = [[OAHMAC_SHA1SignatureProvider alloc] init]; // From OAuth Spec, Appendix A.2 "Obtaining a Request Token plaintextRequest = [[OAMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://photos.example.net/request_token"] consumer:consumer token:NULL realm:NULL signatureProvider:plaintextProvider nonce:@"hsu94j3884jdopsl" timestamp:@"1191242090"]; [plaintextRequest setHTTPMethod:@"POST"]; // From OAuth Spec, Appendix A.5.3 "Requesting Protected Resource" hmacSha1Request = [[OAMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://photos.example.net/photos"] consumer:consumer token:token realm:NULL signatureProvider:hmacSha1Provider nonce:@"kllo9940pd9333jh" timestamp:@"1191242096"]; [hmacSha1Request setParameters:[NSArray arrayWithObjects:[[OARequestParameter alloc] initWithName:@"file" value:@"vacation.jpg"], [[OARequestParameter alloc] initWithName:@"size" value:@"original"], nil]]; } - (void)testGenerateNonce { // Check for duplicates over 100,000 requests NSUInteger nonceTolerance = 100000; NSMutableDictionary *hash = [[NSMutableDictionary alloc] initWithCapacity:nonceTolerance]; int i; for (i = 0; i < nonceTolerance; i++) { [plaintextRequest _generateNonce]; NSString *nonce = [plaintextRequest nonce]; [hash setObject:@"" forKey:nonce]; } STAssertEquals(nonceTolerance, [hash count], @"Nonce collision with %d requests", nonceTolerance); } - (void)testSignatureBaseString { // From OAuth Spec, Appendix A.5.1 STAssertEqualObjects([hmacSha1Request _signatureBaseString], @"GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal", @"Signature Base String does not match OAuth Spec, Appendix A.5.1"); } - (void)testSignature { // From OAuth Spec, Appendix A.2 "Obtaining a Request Token" [plaintextRequest prepare]; STAssertEqualObjects(plaintextRequest.signature, @"kd94hf93k423kf44&", @"Plaintext request signature does not match OAuth Spec, Appendix A.2"); // From OAuth Spec, Appendix A.5.3 "Requesting Protected Resource" [hmacSha1Request prepare]; STAssertEqualObjects(hmacSha1Request.signature, @"tR3+Ty81lMeYAr/Fid0kMTYa/WM=", @"HMAC-SHA1 request signature does not match OAuth Spec, Appendix A.5.3"); } @end
{ "pile_set_name": "Github" }
#include "cornerAxis.h" #include <math.h> using namespace std; using namespace qglviewer; void Viewer::draw() { float nbSteps = 200.0; glBegin(GL_QUAD_STRIP); for (float i = 0; i < nbSteps; ++i) { float ratio = i / nbSteps; float angle = 21.0 * ratio; float c = cos(angle); float s = sin(angle); float r1 = 1.0 - 0.8 * ratio; float r2 = 0.8 - 0.8 * ratio; float alt = ratio - 0.5; const float nor = 0.5; const float up = sqrt(1.0 - nor * nor); glColor3f(1.0 - ratio, 0.2f, ratio); glNormal3f(nor * c, up, nor * s); glVertex3f(r1 * c, alt, r1 * s); glVertex3f(r2 * c, alt + 0.05, r2 * s); } glEnd(); } void Viewer::drawCornerAxis() { int viewport[4]; int scissor[4]; // The viewport and the scissor are changed to fit the lower left // corner. Original values are saved. glGetIntegerv(GL_VIEWPORT, viewport); glGetIntegerv(GL_SCISSOR_BOX, scissor); // Axis viewport size, in pixels const int size = 150; glViewport(0, 0, size, size); glScissor(0, 0, size, size); // The Z-buffer is cleared to make the axis appear over the // original image. glClear(GL_DEPTH_BUFFER_BIT); // Tune for best line rendering glDisable(GL_LIGHTING); glLineWidth(3.0); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glOrtho(-1, 1, -1, 1, -1, 1); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); glMultMatrixd(camera()->orientation().inverse().matrix()); glBegin(GL_LINES); glColor3f(1.0, 0.0, 0.0); glVertex3f(0.0, 0.0, 0.0); glVertex3f(1.0, 0.0, 0.0); glColor3f(0.0, 1.0, 0.0); glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.0, 1.0, 0.0); glColor3f(0.0, 0.0, 1.0); glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.0, 0.0, 1.0); glEnd(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glPopMatrix(); glEnable(GL_LIGHTING); // The viewport and the scissor are restored. glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); } // The thumbnail has to be drawn at the very end to allow a correct // display of the visual hints (axes, grid, etc). void Viewer::postDraw() { QGLViewer::postDraw(); drawCornerAxis(); } void Viewer::init() { restoreStateFromFile(); help(); } QString Viewer::helpString() const { QString text("<h2>C o r n e r A x i s</h2>"); text += "A world axis representation is drawn in the lower left corner, so " "that one always sees how the scene is oriented.<br><br>"; text += "The axis is drawn in <code>postDraw()</code> with appropriate ortho " "camera parameters. "; text += "<code>glViewport</code> and <code>glScissor</code> are used to " "restrict the drawing area."; return text; }
{ "pile_set_name": "Github" }
<?php /** * Shopware 5 * Copyright (c) shopware AG * * According to our dual licensing model, this program can be used either * under the terms of the GNU Affero General Public License, version 3, * or under a proprietary license. * * The texts of the GNU Affero General Public License with an additional * permission and of our proprietary license can be found at and * in the LICENSE file you have received along with this program. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * "Shopware" is a registered trademark of shopware AG. * The licensing of the program under the AGPLv3 does not imply a * trademark license. Therefore any rights, title and interest in * our trademarks remain entirely with us. */ namespace Shopware\Bundle\AttributeBundle\Service; use Doctrine\DBAL\Connection; class SchemaOperator implements SchemaOperatorInterface { /** * @var Connection */ private $connection; /** * @var TableMappingInterface */ private $tableMapping; /** * @var array */ private $nameBlacklist; public function __construct(Connection $connection, TableMappingInterface $tableMapping) { $this->connection = $connection; $this->tableMapping = $tableMapping; $this->nameBlacklist = include __DIR__ . '/../DependencyInjection/Resources/column_name_blacklist.php'; } /** * {@inheritdoc} * * @throws \Doctrine\DBAL\DBALException * @throws \Exception */ public function createColumn($table, $column, $type, $defaultValue = null) { $this->validate($table, $column); $defaultValue = $this->filterDefaultValue($defaultValue); if (!$type) { throw new \Exception('No column type provided'); } $sql = sprintf( 'ALTER TABLE `%s` ADD `%s` %s NULL DEFAULT %s', $table, $column, $type, $defaultValue ); $this->connection->executeQuery($sql); } /** * {@inheritdoc} * * @throws \Doctrine\DBAL\DBALException * @throws \Exception */ public function changeColumn($table, $originalName, $newName, $type, $defaultValue = null) { $this->validate($table, $originalName); if (!$newName) { throw new \Exception('No column name provided'); } if (!$type) { throw new \Exception('No column type provided'); } $this->validateField($newName); $defaultValue = $this->filterDefaultValue($defaultValue); $sql = sprintf( 'ALTER TABLE `%s` CHANGE `%s` `%s` %s NULL DEFAULT %s;', $table, $originalName, $newName, $type, $defaultValue ); $this->connection->executeQuery($sql); } /** * {@inheritdoc} * * @throws \Doctrine\DBAL\DBALException * @throws \Exception */ public function dropColumn($table, $column) { $this->validate($table, $column); if ($this->tableMapping->isCoreColumn($table, $column)) { throw new \Exception(sprintf('Provided column is an core attribute column: %s', $column)); } $sql = sprintf('ALTER TABLE `%s` DROP `%s`', $table, $column); $this->connection->executeQuery($sql); } /** * {@inheritdoc} * * @throws \Doctrine\DBAL\DBALException * @throws \Exception */ public function resetColumn($table, $column) { $this->validate($table, $column); if (!$this->tableMapping->isTableColumn($table, $column)) { throw new \Exception(sprintf('Provided column %s does not exist in table %s', $column, $table)); } $sql = sprintf('UPDATE `%s` SET `%s` = NULL', $table, $column); $this->connection->executeUpdate($sql); } /** * @param string $table * @param string $name * * @throws \Exception */ private function validate($table, $name) { if (!$table) { throw new \Exception('No table name provided'); } if (!$name) { throw new \Exception('No column name provided'); } $this->validateField($table); $this->validateField($name); if (!$this->tableMapping->isAttributeTable($table)) { throw new \Exception(sprintf('Provided table is no attribute table: %s', $table)); } if ($this->tableMapping->isIdentifierColumn($table, $name)) { throw new \Exception(sprintf('Provided column is an identifier column: %s', $name)); } $lowerCaseName = strtolower($name); if (in_array($lowerCaseName, $this->nameBlacklist)) { throw new \Exception(sprintf('Provided name %s is a reserved keyword.', $name)); } } /** * @param string $field * * @throws \Exception */ private function validateField($field) { if (strlen($field) > 64) { throw new \Exception('Maximum length: 64 chars'); } if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $field)) { throw new \Exception(sprintf('Invalid chars in %s', $field)); } } /** * @param float|int|string|null $defaultValue * * @return float|int|string|null */ private function filterDefaultValue($defaultValue) { if (!is_string($defaultValue)) { return $defaultValue; } if ($defaultValue === 'NULL') { return $defaultValue; } return $this->connection->quote( str_replace(['`', '\''], '', $defaultValue) ); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.activemq</groupId> <artifactId>activemq-parent</artifactId> <version>5.17.0-SNAPSHOT</version> </parent> <artifactId>activemq-blueprint</artifactId> <packaging>bundle</packaging> <name>ActiveMQ :: Blueprint</name> <description>The ActiveMQ Message Broker and Client implementations</description> <properties> <activemq.osgi.import.pkg> org.apache.xbean*;version="[3.13,5)", org.apache.aries.blueprint.*;version="[1.0,2)", * </activemq.osgi.import.pkg> </properties> <dependencies> <dependency> <groupId>org.apache.aries.blueprint</groupId> <artifactId>org.apache.aries.blueprint</artifactId> <version>${aries-version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.xbean</groupId> <artifactId>xbean-blueprint</artifactId> <version>${xbean-version}</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <configuration> <instructions> <Fragment-Host>org.apache.activemq.activemq-osgi</Fragment-Host> </instructions> </configuration> </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> </plugin> <plugin> <artifactId>maven-install-plugin</artifactId> </plugin> </plugins> </build> </project>
{ "pile_set_name": "Github" }
#ifndef BOOST_MPL_AUX_HAS_TYPE_HPP_INCLUDED #define BOOST_MPL_AUX_HAS_TYPE_HPP_INCLUDED // Copyright Aleksey Gurtovoy 2002-2004 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/mpl for documentation. // $Id: has_type.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ // $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $ // $Revision: 49267 $ #include <boost/mpl/has_xxx.hpp> namespace boost { namespace mpl { namespace aux { BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_type, type, true) }}} #endif // BOOST_MPL_AUX_HAS_TYPE_HPP_INCLUDED
{ "pile_set_name": "Github" }
/* -*-C-*- ******************************************************************************** * * File: chopper.c (Formerly chopper.c) * Description: * Author: Mark Seaman, OCR Technology * Created: Fri Oct 16 14:37:00 1987 * Modified: Tue Jul 30 16:18:52 1991 (Mark Seaman) marks@hpgrlt * Language: C * Package: N/A * Status: Reusable Software Component * * (c) Copyright 1987, Hewlett-Packard Company. ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** http://www.apache.org/licenses/LICENSE-2.0 ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. * **************************************************************************/ /*---------------------------------------------------------------------- I n c l u d e s ----------------------------------------------------------------------*/ #include <math.h> #include "chopper.h" #include "assert.h" #include "associate.h" #include "blobs.h" #include "callcpp.h" #include "const.h" #include "findseam.h" #include "globals.h" #include "render.h" #include "pageres.h" #include "seam.h" #include "stopper.h" #include "structures.h" #include "unicharset.h" #include "wordrec.h" // Include automatically generated configuration file if running autoconf. #ifdef HAVE_CONFIG_H #include "config_auto.h" #endif // Even though the limit on the number of chunks may now be removed, keep // the same limit for repeatable behavior, and it may be a speed advantage. static const int kMaxNumChunks = 64; /*---------------------------------------------------------------------- F u n c t i o n s ----------------------------------------------------------------------*/ /** * @name preserve_outline_tree * * Copy the list of outlines. */ void preserve_outline(EDGEPT *start) { EDGEPT *srcpt; if (start == NULL) return; srcpt = start; do { srcpt->flags[1] = 1; srcpt = srcpt->next; } while (srcpt != start); srcpt->flags[1] = 2; } /**************************************************************************/ void preserve_outline_tree(TESSLINE *srcline) { TESSLINE *outline; for (outline = srcline; outline != NULL; outline = outline->next) { preserve_outline (outline->loop); } } /** * @name restore_outline_tree * * Copy the list of outlines. */ EDGEPT *restore_outline(EDGEPT *start) { EDGEPT *srcpt; EDGEPT *real_start; if (start == NULL) return NULL; srcpt = start; do { if (srcpt->flags[1] == 2) break; srcpt = srcpt->next; } while (srcpt != start); real_start = srcpt; do { srcpt = srcpt->next; if (srcpt->prev->flags[1] == 0) { remove_edgept(srcpt->prev); } } while (srcpt != real_start); return real_start; } /******************************************************************************/ void restore_outline_tree(TESSLINE *srcline) { TESSLINE *outline; for (outline = srcline; outline != NULL; outline = outline->next) { outline->loop = restore_outline (outline->loop); outline->start = outline->loop->pos; } } // Helper runs all the checks on a seam to make sure it is valid. // Returns the seam if OK, otherwise deletes the seam and returns NULL. static SEAM* CheckSeam(int debug_level, inT32 blob_number, TWERD* word, TBLOB* blob, TBLOB* other_blob, const GenericVector<SEAM*>& seams, SEAM* seam) { if (seam == NULL || blob->outlines == NULL || other_blob->outlines == NULL || total_containment(blob, other_blob) || check_blob(other_blob) || !seam->ContainedByBlob(*blob) || !seam->ContainedByBlob(*other_blob) || any_shared_split_points(seams, seam) || !seam->PrepareToInsertSeam(seams, word->blobs, blob_number, false)) { word->blobs.remove(blob_number + 1); if (seam) { seam->UndoSeam(blob, other_blob); delete seam; seam = NULL; #ifndef GRAPHICS_DISABLED if (debug_level) { if (debug_level >2) display_blob(blob, Red); tprintf("\n** seam being removed ** \n"); } #endif } else { delete other_blob; } return NULL; } return seam; } /** * @name attempt_blob_chop * * Try to split the this blob after this one. Check to make sure that * it was successful. */ namespace tesseract { SEAM *Wordrec::attempt_blob_chop(TWERD *word, TBLOB *blob, inT32 blob_number, bool italic_blob, const GenericVector<SEAM*>& seams) { if (repair_unchopped_blobs) preserve_outline_tree (blob->outlines); TBLOB *other_blob = TBLOB::ShallowCopy(*blob); /* Make new blob */ // Insert it into the word. word->blobs.insert(other_blob, blob_number + 1); SEAM *seam = NULL; if (prioritize_division) { TPOINT location; if (divisible_blob(blob, italic_blob, &location)) { seam = new SEAM(0.0f, location); } } if (seam == NULL) seam = pick_good_seam(blob); if (chop_debug) { if (seam != NULL) seam->Print("Good seam picked="); else tprintf("\n** no seam picked *** \n"); } if (seam) { seam->ApplySeam(italic_blob, blob, other_blob); } seam = CheckSeam(chop_debug, blob_number, word, blob, other_blob, seams, seam); if (seam == NULL) { if (repair_unchopped_blobs) restore_outline_tree(blob->outlines); if (allow_blob_division && !prioritize_division) { // If the blob can simply be divided into outlines, then do that. TPOINT location; if (divisible_blob(blob, italic_blob, &location)) { other_blob = TBLOB::ShallowCopy(*blob); /* Make new blob */ word->blobs.insert(other_blob, blob_number + 1); seam = new SEAM(0.0f, location); seam->ApplySeam(italic_blob, blob, other_blob); seam = CheckSeam(chop_debug, blob_number, word, blob, other_blob, seams, seam); } } } if (seam != NULL) { // Make sure this seam doesn't get chopped again. seam->Finalize(); } return seam; } SEAM *Wordrec::chop_numbered_blob(TWERD *word, inT32 blob_number, bool italic_blob, const GenericVector<SEAM*>& seams) { return attempt_blob_chop(word, word->blobs[blob_number], blob_number, italic_blob, seams); } SEAM *Wordrec::chop_overlapping_blob(const GenericVector<TBOX>& boxes, bool italic_blob, WERD_RES *word_res, int *blob_number) { TWERD *word = word_res->chopped_word; for (*blob_number = 0; *blob_number < word->NumBlobs(); ++*blob_number) { TBLOB *blob = word->blobs[*blob_number]; TPOINT topleft, botright; topleft.x = blob->bounding_box().left(); topleft.y = blob->bounding_box().top(); botright.x = blob->bounding_box().right(); botright.y = blob->bounding_box().bottom(); TPOINT original_topleft, original_botright; word_res->denorm.DenormTransform(NULL, topleft, &original_topleft); word_res->denorm.DenormTransform(NULL, botright, &original_botright); TBOX original_box = TBOX(original_topleft.x, original_botright.y, original_botright.x, original_topleft.y); bool almost_equal_box = false; int num_overlap = 0; for (int i = 0; i < boxes.size(); i++) { if (original_box.overlap_fraction(boxes[i]) > 0.125) num_overlap++; if (original_box.almost_equal(boxes[i], 3)) almost_equal_box = true; } TPOINT location; if (divisible_blob(blob, italic_blob, &location) || (!almost_equal_box && num_overlap > 1)) { SEAM *seam = attempt_blob_chop(word, blob, *blob_number, italic_blob, word_res->seam_array); if (seam != NULL) return seam; } } *blob_number = -1; return NULL; } } // namespace tesseract /** * @name any_shared_split_points * * Return true if any of the splits share a point with this one. */ int any_shared_split_points(const GenericVector<SEAM*>& seams, SEAM *seam) { int length; int index; length = seams.size(); for (index = 0; index < length; index++) if (seam->SharesPosition(*seams[index])) return TRUE; return FALSE; } /** * @name check_blob * * @return true if blob has a non whole outline. */ int check_blob(TBLOB *blob) { TESSLINE *outline; EDGEPT *edgept; for (outline = blob->outlines; outline != NULL; outline = outline->next) { edgept = outline->loop; do { if (edgept == NULL) break; edgept = edgept->next; } while (edgept != outline->loop); if (edgept == NULL) return 1; } return 0; } namespace tesseract { /** * @name improve_one_blob * * Finds the best place to chop, based on the worst blob, fixpt, or next to * a fragment, according to the input. Returns the SEAM corresponding to the * chop point, if any is found, and the index in the ratings_matrix of the * chopped blob. Note that blob_choices is just a copy of the pointers in the * leading diagonal of the ratings MATRIX. * Although the blob is chopped, the returned SEAM is yet to be inserted into * word->seam_array and the resulting blobs are unclassified, so this function * can be used by ApplyBox as well as during recognition. */ SEAM* Wordrec::improve_one_blob(const GenericVector<BLOB_CHOICE*>& blob_choices, DANGERR *fixpt, bool split_next_to_fragment, bool italic_blob, WERD_RES* word, int* blob_number) { float rating_ceiling = MAX_FLOAT32; SEAM *seam = NULL; do { *blob_number = select_blob_to_split_from_fixpt(fixpt); if (chop_debug) tprintf("blob_number from fixpt = %d\n", *blob_number); bool split_point_from_dict = (*blob_number != -1); if (split_point_from_dict) { fixpt->clear(); } else { *blob_number = select_blob_to_split(blob_choices, rating_ceiling, split_next_to_fragment); } if (chop_debug) tprintf("blob_number = %d\n", *blob_number); if (*blob_number == -1) return NULL; // TODO(rays) it may eventually help to allow italic_blob to be true, seam = chop_numbered_blob(word->chopped_word, *blob_number, italic_blob, word->seam_array); if (seam != NULL) return seam; // Success! if (blob_choices[*blob_number] == NULL) return NULL; if (!split_point_from_dict) { // We chopped the worst rated blob, try something else next time. rating_ceiling = blob_choices[*blob_number]->rating(); } } while (true); return seam; } /** * @name chop_one_blob * * Start with the current one-blob word and its classification. Find * the worst blobs and try to divide it up to improve the ratings. * Used for testing chopper. */ SEAM* Wordrec::chop_one_blob(const GenericVector<TBOX>& boxes, const GenericVector<BLOB_CHOICE*>& blob_choices, WERD_RES* word_res, int* blob_number) { if (prioritize_division) { return chop_overlapping_blob(boxes, true, word_res, blob_number); } else { return improve_one_blob(blob_choices, NULL, false, true, word_res, blob_number); } } /** * @name chop_word_main * * Classify the blobs in this word and permute the results. Find the * worst blob in the word and chop it up. Continue this process until * a good answer has been found or all the blobs have been chopped up * enough. The results are returned in the WERD_RES. */ void Wordrec::chop_word_main(WERD_RES *word) { int num_blobs = word->chopped_word->NumBlobs(); if (word->ratings == NULL) { word->ratings = new MATRIX(num_blobs, wordrec_max_join_chunks); } if (word->ratings->get(0, 0) == NULL) { // Run initial classification. for (int b = 0; b < num_blobs; ++b) { BLOB_CHOICE_LIST* choices = classify_piece(word->seam_array, b, b, "Initial:", word->chopped_word, word->blamer_bundle); word->ratings->put(b, b, choices); } } else { // Blobs have been pre-classified. Set matrix cell for all blob choices for (int col = 0; col < word->ratings->dimension(); ++col) { for (int row = col; row < word->ratings->dimension() && row < col + word->ratings->bandwidth(); ++row) { BLOB_CHOICE_LIST* choices = word->ratings->get(col, row); if (choices != NULL) { BLOB_CHOICE_IT bc_it(choices); for (bc_it.mark_cycle_pt(); !bc_it.cycled_list(); bc_it.forward()) { bc_it.data()->set_matrix_cell(col, row); } } } } } // Run Segmentation Search. BestChoiceBundle best_choice_bundle(word->ratings->dimension()); SegSearch(word, &best_choice_bundle, word->blamer_bundle); if (word->best_choice == NULL) { // SegSearch found no valid paths, so just use the leading diagonal. word->FakeWordFromRatings(TOP_CHOICE_PERM); } word->RebuildBestState(); // If we finished without a hyphen at the end of the word, let the next word // be found in the dictionary. if (word->word->flag(W_EOL) && !getDict().has_hyphen_end(*word->best_choice)) { getDict().reset_hyphen_vars(true); } if (word->blamer_bundle != NULL && this->fill_lattice_ != NULL) { CallFillLattice(*word->ratings, word->best_choices, *word->uch_set, word->blamer_bundle); } if (wordrec_debug_level > 0) { tprintf("Final Ratings Matrix:\n"); word->ratings->print(getDict().getUnicharset()); } word->FilterWordChoices(getDict().stopper_debug_level); } /** * @name improve_by_chopping * * Repeatedly chops the worst blob, classifying the new blobs fixing up all * the data, and incrementally runs the segmentation search until a good word * is found, or no more chops can be found. */ void Wordrec::improve_by_chopping(float rating_cert_scale, WERD_RES* word, BestChoiceBundle* best_choice_bundle, BlamerBundle* blamer_bundle, LMPainPoints* pain_points, GenericVector<SegSearchPending>* pending) { int blob_number; do { // improvement loop. // Make a simple vector of BLOB_CHOICEs to make it easy to pick which // one to chop. GenericVector<BLOB_CHOICE*> blob_choices; int num_blobs = word->ratings->dimension(); for (int i = 0; i < num_blobs; ++i) { BLOB_CHOICE_LIST* choices = word->ratings->get(i, i); if (choices == NULL || choices->empty()) { blob_choices.push_back(NULL); } else { BLOB_CHOICE_IT bc_it(choices); blob_choices.push_back(bc_it.data()); } } SEAM* seam = improve_one_blob(blob_choices, &best_choice_bundle->fixpt, false, false, word, &blob_number); if (seam == NULL) break; // A chop has been made. We have to correct all the data structures to // take into account the extra bottom-level blob. // Put the seam into the seam_array and correct everything else on the // word: ratings matrix (including matrix location in the BLOB_CHOICES), // states in WERD_CHOICEs, and blob widths. word->InsertSeam(blob_number, seam); // Insert a new entry in the beam array. best_choice_bundle->beam.insert(new LanguageModelState, blob_number); // Fixpts are outdated, but will get recalculated. best_choice_bundle->fixpt.clear(); // Remap existing pain points. pain_points->RemapForSplit(blob_number); // Insert a new pending at the chop point. pending->insert(SegSearchPending(), blob_number); // Classify the two newly created blobs using ProcessSegSearchPainPoint, // as that updates the pending correctly and adds new pain points. MATRIX_COORD pain_point(blob_number, blob_number); ProcessSegSearchPainPoint(0.0f, pain_point, "Chop1", pending, word, pain_points, blamer_bundle); pain_point.col = blob_number + 1; pain_point.row = blob_number + 1; ProcessSegSearchPainPoint(0.0f, pain_point, "Chop2", pending, word, pain_points, blamer_bundle); if (language_model_->language_model_ngram_on) { // N-gram evaluation depends on the number of blobs in a chunk, so we // have to re-evaluate everything in the word. ResetNGramSearch(word, best_choice_bundle, pending); blob_number = 0; } // Run language model incrementally. (Except with the n-gram model on.) UpdateSegSearchNodes(rating_cert_scale, blob_number, pending, word, pain_points, best_choice_bundle, blamer_bundle); } while (!language_model_->AcceptableChoiceFound() && word->ratings->dimension() < kMaxNumChunks); // If after running only the chopper best_choice is incorrect and no blame // has been yet set, blame the classifier if best_choice is classifier's // top choice and is a dictionary word (i.e. language model could not have // helped). Otherwise blame the tradeoff between the classifier and // the old language model (permuters). if (word->blamer_bundle != NULL && word->blamer_bundle->incorrect_result_reason() == IRR_CORRECT && !word->blamer_bundle->ChoiceIsCorrect(word->best_choice)) { bool valid_permuter = word->best_choice != NULL && Dict::valid_word_permuter(word->best_choice->permuter(), false); word->blamer_bundle->BlameClassifierOrLangModel(word, getDict().getUnicharset(), valid_permuter, wordrec_debug_blamer); } } /********************************************************************** * select_blob_to_split * * These are the results of the last classification. Find a likely * place to apply splits. If none, return -1. **********************************************************************/ int Wordrec::select_blob_to_split( const GenericVector<BLOB_CHOICE*>& blob_choices, float rating_ceiling, bool split_next_to_fragment) { BLOB_CHOICE *blob_choice; int x; float worst = -MAX_FLOAT32; int worst_index = -1; float worst_near_fragment = -MAX_FLOAT32; int worst_index_near_fragment = -1; const CHAR_FRAGMENT **fragments = NULL; if (chop_debug) { if (rating_ceiling < MAX_FLOAT32) tprintf("rating_ceiling = %8.4f\n", rating_ceiling); else tprintf("rating_ceiling = No Limit\n"); } if (split_next_to_fragment && blob_choices.size() > 0) { fragments = new const CHAR_FRAGMENT *[blob_choices.length()]; if (blob_choices[0] != NULL) { fragments[0] = getDict().getUnicharset().get_fragment( blob_choices[0]->unichar_id()); } else { fragments[0] = NULL; } } for (x = 0; x < blob_choices.size(); ++x) { if (blob_choices[x] == NULL) { delete[] fragments; return x; } else { blob_choice = blob_choices[x]; // Populate fragments for the following position. if (split_next_to_fragment && x+1 < blob_choices.size()) { if (blob_choices[x + 1] != NULL) { fragments[x + 1] = getDict().getUnicharset().get_fragment( blob_choices[x + 1]->unichar_id()); } else { fragments[x + 1] = NULL; } } if (blob_choice->rating() < rating_ceiling && blob_choice->certainty() < tessedit_certainty_threshold) { // Update worst and worst_index. if (blob_choice->rating() > worst) { worst_index = x; worst = blob_choice->rating(); } if (split_next_to_fragment) { // Update worst_near_fragment and worst_index_near_fragment. bool expand_following_fragment = (x + 1 < blob_choices.size() && fragments[x+1] != NULL && !fragments[x+1]->is_beginning()); bool expand_preceding_fragment = (x > 0 && fragments[x-1] != NULL && !fragments[x-1]->is_ending()); if ((expand_following_fragment || expand_preceding_fragment) && blob_choice->rating() > worst_near_fragment) { worst_index_near_fragment = x; worst_near_fragment = blob_choice->rating(); if (chop_debug) { tprintf("worst_index_near_fragment=%d" " expand_following_fragment=%d" " expand_preceding_fragment=%d\n", worst_index_near_fragment, expand_following_fragment, expand_preceding_fragment); } } } } } } delete[] fragments; // TODO(daria): maybe a threshold of badness for // worst_near_fragment would be useful. return worst_index_near_fragment != -1 ? worst_index_near_fragment : worst_index; } /********************************************************************** * select_blob_to_split_from_fixpt * * Given the fix point from a dictionary search, if there is a single * dangerous blob that maps to multiple characters, return that blob * index as a place we need to split. If none, return -1. **********************************************************************/ int Wordrec::select_blob_to_split_from_fixpt(DANGERR *fixpt) { if (!fixpt) return -1; for (int i = 0; i < fixpt->size(); i++) { if ((*fixpt)[i].begin + 1 == (*fixpt)[i].end && (*fixpt)[i].dangerous && (*fixpt)[i].correct_is_ngram) { return (*fixpt)[i].begin; } } return -1; } } // namespace tesseract /********************************************************************** * total_containment * * Check to see if one of these outlines is totally contained within * the bounding box of the other. **********************************************************************/ inT16 total_containment(TBLOB *blob1, TBLOB *blob2) { TBOX box1 = blob1->bounding_box(); TBOX box2 = blob2->bounding_box(); return box1.contains(box2) || box2.contains(box1); }
{ "pile_set_name": "Github" }
// Copyright (c) 2019 K Team. All Rights Reserved. requires "../map-tests.k" module ASSIGNMENT-5-SPEC imports MAP-TESTS rule <k> assignment ( (MAP:Map X:MyId |-> 1) [ Y:MyId <- 2 ] [ Z:MyId <- 3 ] ) => . </k> requires Y =/=K X andBool notBool Y in_keys(MAP) endmodule
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <UIKit/UIView.h> @class NSAttributedString, NSString, UIButton, UILabel; @protocol SKUIMessageBannerDelegate; @interface SKUIMessageBanner : UIView { id <SKUIMessageBannerDelegate> _delegate; UILabel *_label; UIButton *_button; UIView *_borderView; UIButton *_clearButton; NSAttributedString *_attributedMessage; } @property(retain, nonatomic) NSAttributedString *attributedMessage; // @synthesize attributedMessage=_attributedMessage; @property(nonatomic) __weak id <SKUIMessageBannerDelegate> delegate; // @synthesize delegate=_delegate; - (void).cxx_destruct; - (void)_clearButtonAction:(id)arg1; - (void)_buttonAction:(id)arg1; - (struct CGSize)sizeThatFits:(struct CGSize)arg1; - (void)layoutSubviews; - (id)value; @property(retain, nonatomic) NSString *message; @property(nonatomic) _Bool showsClearButton; - (id)initWithFrame:(struct CGRect)arg1; @end
{ "pile_set_name": "Github" }
module Revily module Event class Job class IncidentTrigger < Incident def process current_user.contacts.each do |contact| contact.notify(incidents.triggered) end end end end end end
{ "pile_set_name": "Github" }
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_FIXED_BUFFER_H_ #define MOJO_PUBLIC_CPP_BINDINGS_LIB_FIXED_BUFFER_H_ #include <cstddef> #include "base/component_export.h" #include "base/macros.h" #include "mojo/public/cpp/bindings/lib/buffer.h" namespace mojo { namespace internal { // FixedBufferForTesting owns its buffer. The Leak method may be used to steal // the underlying memory. class COMPONENT_EXPORT(MOJO_CPP_BINDINGS_BASE) FixedBufferForTesting : public Buffer { public: explicit FixedBufferForTesting(size_t size); ~FixedBufferForTesting(); private: DISALLOW_COPY_AND_ASSIGN(FixedBufferForTesting); }; } // namespace internal } // namespace mojo #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_FIXED_BUFFER_H_
{ "pile_set_name": "Github" }
<Canvas> <Kind>40</Kind> <Name>Presets</Name> <IsMinified>0</IsMinified> <XPosition>652.000000000</XPosition> <YPosition>347.000000000</YPosition> </Canvas> <Widget> <Kind>2</Kind> <Name>Replicator</Name> <Value>1</Value> </Widget> <Widget> <Kind>2</Kind> <Name>Replicator_echoVortex</Name> <Value>1</Value> </Widget> <Widget> <Kind>2</Kind> <Name>Replicator_organ</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>ReplicatorOC</Name> <Value>0</Value> </Widget>
{ "pile_set_name": "Github" }
<?php /** * @copyright Copyright (C) 2017 AIZAWA Hina * @license https://github.com/fetus-hina/stat.ink/blob/master/LICENSE MIT * @author AIZAWA Hina <hina@fetus.jp> */ namespace app\components\widgets; use Yii; use app\assets\ActiveReltimeAsset; use yii\base\Widget; use yii\helpers\Html; use yii\helpers\Json; use yii\web\View; class ActiveRelativeTimeWidget extends Widget { public $datetime; public $mode = 'long'; public function run() { ActiveReltimeAsset::register($this->view); $this->view->registerJs( sprintf( '!function(){window.reltimeFormats=%s}();', Json::encode($this->getFormats()) ), View::POS_BEGIN, hash('md5', sprintf('%s:%s:%d', __METHOD__, __FILE__, __LINE__)) ); return Html::tag( 'span', Html::encode($this->formatReltime()), [ 'class' => 'active-reltime', 'data' => [ 'time' => (string)(int)$this->datetime->getTimestamp(), 'mode' => $this->mode === 'short' ? 'short' : 'long', ] ] ); } protected function formatReltime(): string { $formatter = Yii::$app->getFormatter(); $now = $_SERVER['REQUEST_TIME'] ?? time(); switch ($this->mode) { case 'long': default: return $formatter->asRelativeTime($this->datetime, $now); case 'short': $diff = $now - $this->datetime->getTimestamp(); if ($diff >= 31536000) { return Yii::t('app-reltime', '{delta} yr', ['delta' => (int)floor($diff / 31536000)]); } elseif ($diff >= 2592000) { return Yii::t('app-reltime', '{delta} mo', ['delta' => (int)floor($diff / 2592000)]); } elseif ($diff >= 86400) { return Yii::t('app-reltime', '{delta} d', ['delta' => (int)floor($diff / 86400)]); } elseif ($diff >= 3600) { return Yii::t('app-reltime', '{delta} h', ['delta' => (int)floor($diff / 3600)]); } elseif ($diff >= 60) { return Yii::t('app-reltime', '{delta} m', ['delta' => (int)floor($diff / 60)]); } elseif ($diff >= 15) { return Yii::t('app-reltime', '{delta} s', ['delta' => (int)$diff]); } else { return Yii::t('app-reltime', 'now'); } } } protected function getFormats(): array { // {{{ return [ 'short' => [ 'one' => [ 'year' => \Yii::t('app-reltime', '{delta} yr', ['delta' => 1]), 'mon' => \Yii::t('app-reltime', '{delta} mo', ['delta' => 1]), 'day' => \Yii::t('app-reltime', '{delta} d', ['delta' => 1]), 'hour' => \Yii::t('app-reltime', '{delta} h', ['delta' => 1]), 'min' => \Yii::t('app-reltime', '{delta} m', ['delta' => 1]), 'sec' => \Yii::t('app-reltime', '{delta} s', ['delta' => 1]), 'now' => \Yii::t('app-reltime', 'now'), ], 'many' => [ 'year' => \Yii::t('app-reltime', '{delta} yr', ['delta' => 42]), 'mon' => \Yii::t('app-reltime', '{delta} mo', ['delta' => 42]), 'day' => \Yii::t('app-reltime', '{delta} d', ['delta' => 42]), 'hour' => \Yii::t('app-reltime', '{delta} h', ['delta' => 42]), 'min' => \Yii::t('app-reltime', '{delta} m', ['delta' => 42]), 'sec' => \Yii::t('app-reltime', '{delta} s', ['delta' => 42]), 'now' => \Yii::t('app-reltime', 'now'), ], ], 'long' => [ 'one' => [ 'year' => \Yii::t('yii', '{delta, plural, =1{a year} other{# years}} ago', ['delta' => 1]), 'mon' => \Yii::t('yii', '{delta, plural, =1{a month} other{# months}} ago', ['delta' => 1]), 'day' => \Yii::t('yii', '{delta, plural, =1{a day} other{# days}} ago', ['delta' => 1]), 'hour' => \Yii::t('yii', '{delta, plural, =1{an hour} other{# hours}} ago', ['delta' => 1]), 'min' => \Yii::t('yii', '{delta, plural, =1{a minute} other{# minutes}} ago', ['delta' => 1]), 'sec' => \Yii::t('yii', '{delta, plural, =1{a second} other{# seconds}} ago', ['delta' => 1]), 'now' => \Yii::t('yii', 'just now'), ], 'many' => [ 'year' => \Yii::t('yii', '{delta, plural, =1{a year} other{# years}} ago', ['delta' => 42]), 'mon' => \Yii::t('yii', '{delta, plural, =1{a month} other{# months}} ago', ['delta' => 42]), 'day' => \Yii::t('yii', '{delta, plural, =1{a day} other{# days}} ago', ['delta' => 42]), 'hour' => \Yii::t('yii', '{delta, plural, =1{an hour} other{# hours}} ago', ['delta' => 42]), 'min' => \Yii::t('yii', '{delta, plural, =1{a minute} other{# minutes}} ago', ['delta' => 42]), 'sec' => \Yii::t('yii', '{delta, plural, =1{a second} other{# seconds}} ago', ['delta' => 42]), 'now' => \Yii::t('yii', 'just now'), ], ], ]; // }}} } }
{ "pile_set_name": "Github" }
Cache-control: no-store
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>uIP 1.0: uip_tcpip_hdr Struct Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.6 --> <div class="tabs"> <ul> <li><a href="main.html"><span>Main&nbsp;Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li id="current"><a href="classes.html"><span>Data&nbsp;Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul></div> <div class="tabs"> <ul> <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li> <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li> <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li> <li><a href="functions.html"><span>Data&nbsp;Fields</span></a></li> </ul></div> <h1>uip_tcpip_hdr Struct Reference<br> <small> [<a class="el" href="a00150.html">The uIP TCP/IP stack</a>]</small> </h1><!-- doxytag: class="uip_tcpip_hdr" --><hr><a name="_details"></a><h2>Detailed Description</h2> <p> <p> Definition at line <a class="el" href="a00202.html#l01386">1386</a> of file <a class="el" href="a00202.html">uip.h</a>.<table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Data Fields</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e1e60d56ea87dfa09230e25ca5ecf2fc"></a><!-- doxytag: member="uip_tcpip_hdr::vhl" ref="e1e60d56ea87dfa09230e25ca5ecf2fc" args="" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#e1e60d56ea87dfa09230e25ca5ecf2fc">vhl</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8cf0ca17b115ff2e3071b3fabcc43b53"></a><!-- doxytag: member="uip_tcpip_hdr::tos" ref="8cf0ca17b115ff2e3071b3fabcc43b53" args="" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#8cf0ca17b115ff2e3071b3fabcc43b53">tos</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e57281f5bef284bc9545834ef8ed4a96"></a><!-- doxytag: member="uip_tcpip_hdr::len" ref="e57281f5bef284bc9545834ef8ed4a96" args="[2]" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#e57281f5bef284bc9545834ef8ed4a96">len</a> [2]</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7a59f0dad059786238d8ab604630e7f3"></a><!-- doxytag: member="uip_tcpip_hdr::ipid" ref="7a59f0dad059786238d8ab604630e7f3" args="[2]" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#7a59f0dad059786238d8ab604630e7f3">ipid</a> [2]</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="85d7f35662f7be20cd84e789a290dd4b"></a><!-- doxytag: member="uip_tcpip_hdr::ipoffset" ref="85d7f35662f7be20cd84e789a290dd4b" args="[2]" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#85d7f35662f7be20cd84e789a290dd4b">ipoffset</a> [2]</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0f27e16ddcf7199d514968204966f559"></a><!-- doxytag: member="uip_tcpip_hdr::ttl" ref="0f27e16ddcf7199d514968204966f559" args="" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#0f27e16ddcf7199d514968204966f559">ttl</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e45b31a0a277dd5325ad2a332358b21b"></a><!-- doxytag: member="uip_tcpip_hdr::proto" ref="e45b31a0a277dd5325ad2a332358b21b" args="" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#e45b31a0a277dd5325ad2a332358b21b">proto</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="af7a8a5310ad945de38f5b3ac755ae7d"></a><!-- doxytag: member="uip_tcpip_hdr::ipchksum" ref="af7a8a5310ad945de38f5b3ac755ae7d" args="" --> <a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#af7a8a5310ad945de38f5b3ac755ae7d">ipchksum</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c8f124419a231f38bb6cdf5041757a27"></a><!-- doxytag: member="uip_tcpip_hdr::srcipaddr" ref="c8f124419a231f38bb6cdf5041757a27" args="[2]" --> <a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#c8f124419a231f38bb6cdf5041757a27">srcipaddr</a> [2]</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8d4e08d051b35b1c710c3be5b8bbfa05"></a><!-- doxytag: member="uip_tcpip_hdr::destipaddr" ref="8d4e08d051b35b1c710c3be5b8bbfa05" args="[2]" --> <a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#8d4e08d051b35b1c710c3be5b8bbfa05">destipaddr</a> [2]</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a81fff4836049cb3c018304d77337554"></a><!-- doxytag: member="uip_tcpip_hdr::srcport" ref="a81fff4836049cb3c018304d77337554" args="" --> <a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#a81fff4836049cb3c018304d77337554">srcport</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="025ffa46b799fa6952719c499a3ae17c"></a><!-- doxytag: member="uip_tcpip_hdr::destport" ref="025ffa46b799fa6952719c499a3ae17c" args="" --> <a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#025ffa46b799fa6952719c499a3ae17c">destport</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2541fae506eb111ff1be2372e0919839"></a><!-- doxytag: member="uip_tcpip_hdr::seqno" ref="2541fae506eb111ff1be2372e0919839" args="[4]" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#2541fae506eb111ff1be2372e0919839">seqno</a> [4]</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="71721395f1c7c42b8bcc111b339bea7c"></a><!-- doxytag: member="uip_tcpip_hdr::ackno" ref="71721395f1c7c42b8bcc111b339bea7c" args="[4]" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#71721395f1c7c42b8bcc111b339bea7c">ackno</a> [4]</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6af8a59d0ab8967aacea749d6e59ac90"></a><!-- doxytag: member="uip_tcpip_hdr::tcpoffset" ref="6af8a59d0ab8967aacea749d6e59ac90" args="" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#6af8a59d0ab8967aacea749d6e59ac90">tcpoffset</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="619d9755a5d4aaabdb2e5e6ea4c1e0bf"></a><!-- doxytag: member="uip_tcpip_hdr::flags" ref="619d9755a5d4aaabdb2e5e6ea4c1e0bf" args="" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#619d9755a5d4aaabdb2e5e6ea4c1e0bf">flags</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7f0ab3fe3bcf1e3ed9f5950cb4474ec1"></a><!-- doxytag: member="uip_tcpip_hdr::wnd" ref="7f0ab3fe3bcf1e3ed9f5950cb4474ec1" args="[2]" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#7f0ab3fe3bcf1e3ed9f5950cb4474ec1">wnd</a> [2]</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f4a1d8cfbe270393a2de02b0c743e474"></a><!-- doxytag: member="uip_tcpip_hdr::tcpchksum" ref="f4a1d8cfbe270393a2de02b0c743e474" args="" --> <a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#f4a1d8cfbe270393a2de02b0c743e474">tcpchksum</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="dc7001682017599549f57771f4cd1b9a"></a><!-- doxytag: member="uip_tcpip_hdr::urgp" ref="dc7001682017599549f57771f4cd1b9a" args="[2]" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#dc7001682017599549f57771f4cd1b9a">urgp</a> [2]</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="dde3cf9a57445814d01b3c67da08afdb"></a><!-- doxytag: member="uip_tcpip_hdr::optdata" ref="dde3cf9a57445814d01b3c67da08afdb" args="[4]" --> <a class="el" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00094.html#dde3cf9a57445814d01b3c67da08afdb">optdata</a> [4]</td></tr> </table> <hr size="1"><address style="align: right;"><small>Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by&nbsp; <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address> </body> </html>
{ "pile_set_name": "Github" }
/* testBSIFutureComposer() */ /* Rip_BSIFutureComposer() */ #include "globals.h" #include "extern.h" short testBSIFutureComposer ( void ) { PW_Start_Address = PW_i; /* file size < 18424 */ if ( test_1_start(PW_Start_Address + 18424) ) { /*printf ( "#1 (start:%ld) (number of samples:%ld)\n" , PW_Start_Address , PW_j);*/ return BAD; } if (( in_data[PW_Start_Address+17412] != 'D' ) || ( in_data[PW_Start_Address+17413] != 'I' ) || ( in_data[PW_Start_Address+17414] != 'G' ) || ( in_data[PW_Start_Address+17415] != 'I' ) ) { /*printf ( "#2 (start:%ld) (number of samples:%ld)\n" , PW_Start_Address , PW_j);*/ return BAD; } if (( in_data[PW_Start_Address+18424] != 'D' ) || ( in_data[PW_Start_Address+18425] != 'I' ) || ( in_data[PW_Start_Address+18426] != 'G' ) || ( in_data[PW_Start_Address+18427] != 'P' ) ) { /*printf ( "#3 (start:%ld) (number of samples:%ld)\n" , PW_Start_Address , PW_j);*/ return BAD; } return GOOD; } /* Rip_BSIFutureComposer */ void Rip_BSIFutureComposer ( void ) { /* get whole sample size */ PW_WholeSampleSize = 0; for ( PW_j=0 ; PW_j<63 ; PW_j++ ) { PW_o =((in_data[PW_Start_Address+17420+(PW_j*16)]*256*256*256)+ (in_data[PW_Start_Address+17421+(PW_j*16)]*256*256)+ (in_data[PW_Start_Address+17422+(PW_j*16)]*256)+ in_data[PW_Start_Address+17423+(PW_j*16)] ); PW_WholeSampleSize += PW_o; } OutputSize = PW_WholeSampleSize + 18428; CONVERT = BAD; Save_Rip ( "BSI Future Composer module", BSIFC ); if ( Save_Status == GOOD ) PW_i += (OutputSize - 2); /* 0 should do but call it "just to be sure" :) */ }
{ "pile_set_name": "Github" }
/* * @BEGIN LICENSE * * Psi4: an open-source quantum chemistry software package * * Copyright (c) 2007-2019 The Psi4 Developers. * * The copyrights for code used from other parties are included in * the corresponding files. * * This file is part of Psi4. * * Psi4 is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, version 3. * * Psi4 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along * with Psi4; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * @END LICENSE */ /*! ** \file ** \brief Zero arrays or matrices of doubles ** \ingroup CIOMR */ #include <cstring> namespace psi { /*! ** zero_arr(): zero out an array of length 'size' ** ** \param a = array to zero out ** \param size = how many elements of a to zero ** ** Returns: none ** ** \ingroup CIOMR */ void zero_arr(double *a, int size) { memset(a, 0, sizeof(double) * size); } /*! ** zero_mat(): zero out a matrix 'a' with n rows and m columns ** ** \param a = matrix of doubles to zero out ** \param n = number of rows in a ** \param m = number of columns in a ** ** \ingroup CIOMR */ void zero_mat(double **a, int n, int m) { int i; for (i = 0; i < n; i++) { memset(a[i], 0, sizeof(double) * m); } } }
{ "pile_set_name": "Github" }
/** ****************************************************************************** * @file usbh_ctlreq.c * @author MCD Application Team * @brief This file implements the control requests for device enumeration ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2015 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under Ultimate Liberty license * SLA0044, the "License"; You may not use this file except in compliance with * the License. You may obtain a copy of the License at: * www.st.com/SLA0044 * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "usbh_ctlreq.h" /** @addtogroup USBH_LIB * @{ */ /** @addtogroup USBH_LIB_CORE * @{ */ /** @defgroup USBH_CTLREQ * @brief This file implements the standard requests for device enumeration * @{ */ /** @defgroup USBH_CTLREQ_Private_Defines * @{ */ /** * @} */ /** @defgroup USBH_CTLREQ_Private_TypesDefinitions * @{ */ /** * @} */ /** @defgroup USBH_CTLREQ_Private_Macros * @{ */ /** * @} */ /** @defgroup USBH_CTLREQ_Private_Variables * @{ */ /** * @} */ /** @defgroup USBH_CTLREQ_Private_FunctionPrototypes * @{ */ static USBH_StatusTypeDef USBH_HandleControl(USBH_HandleTypeDef *phost); static void USBH_ParseDevDesc(USBH_DevDescTypeDef *dev_desc, uint8_t *buf, uint16_t length); static void USBH_ParseCfgDesc(USBH_CfgDescTypeDef *cfg_desc, uint8_t *buf, uint16_t length); static void USBH_ParseEPDesc(USBH_EpDescTypeDef *ep_descriptor, uint8_t *buf); static void USBH_ParseStringDesc(uint8_t *psrc, uint8_t *pdest, uint16_t length); static void USBH_ParseInterfaceDesc(USBH_InterfaceDescTypeDef *if_descriptor, uint8_t *buf); /** * @} */ /** @defgroup USBH_CTLREQ_Private_Functions * @{ */ /** * @brief USBH_Get_DevDesc * Issue Get Device Descriptor command to the device. Once the response * received, it parses the device descriptor and updates the status. * @param phost: Host Handle * @param length: Length of the descriptor * @retval USBH Status */ USBH_StatusTypeDef USBH_Get_DevDesc(USBH_HandleTypeDef *phost, uint8_t length) { USBH_StatusTypeDef status; if ((status = USBH_GetDescriptor(phost, USB_REQ_RECIPIENT_DEVICE | USB_REQ_TYPE_STANDARD, USB_DESC_DEVICE, phost->device.Data, (uint16_t)length)) == USBH_OK) { /* Commands successfully sent and Response Received */ USBH_ParseDevDesc(&phost->device.DevDesc, phost->device.Data, (uint16_t)length); } return status; } /** * @brief USBH_Get_CfgDesc * Issues Configuration Descriptor to the device. Once the response * received, it parses the configuration descriptor and updates the * status. * @param phost: Host Handle * @param length: Length of the descriptor * @retval USBH Status */ USBH_StatusTypeDef USBH_Get_CfgDesc(USBH_HandleTypeDef *phost, uint16_t length) { USBH_StatusTypeDef status; uint8_t *pData = phost->device.CfgDesc_Raw;; if ((status = USBH_GetDescriptor(phost, (USB_REQ_RECIPIENT_DEVICE | USB_REQ_TYPE_STANDARD), USB_DESC_CONFIGURATION, pData, length)) == USBH_OK) { /* Commands successfully sent and Response Received */ USBH_ParseCfgDesc(&phost->device.CfgDesc, pData, length); } return status; } /** * @brief USBH_Get_StringDesc * Issues string Descriptor command to the device. Once the response * received, it parses the string descriptor and updates the status. * @param phost: Host Handle * @param string_index: String index for the descriptor * @param buff: Buffer address for the descriptor * @param length: Length of the descriptor * @retval USBH Status */ USBH_StatusTypeDef USBH_Get_StringDesc(USBH_HandleTypeDef *phost, uint8_t string_index, uint8_t *buff, uint16_t length) { USBH_StatusTypeDef status; if ((status = USBH_GetDescriptor(phost, USB_REQ_RECIPIENT_DEVICE | USB_REQ_TYPE_STANDARD, USB_DESC_STRING | string_index, phost->device.Data, length)) == USBH_OK) { /* Commands successfully sent and Response Received */ USBH_ParseStringDesc(phost->device.Data, buff, length); } return status; } /** * @brief USBH_GetDescriptor * Issues Descriptor command to the device. Once the response received, * it parses the descriptor and updates the status. * @param phost: Host Handle * @param req_type: Descriptor type * @param value_idx: Value for the GetDescriptr request * @param buff: Buffer to store the descriptor * @param length: Length of the descriptor * @retval USBH Status */ USBH_StatusTypeDef USBH_GetDescriptor(USBH_HandleTypeDef *phost, uint8_t req_type, uint16_t value_idx, uint8_t *buff, uint16_t length) { if (phost->RequestState == CMD_SEND) { phost->Control.setup.b.bmRequestType = USB_D2H | req_type; phost->Control.setup.b.bRequest = USB_REQ_GET_DESCRIPTOR; phost->Control.setup.b.wValue.w = value_idx; if ((value_idx & 0xff00U) == USB_DESC_STRING) { phost->Control.setup.b.wIndex.w = 0x0409U; } else { phost->Control.setup.b.wIndex.w = 0U; } phost->Control.setup.b.wLength.w = length; } return USBH_CtlReq(phost, buff, length); } /** * @brief USBH_SetAddress * This command sets the address to the connected device * @param phost: Host Handle * @param DeviceAddress: Device address to assign * @retval USBH Status */ USBH_StatusTypeDef USBH_SetAddress(USBH_HandleTypeDef *phost, uint8_t DeviceAddress) { if (phost->RequestState == CMD_SEND) { phost->Control.setup.b.bmRequestType = USB_H2D | USB_REQ_RECIPIENT_DEVICE | \ USB_REQ_TYPE_STANDARD; phost->Control.setup.b.bRequest = USB_REQ_SET_ADDRESS; phost->Control.setup.b.wValue.w = (uint16_t)DeviceAddress; phost->Control.setup.b.wIndex.w = 0U; phost->Control.setup.b.wLength.w = 0U; } return USBH_CtlReq(phost, 0U, 0U); } /** * @brief USBH_SetCfg * The command sets the configuration value to the connected device * @param phost: Host Handle * @param cfg_idx: Configuration value * @retval USBH Status */ USBH_StatusTypeDef USBH_SetCfg(USBH_HandleTypeDef *phost, uint16_t cfg_idx) { if (phost->RequestState == CMD_SEND) { phost->Control.setup.b.bmRequestType = USB_H2D | USB_REQ_RECIPIENT_DEVICE | USB_REQ_TYPE_STANDARD; phost->Control.setup.b.bRequest = USB_REQ_SET_CONFIGURATION; phost->Control.setup.b.wValue.w = cfg_idx; phost->Control.setup.b.wIndex.w = 0U; phost->Control.setup.b.wLength.w = 0U; } return USBH_CtlReq(phost, 0U, 0U); } /** * @brief USBH_SetInterface * The command sets the Interface value to the connected device * @param phost: Host Handle * @param altSetting: Interface value * @retval USBH Status */ USBH_StatusTypeDef USBH_SetInterface(USBH_HandleTypeDef *phost, uint8_t ep_num, uint8_t altSetting) { if (phost->RequestState == CMD_SEND) { phost->Control.setup.b.bmRequestType = USB_H2D | USB_REQ_RECIPIENT_INTERFACE | USB_REQ_TYPE_STANDARD; phost->Control.setup.b.bRequest = USB_REQ_SET_INTERFACE; phost->Control.setup.b.wValue.w = altSetting; phost->Control.setup.b.wIndex.w = ep_num; phost->Control.setup.b.wLength.w = 0U; } return USBH_CtlReq(phost, 0U, 0U); } /** * @brief USBH_SetFeature * The command sets the device features (remote wakeup feature,..) * @param pdev: Selected device * @param itf_idx * @retval Status */ USBH_StatusTypeDef USBH_SetFeature(USBH_HandleTypeDef *phost, uint8_t wValue) { if (phost->RequestState == CMD_SEND) { phost->Control.setup.b.bmRequestType = USB_H2D | USB_REQ_RECIPIENT_DEVICE | USB_REQ_TYPE_STANDARD; phost->Control.setup.b.bRequest = USB_REQ_SET_FEATURE; phost->Control.setup.b.wValue.w = wValue; phost->Control.setup.b.wIndex.w = 0U; phost->Control.setup.b.wLength.w = 0U; } return USBH_CtlReq(phost, 0U, 0U); } /** * @brief USBH_ClrFeature * This request is used to clear or disable a specific feature. * @param phost: Host Handle * @param ep_num: endpoint number * @param hc_num: Host channel number * @retval USBH Status */ USBH_StatusTypeDef USBH_ClrFeature(USBH_HandleTypeDef *phost, uint8_t ep_num) { if (phost->RequestState == CMD_SEND) { phost->Control.setup.b.bmRequestType = USB_H2D | USB_REQ_RECIPIENT_ENDPOINT | USB_REQ_TYPE_STANDARD; phost->Control.setup.b.bRequest = USB_REQ_CLEAR_FEATURE; phost->Control.setup.b.wValue.w = FEATURE_SELECTOR_ENDPOINT; phost->Control.setup.b.wIndex.w = ep_num; phost->Control.setup.b.wLength.w = 0U; } return USBH_CtlReq(phost, 0U, 0U); } /** * @brief USBH_ParseDevDesc * This function Parses the device descriptor * @param dev_desc: device_descriptor destination address * @param buf: Buffer where the source descriptor is available * @param length: Length of the descriptor * @retval None */ static void USBH_ParseDevDesc(USBH_DevDescTypeDef *dev_desc, uint8_t *buf, uint16_t length) { dev_desc->bLength = *(uint8_t *)(buf + 0); dev_desc->bDescriptorType = *(uint8_t *)(buf + 1); dev_desc->bcdUSB = LE16(buf + 2); dev_desc->bDeviceClass = *(uint8_t *)(buf + 4); dev_desc->bDeviceSubClass = *(uint8_t *)(buf + 5); dev_desc->bDeviceProtocol = *(uint8_t *)(buf + 6); dev_desc->bMaxPacketSize = *(uint8_t *)(buf + 7); if (length > 8U) { /* For 1st time after device connection, Host may issue only 8 bytes for Device Descriptor Length */ dev_desc->idVendor = LE16(buf + 8); dev_desc->idProduct = LE16(buf + 10); dev_desc->bcdDevice = LE16(buf + 12); dev_desc->iManufacturer = *(uint8_t *)(buf + 14); dev_desc->iProduct = *(uint8_t *)(buf + 15); dev_desc->iSerialNumber = *(uint8_t *)(buf + 16); dev_desc->bNumConfigurations = *(uint8_t *)(buf + 17); } } /** * @brief USBH_ParseCfgDesc * This function Parses the configuration descriptor * @param cfg_desc: Configuration Descriptor address * @param buf: Buffer where the source descriptor is available * @param length: Length of the descriptor * @retval None */ static void USBH_ParseCfgDesc(USBH_CfgDescTypeDef *cfg_desc, uint8_t *buf, uint16_t length) { USBH_InterfaceDescTypeDef *pif ; USBH_EpDescTypeDef *pep; USBH_DescHeader_t *pdesc = (USBH_DescHeader_t *)(void *)buf; uint16_t ptr; uint8_t if_ix = 0U; uint8_t ep_ix = 0U; pdesc = (USBH_DescHeader_t *)(void *)buf; /* Parse configuration descriptor */ cfg_desc->bLength = *(uint8_t *)(buf + 0); cfg_desc->bDescriptorType = *(uint8_t *)(buf + 1); cfg_desc->wTotalLength = LE16(buf + 2); cfg_desc->bNumInterfaces = *(uint8_t *)(buf + 4); cfg_desc->bConfigurationValue = *(uint8_t *)(buf + 5); cfg_desc->iConfiguration = *(uint8_t *)(buf + 6); cfg_desc->bmAttributes = *(uint8_t *)(buf + 7); cfg_desc->bMaxPower = *(uint8_t *)(buf + 8); if (length > USB_CONFIGURATION_DESC_SIZE) { ptr = USB_LEN_CFG_DESC; pif = (USBH_InterfaceDescTypeDef *)0; while ((if_ix < USBH_MAX_NUM_INTERFACES) && (ptr < cfg_desc->wTotalLength)) { pdesc = USBH_GetNextDesc((uint8_t *)(void *)pdesc, &ptr); if (pdesc->bDescriptorType == USB_DESC_TYPE_INTERFACE) { pif = &cfg_desc->Itf_Desc[if_ix]; USBH_ParseInterfaceDesc(pif, (uint8_t *)(void *)pdesc); ep_ix = 0U; pep = (USBH_EpDescTypeDef *)0; while ((ep_ix < pif->bNumEndpoints) && (ptr < cfg_desc->wTotalLength)) { pdesc = USBH_GetNextDesc((uint8_t *)(void *)pdesc, &ptr); if (pdesc->bDescriptorType == USB_DESC_TYPE_ENDPOINT) { pep = &cfg_desc->Itf_Desc[if_ix].Ep_Desc[ep_ix]; USBH_ParseEPDesc(pep, (uint8_t *)(void *)pdesc); ep_ix++; } } if_ix++; } } } } /** * @brief USBH_ParseInterfaceDesc * This function Parses the interface descriptor * @param if_descriptor : Interface descriptor destination * @param buf: Buffer where the descriptor data is available * @retval None */ static void USBH_ParseInterfaceDesc(USBH_InterfaceDescTypeDef *if_descriptor, uint8_t *buf) { if_descriptor->bLength = *(uint8_t *)(buf + 0); if_descriptor->bDescriptorType = *(uint8_t *)(buf + 1); if_descriptor->bInterfaceNumber = *(uint8_t *)(buf + 2); if_descriptor->bAlternateSetting = *(uint8_t *)(buf + 3); if_descriptor->bNumEndpoints = *(uint8_t *)(buf + 4); if_descriptor->bInterfaceClass = *(uint8_t *)(buf + 5); if_descriptor->bInterfaceSubClass = *(uint8_t *)(buf + 6); if_descriptor->bInterfaceProtocol = *(uint8_t *)(buf + 7); if_descriptor->iInterface = *(uint8_t *)(buf + 8); } /** * @brief USBH_ParseEPDesc * This function Parses the endpoint descriptor * @param ep_descriptor: Endpoint descriptor destination address * @param buf: Buffer where the parsed descriptor stored * @retval None */ static void USBH_ParseEPDesc(USBH_EpDescTypeDef *ep_descriptor, uint8_t *buf) { ep_descriptor->bLength = *(uint8_t *)(buf + 0); ep_descriptor->bDescriptorType = *(uint8_t *)(buf + 1); ep_descriptor->bEndpointAddress = *(uint8_t *)(buf + 2); ep_descriptor->bmAttributes = *(uint8_t *)(buf + 3); ep_descriptor->wMaxPacketSize = LE16(buf + 4); ep_descriptor->bInterval = *(uint8_t *)(buf + 6); } /** * @brief USBH_ParseStringDesc * This function Parses the string descriptor * @param psrc: Source pointer containing the descriptor data * @param pdest: Destination address pointer * @param length: Length of the descriptor * @retval None */ static void USBH_ParseStringDesc(uint8_t *psrc, uint8_t *pdest, uint16_t length) { uint16_t strlength; uint16_t idx; /* The UNICODE string descriptor is not NULL-terminated. The string length is computed by substracting two from the value of the first byte of the descriptor. */ /* Check which is lower size, the Size of string or the length of bytes read from the device */ if (psrc[1] == USB_DESC_TYPE_STRING) { /* Make sure the Descriptor is String Type */ /* psrc[0] contains Size of Descriptor, subtract 2 to get the length of string */ strlength = ((((uint16_t)psrc[0] - 2U) <= length) ? ((uint16_t)psrc[0] - 2U) : length); /* Adjust the offset ignoring the String Len and Descriptor type */ psrc += 2U; for (idx = 0U; idx < strlength; idx += 2U) { /* Copy Only the string and ignore the UNICODE ID, hence add the src */ *pdest = psrc[idx]; pdest++; } *pdest = 0U; /* mark end of string */ } } /** * @brief USBH_GetNextDesc * This function return the next descriptor header * @param buf: Buffer where the cfg descriptor is available * @param ptr: data pointer inside the cfg descriptor * @retval next header */ USBH_DescHeader_t *USBH_GetNextDesc(uint8_t *pbuf, uint16_t *ptr) { USBH_DescHeader_t *pnext; *ptr += ((USBH_DescHeader_t *)(void *)pbuf)->bLength; pnext = (USBH_DescHeader_t *)(void *)((uint8_t *)(void *)pbuf + \ ((USBH_DescHeader_t *)(void *)pbuf)->bLength); return (pnext); } /** * @brief USBH_CtlReq * USBH_CtlReq sends a control request and provide the status after * completion of the request * @param phost: Host Handle * @param req: Setup Request Structure * @param buff: data buffer address to store the response * @param length: length of the response * @retval USBH Status */ USBH_StatusTypeDef USBH_CtlReq(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length) { USBH_StatusTypeDef status; status = USBH_BUSY; switch (phost->RequestState) { case CMD_SEND: /* Start a SETUP transfer */ phost->Control.buff = buff; phost->Control.length = length; phost->Control.state = CTRL_SETUP; phost->RequestState = CMD_WAIT; status = USBH_BUSY; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif break; case CMD_WAIT: status = USBH_HandleControl(phost); if ((status == USBH_OK) || (status == USBH_NOT_SUPPORTED)) { /* Transaction completed, move control state to idle */ phost->RequestState = CMD_SEND; phost->Control.state = CTRL_IDLE; } else if (status == USBH_FAIL) { /* Failure Mode */ phost->RequestState = CMD_SEND; } else { /* .. */ } #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif break; default: break; } return status; } /** * @brief USBH_HandleControl * Handles the USB control transfer state machine * @param phost: Host Handle * @retval USBH Status */ static USBH_StatusTypeDef USBH_HandleControl(USBH_HandleTypeDef *phost) { uint8_t direction; USBH_StatusTypeDef status = USBH_BUSY; USBH_URBStateTypeDef URB_Status = USBH_URB_IDLE; switch (phost->Control.state) { case CTRL_SETUP: /* send a SETUP packet */ USBH_CtlSendSetup(phost, (uint8_t *)(void *)phost->Control.setup.d8, phost->Control.pipe_out); phost->Control.state = CTRL_SETUP_WAIT; break; case CTRL_SETUP_WAIT: URB_Status = USBH_LL_GetURBState(phost, phost->Control.pipe_out); /* case SETUP packet sent successfully */ if (URB_Status == USBH_URB_DONE) { direction = (phost->Control.setup.b.bmRequestType & USB_REQ_DIR_MASK); /* check if there is a data stage */ if (phost->Control.setup.b.wLength.w != 0U) { if (direction == USB_D2H) { /* Data Direction is IN */ phost->Control.state = CTRL_DATA_IN; } else { /* Data Direction is OUT */ phost->Control.state = CTRL_DATA_OUT; } } /* No DATA stage */ else { /* If there is No Data Transfer Stage */ if (direction == USB_D2H) { /* Data Direction is IN */ phost->Control.state = CTRL_STATUS_OUT; } else { /* Data Direction is OUT */ phost->Control.state = CTRL_STATUS_IN; } } #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } else { if ((URB_Status == USBH_URB_ERROR) || (URB_Status == USBH_URB_NOTREADY)) { phost->Control.state = CTRL_ERROR; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } } break; case CTRL_DATA_IN: /* Issue an IN token */ phost->Control.timer = (uint16_t)phost->Timer; USBH_CtlReceiveData(phost, phost->Control.buff, phost->Control.length, phost->Control.pipe_in); phost->Control.state = CTRL_DATA_IN_WAIT; break; case CTRL_DATA_IN_WAIT: URB_Status = USBH_LL_GetURBState(phost, phost->Control.pipe_in); /* check is DATA packet transferred successfully */ if (URB_Status == USBH_URB_DONE) { phost->Control.state = CTRL_STATUS_OUT; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } /* manage error cases*/ if (URB_Status == USBH_URB_STALL) { /* In stall case, return to previous machine state*/ status = USBH_NOT_SUPPORTED; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } else { if (URB_Status == USBH_URB_ERROR) { /* Device error */ phost->Control.state = CTRL_ERROR; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } } break; case CTRL_DATA_OUT: USBH_CtlSendData(phost, phost->Control.buff, phost->Control.length, phost->Control.pipe_out, 1U); phost->Control.timer = (uint16_t)phost->Timer; phost->Control.state = CTRL_DATA_OUT_WAIT; break; case CTRL_DATA_OUT_WAIT: URB_Status = USBH_LL_GetURBState(phost, phost->Control.pipe_out); if (URB_Status == USBH_URB_DONE) { /* If the Setup Pkt is sent successful, then change the state */ phost->Control.state = CTRL_STATUS_IN; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } /* handle error cases */ else if (URB_Status == USBH_URB_STALL) { /* In stall case, return to previous machine state*/ phost->Control.state = CTRL_STALLED; status = USBH_NOT_SUPPORTED; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } else if (URB_Status == USBH_URB_NOTREADY) { /* Nack received from device */ phost->Control.state = CTRL_DATA_OUT; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } else { if (URB_Status == USBH_URB_ERROR) { /* device error */ phost->Control.state = CTRL_ERROR; status = USBH_FAIL; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } } break; case CTRL_STATUS_IN: /* Send 0 bytes out packet */ USBH_CtlReceiveData(phost, 0U, 0U, phost->Control.pipe_in); phost->Control.timer = (uint16_t)phost->Timer; phost->Control.state = CTRL_STATUS_IN_WAIT; break; case CTRL_STATUS_IN_WAIT: URB_Status = USBH_LL_GetURBState(phost, phost->Control.pipe_in); if (URB_Status == USBH_URB_DONE) { /* Control transfers completed, Exit the State Machine */ phost->Control.state = CTRL_COMPLETE; status = USBH_OK; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } else if (URB_Status == USBH_URB_ERROR) { phost->Control.state = CTRL_ERROR; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } else { if (URB_Status == USBH_URB_STALL) { /* Control transfers completed, Exit the State Machine */ status = USBH_NOT_SUPPORTED; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } } break; case CTRL_STATUS_OUT: USBH_CtlSendData(phost, 0U, 0U, phost->Control.pipe_out, 1U); phost->Control.timer = (uint16_t)phost->Timer; phost->Control.state = CTRL_STATUS_OUT_WAIT; break; case CTRL_STATUS_OUT_WAIT: URB_Status = USBH_LL_GetURBState(phost, phost->Control.pipe_out); if (URB_Status == USBH_URB_DONE) { status = USBH_OK; phost->Control.state = CTRL_COMPLETE; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } else if (URB_Status == USBH_URB_NOTREADY) { phost->Control.state = CTRL_STATUS_OUT; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } else { if (URB_Status == USBH_URB_ERROR) { phost->Control.state = CTRL_ERROR; #if (USBH_USE_OS == 1U) phost->os_msg = (uint32_t)USBH_CONTROL_EVENT; #if (osCMSIS < 0x20000U) (void)osMessagePut(phost->os_event, phost->os_msg, 0U); #else (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); #endif #endif } } break; case CTRL_ERROR: /* After a halt condition is encountered or an error is detected by the host, a control endpoint is allowed to recover by accepting the next Setup PID; i.e., recovery actions via some other pipe are not required for control endpoints. For the Default Control Pipe, a device reset will ultimately be required to clear the halt or error condition if the next Setup PID is not accepted. */ if (++phost->Control.errorcount <= USBH_MAX_ERROR_COUNT) { /* Do the transmission again, starting from SETUP Packet */ phost->Control.state = CTRL_SETUP; phost->RequestState = CMD_SEND; } else { phost->pUser(phost, HOST_USER_UNRECOVERED_ERROR); phost->Control.errorcount = 0U; USBH_ErrLog("Control error: Device not responding"); /* Free control pipes */ USBH_FreePipe(phost, phost->Control.pipe_out); USBH_FreePipe(phost, phost->Control.pipe_in); phost->gState = HOST_IDLE; status = USBH_FAIL; } break; default: break; } return status; } /** * @} */ /** * @} */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
{ "pile_set_name": "Github" }
package service import ( "context" "github.com/rancher/rio/modules/gloo/pkg/vsfactory" riov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" rioadminv1controller "github.com/rancher/rio/pkg/generated/controllers/admin.rio.cattle.io/v1" riov1controller "github.com/rancher/rio/pkg/generated/controllers/rio.cattle.io/v1" "github.com/rancher/rio/types" "k8s.io/apimachinery/pkg/runtime" ) func Register(ctx context.Context, rContext *types.Context) error { h := &handler{ systemNamespace: rContext.Namespace, clusterDomainCache: rContext.Admin.Admin().V1().ClusterDomain().Cache(), vsFactory: vsfactory.New(rContext), } riov1controller.RegisterServiceGeneratingHandler(ctx, rContext.Rio.Rio().V1().Service(), rContext.Apply.WithCacheTypes( rContext.Gateway.Gateway().V1().VirtualService(), ), "", "gloo-service", h.generate, nil) return nil } type handler struct { systemNamespace string clusterDomainCache rioadminv1controller.ClusterDomainCache vsFactory *vsfactory.VirtualServiceFactory } func (h *handler) generate(obj *riov1.Service, status riov1.ServiceStatus) ([]runtime.Object, riov1.ServiceStatus, error) { if obj.Spec.Template { return nil, status, nil } vss, err := h.vsFactory.ForRevision(obj) if err != nil { return nil, status, err } var result []runtime.Object for _, vs := range vss { result = append(result, vs) } return result, status, nil }
{ "pile_set_name": "Github" }
define(function (require) { var PointerPath = require('./PointerPath'); var graphic = require('../../util/graphic'); var numberUtil = require('../../util/number'); var parsePercent = numberUtil.parsePercent; function parsePosition(seriesModel, api) { var center = seriesModel.get('center'); var width = api.getWidth(); var height = api.getHeight(); var size = Math.min(width, height); var cx = parsePercent(center[0], api.getWidth()); var cy = parsePercent(center[1], api.getHeight()); var r = parsePercent(seriesModel.get('radius'), size / 2); return { cx: cx, cy: cy, r: r }; } function formatLabel(label, labelFormatter) { if (labelFormatter) { if (typeof labelFormatter === 'string') { label = labelFormatter.replace('{value}', label); } else if (typeof labelFormatter === 'function') { label = labelFormatter(label); } } return label; } var PI2 = Math.PI * 2; var GaugeView = require('../../view/Chart').extend({ type: 'gauge', render: function (seriesModel, ecModel, api) { this.group.removeAll(); var colorList = seriesModel.get('axisLine.lineStyle.color'); var posInfo = parsePosition(seriesModel, api); this._renderMain( seriesModel, ecModel, api, colorList, posInfo ); }, _renderMain: function (seriesModel, ecModel, api, colorList, posInfo) { var group = this.group; var axisLineModel = seriesModel.getModel('axisLine'); var lineStyleModel = axisLineModel.getModel('lineStyle'); var clockwise = seriesModel.get('clockwise'); var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI; var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI; var angleRangeSpan = (endAngle - startAngle) % PI2; var prevEndAngle = startAngle; var axisLineWidth = lineStyleModel.get('width'); for (var i = 0; i < colorList.length; i++) { // Clamp var percent = Math.min(Math.max(colorList[i][0], 0), 1); var endAngle = startAngle + angleRangeSpan * percent; var sector = new graphic.Sector({ shape: { startAngle: prevEndAngle, endAngle: endAngle, cx: posInfo.cx, cy: posInfo.cy, clockwise: clockwise, r0: posInfo.r - axisLineWidth, r: posInfo.r }, silent: true }); sector.setStyle({ fill: colorList[i][1] }); sector.setStyle(lineStyleModel.getLineStyle( // Because we use sector to simulate arc // so the properties for stroking are useless ['color', 'borderWidth', 'borderColor'] )); group.add(sector); prevEndAngle = endAngle; } var getColor = function (percent) { // Less than 0 if (percent <= 0) { return colorList[0][1]; } for (var i = 0; i < colorList.length; i++) { if (colorList[i][0] >= percent && (i === 0 ? 0 : colorList[i - 1][0]) < percent ) { return colorList[i][1]; } } // More than 1 return colorList[i - 1][1]; }; if (!clockwise) { var tmp = startAngle; startAngle = endAngle; endAngle = tmp; } this._renderTicks( seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise ); this._renderPointer( seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise ); this._renderTitle( seriesModel, ecModel, api, getColor, posInfo ); this._renderDetail( seriesModel, ecModel, api, getColor, posInfo ); }, _renderTicks: function ( seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise ) { var group = this.group; var cx = posInfo.cx; var cy = posInfo.cy; var r = posInfo.r; var minVal = seriesModel.get('min'); var maxVal = seriesModel.get('max'); var splitLineModel = seriesModel.getModel('splitLine'); var tickModel = seriesModel.getModel('axisTick'); var labelModel = seriesModel.getModel('axisLabel'); var splitNumber = seriesModel.get('splitNumber'); var subSplitNumber = tickModel.get('splitNumber'); var splitLineLen = parsePercent( splitLineModel.get('length'), r ); var tickLen = parsePercent( tickModel.get('length'), r ); var angle = startAngle; var step = (endAngle - startAngle) / splitNumber; var subStep = step / subSplitNumber; var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle(); var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle(); var textStyleModel = labelModel.getModel('textStyle'); for (var i = 0; i <= splitNumber; i++) { var unitX = Math.cos(angle); var unitY = Math.sin(angle); // Split line if (splitLineModel.get('show')) { var splitLine = new graphic.Line({ shape: { x1: unitX * r + cx, y1: unitY * r + cy, x2: unitX * (r - splitLineLen) + cx, y2: unitY * (r - splitLineLen) + cy }, style: splitLineStyle, silent: true }); if (splitLineStyle.stroke === 'auto') { splitLine.setStyle({ stroke: getColor(i / splitNumber) }); } group.add(splitLine); } // Label if (labelModel.get('show')) { var label = formatLabel( numberUtil.round(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter') ); var text = new graphic.Text({ style: { text: label, x: unitX * (r - splitLineLen - 5) + cx, y: unitY * (r - splitLineLen - 5) + cy, fill: textStyleModel.getTextColor(), textFont: textStyleModel.getFont(), textVerticalAlign: unitY < -0.4 ? 'top' : (unitY > 0.4 ? 'bottom' : 'middle'), textAlign: unitX < -0.4 ? 'left' : (unitX > 0.4 ? 'right' : 'center') }, silent: true }); if (text.style.fill === 'auto') { text.setStyle({ fill: getColor(i / splitNumber) }); } group.add(text); } // Axis tick if (tickModel.get('show') && i !== splitNumber) { for (var j = 0; j <= subSplitNumber; j++) { var unitX = Math.cos(angle); var unitY = Math.sin(angle); var tickLine = new graphic.Line({ shape: { x1: unitX * r + cx, y1: unitY * r + cy, x2: unitX * (r - tickLen) + cx, y2: unitY * (r - tickLen) + cy }, silent: true, style: tickLineStyle }); if (tickLineStyle.stroke === 'auto') { tickLine.setStyle({ stroke: getColor((i + j / subSplitNumber) / splitNumber) }); } group.add(tickLine); angle += subStep; } angle -= subStep; } else { angle += step; } } }, _renderPointer: function ( seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise ) { var valueExtent = [+seriesModel.get('min'), +seriesModel.get('max')]; var angleExtent = [startAngle, endAngle]; if (!clockwise) { angleExtent = angleExtent.reverse(); } var data = seriesModel.getData(); var oldData = this._data; var group = this.group; data.diff(oldData) .add(function (idx) { var pointer = new PointerPath({ shape: { angle: startAngle } }); graphic.updateProps(pointer, { shape: { angle: numberUtil.linearMap(data.get('value', idx), valueExtent, angleExtent, true) } }, seriesModel); group.add(pointer); data.setItemGraphicEl(idx, pointer); }) .update(function (newIdx, oldIdx) { var pointer = oldData.getItemGraphicEl(oldIdx); graphic.updateProps(pointer, { shape: { angle: numberUtil.linearMap(data.get('value', newIdx), valueExtent, angleExtent, true) } }, seriesModel); group.add(pointer); data.setItemGraphicEl(newIdx, pointer); }) .remove(function (idx) { var pointer = oldData.getItemGraphicEl(idx); group.remove(pointer); }) .execute(); data.eachItemGraphicEl(function (pointer, idx) { var itemModel = data.getItemModel(idx); var pointerModel = itemModel.getModel('pointer'); pointer.setShape({ x: posInfo.cx, y: posInfo.cy, width: parsePercent( pointerModel.get('width'), posInfo.r ), r: parsePercent(pointerModel.get('length'), posInfo.r) }); pointer.useStyle(itemModel.getModel('itemStyle.normal').getItemStyle()); if (pointer.style.fill === 'auto') { pointer.setStyle('fill', getColor( (data.get('value', idx) - valueExtent[0]) / (valueExtent[1] - valueExtent[0]) )); } graphic.setHoverStyle( pointer, itemModel.getModel('itemStyle.emphasis').getItemStyle() ); }); this._data = data; }, _renderTitle: function ( seriesModel, ecModel, api, getColor, posInfo ) { var titleModel = seriesModel.getModel('title'); if (titleModel.get('show')) { var textStyleModel = titleModel.getModel('textStyle'); var offsetCenter = titleModel.get('offsetCenter'); var x = posInfo.cx + parsePercent(offsetCenter[0], posInfo.r); var y = posInfo.cy + parsePercent(offsetCenter[1], posInfo.r); var text = new graphic.Text({ style: { x: x, y: y, // FIXME First data name ? text: seriesModel.getData().getName(0), fill: textStyleModel.getTextColor(), textFont: textStyleModel.getFont(), textAlign: 'center', textVerticalAlign: 'middle' } }); this.group.add(text); } }, _renderDetail: function ( seriesModel, ecModel, api, getColor, posInfo ) { var detailModel = seriesModel.getModel('detail'); var minVal = seriesModel.get('min'); var maxVal = seriesModel.get('max'); if (detailModel.get('show')) { var textStyleModel = detailModel.getModel('textStyle'); var offsetCenter = detailModel.get('offsetCenter'); var x = posInfo.cx + parsePercent(offsetCenter[0], posInfo.r); var y = posInfo.cy + parsePercent(offsetCenter[1], posInfo.r); var width = parsePercent(detailModel.get('width'), posInfo.r); var height = parsePercent(detailModel.get('height'), posInfo.r); var value = seriesModel.getData().get('value', 0); var rect = new graphic.Rect({ shape: { x: x - width / 2, y: y - height / 2, width: width, height: height }, style: { text: formatLabel( // FIXME First data name ? value, detailModel.get('formatter') ), fill: detailModel.get('backgroundColor'), textFill: textStyleModel.getTextColor(), textFont: textStyleModel.getFont() } }); if (rect.style.textFill === 'auto') { rect.setStyle('textFill', getColor( numberUtil.linearMap(value, [minVal, maxVal], [0, 1], true) )); } rect.setStyle(detailModel.getItemStyle(['color'])); this.group.add(rect); } } }); return GaugeView; });
{ "pile_set_name": "Github" }
# # Copyright 2007-2016, Kaazing Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Autobahn test case 7.7.1 # Case Description # Send close with valid close code 1000 # Case Expectation # Clean close with normal or echoed code connect "tcp://localhost:8555" connected write "GET /echo HTTP/1.1\r\n" write "User-Agent: AutobahnTestSuite/0.6.1-0.8.8\r\n" write "Host: localhost:8555\r\n" write "Upgrade: WebSocket\r\n" write "Connection: Upgrade\r\n" write "Pragma: no-cache\r\n" write "Cache-Control: no-cache\r\n" write "Sec-WebSocket-Key: uVq3zSlsryimgWqPZUGOGw==\r\n" write "Sec-WebSocket-Version: 13\r\n" write "\r\n" read "HTTP/1.1 101 Web Socket Protocol Handshake\r\n" read "Connection: Upgrade\r\n" read /Date: .*\r\n/ read "Sec-WebSocket-Accept: 6q4AuUKdx4mAmvRZwNHgRIv8ykI=\r\n" read "Server: Kaazing Gateway\r\n" read "Upgrade: WebSocket\r\n" read "\r\n" # Websocket close with normal closure (given close code 1000) write [0x88 0x82 0x68 0x57 0x80 0x68 0x6b 0xbf] read [0x88 0x02 0x03 0xe8] close closed
{ "pile_set_name": "Github" }
<ApplicationInsights xdt:Transform="SetAttributes" xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <ContextInitializers xdt:Transform="InsertIfMissing"> <Add xdt:Transform="InsertIfMissing" xdt:Locator="Match(Type)" Type="Microsoft.ApplicationInsights.Extensibility.ComponentContextInitializer, Microsoft.ApplicationInsights" /> <Add xdt:Transform="InsertIfMissing" xdt:Locator="Match(Type)" Type="Microsoft.ApplicationInsights.Extensibility.DeviceContextInitializer, Microsoft.ApplicationInsights" /> </ContextInitializers> <TelemetryInitializers xdt:Transform="InsertIfMissing"> <Add xdt:Transform="InsertIfMissing" xdt:Locator="Match(Type)" Type="Microsoft.ApplicationInsights.Extensibility.Windows.UserContextInitializer, Microsoft.ApplicationInsights.Extensibility.Windows" /> </TelemetryInitializers> <TelemetryModules xdt:Transform="InsertIfMissing"> <Add xdt:Transform="InsertIfMissing" xdt:Locator="Match(Type)" Type="Microsoft.ApplicationInsights.Extensibility.Windows.SessionTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Windows" /> <Add xdt:Transform="InsertIfMissing" xdt:Locator="Match(Type)" Type="Microsoft.ApplicationInsights.Extensibility.Windows.PageViewTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Windows" /> <Add xdt:Transform="InsertIfMissing" xdt:Locator="Match(Type)" Type="Microsoft.ApplicationInsights.Extensibility.Windows.UnhandledExceptionTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Windows" /> </TelemetryModules> </ApplicationInsights>
{ "pile_set_name": "Github" }
project Test is package Compiler is for Default_Switches ("ada") use ("-gnat12"); end Compiler; package Prove is for Proof_Dir use "proof/dir"; end Prove; end Test;
{ "pile_set_name": "Github" }
class PhotoTag < ActiveRecord::Base belongs_to :tag belongs_to :photo end
{ "pile_set_name": "Github" }
c----------------------------------------------------------------------- c\BeginDoc c c\Name: dsconv c c\Description: c Convergence testing for the symmetric Arnoldi eigenvalue routine. c c\Usage: c call dsconv c ( N, RITZ, BOUNDS, TOL, NCONV ) c c\Arguments c N Integer. (INPUT) c Number of Ritz values to check for convergence. c c RITZ Double precision array of length N. (INPUT) c The Ritz values to be checked for convergence. c c BOUNDS Double precision array of length N. (INPUT) c Ritz estimates associated with the Ritz values in RITZ. c c TOL Double precision scalar. (INPUT) c Desired relative accuracy for a Ritz value to be considered c "converged". c c NCONV Integer scalar. (OUTPUT) c Number of "converged" Ritz values. c c\EndDoc c c----------------------------------------------------------------------- c c\BeginLib c c\Routines called: c second ARPACK utility routine for timing. c dlamch LAPACK routine that determines machine constants. c c\Author c Danny Sorensen Phuong Vu c Richard Lehoucq CRPC / Rice University c Dept. of Computational & Houston, Texas c Applied Mathematics c Rice University c Houston, Texas c c\SCCS Information: @(#) c FILE: sconv.F SID: 2.4 DATE OF SID: 4/19/96 RELEASE: 2 c c\Remarks c 1. Starting with version 2.4, this routine no longer uses the c Parlett strategy using the gap conditions. c c\EndLib c c----------------------------------------------------------------------- c subroutine dsconv (n, ritz, bounds, tol, nconv) c c %----------------------------------------------------% c | Include files for debugging and timing information | c %----------------------------------------------------% c include 'debug.h' include 'stat.h' c c %------------------% c | Scalar Arguments | c %------------------% c integer n, nconv Double precision & tol c c %-----------------% c | Array Arguments | c %-----------------% c Double precision & ritz(n), bounds(n) c c %---------------% c | Local Scalars | c %---------------% c integer i Double precision & temp, eps23 c c %-------------------% c | External routines | c %-------------------% c Double precision & dlamch external dlamch c %---------------------% c | Intrinsic Functions | c %---------------------% c intrinsic abs c c %-----------------------% c | Executable Statements | c %-----------------------% c call second (t0) c eps23 = dlamch('Epsilon-Machine') eps23 = eps23**(2.0D+0 / 3.0D+0) c nconv = 0 do 10 i = 1, n c c %-----------------------------------------------------% c | The i-th Ritz value is considered "converged" | c | when: bounds(i) .le. TOL*max(eps23, abs(ritz(i))) | c %-----------------------------------------------------% c temp = max( eps23, abs(ritz(i)) ) if ( bounds(i) .le. tol*temp ) then nconv = nconv + 1 end if c 10 continue c call second (t1) tsconv = tsconv + (t1 - t0) c return c c %---------------% c | End of dsconv | c %---------------% c end
{ "pile_set_name": "Github" }
{ "name": "simple", "version": "0.1.0", "private": true, "dependencies": { "apollo-cache-inmemory": "1.x", "apollo-client": "2.x", "apollo-link-rest": "0.x", "graphql": "0.x", "graphql-anywhere": "4.x", "graphql-tag": "2.x", "qs": "^6.6.0", "react": "16.x", "react-apollo": "2.x", "react-dom": "16.x", "react-scripts": "1.x" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" } }
{ "pile_set_name": "Github" }
/*++ Copyright (C) Microsoft Corporation, 1991 - 1999 Module Name: classwmi.c Abstract: SCSI class driver routines Environment: kernel mode only Notes: Revision History: --*/ #include "stddef.h" #include "ntddk.h" #include "scsi.h" #include "classpnp.h" #include "mountdev.h" #include <stdarg.h> #include "classp.h" #include <wmistr.h> #include <wmidata.h> #include <classlog.h> #ifdef DEBUG_USE_WPP #include "classwmi.tmh" #endif #define TIME_STRING_LENGTH 25 BOOLEAN ClassFindGuid( PGUIDREGINFO GuidList, ULONG GuidCount, LPGUID Guid, PULONG GuidIndex ); NTSTATUS ClassQueryInternalDataBlock( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN ULONG GuidIndex, IN ULONG BufferAvail, OUT PUCHAR Buffer ); PWCHAR ConvertTickToDateTime( IN LARGE_INTEGER Tick, _Out_writes_(TIME_STRING_LENGTH) PWCHAR String ); BOOLEAN ClassFindInternalGuid( LPGUID Guid, PULONG GuidIndex ); // // This is the name for the MOF resource that must be part of all drivers that // register via this interface. #define MOFRESOURCENAME L"MofResourceName" // // What can be paged ??? #ifdef ALLOC_PRAGMA #pragma alloc_text(PAGE, ClassSystemControl) #pragma alloc_text(PAGE, ClassFindGuid) #pragma alloc_text(PAGE, ClassFindInternalGuid) #endif // // Define WMI interface to all class drivers // GUIDREGINFO wmiClassGuids[] = { { MSStorageDriver_ClassErrorLogGuid, 1, 0 } }; #define MSStorageDriver_ClassErrorLogGuid_Index 0 #define NUM_CLASS_WMI_GUIDS (sizeof(wmiClassGuids) / sizeof(GUIDREGINFO)) /*++//////////////////////////////////////////////////////////////////////////// ClassFindGuid() Routine Description: This routine will search the list of guids registered and return the index for the one that was registered. Arguments: GuidList is the list of guids to search GuidCount is the count of guids in the list Guid is the guid being searched for *GuidIndex returns the index to the guid Return Value: TRUE if guid is found else FALSE --*/ BOOLEAN ClassFindGuid( PGUIDREGINFO GuidList, ULONG GuidCount, LPGUID Guid, PULONG GuidIndex ) { ULONG i; PAGED_CODE(); for (i = 0; i < GuidCount; i++) { if (IsEqualGUID(Guid, &GuidList[i].Guid)) { *GuidIndex = i; return(TRUE); } } return(FALSE); } // end ClassFindGuid() /*++//////////////////////////////////////////////////////////////////////////// ClassFindInternalGuid() Routine Description: This routine will search the list of internal guids registered and return the index for the one that was registered. Arguments: Guid is the guid being searched for *GuidIndex returns the index to the guid Return Value: TRUE if guid is found else FALSE --*/ BOOLEAN ClassFindInternalGuid( LPGUID Guid, PULONG GuidIndex ) { ULONG i; PAGED_CODE(); for (i = 0; i < NUM_CLASS_WMI_GUIDS; i++) { if (IsEqualGUID(Guid, &wmiClassGuids[i].Guid)) { *GuidIndex = i; return(TRUE); } } return(FALSE); } // end ClassFindGuid() /*++//////////////////////////////////////////////////////////////////////////// ClassSystemControl() Routine Description: Dispatch routine for IRP_MJ_SYSTEM_CONTROL. This routine will process all wmi requests received, forwarding them if they are not for this driver or determining if the guid is valid and if so passing it to the driver specific function for handing wmi requests. Arguments: DeviceObject - Supplies a pointer to the device object for this request. Irp - Supplies the Irp making the request. Return Value: status --*/ NTSTATUS ClassSystemControl( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp ) { PCOMMON_DEVICE_EXTENSION commonExtension = DeviceObject->DeviceExtension; PCLASS_DRIVER_EXTENSION driverExtension; PIO_STACK_LOCATION irpStack = IoGetCurrentIrpStackLocation(Irp); ULONG isRemoved; ULONG bufferSize; PUCHAR buffer; NTSTATUS status; UCHAR minorFunction; ULONG guidIndex = (ULONG)-1; PCLASS_WMI_INFO classWmiInfo; BOOLEAN isInternalGuid = FALSE; PAGED_CODE(); // // Make sure device has not been removed isRemoved = ClassAcquireRemoveLock(DeviceObject, Irp); if(isRemoved) { Irp->IoStatus.Status = STATUS_DEVICE_DOES_NOT_EXIST; ClassReleaseRemoveLock(DeviceObject, Irp); ClassCompleteRequest(DeviceObject, Irp, IO_NO_INCREMENT); return STATUS_DEVICE_DOES_NOT_EXIST; } // // If the irp is not a WMI irp or it is not targetted at this device // or this device has not regstered with WMI then just forward it on. minorFunction = irpStack->MinorFunction; if ((minorFunction > IRP_MN_EXECUTE_METHOD) || (irpStack->Parameters.WMI.ProviderId != (ULONG_PTR)DeviceObject) || ((minorFunction != IRP_MN_REGINFO) && (commonExtension->GuidCount == 0))) { // // CONSIDER: Do I need to hang onto lock until IoCallDriver returns ? IoSkipCurrentIrpStackLocation(Irp); ClassReleaseRemoveLock(DeviceObject, Irp); return(IoCallDriver(commonExtension->LowerDeviceObject, Irp)); } buffer = (PUCHAR)irpStack->Parameters.WMI.Buffer; bufferSize = irpStack->Parameters.WMI.BufferSize; if (minorFunction != IRP_MN_REGINFO) { // // For all requests other than query registration info we are passed // a guid. Determine if the guid is one that is supported by the // device. if (commonExtension->GuidRegInfo != NULL && ClassFindGuid(commonExtension->GuidRegInfo, commonExtension->GuidCount, (LPGUID)irpStack->Parameters.WMI.DataPath, &guidIndex)) { isInternalGuid = FALSE; status = STATUS_SUCCESS; } else if (ClassFindInternalGuid((LPGUID)irpStack->Parameters.WMI.DataPath, &guidIndex)) { isInternalGuid = TRUE; status = STATUS_SUCCESS; } else { status = STATUS_WMI_GUID_NOT_FOUND; TracePrint((TRACE_LEVEL_WARNING, TRACE_FLAG_WMI, "WMI GUID not found!")); } TracePrint((TRACE_LEVEL_VERBOSE, TRACE_FLAG_WMI, "WMI Find Guid = %x, isInternalGuid = %x", status, isInternalGuid)); if (NT_SUCCESS(status) && ((minorFunction == IRP_MN_QUERY_SINGLE_INSTANCE) || (minorFunction == IRP_MN_CHANGE_SINGLE_INSTANCE) || (minorFunction == IRP_MN_CHANGE_SINGLE_ITEM) || (minorFunction == IRP_MN_EXECUTE_METHOD))) { if ( (((PWNODE_HEADER)buffer)->Flags) & WNODE_FLAG_STATIC_INSTANCE_NAMES) { if ( ((PWNODE_SINGLE_INSTANCE)buffer)->InstanceIndex != 0 ) { status = STATUS_WMI_INSTANCE_NOT_FOUND; } } else { status = STATUS_WMI_INSTANCE_NOT_FOUND; TracePrint((TRACE_LEVEL_WARNING, TRACE_FLAG_WMI, "WMI Instance not found!")); } } if (! NT_SUCCESS(status)) { Irp->IoStatus.Status = status; ClassReleaseRemoveLock(DeviceObject, Irp); ClassCompleteRequest(DeviceObject, Irp, IO_NO_INCREMENT); return(status); } } driverExtension = commonExtension->DriverExtension; classWmiInfo = commonExtension->IsFdo ? &driverExtension->InitData.FdoData.ClassWmiInfo : &driverExtension->InitData.PdoData.ClassWmiInfo; switch(minorFunction) { case IRP_MN_REGINFO: { ULONG guidCount; PGUIDREGINFO guidList; PWMIREGINFOW wmiRegInfo; PWMIREGGUIDW wmiRegGuid; PUNICODE_STRING regPath; PWCHAR stringPtr; ULONG retSize; ULONG registryPathOffset; ULONG mofResourceOffset; ULONG bufferNeeded; ULONG i; ULONG_PTR nameInfo; ULONG nameSize, nameOffset, nameFlags; UNICODE_STRING name, mofName; PCLASS_QUERY_WMI_REGINFO_EX ClassQueryWmiRegInfoEx; name.Buffer = NULL; name.Length = 0; name.MaximumLength = 0; nameFlags = 0; ClassQueryWmiRegInfoEx = commonExtension->IsFdo ? driverExtension->ClassFdoQueryWmiRegInfoEx : driverExtension->ClassPdoQueryWmiRegInfoEx; if ((classWmiInfo->GuidRegInfo != NULL) && (classWmiInfo->ClassQueryWmiRegInfo != NULL) && (ClassQueryWmiRegInfoEx == NULL)) { status = classWmiInfo->ClassQueryWmiRegInfo( DeviceObject, &nameFlags, &name); RtlInitUnicodeString(&mofName, MOFRESOURCENAME); } else if ((classWmiInfo->GuidRegInfo != NULL) && (ClassQueryWmiRegInfoEx != NULL)) { RtlInitUnicodeString(&mofName, L""); status = (*ClassQueryWmiRegInfoEx)( DeviceObject, &nameFlags, &name, &mofName); } else { RtlInitUnicodeString(&mofName, L""); nameFlags = WMIREG_FLAG_INSTANCE_PDO; status = STATUS_SUCCESS; } if (NT_SUCCESS(status) && (! (nameFlags & WMIREG_FLAG_INSTANCE_PDO) && (name.Buffer == NULL))) { // // if PDO flag not specified then an instance name must be status = STATUS_INVALID_DEVICE_REQUEST; TracePrint((TRACE_LEVEL_WARNING, TRACE_FLAG_WMI, "Invalid Device Request!")); } if (NT_SUCCESS(status)) { guidList = classWmiInfo->GuidRegInfo; guidCount = (classWmiInfo->GuidRegInfo == NULL ? 0 : classWmiInfo->GuidCount) + NUM_CLASS_WMI_GUIDS; nameOffset = sizeof(WMIREGINFO) + guidCount * sizeof(WMIREGGUIDW); if (nameFlags & WMIREG_FLAG_INSTANCE_PDO) { nameSize = 0; nameInfo = commonExtension->IsFdo ? (ULONG_PTR)((PFUNCTIONAL_DEVICE_EXTENSION)commonExtension)->LowerPdo : (ULONG_PTR)DeviceObject; } else { nameFlags |= WMIREG_FLAG_INSTANCE_LIST; nameSize = name.Length + sizeof(USHORT); nameInfo = nameOffset; } mofResourceOffset = nameOffset + nameSize; registryPathOffset = mofResourceOffset + mofName.Length + sizeof(USHORT); regPath = &driverExtension->RegistryPath; bufferNeeded = registryPathOffset + regPath->Length; bufferNeeded += sizeof(USHORT); if (bufferNeeded <= bufferSize) { retSize = bufferNeeded; commonExtension->GuidCount = guidCount; commonExtension->GuidRegInfo = guidList; wmiRegInfo = (PWMIREGINFO)buffer; wmiRegInfo->BufferSize = bufferNeeded; wmiRegInfo->NextWmiRegInfo = 0; wmiRegInfo->MofResourceName = mofResourceOffset; wmiRegInfo->RegistryPath = registryPathOffset; wmiRegInfo->GuidCount = guidCount; for (i = 0; i < classWmiInfo->GuidCount; i++) { wmiRegGuid = &wmiRegInfo->WmiRegGuid[i]; wmiRegGuid->Guid = guidList[i].Guid; wmiRegGuid->Flags = guidList[i].Flags | nameFlags; wmiRegGuid->InstanceInfo = nameInfo; wmiRegGuid->InstanceCount = 1; } for (i = 0; i < NUM_CLASS_WMI_GUIDS; i++) { wmiRegGuid = &wmiRegInfo->WmiRegGuid[i + classWmiInfo->GuidCount]; wmiRegGuid->Guid = wmiClassGuids[i].Guid; wmiRegGuid->Flags = wmiClassGuids[i].Flags | nameFlags; wmiRegGuid->InstanceInfo = nameInfo; wmiRegGuid->InstanceCount = 1; } if ( nameFlags & WMIREG_FLAG_INSTANCE_LIST) { bufferNeeded = nameOffset + sizeof(WCHAR); bufferNeeded += name.Length; if (bufferSize >= bufferNeeded){ stringPtr = (PWCHAR)((PUCHAR)buffer + nameOffset); *stringPtr++ = name.Length; RtlCopyMemory(stringPtr, name.Buffer, name.Length); } else { NT_ASSERT(bufferSize >= bufferNeeded); status = STATUS_INVALID_BUFFER_SIZE; } } bufferNeeded = mofResourceOffset + sizeof(WCHAR); bufferNeeded += mofName.Length; if (bufferSize >= bufferNeeded){ stringPtr = (PWCHAR)((PUCHAR)buffer + mofResourceOffset); *stringPtr++ = mofName.Length; RtlCopyMemory(stringPtr, mofName.Buffer, mofName.Length); } else { NT_ASSERT(bufferSize >= bufferNeeded); status = STATUS_INVALID_BUFFER_SIZE; } bufferNeeded = registryPathOffset + sizeof(WCHAR); bufferNeeded += regPath->Length; if (bufferSize >= bufferNeeded){ stringPtr = (PWCHAR)((PUCHAR)buffer + registryPathOffset); *stringPtr++ = regPath->Length; RtlCopyMemory(stringPtr, regPath->Buffer, regPath->Length); } else { NT_ASSERT(bufferSize >= bufferNeeded); TracePrint((TRACE_LEVEL_WARNING, TRACE_FLAG_WMI, "Invalid Buffer Size!")); status = STATUS_INVALID_BUFFER_SIZE; } } else { *((PULONG)buffer) = bufferNeeded; retSize = sizeof(ULONG); } } else { retSize = 0; } FREE_POOL(name.Buffer); Irp->IoStatus.Status = status; Irp->IoStatus.Information = retSize; ClassReleaseRemoveLock(DeviceObject, Irp); ClassCompleteRequest(DeviceObject, Irp, IO_NO_INCREMENT); return(status); } case IRP_MN_QUERY_ALL_DATA: { PWNODE_ALL_DATA wnode; ULONG bufferAvail; wnode = (PWNODE_ALL_DATA)buffer; if (bufferSize < sizeof(WNODE_ALL_DATA)) { bufferAvail = 0; } else { bufferAvail = bufferSize - sizeof(WNODE_ALL_DATA); } wnode->DataBlockOffset = sizeof(WNODE_ALL_DATA); NT_ASSERT(guidIndex != (ULONG)-1); _Analysis_assume_(isInternalGuid); if (isInternalGuid) { status = ClassQueryInternalDataBlock( DeviceObject, Irp, guidIndex, bufferAvail, buffer + sizeof(WNODE_ALL_DATA)); } else { status = classWmiInfo->ClassQueryWmiDataBlock( DeviceObject, Irp, guidIndex, bufferAvail, buffer + sizeof(WNODE_ALL_DATA)); } break; } case IRP_MN_QUERY_SINGLE_INSTANCE: { PWNODE_SINGLE_INSTANCE wnode; ULONG dataBlockOffset; wnode = (PWNODE_SINGLE_INSTANCE)buffer; dataBlockOffset = wnode->DataBlockOffset; NT_ASSERT(guidIndex != (ULONG)-1); _Analysis_assume_(isInternalGuid); if (isInternalGuid) { status = ClassQueryInternalDataBlock( DeviceObject, Irp, guidIndex, bufferSize - dataBlockOffset, (PUCHAR)wnode + dataBlockOffset); } else { status = classWmiInfo->ClassQueryWmiDataBlock( DeviceObject, Irp, guidIndex, bufferSize - dataBlockOffset, (PUCHAR)wnode + dataBlockOffset); } break; } case IRP_MN_CHANGE_SINGLE_INSTANCE: { PWNODE_SINGLE_INSTANCE wnode; wnode = (PWNODE_SINGLE_INSTANCE)buffer; _Analysis_assume_(isInternalGuid); if (isInternalGuid) { status = ClassWmiCompleteRequest(DeviceObject, Irp, STATUS_WMI_GUID_NOT_FOUND, 0, IO_NO_INCREMENT); } else { NT_ASSERT(guidIndex != (ULONG)-1); status = classWmiInfo->ClassSetWmiDataBlock( DeviceObject, Irp, guidIndex, wnode->SizeDataBlock, (PUCHAR)wnode + wnode->DataBlockOffset); } break; } case IRP_MN_CHANGE_SINGLE_ITEM: { PWNODE_SINGLE_ITEM wnode; wnode = (PWNODE_SINGLE_ITEM)buffer; NT_ASSERT(guidIndex != (ULONG)-1); _Analysis_assume_(isInternalGuid); if (isInternalGuid) { status = ClassWmiCompleteRequest(DeviceObject, Irp, STATUS_WMI_GUID_NOT_FOUND, 0, IO_NO_INCREMENT); } else { NT_ASSERT(guidIndex != (ULONG)-1); status = classWmiInfo->ClassSetWmiDataItem( DeviceObject, Irp, guidIndex, wnode->ItemId, wnode->SizeDataItem, (PUCHAR)wnode + wnode->DataBlockOffset); } break; } case IRP_MN_EXECUTE_METHOD: { PWNODE_METHOD_ITEM wnode; wnode = (PWNODE_METHOD_ITEM)buffer; _Analysis_assume_(isInternalGuid); if (isInternalGuid) { status = ClassWmiCompleteRequest(DeviceObject, Irp, STATUS_WMI_GUID_NOT_FOUND, 0, IO_NO_INCREMENT); } else { NT_ASSERT(guidIndex != (ULONG)-1); status = classWmiInfo->ClassExecuteWmiMethod( DeviceObject, Irp, guidIndex, wnode->MethodId, wnode->SizeDataBlock, bufferSize - wnode->DataBlockOffset, buffer + wnode->DataBlockOffset); } break; } case IRP_MN_ENABLE_EVENTS: { _Analysis_assume_(isInternalGuid); if (isInternalGuid) { status = ClassWmiCompleteRequest(DeviceObject, Irp, STATUS_WMI_GUID_NOT_FOUND, 0, IO_NO_INCREMENT); } else { NT_ASSERT(guidIndex != (ULONG)-1); status = classWmiInfo->ClassWmiFunctionControl( DeviceObject, Irp, guidIndex, EventGeneration, TRUE); } break; } case IRP_MN_DISABLE_EVENTS: { _Analysis_assume_(isInternalGuid); if (isInternalGuid) { status = ClassWmiCompleteRequest(DeviceObject, Irp, STATUS_WMI_GUID_NOT_FOUND, 0, IO_NO_INCREMENT); } else { NT_ASSERT(guidIndex != (ULONG)-1); status = classWmiInfo->ClassWmiFunctionControl( DeviceObject, Irp, guidIndex, EventGeneration, FALSE); } break; } case IRP_MN_ENABLE_COLLECTION: { _Analysis_assume_(isInternalGuid); if (isInternalGuid) { status = ClassWmiCompleteRequest(DeviceObject, Irp, STATUS_WMI_GUID_NOT_FOUND, 0, IO_NO_INCREMENT); } else { NT_ASSERT(guidIndex != (ULONG)-1); status = classWmiInfo->ClassWmiFunctionControl( DeviceObject, Irp, guidIndex, DataBlockCollection, TRUE); } break; } case IRP_MN_DISABLE_COLLECTION: { _Analysis_assume_(isInternalGuid); if (isInternalGuid) { status = ClassWmiCompleteRequest(DeviceObject, Irp, STATUS_WMI_GUID_NOT_FOUND, 0, IO_NO_INCREMENT); } else { NT_ASSERT(guidIndex != (ULONG)-1); status = classWmiInfo->ClassWmiFunctionControl( DeviceObject, Irp, guidIndex, DataBlockCollection, FALSE); } break; } default: { status = STATUS_INVALID_DEVICE_REQUEST; break; } } return(status); } // end ClassSystemControl() NTSTATUS ClassQueryInternalDataBlock( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN ULONG GuidIndex, IN ULONG BufferAvail, OUT PUCHAR Buffer ) /*++ Routine Description: This routine allows querying for the contents of an internal WMI data block. When the driver has finished filling the data block it must call ClassWmiCompleteRequest to complete the irp. Arguments: DeviceObject is the device whose data block is being queried Irp is the Irp that makes this request GuidIndex is the index into the list of guids provided when the device registered BufferAvail on has the maximum size available to write the data block. Buffer on return is filled with the returned data block Return Value: status --*/ { NTSTATUS status; ULONG sizeNeeded = 0, i; PFUNCTIONAL_DEVICE_EXTENSION fdoExt = DeviceObject->DeviceExtension; if (GuidIndex == MSStorageDriver_ClassErrorLogGuid_Index) { // // NOTE - ClassErrorLog is still using SCSI_REQUEST_BLOCK and will not be // updated to support extended SRB until classpnp is updated to send >16 // byte CDBs. Extended SRBs will be translated to SCSI_REQUEST_BLOCK. // sizeNeeded = MSStorageDriver_ClassErrorLog_SIZE; if (BufferAvail >= sizeNeeded) { PMSStorageDriver_ClassErrorLog errorLog = (PMSStorageDriver_ClassErrorLog) Buffer; PMSStorageDriver_ClassErrorLogEntry logEntry; PMSStorageDriver_ScsiRequestBlock srbBlock; PMSStorageDriver_SenseData senseData; PCLASS_PRIVATE_FDO_DATA fdoData = fdoExt->PrivateFdoData; PCLASS_ERROR_LOG_DATA fdoLogEntry; PSCSI_REQUEST_BLOCK fdoSRBBlock; PSENSE_DATA fdoSenseData; errorLog->numEntries = NUM_ERROR_LOG_ENTRIES; for (i = 0; i < NUM_ERROR_LOG_ENTRIES; i++) { fdoLogEntry = &fdoData->ErrorLogs[i]; fdoSRBBlock = &fdoLogEntry->Srb; fdoSenseData = &fdoLogEntry->SenseData; logEntry = &errorLog->logEntries[i]; srbBlock = &logEntry->srb; senseData = &logEntry->senseData; logEntry->tickCount = fdoLogEntry->TickCount.QuadPart; logEntry->portNumber = fdoLogEntry->PortNumber; logEntry->errorPaging = (fdoLogEntry->ErrorPaging == 0 ? FALSE : TRUE); logEntry->errorRetried = (fdoLogEntry->ErrorRetried == 0 ? FALSE : TRUE); logEntry->errorUnhandled = (fdoLogEntry->ErrorUnhandled == 0 ? FALSE : TRUE); logEntry->errorReserved = fdoLogEntry->ErrorReserved; RtlMoveMemory(logEntry->reserved, fdoLogEntry->Reserved, sizeof(logEntry->reserved)); ConvertTickToDateTime(fdoLogEntry->TickCount, logEntry->eventTime); srbBlock->length = fdoSRBBlock->Length; srbBlock->function = fdoSRBBlock->Function; srbBlock->srbStatus = fdoSRBBlock->SrbStatus; srbBlock->scsiStatus = fdoSRBBlock->ScsiStatus; srbBlock->pathID = fdoSRBBlock->PathId; srbBlock->targetID = fdoSRBBlock->TargetId; srbBlock->lun = fdoSRBBlock->Lun; srbBlock->queueTag = fdoSRBBlock->QueueTag; srbBlock->queueAction = fdoSRBBlock->QueueAction; srbBlock->cdbLength = fdoSRBBlock->CdbLength; srbBlock->senseInfoBufferLength = fdoSRBBlock->SenseInfoBufferLength; srbBlock->srbFlags = fdoSRBBlock->SrbFlags; srbBlock->dataTransferLength = fdoSRBBlock->DataTransferLength; srbBlock->timeOutValue = fdoSRBBlock->TimeOutValue; srbBlock->dataBuffer = (ULONGLONG) fdoSRBBlock->DataBuffer; srbBlock->senseInfoBuffer = (ULONGLONG) fdoSRBBlock->SenseInfoBuffer; srbBlock->nextSRB = (ULONGLONG) fdoSRBBlock->NextSrb; srbBlock->originalRequest = (ULONGLONG) fdoSRBBlock->OriginalRequest; srbBlock->srbExtension = (ULONGLONG) fdoSRBBlock->SrbExtension; srbBlock->internalStatus = fdoSRBBlock->InternalStatus; #if defined(_WIN64) srbBlock->reserved = fdoSRBBlock->Reserved; #else srbBlock->reserved = 0; #endif RtlMoveMemory(srbBlock->cdb, fdoSRBBlock->Cdb, sizeof(srbBlock->cdb)); // // Note: Sense data has been converted into Fixed format before it was // put in the log. Therefore, no conversion is needed here. // senseData->errorCode = fdoSenseData->ErrorCode; senseData->valid = (fdoSenseData->Valid == 0 ? FALSE : TRUE); senseData->segmentNumber = fdoSenseData->SegmentNumber; senseData->senseKey = fdoSenseData->SenseKey; senseData->reserved = (fdoSenseData->Reserved == 0 ? FALSE : TRUE); senseData->incorrectLength = (fdoSenseData->IncorrectLength == 0 ? FALSE : TRUE); senseData->endOfMedia = (fdoSenseData->EndOfMedia == 0 ? FALSE : TRUE); senseData->fileMark = (fdoSenseData->FileMark == 0 ? FALSE : TRUE); RtlMoveMemory(senseData->information, fdoSenseData->Information, sizeof(senseData->information)); senseData->additionalSenseLength = fdoSenseData->AdditionalSenseLength; RtlMoveMemory(senseData->commandSpecificInformation, fdoSenseData->CommandSpecificInformation, sizeof(senseData->commandSpecificInformation)); senseData->additionalSenseCode = fdoSenseData->AdditionalSenseCode; senseData->additionalSenseCodeQualifier = fdoSenseData->AdditionalSenseCodeQualifier; senseData->fieldReplaceableUnitCode = fdoSenseData->FieldReplaceableUnitCode; RtlMoveMemory(senseData->senseKeySpecific, fdoSenseData->SenseKeySpecific, sizeof(senseData->senseKeySpecific)); } status = STATUS_SUCCESS; } else { status = STATUS_BUFFER_TOO_SMALL; } } else if (GuidIndex > 0 && GuidIndex < NUM_CLASS_WMI_GUIDS) { status = STATUS_WMI_INSTANCE_NOT_FOUND; } else { status = STATUS_WMI_GUID_NOT_FOUND; } status = ClassWmiCompleteRequest(DeviceObject, Irp, status, sizeNeeded, IO_NO_INCREMENT); return status; } PWCHAR ConvertTickToDateTime( IN LARGE_INTEGER Tick, _Out_writes_(TIME_STRING_LENGTH) PWCHAR String ) /*++ Routine Description: This routine converts a tick count to a datetime (MOF) data type Arguments: Tick - The tick count that needs to be converted String - The buffer to hold the time string, must be able to hold WCHAR[25] Return Value: The time string --*/ { LARGE_INTEGER nowTick, nowTime, time; ULONG maxInc = 0; TIME_FIELDS timeFields = {0}; WCHAR outDateTime[TIME_STRING_LENGTH + 1]; nowTick.QuadPart = 0; nowTime.QuadPart = 0; // // Translate the tick count to a system time // KeQueryTickCount(&nowTick); maxInc = KeQueryTimeIncrement(); KeQuerySystemTime(&nowTime); time.QuadPart = nowTime.QuadPart - ((nowTick.QuadPart - Tick.QuadPart) * maxInc); RtlTimeToTimeFields(&time, &timeFields); // // The buffer String is of size MAX_PATH. Use that to specify the buffer size. // //yyyymmddhhmmss.mmmmmmsutc RtlStringCbPrintfW(outDateTime, sizeof(outDateTime), L"%04d%02d%02d%02d%02d%02d.%03d***+000", timeFields.Year, timeFields.Month, timeFields.Day, timeFields.Hour, timeFields.Minute, timeFields.Second, timeFields.Milliseconds); RtlMoveMemory(String, outDateTime, sizeof(WCHAR) * TIME_STRING_LENGTH); return String; } /*++//////////////////////////////////////////////////////////////////////////// ClassWmiCompleteRequest() Routine Description: This routine will do the work of completing a WMI irp. Depending upon the the WMI request this routine will fixup the returned WNODE appropriately. NOTE: This routine assumes that the ClassRemoveLock is held and it will release it. Arguments: DeviceObject - Supplies a pointer to the device object for this request. Irp - Supplies the Irp making the request. Status - Status to complete the irp with. STATUS_BUFFER_TOO_SMALL is used to indicate that more buffer is required for the data requested. BufferUsed - number of bytes of actual data to return (not including WMI specific structures) PriorityBoost - priority boost to pass to ClassCompleteRequest Return Value: status --*/ SCSIPORT_API NTSTATUS ClassWmiCompleteRequest( _In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _In_ NTSTATUS Status, _In_ ULONG BufferUsed, _In_ CCHAR PriorityBoost ) { PIO_STACK_LOCATION irpStack = IoGetCurrentIrpStackLocation(Irp); PUCHAR buffer; ULONG retSize; UCHAR minorFunction; minorFunction = irpStack->MinorFunction; buffer = (PUCHAR)irpStack->Parameters.WMI.Buffer; switch(minorFunction) { case IRP_MN_QUERY_ALL_DATA: { PWNODE_ALL_DATA wnode; PWNODE_TOO_SMALL wnodeTooSmall; ULONG bufferNeeded; wnode = (PWNODE_ALL_DATA)buffer; bufferNeeded = sizeof(WNODE_ALL_DATA) + BufferUsed; if (NT_SUCCESS(Status)) { retSize = bufferNeeded; wnode->WnodeHeader.BufferSize = bufferNeeded; KeQuerySystemTime(&wnode->WnodeHeader.TimeStamp); wnode->WnodeHeader.Flags |= WNODE_FLAG_FIXED_INSTANCE_SIZE; wnode->FixedInstanceSize = BufferUsed; wnode->InstanceCount = 1; } else if (Status == STATUS_BUFFER_TOO_SMALL) { wnodeTooSmall = (PWNODE_TOO_SMALL)wnode; wnodeTooSmall->WnodeHeader.BufferSize = sizeof(WNODE_TOO_SMALL); wnodeTooSmall->WnodeHeader.Flags = WNODE_FLAG_TOO_SMALL; wnodeTooSmall->SizeNeeded = sizeof(WNODE_ALL_DATA) + BufferUsed; retSize = sizeof(WNODE_TOO_SMALL); Status = STATUS_SUCCESS; } else { retSize = 0; } break; } case IRP_MN_QUERY_SINGLE_INSTANCE: { PWNODE_SINGLE_INSTANCE wnode; PWNODE_TOO_SMALL wnodeTooSmall; ULONG bufferNeeded; wnode = (PWNODE_SINGLE_INSTANCE)buffer; bufferNeeded = wnode->DataBlockOffset + BufferUsed; if (NT_SUCCESS(Status)) { retSize = bufferNeeded; wnode->WnodeHeader.BufferSize = bufferNeeded; KeQuerySystemTime(&wnode->WnodeHeader.TimeStamp); wnode->SizeDataBlock = BufferUsed; } else if (Status == STATUS_BUFFER_TOO_SMALL) { wnodeTooSmall = (PWNODE_TOO_SMALL)wnode; wnodeTooSmall->WnodeHeader.BufferSize = sizeof(WNODE_TOO_SMALL); wnodeTooSmall->WnodeHeader.Flags = WNODE_FLAG_TOO_SMALL; wnodeTooSmall->SizeNeeded = bufferNeeded; retSize = sizeof(WNODE_TOO_SMALL); Status = STATUS_SUCCESS; } else { retSize = 0; } break; } case IRP_MN_EXECUTE_METHOD: { PWNODE_METHOD_ITEM wnode; PWNODE_TOO_SMALL wnodeTooSmall; ULONG bufferNeeded; wnode = (PWNODE_METHOD_ITEM)buffer; bufferNeeded = wnode->DataBlockOffset + BufferUsed; if (NT_SUCCESS(Status)) { retSize = bufferNeeded; wnode->WnodeHeader.BufferSize = bufferNeeded; KeQuerySystemTime(&wnode->WnodeHeader.TimeStamp); wnode->SizeDataBlock = BufferUsed; } else if (Status == STATUS_BUFFER_TOO_SMALL) { wnodeTooSmall = (PWNODE_TOO_SMALL)wnode; wnodeTooSmall->WnodeHeader.BufferSize = sizeof(WNODE_TOO_SMALL); wnodeTooSmall->WnodeHeader.Flags = WNODE_FLAG_TOO_SMALL; wnodeTooSmall->SizeNeeded = bufferNeeded; retSize = sizeof(WNODE_TOO_SMALL); Status = STATUS_SUCCESS; } else { retSize = 0; } break; } default: { // // All other requests don't return any data retSize = 0; break; } } Irp->IoStatus.Status = Status; Irp->IoStatus.Information = retSize; ClassReleaseRemoveLock(DeviceObject, Irp); ClassCompleteRequest(DeviceObject, Irp, PriorityBoost); return(Status); } // end ClassWmiCompleteRequest() /*++//////////////////////////////////////////////////////////////////////////// ClassWmiFireEvent() Routine Description: This routine will fire a WMI event using the data buffer passed. This routine may be called at or below DPC level Arguments: DeviceObject - Supplies a pointer to the device object for this event Guid is pointer to the GUID that represents the event InstanceIndex is the index of the instance of the event EventDataSize is the number of bytes of data that is being fired with with the event EventData is the data that is fired with the events. This may be NULL if there is no data associated with the event Return Value: status --*/ _IRQL_requires_max_(DISPATCH_LEVEL) NTSTATUS ClassWmiFireEvent( _In_ PDEVICE_OBJECT DeviceObject, _In_ LPGUID Guid, _In_ ULONG InstanceIndex, _In_ ULONG EventDataSize, _In_reads_bytes_(EventDataSize) PVOID EventData ) { ULONG sizeNeeded; PWNODE_SINGLE_INSTANCE event; NTSTATUS status; if (EventData == NULL) { EventDataSize = 0; } sizeNeeded = sizeof(WNODE_SINGLE_INSTANCE) + EventDataSize; event = ExAllocatePoolWithTag(NonPagedPoolNx, sizeNeeded, CLASS_TAG_WMI); if (event != NULL) { RtlZeroMemory(event, sizeNeeded); event->WnodeHeader.Guid = *Guid; event->WnodeHeader.ProviderId = IoWMIDeviceObjectToProviderId(DeviceObject); event->WnodeHeader.BufferSize = sizeNeeded; event->WnodeHeader.Flags = WNODE_FLAG_SINGLE_INSTANCE | WNODE_FLAG_EVENT_ITEM | WNODE_FLAG_STATIC_INSTANCE_NAMES; KeQuerySystemTime(&event->WnodeHeader.TimeStamp); event->InstanceIndex = InstanceIndex; event->SizeDataBlock = EventDataSize; event->DataBlockOffset = sizeof(WNODE_SINGLE_INSTANCE); if (EventData != NULL) { RtlCopyMemory( &event->VariableData, EventData, EventDataSize); } status = IoWMIWriteEvent(event); if (! NT_SUCCESS(status)) { FREE_POOL(event); } } else { status = STATUS_INSUFFICIENT_RESOURCES; } return(status); } // end ClassWmiFireEvent()
{ "pile_set_name": "Github" }
PYTHONMALLOC=malloc_debug export PYTHONMALLOC check_PROGRAMS += \ ${modules_python_tests_TESTS} modules_python_tests_TESTS = \ modules/python/tests/test_python_logmsg \ modules/python/tests/test_python_template \ modules/python/tests/test_python_persist_name \ modules/python/tests/test_python_persist \ modules/python/tests/test_python_bookmark \ modules/python/tests/test_python_ack_tracker modules_python_tests_test_python_logmsg_CFLAGS = $(TEST_CFLAGS) $(PYTHON_CFLAGS) -I$(top_srcdir)/modules/python modules_python_tests_test_python_logmsg_LDADD = $(TEST_LDADD) \ -dlpreopen $(top_builddir)/modules/python/libmod-python.la \ $(PREOPEN_SYSLOGFORMAT) \ $(PYTHON_LIBS) modules_python_tests_test_python_template_CFLAGS = $(TEST_CFLAGS) $(PYTHON_CFLAGS) \ -I$(top_srcdir)/modules/python -I$(top_srcdir)/modules/syslogformat modules_python_tests_test_python_template_LDADD = $(TEST_LDADD) \ -dlpreopen $(top_builddir)/modules/python/libmod-python.la \ $(PYTHON_LIBS) $(PREOPEN_SYSLOGFORMAT) modules_python_tests_test_python_persist_name_CFLAGS = $(TEST_CFLAGS) $(PYTHON_CFLAGS) \ -I$(top_srcdir)/modules/python -I$(top_srcdir)/modules/syslogformat modules_python_tests_test_python_persist_name_LDADD = $(TEST_LDADD) \ -dlpreopen $(top_builddir)/modules/python/libmod-python.la \ $(PYTHON_LIBS) $(PREOPEN_SYSLOGFORMAT) modules_python_tests_test_python_persist_CFLAGS = $(TEST_CFLAGS) $(PYTHON_CFLAGS) \ -I$(top_srcdir)/modules/python -I$(top_srcdir)/modules/syslogformat modules_python_tests_test_python_persist_LDADD = $(TEST_LDADD) \ -dlpreopen $(top_builddir)/modules/python/libmod-python.la \ $(PYTHON_LIBS) $(PREOPEN_SYSLOGFORMAT) modules_python_tests_test_python_bookmark_CFLAGS = $(TEST_CFLAGS) $(PYTHON_CFLAGS) \ -I$(top_srcdir)/modules/python -I$(top_srcdir)/modules/syslogformat modules_python_tests_test_python_bookmark_LDADD = $(TEST_LDADD) \ -dlpreopen $(top_builddir)/modules/python/libmod-python.la \ $(PYTHON_LIBS) modules_python_tests_test_python_ack_tracker_CFLAGS = $(TEST_CFLAGS) $(PYTHON_CFLAGS) \ -I$(top_srcdir)/modules/python -I$(top_srcdir)/modules/syslogformat modules_python_tests_test_python_ack_tracker_LDADD = $(TEST_LDADD) \ -dlpreopen $(top_builddir)/modules/python/libmod-python.la \ $(PYTHON_LIBS) $(PREOPEN_SYSLOGFORMAT) EXTRA_DIST += modules/python/tests/CMakeLists.txt
{ "pile_set_name": "Github" }
[![Build Status](https://travis-ci.org/ufoai/ufoai.svg?branch=master)](https://travis-ci.org/ufoai/ufoai) [![Build status](https://ci.appveyor.com/api/projects/status/v3a601svb3odeot9?svg=true)](https://ci.appveyor.com/project/ufoai/ufoai) Please see the [wiki](http://ufoai.sf.net) for more information on how to compile the game and the gamedata
{ "pile_set_name": "Github" }
// +build !integration all package changelog import ( "testing" "time" "github.com/short-d/app/fw/assert" "github.com/short-d/app/fw/timer" "github.com/short-d/short/backend/app/entity" "github.com/short-d/short/backend/app/fw/ptr" "github.com/short-d/short/backend/app/usecase/authorizer" "github.com/short-d/short/backend/app/usecase/authorizer/rbac" "github.com/short-d/short/backend/app/usecase/authorizer/rbac/role" "github.com/short-d/short/backend/app/usecase/keygen" "github.com/short-d/short/backend/app/usecase/repository" ) func TestPersist_CreateChange(t *testing.T) { t.Parallel() now := time.Now().UTC() testCases := []struct { name string changeLog []entity.Change change entity.Change expectedChange entity.Change availableKeys []keygen.Key roles map[string][]role.Role user entity.User expectedChangeLogSize int hasErr bool }{ { name: "create change successfully", changeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, change: entity.Change{ Title: "title 3", SummaryMarkdown: ptr.String("summary 3"), }, expectedChange: entity.Change{ ID: "test", Title: "title 3", SummaryMarkdown: ptr.String("summary 3"), ReleasedAt: now, }, availableKeys: []keygen.Key{"test"}, roles: map[string][]role.Role{ "alpha": {role.Admin}, }, user: entity.User{ ID: "alpha", }, expectedChangeLogSize: 3, hasErr: false, }, { name: "no available key", changeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, change: entity.Change{ Title: "title 3", SummaryMarkdown: ptr.String("summary 3"), }, expectedChange: entity.Change{}, availableKeys: []keygen.Key{}, roles: map[string][]role.Role{ "alpha": {role.Admin}, }, user: entity.User{ ID: "alpha", }, expectedChangeLogSize: 2, hasErr: true, }, { name: "ID already exists", changeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, change: entity.Change{ Title: "title 3", SummaryMarkdown: ptr.String("summary 3"), }, expectedChange: entity.Change{}, availableKeys: []keygen.Key{"12345"}, roles: map[string][]role.Role{ "alpha": {role.Admin}, }, user: entity.User{ ID: "alpha", }, expectedChangeLogSize: 2, hasErr: true, }, { name: "allow summary to be nil", changeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, change: entity.Change{ Title: "title 3", SummaryMarkdown: nil, }, expectedChange: entity.Change{ ID: "22222", Title: "title 3", SummaryMarkdown: nil, ReleasedAt: now, }, availableKeys: []keygen.Key{"22222"}, roles: map[string][]role.Role{ "alpha": {role.Admin}, }, user: entity.User{ ID: "alpha", }, expectedChangeLogSize: 3, hasErr: false, }, { name: "user is not allowed to create a change", changeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, change: entity.Change{ Title: "title 3", SummaryMarkdown: ptr.String("summary 3"), }, availableKeys: []keygen.Key{"test"}, roles: map[string][]role.Role{ "alpha": {role.Basic}, }, user: entity.User{ ID: "alpha", }, hasErr: true, }, } for _, testCase := range testCases { testCase := testCase t.Run(testCase.name, func(t *testing.T) { t.Parallel() changeLogRepo := repository.NewChangeLogFake(testCase.changeLog) keyFetcher := keygen.NewKeyFetcherFake(testCase.availableKeys) keyGen, err := keygen.NewKeyGenerator(2, &keyFetcher) assert.Equal(t, nil, err) fakeRolesRepo := repository.NewUserRoleFake(testCase.roles) rb := rbac.NewRBAC(fakeRolesRepo) au := authorizer.NewAuthorizer(rb) tm := timer.NewStub(now) userChangeLogRepo := repository.NewUserChangeLogFake(map[string]time.Time{}) persist := NewPersist( keyGen, tm, &changeLogRepo, &userChangeLogRepo, au, ) newChange, err := persist.CreateChange(testCase.change.Title, testCase.change.SummaryMarkdown, testCase.user) if testCase.hasErr { assert.NotEqual(t, nil, err) return } assert.Equal(t, nil, err) assert.Equal(t, testCase.expectedChange, newChange) changeLog, err := persist.GetChangeLog() assert.Equal(t, nil, err) assert.Equal(t, testCase.expectedChangeLogSize, len(changeLog)) }) } } func TestPersist_GetChangeLog(t *testing.T) { t.Parallel() now := time.Now() testCases := []struct { name string changeLog []entity.Change availableKeys []keygen.Key roles map[string][]role.Role user entity.User }{ { name: "get full changelog successfully", changeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, availableKeys: []keygen.Key{}, roles: map[string][]role.Role{ "alpha": {role.Basic}, }, user: entity.User{ ID: "alpha", }, }, { name: "get empty changelog successfully", changeLog: []entity.Change{}, availableKeys: []keygen.Key{}, roles: map[string][]role.Role{ "alpha": {role.Basic}, }, user: entity.User{ ID: "alpha", }, }, } for _, testCase := range testCases { testCase := testCase t.Run(testCase.name, func(t *testing.T) { t.Parallel() changeLogRepo := repository.NewChangeLogFake(testCase.changeLog) keyFetcher := keygen.NewKeyFetcherFake(testCase.availableKeys) keyGen, err := keygen.NewKeyGenerator(2, &keyFetcher) assert.Equal(t, nil, err) fakeRolesRepo := repository.NewUserRoleFake(testCase.roles) rb := rbac.NewRBAC(fakeRolesRepo) au := authorizer.NewAuthorizer(rb) tm := timer.NewStub(now) userChangeLogRepo := repository.NewUserChangeLogFake(map[string]time.Time{}) persist := NewPersist( keyGen, tm, &changeLogRepo, &userChangeLogRepo, au, ) changeLog, err := persist.GetChangeLog() assert.Equal(t, nil, err) assert.SameElements(t, testCase.changeLog, changeLog) }) } } func TestPersist_GetLastViewedAt(t *testing.T) { t.Parallel() now := time.Now().UTC() twoMonthsAgo := now.AddDate(0, -2, 0) testCases := []struct { name string userChangeLog map[string]time.Time user entity.User roles map[string][]role.Role lastViewedAt *time.Time }{ { name: "user never viewed the change log before", userChangeLog: map[string]time.Time{}, user: entity.User{ ID: "alpha", Name: "Test User", Email: "test@gmail.com", }, roles: map[string][]role.Role{ "alpha": {role.Basic}, }, lastViewedAt: nil, }, { name: "user viewed change log", userChangeLog: map[string]time.Time{"test@gmail.com": twoMonthsAgo}, user: entity.User{ ID: "alpha", Name: "Test User", Email: "test@gmail.com", }, roles: map[string][]role.Role{ "alpha": {role.Basic}, }, lastViewedAt: &twoMonthsAgo, }, } for _, testCase := range testCases { testCase := testCase t.Run(testCase.name, func(t *testing.T) { t.Parallel() changeLogRepo := repository.NewChangeLogFake([]entity.Change{}) keyFetcher := keygen.NewKeyFetcherFake([]keygen.Key{}) keyGen, err := keygen.NewKeyGenerator(2, &keyFetcher) assert.Equal(t, nil, err) tm := timer.NewStub(now) userChangeLogRepo := repository.NewUserChangeLogFake(testCase.userChangeLog) fakeRolesRepo := repository.NewUserRoleFake(testCase.roles) rb := rbac.NewRBAC(fakeRolesRepo) au := authorizer.NewAuthorizer(rb) persist := NewPersist( keyGen, tm, &changeLogRepo, &userChangeLogRepo, au, ) lastViewedAt, err := persist.GetLastViewedAt(testCase.user) assert.Equal(t, nil, err) assert.Equal(t, testCase.lastViewedAt, lastViewedAt) }) } } func TestPersist_ViewChangeLog(t *testing.T) { t.Parallel() now := time.Now().UTC() twoMonthsAgo := now.AddDate(0, -2, 0) testCases := []struct { name string userChangeLog map[string]time.Time user entity.User roles map[string][]role.Role lastViewedAt time.Time }{ { name: "user viewed the change log the first time", userChangeLog: map[string]time.Time{}, user: entity.User{ ID: "alpha", Name: "Test User", Email: "test@gmail.com", }, roles: map[string][]role.Role{ "alpha": {role.Basic}, }, lastViewedAt: now, }, { name: "user has viewed the change log before", userChangeLog: map[string]time.Time{"test@gmail.com": twoMonthsAgo}, user: entity.User{ ID: "alpha", Name: "Test User", Email: "test@gmail.com", }, roles: map[string][]role.Role{ "alpha": {role.Basic}, }, lastViewedAt: now, }, } for _, testCase := range testCases { testCase := testCase t.Run(testCase.name, func(t *testing.T) { t.Parallel() changeLogRepo := repository.NewChangeLogFake([]entity.Change{}) keyFetcher := keygen.NewKeyFetcherFake([]keygen.Key{}) keyGen, err := keygen.NewKeyGenerator(2, &keyFetcher) assert.Equal(t, nil, err) tm := timer.NewStub(now) userChangeLogRepo := repository.NewUserChangeLogFake(testCase.userChangeLog) fakeRolesRepo := repository.NewUserRoleFake(testCase.roles) rb := rbac.NewRBAC(fakeRolesRepo) au := authorizer.NewAuthorizer(rb) persist := NewPersist( keyGen, tm, &changeLogRepo, &userChangeLogRepo, au, ) lastViewedAt, err := persist.ViewChangeLog(testCase.user) assert.Equal(t, nil, err) assert.Equal(t, testCase.lastViewedAt, lastViewedAt) }) } } func TestPersist_GetAllChanges(t *testing.T) { t.Parallel() now := time.Now() testCases := []struct { name string changes []entity.Change expectedChanges []entity.Change availableKeys []keygen.Key roles map[string][]role.Role user entity.User hasErr bool }{ { name: "get full changelog successfully", changes: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, expectedChanges: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, availableKeys: []keygen.Key{}, roles: map[string][]role.Role{ "alpha": {role.ChangeLogViewer}, }, user: entity.User{ ID: "alpha", }, hasErr: false, }, { name: "user is not allowed to get changes", changes: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, expectedChanges: []entity.Change{}, availableKeys: []keygen.Key{}, roles: map[string][]role.Role{ "alpha": {role.Basic}, }, user: entity.User{ ID: "alpha", }, hasErr: true, }, } for _, testCase := range testCases { testCase := testCase t.Run(testCase.name, func(t *testing.T) { t.Parallel() changeLogRepo := repository.NewChangeLogFake(testCase.changes) keyFetcher := keygen.NewKeyFetcherFake(testCase.availableKeys) keyGen, err := keygen.NewKeyGenerator(2, &keyFetcher) assert.Equal(t, nil, err) fakeRolesRepo := repository.NewUserRoleFake(testCase.roles) rb := rbac.NewRBAC(fakeRolesRepo) au := authorizer.NewAuthorizer(rb) tm := timer.NewStub(now) userChangeLogRepo := repository.NewUserChangeLogFake(map[string]time.Time{}) persist := NewPersist( keyGen, tm, &changeLogRepo, &userChangeLogRepo, au, ) changeLog, err := persist.GetAllChanges(testCase.user) if testCase.hasErr { assert.NotEqual(t, nil, err) return } assert.Equal(t, nil, err) assert.SameElements(t, testCase.expectedChanges, changeLog) }) } } func TestPersist_DeleteChange(t *testing.T) { t.Parallel() testCases := []struct { name string changeLog []entity.Change deleteChangeId string expectedChangeLog []entity.Change expectedChangeLogSize int roles map[string][]role.Role user entity.User hasErr bool }{ { name: "delete existing change successfully", changeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, deleteChangeId: "12345", expectedChangeLog: []entity.Change{ { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, expectedChangeLogSize: 1, roles: map[string][]role.Role{ "alpha": {role.Admin}, }, user: entity.User{ ID: "alpha", }, hasErr: false, }, { name: "delete non existing change", changeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, deleteChangeId: "34567", expectedChangeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, expectedChangeLogSize: 2, roles: map[string][]role.Role{ "alpha": {role.Admin}, }, user: entity.User{ ID: "alpha", }, hasErr: false, }, { name: "user is not allowed to delete a change", changeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, deleteChangeId: "12345", expectedChangeLogSize: 1, roles: map[string][]role.Role{ "alpha": {role.Basic}, }, user: entity.User{ ID: "alpha", }, hasErr: true, }, } for _, testCase := range testCases { testCase := testCase t.Run(testCase.name, func(t *testing.T) { t.Parallel() changeLogRepo := repository.NewChangeLogFake(testCase.changeLog) keyFetcher := keygen.NewKeyFetcherFake([]keygen.Key{}) keyGen, err := keygen.NewKeyGenerator(2, &keyFetcher) assert.Equal(t, nil, err) fakeRolesRepo := repository.NewUserRoleFake(testCase.roles) rb := rbac.NewRBAC(fakeRolesRepo) au := authorizer.NewAuthorizer(rb) tm := timer.NewStub(time.Now()) userChangeLogRepo := repository.NewUserChangeLogFake(map[string]time.Time{}) persist := NewPersist( keyGen, tm, &changeLogRepo, &userChangeLogRepo, au, ) err = persist.DeleteChange(testCase.deleteChangeId, testCase.user) if testCase.hasErr { assert.NotEqual(t, nil, err) return } assert.Equal(t, nil, err) changeLog, err := persist.GetChangeLog() assert.Equal(t, nil, err) assert.SameElements(t, testCase.expectedChangeLog, changeLog) }) } } func TestPersist_UpdateChange(t *testing.T) { t.Parallel() testCases := []struct { name string changeLog []entity.Change change entity.Change roles map[string][]role.Role user entity.User expectedChangeLog []entity.Change hasErr bool }{ { name: "update existing change successfully", changeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, change: entity.Change{ ID: "54321", Title: "title 3", SummaryMarkdown: ptr.String("summary 3"), }, roles: map[string][]role.Role{ "alpha": {role.Admin}, }, user: entity.User{ ID: "alpha", }, expectedChangeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 3", SummaryMarkdown: ptr.String("summary 3"), }, }, hasErr: false, }, { name: "update non existing change", changeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, change: entity.Change{ ID: "34567", Title: "title 3", SummaryMarkdown: ptr.String("summary 3"), }, roles: map[string][]role.Role{ "alpha": {role.Admin}, }, user: entity.User{ ID: "alpha", }, expectedChangeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, hasErr: false, }, { name: "user is not allowed to update a change", changeLog: []entity.Change{ { ID: "12345", Title: "title 1", SummaryMarkdown: ptr.String("summary 1"), }, { ID: "54321", Title: "title 2", SummaryMarkdown: ptr.String("summary 2"), }, }, change: entity.Change{ ID: "54321", Title: "title 3", SummaryMarkdown: ptr.String("summary 3"), }, roles: map[string][]role.Role{ "alpha": {role.Basic}, }, user: entity.User{ ID: "alpha", }, hasErr: true, }, } for _, testCase := range testCases { testCase := testCase t.Run(testCase.name, func(t *testing.T) { t.Parallel() changeLogRepo := repository.NewChangeLogFake(testCase.changeLog) keyFetcher := keygen.NewKeyFetcherFake([]keygen.Key{}) keyGen, err := keygen.NewKeyGenerator(2, &keyFetcher) assert.Equal(t, nil, err) fakeRolesRepo := repository.NewUserRoleFake(testCase.roles) rb := rbac.NewRBAC(fakeRolesRepo) au := authorizer.NewAuthorizer(rb) tm := timer.NewStub(time.Now()) userChangeLogRepo := repository.NewUserChangeLogFake(map[string]time.Time{}) persist := NewPersist( keyGen, tm, &changeLogRepo, &userChangeLogRepo, au, ) _, err = persist.UpdateChange(testCase.change.ID, testCase.change.Title, testCase.change.SummaryMarkdown, testCase.user) if testCase.hasErr { assert.NotEqual(t, nil, err) return } assert.Equal(t, nil, err) changeLog, err := persist.GetChangeLog() assert.Equal(t, nil, err) assert.SameElements(t, testCase.expectedChangeLog, changeLog) }) } }
{ "pile_set_name": "Github" }
/* SPDX-License-Identifier: GPL-2.0-only */ #include <device/pci_ops.h> #include <bootblock_common.h> #include <southbridge/intel/common/early_spi.h> #include <southbridge/intel/i82801ix/i82801ix.h> #include <console/console.h> /* Just define these here, there is no gm35.h file to include. */ #define D0F0_PCIEXBAR_LO 0x60 #define D0F0_PCIEXBAR_HI 0x64 static void bootblock_northbridge_init(void) { uint32_t reg; /* * The "io" variant of the config access is explicitly used to * setup the PCIEXBAR because CONFIG(MMCONF_SUPPORT) is set to * to true. That way all subsequent non-explicit config accesses use * MCFG. This code also assumes that bootblock_northbridge_init() is * the first thing called in the non-asm boot block code. The final * assumption is that no assembly code is using the * CONFIG(MMCONF_SUPPORT) option to do PCI config acceses. * * The PCIEXBAR is assumed to live in the memory mapped IO space under * 4GiB. */ reg = 0; pci_io_write_config32(PCI_DEV(0,0,0), D0F0_PCIEXBAR_HI, reg); reg = CONFIG_MMCONF_BASE_ADDRESS | 1; /* 256MiB - 0-255 buses. */ pci_io_write_config32(PCI_DEV(0,0,0), D0F0_PCIEXBAR_LO, reg); /* MCFG is now active. If it's not qemu was started for machine PC */ if (CONFIG(BOOTBLOCK_CONSOLE) && (pci_read_config32(PCI_DEV(0, 0, 0), D0F0_PCIEXBAR_LO) != (CONFIG_MMCONF_BASE_ADDRESS | 1))) die("You must run qemu for machine Q35 (-M q35)"); } static void bootblock_southbridge_init(void) { enable_spi_prefetching_and_caching(); /* Enable RCBA */ pci_write_config32(PCI_DEV(0, 0x1f, 0), RCBA, (uintptr_t)DEFAULT_RCBA | 1); } void bootblock_soc_init(void) { bootblock_northbridge_init(); bootblock_southbridge_init(); }
{ "pile_set_name": "Github" }
/* * Theme Name: Scratchpad * Description: Gutenberg Block Editor Styles */ /*-------------------------------------------------------------- >>> TABLE OF CONTENTS: ---------------------------------------------------------------- 1.0 General Typography 2.0 General Block Styles 3.0 Blocks - Common Blocks 4.0 Blocks - Formatting 5.0 Blocks - Layout Elements 6.0 Blocks - Widgets --------------------------------------------------------------*/ /*-------------------------------------------------------------- 1.0 General Typography --------------------------------------------------------------*/ .edit-post-visual-editor .editor-block-list__block, .edit-post-visual-editor .editor-block-list__block p, .editor-default-block-appender textarea.editor-default-block-appender__content { font-family: "Lato", "Helvetica Neue", helvetica, arial, sans-serif; font-size: 18px; line-height: 1.8; } .edit-post-visual-editor .editor-block-list__block { color: #777; } .alignleft, .editor-block-list__layout .editor-block-list__block[data-align=left] .editor-block-list__block-edit { display: inline; float: left; margin: 0 1.5em .75em 0; } .alignright, .editor-block-list__layout .editor-block-list__block[data-align=right] .editor-block-list__block-edit { display: inline; float: right; margin: 0 0 .75em 1.5em; } .aligncenter, .editor-block-list__layout .editor-block-list__block[data-align=center] .editor-block-list__block-edit { margin-left: auto; margin-right: auto; } .wp-block-columns.alignfull, .wp-block-latest-comments.alignfull, .editor-block-list__layout .editor-block-list__block[data-align=full] { padding-left: 60px; padding-right: 60px; } /* Title */ .editor-post-title__block .editor-post-title__input { font-family: "Lato", "Helvetica Neue", helvetica, arial, sans-serif; color: #777; margin-top: 0; padding-top: 0; font-size: 32px; } @media only screen and (max-width: 800px) { .editor-post-title__block .editor-post-title__input { font-size: 28px; } } /* Headings */ .edit-post-visual-editor h1, .edit-post-visual-editor h2, .edit-post-visual-editor h3, .edit-post-visual-editor h4, .edit-post-visual-editor h5, .edit-post-visual-editor h6 { clear: both; margin-top: 0; padding-top: 0; } .edit-post-visual-editor h1 { font-size: 32px; } .edit-post-visual-editor h2 { font-size: 28px; } .edit-post-visual-editor h3 { font-size: 24px; } .edit-post-visual-editor h4 { font-size: 20px; } .edit-post-visual-editor h5 { font-size: 16px; text-transform: uppercase; } .edit-post-visual-editor h6 { font-size: 14px; text-transform: uppercase; } @media only screen and (max-width: 800px) { .edit-post-visual-editor h1 { font-size: 28px; } .edit-post-visual-editor h2 { font-size: 24px; } .edit-post-visual-editor h3 { font-size: 20px; } .edit-post-visual-editor h4 { font-size: 18px; } .edit-post-visual-editor h5 { font-size: 16px; } .edit-post-visual-editor h6 { font-size: 14px; } } /*-------------------------------------------------------------- 2.0 General Block Styles --------------------------------------------------------------*/ /* Main column width */ .wp-block { max-width: 690px; /* 660px + 30px to account for padding */ } /* Link styles */ .edit-post-visual-editor a, .editor-block-list__block a, .wp-block-freeform.block-library-rich-text__tinymce a { color: #537375; } .edit-post-visual-editor a:hover, .edit-post-visual-editor a:focus, .edit-post-visual-editor a:active, .editor-block-list__block a:hover, .editor-block-list__block a:focus, .editor-block-list__block a:active, .wp-block-freeform.block-library-rich-text__tinymce a:hover, .wp-block-freeform.block-library-rich-text__tinymce a:focus, .wp-block-freeform.block-library-rich-text__tinymce a:active { color: #537375; text-decoration: none; } /* List styles */ .block-library-list .editor-rich-text__tinymce { margin: 0; padding: 0; } .edit-post-visual-editor ul:not(.wp-block-gallery), .editor-block-list__block ul:not(.wp-block-gallery), .block-library-list ul { list-style: disc; } .edit-post-visual-editor ol, .editor-block-list__block ol, .block-library-list ol.editor-rich-text__tinymce { list-style: decimal; } .edit-post-visual-editor ul:not(.wp-block-gallery) li > ul, .editor-block-list__block ul:not(.wp-block-gallery) li > ul, .block-library-list li > ul, .edit-post-visual-editor li > ol, .editor-block-list__block li > ol, .block-library-list li > ol { margin-bottom: 0; margin-left: 2em; } .rtl .edit-post-visual-editor ul:not(.wp-block-gallery), .rtl .editor-block-list__block ul:not(.wp-block-gallery), .rtl .block-library-list ul, .rtl .edit-post-visual-editor ol, .rtl .editor-block-list__block ol, .rtl .block-library-list ol.editor-rich-text__tinymce { margin-left: 0; margin-right: 2em; padding: 0; } /* Captions */ [class^="wp-block-"] figcaption, .wp-caption-dd { font-family: "Kalam", "Chalkboard", "Comic Sans", script; font-size: 15px; line-height: 1.5; margin-left: 0; margin-right: 0; text-align: center; } [class^="wp-block-"]:not(.wp-block-gallery) figcaption, .wp-caption-dd { border-bottom: 1px solid #ddd; color: #b9b9b9; padding-bottom: 0.5em; } /* Definition List styles */ .wp-block-freeform.block-library-rich-text__tinymce dt { font-weight: bold; } .wp-block-freeform.block-library-rich-text__tinymce dd { margin-bottom: 1em; } /* Code styles */ .wp-block-freeform.block-library-rich-text__tinymce code, .wp-block-freeform.block-library-rich-text__tinymce kbd, .wp-block-freeform.block-library-rich-text__tinymce tt, .wp-block-freeform.block-library-rich-text__tinymce var { background: transparent; color: #777; font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; font-size: 15px; } /* Mark, Ins styles */ .wp-block-freeform.block-library-rich-text__tinymce mark, .wp-block-freeform.block-library-rich-text__tinymce ins { background: #fff9c0; } /*-------------------------------------------------------------- 3.0 Blocks - Common Blocks --------------------------------------------------------------*/ /* Paragraph */ .wp-block-paragraph.has-drop-cap:not(:focus)::first-letter { font-size: 5em; margin-top: 0.16em; } .edit-post-visual-editor p { margin: 0 0 1.5em; } .edit-post-visual-editor blockquote p { margin: 0 0 1.5em; } /* Images */ .wp-block-image figcaption { font-family: "Kalam", "Chalkboard", "Comic Sans", script; font-size: 15px; line-height: 1.5; } /* Quote */ .wp-block-quote:before { background: url("images/icon-sprites.svg") 0 -408px no-repeat; background-size: 100%; content: ""; display: block; height: 39px; opacity: 0.2; position: absolute; top: 0; width: 50px; } .wp-block-quote:before, .rtl .wp-block-quote[style*="text-align:left"]:before, .rtl .wp-block-quote[style*="text-align: left"]:before { left: 0; right: auto; } .wp-block-quote:not(.is-large):not(.is-style-large), .wp-block-quote { border: 0; color: #aaa; font-size: 22px; font-style: italic; margin: 0; padding-left: 70px; position: relative; } .rtl .wp-block-quote:before, .wp-block-quote[style*="text-align:right"]:before, .wp-block-quote[style*="text-align: right"]:before { left: auto; right: 0; } @media only screen and (max-width: 800px) { .editor-block-list__block .wp-block-quote:not(.is-large):not(.is-style-large), .editor-block-list__block .wp-block-quote { font-size: 17px; } } .rtl .wp-block-quote:not(.is-large):not(.is-style-large), .rtl .wp-block-quote, .wp-block-quote:not(.is-large):not(.is-style-large)[style*="text-align:right"], .wp-block-quote:not(.is-large):not(.is-style-large)[style*="text-align: right"], .wp-block-quote[style*="text-align:right"], .wp-block-quote[style*="text-align: right"] { border: 0; margin: 0; padding-left: 0; padding-right: 70px; } .rtl .wp-block-quote:not(.is-large):not(.is-style-large)[style*="text-align:left"], .rtl .wp-block-quote:not(.is-large):not(.is-style-large)[style*="text-align: left"], .rtl .wp-block-quote[style*="text-align:left"], .rtl .wp-block-quote[style*="text-align: left"] { padding-left: 70px; padding-right: 0; } .edit-post-visual-editor .editor-block-list__block blockquote p { color: #aaa; font-size: 22px; } .editor-block-list__block .wp-block-quote__citation { color: inherit; display: block; font-size: 18px; font-style: italic; padding: 8px 0 0; } .editor-block-list__block .wp-block-quote em, .editor-block-list__block .wp-block-quote i { font-style: normal; } .editor-block-list__block .wp-block-quote > :last-child { margin-bottom: 0; } .wp-block-quote.is-large, .wp-block-quote.is-style-large { font-size: 32px; font-style: italic; } .edit-post-visual-editor .editor-block-list__block .wp-block-quote.is-large, .edit-post-visual-editor .editor-block-list__block .wp-block-quote.is-style-large, .edit-post-visual-editor .editor-block-list__block .wp-block-quote.is-large p, .edit-post-visual-editor .editor-block-list__block .wp-block-quote.is-style-large p { font-size: 32px; } @media only screen and (max-width: 800px) { .edit-post-visual-editor .editor-block-list__block .wp-block-quote.is-large, .edit-post-visual-editor .editor-block-list__block .wp-block-quote.is-style-large, .edit-post-visual-editor .editor-block-list__block .wp-block-quote.is-large p, .edit-post-visual-editor .editor-block-list__block .wp-block-quote.is-style-large p { font-size: 28px; } } .editor-block-list__block .wp-block-quote.is-large p, .editor-block-list__block .wp-block-quote.is-style-large p { margin-bottom: 1.5em; font-style: normal; } /* Cover */ .edit-post-visual-editor .editor-block-list__block .wp-block-cover-image p.wp-block-cover-image-text, .edit-post-visual-editor .editor-block-list__block .wp-block-cover-image p.wp-block-cover-text, .edit-post-visual-editor .editor-block-list__block .wp-block-cover-image h2, .edit-post-visual-editor .editor-block-list__block .wp-block-cover p.wp-block-cover-image-text, .edit-post-visual-editor .editor-block-list__block .wp-block-cover p.wp-block-cover-text, .edit-post-visual-editor .editor-block-list__block .wp-block-cover h2 { font-family: "Kalam", "Chalkboard", "Comic Sans", script; font-size: 2.0em; } /* File */ .wp-block-file { margin: 0 0 1.5em; } .wp-block-file .wp-block-file__button { background: transparent; border: 2px solid rgba(119, 119, 119, 0.5); border-radius: 255px 15px 225px 15px/15px 225px 15px; color: rgba(119, 119, 119, 0.8); font-family: "Kalam", "Chalkboard", "Comic Sans", script; font-size: 14px; letter-spacing: 0.05em; outline: none; padding: 10px 20px; text-shadow: none; text-transform: uppercase; -webkit-transition: color 0.2s, border-color 0.2s; -moz-transition: color 0.2s, border-color 0.2s; transition: color 0.2s, border-color 0.2s; } .rtl .wp-block-file .wp-block-file__button { margin-left: 10px; margin-right: 0; } /*-------------------------------------------------------------- 4.0 Blocks - Formatting --------------------------------------------------------------*/ /* Verse */ .wp-block-verse pre { background: transparent; color: inherit; font-family: "Kalam", "Chalkboard", "Comic Sans", script; font-size: inherit; line-height: inherit; margin-bottom: 1.5em; max-width: 100%; overflow: auto; padding: 0; } /* Code */ .wp-block-code { color: #777; background: #eee; font-family: "Courier 10 Pitch", Courier, monospace; font-size: 15px; font-size: 0.9375rem; line-height: 1.6; margin-bottom: 1.6em; max-width: 100%; overflow: auto; padding: 1.6em; } .wp-block-code .editor-plain-text { background: #eee; } /* Classic */ .wp-block-freeform.block-library-rich-text__tinymce { overflow: visible; } .wp-block-freeform.block-library-rich-text__tinymce address { margin-bottom: 1.5em; } .wp-block-freeform.block-library-rich-text__tinymce ol { list-style: decimal; margin-left: 3em; padding: 0; } .wp-block-freeform.block-library-rich-text__tinymce li > ol { margin-left: 3em; } .wp-block-freeform.block-library-rich-text__tinymce blockquote:before { background: url("images/icon-sprites.svg") 0 -408px no-repeat; background-size: 100%; content: ""; display: block; height: 39px; left: 0; opacity: 0.2; position: absolute; top: 0; width: 50px; } .rtl .wp-block-freeform.block-library-rich-text__tinymce blockquote:before { left: auto; right: 0; } .wp-block-freeform.block-library-rich-text__tinymce blockquote { border: 0; color: #aaa; font-size: 22px; font-style: italic; margin: 0; padding-left: 70px; position: relative; } @media only screen and (max-width: 800px) { .wp-block-freeform.block-library-rich-text__tinymce blockquote { font-size: 17px; } } .wp-block-freeform.block-library-rich-text__tinymce blockquote > :last-child { margin-bottom: 0; } .wp-block-freeform.block-library-rich-text__tinymce blockquote cite { font-style: italic; font-size: 18px; } .rtl .wp-block-freeform.block-library-rich-text__tinymce blockquote { border: 0; padding-left: 0; padding-right: 70px; } .rtl .wp-block-freeform.block-library-rich-text__tinymce .alignleft { float: left; } .rtl .wp-block-freeform.block-library-rich-text__tinymce .alignright { float: right; } .rtl .wp-block-freeform.block-library-rich-text__tinymce blockquote.alignleft { margin: .75em 1.5em .75em 0; } .rtl .wp-block-freeform.block-library-rich-text__tinymce blockquote.alignright { margin: .75em 0 .75em 1.5em; } .wp-block-freeform.block-library-rich-text__tinymce h1, .wp-block-freeform.block-library-rich-text__tinymce h2, .wp-block-freeform.block-library-rich-text__tinymce h3, .wp-block-freeform.block-library-rich-text__tinymce h4, .wp-block-freeform.block-library-rich-text__tinymce h5, .wp-block-freeform.block-library-rich-text__tinymce h6 { clear: both; margin-top: 0; padding-top: 0; color: #777; } .wp-block-freeform.block-library-rich-text__tinymce h1 { font-size: 32px; } .wp-block-freeform.block-library-rich-text__tinymce h2 { font-size: 28px; } .wp-block-freeform.block-library-rich-text__tinymce h3 { font-size: 24px; } .wp-block-freeform.block-library-rich-text__tinymce h4 { font-size: 20px; } .wp-block-freeform.block-library-rich-text__tinymce h5 { font-size: 16px; text-transform: uppercase; } .wp-block-freeform.block-library-rich-text__tinymce h6 { font-size: 14px; text-transform: uppercase; } @media only screen and (max-width: 800px) { .wp-block-freeform.block-library-rich-text__tinymce h1 { font-size: 28px; } .wp-block-freeform.block-library-rich-text__tinymce h2 { font-size: 24px; } .wp-block-freeform.block-library-rich-text__tinymce h3 { font-size: 20px; } .wp-block-freeform.block-library-rich-text__tinymce h4 { font-size: 18px; } .wp-block-freeform.block-library-rich-text__tinymce h5 { font-size: 16px; } .wp-block-freeform.block-library-rich-text__tinymce h6 { font-size: 14px; } } .wp-block-freeform.block-library-rich-text__tinymce pre { color: #777; background: #eee; font-family: "Courier 10 Pitch", Courier, monospace; font-size: 15px; line-height: 1.6; margin-bottom: 1.6em; max-width: 100%; overflow: auto; padding: 1.6em; } .wp-block-freeform.block-library-rich-text__tinymce table { border: 0; border-collapse: collapse; border-top: 1px solid #ddd; color: #777; margin: 0 0 1.5em; width: 100%; } .wp-block-freeform.block-library-rich-text__tinymce .alternate { background: transparent; } .wp-block-freeform.block-library-rich-text__tinymce table td, .wp-block-freeform.block-library-rich-text__tinymce table th { border: 0; border-bottom: 1px solid #ddd; font-size: 90%; padding: 0.5em; text-align: left; } .rtl .wp-block-freeform.block-library-rich-text__tinymce table td, .rtl .wp-block-freeform.block-library-rich-text__tinymce table th { text-align: right; } /* Preformatted */ .editor-block-list__block .wp-block-preformatted pre { color: #777; background: #eee; font-family: "Courier 10 Pitch", Courier, monospace; font-size: 15px; line-height: 1.6; margin-bottom: 1.6em; max-width: 100%; overflow: auto; padding: 1.6em; } /* Pullquote */ .editor-block-list__block .wp-block-pullquote blockquote { margin: 0; padding: 0; border: 0; } .edit-post-visual-editor .editor-block-list__block .wp-block-pullquote blockquote p { font-size: 28px; } .edit-post-visual-editor .editor-block-list__block .wp-block-pullquote.alignleft blockquote p, .edit-post-visual-editor .editor-block-list__block .wp-block-pullquote.alignright blockquote p { font-size: 22px; } .wp-block-pullquote blockquote:before { display: none; } .wp-block-pullquote { border-left: 0; border-bottom: 2px solid #bdcbcc; border-top: 5px solid #bdcbcc; font-size: 28px; font-style: italic; line-height: 1.6; margin: 0 0 1.5em; padding: 1.5em; color: #aaa; } .wp-block-pullquote blockquote { font-size: 28px; } .wp-block-pullquote.alignfull blockquote { padding-left: 1.5em; padding-right: 1.5em; } .wp-block-pullquote.alignleft, .wp-block-pullquote.alignright { font-size: 22px; } .wp-block-pullquote.alignleft cite, .wp-block-pullquote.alignright cite { font-size: 18px; } .wp-block-pullquote.alignleft blockquote, .wp-block-pullquote.alignright blockquote { border: 0; padding: 0; margin: 0; } .wp-block-pullquote.alignleft { font-size: 18px; margin-right: 1.5em; } .wp-block-pullquote.alignright { font-size: 18px; margin-left: 1.5em; } .wp-block-pullquote blockquote > .editor-rich-text p { margin-bottom: .75em; } .wp-block-pullquote__citation, .wp-block-pullquote cite, .wp-block-pullquote footer { color: inherit; font-size: 18px; font-style: italic; font-weight: normal; text-transform: none; } /* Table */ .editor-block-list__block .wp-block-table__cell-content { padding: 0; } .editor-block-list__block table.wp-block-table { border-top: 1px solid #ddd; margin: 0 0 1.5em; width: 100%; } .editor-block-list__block table.wp-block-table td { border: 0; border-bottom: 1px solid #ddd; font-size: 90%; padding: 0.5em; text-align: left; } .editor-block-list__block table.wp-block-table th { border: 0; border-bottom: 1px solid #ddd; font-size: 90%; padding: 0.5em; text-align: left; } .rtl .editor-block-list__block table.wp-block-table td, .rtl .editor-block-list__block table.wp-block-table th { text-align: right; } /*-------------------------------------------------------------- 5.0 Blocks - Layout Elements --------------------------------------------------------------*/ /* Buttons */ .wp-block-button .wp-block-button__link { font-family: "Kalam", "Chalkboard", "Comic Sans", script; font-size: 14px; letter-spacing: 0.05em; outline: none; padding: 12px 20px 10px; text-shadow: none; text-transform: uppercase; } .wp-block-button__link { background-color: rgba(119, 119, 119, 0.8); color: #fff; } .is-style-outline .wp-block-button__link:not(.has-text-color) { color: rgba(119, 119, 119, 0.8); } .wp-block-button.alignleft { margin-left: 0; } .wp-block-button.alignright { margin-right: 0; } .wp-block-button.aligncenter { margin: 1.5em auto; } /* Separator */ .wp-block-separator { background-color: #ccc; border: 0; height: 1px; margin-bottom: 1.5em; } .wp-block-separator.is-style-wide { max-width: 100%; } /*-------------------------------------------------------------- 6.0 Blocks - Widgets --------------------------------------------------------------*/ /* General Widget styles */ .edit-post-visual-editor [data-align="center"] .wp-block-categories__list, .edit-post-visual-editor [data-align="center"] .wp-block-archives, .edit-post-visual-editor [data-align="center"] .wp-block-lastest-posts { list-style-position: inside; text-align: center; } /* Categories */ .editor-block-list__block[data-align=right] .wp-block-categories__list, .editor-block-list__block[data-align=left] .wp-block-categories__list { padding: 0; } /* Latest Comments */ .wp-block-latest-comments { margin-left: 0; margin-right: 0; } .wp-block-latest-comments__comment-meta a { font-weight: 700; text-decoration: none; } .wp-block-latest-comments .wp-block-latest-comments__comment { margin-bottom: 0; padding: 0.75em 0; } .wp-block-latest-comments .avatar, .wp-block-latest-comments__comment-avatar { margin: 0; } .wp-block-latest-comments__comment, .wp-block-latest-comments__comment-date, .wp-block-latest-comments__comment-excerpt p { font-size: inherit; } .wp-block-latest-comments__comment-date { color: #999; font-family: "Kalam", "Chalkboard", "Comic Sans", script; font-size: 16px; font-size: 1rem; } .rtl ol.wp-block-latest-comments { margin-right: 0; } /* Latest Posts */ .edit-post-visual-editor .wp-block-latest-posts.is-grid { list-style: none; margin-left: 0; margin-right: 0; } .edit-post-visual-editor .wp-block-latest-posts.is-grid li { margin-bottom: .75em; }
{ "pile_set_name": "Github" }
// // BasicUIScrollViewController.swift // SnapKit // // Created by Spiros Gerokostas on 01/03/16. // Copyright © 2016 SnapKit Team. All rights reserved. // import UIKit class BasicUIScrollViewController: UIViewController { var didSetupConstraints = false let scrollView = UIScrollView() let contentView = UIView() let label: UILabel = { let label = UILabel() label.backgroundColor = .blue label.numberOfLines = 0 label.lineBreakMode = .byClipping label.textColor = .white label.text = NSLocalizedString("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", comment: "") return label }() override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = UIColor.white view.addSubview(scrollView) contentView.backgroundColor = UIColor.lightGray scrollView.addSubview(contentView) contentView.addSubview(label) view.setNeedsUpdateConstraints() } override func updateViewConstraints() { if (!didSetupConstraints) { scrollView.snp.makeConstraints { make in make.edges.equalTo(view).inset(UIEdgeInsets.zero) } contentView.snp.makeConstraints { make in make.edges.equalTo(scrollView).inset(UIEdgeInsets.zero) make.width.equalTo(scrollView) } label.snp.makeConstraints { make in make.top.equalTo(contentView).inset(20) make.leading.equalTo(contentView).inset(20) make.trailing.equalTo(contentView).inset(20) make.bottom.equalTo(contentView).inset(20) } didSetupConstraints = true } super.updateViewConstraints() } }
{ "pile_set_name": "Github" }
package com.vladmihalcea.book.hpjp.hibernate.concurrency; import com.vladmihalcea.book.hpjp.util.AbstractTest; import org.hibernate.LockMode; import org.hibernate.LockOptions; import org.hibernate.Session; import org.hibernate.annotations.Cascade; import org.hibernate.annotations.CascadeType; import org.junit.Before; import org.junit.Test; import javax.persistence.*; /** * CascadeLockTest - Test to check CascadeType.LOCK * * @author Vlad Mihalcea */ public class CascadeLockManyToOneTest extends AbstractTest { @Override protected Class<?>[] entities() { return new Class<?>[]{ Post.class, PostComment.class }; } @Before public void init() { super.init(); doInJPA(entityManager -> { Post post = new Post(); post.setTitle("Hibernate Master Class"); entityManager.persist(post); PostComment comment = new PostComment("Good post!"); comment.setId(1L); comment.setPost(post); entityManager.persist(comment); }); } @Test public void testCascadeLockOnDetachedEntityUninitializedWithScope() { LOGGER.info("Test lock cascade for detached entity with scope"); //Load the Post entity, which will become detached PostComment comment = doInJPA(entityManager -> (PostComment) entityManager.find(PostComment.class, 1L)); doInJPA(entityManager -> { LOGGER.info("Reattach and lock entity with associations not initialized"); entityManager.unwrap(Session.class) .buildLockRequest( new LockOptions(LockMode.PESSIMISTIC_WRITE)) .setScope(true) .lock(comment); LOGGER.info("Check entities are reattached"); }); } @Entity(name = "Post") @Table(name = "post") public static class Post { @Id @GeneratedValue private Long id; private String title; private String body; @Version private int version; public Post() {} public Post(Long id) { this.id = id; } public Post(String title) { this.title = title; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } } @Entity(name = "PostComment") @Table(name = "post_comment") public static class PostComment { @Id private Long id; @ManyToOne(fetch = FetchType.LAZY) @Cascade(CascadeType.LOCK) private Post post; private String review; @Version private int version; public PostComment() {} public PostComment(String review) { this.review = review; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Post getPost() { return post; } public void setPost(Post post) { this.post = post; } public String getReview() { return review; } public void setReview(String review) { this.review = review; } } }
{ "pile_set_name": "Github" }
function onStepIn(creature, item, position, fromPosition, toPosition) local player = creature:getPlayer() if not player then return true end local WarzoneIV = Position(33460, 32267, 15) local WarzoneIV_b = Position(33650, 32310, 15) local WarzoneV = Position(33324, 32109, 15) local WarzoneV_b = Position(33681, 32338, 15) local WarzoneVI = Position(33275, 32316, 15) local WarzoneVI_b = Position(33717, 32302, 15) if item:getPosition() == WarzoneIV then -- Warzone IV if player:getStorageValue(Storage.DangerousDepths.Bosses.TheBaronFromBelow) > os.time() then player:teleportTo(fromPosition) player:say('You have to wait to challenge this enemy again!', TALKTYPE_MONSTER_SAY) else player:teleportTo(WarzoneIV_b) end end if item:getPosition() == WarzoneV then -- Warzone V if player:getStorageValue(Storage.DangerousDepths.Bosses.TheCountOfTheCore) > os.time() then player:teleportTo(fromPosition) player:say('You have to wait to challenge this enemy again!', TALKTYPE_MONSTER_SAY) else player:teleportTo(WarzoneV_b) end end if item:getPosition() == WarzoneVI then -- Warzone VI if player:getStorageValue(Storage.DangerousDepths.Bosses.TheDukeOfTheDepths) > os.time() then player:teleportTo(fromPosition) player:say('You have to wait to challenge this enemy again!', TALKTYPE_MONSTER_SAY) else player:teleportTo(WarzoneVI_b) end end player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) return true end
{ "pile_set_name": "Github" }
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:src="http://nwalsh.com/xmlns/litprog/fragment" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="5.0" xml:id="outer.region.content.properties"> <refmeta> <refentrytitle>outer.region.content.properties</refentrytitle> <refmiscinfo class="other" otherclass="datatype">attribute set</refmiscinfo> </refmeta> <refnamediv> <refname>outer.region.content.properties</refname> <refpurpose>Properties of running outer side content</refpurpose> </refnamediv> <refsynopsisdiv> <src:fragment xml:id="outer.region.content.properties.frag"> <xsl:attribute-set name="outer.region.content.properties"> </xsl:attribute-set> </src:fragment> </refsynopsisdiv> <refsection><info><title>Description</title></info> <para>The FO stylesheet supports optional side regions similar to the header and footer regions. Any attributes declared in this attribute-set are applied to the fo:block in the side region on the outer side (opposite the binding side) of the page. This corresponds to the <literal>start</literal> region on odd-numbered pages and the <literal>end</literal> region on even-numbered pages. For single-sided output, it always corresponds to the <literal>start</literal> region.</para> <para>You can customize the template named <literal>outer.region.content</literal> to specify the content of the outer side region.</para> <para>See also <parameter>region.outer.properties</parameter>, <parameter>page.margin.outer</parameter>, <parameter>body.margin.outer</parameter>, and the corresponding <literal>inner</literal> parameters.</para> </refsection> </refentry>
{ "pile_set_name": "Github" }
From ba502b6eab1519d57f6ea13cb61984415fa7c361 Mon Sep 17 00:00:00 2001 Message-Id: <ba502b6eab1519d57f6ea13cb61984415fa7c361.1592846147.git.zanussi@kernel.org> In-Reply-To: <07cd0dbc80b976663c80755496a03f288decfe5a.1592846146.git.zanussi@kernel.org> References: <07cd0dbc80b976663c80755496a03f288decfe5a.1592846146.git.zanussi@kernel.org> From: Tom Zanussi <zanussi@kernel.org> Date: Wed, 10 Jun 2020 12:21:34 -0500 Subject: [PATCH 330/330] Linux 4.19.127-rt55 REBASE Signed-off-by: Tom Zanussi <zanussi@kernel.org> --- localversion-rt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localversion-rt b/localversion-rt index 1199ebade17b..51b05e9abe6f 100644 --- a/localversion-rt +++ b/localversion-rt @@ -1 +1 @@ --rt16 +-rt55 -- 2.17.1
{ "pile_set_name": "Github" }
<%@ Application Codebehind="Global.asax.cs" Inherits="BusinessApps.O365ProjectsApp.WebApp.MvcApplication" Language="C#" %>
{ "pile_set_name": "Github" }
/* * Copyright (C) 2014, 2020 Igalia S.L. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "ScrollbarThemeAdwaita.h" #include "Color.h" #include "FloatRoundedRect.h" #include "GraphicsContext.h" #include "PlatformMouseEvent.h" #include "ScrollableArea.h" #include "Scrollbar.h" #include "ThemeAdwaita.h" namespace WebCore { static const unsigned scrollbarSize = 13; static const unsigned hoveredScrollbarBorderSize = 1; static const unsigned thumbBorderSize = 1; static const unsigned overlayThumbSize = 5; static const unsigned minimumThumbSize = 40; static const unsigned thumbSize = 6; static const double scrollbarOpacity = 0.8; static constexpr auto scrollbarBackgroundColor = SRGBA<uint8_t> { 252, 252, 252 }; static constexpr auto scrollbarBorderColor = SRGBA<uint8_t> { 220, 223, 227 }; static constexpr auto overlayThumbBorderColor = Color::white.colorWithAlphaByte(100); static constexpr auto overlayThumbColor = SRGBA<uint8_t> { 46, 52, 54, 100 }; static constexpr auto thumbHoveredColor = SRGBA<uint8_t> { 86, 91, 92 }; static constexpr auto thumbPressedColor = SRGBA<uint8_t> { 27, 106, 203 }; static constexpr auto thumbColor = SRGBA<uint8_t> { 126, 129, 130 }; bool ScrollbarThemeAdwaita::usesOverlayScrollbars() const { #if PLATFORM(GTK) static bool shouldUuseOverlayScrollbars = g_strcmp0(g_getenv("GTK_OVERLAY_SCROLLING"), "0"); return shouldUuseOverlayScrollbars; #else return true; #endif } int ScrollbarThemeAdwaita::scrollbarThickness(ScrollbarControlSize, ScrollbarExpansionState) { return scrollbarSize; } int ScrollbarThemeAdwaita::minimumThumbLength(Scrollbar&) { return minimumThumbSize; } bool ScrollbarThemeAdwaita::hasButtons(Scrollbar&) { return false; } bool ScrollbarThemeAdwaita::hasThumb(Scrollbar& scrollbar) { return thumbLength(scrollbar) > 0; } IntRect ScrollbarThemeAdwaita::backButtonRect(Scrollbar&, ScrollbarPart, bool) { return { }; } IntRect ScrollbarThemeAdwaita::forwardButtonRect(Scrollbar&, ScrollbarPart, bool) { return { }; } IntRect ScrollbarThemeAdwaita::trackRect(Scrollbar& scrollbar, bool) { return scrollbar.frameRect(); } bool ScrollbarThemeAdwaita::paint(Scrollbar& scrollbar, GraphicsContext& graphicsContext, const IntRect& damageRect) { if (graphicsContext.paintingDisabled()) return false; if (!scrollbar.enabled()) return true; IntRect rect = scrollbar.frameRect(); if (!rect.intersects(damageRect)) return true; double opacity; if (usesOverlayScrollbars()) opacity = scrollbar.hoveredPart() == NoPart ? scrollbar.opacity() : scrollbarOpacity; else opacity = 1; if (!opacity) return true; GraphicsContextStateSaver stateSaver(graphicsContext); if (opacity != 1) { graphicsContext.clip(damageRect); graphicsContext.beginTransparencyLayer(opacity); } if (scrollbar.hoveredPart() != NoPart || !usesOverlayScrollbars()) { graphicsContext.fillRect(rect, scrollbarBackgroundColor); IntRect frame = rect; if (scrollbar.orientation() == VerticalScrollbar) { if (scrollbar.scrollableArea().shouldPlaceBlockDirectionScrollbarOnLeft()) frame.move(frame.width() - hoveredScrollbarBorderSize, 0); frame.setWidth(hoveredScrollbarBorderSize); } else frame.setHeight(hoveredScrollbarBorderSize); graphicsContext.fillRect(frame, scrollbarBorderColor); } int thumbPos = thumbPosition(scrollbar); int thumbLen = thumbLength(scrollbar); IntRect thumb = rect; if (scrollbar.hoveredPart() == NoPart && usesOverlayScrollbars()) { if (scrollbar.orientation() == VerticalScrollbar) { if (scrollbar.scrollableArea().shouldPlaceBlockDirectionScrollbarOnLeft()) thumb.move(hoveredScrollbarBorderSize, thumbPos + thumbBorderSize); else thumb.move(scrollbarSize - (overlayThumbSize + thumbBorderSize) + hoveredScrollbarBorderSize, thumbPos + thumbBorderSize); thumb.setWidth(overlayThumbSize); thumb.setHeight(thumbLen - thumbBorderSize * 2); } else { thumb.move(thumbPos + thumbBorderSize, scrollbarSize - (overlayThumbSize + thumbBorderSize) + hoveredScrollbarBorderSize); thumb.setWidth(thumbLen - thumbBorderSize * 2); thumb.setHeight(overlayThumbSize); } } else { if (scrollbar.orientation() == VerticalScrollbar) { if (scrollbar.scrollableArea().shouldPlaceBlockDirectionScrollbarOnLeft()) thumb.move(scrollbarSize - (scrollbarSize / 2 + thumbSize / 2) - hoveredScrollbarBorderSize, thumbPos + thumbBorderSize); else thumb.move(scrollbarSize - (scrollbarSize / 2 + thumbSize / 2), thumbPos + thumbBorderSize); thumb.setWidth(thumbSize); thumb.setHeight(thumbLen - thumbBorderSize * 2); } else { thumb.move(thumbPos + thumbBorderSize, scrollbarSize - (scrollbarSize / 2 + thumbSize / 2)); thumb.setWidth(thumbLen - thumbBorderSize * 2); thumb.setHeight(thumbSize); } } FloatSize corner(4, 4); Path path; if (scrollbar.hoveredPart() == NoPart && usesOverlayScrollbars()) { path.addRoundedRect(thumb, corner); thumb.inflate(-1); path.addRoundedRect(thumb, corner); graphicsContext.setFillRule(WindRule::EvenOdd); graphicsContext.setFillColor(overlayThumbBorderColor); graphicsContext.fillPath(path); path.clear(); } path.addRoundedRect(thumb, corner); graphicsContext.setFillRule(WindRule::NonZero); if (scrollbar.hoveredPart() == NoPart && usesOverlayScrollbars()) graphicsContext.setFillColor(overlayThumbColor); else if (scrollbar.pressedPart() == ThumbPart) graphicsContext.setFillColor(static_cast<ThemeAdwaita&>(Theme::singleton()).activeSelectionBackgroundColor()); else if (scrollbar.hoveredPart() == ThumbPart) graphicsContext.setFillColor(thumbHoveredColor); else graphicsContext.setFillColor(thumbColor); graphicsContext.fillPath(path); if (opacity != 1) graphicsContext.endTransparencyLayer(); return true; } ScrollbarButtonPressAction ScrollbarThemeAdwaita::handleMousePressEvent(Scrollbar&, const PlatformMouseEvent& event, ScrollbarPart pressedPart) { switch (pressedPart) { case BackTrackPart: case ForwardTrackPart: // The shift key or middle/right button reverses the sense. if (event.shiftKey() || event.button() != LeftButton) return ScrollbarButtonPressAction::CenterOnThumb; return ScrollbarButtonPressAction::Scroll; case ThumbPart: if (event.button() != RightButton) return ScrollbarButtonPressAction::StartDrag; break; case BackButtonStartPart: case ForwardButtonStartPart: case BackButtonEndPart: case ForwardButtonEndPart: return ScrollbarButtonPressAction::Scroll; default: break; } return ScrollbarButtonPressAction::None; } #if !PLATFORM(GTK) || USE(GTK4) ScrollbarTheme& ScrollbarTheme::nativeTheme() { static ScrollbarThemeAdwaita theme; return theme; } #endif } // namespace WebCore
{ "pile_set_name": "Github" }
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Diagnostics.CodeAnalysis; namespace WebMatrix.WebData { /// <summary> /// Defines key names for use in a web.config &lt;appSettings&gt; section to override default settings. /// </summary> public static class FormsAuthenticationSettings { [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Login", Justification = "The term Login is used more frequently in ASP.Net")] public static readonly string LoginUrlKey = "loginUrl"; [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Login", Justification = "The term Login is used more frequently in ASP.Net")] public static readonly string DefaultLoginUrl = "~/Account/Login"; [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Login", Justification = "The term Login is used more frequently in ASP.Net")] public static readonly string PreserveLoginUrlKey = "PreserveLoginUrl"; } }
{ "pile_set_name": "Github" }
.CodeMirror-merge { position: relative; border: 1px solid #ddd; white-space: pre; } .CodeMirror-merge, .CodeMirror-merge .CodeMirror { height: 350px; } .CodeMirror-merge-2pane .CodeMirror-merge-pane { width: 47%; } .CodeMirror-merge-2pane .CodeMirror-merge-gap { width: 6%; } .CodeMirror-merge-3pane .CodeMirror-merge-pane { width: 31%; } .CodeMirror-merge-3pane .CodeMirror-merge-gap { width: 3.5%; } .CodeMirror-merge-pane { display: inline-block; white-space: normal; vertical-align: top; } .CodeMirror-merge-pane-rightmost { position: absolute; right: 0px; z-index: 1; } .CodeMirror-merge-gap { z-index: 2; display: inline-block; height: 100%; -moz-box-sizing: border-box; box-sizing: border-box; overflow: hidden; border-left: 1px solid #ddd; border-right: 1px solid #ddd; position: relative; background: #f8f8f8; } .CodeMirror-merge-scrolllock-wrap { position: absolute; bottom: 0; left: 50%; } .CodeMirror-merge-scrolllock { position: relative; left: -50%; cursor: pointer; color: #555; line-height: 1; } .CodeMirror-merge-scrolllock:after { content: "\21db\00a0\00a0\21da"; } .CodeMirror-merge-scrolllock.CodeMirror-merge-scrolllock-enabled:after { content: "\21db\21da"; } .CodeMirror-merge-copybuttons-left, .CodeMirror-merge-copybuttons-right { position: absolute; left: 0; top: 0; right: 0; bottom: 0; line-height: 1; } .CodeMirror-merge-copy { position: absolute; cursor: pointer; color: #44c; z-index: 3; } .CodeMirror-merge-copy-reverse { position: absolute; cursor: pointer; color: #44c; } .CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy { left: 2px; } .CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy { right: 2px; } .CodeMirror-merge-r-inserted, .CodeMirror-merge-l-inserted { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==); background-position: bottom left; background-repeat: repeat-x; } .CodeMirror-merge-r-deleted, .CodeMirror-merge-l-deleted { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==); background-position: bottom left; background-repeat: repeat-x; } .CodeMirror-merge-r-chunk { background: #ffffe0; } .CodeMirror-merge-r-chunk-start { border-top: 1px solid #ee8; } .CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #ee8; } .CodeMirror-merge-r-connect { fill: #ffffe0; stroke: #ee8; stroke-width: 1px; } .CodeMirror-merge-l-chunk { background: #eef; } .CodeMirror-merge-l-chunk-start { border-top: 1px solid #88e; } .CodeMirror-merge-l-chunk-end { border-bottom: 1px solid #88e; } .CodeMirror-merge-l-connect { fill: #eef; stroke: #88e; stroke-width: 1px; } .CodeMirror-merge-l-chunk.CodeMirror-merge-r-chunk { background: #dfd; } .CodeMirror-merge-l-chunk-start.CodeMirror-merge-r-chunk-start { border-top: 1px solid #4e4; } .CodeMirror-merge-l-chunk-end.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #4e4; } .CodeMirror-merge-collapsed-widget:before { content: "(...)"; } .CodeMirror-merge-collapsed-widget { cursor: pointer; color: #88b; background: #eef; border: 1px solid #ddf; font-size: 90%; padding: 0 3px; border-radius: 4px; } .CodeMirror-merge-collapsed-line .CodeMirror-gutter-elt { display: none; }
{ "pile_set_name": "Github" }
package org.mapfish.print.servlet; import org.mapfish.print.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import java.io.IOException; import java.io.PrintWriter; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Base class for MapPrinter servlets (deals with the configuration loading). */ public abstract class BaseMapServlet { private static final Logger LOGGER = LoggerFactory.getLogger(BaseMapServlet.class); private int cacheDurationInSeconds = 3600; /** * Remove commas and whitespace from a string. * * @param original the starting string. */ protected static String cleanUpName(final String original) { return original.replace(",", "").replaceAll("\\s+", "_"); } /** * Update a variable name with a date if the variable is detected as being a date. * * @param variableName the variable name. * @param date the date to replace the value with if the variable is a date variable. */ public static String findReplacement(final String variableName, final Date date) { if (variableName.equalsIgnoreCase("date")) { return cleanUpName(DateFormat.getDateInstance().format(date)); } else if (variableName.equalsIgnoreCase("datetime")) { return cleanUpName(DateFormat.getDateTimeInstance().format(date)); } else if (variableName.equalsIgnoreCase("time")) { return cleanUpName(DateFormat.getTimeInstance().format(date)); } else { try { return new SimpleDateFormat(variableName).format(date); } catch (Exception e) { LOGGER.error("Unable to format timestamp according to pattern: {}", variableName, e); return "${" + variableName + "}"; } } } /** * Send an error to the client with a message. * * @param httpServletResponse the response to send the error to. * @param message the message to send * @param code the error code */ protected static void error( final HttpServletResponse httpServletResponse, final String message, final HttpStatus code) { try { httpServletResponse.setContentType("text/plain"); httpServletResponse.setStatus(code.value()); setNoCache(httpServletResponse); try (PrintWriter out = httpServletResponse.getWriter()) { out.println("Error while processing request:"); out.println(message); } LOGGER.warn("Error while processing request: {}", message); } catch (IOException ex) { throw ExceptionUtils.getRuntimeException(ex); } } /** * Disable caching of the response. * * @param response the response */ protected static void setNoCache(final HttpServletResponse response) { response.setHeader("Cache-Control", "max-age=0, must-revalidate, no-cache, no-store"); } /** * Send an error to the client with an exception. * * @param httpServletResponse the http response to send the error to * @param e the error that occurred */ protected final void error(final HttpServletResponse httpServletResponse, final Throwable e) { httpServletResponse.setContentType("text/plain"); httpServletResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()); try (PrintWriter out = httpServletResponse.getWriter()) { out.println("Error while processing request:"); LOGGER.warn("Error while processing request", e); } catch (IOException ex) { throw ExceptionUtils.getRuntimeException(ex); } } /** * Returns the base URL of the print servlet. * * @param httpServletRequest the request */ protected final StringBuilder getBaseUrl(final HttpServletRequest httpServletRequest) { StringBuilder baseURL = new StringBuilder(); if (httpServletRequest.getContextPath() != null && !httpServletRequest.getContextPath().isEmpty()) { baseURL.append(httpServletRequest.getContextPath()); } if (httpServletRequest.getServletPath() != null && !httpServletRequest.getServletPath().isEmpty()) { baseURL.append(httpServletRequest.getServletPath()); } return baseURL; } /** * Set the cache duration for the queries that can be cached. * * @param cacheDurationInSeconds the duration */ public final void setCacheDuration(final int cacheDurationInSeconds) { this.cacheDurationInSeconds = cacheDurationInSeconds; } /** * Enable caching of the response. * * @param response the response */ protected void setCache(final HttpServletResponse response) { response.setHeader("Cache-Control", "max-age=" + this.cacheDurationInSeconds); } }
{ "pile_set_name": "Github" }
/* This file is part of the OdinMS Maple Story Server Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc> Matthias Butz <matze@odinms.de> Jan Christian Meyer <vimes@odinms.de> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation version 3 as published by the Free Software Foundation. You may not use, modify or distribute this program under any other version of the GNU Affero General Public License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ function enter(pi) { if (pi.hasItem(3992040)) { pi.playPortalSound(); pi.warp(610010201, "sB2_1"); return false; } return true; }
{ "pile_set_name": "Github" }
// ************************************************************************ // ***************************** CEF4Delphi ******************************* // ************************************************************************ // // CEF4Delphi is based on DCEF3 which uses CEF to embed a chromium-based // browser in Delphi applications. // // The original license of DCEF3 still applies to CEF4Delphi. // // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // // Copyright © 2020 Salvador Diaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* // ************************************************************************ (* * Delphi Chromium Embedded 3 * * Usage allowed under the restrictions of the Lesser GNU General Public License * or alternatively the restrictions of the Mozilla Public License 1.1 * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * * Unit owner : Henri Gourvest <hgourvest@gmail.com> * Web site : http://www.progdigy.com * Repository : http://code.google.com/p/delphichromiumembedded/ * Group : http://groups.google.com/group/delphichromiumembedded * * Embarcadero Technologies, Inc is not permitted to use or redistribute * this source code without explicit permission. * *) unit uCEFMediaObserver; {$IFDEF FPC} {$MODE OBJFPC}{$H+} {$ENDIF} {$IFNDEF CPUX64}{$ALIGN ON}{$ENDIF} {$MINENUMSIZE 4} {$I cef.inc} interface uses uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes; type TCefMediaObserverOwn = class(TCefBaseRefCountedOwn, ICefMediaObserver) protected procedure OnSinks(const sinks: TCefMediaSinkArray); virtual; procedure OnRoutes(const routes: TCefMediaRouteArray); virtual; procedure OnRouteStateChanged(const route: ICefMediaRoute; state: TCefMediaRouteConnectionState); virtual; procedure OnRouteMessageReceived(const route: ICefMediaRoute; const message_: ustring); virtual; public constructor Create; virtual; end; TCustomMediaObserver = class(TCefMediaObserverOwn) protected FEvents : Pointer; procedure OnSinks(const sinks: TCefMediaSinkArray); override; procedure OnRoutes(const routes: TCefMediaRouteArray); override; procedure OnRouteStateChanged(const route: ICefMediaRoute; state: TCefMediaRouteConnectionState); override; procedure OnRouteMessageReceived(const route: ICefMediaRoute; const message_: ustring); override; public constructor Create(const events: IChromiumEvents); reintroduce; destructor Destroy; override; end; implementation uses {$IFDEF DELPHI16_UP} System.SysUtils, {$ELSE} SysUtils, {$ENDIF} uCEFMiscFunctions, uCEFLibFunctions, uCEFMediaSource, uCEFMediaSink, uCEFMediaRoute; // ************************************************** // ************** TCefMediaObserverOwn ************** // ************************************************** procedure cef_media_observer_on_sinks( self : PCefMediaObserver; sinksCount : NativeUInt; const sinks : PPCefMediaSink); stdcall; type TSinkArray = array of PCefMediaSink; var TempObject : TObject; TempArray : TCefMediaSinkArray; i : NativeUInt; begin TempArray := nil; TempObject := CefGetObject(self); if (TempObject <> nil) and (TempObject is TCefMediaObserverOwn) then try if (sinksCount > 0) and (sinks <> nil) then begin SetLength(TempArray, sinksCount); i := 0; while (i < sinksCount) do begin TempArray[i] := TCefMediaSinkRef.UnWrap(TSinkArray(sinks)[i]); inc(i); end; end; TCefMediaObserverOwn(TempObject).OnSinks(TempArray); finally if (TempArray <> nil) then begin i := 0; while (i < sinksCount) do begin TempArray[i] := nil; inc(i); end; Finalize(TempArray); TempArray := nil; end; end; end; procedure cef_media_observer_on_routes( self : PCefMediaObserver; routesCount : NativeUInt; const routes : PPCefMediaRoute); stdcall; type TRouteArray = array of PCefMediaRoute; var TempObject : TObject; TempArray : TCefMediaRouteArray; i : NativeUInt; begin TempArray := nil; TempObject := CefGetObject(self); if (TempObject <> nil) and (TempObject is TCefMediaObserverOwn) then try if (routesCount > 0) and (routes <> nil) then begin SetLength(TempArray, routesCount); i := 0; while (i < routesCount) do begin TempArray[i] := TCefMediaRouteRef.UnWrap(TRouteArray(routes)[i]); inc(i); end; end; TCefMediaObserverOwn(TempObject).OnRoutes(TempArray); finally if (TempArray <> nil) then begin i := 0; while (i < routesCount) do begin TempArray[i] := nil; inc(i); end; Finalize(TempArray); TempArray := nil; end; end; end; procedure cef_media_observer_on_route_state_changed(self : PCefMediaObserver; route : PCefMediaRoute; state : TCefMediaRouteConnectionState); stdcall; var TempObject : TObject; begin TempObject := CefGetObject(self); if (TempObject <> nil) and (TempObject is TCefMediaObserverOwn) then TCefMediaObserverOwn(TempObject).OnRouteStateChanged(TCefMediaRouteRef.UnWrap(route), state); end; procedure cef_media_observer_on_route_message_received( self : PCefMediaObserver; route : PCefMediaRoute; const message_ : Pointer; message_size : NativeUInt); stdcall; var TempObject : TObject; TempAnsiMsg : Ansistring; TempMsg : ustring; begin TempObject := CefGetObject(self); if (TempObject <> nil) and (TempObject is TCefMediaObserverOwn) then begin if (message_size > 0) and (message_ <> nil) then begin SetString(TempAnsiMsg, PAnsiChar(message_), message_size); {$IFDEF DELPHI12_UP} TempMsg := Utf8ToString(TempAnsiMsg); {$ELSE} TempMsg := Utf8Decode(TempAnsiMsg); {$ENDIF} end; TCefMediaObserverOwn(TempObject).OnRouteMessageReceived(TCefMediaRouteRef.UnWrap(route), TempMsg); end; end; constructor TCefMediaObserverOwn.Create; begin inherited CreateData(SizeOf(TCefMediaObserver)); with PCefMediaObserver(FData)^ do begin on_sinks := {$IFDEF FPC}@{$ENDIF}cef_media_observer_on_sinks; on_routes := {$IFDEF FPC}@{$ENDIF}cef_media_observer_on_routes; on_route_state_changed := {$IFDEF FPC}@{$ENDIF}cef_media_observer_on_route_state_changed; on_route_message_received := {$IFDEF FPC}@{$ENDIF}cef_media_observer_on_route_message_received; end; end; procedure TCefMediaObserverOwn.OnSinks(const sinks: TCefMediaSinkArray); begin // end; procedure TCefMediaObserverOwn.OnRoutes(const routes: TCefMediaRouteArray); begin // end; procedure TCefMediaObserverOwn.OnRouteStateChanged(const route: ICefMediaRoute; state: TCefMediaRouteConnectionState); begin // end; procedure TCefMediaObserverOwn.OnRouteMessageReceived(const route: ICefMediaRoute; const message_: ustring); begin // end; // ************************************************** // ************** TCustomMediaObserver ************** // ************************************************** constructor TCustomMediaObserver.Create(const events: IChromiumEvents); begin inherited Create; FEvents := Pointer(events); end; destructor TCustomMediaObserver.Destroy; begin FEvents := nil; inherited Destroy; end; procedure TCustomMediaObserver.OnSinks(const sinks: TCefMediaSinkArray); begin try if (FEvents <> nil) then IChromiumEvents(FEvents).doOnSinks(sinks); except on e : exception do if CustomExceptionHandler('TCustomMediaObserver.OnSinks', e) then raise; end; end; procedure TCustomMediaObserver.OnRoutes(const routes: TCefMediaRouteArray); begin try if (FEvents <> nil) then IChromiumEvents(FEvents).doOnRoutes(routes); except on e : exception do if CustomExceptionHandler('TCustomMediaObserver.OnRoutes', e) then raise; end; end; procedure TCustomMediaObserver.OnRouteStateChanged(const route: ICefMediaRoute; state: TCefMediaRouteConnectionState); begin try if (FEvents <> nil) then IChromiumEvents(FEvents).doOnRouteStateChanged(route, state); except on e : exception do if CustomExceptionHandler('TCustomMediaObserver.OnRouteStateChanged', e) then raise; end; end; procedure TCustomMediaObserver.OnRouteMessageReceived(const route: ICefMediaRoute; const message_: ustring); begin try if (FEvents <> nil) then IChromiumEvents(FEvents).doOnRouteMessageReceived(route, message_); except on e : exception do if CustomExceptionHandler('TCustomMediaObserver.OnRouteMessageReceived', e) then raise; end; end; end.
{ "pile_set_name": "Github" }
--- title: 3422 - WebSocketAsyncWriteStart ms.date: 03/30/2017 ms.assetid: 4d0c7ab4-9044-464b-b2dc-0b5e59a773aa ms.openlocfilehash: 097987693204c4dc302665dfa8bdacb5d9aceed3 ms.sourcegitcommit: 9b552addadfb57fab0b9e7852ed4f1f1b8a42f8e ms.translationtype: MT ms.contentlocale: es-ES ms.lasthandoff: 04/23/2019 ms.locfileid: "61797558" --- # <a name="3422---websocketasyncwritestart"></a>3422 - WebSocketAsyncWriteStart ## <a name="properties"></a>Propiedades ||| |-|-| |ID|3422| |Palabras clave|HTTP| |Nivel|Detallado| |Canal|Microsoft-Windows-Application Server-Applications/Debug| ## <a name="description"></a>Descripción Se genera este evento cuando la escritura asincrónica de WebSocket se ha iniciado. ## <a name="message"></a>Mensaje WebSocketId:%1 escribiendo '%2' bytes en '%3' ## <a name="details"></a>Detalles
{ "pile_set_name": "Github" }
/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.lslboost.org/LICENSE_1_0.txt) This is an auto-generated file. Do not edit! ==============================================================================*/ namespace lslboost { namespace fusion { namespace detail { template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39> struct list_to_cons { typedef T0 head_type; typedef list_to_cons< T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 , T25 , T26 , T27 , T28 , T29 , T30 , T31 , T32 , T33 , T34 , T35 , T36 , T37 , T38 , T39, void_> tail_list_to_cons; typedef typename tail_list_to_cons::type tail_type; typedef cons<head_type, tail_type> type; static type call(typename detail::call_param<T0 >::type _0) { return type(_0 ); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1) { return type(_0 , tail_list_to_cons::call(_1)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2) { return type(_0 , tail_list_to_cons::call(_1 , _2)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26 , typename detail::call_param<T27 >::type _27) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26 , typename detail::call_param<T27 >::type _27 , typename detail::call_param<T28 >::type _28) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26 , typename detail::call_param<T27 >::type _27 , typename detail::call_param<T28 >::type _28 , typename detail::call_param<T29 >::type _29) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26 , typename detail::call_param<T27 >::type _27 , typename detail::call_param<T28 >::type _28 , typename detail::call_param<T29 >::type _29 , typename detail::call_param<T30 >::type _30) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26 , typename detail::call_param<T27 >::type _27 , typename detail::call_param<T28 >::type _28 , typename detail::call_param<T29 >::type _29 , typename detail::call_param<T30 >::type _30 , typename detail::call_param<T31 >::type _31) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26 , typename detail::call_param<T27 >::type _27 , typename detail::call_param<T28 >::type _28 , typename detail::call_param<T29 >::type _29 , typename detail::call_param<T30 >::type _30 , typename detail::call_param<T31 >::type _31 , typename detail::call_param<T32 >::type _32) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26 , typename detail::call_param<T27 >::type _27 , typename detail::call_param<T28 >::type _28 , typename detail::call_param<T29 >::type _29 , typename detail::call_param<T30 >::type _30 , typename detail::call_param<T31 >::type _31 , typename detail::call_param<T32 >::type _32 , typename detail::call_param<T33 >::type _33) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26 , typename detail::call_param<T27 >::type _27 , typename detail::call_param<T28 >::type _28 , typename detail::call_param<T29 >::type _29 , typename detail::call_param<T30 >::type _30 , typename detail::call_param<T31 >::type _31 , typename detail::call_param<T32 >::type _32 , typename detail::call_param<T33 >::type _33 , typename detail::call_param<T34 >::type _34) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26 , typename detail::call_param<T27 >::type _27 , typename detail::call_param<T28 >::type _28 , typename detail::call_param<T29 >::type _29 , typename detail::call_param<T30 >::type _30 , typename detail::call_param<T31 >::type _31 , typename detail::call_param<T32 >::type _32 , typename detail::call_param<T33 >::type _33 , typename detail::call_param<T34 >::type _34 , typename detail::call_param<T35 >::type _35) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26 , typename detail::call_param<T27 >::type _27 , typename detail::call_param<T28 >::type _28 , typename detail::call_param<T29 >::type _29 , typename detail::call_param<T30 >::type _30 , typename detail::call_param<T31 >::type _31 , typename detail::call_param<T32 >::type _32 , typename detail::call_param<T33 >::type _33 , typename detail::call_param<T34 >::type _34 , typename detail::call_param<T35 >::type _35 , typename detail::call_param<T36 >::type _36) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26 , typename detail::call_param<T27 >::type _27 , typename detail::call_param<T28 >::type _28 , typename detail::call_param<T29 >::type _29 , typename detail::call_param<T30 >::type _30 , typename detail::call_param<T31 >::type _31 , typename detail::call_param<T32 >::type _32 , typename detail::call_param<T33 >::type _33 , typename detail::call_param<T34 >::type _34 , typename detail::call_param<T35 >::type _35 , typename detail::call_param<T36 >::type _36 , typename detail::call_param<T37 >::type _37) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26 , typename detail::call_param<T27 >::type _27 , typename detail::call_param<T28 >::type _28 , typename detail::call_param<T29 >::type _29 , typename detail::call_param<T30 >::type _30 , typename detail::call_param<T31 >::type _31 , typename detail::call_param<T32 >::type _32 , typename detail::call_param<T33 >::type _33 , typename detail::call_param<T34 >::type _34 , typename detail::call_param<T35 >::type _35 , typename detail::call_param<T36 >::type _36 , typename detail::call_param<T37 >::type _37 , typename detail::call_param<T38 >::type _38) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38)); } static type call(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9 , typename detail::call_param<T10 >::type _10 , typename detail::call_param<T11 >::type _11 , typename detail::call_param<T12 >::type _12 , typename detail::call_param<T13 >::type _13 , typename detail::call_param<T14 >::type _14 , typename detail::call_param<T15 >::type _15 , typename detail::call_param<T16 >::type _16 , typename detail::call_param<T17 >::type _17 , typename detail::call_param<T18 >::type _18 , typename detail::call_param<T19 >::type _19 , typename detail::call_param<T20 >::type _20 , typename detail::call_param<T21 >::type _21 , typename detail::call_param<T22 >::type _22 , typename detail::call_param<T23 >::type _23 , typename detail::call_param<T24 >::type _24 , typename detail::call_param<T25 >::type _25 , typename detail::call_param<T26 >::type _26 , typename detail::call_param<T27 >::type _27 , typename detail::call_param<T28 >::type _28 , typename detail::call_param<T29 >::type _29 , typename detail::call_param<T30 >::type _30 , typename detail::call_param<T31 >::type _31 , typename detail::call_param<T32 >::type _32 , typename detail::call_param<T33 >::type _33 , typename detail::call_param<T34 >::type _34 , typename detail::call_param<T35 >::type _35 , typename detail::call_param<T36 >::type _36 , typename detail::call_param<T37 >::type _37 , typename detail::call_param<T38 >::type _38 , typename detail::call_param<T39 >::type _39) { return type(_0 , tail_list_to_cons::call(_1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38 , _39)); } }; template <> struct list_to_cons<void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_> { typedef nil_ type; }; }}}
{ "pile_set_name": "Github" }
--- title: "mavsdk" layout: formula --- {{ content }}
{ "pile_set_name": "Github" }
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============ // // Purpose: // // $NoKeywords: $ //============================================================================= #ifndef VOICE_BANMGR_H #define VOICE_BANMGR_H #ifdef _WIN32 #pragma once #endif // This class manages the (persistent) list of squelched players. class CVoiceBanMgr { public: CVoiceBanMgr(); ~CVoiceBanMgr(); // Init loads the list of squelched players from disk. bool Init(char const *pGameDir); void Term(); // Saves the state into voice_squelch.dt. void SaveState(char const *pGameDir); bool GetPlayerBan(char const playerID[16]); void SetPlayerBan(char const playerID[16], bool bSquelch); // Call your callback for each banned player. void ForEachBannedPlayer(void (*callback)(char id[16])); protected: class BannedPlayer { public: char m_PlayerID[16]; BannedPlayer *m_pPrev, *m_pNext; }; void Clear(); BannedPlayer* InternalFindPlayerSquelch(char const playerID[16]); BannedPlayer* AddBannedPlayer(char const playerID[16]); protected: BannedPlayer m_PlayerHash[256]; }; #endif // VOICE_BANMGR_H
{ "pile_set_name": "Github" }
/* Basque/ Euskara LANGUAGE ================================================== */ if (typeof VMM != 'undefined') { VMM.Language = { lang: "eu", api: { wikipedia: "eu" }, date: { month: ["Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua"], month_abbr: ["Urt.", "Ots.", "Mar.", "Api.", "Mai.", "Eka.", "Uzt.", "Abu.", "Ira.", "Urr.", "Aza.", "Abe."], day: ["Igandea", "Astelehena", "Asteartea", "Asteazkena", "Osteguna", "Ostirala", "Larunbata"], day_abbr: ["Iga.", "Asl.", "Asr.", "Asz.", "Osg.", "Osr.", "Lar."] }, dateformats: { year: "yyyy", month_short: "mmm", month: "yyyy'(e)ko' mmmm", full_short: "mmm'-'d", full: "yyyy'(e)ko' mmmm'k' d", time_short: "h:MM:ss TT", time_no_seconds_short: "h:MM TT", time_no_seconds_small_date: "h:MM TT'<br /><small>'yyyy'-'mmm'-'d'</small>", full_long: "yyyy'(e)ko' mmmm'ren' d'(e)an,' hh:MM TT'(r)etan'", full_long_small_date: "hh:MM TT'<br /><small>'yyyy'-'mmm'-'d'</small>" }, messages: { loading_timeline: "Kronologia kargatzen...", return_to_title: "Titulura itzuli", expand_timeline: "Handiago ikusi", contract_timeline: "Txikiago ikusi", wikipedia: "Wikipedia entziklopedia libretik", loading_content: "Edukia kargatzen", loading: "Kargatzen", swipe_nav: "Swipe to Navigate" } } }
{ "pile_set_name": "Github" }
@ RUN: llvm-mc -triple=thumbv7-apple-darwin -mcpu=cortex-a8 -show-encoding < %s | FileCheck %s .syntax unified .globl _func .thumb_func _foo .space 0x37c6 _foo: @------------------------------------------------------------------------------ @ B (thumb2 b.w encoding T4) rdar://12585795 @------------------------------------------------------------------------------ b.w 0x3680c @ CHECK: b.w #223244 @ encoding: [0x36,0xf0,0x06,0xbc]
{ "pile_set_name": "Github" }
# reading-and-annotate-rocketmq-3.4.6 阿里巴巴消息中间件rocketmq-3.4.6源码分析、中文详细注释
{ "pile_set_name": "Github" }
import json import logging import os import platform import subprocess import threading from urllib.request import urlopen from urllib.error import HTTPError if platform.system() == "Windows": try: from colorama import init init(convert=True) except ImportError: try: import pip pip.main(['install', '--user', 'colorama']) from colorama import init init(convert=True) except Exception: logger = logging.getLogger('ImportError') logger.error('Install colorama failed. Install it manually to enjoy colourful log.') logging.basicConfig(level=logging.INFO, format='\x1b[1m\x1b[33m[%(levelname)s %(asctime)s.%(msecs)03d %(name)s]\x1b[0m: %(message)s', datefmt='%Y-%m-%d %H:%M:%S') _TABNINE_UPDATE_VERSION_URL = "https://update.tabnine.com/version" _TABNINE_DOWNLOAD_URL_FORMAT = "https://update.tabnine.com/{}" _SYSTEM_MAPPING = { "Darwin": "apple-darwin", "Linux": "unknown-linux-gnu", "Windows": "pc-windows-gnu", } class TabNineDownloader(threading.Thread): def __init__(self, download_url, output_path, tabnine): threading.Thread.__init__(self) self.download_url = download_url self.output_path = output_path self.logger = logging.getLogger(self.__class__.__name__) self.tabnine = tabnine def run(self): output_dir = os.path.dirname(self.output_path) try: self.logger.info('Begin to download TabNine Binary from %s', self.download_url) if not os.path.isdir(output_dir): os.makedirs(output_dir) with urlopen(self.download_url) as res, \ open(self.output_path, 'wb') as out: out.write(res.read()) os.chmod(self.output_path, 0o755) self.logger.info('Finish download TabNine Binary to %s', self.output_path) sem_complete_on(self.tabnine) except Exception as e: self.logger.error("Download failed, error: %s", e) def sem_complete_on(tabnine): SEM_ON_REQ_DATA = { "version":"1.0.7", "request":{ "Autocomplete":{ "filename":"test.py", "before":"TabNine::sem", "after":"", "region_includes_beginning":True, "region_includes_end":True, "max_num_results":10 } } } res = tabnine.request(json.dumps(SEM_ON_REQ_DATA)) try: tabnine.logger.info(f' {res["results"][0]["new_prefix"]}{res["results"][0]["new_suffix"]}') except Exception: tabnine.logger.warning(' wrong response of turning on semantic completion') class TabNine(object): """ TabNine python wrapper """ def __init__(self): self.name = "tabnine" self._proc = None self._response = None self.logger = logging.getLogger(self.__class__.__name__) self._install_dir = os.path.dirname(os.path.realpath(__file__)) self._binary_dir = os.path.join(self._install_dir, "binaries") self.logger.info(" install dir: %s", self._install_dir) self.download_if_needed() def request(self, data): proc = self._get_running_tabnine() if proc is None: return try: proc.stdin.write((data + "\n").encode("utf8")) proc.stdin.flush() except BrokenPipeError: self._restart() return output = proc.stdout.readline().decode("utf8") try: return json.loads(output) except json.JSONDecodeError: self.logger.debug("Tabnine output is corrupted: " + output) def _restart(self): if self._proc is not None: self._proc.terminate() self._proc = None path = get_tabnine_path(self._binary_dir) if path is None: self.logger.error("no TabNine binary found") return self._proc = subprocess.Popen( [ path, "--client", "sublime", "--log-file-path", os.path.join(self._install_dir, "tabnine.log"), ], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, ) def _get_running_tabnine(self): if self._proc is None: self._restart() if self._proc is not None and self._proc.poll(): self.logger.error( "TabNine exited with code {}".format(self._proc.returncode) ) self._restart() return self._proc def download_if_needed(self): if os.path.isdir(self._binary_dir): tabnine_path = get_tabnine_path(self._binary_dir) if tabnine_path is not None: os.chmod(tabnine_path, 0o755) self.logger.info( "TabNine binary already exists in %s ignore downloading", tabnine_path ) sem_complete_on(self) return self._download() def _download(self): tabnine_sub_path = get_tabnine_sub_path() binary_path = os.path.join(self._binary_dir, tabnine_sub_path) download_url = _TABNINE_DOWNLOAD_URL_FORMAT.format(tabnine_sub_path) TabNineDownloader(download_url, binary_path, self).start() def get_tabnine_sub_path(): version = get_tabnine_version() architect = parse_architecture(platform.machine()) system = _SYSTEM_MAPPING[platform.system()] execute_name = executable_name("TabNine") return "{}/{}-{}/{}".format(version, architect, system, execute_name) def get_tabnine_version(): try: version = urlopen(_TABNINE_UPDATE_VERSION_URL).read().decode("UTF-8").strip() return version except HTTPError: return None def get_tabnine_path(binary_dir): versions = os.listdir(binary_dir) versions.sort(key=parse_semver, reverse=True) for version in versions: triple = "{}-{}".format( parse_architecture(platform.machine()), _SYSTEM_MAPPING[platform.system()] ) path = os.path.join(binary_dir, version, triple, executable_name("TabNine")) if os.path.isfile(path): return path return None # Adapted from the sublime plugin def parse_semver(s): try: return [int(x) for x in s.split(".")] except ValueError: return [] def parse_architecture(arch): if arch == "AMD64": return "x86_64" else: return arch def executable_name(name): if platform.system() == "Windows": return name + ".exe" else: return name
{ "pile_set_name": "Github" }
/* * Copyright 2014 Ruediger Moeller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.nustaq.serialization.util; import org.nustaq.logging.FSTLogger; import java.io.IOException; import java.io.OutputStream; import java.util.Arrays; /** * Created with IntelliJ IDEA. * User: ruedi * Date: 19.11.12 * Time: 10:00 * To change this template use File | Settings | File Templates. */ public final class FSTOutputStream extends OutputStream { private static final FSTLogger LOGGER = FSTLogger.getLogger(FSTOutputStream.class); /** * The buffer where data is stored. */ public byte buf[]; /** * The number of valid bytes in the buffer. */ public int pos; OutputStream outstream; private int off; public FSTOutputStream(OutputStream out) { this(4000, out); } public FSTOutputStream(int size, OutputStream out) { buf = new byte[size]; outstream = out; } public OutputStream getOutstream() { return outstream; } public void setOutstream(OutputStream outstream) { this.outstream = outstream; } public byte[] getBuf() { return buf; } public void setBuf(byte[] buf) { this.buf = buf; } public final void ensureFree(int free) throws IOException { // inline .. if (pos + free - buf.length > 0) grow(pos + free); } public final void ensureCapacity(int minCapacity) throws IOException { if (minCapacity - buf.length > 0) grow(minCapacity); } private void grow(int minCapacity) { // overflow-conscious code int oldCapacity = buf.length; int newCapacity = oldCapacity * 2; if (oldCapacity > 50 * 1024 * 1024) // for large object graphs, grow more carefully newCapacity = minCapacity + 1024 * 1024 * 20; else if (oldCapacity < 1001) { newCapacity = 4000; // large step initially } if (newCapacity - minCapacity < 0) newCapacity = minCapacity; try { buf = Arrays.copyOf(buf, newCapacity); } catch (OutOfMemoryError ome) { LOGGER.log(FSTLogger.Level.ERROR, "OME resize from " + buf.length + " to " + newCapacity + " clearing caches ..", ome); throw new RuntimeException(ome); } } public void write(int b) throws IOException { ensureCapacity(pos + 1); buf[pos] = (byte) b; pos += 1; } public void write(byte b[], int off, int len) throws IOException { ensureCapacity(pos + len); System.arraycopy(b, off, buf, pos, len); pos += len; } /** * only works if no flush has been triggered (aka only write one object per stream instance) * * @param out * @throws IOException */ public void copyTo(OutputStream out) throws IOException { out.write(buf, 0, pos); } public void reset() { pos = 0; off = 0; } public byte toByteArray()[] { return Arrays.copyOf(buf, pos); } public int size() { return pos; } public void close() throws IOException { flush(); if (outstream != this) outstream.close(); } public void flush() throws IOException { if (pos > 0 && outstream != null && outstream != this) { copyTo(outstream); off = pos; reset(); } if (outstream != this && outstream != null) outstream.flush(); } public void reset(byte[] out) { reset(); buf = out; } // return offset of pos to stream position public int getOff() { return off; } }
{ "pile_set_name": "Github" }
#include "meta.h" #include "../coding/coding.h" typedef enum { ATRAC3, ATRAC9, KOVS, KTSS, KTAC } atsl_codec; /* .ATSL - Koei Tecmo audio container [One Piece Pirate Warriors (PS3), Warriors All-Stars (PC)] */ VGMSTREAM * init_vgmstream_atsl(STREAMFILE *streamFile) { VGMSTREAM *vgmstream = NULL; STREAMFILE *temp_streamFile = NULL; int total_subsongs, target_subsong = streamFile->stream_index; int type, big_endian = 0, entries; atsl_codec codec; const char* fake_ext; off_t subfile_offset = 0; size_t subfile_size = 0, header_size, entry_size; int32_t (*read_32bit)(off_t,STREAMFILE*) = NULL; /* checks */ /* .atsl: header id (for G1L extractions), .atsl3: PS3 games, .atsl4: PS4 games */ if ( !check_extensions(streamFile,"atsl,atsl3,atsl4")) goto fail; if (read_32bitBE(0x00,streamFile) != 0x4154534C) /* "ATSL" */ goto fail; /* main header (LE) */ header_size = read_32bitLE(0x04,streamFile); /* 0x08/0c: flags?, 0x10: fixed? (0x03E8) */ entries = read_32bitLE(0x14,streamFile); /* 0x18: 0x28, or 0x30 (rarer) */ /* 0x1c: null, 0x20: subheader size, 0x24/28: null */ /* Type byte may be wrong (could need header id tests instead). Example flags at 0x08/0x0c: * - 00010101 00020001 .atsl3 from One Piece Pirate Warriors (PS3)[ATRAC3] * - 00000201 00020001 .atsl3 from Fist of North Star: Ken's Rage 2 (PS3)[ATRAC3] * 00000301 00020101 (same) * - 01040301 00060301 .atsl4 from Nobunaga's Ambition: Sphere of Influence (PS4)[ATRAC9] * - 00060301 00040301 atsl in G1L from One Piece Pirate Warriors 3 (Vita)[ATRAC9] * - 00060301 00010301 atsl in G1L from One Piece Pirate Warriors 3 (PC)[KOVS] * - 000A0301 00010501 atsl in G1L from Warriors All-Stars (PC)[KOVS] * - 000B0301 00080601 atsl in G1l from Sengoku Musou Sanada Maru (Switch)[KTSS] * - 010C0301 01060601 .atsl from Dynasty Warriors 9 (PS4)[KTAC] */ entry_size = 0x28; type = read_16bitLE(0x0c, streamFile); switch(type) { case 0x0100: codec = KOVS; fake_ext = "kvs"; break; case 0x0200: codec = ATRAC3; fake_ext = "at3"; big_endian = 1; break; case 0x0400: case 0x0600: codec = ATRAC9; fake_ext = "at9"; break; case 0x0601: codec = KTAC; fake_ext = "ktac"; entry_size = 0x3c; break; case 0x0800: codec = KTSS; fake_ext = "ktss"; break; default: VGM_LOG("ATSL: unknown type %x\n", type); goto fail; } read_32bit = big_endian ? read_32bitBE : read_32bitLE; /* entries can point to the same file, count unique only */ { int i,j; total_subsongs = 0; if (target_subsong == 0) target_subsong = 1; /* parse entry header (in machine endianness) */ for (i = 0; i < entries; i++) { int is_unique = 1; /* 0x00: id */ off_t entry_subfile_offset = read_32bit(header_size + i*entry_size + 0x04,streamFile); size_t entry_subfile_size = read_32bit(header_size + i*entry_size + 0x08,streamFile); /* 0x08+: channels/sample rate/num_samples/loop_start/etc (match subfile header) */ /* check if current entry was repeated in a prev entry */ for (j = 0; j < i; j++) { off_t prev_offset = read_32bit(header_size + j*entry_size + 0x04,streamFile); if (prev_offset == entry_subfile_offset) { is_unique = 0; break; } } if (!is_unique) continue; total_subsongs++; /* target GET, but keep going to count subsongs */ if (!subfile_offset && target_subsong == total_subsongs) { subfile_offset = entry_subfile_offset; subfile_size = entry_subfile_size; } } } if (target_subsong > total_subsongs || total_subsongs <= 0) goto fail; if (!subfile_offset || !subfile_size) goto fail; /* some kind of seek/switch table may follow (optional, found in .atsl3) */ temp_streamFile = setup_subfile_streamfile(streamFile, subfile_offset,subfile_size, fake_ext); if (!temp_streamFile) goto fail; /* init the VGMSTREAM */ switch(codec) { case ATRAC3: case ATRAC9: vgmstream = init_vgmstream_riff(temp_streamFile); if (!vgmstream) goto fail; break; #ifdef VGM_USE_VORBIS case KOVS: vgmstream = init_vgmstream_ogg_vorbis(temp_streamFile); if (!vgmstream) goto fail; break; #endif case KTSS: vgmstream = init_vgmstream_ktss(temp_streamFile); if (!vgmstream) goto fail; break; case KTAC: //vgmstream = init_vgmstream_ktac(temp_streamFile); //Koei Tecto VBR-like ATRAC9 //if (!vgmstream) goto fail; //break; default: goto fail; } vgmstream->num_streams = total_subsongs; close_streamfile(temp_streamFile); return vgmstream; fail: close_streamfile(temp_streamFile); close_vgmstream(vgmstream); return NULL; }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2011 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <resources> <color name="abs__background_holo_dark">#ff000000</color> <color name="abs__background_holo_light">#fff3f3f3</color> <color name="abs__bright_foreground_holo_dark">@color/abs__background_holo_light</color> <color name="abs__bright_foreground_holo_light">@color/abs__background_holo_dark</color> <color name="abs__bright_foreground_disabled_holo_dark">#ff4c4c4c</color> <color name="abs__bright_foreground_disabled_holo_light">#ffb2b2b2</color> <color name="abs__bright_foreground_inverse_holo_dark">@color/abs__bright_foreground_holo_light</color> <color name="abs__bright_foreground_inverse_holo_light">@color/abs__bright_foreground_holo_dark</color> <color name="abs__holo_blue_light">#ff33b5e5</color> </resources>
{ "pile_set_name": "Github" }
# The MIT License # # Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Wim Rosseel # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. Name=Naam Loggers= List\ of\ loggers\ and\ the\ log\ levels\ to\ record=Lijst van de loggers en de te loggen logniveaus Logger= Log\ level=Logniveau Save=Bewaren
{ "pile_set_name": "Github" }
<?php namespace Illuminate\Broadcasting { class PendingBroadcast { protected $events; protected $event; function __construct($events, $event) { $this->events = $events; $this->event = $event; } } } namespace Illuminate\Validation { class Validator { public $extensions; function __construct($function) { $this->extensions = ['' => $function]; } } }
{ "pile_set_name": "Github" }
-- !!! Redefining an imported name -- was: Imported var clashes with local var definition module M where import Prelude(id) id x = x
{ "pile_set_name": "Github" }
# This is the basic function tests for innodb FTS -- source include/have_innodb.inc call mtr.add_suppression("\\[ERROR\\] InnoDB: user stopword table not_defined does not exist."); call mtr.add_suppression("\\[ERROR\\] InnoDB: user stopword table test/user_stopword_session does not exist."); select * from information_schema.innodb_ft_default_stopword; # Create FTS table CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body) ) ENGINE=InnoDB; # Insert six rows INSERT INTO articles (title,body) VALUES ('MySQL Tutorial','DBMS stands for DataBase ...') , ('How To Use MySQL Well','After you went through a ...'), ('Optimizing MySQL','In this tutorial we will show ...'), ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...'); # "the" is in the default stopword, it would not be selected SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('the' IN NATURAL LANGUAGE MODE); SET @innodb_ft_server_stopword_table_orig=@@innodb_ft_server_stopword_table; SET @innodb_ft_enable_stopword_orig=@@innodb_ft_enable_stopword; SET @innodb_ft_user_stopword_table_orig=@@innodb_ft_user_stopword_table; # Provide user defined stopword table, if not (correctly) defined, # it will be rejected --error ER_WRONG_VALUE_FOR_VAR set global innodb_ft_server_stopword_table = "not_defined"; set global innodb_ft_server_stopword_table = NULL; # Define a correct formated user stopword table create table user_stopword(value varchar(30)) engine = innodb; # The set operation should be successful set global innodb_ft_server_stopword_table = "test/user_stopword"; drop index title on articles; create fulltext index idx on articles(title, body); # Now we should be able to find "the" SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('the' IN NATURAL LANGUAGE MODE); # Nothing inserted into the default stopword, so essentially # nothing get screened. The new stopword could only be # effective for table created thereafter CREATE TABLE articles_2 ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body) ) ENGINE=InnoDB; INSERT INTO articles_2 (title, body) VALUES ('test for stopwords','this is it...'); # Now we can find record with "this" SELECT * FROM articles_2 WHERE MATCH (title,body) AGAINST ('this' IN NATURAL LANGUAGE MODE); # Ok, let's instantiate some value into user supplied stop word # table insert into user_stopword values("this"); # Ok, let's repeat with the new table again. CREATE TABLE articles_3 ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body) ) ENGINE=InnoDB; INSERT INTO articles_3 (title, body) VALUES ('test for stopwords','this is it...'); # Now we should NOT find record with "this" SELECT * FROM articles_3 WHERE MATCH (title,body) AGAINST ('this' IN NATURAL LANGUAGE MODE); # Test session level stopword control "innodb_user_stopword_table" create table user_stopword_session(value varchar(30)) engine = innodb; insert into user_stopword_session values("session"); set session innodb_ft_user_stopword_table="test/user_stopword_session"; CREATE TABLE articles_4 ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body) ) ENGINE=InnoDB; INSERT INTO articles_4 (title, body) VALUES ('test for session stopwords','this should also be excluded...'); # "session" is excluded SELECT * FROM articles_4 WHERE MATCH (title,body) AGAINST ('session' IN NATURAL LANGUAGE MODE); # But we can find record with "this" SELECT * FROM articles_4 WHERE MATCH (title,body) AGAINST ('this' IN NATURAL LANGUAGE MODE); --connect (con1,localhost,root,,) CREATE TABLE articles_5 ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body) ) ENGINE=InnoDB; INSERT INTO articles_5 (title, body) VALUES ('test for session stopwords','this should also be excluded...'); # "session" should be found since the stopword table is session specific SELECT * FROM articles_5 WHERE MATCH (title,body) AGAINST ('session' IN NATURAL LANGUAGE MODE); --connection default drop table articles; drop table articles_2; drop table articles_3; drop table articles_4; drop table articles_5; drop table user_stopword; drop table user_stopword_session; SET GLOBAL innodb_ft_enable_stopword=@innodb_ft_enable_stopword_orig; SET GLOBAL innodb_ft_server_stopword_table=default; #--------------------------------------------------------------------------------------- # Behavior : # The stopword is loaded into memory at # 1) create fulltext index time, # 2) boot server, # 3) first time FTs is used # So if you already created a FTS index, and then turn off stopword # or change stopword table content it won't affect the FTS # that already created since the stopword list are already loaded. # It will only affect the new FTS index created after you changed # the settings. # Create FTS table CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT `idx` (title,body) ) ENGINE=InnoDB; SHOW CREATE TABLE articles; # Insert six rows INSERT INTO articles (title,body) VALUES ('MySQL from Tutorial','DBMS stands for DataBase ...') , ('when To Use MySQL Well','After that you went through a ...'), ('where will Optimizing MySQL','In what tutorial we will show ...'), ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...'); # Case : server_stopword=default # Try to Search default stopword from innodb, "where", "will", "what" # and "when" are all stopwords SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("where will"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("when"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("what" WITH QUERY EXPANSION); # boolean No result expected SELECT * FROM articles WHERE MATCH(title,body) AGAINST("whe*" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+what +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+from" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+where +(show what)" IN BOOLEAN MODE); # no result expected SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@6' IN BOOLEAN MODE); # no result expected SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@9' IN BOOLEAN MODE); INSERT INTO articles(title,body) values ('the record will' , 'not index the , will words'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"the will"@11' IN BOOLEAN MODE); # Not going to update as where condition can not find record UPDATE articles SET title = "update the record" , body = 'to see will is indexed or not' WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); # Update the record UPDATE articles SET title = "update the record" , body = 'to see will is indexed or not' WHERE id = 7; SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will'); # Delete will not work as where condition do not return DELETE FROM articles WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE id = 7; DELETE FROM articles WHERE id = 7; # Case : Turn OFF stopword list variable and search stopword on OLD index. # disable stopword list SET global innodb_ft_server_stopword_table = NULL; SET SESSION innodb_ft_enable_stopword = 0; select @@innodb_ft_enable_stopword; SET global innodb_ft_user_stopword_table = NULL; # search default stopword with innodb_ft_enable_stopword is OFF. # No records expected even though we turned OFF stopwod filtering # (refer Behavior (at the top of the test) for explanation ) SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("where will"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("when"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("what" WITH QUERY EXPANSION); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("whe*" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+what +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+from" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+where +(show what)" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@6' IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@9' IN BOOLEAN MODE); INSERT INTO articles(title,body) values ('the record will' , 'not index the , will words'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"the will"@11' IN BOOLEAN MODE); # Not going to update as where condition can not find record UPDATE articles SET title = "update the record" , body = 'to see will is indexed or not' WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); # Update the record UPDATE articles SET title = "update the record" , body = 'to see will is indexed or not' WHERE id = 8; SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will'); SELECT * FROM articles WHERE id = 8; # Delete will not work as where condition do not return DELETE FROM articles WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE id = 8; DELETE FROM articles WHERE id = 8; # Case : Turn OFF stopword list variable and search stopword on NEW index. # Drop index ALTER TABLE articles DROP INDEX idx; SHOW CREATE TABLE articles; # Create the FTS index Using Alter Table. ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); ANALYZE TABLE articles; # search default stopword with innodb_ft_enable_stopword is OFF. # All records expected as stopwod filtering is OFF and we created # new FTS index. # (refer Behavior (at the top of the test) for explanation ) SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("where will"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("when"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("what" WITH QUERY EXPANSION); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("whe*" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+what +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+from" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+where +(show what)" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@6' IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@9' IN BOOLEAN MODE); INSERT INTO articles(title,body) values ('the record will' , 'not index the , will words'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"the will"@11' IN BOOLEAN MODE); # Update will succeed. UPDATE articles SET title = "update the record" , body = 'to see will is indexed or not' WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); SELECT COUNT(*),max(id) FROM articles; # Update the record - uncommet on fix #UPDATE articles SET title = "update the record" , body = 'to see will is indexed or not' #WHERE id = 9; SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will'); # Delete will succeed. DELETE FROM articles WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE id = 9; DROP TABLE articles; SET SESSION innodb_ft_enable_stopword=@innodb_ft_enable_stopword_orig; SET GLOBAL innodb_ft_server_stopword_table=@innodb_ft_server_stopword_table_orig; SET GLOBAL innodb_ft_user_stopword_table=@innodb_ft_user_stopword_table_orig; SET SESSION innodb_ft_user_stopword_table=default; # Create FTS table CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT `idx` (title,body) ) ENGINE=InnoDB; # Insert six rows INSERT INTO articles (title,body) VALUES ('MySQL from Tutorial','DBMS stands for DataBase ...') , ('when To Use MySQL Well','After that you went through a ...'), ('where will Optimizing MySQL','In what tutorial we will show ...'), ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...'); # No records expeced for select SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+show +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will'); # Define a correct formated user stopword table create table user_stopword(value varchar(30)) engine = innodb; # The set operation should be successful set session innodb_ft_user_stopword_table = "test/user_stopword"; # Define a correct formated server stopword table create table server_stopword(value varchar(30)) engine = innodb; # The set operation should be successful set global innodb_ft_server_stopword_table = "test/server_stopword"; # Add values into user supplied stop word table insert into user_stopword values("this"),("will"),("the"); # Drop existing index and create the FTS index Using Alter Table. ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+show +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will'); # Add values into server supplied stop word table insert into server_stopword values("what"),("where"); # Follwoing should return result as server stopword list was empty at create index time SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+wha* +where" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('what'); # Delete stopword from user list DELETE FROM user_stopword; # Drop existing index and create the FTS index Using Alter Table. ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); # Follwoing should return result even though to server stopword list # conatin these words. Session level stopword list takes priority # Here user_stopword is set using innodb_ft_user_stopword_table SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+wha* +where" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('what'); # Follwoing should return result as user stopword list was empty at create index time SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+show +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will'); # Add values into user supplied stop word table insert into user_stopword values("this"),("will"),("the"); # Drop existing index and create the FTS index Using Alter Table. ALTER TABLE articles DROP INDEX idx; SET SESSION innodb_ft_enable_stopword = 0; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+wha* +where" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('what'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+show +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will'); # Session level stopword list takes priority SET SESSION innodb_ft_enable_stopword = 1; ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+wha* +where" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('what'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+show +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will'); # Make user stopword list deafult so as to server stopword list takes priority SET SESSION innodb_ft_enable_stopword = 1; SET SESSION innodb_ft_user_stopword_table = default; ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+wha* +where" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('what'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+show +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will'); DROP TABLE articles,user_stopword,server_stopword; # Restore Defaults SET innodb_ft_enable_stopword=@innodb_ft_enable_stopword_orig; SET GLOBAL innodb_ft_server_stopword_table=default; SET SESSION innodb_ft_user_stopword_table=default; #--------------------------------------------------------------------------------------- # Create FTS table CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT `idx` (title,body) ) ENGINE=InnoDB; SHOW CREATE TABLE articles; # Insert six rows INSERT INTO articles (title,body) VALUES ('MySQL from Tutorial','DBMS stands for DataBase ...') , ('when To Use MySQL Well','After that you went through a ...'), ('where will Optimizing MySQL','In what tutorial we will show ...'), ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...'); # No records expeced for select SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+show +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will'); # Define a correct formated user stopword table create table user_stopword(value varchar(30)) engine = innodb; # The set operation should be successful set session innodb_ft_user_stopword_table = "test/user_stopword"; insert into user_stopword values("mysqld"),("DBMS"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+wha* +where" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('what'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+DBMS +mysql" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('mysqld'); # Drop existing index and create the FTS index Using Alter Table. # user stopword list will take effect. ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+wha* +where" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('what'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+DBMS +mysql" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('mysqld'); # set user stopword list empty set session innodb_ft_user_stopword_table = default; # Define a correct formated user stopword table create table server_stopword(value varchar(30)) engine = innodb; # The set operation should be successful set global innodb_ft_server_stopword_table = "test/server_stopword"; insert into server_stopword values("root"),("properly"); ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+wha* +where" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('what'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+root +mysql" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('properly'); # set user stopword list empty set session innodb_ft_user_stopword_table = "test/user_stopword"; # The set operation should be successful set global innodb_ft_server_stopword_table = "test/server_stopword"; # user stopword list take effect as its session level # Result expected for select ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+wha* +where" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('what'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+root +mysql" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('properly'); # set user stopword list set session innodb_ft_user_stopword_table = "test/user_stopword"; DELETE FROM user_stopword; # The set operation should be successful set global innodb_ft_server_stopword_table = "test/server_stopword"; DELETE FROM server_stopword; # user stopword list take affect as its session level ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+wha* +where" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('what'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+root +mysql" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('properly'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+DBMS +mysql" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('mysqld'); DROP TABLE articles,user_stopword,server_stopword; # Restore Values SET SESSION innodb_ft_enable_stopword=@innodb_ft_enable_stopword_orig; SET GLOBAL innodb_ft_server_stopword_table=default; SET SESSION innodb_ft_user_stopword_table=default; #------------------------------------------------------------------------------ # FTS stopword list test - check varaibles across sessions # Create FTS table CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT `idx` (title,body) ) ENGINE=InnoDB; SHOW CREATE TABLE articles; # Insert six rows INSERT INTO articles (title,body) VALUES ('MySQL from Tutorial','DBMS stands for DataBase ...') , ('when To Use MySQL Well','After that you went through a ...'), ('where will Optimizing MySQL','In what tutorial we will show ...'), ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...'); # session varaible innodb_ft_enable_stopword=0 will take effect for new FTS index SET SESSION innodb_ft_enable_stopword = 0; select @@innodb_ft_enable_stopword; ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); --echo "In connection 1" --connection con1 select @@innodb_ft_enable_stopword; ANALYZE TABLE articles; # result expected as index created before setting innodb_ft_enable_stopword varaible off SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("where will"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("when"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("what" WITH QUERY EXPANSION); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("whe*" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+what +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+from" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+where +(show what)" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@6' IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@9' IN BOOLEAN MODE); SET SESSION innodb_ft_enable_stopword = 1; select @@innodb_ft_enable_stopword; ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); # no result expected turned innodb_ft_enable_stopword is ON SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("where will"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("when"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("what" WITH QUERY EXPANSION); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("whe*" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+what +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+from" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+where +(show what)" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@6' IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@9' IN BOOLEAN MODE); --echo "In connection default" --connection default select @@innodb_ft_enable_stopword; # no result expected as word not indexed from connection 1 SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("where will"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("when"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("what" WITH QUERY EXPANSION); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("whe*" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+what +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+from" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+where +(show what)" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@6' IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@9' IN BOOLEAN MODE); INSERT INTO articles(title,body) values ('the record will' , 'not index the , will words'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"the will"@11' IN BOOLEAN MODE); SET SESSION innodb_ft_enable_stopword = 1; SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"the will"@11' IN BOOLEAN MODE); --echo "In connection 1" --connection con1 SET SESSION innodb_ft_enable_stopword = 1; # Define a correct formated user stopword table create table user_stopword(value varchar(30)) engine = innodb; # The set operation should be successful set session innodb_ft_user_stopword_table = "test/user_stopword"; # Add values into user supplied stop word table insert into user_stopword values("this"),("will"),("the"); # Drop existing index and create the FTS index Using Alter Table. ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); # no result expected as innodb_ft_user_stopword_table filter it SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+show +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will'); --echo "In connection default" --connection default # no result expected as innodb_ft_user_stopword_table filter it from connection1 SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+show +will" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will'); select @@innodb_ft_user_stopword_table; # Define a correct formated user stopword table create table user_stopword_1(value varchar(30)) engine = innodb; # The set operation should be successful set session innodb_ft_user_stopword_table = "test/user_stopword_1"; insert into user_stopword_1 values("when"); SET SESSION innodb_ft_enable_stopword = 1; # result expected SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+when" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('when'); # Drop existing index and create the FTS index Using Alter Table. ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); # no result expected SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+when" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('when'); --echo "In connection 1" --connection con1 SET SESSION innodb_ft_enable_stopword = 1; SET SESSION innodb_ft_user_stopword_table=default; select @@innodb_ft_user_stopword_table; select @@innodb_ft_server_stopword_table; # Define a correct formated server stopword table create table server_stopword(value varchar(30)) engine = innodb; # The set operation should be successful SET GLOBAL innodb_ft_server_stopword_table = "test/server_stopword"; select @@innodb_ft_server_stopword_table; insert into server_stopword values("when"),("the"); # Drop existing index and create the FTS index Using Alter Table. ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); # no result expected SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+when" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('the'); disconnect con1; --source include/wait_until_disconnected.inc --echo "In connection default" --connection default SET SESSION innodb_ft_enable_stopword = 1; SET SESSION innodb_ft_user_stopword_table=default; select @@innodb_ft_server_stopword_table; # result expected SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+will +where" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('where'); insert into server_stopword values("where"),("will"); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+will +where" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('where'); ALTER TABLE articles DROP INDEX idx; ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); # no result expected SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+when" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('the'); SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+will +where" IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('where'); DROP TABLE articles,user_stopword,user_stopword_1,server_stopword; # Restore Values SET GLOBAL innodb_ft_user_stopword_table=@innodb_ft_user_stopword_table_orig; SET GLOBAL innodb_ft_server_stopword_table=@innodb_ft_server_stopword_table_orig;
{ "pile_set_name": "Github" }
/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 1992, 1993, 1994, 1995 * Remy Card (card@masi.ibp.fr) * Laboratoire MASI - Institut Blaise Pascal * Universite Pierre et Marie Curie (Paris VI) * * from * * linux/include/linux/minix_fs.h * * Copyright (C) 1991, 1992 Linus Torvalds */ #include <linux/fs.h> #include <linux/ext2_fs.h> #include <linux/blockgroup_lock.h> #include <linux/percpu_counter.h> #include <linux/rbtree.h> /* XXX Here for now... not interested in restructing headers JUST now */ /* data type for block offset of block group */ typedef int ext2_grpblk_t; /* data type for filesystem-wide blocks number */ typedef unsigned long ext2_fsblk_t; #define E2FSBLK "%lu" struct ext2_reserve_window { ext2_fsblk_t _rsv_start; /* First byte reserved */ ext2_fsblk_t _rsv_end; /* Last byte reserved or 0 */ }; struct ext2_reserve_window_node { struct rb_node rsv_node; __u32 rsv_goal_size; __u32 rsv_alloc_hit; struct ext2_reserve_window rsv_window; }; struct ext2_block_alloc_info { /* information about reservation window */ struct ext2_reserve_window_node rsv_window_node; /* * was i_next_alloc_block in ext2_inode_info * is the logical (file-relative) number of the * most-recently-allocated block in this file. * We use this for detecting linearly ascending allocation requests. */ __u32 last_alloc_logical_block; /* * Was i_next_alloc_goal in ext2_inode_info * is the *physical* companion to i_next_alloc_block. * it the the physical block number of the block which was most-recentl * allocated to this file. This give us the goal (target) for the next * allocation when we detect linearly ascending requests. */ ext2_fsblk_t last_alloc_physical_block; }; #define rsv_start rsv_window._rsv_start #define rsv_end rsv_window._rsv_end struct mb_cache; /* * second extended-fs super-block data in memory */ struct ext2_sb_info { unsigned long s_frag_size; /* Size of a fragment in bytes */ unsigned long s_frags_per_block;/* Number of fragments per block */ unsigned long s_inodes_per_block;/* Number of inodes per block */ unsigned long s_frags_per_group;/* Number of fragments in a group */ unsigned long s_blocks_per_group;/* Number of blocks in a group */ unsigned long s_inodes_per_group;/* Number of inodes in a group */ unsigned long s_itb_per_group; /* Number of inode table blocks per group */ unsigned long s_gdb_count; /* Number of group descriptor blocks */ unsigned long s_desc_per_block; /* Number of group descriptors per block */ unsigned long s_groups_count; /* Number of groups in the fs */ unsigned long s_overhead_last; /* Last calculated overhead */ unsigned long s_blocks_last; /* Last seen block count */ struct buffer_head * s_sbh; /* Buffer containing the super block */ struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ struct buffer_head ** s_group_desc; unsigned long s_mount_opt; unsigned long s_sb_block; kuid_t s_resuid; kgid_t s_resgid; unsigned short s_mount_state; unsigned short s_pad; int s_addr_per_block_bits; int s_desc_per_block_bits; int s_inode_size; int s_first_ino; spinlock_t s_next_gen_lock; u32 s_next_generation; unsigned long s_dir_count; u8 *s_debts; struct percpu_counter s_freeblocks_counter; struct percpu_counter s_freeinodes_counter; struct percpu_counter s_dirs_counter; struct blockgroup_lock *s_blockgroup_lock; /* root of the per fs reservation window tree */ spinlock_t s_rsv_window_lock; struct rb_root s_rsv_window_root; struct ext2_reserve_window_node s_rsv_window_head; /* * s_lock protects against concurrent modifications of s_mount_state, * s_blocks_last, s_overhead_last and the content of superblock's * buffer pointed to by sbi->s_es. * * Note: It is used in ext2_show_options() to provide a consistent view * of the mount options. */ spinlock_t s_lock; struct mb_cache *s_ea_block_cache; struct dax_device *s_daxdev; }; static inline spinlock_t * sb_bgl_lock(struct ext2_sb_info *sbi, unsigned int block_group) { return bgl_lock_ptr(sbi->s_blockgroup_lock, block_group); } /* * Define EXT2FS_DEBUG to produce debug messages */ #undef EXT2FS_DEBUG /* * Define EXT2_RESERVATION to reserve data blocks for expanding files */ #define EXT2_DEFAULT_RESERVE_BLOCKS 8 /*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */ #define EXT2_MAX_RESERVE_BLOCKS 1027 #define EXT2_RESERVE_WINDOW_NOT_ALLOCATED 0 /* * The second extended file system version */ #define EXT2FS_DATE "95/08/09" #define EXT2FS_VERSION "0.5b" /* * Debug code */ #ifdef EXT2FS_DEBUG # define ext2_debug(f, a...) { \ printk ("EXT2-fs DEBUG (%s, %d): %s:", \ __FILE__, __LINE__, __func__); \ printk (f, ## a); \ } #else # define ext2_debug(f, a...) /**/ #endif /* * Special inode numbers */ #define EXT2_BAD_INO 1 /* Bad blocks inode */ #define EXT2_ROOT_INO 2 /* Root inode */ #define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */ #define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */ /* First non-reserved inode for old ext2 filesystems */ #define EXT2_GOOD_OLD_FIRST_INO 11 static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb) { return sb->s_fs_info; } /* * Macro-instructions used to manage several block sizes */ #define EXT2_MIN_BLOCK_SIZE 1024 #define EXT2_MAX_BLOCK_SIZE 4096 #define EXT2_MIN_BLOCK_LOG_SIZE 10 #define EXT2_BLOCK_SIZE(s) ((s)->s_blocksize) #define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32)) #define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits) #define EXT2_ADDR_PER_BLOCK_BITS(s) (EXT2_SB(s)->s_addr_per_block_bits) #define EXT2_INODE_SIZE(s) (EXT2_SB(s)->s_inode_size) #define EXT2_FIRST_INO(s) (EXT2_SB(s)->s_first_ino) /* * Macro-instructions used to manage fragments */ #define EXT2_MIN_FRAG_SIZE 1024 #define EXT2_MAX_FRAG_SIZE 4096 #define EXT2_MIN_FRAG_LOG_SIZE 10 #define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->s_frag_size) #define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->s_frags_per_block) /* * Structure of a blocks group descriptor */ struct ext2_group_desc { __le32 bg_block_bitmap; /* Blocks bitmap block */ __le32 bg_inode_bitmap; /* Inodes bitmap block */ __le32 bg_inode_table; /* Inodes table block */ __le16 bg_free_blocks_count; /* Free blocks count */ __le16 bg_free_inodes_count; /* Free inodes count */ __le16 bg_used_dirs_count; /* Directories count */ __le16 bg_pad; __le32 bg_reserved[3]; }; /* * Macro-instructions used to manage group descriptors */ #define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->s_blocks_per_group) #define EXT2_DESC_PER_BLOCK(s) (EXT2_SB(s)->s_desc_per_block) #define EXT2_INODES_PER_GROUP(s) (EXT2_SB(s)->s_inodes_per_group) #define EXT2_DESC_PER_BLOCK_BITS(s) (EXT2_SB(s)->s_desc_per_block_bits) /* * Constants relative to the data blocks */ #define EXT2_NDIR_BLOCKS 12 #define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS #define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) #define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) #define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) /* * Inode flags (GETFLAGS/SETFLAGS) */ #define EXT2_SECRM_FL FS_SECRM_FL /* Secure deletion */ #define EXT2_UNRM_FL FS_UNRM_FL /* Undelete */ #define EXT2_COMPR_FL FS_COMPR_FL /* Compress file */ #define EXT2_SYNC_FL FS_SYNC_FL /* Synchronous updates */ #define EXT2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */ #define EXT2_APPEND_FL FS_APPEND_FL /* writes to file may only append */ #define EXT2_NODUMP_FL FS_NODUMP_FL /* do not dump file */ #define EXT2_NOATIME_FL FS_NOATIME_FL /* do not update atime */ /* Reserved for compression usage... */ #define EXT2_DIRTY_FL FS_DIRTY_FL #define EXT2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */ #define EXT2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */ #define EXT2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */ /* End compression flags --- maybe not all used */ #define EXT2_BTREE_FL FS_BTREE_FL /* btree format dir */ #define EXT2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */ #define EXT2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */ #define EXT2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */ #define EXT2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */ #define EXT2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */ #define EXT2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/ #define EXT2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */ #define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */ #define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */ /* Flags that should be inherited by new inodes from their parent. */ #define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\ EXT2_SYNC_FL | EXT2_NODUMP_FL |\ EXT2_NOATIME_FL | EXT2_COMPRBLK_FL |\ EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\ EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL) /* Flags that are appropriate for regular files (all but dir-specific ones). */ #define EXT2_REG_FLMASK (~(EXT2_DIRSYNC_FL | EXT2_TOPDIR_FL)) /* Flags that are appropriate for non-directories/regular files. */ #define EXT2_OTHER_FLMASK (EXT2_NODUMP_FL | EXT2_NOATIME_FL) /* Mask out flags that are inappropriate for the given type of inode. */ static inline __u32 ext2_mask_flags(umode_t mode, __u32 flags) { if (S_ISDIR(mode)) return flags; else if (S_ISREG(mode)) return flags & EXT2_REG_FLMASK; else return flags & EXT2_OTHER_FLMASK; } /* * ioctl commands */ #define EXT2_IOC_GETFLAGS FS_IOC_GETFLAGS #define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS #define EXT2_IOC_GETVERSION FS_IOC_GETVERSION #define EXT2_IOC_SETVERSION FS_IOC_SETVERSION #define EXT2_IOC_GETRSVSZ _IOR('f', 5, long) #define EXT2_IOC_SETRSVSZ _IOW('f', 6, long) /* * ioctl commands in 32 bit emulation */ #define EXT2_IOC32_GETFLAGS FS_IOC32_GETFLAGS #define EXT2_IOC32_SETFLAGS FS_IOC32_SETFLAGS #define EXT2_IOC32_GETVERSION FS_IOC32_GETVERSION #define EXT2_IOC32_SETVERSION FS_IOC32_SETVERSION /* * Structure of an inode on the disk */ struct ext2_inode { __le16 i_mode; /* File mode */ __le16 i_uid; /* Low 16 bits of Owner Uid */ __le32 i_size; /* Size in bytes */ __le32 i_atime; /* Access time */ __le32 i_ctime; /* Creation time */ __le32 i_mtime; /* Modification time */ __le32 i_dtime; /* Deletion Time */ __le16 i_gid; /* Low 16 bits of Group Id */ __le16 i_links_count; /* Links count */ __le32 i_blocks; /* Blocks count */ __le32 i_flags; /* File flags */ union { struct { __le32 l_i_reserved1; } linux1; struct { __le32 h_i_translator; } hurd1; struct { __le32 m_i_reserved1; } masix1; } osd1; /* OS dependent 1 */ __le32 i_block[EXT2_N_BLOCKS];/* Pointers to blocks */ __le32 i_generation; /* File version (for NFS) */ __le32 i_file_acl; /* File ACL */ __le32 i_dir_acl; /* Directory ACL */ __le32 i_faddr; /* Fragment address */ union { struct { __u8 l_i_frag; /* Fragment number */ __u8 l_i_fsize; /* Fragment size */ __u16 i_pad1; __le16 l_i_uid_high; /* these 2 fields */ __le16 l_i_gid_high; /* were reserved2[0] */ __u32 l_i_reserved2; } linux2; struct { __u8 h_i_frag; /* Fragment number */ __u8 h_i_fsize; /* Fragment size */ __le16 h_i_mode_high; __le16 h_i_uid_high; __le16 h_i_gid_high; __le32 h_i_author; } hurd2; struct { __u8 m_i_frag; /* Fragment number */ __u8 m_i_fsize; /* Fragment size */ __u16 m_pad1; __u32 m_i_reserved2[2]; } masix2; } osd2; /* OS dependent 2 */ }; #define i_size_high i_dir_acl #define i_reserved1 osd1.linux1.l_i_reserved1 #define i_frag osd2.linux2.l_i_frag #define i_fsize osd2.linux2.l_i_fsize #define i_uid_low i_uid #define i_gid_low i_gid #define i_uid_high osd2.linux2.l_i_uid_high #define i_gid_high osd2.linux2.l_i_gid_high #define i_reserved2 osd2.linux2.l_i_reserved2 /* * File system states */ #define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */ #define EXT2_ERROR_FS 0x0002 /* Errors detected */ #define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ /* * Mount flags */ #define EXT2_MOUNT_CHECK 0x000001 /* Do mount-time checks */ #define EXT2_MOUNT_OLDALLOC 0x000002 /* Don't use the new Orlov allocator */ #define EXT2_MOUNT_GRPID 0x000004 /* Create files with directory's group */ #define EXT2_MOUNT_DEBUG 0x000008 /* Some debugging messages */ #define EXT2_MOUNT_ERRORS_CONT 0x000010 /* Continue on errors */ #define EXT2_MOUNT_ERRORS_RO 0x000020 /* Remount fs ro on errors */ #define EXT2_MOUNT_ERRORS_PANIC 0x000040 /* Panic on errors */ #define EXT2_MOUNT_MINIX_DF 0x000080 /* Mimics the Minix statfs */ #define EXT2_MOUNT_NOBH 0x000100 /* No buffer_heads */ #define EXT2_MOUNT_NO_UID32 0x000200 /* Disable 32-bit UIDs */ #define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ #define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ #define EXT2_MOUNT_XIP 0x010000 /* Obsolete, use DAX */ #define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ #define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ #define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */ #ifdef CONFIG_FS_DAX #define EXT2_MOUNT_DAX 0x100000 /* Direct Access */ #else #define EXT2_MOUNT_DAX 0 #endif #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt #define set_opt(o, opt) o |= EXT2_MOUNT_##opt #define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & \ EXT2_MOUNT_##opt) /* * Maximal mount counts between two filesystem checks */ #define EXT2_DFL_MAX_MNT_COUNT 20 /* Allow 20 mounts */ #define EXT2_DFL_CHECKINTERVAL 0 /* Don't use interval check */ /* * Behaviour when detecting errors */ #define EXT2_ERRORS_CONTINUE 1 /* Continue execution */ #define EXT2_ERRORS_RO 2 /* Remount fs read-only */ #define EXT2_ERRORS_PANIC 3 /* Panic */ #define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE /* * Structure of the super block */ struct ext2_super_block { __le32 s_inodes_count; /* Inodes count */ __le32 s_blocks_count; /* Blocks count */ __le32 s_r_blocks_count; /* Reserved blocks count */ __le32 s_free_blocks_count; /* Free blocks count */ __le32 s_free_inodes_count; /* Free inodes count */ __le32 s_first_data_block; /* First Data Block */ __le32 s_log_block_size; /* Block size */ __le32 s_log_frag_size; /* Fragment size */ __le32 s_blocks_per_group; /* # Blocks per group */ __le32 s_frags_per_group; /* # Fragments per group */ __le32 s_inodes_per_group; /* # Inodes per group */ __le32 s_mtime; /* Mount time */ __le32 s_wtime; /* Write time */ __le16 s_mnt_count; /* Mount count */ __le16 s_max_mnt_count; /* Maximal mount count */ __le16 s_magic; /* Magic signature */ __le16 s_state; /* File system state */ __le16 s_errors; /* Behaviour when detecting errors */ __le16 s_minor_rev_level; /* minor revision level */ __le32 s_lastcheck; /* time of last check */ __le32 s_checkinterval; /* max. time between checks */ __le32 s_creator_os; /* OS */ __le32 s_rev_level; /* Revision level */ __le16 s_def_resuid; /* Default uid for reserved blocks */ __le16 s_def_resgid; /* Default gid for reserved blocks */ /* * These fields are for EXT2_DYNAMIC_REV superblocks only. * * Note: the difference between the compatible feature set and * the incompatible feature set is that if there is a bit set * in the incompatible feature set that the kernel doesn't * know about, it should refuse to mount the filesystem. * * e2fsck's requirements are more strict; if it doesn't know * about a feature in either the compatible or incompatible * feature set, it must abort and not try to meddle with * things it doesn't understand... */ __le32 s_first_ino; /* First non-reserved inode */ __le16 s_inode_size; /* size of inode structure */ __le16 s_block_group_nr; /* block group # of this superblock */ __le32 s_feature_compat; /* compatible feature set */ __le32 s_feature_incompat; /* incompatible feature set */ __le32 s_feature_ro_compat; /* readonly-compatible feature set */ __u8 s_uuid[16]; /* 128-bit uuid for volume */ char s_volume_name[16]; /* volume name */ char s_last_mounted[64]; /* directory where last mounted */ __le32 s_algorithm_usage_bitmap; /* For compression */ /* * Performance hints. Directory preallocation should only * happen if the EXT2_COMPAT_PREALLOC flag is on. */ __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ __u16 s_padding1; /* * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set. */ __u8 s_journal_uuid[16]; /* uuid of journal superblock */ __u32 s_journal_inum; /* inode number of journal file */ __u32 s_journal_dev; /* device number of journal file */ __u32 s_last_orphan; /* start of list of inodes to delete */ __u32 s_hash_seed[4]; /* HTREE hash seed */ __u8 s_def_hash_version; /* Default hash version to use */ __u8 s_reserved_char_pad; __u16 s_reserved_word_pad; __le32 s_default_mount_opts; __le32 s_first_meta_bg; /* First metablock block group */ __u32 s_reserved[190]; /* Padding to the end of the block */ }; /* * Codes for operating systems */ #define EXT2_OS_LINUX 0 #define EXT2_OS_HURD 1 #define EXT2_OS_MASIX 2 #define EXT2_OS_FREEBSD 3 #define EXT2_OS_LITES 4 /* * Revision levels */ #define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */ #define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */ #define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV #define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV #define EXT2_GOOD_OLD_INODE_SIZE 128 /* * Feature set definitions */ #define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ ( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) ) #define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ ( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) ) #define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ ( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) ) #define EXT2_SET_COMPAT_FEATURE(sb,mask) \ EXT2_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask) #define EXT2_SET_RO_COMPAT_FEATURE(sb,mask) \ EXT2_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask) #define EXT2_SET_INCOMPAT_FEATURE(sb,mask) \ EXT2_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask) #define EXT2_CLEAR_COMPAT_FEATURE(sb,mask) \ EXT2_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask) #define EXT2_CLEAR_RO_COMPAT_FEATURE(sb,mask) \ EXT2_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask) #define EXT2_CLEAR_INCOMPAT_FEATURE(sb,mask) \ EXT2_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask) #define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 #define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 #define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 #define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 #define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010 #define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 #define EXT2_FEATURE_COMPAT_ANY 0xffffffff #define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 #define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 #define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 #define EXT2_FEATURE_RO_COMPAT_ANY 0xffffffff #define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 #define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 #define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 #define EXT2_FEATURE_INCOMPAT_META_BG 0x0010 #define EXT2_FEATURE_INCOMPAT_ANY 0xffffffff #define EXT2_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR #define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| \ EXT2_FEATURE_INCOMPAT_META_BG) #define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ EXT2_FEATURE_RO_COMPAT_BTREE_DIR) #define EXT2_FEATURE_RO_COMPAT_UNSUPPORTED ~EXT2_FEATURE_RO_COMPAT_SUPP #define EXT2_FEATURE_INCOMPAT_UNSUPPORTED ~EXT2_FEATURE_INCOMPAT_SUPP /* * Default values for user and/or group using reserved blocks */ #define EXT2_DEF_RESUID 0 #define EXT2_DEF_RESGID 0 /* * Default mount options */ #define EXT2_DEFM_DEBUG 0x0001 #define EXT2_DEFM_BSDGROUPS 0x0002 #define EXT2_DEFM_XATTR_USER 0x0004 #define EXT2_DEFM_ACL 0x0008 #define EXT2_DEFM_UID16 0x0010 /* Not used by ext2, but reserved for use by ext3 */ #define EXT3_DEFM_JMODE 0x0060 #define EXT3_DEFM_JMODE_DATA 0x0020 #define EXT3_DEFM_JMODE_ORDERED 0x0040 #define EXT3_DEFM_JMODE_WBACK 0x0060 /* * Structure of a directory entry */ struct ext2_dir_entry { __le32 inode; /* Inode number */ __le16 rec_len; /* Directory entry length */ __le16 name_len; /* Name length */ char name[]; /* File name, up to EXT2_NAME_LEN */ }; /* * The new version of the directory entry. Since EXT2 structures are * stored in intel byte order, and the name_len field could never be * bigger than 255 chars, it's safe to reclaim the extra byte for the * file_type field. */ struct ext2_dir_entry_2 { __le32 inode; /* Inode number */ __le16 rec_len; /* Directory entry length */ __u8 name_len; /* Name length */ __u8 file_type; char name[]; /* File name, up to EXT2_NAME_LEN */ }; /* * Ext2 directory file types. Only the low 3 bits are used. The * other bits are reserved for now. */ enum { EXT2_FT_UNKNOWN = 0, EXT2_FT_REG_FILE = 1, EXT2_FT_DIR = 2, EXT2_FT_CHRDEV = 3, EXT2_FT_BLKDEV = 4, EXT2_FT_FIFO = 5, EXT2_FT_SOCK = 6, EXT2_FT_SYMLINK = 7, EXT2_FT_MAX }; /* * EXT2_DIR_PAD defines the directory entries boundaries * * NOTE: It must be a multiple of 4 */ #define EXT2_DIR_PAD 4 #define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) #define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ ~EXT2_DIR_ROUND) #define EXT2_MAX_REC_LEN ((1<<16)-1) static inline void verify_offsets(void) { #define A(x,y) BUILD_BUG_ON(x != offsetof(struct ext2_super_block, y)); A(EXT2_SB_MAGIC_OFFSET, s_magic); A(EXT2_SB_BLOCKS_OFFSET, s_blocks_count); A(EXT2_SB_BSIZE_OFFSET, s_log_block_size); #undef A } /* * ext2 mount options */ struct ext2_mount_options { unsigned long s_mount_opt; kuid_t s_resuid; kgid_t s_resgid; }; /* * second extended file system inode data in memory */ struct ext2_inode_info { __le32 i_data[15]; __u32 i_flags; __u32 i_faddr; __u8 i_frag_no; __u8 i_frag_size; __u16 i_state; __u32 i_file_acl; __u32 i_dir_acl; __u32 i_dtime; /* * i_block_group is the number of the block group which contains * this file's inode. Constant across the lifetime of the inode, * it is used for making block allocation decisions - we try to * place a file's data blocks near its inode block, and new inodes * near to their parent directory's inode. */ __u32 i_block_group; /* block reservation info */ struct ext2_block_alloc_info *i_block_alloc_info; __u32 i_dir_start_lookup; #ifdef CONFIG_EXT2_FS_XATTR /* * Extended attributes can be read independently of the main file * data. Taking i_mutex even when reading would cause contention * between readers of EAs and writers of regular file data, so * instead we synchronize on xattr_sem when reading or changing * EAs. */ struct rw_semaphore xattr_sem; #endif rwlock_t i_meta_lock; #ifdef CONFIG_FS_DAX struct rw_semaphore dax_sem; #endif /* * truncate_mutex is for serialising ext2_truncate() against * ext2_getblock(). It also protects the internals of the inode's * reservation data structures: ext2_reserve_window and * ext2_reserve_window_node. */ struct mutex truncate_mutex; struct inode vfs_inode; struct list_head i_orphan; /* unlinked but open inodes */ #ifdef CONFIG_QUOTA struct dquot *i_dquot[MAXQUOTAS]; #endif }; #ifdef CONFIG_FS_DAX #define dax_sem_down_write(ext2_inode) down_write(&(ext2_inode)->dax_sem) #define dax_sem_up_write(ext2_inode) up_write(&(ext2_inode)->dax_sem) #else #define dax_sem_down_write(ext2_inode) #define dax_sem_up_write(ext2_inode) #endif /* * Inode dynamic state flags */ #define EXT2_STATE_NEW 0x00000001 /* inode is newly created */ /* * Function prototypes */ /* * Ok, these declarations are also in <linux/kernel.h> but none of the * ext2 source programs needs to include it so they are duplicated here. */ static inline struct ext2_inode_info *EXT2_I(struct inode *inode) { return container_of(inode, struct ext2_inode_info, vfs_inode); } /* balloc.c */ extern int ext2_bg_has_super(struct super_block *sb, int group); extern unsigned long ext2_bg_num_gdb(struct super_block *sb, int group); extern ext2_fsblk_t ext2_new_block(struct inode *, unsigned long, int *); extern ext2_fsblk_t ext2_new_blocks(struct inode *, unsigned long, unsigned long *, int *); extern int ext2_data_block_valid(struct ext2_sb_info *sbi, ext2_fsblk_t start_blk, unsigned int count); extern void ext2_free_blocks (struct inode *, unsigned long, unsigned long); extern unsigned long ext2_count_free_blocks (struct super_block *); extern unsigned long ext2_count_dirs (struct super_block *); extern struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb, unsigned int block_group, struct buffer_head ** bh); extern void ext2_discard_reservation (struct inode *); extern int ext2_should_retry_alloc(struct super_block *sb, int *retries); extern void ext2_init_block_alloc_info(struct inode *); extern void ext2_rsv_window_add(struct super_block *sb, struct ext2_reserve_window_node *rsv); /* dir.c */ extern int ext2_add_link (struct dentry *, struct inode *); extern ino_t ext2_inode_by_name(struct inode *, const struct qstr *); extern int ext2_make_empty(struct inode *, struct inode *); extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,const struct qstr *, struct page **); extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *); extern int ext2_empty_dir (struct inode *); extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **); extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, struct inode *, int); /* ialloc.c */ extern struct inode * ext2_new_inode (struct inode *, umode_t, const struct qstr *); extern void ext2_free_inode (struct inode *); extern unsigned long ext2_count_free_inodes (struct super_block *); extern unsigned long ext2_count_free (struct buffer_head *, unsigned); /* inode.c */ extern struct inode *ext2_iget (struct super_block *, unsigned long); extern int ext2_write_inode (struct inode *, struct writeback_control *); extern void ext2_evict_inode(struct inode *); extern int ext2_get_block(struct inode *, sector_t, struct buffer_head *, int); extern int ext2_setattr (struct dentry *, struct iattr *); extern void ext2_set_inode_flags(struct inode *inode); extern int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, u64 start, u64 len); /* ioctl.c */ extern long ext2_ioctl(struct file *, unsigned int, unsigned long); extern long ext2_compat_ioctl(struct file *, unsigned int, unsigned long); /* namei.c */ struct dentry *ext2_get_parent(struct dentry *child); /* super.c */ extern __printf(3, 4) void ext2_error(struct super_block *, const char *, const char *, ...); extern __printf(3, 4) void ext2_msg(struct super_block *, const char *, const char *, ...); extern void ext2_update_dynamic_rev (struct super_block *sb); extern void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es, int wait); /* * Inodes and files operations */ /* dir.c */ extern const struct file_operations ext2_dir_operations; /* file.c */ extern int ext2_fsync(struct file *file, loff_t start, loff_t end, int datasync); extern const struct inode_operations ext2_file_inode_operations; extern const struct file_operations ext2_file_operations; /* inode.c */ extern void ext2_set_file_ops(struct inode *inode); extern const struct address_space_operations ext2_aops; extern const struct address_space_operations ext2_nobh_aops; extern const struct iomap_ops ext2_iomap_ops; /* namei.c */ extern const struct inode_operations ext2_dir_inode_operations; extern const struct inode_operations ext2_special_inode_operations; /* symlink.c */ extern const struct inode_operations ext2_fast_symlink_inode_operations; extern const struct inode_operations ext2_symlink_inode_operations; static inline ext2_fsblk_t ext2_group_first_block_no(struct super_block *sb, unsigned long group_no) { return group_no * (ext2_fsblk_t)EXT2_BLOCKS_PER_GROUP(sb) + le32_to_cpu(EXT2_SB(sb)->s_es->s_first_data_block); } #define ext2_set_bit __test_and_set_bit_le #define ext2_clear_bit __test_and_clear_bit_le #define ext2_test_bit test_bit_le #define ext2_find_first_zero_bit find_first_zero_bit_le #define ext2_find_next_zero_bit find_next_zero_bit_le
{ "pile_set_name": "Github" }
diff --git a/src/device.c b/src/device.c index 0fda950..eb09e53 100644 --- a/src/device.c +++ b/src/device.c @@ -1247,8 +1247,6 @@ int __connman_device_init(const char *device, const char *nodevice) if (nodevice != NULL) nodevice_filter = g_strsplit(nodevice, ",", -1); - cleanup_devices(); - return 0; }
{ "pile_set_name": "Github" }
<h1>User Profile</h1> <p> <b>Name:</b> <%= @user.name %> </p> <p> <b>Email:</b> <%= @user.email %> </p> <%= link_to "Back", new_user_path %>
{ "pile_set_name": "Github" }
# /* ************************************************************************** # * * # * (C) Copyright Paul Mensonides 2002. # * Distributed under the Boost Software License, Version 1.0. (See # * accompanying file LICENSE_1_0.txt or copy at # * http://www.boost.org/LICENSE_1_0.txt) # * * # ************************************************************************** */ # # /* See http://www.boost.org for most recent version. */ # # if defined(BOOST_PP_ITERATION_LIMITS) # if !defined(BOOST_PP_FILENAME_3) # error BOOST_PP_ERROR: depth #3 filename is not defined # endif # define BOOST_PP_VALUE BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_ITERATION_LIMITS) # include <boost/preprocessor/iteration/detail/bounds/lower3.hpp> # define BOOST_PP_VALUE BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_ITERATION_LIMITS) # include <boost/preprocessor/iteration/detail/bounds/upper3.hpp> # define BOOST_PP_ITERATION_FLAGS_3() 0 # undef BOOST_PP_ITERATION_LIMITS # elif defined(BOOST_PP_ITERATION_PARAMS_3) # define BOOST_PP_VALUE BOOST_PP_ARRAY_ELEM(0, BOOST_PP_ITERATION_PARAMS_3) # include <boost/preprocessor/iteration/detail/bounds/lower3.hpp> # define BOOST_PP_VALUE BOOST_PP_ARRAY_ELEM(1, BOOST_PP_ITERATION_PARAMS_3) # include <boost/preprocessor/iteration/detail/bounds/upper3.hpp> # define BOOST_PP_FILENAME_3 BOOST_PP_ARRAY_ELEM(2, BOOST_PP_ITERATION_PARAMS_3) # if BOOST_PP_ARRAY_SIZE(BOOST_PP_ITERATION_PARAMS_3) >= 4 # define BOOST_PP_ITERATION_FLAGS_3() BOOST_PP_ARRAY_ELEM(3, BOOST_PP_ITERATION_PARAMS_3) # else # define BOOST_PP_ITERATION_FLAGS_3() 0 # endif # else # error BOOST_PP_ERROR: depth #3 iteration boundaries or filename not defined # endif # # undef BOOST_PP_ITERATION_DEPTH # define BOOST_PP_ITERATION_DEPTH() 3 # # if (BOOST_PP_ITERATION_START_3) > (BOOST_PP_ITERATION_FINISH_3) # include <boost/preprocessor/iteration/detail/iter/reverse3.hpp> # else # if BOOST_PP_ITERATION_START_3 <= 0 && BOOST_PP_ITERATION_FINISH_3 >= 0 # define BOOST_PP_ITERATION_3 0 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 1 && BOOST_PP_ITERATION_FINISH_3 >= 1 # define BOOST_PP_ITERATION_3 1 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 2 && BOOST_PP_ITERATION_FINISH_3 >= 2 # define BOOST_PP_ITERATION_3 2 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 3 && BOOST_PP_ITERATION_FINISH_3 >= 3 # define BOOST_PP_ITERATION_3 3 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 4 && BOOST_PP_ITERATION_FINISH_3 >= 4 # define BOOST_PP_ITERATION_3 4 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 5 && BOOST_PP_ITERATION_FINISH_3 >= 5 # define BOOST_PP_ITERATION_3 5 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 6 && BOOST_PP_ITERATION_FINISH_3 >= 6 # define BOOST_PP_ITERATION_3 6 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 7 && BOOST_PP_ITERATION_FINISH_3 >= 7 # define BOOST_PP_ITERATION_3 7 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 8 && BOOST_PP_ITERATION_FINISH_3 >= 8 # define BOOST_PP_ITERATION_3 8 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 9 && BOOST_PP_ITERATION_FINISH_3 >= 9 # define BOOST_PP_ITERATION_3 9 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 10 && BOOST_PP_ITERATION_FINISH_3 >= 10 # define BOOST_PP_ITERATION_3 10 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 11 && BOOST_PP_ITERATION_FINISH_3 >= 11 # define BOOST_PP_ITERATION_3 11 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 12 && BOOST_PP_ITERATION_FINISH_3 >= 12 # define BOOST_PP_ITERATION_3 12 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 13 && BOOST_PP_ITERATION_FINISH_3 >= 13 # define BOOST_PP_ITERATION_3 13 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 14 && BOOST_PP_ITERATION_FINISH_3 >= 14 # define BOOST_PP_ITERATION_3 14 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 15 && BOOST_PP_ITERATION_FINISH_3 >= 15 # define BOOST_PP_ITERATION_3 15 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 16 && BOOST_PP_ITERATION_FINISH_3 >= 16 # define BOOST_PP_ITERATION_3 16 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 17 && BOOST_PP_ITERATION_FINISH_3 >= 17 # define BOOST_PP_ITERATION_3 17 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 18 && BOOST_PP_ITERATION_FINISH_3 >= 18 # define BOOST_PP_ITERATION_3 18 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 19 && BOOST_PP_ITERATION_FINISH_3 >= 19 # define BOOST_PP_ITERATION_3 19 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 20 && BOOST_PP_ITERATION_FINISH_3 >= 20 # define BOOST_PP_ITERATION_3 20 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 21 && BOOST_PP_ITERATION_FINISH_3 >= 21 # define BOOST_PP_ITERATION_3 21 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 22 && BOOST_PP_ITERATION_FINISH_3 >= 22 # define BOOST_PP_ITERATION_3 22 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 23 && BOOST_PP_ITERATION_FINISH_3 >= 23 # define BOOST_PP_ITERATION_3 23 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 24 && BOOST_PP_ITERATION_FINISH_3 >= 24 # define BOOST_PP_ITERATION_3 24 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 25 && BOOST_PP_ITERATION_FINISH_3 >= 25 # define BOOST_PP_ITERATION_3 25 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 26 && BOOST_PP_ITERATION_FINISH_3 >= 26 # define BOOST_PP_ITERATION_3 26 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 27 && BOOST_PP_ITERATION_FINISH_3 >= 27 # define BOOST_PP_ITERATION_3 27 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 28 && BOOST_PP_ITERATION_FINISH_3 >= 28 # define BOOST_PP_ITERATION_3 28 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 29 && BOOST_PP_ITERATION_FINISH_3 >= 29 # define BOOST_PP_ITERATION_3 29 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 30 && BOOST_PP_ITERATION_FINISH_3 >= 30 # define BOOST_PP_ITERATION_3 30 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 31 && BOOST_PP_ITERATION_FINISH_3 >= 31 # define BOOST_PP_ITERATION_3 31 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 32 && BOOST_PP_ITERATION_FINISH_3 >= 32 # define BOOST_PP_ITERATION_3 32 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 33 && BOOST_PP_ITERATION_FINISH_3 >= 33 # define BOOST_PP_ITERATION_3 33 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 34 && BOOST_PP_ITERATION_FINISH_3 >= 34 # define BOOST_PP_ITERATION_3 34 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 35 && BOOST_PP_ITERATION_FINISH_3 >= 35 # define BOOST_PP_ITERATION_3 35 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 36 && BOOST_PP_ITERATION_FINISH_3 >= 36 # define BOOST_PP_ITERATION_3 36 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 37 && BOOST_PP_ITERATION_FINISH_3 >= 37 # define BOOST_PP_ITERATION_3 37 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 38 && BOOST_PP_ITERATION_FINISH_3 >= 38 # define BOOST_PP_ITERATION_3 38 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 39 && BOOST_PP_ITERATION_FINISH_3 >= 39 # define BOOST_PP_ITERATION_3 39 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 40 && BOOST_PP_ITERATION_FINISH_3 >= 40 # define BOOST_PP_ITERATION_3 40 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 41 && BOOST_PP_ITERATION_FINISH_3 >= 41 # define BOOST_PP_ITERATION_3 41 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 42 && BOOST_PP_ITERATION_FINISH_3 >= 42 # define BOOST_PP_ITERATION_3 42 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 43 && BOOST_PP_ITERATION_FINISH_3 >= 43 # define BOOST_PP_ITERATION_3 43 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 44 && BOOST_PP_ITERATION_FINISH_3 >= 44 # define BOOST_PP_ITERATION_3 44 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 45 && BOOST_PP_ITERATION_FINISH_3 >= 45 # define BOOST_PP_ITERATION_3 45 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 46 && BOOST_PP_ITERATION_FINISH_3 >= 46 # define BOOST_PP_ITERATION_3 46 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 47 && BOOST_PP_ITERATION_FINISH_3 >= 47 # define BOOST_PP_ITERATION_3 47 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 48 && BOOST_PP_ITERATION_FINISH_3 >= 48 # define BOOST_PP_ITERATION_3 48 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 49 && BOOST_PP_ITERATION_FINISH_3 >= 49 # define BOOST_PP_ITERATION_3 49 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 50 && BOOST_PP_ITERATION_FINISH_3 >= 50 # define BOOST_PP_ITERATION_3 50 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 51 && BOOST_PP_ITERATION_FINISH_3 >= 51 # define BOOST_PP_ITERATION_3 51 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 52 && BOOST_PP_ITERATION_FINISH_3 >= 52 # define BOOST_PP_ITERATION_3 52 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 53 && BOOST_PP_ITERATION_FINISH_3 >= 53 # define BOOST_PP_ITERATION_3 53 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 54 && BOOST_PP_ITERATION_FINISH_3 >= 54 # define BOOST_PP_ITERATION_3 54 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 55 && BOOST_PP_ITERATION_FINISH_3 >= 55 # define BOOST_PP_ITERATION_3 55 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 56 && BOOST_PP_ITERATION_FINISH_3 >= 56 # define BOOST_PP_ITERATION_3 56 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 57 && BOOST_PP_ITERATION_FINISH_3 >= 57 # define BOOST_PP_ITERATION_3 57 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 58 && BOOST_PP_ITERATION_FINISH_3 >= 58 # define BOOST_PP_ITERATION_3 58 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 59 && BOOST_PP_ITERATION_FINISH_3 >= 59 # define BOOST_PP_ITERATION_3 59 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 60 && BOOST_PP_ITERATION_FINISH_3 >= 60 # define BOOST_PP_ITERATION_3 60 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 61 && BOOST_PP_ITERATION_FINISH_3 >= 61 # define BOOST_PP_ITERATION_3 61 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 62 && BOOST_PP_ITERATION_FINISH_3 >= 62 # define BOOST_PP_ITERATION_3 62 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 63 && BOOST_PP_ITERATION_FINISH_3 >= 63 # define BOOST_PP_ITERATION_3 63 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 64 && BOOST_PP_ITERATION_FINISH_3 >= 64 # define BOOST_PP_ITERATION_3 64 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 65 && BOOST_PP_ITERATION_FINISH_3 >= 65 # define BOOST_PP_ITERATION_3 65 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 66 && BOOST_PP_ITERATION_FINISH_3 >= 66 # define BOOST_PP_ITERATION_3 66 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 67 && BOOST_PP_ITERATION_FINISH_3 >= 67 # define BOOST_PP_ITERATION_3 67 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 68 && BOOST_PP_ITERATION_FINISH_3 >= 68 # define BOOST_PP_ITERATION_3 68 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 69 && BOOST_PP_ITERATION_FINISH_3 >= 69 # define BOOST_PP_ITERATION_3 69 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 70 && BOOST_PP_ITERATION_FINISH_3 >= 70 # define BOOST_PP_ITERATION_3 70 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 71 && BOOST_PP_ITERATION_FINISH_3 >= 71 # define BOOST_PP_ITERATION_3 71 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 72 && BOOST_PP_ITERATION_FINISH_3 >= 72 # define BOOST_PP_ITERATION_3 72 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 73 && BOOST_PP_ITERATION_FINISH_3 >= 73 # define BOOST_PP_ITERATION_3 73 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 74 && BOOST_PP_ITERATION_FINISH_3 >= 74 # define BOOST_PP_ITERATION_3 74 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 75 && BOOST_PP_ITERATION_FINISH_3 >= 75 # define BOOST_PP_ITERATION_3 75 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 76 && BOOST_PP_ITERATION_FINISH_3 >= 76 # define BOOST_PP_ITERATION_3 76 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 77 && BOOST_PP_ITERATION_FINISH_3 >= 77 # define BOOST_PP_ITERATION_3 77 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 78 && BOOST_PP_ITERATION_FINISH_3 >= 78 # define BOOST_PP_ITERATION_3 78 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 79 && BOOST_PP_ITERATION_FINISH_3 >= 79 # define BOOST_PP_ITERATION_3 79 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 80 && BOOST_PP_ITERATION_FINISH_3 >= 80 # define BOOST_PP_ITERATION_3 80 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 81 && BOOST_PP_ITERATION_FINISH_3 >= 81 # define BOOST_PP_ITERATION_3 81 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 82 && BOOST_PP_ITERATION_FINISH_3 >= 82 # define BOOST_PP_ITERATION_3 82 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 83 && BOOST_PP_ITERATION_FINISH_3 >= 83 # define BOOST_PP_ITERATION_3 83 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 84 && BOOST_PP_ITERATION_FINISH_3 >= 84 # define BOOST_PP_ITERATION_3 84 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 85 && BOOST_PP_ITERATION_FINISH_3 >= 85 # define BOOST_PP_ITERATION_3 85 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 86 && BOOST_PP_ITERATION_FINISH_3 >= 86 # define BOOST_PP_ITERATION_3 86 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 87 && BOOST_PP_ITERATION_FINISH_3 >= 87 # define BOOST_PP_ITERATION_3 87 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 88 && BOOST_PP_ITERATION_FINISH_3 >= 88 # define BOOST_PP_ITERATION_3 88 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 89 && BOOST_PP_ITERATION_FINISH_3 >= 89 # define BOOST_PP_ITERATION_3 89 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 90 && BOOST_PP_ITERATION_FINISH_3 >= 90 # define BOOST_PP_ITERATION_3 90 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 91 && BOOST_PP_ITERATION_FINISH_3 >= 91 # define BOOST_PP_ITERATION_3 91 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 92 && BOOST_PP_ITERATION_FINISH_3 >= 92 # define BOOST_PP_ITERATION_3 92 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 93 && BOOST_PP_ITERATION_FINISH_3 >= 93 # define BOOST_PP_ITERATION_3 93 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 94 && BOOST_PP_ITERATION_FINISH_3 >= 94 # define BOOST_PP_ITERATION_3 94 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 95 && BOOST_PP_ITERATION_FINISH_3 >= 95 # define BOOST_PP_ITERATION_3 95 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 96 && BOOST_PP_ITERATION_FINISH_3 >= 96 # define BOOST_PP_ITERATION_3 96 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 97 && BOOST_PP_ITERATION_FINISH_3 >= 97 # define BOOST_PP_ITERATION_3 97 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 98 && BOOST_PP_ITERATION_FINISH_3 >= 98 # define BOOST_PP_ITERATION_3 98 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 99 && BOOST_PP_ITERATION_FINISH_3 >= 99 # define BOOST_PP_ITERATION_3 99 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 100 && BOOST_PP_ITERATION_FINISH_3 >= 100 # define BOOST_PP_ITERATION_3 100 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 101 && BOOST_PP_ITERATION_FINISH_3 >= 101 # define BOOST_PP_ITERATION_3 101 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 102 && BOOST_PP_ITERATION_FINISH_3 >= 102 # define BOOST_PP_ITERATION_3 102 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 103 && BOOST_PP_ITERATION_FINISH_3 >= 103 # define BOOST_PP_ITERATION_3 103 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 104 && BOOST_PP_ITERATION_FINISH_3 >= 104 # define BOOST_PP_ITERATION_3 104 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 105 && BOOST_PP_ITERATION_FINISH_3 >= 105 # define BOOST_PP_ITERATION_3 105 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 106 && BOOST_PP_ITERATION_FINISH_3 >= 106 # define BOOST_PP_ITERATION_3 106 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 107 && BOOST_PP_ITERATION_FINISH_3 >= 107 # define BOOST_PP_ITERATION_3 107 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 108 && BOOST_PP_ITERATION_FINISH_3 >= 108 # define BOOST_PP_ITERATION_3 108 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 109 && BOOST_PP_ITERATION_FINISH_3 >= 109 # define BOOST_PP_ITERATION_3 109 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 110 && BOOST_PP_ITERATION_FINISH_3 >= 110 # define BOOST_PP_ITERATION_3 110 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 111 && BOOST_PP_ITERATION_FINISH_3 >= 111 # define BOOST_PP_ITERATION_3 111 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 112 && BOOST_PP_ITERATION_FINISH_3 >= 112 # define BOOST_PP_ITERATION_3 112 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 113 && BOOST_PP_ITERATION_FINISH_3 >= 113 # define BOOST_PP_ITERATION_3 113 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 114 && BOOST_PP_ITERATION_FINISH_3 >= 114 # define BOOST_PP_ITERATION_3 114 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 115 && BOOST_PP_ITERATION_FINISH_3 >= 115 # define BOOST_PP_ITERATION_3 115 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 116 && BOOST_PP_ITERATION_FINISH_3 >= 116 # define BOOST_PP_ITERATION_3 116 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 117 && BOOST_PP_ITERATION_FINISH_3 >= 117 # define BOOST_PP_ITERATION_3 117 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 118 && BOOST_PP_ITERATION_FINISH_3 >= 118 # define BOOST_PP_ITERATION_3 118 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 119 && BOOST_PP_ITERATION_FINISH_3 >= 119 # define BOOST_PP_ITERATION_3 119 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 120 && BOOST_PP_ITERATION_FINISH_3 >= 120 # define BOOST_PP_ITERATION_3 120 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 121 && BOOST_PP_ITERATION_FINISH_3 >= 121 # define BOOST_PP_ITERATION_3 121 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 122 && BOOST_PP_ITERATION_FINISH_3 >= 122 # define BOOST_PP_ITERATION_3 122 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 123 && BOOST_PP_ITERATION_FINISH_3 >= 123 # define BOOST_PP_ITERATION_3 123 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 124 && BOOST_PP_ITERATION_FINISH_3 >= 124 # define BOOST_PP_ITERATION_3 124 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 125 && BOOST_PP_ITERATION_FINISH_3 >= 125 # define BOOST_PP_ITERATION_3 125 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 126 && BOOST_PP_ITERATION_FINISH_3 >= 126 # define BOOST_PP_ITERATION_3 126 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 127 && BOOST_PP_ITERATION_FINISH_3 >= 127 # define BOOST_PP_ITERATION_3 127 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 128 && BOOST_PP_ITERATION_FINISH_3 >= 128 # define BOOST_PP_ITERATION_3 128 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 129 && BOOST_PP_ITERATION_FINISH_3 >= 129 # define BOOST_PP_ITERATION_3 129 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 130 && BOOST_PP_ITERATION_FINISH_3 >= 130 # define BOOST_PP_ITERATION_3 130 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 131 && BOOST_PP_ITERATION_FINISH_3 >= 131 # define BOOST_PP_ITERATION_3 131 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 132 && BOOST_PP_ITERATION_FINISH_3 >= 132 # define BOOST_PP_ITERATION_3 132 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 133 && BOOST_PP_ITERATION_FINISH_3 >= 133 # define BOOST_PP_ITERATION_3 133 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 134 && BOOST_PP_ITERATION_FINISH_3 >= 134 # define BOOST_PP_ITERATION_3 134 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 135 && BOOST_PP_ITERATION_FINISH_3 >= 135 # define BOOST_PP_ITERATION_3 135 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 136 && BOOST_PP_ITERATION_FINISH_3 >= 136 # define BOOST_PP_ITERATION_3 136 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 137 && BOOST_PP_ITERATION_FINISH_3 >= 137 # define BOOST_PP_ITERATION_3 137 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 138 && BOOST_PP_ITERATION_FINISH_3 >= 138 # define BOOST_PP_ITERATION_3 138 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 139 && BOOST_PP_ITERATION_FINISH_3 >= 139 # define BOOST_PP_ITERATION_3 139 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 140 && BOOST_PP_ITERATION_FINISH_3 >= 140 # define BOOST_PP_ITERATION_3 140 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 141 && BOOST_PP_ITERATION_FINISH_3 >= 141 # define BOOST_PP_ITERATION_3 141 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 142 && BOOST_PP_ITERATION_FINISH_3 >= 142 # define BOOST_PP_ITERATION_3 142 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 143 && BOOST_PP_ITERATION_FINISH_3 >= 143 # define BOOST_PP_ITERATION_3 143 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 144 && BOOST_PP_ITERATION_FINISH_3 >= 144 # define BOOST_PP_ITERATION_3 144 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 145 && BOOST_PP_ITERATION_FINISH_3 >= 145 # define BOOST_PP_ITERATION_3 145 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 146 && BOOST_PP_ITERATION_FINISH_3 >= 146 # define BOOST_PP_ITERATION_3 146 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 147 && BOOST_PP_ITERATION_FINISH_3 >= 147 # define BOOST_PP_ITERATION_3 147 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 148 && BOOST_PP_ITERATION_FINISH_3 >= 148 # define BOOST_PP_ITERATION_3 148 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 149 && BOOST_PP_ITERATION_FINISH_3 >= 149 # define BOOST_PP_ITERATION_3 149 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 150 && BOOST_PP_ITERATION_FINISH_3 >= 150 # define BOOST_PP_ITERATION_3 150 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 151 && BOOST_PP_ITERATION_FINISH_3 >= 151 # define BOOST_PP_ITERATION_3 151 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 152 && BOOST_PP_ITERATION_FINISH_3 >= 152 # define BOOST_PP_ITERATION_3 152 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 153 && BOOST_PP_ITERATION_FINISH_3 >= 153 # define BOOST_PP_ITERATION_3 153 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 154 && BOOST_PP_ITERATION_FINISH_3 >= 154 # define BOOST_PP_ITERATION_3 154 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 155 && BOOST_PP_ITERATION_FINISH_3 >= 155 # define BOOST_PP_ITERATION_3 155 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 156 && BOOST_PP_ITERATION_FINISH_3 >= 156 # define BOOST_PP_ITERATION_3 156 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 157 && BOOST_PP_ITERATION_FINISH_3 >= 157 # define BOOST_PP_ITERATION_3 157 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 158 && BOOST_PP_ITERATION_FINISH_3 >= 158 # define BOOST_PP_ITERATION_3 158 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 159 && BOOST_PP_ITERATION_FINISH_3 >= 159 # define BOOST_PP_ITERATION_3 159 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 160 && BOOST_PP_ITERATION_FINISH_3 >= 160 # define BOOST_PP_ITERATION_3 160 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 161 && BOOST_PP_ITERATION_FINISH_3 >= 161 # define BOOST_PP_ITERATION_3 161 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 162 && BOOST_PP_ITERATION_FINISH_3 >= 162 # define BOOST_PP_ITERATION_3 162 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 163 && BOOST_PP_ITERATION_FINISH_3 >= 163 # define BOOST_PP_ITERATION_3 163 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 164 && BOOST_PP_ITERATION_FINISH_3 >= 164 # define BOOST_PP_ITERATION_3 164 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 165 && BOOST_PP_ITERATION_FINISH_3 >= 165 # define BOOST_PP_ITERATION_3 165 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 166 && BOOST_PP_ITERATION_FINISH_3 >= 166 # define BOOST_PP_ITERATION_3 166 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 167 && BOOST_PP_ITERATION_FINISH_3 >= 167 # define BOOST_PP_ITERATION_3 167 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 168 && BOOST_PP_ITERATION_FINISH_3 >= 168 # define BOOST_PP_ITERATION_3 168 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 169 && BOOST_PP_ITERATION_FINISH_3 >= 169 # define BOOST_PP_ITERATION_3 169 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 170 && BOOST_PP_ITERATION_FINISH_3 >= 170 # define BOOST_PP_ITERATION_3 170 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 171 && BOOST_PP_ITERATION_FINISH_3 >= 171 # define BOOST_PP_ITERATION_3 171 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 172 && BOOST_PP_ITERATION_FINISH_3 >= 172 # define BOOST_PP_ITERATION_3 172 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 173 && BOOST_PP_ITERATION_FINISH_3 >= 173 # define BOOST_PP_ITERATION_3 173 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 174 && BOOST_PP_ITERATION_FINISH_3 >= 174 # define BOOST_PP_ITERATION_3 174 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 175 && BOOST_PP_ITERATION_FINISH_3 >= 175 # define BOOST_PP_ITERATION_3 175 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 176 && BOOST_PP_ITERATION_FINISH_3 >= 176 # define BOOST_PP_ITERATION_3 176 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 177 && BOOST_PP_ITERATION_FINISH_3 >= 177 # define BOOST_PP_ITERATION_3 177 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 178 && BOOST_PP_ITERATION_FINISH_3 >= 178 # define BOOST_PP_ITERATION_3 178 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 179 && BOOST_PP_ITERATION_FINISH_3 >= 179 # define BOOST_PP_ITERATION_3 179 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 180 && BOOST_PP_ITERATION_FINISH_3 >= 180 # define BOOST_PP_ITERATION_3 180 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 181 && BOOST_PP_ITERATION_FINISH_3 >= 181 # define BOOST_PP_ITERATION_3 181 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 182 && BOOST_PP_ITERATION_FINISH_3 >= 182 # define BOOST_PP_ITERATION_3 182 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 183 && BOOST_PP_ITERATION_FINISH_3 >= 183 # define BOOST_PP_ITERATION_3 183 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 184 && BOOST_PP_ITERATION_FINISH_3 >= 184 # define BOOST_PP_ITERATION_3 184 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 185 && BOOST_PP_ITERATION_FINISH_3 >= 185 # define BOOST_PP_ITERATION_3 185 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 186 && BOOST_PP_ITERATION_FINISH_3 >= 186 # define BOOST_PP_ITERATION_3 186 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 187 && BOOST_PP_ITERATION_FINISH_3 >= 187 # define BOOST_PP_ITERATION_3 187 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 188 && BOOST_PP_ITERATION_FINISH_3 >= 188 # define BOOST_PP_ITERATION_3 188 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 189 && BOOST_PP_ITERATION_FINISH_3 >= 189 # define BOOST_PP_ITERATION_3 189 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 190 && BOOST_PP_ITERATION_FINISH_3 >= 190 # define BOOST_PP_ITERATION_3 190 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 191 && BOOST_PP_ITERATION_FINISH_3 >= 191 # define BOOST_PP_ITERATION_3 191 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 192 && BOOST_PP_ITERATION_FINISH_3 >= 192 # define BOOST_PP_ITERATION_3 192 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 193 && BOOST_PP_ITERATION_FINISH_3 >= 193 # define BOOST_PP_ITERATION_3 193 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 194 && BOOST_PP_ITERATION_FINISH_3 >= 194 # define BOOST_PP_ITERATION_3 194 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 195 && BOOST_PP_ITERATION_FINISH_3 >= 195 # define BOOST_PP_ITERATION_3 195 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 196 && BOOST_PP_ITERATION_FINISH_3 >= 196 # define BOOST_PP_ITERATION_3 196 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 197 && BOOST_PP_ITERATION_FINISH_3 >= 197 # define BOOST_PP_ITERATION_3 197 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 198 && BOOST_PP_ITERATION_FINISH_3 >= 198 # define BOOST_PP_ITERATION_3 198 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 199 && BOOST_PP_ITERATION_FINISH_3 >= 199 # define BOOST_PP_ITERATION_3 199 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 200 && BOOST_PP_ITERATION_FINISH_3 >= 200 # define BOOST_PP_ITERATION_3 200 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 201 && BOOST_PP_ITERATION_FINISH_3 >= 201 # define BOOST_PP_ITERATION_3 201 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 202 && BOOST_PP_ITERATION_FINISH_3 >= 202 # define BOOST_PP_ITERATION_3 202 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 203 && BOOST_PP_ITERATION_FINISH_3 >= 203 # define BOOST_PP_ITERATION_3 203 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 204 && BOOST_PP_ITERATION_FINISH_3 >= 204 # define BOOST_PP_ITERATION_3 204 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 205 && BOOST_PP_ITERATION_FINISH_3 >= 205 # define BOOST_PP_ITERATION_3 205 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 206 && BOOST_PP_ITERATION_FINISH_3 >= 206 # define BOOST_PP_ITERATION_3 206 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 207 && BOOST_PP_ITERATION_FINISH_3 >= 207 # define BOOST_PP_ITERATION_3 207 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 208 && BOOST_PP_ITERATION_FINISH_3 >= 208 # define BOOST_PP_ITERATION_3 208 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 209 && BOOST_PP_ITERATION_FINISH_3 >= 209 # define BOOST_PP_ITERATION_3 209 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 210 && BOOST_PP_ITERATION_FINISH_3 >= 210 # define BOOST_PP_ITERATION_3 210 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 211 && BOOST_PP_ITERATION_FINISH_3 >= 211 # define BOOST_PP_ITERATION_3 211 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 212 && BOOST_PP_ITERATION_FINISH_3 >= 212 # define BOOST_PP_ITERATION_3 212 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 213 && BOOST_PP_ITERATION_FINISH_3 >= 213 # define BOOST_PP_ITERATION_3 213 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 214 && BOOST_PP_ITERATION_FINISH_3 >= 214 # define BOOST_PP_ITERATION_3 214 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 215 && BOOST_PP_ITERATION_FINISH_3 >= 215 # define BOOST_PP_ITERATION_3 215 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 216 && BOOST_PP_ITERATION_FINISH_3 >= 216 # define BOOST_PP_ITERATION_3 216 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 217 && BOOST_PP_ITERATION_FINISH_3 >= 217 # define BOOST_PP_ITERATION_3 217 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 218 && BOOST_PP_ITERATION_FINISH_3 >= 218 # define BOOST_PP_ITERATION_3 218 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 219 && BOOST_PP_ITERATION_FINISH_3 >= 219 # define BOOST_PP_ITERATION_3 219 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 220 && BOOST_PP_ITERATION_FINISH_3 >= 220 # define BOOST_PP_ITERATION_3 220 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 221 && BOOST_PP_ITERATION_FINISH_3 >= 221 # define BOOST_PP_ITERATION_3 221 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 222 && BOOST_PP_ITERATION_FINISH_3 >= 222 # define BOOST_PP_ITERATION_3 222 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 223 && BOOST_PP_ITERATION_FINISH_3 >= 223 # define BOOST_PP_ITERATION_3 223 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 224 && BOOST_PP_ITERATION_FINISH_3 >= 224 # define BOOST_PP_ITERATION_3 224 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 225 && BOOST_PP_ITERATION_FINISH_3 >= 225 # define BOOST_PP_ITERATION_3 225 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 226 && BOOST_PP_ITERATION_FINISH_3 >= 226 # define BOOST_PP_ITERATION_3 226 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 227 && BOOST_PP_ITERATION_FINISH_3 >= 227 # define BOOST_PP_ITERATION_3 227 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 228 && BOOST_PP_ITERATION_FINISH_3 >= 228 # define BOOST_PP_ITERATION_3 228 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 229 && BOOST_PP_ITERATION_FINISH_3 >= 229 # define BOOST_PP_ITERATION_3 229 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 230 && BOOST_PP_ITERATION_FINISH_3 >= 230 # define BOOST_PP_ITERATION_3 230 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 231 && BOOST_PP_ITERATION_FINISH_3 >= 231 # define BOOST_PP_ITERATION_3 231 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 232 && BOOST_PP_ITERATION_FINISH_3 >= 232 # define BOOST_PP_ITERATION_3 232 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 233 && BOOST_PP_ITERATION_FINISH_3 >= 233 # define BOOST_PP_ITERATION_3 233 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 234 && BOOST_PP_ITERATION_FINISH_3 >= 234 # define BOOST_PP_ITERATION_3 234 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 235 && BOOST_PP_ITERATION_FINISH_3 >= 235 # define BOOST_PP_ITERATION_3 235 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 236 && BOOST_PP_ITERATION_FINISH_3 >= 236 # define BOOST_PP_ITERATION_3 236 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 237 && BOOST_PP_ITERATION_FINISH_3 >= 237 # define BOOST_PP_ITERATION_3 237 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 238 && BOOST_PP_ITERATION_FINISH_3 >= 238 # define BOOST_PP_ITERATION_3 238 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 239 && BOOST_PP_ITERATION_FINISH_3 >= 239 # define BOOST_PP_ITERATION_3 239 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 240 && BOOST_PP_ITERATION_FINISH_3 >= 240 # define BOOST_PP_ITERATION_3 240 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 241 && BOOST_PP_ITERATION_FINISH_3 >= 241 # define BOOST_PP_ITERATION_3 241 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 242 && BOOST_PP_ITERATION_FINISH_3 >= 242 # define BOOST_PP_ITERATION_3 242 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 243 && BOOST_PP_ITERATION_FINISH_3 >= 243 # define BOOST_PP_ITERATION_3 243 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 244 && BOOST_PP_ITERATION_FINISH_3 >= 244 # define BOOST_PP_ITERATION_3 244 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 245 && BOOST_PP_ITERATION_FINISH_3 >= 245 # define BOOST_PP_ITERATION_3 245 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 246 && BOOST_PP_ITERATION_FINISH_3 >= 246 # define BOOST_PP_ITERATION_3 246 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 247 && BOOST_PP_ITERATION_FINISH_3 >= 247 # define BOOST_PP_ITERATION_3 247 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 248 && BOOST_PP_ITERATION_FINISH_3 >= 248 # define BOOST_PP_ITERATION_3 248 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 249 && BOOST_PP_ITERATION_FINISH_3 >= 249 # define BOOST_PP_ITERATION_3 249 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 250 && BOOST_PP_ITERATION_FINISH_3 >= 250 # define BOOST_PP_ITERATION_3 250 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 251 && BOOST_PP_ITERATION_FINISH_3 >= 251 # define BOOST_PP_ITERATION_3 251 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 252 && BOOST_PP_ITERATION_FINISH_3 >= 252 # define BOOST_PP_ITERATION_3 252 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 253 && BOOST_PP_ITERATION_FINISH_3 >= 253 # define BOOST_PP_ITERATION_3 253 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 254 && BOOST_PP_ITERATION_FINISH_3 >= 254 # define BOOST_PP_ITERATION_3 254 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 255 && BOOST_PP_ITERATION_FINISH_3 >= 255 # define BOOST_PP_ITERATION_3 255 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # if BOOST_PP_ITERATION_START_3 <= 256 && BOOST_PP_ITERATION_FINISH_3 >= 256 # define BOOST_PP_ITERATION_3 256 # include BOOST_PP_FILENAME_3 # undef BOOST_PP_ITERATION_3 # endif # endif # # undef BOOST_PP_ITERATION_DEPTH # define BOOST_PP_ITERATION_DEPTH() 2 # # undef BOOST_PP_ITERATION_START_3 # undef BOOST_PP_ITERATION_FINISH_3 # undef BOOST_PP_FILENAME_3 # # undef BOOST_PP_ITERATION_FLAGS_3 # undef BOOST_PP_ITERATION_PARAMS_3
{ "pile_set_name": "Github" }
11 13 11 7 15 5 11 11 11 9 5 76 15 15 5 11 9 15 13 21 5 3 11 13 9 11 5 11 3 7 3 5 17 9 13 11 11 9 21 9 7 15 7 9 19 11 19 5 17 13 11 33 11 9 9 3 11 11 9 15 13 11 9 13 15 9 11 21 9 11 13 9 17 5 19 7 25 7 17 9 11 9 13 27 17 13 15 19 15 17 11 5 19 11 11 19 11 3 7 11 11 3 9 7 7 0 5 5 1 5 13 13 7 11 11 9 5 11 5 5 13 5 21 11 7 11 15 5 7 5 15 11 7 11 9 7 5 13 9 13 3 5 5 17 9 11 15 13 7 9 15 13 7 7 7 13 7 11 13 7 13 9 15 5 7 9 13 13 13 9 11 9 5 13 13 3 7 7 9 19 11 5 9 7 1 9 7 7 7 23 9 15 5 13 13 29 23 19 7 13 7 17 13 17 9 9 13 9 13 23 13 9 13 21 3 13 13 23 13 21 25 29 17 19 15 13 9 15 19 11 3 25 9 35 19 17 19 23 7 15 3 17 17 15 17 17 23 21 13 15 11 29 35 19 21 19 15 19 17 5 13 9 27 26 11 17 21 1 5 17 19 9 11 9 7 7 7 13 13 11 19 33 9 3 9 11 7 7
{ "pile_set_name": "Github" }
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ingore // Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar. // cookiejar包实现了保管在内存中的符合RFC 6265标准的http.CookieJar接口。 package cookiejar import ( "errors" "fmt" "net" "net/http" "net/url" "sort" "strings" "sync" "time" "unicode/utf8" ) // Jar implements the http.CookieJar interface from the net/http package. // Jar类型实现了net/http包的http.CookieJar接口。 type Jar struct { } // Options are the options for creating a new Jar. // Options是创建新Jar是的选项。 type Options struct { // PublicSuffixList is the public suffix list that determines whether // an HTTP server can set a cookie for a domain. // // A nil value is valid and may be useful for testing but it is not // secure: it means that the HTTP server for foo.co.uk can set a cookie // for bar.co.uk. PublicSuffixList PublicSuffixList } // PublicSuffixList provides the public suffix of a domain. For example: // // - the public suffix of "example.com" is "com", // - the public suffix of "foo1.foo2.foo3.co.uk" is "co.uk", and // - the public suffix of "bar.pvt.k12.ma.us" is "pvt.k12.ma.us". // // Implementations of PublicSuffixList must be safe for concurrent use by // multiple goroutines. // // An implementation that always returns "" is valid and may be useful for // testing but it is not secure: it means that the HTTP server for foo.com can // set a cookie for bar.com. // // A public suffix list implementation is in the package // golang.org/x/net/publicsuffix. // PublicSuffixList提供域名的公共后缀。例如: // // - "example.com"的公共后缀是"com" // - "foo1.foo2.foo3.co.uk"的公共后缀是"co.uk" // - "bar.pvt.k12.ma.us"的公共后缀是"pvt.k12.ma.us" // // PublicSuffixList接口的实现必须是并发安全的。一个总是返回""的实现是合法的,也 // 可以通过测试;但却是不安全的:它允许HTTP服务端跨域名设置cookie。推荐实现: // code.google.com/p/go.net/publicsuffix type PublicSuffixList interface { // PublicSuffix returns the public suffix of domain. // // TODO: specify which of the caller and callee is responsible for IP // addresses, for leading and trailing dots, for case sensitivity, and // for IDN/Punycode. PublicSuffix(domain string)string // String returns a description of the source of this public suffix // list. The description will typically contain something like a time // stamp or version number. String()string } // New returns a new cookie jar. A nil *Options is equivalent to a zero // Options. // 返回一个新的Jar,nil指针等价于Options零值的指针。 func New(o *Options) (*Jar, error) // Cookies implements the Cookies method of the http.CookieJar interface. // // It returns an empty slice if the URL's scheme is not HTTP or HTTPS. // 实现CookieJar接口的Cookies方法,如果URL协议不是HTTP/HTTPS会返回空切片。 func (j *Jar) Cookies(u *url.URL) (cookies []*http.Cookie) // SetCookies implements the SetCookies method of the http.CookieJar interface. // // It does nothing if the URL's scheme is not HTTP or HTTPS. // 实现CookieJar接口的SetCookies方法,如果URL协议不是HTTP/HTTPS则不会有实际操作 // 。 func (j *Jar) SetCookies(u *url.URL, cookies []*http.Cookie)
{ "pile_set_name": "Github" }
@model cloudscribe.SimpleContent.Web.ViewModels.PageViewModel @section Meta { <meta name="robots" content="noindex, follow" /> } @section Styles { <partial name="StylePartial" model="@Model" /> } @section Toolbar { <partial name="ToolsPartial" model="@Model" /> } @await Component.InvokeAsync("Navigation", new { viewName = "ChildTree", filterName = NamedNavigationFilters.ChildTree, startingNodeKey = "RootNode" })
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta charset="utf-8" /> <title>DPUB-ARIA roles allowed on h1 to h6</title> </head> <body> <h1 role="doc-subtitle">H1 Subtitle</h1> <h2 role="doc-subtitle">H2 Subtitle</h2> <h3 role="doc-subtitle">H3 Subtitle</h3> <h4 role="doc-subtitle">H4 Subtitle</h4> <h5 role="doc-subtitle">H5 Subtitle</h5> <h6 role="doc-subtitle">H6 Subtitle</h6> </body> </html>
{ "pile_set_name": "Github" }
.. _eu.gmic.FreakyBW: G’MIC Freaky B&W node ===================== .. raw:: html <!-- Do not edit this file! It is generated automatically by Natron itself. --> *This documentation is for version 1.0 of G’MIC Freaky B&W (eu.gmic.FreakyBW).* Description ----------- Author: David Tschumperle. Latest Update: 2015/30/09. Wrapper for the G’MIC framework (http://gmic.eu) written by Tobias Fleischer (http://www.reduxfx.com) and Frederic Devernay. Inputs ------ +--------+-------------+----------+ | Input | Description | Optional | +========+=============+==========+ | Source |   | No | +--------+-------------+----------+ Controls -------- .. tabularcolumns:: |>{\raggedright}p{0.2\columnwidth}|>{\raggedright}p{0.06\columnwidth}|>{\raggedright}p{0.07\columnwidth}|p{0.63\columnwidth}| .. cssclass:: longtable +-----------------------------------------------+---------+---------------+----------------------------+ | Parameter / script name | Type | Default | Function | +===============================================+=========+===============+============================+ | Strength (%) / ``Strength_`` | Double | 90 |   | +-----------------------------------------------+---------+---------------+----------------------------+ | Oddness (%) / ``Oddness_`` | Double | 20 |   | +-----------------------------------------------+---------+---------------+----------------------------+ | Brightness (%) / ``Brightness_`` | Double | 0 |   | +-----------------------------------------------+---------+---------------+----------------------------+ | Contrast (%) / ``Contrast_`` | Double | 0 |   | +-----------------------------------------------+---------+---------------+----------------------------+ | Gamma (%) / ``Gamma_`` | Double | 0 |   | +-----------------------------------------------+---------+---------------+----------------------------+ | Preview Type / ``Preview_Type`` | Choice | Full | |   | | | | | | **Full** | | | | | | **Forward Horizontal** | | | | | | **Forward Vertical** | | | | | | **Backward Horizontal** | | | | | | **Backward Vertical** | | | | | | **Duplicate Top** | | | | | | **Duplicate Left** | | | | | | **Duplicate Bottom** | | | | | | **Duplicate Right** | | | | | | **Duplicate Horizontal** | | | | | | **Duplicate Vertical** | | | | | | **Checkered** | | | | | | **Checkered Inverse** | +-----------------------------------------------+---------+---------------+----------------------------+ | Preview Split / ``Preview_Split`` | Double | x: 0.5 y: 0.5 |   | +-----------------------------------------------+---------+---------------+----------------------------+ | Output Layer / ``Output_Layer`` | Choice | Layer 0 | |   | | | | | | **Merged** | | | | | | **Layer 0** | | | | | | **Layer -1** | | | | | | **Layer -2** | | | | | | **Layer -3** | | | | | | **Layer -4** | | | | | | **Layer -5** | | | | | | **Layer -6** | | | | | | **Layer -7** | | | | | | **Layer -8** | | | | | | **Layer -9** | +-----------------------------------------------+---------+---------------+----------------------------+ | Resize Mode / ``Resize_Mode`` | Choice | Dynamic | |   | | | | | | **Fixed (Inplace)** | | | | | | **Dynamic** | | | | | | **Downsample 1/2** | | | | | | **Downsample 1/4** | | | | | | **Downsample 1/8** | | | | | | **Downsample 1/16** | +-----------------------------------------------+---------+---------------+----------------------------+ | Ignore Alpha / ``Ignore_Alpha`` | Boolean | Off |   | +-----------------------------------------------+---------+---------------+----------------------------+ | Preview/Draft Mode / ``PreviewDraft_Mode`` | Boolean | Off |   | +-----------------------------------------------+---------+---------------+----------------------------+ | Global Random Seed / ``Global_Random_Seed`` | Integer | 0 |   | +-----------------------------------------------+---------+---------------+----------------------------+ | Animate Random Seed / ``Animate_Random_Seed`` | Boolean | Off |   | +-----------------------------------------------+---------+---------------+----------------------------+ | Log Verbosity / ``Log_Verbosity`` | Choice | Off | |   | | | | | | **Off** | | | | | | **Level 1** | | | | | | **Level 2** | | | | | | **Level 3** | +-----------------------------------------------+---------+---------------+----------------------------+
{ "pile_set_name": "Github" }