精华内容
下载资源
问答
  • Vim Syntax Plugin for Verilog and SystemVerilog ... https://stackoverflow.com/questions/27498221/vim-highlight-matching-begin-end using matchit. This s...

    Vim Syntax Plugin for Verilog and SystemVerilog

    https://github.com/vhda/verilog_systemverilog.vim

    https://stackoverflow.com/questions/27498221/vim-highlight-matching-begin-end

    using matchit. This script is part of vim runtime and can easily be loaded by adding the following line to your .vimrc:

    runtime macros/matchit.vim
    

    The standard Verilog filetype plugin already includes the matchit configuration you require:

    " Let the matchit plugin know what items can be matched.
    if exists("loaded_matchit")
      let b:match_ignorecase=0
      let b:match_words=
        \ '\<begin\>:\<end\>,' .
        \ '\<case\>\|\<casex\>\|\<casez\>:\<endcase\>,' .
        \ '\<module\>:\<endmodule\>,' .
        \ '\<if\>:\<else\>,' .
        \ '\<function\>:\<endfunction\>,' .
        \ '`ifdef\>:`else\>:`endif\>,' .
        \ '\<task\>:\<endtask\>,' .
        \ '\<specify\>:\<endspecify\>'
    endif
    

    This way you can match the begin/end using % key, as you probably already do for parentheses and such.

    https://www.cnblogs.com/air-of-code/p/4733151.html

    matchit这个插件,是vim自带的,但是默认不安装。在vim中默认可以用%来实现括号之间的跳转,但是有了这个插件可以设置任意想跳转的标记。

      在linux中敲vi打开一个空白的文件
      :help matchit-install

      可以看到安装matchit的步骤

      就是在cd.vim文件夹下

      mkdir ~/.vim/plugin
      cp $VIMRUNTIME/macros/matchit.vim ~/.vim/plugin

      mkdir ~/.vim/doc
      cp $VIMRUNTIME/macros/matchit.txt ~/.vim/plugin


      然后let b:match_words='\<begin\>:\<end\>' 加到.vimrc文件中

      这里还可以根据自己的需要加上module,primitive等需要匹配的字符串。

      这样就OK了,打开任意一个文件用%就可以看到begin end之间的匹配了。

      在拷上面两个文件的时候没有VIMRUNTIME这个环境变量,在linux中echo一下也是空白,后来在vim中echo才出来了,这个变量是VIM的安装路径。如果在linux中不能用,直接用路径替换掉这个变量就好啦。

      还有一个方法可以替代上面的拷这两个文件,在.vimrc中加上下面这句话

      source $VIMRUNTIME/macros/matchit.vim 

      或者

      runtime macros/matchit.vim 

      还可以在匹配时设这忽略大小写敏感,例如如果在.vimrc中有这句话

      let b:match_ignorecase = 1

      就是忽略大小写,那样begin和END也可以匹配,如果要关掉大小写敏感的话

      let b:match_ignorecase = 0

      真心方便好用!!!

    展开全文
  • cbegin(cend): Return const_iterator to beginning Returns a const_iterator pointing to the first element in the container. A const_iterator is an iterator that points to const content. This iter

    cbegin(cend):

    Return const_iterator to beginning
    Returns a const_iterator pointing to the first element in the container.

    A const_iterator is an iterator that points to const content. This iterator can be increased and decreased (unless it is itself also const), just like the iterator returned by vector::begin, but it cannot be used to modify the contents it points to, even if the vector object is not itself const.

    If the container is empty, the returned iterator value shall not be dereferenced.


    begin(end):

    Return iterator to beginning
    Returns an iterator pointing to the first character of the string.



    Additional topics for the begin and end:

    When the article say the begin() function in the array, we should get more attention on the begin function.. It says it's a function in the concept of "array", not the member-fucntion for the iterator.

    I found there is another point we need to know.. The books don't mention it. for a instance:

    #include <iostream>

    #include <iterator>

    using name space;

    int main()

    {

    int ia[] = {0,1,2,3,4,5,6,7,8,9}; // ten elements in the array

    int  *pbeg = begin(ia);

    int *pend = end(ia):

    cout << *pbeg << " " << *pend << endl;

    }

    if you print them, what  does your comipler tell u ? The gcc compiler told me:  0,0. The *pend doesn't point to the last element in array. why?

    Let's make some change for it?

    #include <iostream>

    #include <iterator>

    using name space;

    int main()

    {

    int ia[] = {0,1,2,3,4,5,6,7,8,9}; // ten elements in the array

    int  *pbeg = begin(ia);

    int *pend = end(ia):

    cout << *pbeg << " " << *pend << endl;

    for (unsigned int i = 0; i != 11; ++i) // special purpose for the error..

     cout << *(pbeg+i) << " |";

    }

    Check it out? Holly crap, the *pend had been changed, the undefined ia[11]  is same as the *pend... What's that???

    *pend pointer is stranger than I had know. But right now, i see it .

    the safe usage is *(pend-1) replace the *pend.... At least , we need more thinking when we programing...

    展开全文
  • Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right ...报错是因为mysql的procedure里面if else语句里面, 用了begin end...

    Error Code : 1064

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

    报错是因为mysql的procedure里面if else语句里面, 用了begin end语句,去掉了就OK了.

     

    DELIMITER $$

     

    USE `sportgbmj`$$

     

    DROP PROCEDURE IF EXISTS `sp_web_addmiddayrank`$$

     

    CREATE DEFINER=`root`@`%` PROCEDURE `sp_web_addmiddayrank`()

    BEGIN

    /*

    修订记录:

    -------------------------------------------------------------------

    版本 修订人 修订日期 修订描述

    -------------------------------------------------------------------

    1.0.0 2013-06-15 查询当前中午12:30-13:30比赛排名

    该sp 当前比赛结束后执行

    排名先决条件:

    1:在一场内必须完满10(含)局以上

    -------------------------------------------------------------------

    */

    DECLARE i_date DATE ;

    DECLARE i_starttime TIME;

    DECLARE i_endtime TIME;

    SET i_date = NOW();

    SET i_endtime = NOW();

    IF (i_endtime > '22:30') THEN

    BEGIN

    /* 夜间赛场 */

    SET i_starttime = '21:30';

    SET i_endtime = '22:30';

    END

    ELSE

    BEGIN

    /* 中午场 */

    SET i_starttime = '12:30';

    SET i_endtime = '13:30';

    END

    END IF;

     

    CREATE TEMPORARY TABLE tmp_rank(

    id INT NOT NULL AUTO_INCREMENT -- 自增

    ,userid INT -- 用户标识

    ,beans INT -- bean 汇总

    ,rounds TINYINT -- 局数 汇总

    ,posttime TIME -- 时间 (该玩家本场比赛最后的时间)

    ) ENGINE = MYISAM;

    INSERT INTO tmp_rank (userid,beans,rounds,posttime)

    SELECT

    userid

    ,SUM(CASE WHEN consume > 0 THEN consume ELSE 0 END) beans

    ,COUNT(userid) rounds

    ,MAX(posttime) AS posttime

    FROM

    score AS S

    INNER JOIN

    scorelist AS SL

    ON

    S.pid = SL.pid

    WHERE

    roomid IN ('1001') AND (postdate = i_date AND posttime >='12:30:00' AND posttime <='13:30:00')

    GROUP BY

    userid

    HAVING

    (rounds >= 10)

    ORDER BY

    beans DESC

    ,maxtime ASC

    LIMIT 500;

    /*

    插入排名表

    */

    INSERT INTO

    hf_playranklist (userid,rank,beans,rounds,postdate,posttime)

    SELECT

    userid,beans,rounds,i_date,posttime

    FROM tmp_rank;

    /*

    插入奖品表

    */

    INSERT INTO hf_prizelist (userid,STATUS,prizeid,receivetime,postdate)

    SELECT

    userid

    ,0

    ,(CASE WHEN id >= 11 THEN 4

    WHEN (id >= 3 AND id <= 10) THEN 3

    WHEN id = 2 THEN 2

    WHEN id = 1 THEN 1

    END) AS prizeid

    ,beans

    ,rounds

    ,posttime

    FROM

    tmp_rank AS R

    WHERE

    rank >= 30;

    END$$

     

    DELIMITER ;BEGIN

    /* 夜间赛场 */

    SET i_starttime = '21:30';

    SET i_endtime = '22:30';

    END

    ELSE

    BEGIN

    /* 中午场 */

    SET i_starttime = '12:30';

    SET i_endtime = '13:30';

    END

    END IF;

     

    CREATE TEMPORARY TABLE tmp_rank(

    id INT NOT NULL AUTO_INCREMENT -- 自增

    ,userid INT -- 用户标识

    ,beans INT -- bean 汇总

    ,rounds TINYINT -- 局数 汇总

    ,posttime TIME -- 时间 (该玩家本场比赛最后的时间)

    ) ENGINE = MYISAM;

    INSERT INTO tmp_rank (userid,beans,rounds,posttime)

    SELECT

    userid

    ,SUM(CASE WHEN consume > 0 THEN consume ELSE 0 END) beans

    ,COUNT(userid) rounds

    ,MAX(posttime) AS posttime

    FROM

    score AS S

    INNER JOIN

    scorelist AS SL

    ON

    S.pid = SL.pid

    WHERE

    roomid IN ('1001') AND (postdate = i_date AND posttime >='12:30:00' AND posttime <='13:30:00')

    GROUP BY

    userid

    HAVING

    (rounds >= 10)

    ORDER BY

    beans DESC

    ,maxtime ASC

    LIMIT 500;

    /*

    插入排名表

    */

    INSERT INTO

    hf_playranklist (userid,rank,beans,rounds,postdate,posttime)

    SELECT

    userid,beans,rounds,i_date,posttime

    FROM tmp_rank;

    /*

    插入奖品表

    */

    INSERT INTO hf_prizelist (userid,STATUS,prizeid,receivetime,postdate)

    SELECT

    userid

    ,0

    ,(CASE WHEN id >= 11 THEN 4

    WHEN (id >= 3 AND id <= 10) THEN 3

    WHEN id = 2 THEN 2

    WHEN id = 1 THEN 1

    END) AS prizeid

    ,beans

    ,rounds

    ,posttime

    FROM

    tmp_rank AS R

    WHERE

    rank >= 30;

    END$$

     

    DELIMITER ;

     

    展开全文
  • vector front back 与 begin end 的区别

    千次阅读 2013-04-10 18:23:40
    vector::end , which returns an iterator just past this element, this function returns a direct reference. Calling this function on an  empty  container causes undefined behavior. ...

    std::vector::back

    <vector>
          reference back();
    const_reference back() const;
    Access last element
    Returns a reference to the last element in the  vector.

    Unlike member  vector::end, which returns an iterator just past this element, this function returns a direct reference.

    Calling this function on an  empty container causes undefined behavior.

    std::vector::front

    <vector>
          reference front();
    const_reference front() const;
    
    Access first element
    Returns a reference to the first element in the  vector.

    Unlike member  vector::begin, which returns an iterator to this same element, this function returns a direct reference.

    Calling this function on an  empty container causes undefined behavior.

    std::vector::at

    <vector>
          reference at (size_type n);
    const_reference at (size_type n) const;
    Access element
    Returns a reference to the element at position  n in the  vector.

    The function automatically checks whether  n is within the bounds of valid elements in the  vector, throwing an out_of_range exception if it is not (i.e., if  n is greater or equal than its  size). This is in contrast with member operator[], that does not check against bounds.
    展开全文
  • begin-end/fork-join

    千次阅读 2018-04-13 10:12:00
    Begin-end顺序执行[例3]:parameterd=50; //声明d是一个参数reg [7:0] r; //声明r是一个8位的寄存器变量begin //由一系列延迟产生的波形#d r = 'h35;#d r = 'hE2;#d r = 'h00;#d r = 'hF7;#d -&gt; end_wave; //...
  • cbegin(cend): Return const_iterator to beginning Returns aconst_iteratorpointing to the first element in the container. ...begin(end): Return iterator to beginning Returns an iterator pointing ...
  • C++中map的beginend

    千次阅读 2010-01-26 17:41:00
    beginreturns an iterator to the beginning of the map。endreturns an iterator just past the last element of a mapbegin 是指向第一个元素,end指向最后一个元素的下一个元素。!!!
  • 关于Verilog中begin-end & fork-join

    千次阅读 2018-06-27 15:40:35
    转载:http://blog.sina.com.cn/s/blog_6c7b6f030101cpgt.htmlbegin-end and fork-join are used to combine a group of statements in a ... General syntax with begin-end is as follows:type_of_block ...
  • 9.3.2 beginend成员  beginend操作产生指向容器内第一个元素和最后一个元素的下一个位置的迭代器,如下所示。这两个迭代器通常用于标记包含容器中所有元素的迭代范围。 c.begin() 返回一个迭代器,它指向容器...
  • begin-end语句块在mysql中的使用问题

    千次阅读 2016-12-21 11:42:00
    在最近在通过navicate...delimiter $$BEGIN SET @a=1; if (@a &gt; 0) THEN SELECT COUNT(*) from tb_public_effect_tmp;ELSE SELECT * from tb_effect_master;end if; END $$ delimiter ; 直接报错[Err] 1...
  • C++之begin()和end()分析(C艹11)

    千次阅读 2017-06-07 13:13:53
    被一网友问到过个这个问题,看了下源码,差不多应该明白了例子:int...std::for_each(std::begin(a), std::end(a), [&](int n) {cout ;}); //这样会把13579输出来。1,先看一下beginend这源码template constexpr con
  • 9.3.2 beginend成员  beginend操作产生指向容器内第一个元素和最后一个元素的下一个位置的迭代器,如下所示。这两个迭代器通常用于标记包含容器中所有元素的迭代范围。 c.begin() 返回一个迭代器,它指向容器...
  • GO、BEGIN...END 在存储过程中的区别

    千次阅读 2019-01-03 17:32:18
    GO is like the end of a script. You could have multiple CREATE TABLE statements, separated by GO. It’s a way of isolating one part of the script from another, but submitting it all in one block. ...
  • 101.Examine the data in the PROMO_BEGIN_DATE column of the PROMOTIONS table:
  • js 由endbody底部调整到顶部beginbody

    千次阅读 2014-10-05 14:57:24
    /vendor/yiisoft/yii2/web/View.php 原来: /** * Marks the beginning of an HTML body section. */ public function beginBody() { echo self::PH_BODY_BEGIN; $this->trigge
  •  出现unbalanced calls to begin/end appearance transitions for uiviewcontroller这样的log,其原因就是在容器类的UIViewController(如,UINavigationController, UITabBarController)中动画没做完,然后又开始...
  • c++ vector begin(),end(),rbegin(),rend()问题

    万次阅读 多人点赞 2016-06-02 15:38:33
    9.3.2 beginend成员  beginend操作产生指向容器内第一个元素和最后一个元素的下一个位置的迭代器。这两个迭代器通常用于标记包含容器中所有元素的迭代范围。 c.begin() 返回一个迭代器,它指向容器c的第...
  • Detection of Fractured Blocks During Open Backups ...One danger in making online backups is the possibility of inconsistent data within a  block. For example, assume that you are backing up block 100 i
  • BEGIN_MESSAGE_MAP和END_MESSAGE_MAP

    千次阅读 2007-10-30 21:42:00
    BEGIN_MESSAGE_MAP和END_MESSAGE_MAP首先看定义#define BEGIN_MESSAGE_MAP(theClass, baseClass) / const AFX_MSGMAP* theClass::GetMessageMap() const / { return &theClass::messageMap; }
  • 之前看见std::vector 容器的begin()、end()、front()、back()用法,了解begin()和end(),不了解front()和back()方法,今天没事查了下博客,验证了下,留个随手笔记。 一、begin函数 函数原型: iterator begin(); ...
  • CREATE TRIGGER trigger_activity_id_delete AFTER DELETE ON tp_activity FOR EACH ...BEGIN DELETE FROM tp_code WHERE OLD.id = tp_code.`activity_id`; END 报错: 1 queries executed, 0 success, 1 error...
  • 包括一系列的 Transact-SQL 语句,从而可以执行一组 Transact-SQL 语句。BEGINEND 是控制流语言的关键字。 Transact-SQL 语法约定 语法 BEGIN { sql_statement | statement_block } END 参数 { s
  • 使用的xml文档如下     [html] view plain copy   &lt;?xml version="1.0" encoding="UTF-8"?&gt;  ...Begin&.../Begin&...End&gt;Etha
  • STL 1–迭代器std::begin()和std::end()使用 迭代器是一个行为类似于指针的模板类对象。只需要迭代器iter指向一个有效对象,就可以通过使用*iter解引用的方式来获取一个对象的引用。通常会使用一对...
  • BEGIN_MESSAGE_MAP和END_MESSAGE_MAP首先看定义#define BEGIN_MESSAGE_MAP(theClass, baseClass) / const AFX_MSGMAP* theClass::GetMessageMap() const / { return &theClass::messageMap; } / AFX_
  •      mfccommandclass框架null ...BEGIN_MESSAGE_MAP和END_MESSAGE_MAP 首先看定义 #define BEGIN_MESSAGE_MAP(theClass, baseClass) /  const AFX_MSGMAP* theClass::GetMessageMap() const /  
  • 1431/2 PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following: := ; not null default character The symbol ";" was substituted for "BEGIN" to ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 328,526
精华内容 131,410
关键字:

beginendthe