方法论,原理C语言程序如下:TH0=0;//定时器高位,初值设为0TL0=0;//定时器低位,初值设为0T0_num=0;//定时器溢出次数,初值设为0while(pulse);//pulse为脉冲的输入引脚 while(!pulse);//等待上升沿来临 TR0=1;//打开定时器 while(pusl1);//等待下降沿来临 th1=TH0;tl1=TL0;num1=T0_num;//保存定时器值 while(!pusl1);//等待上升沿来临 TR0=0;//关闭定时器 th2=TH0;tl2=TL0;num2=T0_num;//保存定时器值
2025/2/27 5:40:04 37KB word
1
输入单词串,以“#”结束,如果是文法正确的句子,则输出成功信息,,否则输出“输入有误,输入了错误的符号:‘’”。
例如:输入{height=2;}#输出{ID=NUM;}=>simpleexpr=NUM=>multexprprime=empty=>multexpr=simpleexprmultexprprime=>assgstmt=ID=arithexpr;=>stmt=assgstmt=>stmts=empty=>stmts=stmtstmts=>compoundstmt={stmts}=>program=compoundstmt接受!输入{aa}#输出{ID}输入有误,输入了错误的符号:‘}’
2025/2/19 5:53:51 49KB LR(0) 语法分析
1
不知道有什么用,我想得积分,280113714&num=1&ut=s&cpi=64088308&v=20160407-1
2025/2/10 19:19:42 64KB windows
1
imdb.npz电影评论数据集当我们按照教程书籍里面的代码试验时,往往会出现数据集下载失败的问题.执行(train_data,train_labels),(test_data,test_labels)=imdb.load_data(num_words=10000)出现Downloadingdatafromhttps://s3.amazonaws.com/text-datasets/imdb.npz,网络连接失败。
此时,将下载好的imdb.npz文件放在主目录下的.keras/datasets文件夹下即可。
2025/1/23 1:51:45 16.66MB imdb数据 电影情感二分
1
PBDOM遍历一个节点下的所有节点name及text的函数例:1>trades_sold_get_response!2>trades!3>trade!4>adjust_fee:0.004>buyer_nick:hwangyanhong4>buyer_obtain_point_fee:04>buyer_rate:false4>cod_fee:0.004>cod_status:NEW_CREATED4>consign_time:2011-04-1821:32:404>created:2011-04-1712:25:234>discount_fee:0.004>modified:2011-04-1821:32:404>num:14>num_iid:100502052764>orders!5>order!6>adjust_fee:0.006>buyer_rate:false6>discount_fee:0.006>num:16>num_iid:100502052766>oid:723705613488006>payment:1.006>pic_path:http://img04.taobaocdn.com/bao/uploaded/i4/T1Ny8OXaXKXXaOBDQT_013227.jpg6>price:1.006>refund_status:NO_REFUND6>seller_rate:false6>seller_type:C6>status:WAIT_BUYER_CONFIRM_GOODS6>title:测试商品,请勿购买6>total_fee:1.004>pay_time:2011-04-1712:27:434>payment:1.004>pic_path:http://img04.taobaocdn.com/bao/uploaded/i4/T1Ny8OXaXKXXaOBDQT_013227.jpg4>point_fee:04>post_fee:0.004>price:1.004>real_point_fee:04>received_payment:0.004>receiver_address:所属地区:手机/小灵通号码:13764963675备注:4>receiver_name:不需收货人4>receiver_zip:0000004>seller_nick:xianzai894>seller_rate:false4>shipping_type:free4>sid:723705613488004>status:WAIT_BUYER_CONFIRM_GOODS4>tid:723705613488004>title:现在店4>total_fee:1.004>type:fixed2>total_results:1
1
P1=10;P2=20;Tr=30;Ts=1;beta=exp(-Ts/Tr);numm=[1];denm=[381];num=[2];den=[1691];[A,B,C,D]=tf2ss(num,den);[Gd,Hd,Cd,Dd]=c2dm(A,B,C,D,Ts);[Am,Bm,Cm,Dm]=tf2ss(numm,denm);[Gmd,Hmd,Cmd,Dmd]=c2dm(Am,Bm,Cm,Dm,Ts);
2024/12/23 9:45:04 7KB 预测函数控制
1
对即将找工作的大学生,研究生都爱刷leetcode的题目,但是刚刚接受无法适从,或是一时半会儿想不到解法,没关系,leetcode题解PDF可一带你慢慢了解思路过程。
目录3.4Addbinary615.1.5BinaryTreeLevelOr-3.5LongestPalindromicSubstring.62dertraversalil3.6RegularExpressionMatching665.1.6BinaryTreeZigzag3.7WildcardMatching67LevelOrdertraversal.963.8LongestCommonPrefix5.1.7RecoverBinarySearch3.9ValidNumber70Tree983.10Integertoroman725.1.8SameTree3.11RomantoInteger5.1.9SymmetricTree1013.12CountandSay745.1.10BalancedBinaryTree..1023.13Anagrams755.1.11FlattenBinaryTreeto3.14SimplifyPath76LinkedList1033.15LengthofLastWord775.1.12PopulatingNextRightPointersineachnodeii105第4章栈和队列7952二叉树的构建1074.1栈795.2.1ConstructBinaryTree4ValidParentheses79fromPreorderandIn4.1.2LongestvalidParenorderTraversatheses805.2.2ConstructBinaryTree4.1.3LargestRectangleinfromInorderandposHistogram82torderTraversal1084.14Evaluatereversepol-53二叉查找树109ishnotation845.3.1UniqueBinarySearch4,2队列85Trees5.3.2UniqueBinarySearch第5章树86Treesli.1105.1二叉树的遍历865.3.3ValidateBinarySearch5.1.1BinaryTreePreorderTreeTraversal865.3.4ConvertSortedarrayto5.1.2BinaryTreeInorderBinarySearchTreel12Traversal885.3.5ConvertSortedListto5.1.3BinaryTreePostorderBinarysearchtree113Traversal9054二叉树的递归1155.1.4BinaryTreeLevelOr5.4.1MinimumDepthofBidertraversalnarylree115目录5.4.2MaximumDepthofBi8.32重新实现nextpermunaryTree116tation1425.4.3PathSum117833递归.1435.44PathSumil1188.4PermutationsII1445.4.5BinaryTreeMaximum8.4.1nextpermutation...144PathSuum119842重新实现nextpermu5.4.6PopulatingNextRighttation144Pointersineachnode12084.3递归1445.4.7SumRoottoLeafNum8.5Combinations146bers122851递归146852迭代147第6章排序1238.6LetterCombinationsofaphone6.1MergeSortedArray123umber1476.2MergeTwoSortedLists12486.1递归1486.3MergekSortedLists124862迭代96.4InsertionSortList125第9章广度优先搜索1506.5Sortlist1269.1WordLadder1506.6FirstMissingPositive1279.2WordLadderil..1526.7SortColors289.3Surroundedregions154第7章查找94小结15613194.1适用场景1567.1Searchforarange131942思考的步骤.1567.2SearchInsertPosition.13294.3代码模板1577.3Searcha2DMatrix133第10章深度优先搜索162第8章暴力枚举法13510.1PalindromePartitioning..1628.1Subsets13510.2UniquePaths1658.1.1递归1350.2.1深搜1658.1.2迭代.13710.22备忘录法.1658.2Subsetsil13810.23动规166821递归1381024数学公式167822迭代.14110.3UniquePathsIl1688.3Permutations14210.3.1备忘录法1688.3.1nextpermutation14210.3.2动规.169目录10.4N-Queens16913.4Maximalrectangle19910.5N-QueensII17213.5BestTimetoBuyandSellStock10.6Restoreipaddresses17320010.7CombinationSum17413.6InterleavingString20110.8CombinationSumIl17513.7ScrambleString20310.9GenerateParentheses.17713.8MinimumPathSum20810.10Sudokusolver17813.9EditDistance21010.11WordSearch.18013.10DecodeWays.21210.12小结18113.11DistinctSubsequences21310.12.1适用场景1813.12WordBreak21410.122思考的步骤1811313WordBreakil21610.12.3代码模板183第14章图21810.12.4深拽与回溯法的区别.18414.1CloneGraph10.12.5深搜与递归的区别..184第15章细节实现题221第11章分治法18515.1ReverseInteger2211.1Pow(x,n)18515.2PalindromeNumber222qrt(x18615.3InsertInterval223第12章贪心法18715.4MergeIntervals22412.1Jumpgame18715.5MinimumWindowSubstring..22512.2JumpgameIl18815.6MultiplyStrings22712.3BestTimetobuyandsellstock19015.7SubstringwithConcatenation12.4BestTimetobuyandsellstock191ofallwords23012.5LongestSubstringWithoutre15.8Pascal,sTrianglepeatingCharacters19215.9PascalsTriangleIl23212.6ContainerwithmostWater.19315.10Spiralmatrix23315.11SpiralmatrixII234第13章动态规划19515.12ZigZagConversion23613.1Triangle19515.13DivideTwoIntegers23713.2MaximumSubarray19615.14TextJustification23813.3PalindromePartitioningII19815.15MaxPointsonaline目录第1章编程技巧在判断两个浮点数a和b是否相等时,不要用a=-b,应该判断二者之差的绝对值fabs(a-b)是否小于某个阈值,例如1e-9。
判断一个整数是否是为奇数,用x%2!=0,不要用x%2==1,因为x可能是负数用char的值作为数组下标(例如,统计字符串中每个字符出现的次数),要考虑到char可能是负数。
有的人考虑到了,先强制转型为unsignedint再用作下标,这仍然是错的。
正确的做法是,先强制转型为unsignedchar,再用作下标。
这涉及C++整型提升的规则,就不详述了。
以下是关于STL使用技巧的,很多条款来自《EffectiⅤveStL》这本书。
vector和string优先于动态分配的数组首先,在性能上,由于vector能够保证连续内存,因此一旦分配了后,它的性能跟原始数组相当其次,如果用new,意味着你要确保后面进行了delete,一旦忘记了,就会岀现BUG,且这样需要都写一行delete,代码不够短再次,声明多维数组的话,只能一个一个new,例如:int**ary=newint*[row_num];for(inti=0:i<rownum;++1)ary[i]newint[col_num]用vector的话一行代码搞定,vector<vector<int>>ary(row_num,vector<int>(col_num,0))使用reserve来避免不必要的重新分配第2章线性表这类题目考察线性表的操作,例如,数组,单链表,双向链表等。
21数组2.1.1RemoveDuplicatesfromSortedarray描述Givenasortedarray,removetheduplicatesinplacesuchthateachelementappearonlyonceandreturnthenewlengthDonotallocateextraspaceforanotherarray,youmustdothisinplacewithconstantmemoryForexample,GiveninputarrayA=[1,1,2Yourfunctionshouldreturnlength=2,andaisnow[1,2]分析无代码1/LeetCode,RemoveDuplicatesfromSortedArray/时间复杂度0(n),空间复杂度0(1)classSolutiontublicintremoveDuplicates(intA[],intn)tlf(n==oreturnointindex=0:for(inti=1:i<n:i++iif(Alindex!alidA[++index]=Alireturnindex12.1数组代码2//LeetCode,RemoveDuplicatesfromSortedArray//使用STL,时间复杂度0(n),空间复杂度0(1)classSolutionipublicintremoveDuplicates(intA[,intn)treturndistance(A,unique(A,An))代码3/LeetCode,RemoveDuplicatesfromSortedArray/使用STL,时间复杂度0(n),空间复杂度0(1)lassSolutionfublicintremoveDuplicates(intA[],intn)treturnremoveDuplicates(A,A+n,A)-A;template<typenameInIt,typenameoutit>OutItremoveDuplicates(InItfirst,InItlast,OutItoutput)thile(firstlast)i*output++=*firstfirstupper_bound(first,last,*firstreturnoutput相关题目RemoveduplicatesfromSortedArrayIl,见§2.1.22.1.2RemoveDuplicatesfromSortedArrayII描述Followupfor"RemoveDuplicates"Whatifduplicatesareallowedatmosttwice?Forexample,Givensortedarraya=[1,1,1,2,2,3]Yourfunctionshouldreturnlength=5,andAisnow[1,1,2,2,3分析加一个变量记录一下元素出现的次数即可。
这题因为是已经排序的数组,所以一个变量即可解决。
如果是没有排序的数组,则需要引入一个hashmap来记录出现次数4第2章线性表代码1//LeetCode,RemoveDuplicatesfromSortedArrayII/时间复杂度0(n),空间复杂度0(1)//qauthorhex108(https://github.com/hex108)classSolutiontublicintremoveDuplicates(intA[],intn)tlf(n<=2returnnintindex=2for(inti=2:in:1++)if(all]!Alindex-2])ALindex++]=Ali]returnindex;代码2下面是一个更简洁的版本。
上面的代码略长,不过扩展性好一些,例如将occur<2改为ocur<3,就变成了允许重复最多3次。
//LeetCode,RemoveDuplicatesfromSortedArrayII//@author虞航仲(http://weibo.com/u/1666779725)//时间复杂度0(n),空间复杂度0(1)classSolutionipublicintremoveDuplicates(intA[],intn)tmtindex=ofor(intif(i>0&&i<1&&A[i]==A[i-1]&&A[i]==A[i+1])continueAlindex++]=Alireturnindex;相关题目RemoveDuplicatesfromSortedArray,见§2.1.12.1.3SearchinRotatedSortedArray描述Supposeasortedarrayisrotatedatsomepivotunknowntoyoubeforehand
2024/12/7 0:08:16 1.03MB leetcode题解
1
GJK计算碰撞代码的应用//-----------------------------------------------------------------------------//Torque3D//Copyright(C)GarageGames.com,Inc.////Thecorealgorithmsinthisfilearebasedoncodewritten//byG.vandenBergenforhisinterferencedetectionlibrary,//"SOLID2.0"//-----------------------------------------------------------------------------#include"core/dataChunker.h"#include"collision/collision.h"#include"sceneGraph/sceneObject.h"#include"collision/convex.h"#include"collision/gjk.h"//----------------------------------------------------------------------------staticF32rel_error=1E-5f;//relativeerrorinthecomputeddistancestaticF32sTolerance=1E-3f;//DistancetolerancestaticF32sEpsilon2=1E-20f;//ZerolengthvectorstaticU32sIteration=15;//Stuckinaloop?S32num_iterations=0;S32num_irregularities=0;//----------------------------------------------------------------------------GjkCollisionState::GjkCollisionState(){a=b=0;}GjkCollisionState::~GjkCollisionState(){}//----------------------------------------------------------------------------voidGjkCollisionState::swap(){Convex*t=a;a=b;b=t;CollisionStateList*l=mLista;mLista=mListb;mListb=l;v.neg();}//----------------------------------------------------------------------------voidGjkCollisionState::compute_det(){//Dotnewpointwithcurrentsetfor(inti=0,bit=1;i0)returnfalse;}}returntrue;}//----------------------------------------------------------------------------inlineboolGjkCollisionState::closest(VectorF&v){compute_det();for(ints=bits;s;--s){if((s&bits)==s){if(valid(s|last_bit)){ bits=s|last_bit;if(bits!=15) compute_vector(bits,v); returntrue;}}}if(valid(last_bit)){bits=last_bit;v=y[last];returntrue;}returnfalse;}//----------------------------------------------------------------------------inlineboolGjkCollisionState::degenerate(constVectorF&w){for(inti=0,bit=1;imState=this;mListb=CollisionStateList::alloc();mListb->mState=this;}//----------------------------------------------------------------------------voidGjkCollisionState::reset(constMatrixF&a2w,constMatrixF&b2w){VectorFzero(0,0,0),sa,sb;a2w.mulP(a->support(zero),&sa);b2w.mulP(b->support(zero),&sb);v=sa-sb;dist=v.len();}//----------------------------------------------------------------------------voidGjkCollisionState::getCollisionInfo(constMatrixF&mat,Collision*info){AssertFatal(false,"GjkCollisionState::getCollisionInfo()-Thereremainscalingproblemshere.");//ThisassumesthattheshapesdonotintersectPoint3Fpa,pb;if(bits){getClosestPoints(pa,pb);mat.mulP(pa,&info->point);b->getTransform().mulP(pb,&pa);info->normal=info->point-pa;}else{mat.mulP(p[last],&info->point);info->normal=v;}info->normal.normalize();info->object=b->getObject();}voidGjkCollisionState::getClosestPoints(Point3F&p1,Point3F&p2){F32sum=0;p1.set(0,0,0);p2.set(0,0,0);for(inti=0,bit=1;isupport(va);a2w.mulP(p[last],&sa);VectorFvb,sb;w2b.mulV(v,&vb);q[last]=b->support(vb);b2w.mulP(q[last],&sb);VectorFw=sa-sb;if(mDot(v,w)>0)returnfalse;if(degenerate(w)){++num_irregularities;returnfalse;}y[last]=w;all_bits=bits|last_bit;++num_iterations;if(!closest(v)||num_iterations>sIteration){++num_irregularities;returnfalse;}}while(bitssEpsilon2);returntrue;}F32GjkCollisionState::distance(constMatrixF&a2w,constMatrixF&b2w,constF32dontCareDist,constMatrixF*_w2a,constMatrixF*_w2b){num_iterations=0;MatrixFw2a,w2b;if(_w2a==NULL||_w2b==NULL){w2a=a2w;w2b=b2w;w2a.inverse();w2b.inverse();}else{w2a=*_w2a;w2b=*_w2b;}reset(a2w,b2w);bits=0;all_bits=0;F32mu=0;do{nextBit();VectorFva,sa;w2a.mulV(-v,&va);p[last]=a->support(va);a2w.mulP(p[last],&sa);VectorFvb,sb;w2b.mulV(v,&vb);q[last]=b->support(vb);b2w.mulP(q[last],&sb);VectorFw=sa-sb;F32nm=mDot(v,w)/dist;if(nm>mu)mu=nm;if(mu>dontCareDist)returnmu;if(mFabs(dist-mu)sIteration){++num_irregularities;returndist;}y[last]=w;all_bits=bits|last_bit;if(!closest(v)){++num_irregularities;returndist;}dist=v.len();}while(bitssTolerance);if(bits==15&&mu<=0)dist=0;returndist;}
2024/11/12 17:21:22 50KB GJK 碰撞
1
图像的增强/////////////////////////////////直方图对话框构造函数;
ZFT::ZFT(CWnd*pParent/*=NULL*/):CDialog(ZFT::IDD,pParent)//ZFT为定义的用来显示直方图的对话框类;
{ Width=Height=0;//对话框初始化阶段设置图像的宽和高为"0";
}////////////////////////对话框重画函数;
voidZFT::OnPaint(){ CRectrect;//矩形区域对象;
 CWnd*pWnd;//得到图片框的窗口指针;
 pWnd=GetDlgItem(IDC_Graphic);//得到ZFT对话框内的"Frame"控件的指针;
 file://(IDC_Graphic为放置在对话框上的一个"Picture"控件,并讲类型设置为"Frame")。
 pWnd->GetClientRect(&rect);//得到"Frame"控件窗口的"视"区域;
 inti; CPaintDCdc(pWnd);//得到"Frame"控件的设备上下文;
 file://画直方图的x、y轴;
 dc.MoveTo(0,rect.Height()); dc.LineTo(rect.Width(),rect.Height()); dc.MoveTo(0,rect.Height()); dc.LineTo(0,0); file://画直方图,num[]是"ZFT"的内部数组变量,存放的是图像各个灰度级出现的概率;
该数组的各个分量在  显示具体图像的直方图时设置;
 for(i=0;iGetWindowRect(&rect);//获取pWnd窗口对象窗口区域位置;
 file://屏幕坐标转换为客户区坐标;
 ScreenToClient(&rect); file://判断当前鼠标是否指在直方图内;
 if(rect.PtInRect(point)) {  intx=point1.x-rect.left;  file://当前鼠标位置减去区域的起始位置恰好为当前鼠标所指位置所表示的灰度级;
  string.Format("%d",x);  file://显示当前位置对应的图像的灰度级;
  pWndText->SetWindowText((LPCTSTR)string); } CDialog::OnMouseMove(nFlags,point);}////////////////////////////////////////voidCDibView::OnImagehorgm()file://在程序的"视"类对象内处理显示图像直方图的函数;
{ CDibDoc*pDoc=GetDocument(); HDIBhdib; hdib=pDoc->GetHDIB(); BITMAPINFOHEADER*lpDIBHdr;//位图信息头结构指针;
 BYTE*lpDIBBits;//指向位图像素灰度值的指针;
 lpDIBHdr=(BITMAPINFOHEADER*)GlobalLock(hdib);//得到图像的位图头信息 lpDIBB
2024/11/9 9:49:33 134KB 图像增强
1
代码放在java目录下,然后将dboa.sql导入MySQL,管理员为admin,密码为admin,主程序为“daima\num_07\PandaStarOA\WebRoot\login.jsp”。
MySQL需要导入的开发包在“daima\num_07\PandaStarOA\WebRoot\WEB-INF\lib”目录下。
Hibernate需要导入的开发包也在“daima\num_07\PandaStarOA\WebRoot\WEB-INF\lib”目录下。
2024/10/10 6:43:43 5.63MB OA办公系统
1
共 65 条记录 首页 上一页 下一页 尾页
在日常工作中,钉钉打卡成了我生活中不可或缺的一部分。然而,有时候这个看似简单的任务却给我带来了不少烦恼。 每天早晚,我总是得牢记打开钉钉应用,点击"工作台",再找到"考勤打卡"进行签到。有时候因为工作忙碌,会忘记打卡,导致考勤异常,影响当月的工作评价。而且,由于我使用的是苹果手机,有时候系统更新后,钉钉的某些功能会出现异常,使得打卡变得更加麻烦。 另外,我的家人使用的是安卓手机,他们也经常抱怨钉钉打卡的繁琐。尤其是对于那些不太熟悉手机操作的长辈来说,每次打卡都是一次挑战。他们总是担心自己会操作失误,导致打卡失败。 为了解决这些烦恼,我开始思考是否可以通过编写一个全自动化脚本来实现钉钉打卡。经过一段时间的摸索和学习,我终于成功编写出了一个适用于苹果和安卓系统的钉钉打卡脚本。
2024-04-09 15:03 15KB 钉钉 钉钉打卡