利用 Topgit 对 Nutch 定制开发进行代码管理(二)

第一篇:Git基本命令的使用 (一)基本命令的使用 注:参考GIt官方文档 1.创建本地仓库的操作步骤如下: 在D:\Gitlearn目录下创建工作区并初始化本地仓库 lenovo@Lenovo-PC MINGW64 /d/Gitlearn $ mkdir respository //1.创建工作区目录 lenovo@Lenovo-PC MINGW64 /d/Gitlearn $ cd respository... 阅读详情

继 : 利用 Topgit 对 Nutch 定制开发进行代码管理(一)

 

6. 利用 Topgit 对 Nutch 定制开发进行代码管理


了解了 Topgit 的原理和使用方法之后,就可以利用 Topgit 对 Nutch 定制开发进行源代码管理了。

 


6.1 准备版本库


 

● 克隆完整的 Nutch 项目代码


从 github 上克隆完整的 nutch 项目代码:

    
    [devalone@devalone nutch]$ git clone https://github.com/apache/nutch.git

查看版本库配置信息:
    
    [devalone@devalone nutch]$ cat .git/config
    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    [remote "origin"]
            url = https://github.com/apache/nutch.git
            fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
            remote = origin
            merge = refs/heads/master

定制开发并不向原始的 https://github.com/apache/nutch.git 版本库上提交代码,而是要向一个本地团队开发公用的版本库提交代码,因此修改 "origin" 远程版本库的名称,而将 "origin" 名称留给团队公用版本库使用。将原始版远程本库名称改为 "upstream" 或其它可以表明上游版本库含义的名称:

    [devalone@devalone nutch]$ git remote rename origin upstream


查看分支和远程分支:
    [devalone@devalone nutch]$ git branch
    * master
    [devalone@devalone nutch]$ git branch -r
      upstream/2.1
      upstream/2.x
      upstream/HEAD -> upstream/master
      upstream/NUTCH-2292
      upstream/branch-0.7
      upstream/branch-0.8
      upstream/branch-0.9
      upstream/branch-1.1
      upstream/branch-1.10
      upstream/branch-1.14
      upstream/branch-1.15
      upstream/branch-1.2
      upstream/branch-1.3
      upstream/branch-1.4
      upstream/branch-1.5
      upstream/branch-1.5.1
      upstream/branch-1.6
      upstream/branch-1.7
      upstream/branch-1.8
      upstream/branch-1.9
      upstream/branch-2.2
      upstream/branch-2.2.1
      upstream/branch-2.3
      upstream/branch-2.3.1
      upstream/master
      upstream/nutchbase
      upstream/nutchgora

上游 upstream 远程版本库对定制开发来说,只具有拉取功能,用于更新本地版本库,而不具有推送功能。这对定制开发来说已经足够了,也正是我们所需要的。

 

● 创建 Nutch 2.x 的本地分支
-------------------------------------------------------------------------------------------------------------------------
由于目前 Nutch 在两个代码分支上进行持续开发,分别为 Nutch 1.x 和 Nutch 2.x :

    □ Nutch 1.x :成熟的产品级 web 爬虫,这个分支通过精细的优化配制,充分利用了具有非常强大的批处理能力的Apache Hadoop数据 结构。目前该分支最新版本是 2017 年12月23日发布的 Nutch 1.14,基于 Hadoop 2.7.4 版本开发。
                  
                  通过如下网址访问该版本的发布报告:
                  
                  https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=10680&version=12340218
                        

    □ Nutch 2.x :从 1.x 分离出来的新兴版本,最重要的不同在于:将底层具体的数据存储抽象为存储层,利用 Apache Gora 作为数据中间层来处理对象的持久化映射。这样用户可以实现非常灵活数据模型来存储任何数据到各种类型的 NoSQL 存储方案中, 例如,抓取时间(etch time), 状态(status), 内容(content), 解析的文本(parsed text), 出链(outlinks),入链 ( inlinks) 等等。
                  
                  目前该分支的最新版本是 2016 年1月21日发布的 Nutch 2.3.1。通过如下网址访问该版本的发布报告:

                  https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=10680&version=12329371


克隆下来的 master 分支对应于 Nutch 1.x 分支,而 Nutch 2.x 分支对应于上游版本库 upstream/2.x ,还没有创建对应的本地分支。
如果针对 Nutch 2.x 进行定制开发,则需要手动创建对应的本地分支。方法如下:

    [devalone@devalone nutch]$ git checkout -b nutch-2.x upstream/2.x
    分支 'nutch-2.x' 设置为跟踪来自 'upstream' 的远程分支 '2.x'。
    切换到一个新分支 'nutch-2.x'

新创建的本地分支 'nutch-2.x' 设置为跟踪来自 'upstream' 的远程分支 '2.x'。并且切换到了新分支 'nutch-2.x' 上。显然,当前我们
有了两个分支:

    [devalone@devalone nutch]$ git branch
      master
    * nutch-2.x

查看 git 配置的变化:

    [devalone@devalone nutch]$ cat .git/config
    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    [remote "upstream"]
            url = https://github.com/apache/nutch.git
            fetch = +refs/heads/*:refs/remotes/upstream/*
    [branch "master"]
            remote = upstream
            merge = refs/heads/master
    [branch "nutch-2.x"]
            remote = upstream
            merge = refs/heads/2.x

        

● 建立定制开发团队公用的开发版本库
-------------------------------------------------------------------------------------------------------------------------
上游版本库准备好了,下一步要建立开发团队内部使用的公用版本库,用于各团队成员向其推送提交,称之为 "团队版本库" 。

建立团队开发版本库的方法很多,最简单的方法就是克隆一个裸版本库到一个团队成员都能访问的公用服务器上。版本库间的通信协议也很多,一般使用 ssh 通信比较方便。这里不再赘述,使用环境内已存在的 gitolite 建立公用版本库,URL 为:

    repo.sansovo.org:scm/vnutch


● 将团队开发版本库添加为远程版本库
-------------------------------------------------------------------------------------------------------------------------
将建立好的团队开发版本库 URL 注册名称为 "origin" 的远程版本库:

    [devalone@devalone nutch]$ cat .git/config
    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    [remote "upstream"]
            url = https://github.com/apache/nutch.git
            fetch = +refs/heads/*:refs/remotes/upstream/*
    [branch "master"]
            remote = upstream
            merge = refs/heads/master
    [branch "nutch-2.x"]
            remote = upstream
            merge = refs/heads/2.x
    [remote "origin"]
            url = repo.sansovo.org:scm/vnutch
            fetch = +refs/heads/*:refs/remotes/origin/*

 

● 将本地版本库推送到团队版本库
-------------------------------------------------------------------------------------------------------------------------

    [devalone@devalone nutch]$ git branch
    * master
      nutch-2.x

    [devalone@devalone nutch]$ git push origin master
    枚举对象: 46738, 完成.
    对象计数中: 100% (46738/46738), 完成.
    Delta compression using up to 4 threads.
    压缩对象中: 100% (10657/10657), 完成.
    写入对象中: 100% (46738/46738), 127.94 MiB | 375.00 KiB/s, 完成.
    Total 46738 (delta 22886), reused 46735 (delta 22886)
    To repo.sansovo.org:scm/vnutch
     * [new branch]        master -> master

    [devalone@devalone nutch]$ git push origin nutch-2.x
    枚举对象: 10338, 完成.
    对象计数中: 100% (10337/10337), 完成.
    Delta compression using up to 4 threads.
    压缩对象中: 100% (2842/2842), 完成.
    写入对象中: 100% (9880/9880), 1.94 MiB | 42.24 MiB/s, 完成.
    Total 9880 (delta 4685), reused 9197 (delta 4078)
    To repo.sansovo.org:scm/vnutch
     * [new branch]        nutch-2.x -> nutch-2.x

    

6.2 建立 TopGit 特性版本
-------------------------------------------------------------------------------------------------------------------------
准备好版本仓库之后,创建 Nutch 1.x 和 Nutch 2.x 的特性分支。

 

● 创建依赖于 master 的 Nutch 1.x 特性分支 t/vnutch-1.x
-------------------------------------------------------------------------------------------------------------------------
    [devalone@devalone nutch]$ tg create t/vnutch-1.x master
    tg: creating t/vnutch-1.x base from master...
    切换到一个新分支 't/vnutch-1.x'
    [t/vnutch-1.x c95f855a] tg create t/vnutch-1.x
     2 files changed, 5 insertions(+)
     create mode 100644 .topdeps
     create mode 100644 .topmsg
    tg: Topic branch t/vnutch-1.x created.

 

● 创建依赖于 Nutch-2.x 的 Nutch 2.x 特性分支 t/vnutch-2.x
-------------------------------------------------------------------------------------------------------------------------
    [devalone@devalone nutch]$ tg create t/vnutch-2.x nutch-2.x
    tg: creating t/vnutch-2.x base from nutch-2.x...
    切换到一个新分支 't/vnutch-2.x'
    [t/vnutch-2.x b3bd8d1a] tg create t/vnutch-2.x
     2 files changed, 5 insertions(+)
     create mode 100644 .topdeps
     create mode 100644 .topmsg
    tg: Topic branch t/vnutch-2.x created.

 

● 查看特性分支信息
-------------------------------------------------------------------------------------------------------------------------
    [devalone@devalone nutch]$ git branch
      master
      nutch-2.x
      t/vnutch-1.x
    * t/vnutch-2.x

    [devalone@devalone nutch]$ tg info
    Topic Branch: t/vnutch-2.x (1/1 commit)
    Subject: [PATCH] t/vnutch-2.x
    Base: c43c2c85
    Depends: nutch-2.x
    Up-to-date.

    [devalone@devalone nutch]$ tg checkout t/vnutch-1.x
    切换到分支 't/vnutch-1.x'
    [devalone@devalone nutch]$ tg info
    Topic Branch: t/vnutch-1.x (1/1 commit)
    Subject: [PATCH] t/vnutch-1.x
    Base: aaf85cad
    Depends: master
    Up-to-date.

    [devalone@devalone nutch]$ tg summary
    >0       t/vnutch-1.x                   [PATCH] t/vnutch-1.x
     0       t/vnutch-2.x                   [PATCH] t/vnutch-2.x


    
● 设置 TopGit 远程分支信息
-------------------------------------------------------------------------------------------------------------------------
    [devalone@devalone nutch]$ tg remote --populate origin
    tg: Remote origin can now follow TopGit topic branches.
    tg: Populating local topic branches from remote 'origin'...
    tg: The remote 'origin' is now the default source of topic branches.

查看 git 配置信息变化:

    [devalone@devalone nutch]$ cat .git/config
    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    [remote "upstream"]
            url = https://github.com/apache/nutch.git
            fetch = +refs/heads/*:refs/remotes/upstream/*
    [branch "master"]
            remote = upstream
            merge = refs/heads/master
    [branch "nutch-2.x"]
            remote = upstream
            merge = refs/heads/2.x
    [remote "origin"]
            url = repo.sansovo.org:scm/vnutch
            fetch = +refs/heads/*:refs/remotes/origin/*
            fetch = +refs/top-bases/*:refs/remotes/origin/top-bases/*
    [merge "ours"]
            name = \"always keep ours\" merge driver
            driver = touch %A
    [topgit]
            remote = origin


● 将 TopGit 分支推送到远程版本库
-------------------------------------------------------------------------------------------------------------------------
查看特性分支状态信息:
    
    [devalone@devalone nutch]$ tg summary
    >0l      t/vnutch-1.x                   [PATCH] t/vnutch-1.x
     0l      t/vnutch-2.x                   [PATCH] t/vnutch-2.x


TopGit 特性分支只存在于本地版本库,还没有推送到远程版本库

运行 tg push --all | -a 命令,将所有的 TopGit 分支推送到远程版本库:

    [devalone@devalone nutch]$ tg push --all
    Enumerating objects: 10, done.
    Counting objects: 100% (10/10), done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (6/6), done.
    Writing objects: 100% (8/8), 932 bytes | 932.00 KiB/s, done.
    Total 8 (delta 2), reused 0 (delta 0)
    To repo.sansovo.org:scm/vnutch
     * [new branch]        t/vnutch-1.x -> t/vnutch-1.x
     * [new branch]        t/vnutch-2.x -> t/vnutch-2.x
     * [new branch]        refs/top-bases/t/vnutch-1.x -> refs/top-bases/t/vnutch-1.x
     * [new branch]        refs/top-bases/t/vnutch-2.x -> refs/top-bases/t/vnutch-2.x
    
    [devalone@devalone nutch]$ tg summary
    >0r      t/vnutch-1.x                   [PATCH] t/vnutch-1.x
     0r      t/vnutch-2.x                   [PATCH] t/vnutch-2.x


OK. 本地版本库与团队开发版本库同步一致。

 


6.3 日常开发维护工作
-------------------------------------------------------------------------------------------------------------------------
特性分支及团队开发版本库设置完成之后,日后的定制开发工作就是在所创建的两个 Nutch 特性分支上进行,t/vnutch-1.x 分支基于
Nutch 1.x,t/vnutch-2.x 基于 Nutch 2.x, 可以随意在任何一条分支线上工作。日常工作与原生 Git 类似:

    git add ...
    git commit ...
    tg summary
    tg push ...
    
    需要时可以建立里程碑:
    tg tag ...
    
    
    
当上游版本库 https://github.com/apache/nutch.git 有足够多的提交需要合并到定制开发分支中时,执行下面操作过程:

    git pull upstream
    git push origin master
    git push origin nutch-2.x

    tg info
    tg summary
    tg update ...
    tg info
    
    可能发生冲突的过程,冲突解决,执行: tg update --continue
    
    tg summary
    ...


    NOTE:
    ---------------------------------------------------------------------------------------------------------------------
    使用 TopGit 管理定制开发,要始终在特性分支上执行提交和推送操作,不要在依赖的分支上操作,例如,本案例中的 master 和 nutch-2.x 分支。依赖分支用于跟踪上游分支的更新,以便特性分支进行 update 操作。定制开发日常真正开发工作的提交和推送都  是在各自的特性分支上进行,如本案例的 t/vnutch-1.x 和 t/vnutch-2.x 分支。
    
    
示例:

    下面是几天以后的一次更新操作,https://github.com/apache/nutch.git 的 master 分支上有了 2 个新的提交,执行:
    
    [devalone@devalone nutch]$ git pull upstream
    来自 https://github.com/apache/nutch
       aaf85cad..f02110f4  master     -> upstream/master
    更新 aaf85cad..f02110f4
    Fast-forward
    ...
    
    [devalone@devalone nutch]$ git push origin master
    枚举对象: 702, 完成.
    对象计数中: 100% (702/702), 完成.
    Delta compression using up to 4 threads.
    压缩对象中: 100% (83/83), 完成.
    写入对象中: 100% (443/443), 71.89 KiB | 71.89 MiB/s, 完成.
    Total 443 (delta 144), reused 442 (delta 143)
    To repo.sansovo.org:scm/vnutch
       aaf85cad..f02110f4  master -> master
    
    [devalone@devalone nutch]$ git push origin nutch-2.x
    Everything up-to-date
    
    [devalone@devalone nutch]$ tg checkout t/vnutch-1.x
    切换到分支 't/vnutch-1.x'

    [devalone@devalone nutch]$ tg info
    Topic Branch: t/vnutch-1.x (2/2 commits)
    Subject: [PATCH] t/vnutch-1.x
    Base: aaf85cad
    Remote Mate: origin/t/vnutch-1.x
    Depends: master
    Needs update from:
            master (2/2 commits)
            
    [devalone@devalone nutch]$ tg summary
    > r D    t/vnutch-1.x                   [PATCH] t/vnutch-1.x
      r      t/vnutch-2.x                   [PATCH] t/vnutch-2.x
      
    (注:新提交发生在 master 分支上,而 nutch-2.x 分支上并没有新的提交,因此 t/vnutch-1.x 状态发生变化,而 t/vnutch-2.x
    分支没有变化)

    [devalone@devalone nutch]$ tg update
    tg: Updating t/vnutch-1.x base with master changes...
    Fast-forward (no commit created)
    tg: The t/vnutch-1.x head is up-to-date wrt. its remote branch.
    tg: Updating t/vnutch-1.x against new base...
    Merge made by the 'trivial aggressive' strategy.
     99 files changed, 291 insertions(+), 256 deletions(-)
    
    [devalone@devalone nutch]$ tg summary
    > rL     t/vnutch-1.x                   [PATCH] t/vnutch-1.x
      r      t/vnutch-2.x                   [PATCH] t/vnutch-2.x

    [devalone@devalone nutch]$ tg update t/vnutch-2.x
    tg: The base is up-to-date.
    tg: The t/vnutch-2.x head is up-to-date wrt. its remote branch.
    tg: The t/vnutch-2.x head is up-to-date wrt. the base.

    [devalone@devalone nutch]$ tg summary
    > rL     t/vnutch-1.x                   [PATCH] t/vnutch-1.x
      r      t/vnutch-2.x                   [PATCH] t/vnutch-2.x
    
    
    最后执行 tg push 操作:
    
    [devalone@devalone nutch]$ tg push -a
    Enumerating objects: 4, done.
    Counting objects: 100% (4/4), done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (2/2), done.
    Writing objects: 100% (2/2), 362 bytes | 362.00 KiB/s, done.
    Total 2 (delta 1), reused 0 (delta 0)
    To repo.sansovo.org:scm/vnutch
       fe6aba3d..30b0cdac  t/vnutch-1.x -> t/vnutch-1.x
       aaf85cad..f02110f4  refs/top-bases/t/vnutch-1.x -> refs/top-bases/t/vnutch-1.x

    查看状态:
    [devalone@devalone nutch]$ tg summary
    > r      t/vnutch-1.x                   [PATCH] t/vnutch-1.x
      r      t/vnutch-2.x                   [PATCH] t/vnutch-2.x
      
    OK. 依赖更新完毕。

    
    下面是最近的 2 个新提交和上次 clone 时的最后一个提交:
    
    [devalone@devalone nutch]$ git log --oneline -3
    f02110f4 (HEAD -> master, refs/top-bases/t/vnutch-1.x, upstream/master, upstream/HEAD, origin/top-bases/t/vnutch-1.x,\
    origin/master) NUTCH-2633 Fix deprecation warnings when building Nutch master branch under JDK 10.0.2+13 (#374)
    01c5d6ea Prepare for new development after release of 1.15 - bump version number (1.15-SNAPSHOT -> 1.16-SNAPSHOT) - \
    add 1.15 changes / release notes
    aaf85cad Merge pull request #366 from sebastian-nagel/NUTCH-2622-unbundle-lgpl-licensed-jars


7. 将 Nutch 项目代码导入到 Eclipse 中
-------------------------------------------------------------------------------------------------------------------------
有了完备的代码管理,再将项目代码导入到 Eclipse 中,定制开发工作就可以愉快地展开了。

 

    NOTE: sonar-ant-task-2.2.jar
    ---------------------------------------------------------------------------------------------------------------------
    nutch 源码 ant 任务依赖 sonar-ant-task-2.2.jar 任务包,但 ivy 无法加载该包的资源定义 org/sonar/ant/antlib.xml,需要
    手动下载,否则出现如下错误:
    [taskdef] Could not load definitions from resource org/sonar/ant/antlib.xml. It could not be found.
    ivy-download:
    [taskdef] Could not load definitions from resource org/sonar/ant/antlib.xml. It could not be found.

    下载地址:
        https://download.youkuaiyun.com/download/devalone/10554266

    将下载解压的 sonar-ant-task-2.2.jar 包文件复制到 ant/lib/ 目录下:
        [devalone@nutch ant]$ sudo cp ~/sonar-ant-task-2.2.jar ant/lib/
    
    
    

7.1 Nutch 1.x 分支导入
-------------------------------------------------------------------------------------------------------------------------
① Nutch 1.x 分支对应已建好的 TopGit 特性分支 t/vnutch-1.x,因此确保当前在 t/vnutch-1.x 分支上:
    
    [devalone@devalone nutch]$ tg summary
    >0r      t/vnutch-1.x                   [PATCH] t/vnutch-1.x
     0r      t/vnutch-2.x                   [PATCH] t/vnutch-2.x
    

② 编辑项目根目录下的 ivy/ivysettings.xml 文件,将其中的 3 个依赖仓库 URL 修改为本地区较快的镜像仓库,例如:
-------------------------------------------------------------------------------------------------------------------------
    http://maven.aliyun.com/nexus/content/groups/public/
    http://maven.aliyun.com/nexus/content/repositories/central/
    http://maven.aliyun.com/nexus/content/repositories/apache-snapshots/
    

    本例使用本地网络环境内配置好的 maven 仓库:
    <property name="oss.sonatype.org"
    value="http://repo.sansovo.org:8081/nexus/content/groups/public/"
    override="false"/>
    <property name="repo.maven.org"
    value="http://repo.sansovo.org:8081/nexus/content/groups/public/"
    override="false"/>
    <property name="repository.apache.org"
    value="http://repo.sansovo.org:8081/nexus/content/groups/public-snapshot/"
    override="false"/>

    
③ 在工作区根目录下执行 ant 的 eclipse 任务:
-------------------------------------------------------------------------------------------------------------------------
    [devalone@devalone nutch]$ ant eclipse
    Buildfile: /home/devalone/workspaces/nutch/nutch/build.xml
    Trying to override old definition of task javac

    clean-build:
       [delete] Deleting directory /home/devalone/workspaces/nutch/nutch/build

    clean-default-lib:

    clean-test-lib:

    clean-lib:

    clean-dist:

    clean-eclipse:

    ivy-probe-antlib:

    ivy-download:

    ivy-download-unchecked:

    ivy-init-antlib:

    ivy-init:

    init:
        [mkdir] Created dir: /home/devalone/workspaces/nutch/nutch/build

    ...
    
    eclipse:
      [eclipse] There were no settings found.
      [eclipse] Writing the project definition in the mode "java".
      [eclipse] Writing the classpath definition.

    BUILD SUCCESSFUL
    Total time: 12 minutes 0 seconds
    
    

    首次执行时间取决于本地网速和所选的镜像仓库速度,以后再次执行 ant 任务时,很快就会完成。
    
    
④ 导入 Eclipse workspace:
-------------------------------------------------------------------------------------------------------------------------
启动 Eclipse,单击 File -> Import

在打开的 Import 向导对话框内展开 General 组,选择 Existing Projects into Workspace ,然后单击 Next 按钮

在 Import 向导的下一对话框内,选择 "Select root directory" ,然后通过 "Browse..." 按钮定位到 nutch 项目的根目录,单击 OK
按钮,返回到对话框。
    
单击 "Finish" 按钮完成导入。

项目名称显示为:

    nutch [nutch t/vnutch-1.x]
    
表明当前处于 t/vnutch-1.x 特性分支上。

OK. 导入 Eclipse 项目完成。


⑤ 将 t/vnutch-1.x 分支对 ivy/ivysettings 的修改提交并推送到团队开发版本库:
-------------------------------------------------------------------------------------------------------------------------
使用原生 Git 命令提交:
    [devalone@devalone nutch]$ git add ivy/ivysettings.xml
    [devalone@devalone nutch]$ git commit -m "修改 ivy 依赖仓库为本地仓库,以提升 ant 任务下载速度。"

查看当前状态信息:
    [devalone@devalone nutch]$ tg summary
    > rL     t/vnutch-1.x                   [PATCH] t/vnutch-1.x
     0r      t/vnutch-2.x                   [PATCH] t/vnutch-2.x

将特性分支提交推送的团队版本库:
    [devalone@devalone nutch]$ tg push
    Enumerating objects: 7, done.
    Counting objects: 100% (7/7), done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (4/4), done.
    Writing objects: 100% (4/4), 557 bytes | 557.00 KiB/s, done.
    Total 4 (delta 3), reused 0 (delta 0)
    To repo.sansovo.org:scm/vnutch
       c95f855a..fe6aba3d  t/vnutch-1.x -> t/vnutch-1.x
    

再次查看状态信息:
    [devalone@devalone nutch]$ tg summary
    > r      t/vnutch-1.x                   [PATCH] t/vnutch-1.x
     0r      t/vnutch-2.x                   [PATCH] t/vnutch-2.x    

OK.


7.2 Nutch 2.x 分支导入
-------------------------------------------------------------------------------------------------------------------------
① 与 Nutch 1.x 分支导入类似,首先切换到 t/vnutch-2 特性分支:


切换分支:
    [devalone@devalone nutch]$ tg checkout t/vnutch-2.x
    切换到分支 't/vnutch-2.x'
    [devalone@devalone nutch]$ git branch
      master
      nutch-2.x
      t/vnutch-1.x
    * t/vnutch-2.x
    


② 编辑项目根目录下的 ivy/ivysettings.xml 文件,将其中的 3 个依赖仓库 URL 修改为本地区较快的镜像仓库
-------------------------------------------------------------------------------------------------------------------------
    同 t/vnutch-1.x 分支设置。
    
    
③ 在工作区根目录下执行 ant 的 eclipse 任务:
-------------------------------------------------------------------------------------------------------------------------
    [devalone@devalone nutch]$ ant eclipse
    Buildfile: /home/devalone/workspaces/nutch/nutch/build.xml
    Trying to override old definition of task javac

    clean-build:
       [delete] Deleting directory /home/devalone/workspaces/nutch/nutch/build

    clean-lib:

    clean-dist:

    clean-eclipse:

    ivy-probe-antlib:

    ivy-download:

    ivy-download-unchecked:
          [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.3.0/ivy-2.3.0.jar
          [get] To: /home/devalone/workspaces/nutch/nutch/ivy/ivy-2.3.0.jar

    ivy-init-antlib:

    ivy-init:

    init:
        [mkdir] Created dir: /home/devalone/workspaces/nutch/nutch/build
        [mkdir] Created dir: /home/devalone/workspaces/nutch/nutch/build/lib
        [mkdir] Created dir: /home/devalone/workspaces/nutch/nutch/build/classes
        [mkdir] Created dir: /home/devalone/workspaces/nutch/nutch/build/release
        [mkdir] Created dir: /home/devalone/workspaces/nutch/nutch/build/test
        [mkdir] Created dir: /home/devalone/workspaces/nutch/nutch/build/test/classes
         [copy] Copying 1 file to /home/devalone/workspaces/nutch/nutch/conf

    ...
    
    eclipse:
    [eclipse] There were no settings found.
    [eclipse] Writing the project definition in the mode "java".
    [eclipse] Writing the classpath definition.

    BUILD SUCCESSFUL
    Total time: 21 minutes 24 seconds


④ 导入 Eclipse workspace:    
-------------------------------------------------------------------------------------------------------------------------
导入过程与 t/vnutch-1.x 分支导入过程相同。
   
如果已经按照上述方法导入了 t/vnutch-1.x 分支,则不需要再次将 t/vnutch-2.x 分支导入到 Eclipse,打开 Eclipse 即会直接切换到
t/vnutch-2.x 分支下工作。

在 t/vnutch-2.x 分支下工作时, Eclipse 中项目名称显示为:

    nutch [nutch t/vnutch-2.x]
    
表明当前处于处于 t/vnutch-2.x 特性分支中。

 

⑤ 将 t/vnutch-2.x 分支对 ivy/ivysettings 的修改提交并推送到团队开发版本库:
-------------------------------------------------------------------------------------------------------------------------
使用原生 Git 命令提交:
    [devalone@devalone nutch]$ git add ivy/ivysettings.xml
    [devalone@devalone nutch]$ git commit -m "修改 ivy 依赖仓库为本地仓库,以提升 ant 任务下载速度。"

查看当前状态信息:
    [devalone@devalone nutch]$ tg summary
      r      t/vnutch-1.x                   [PATCH] t/vnutch-1.x
    > rL     t/vnutch-2.x                   [PATCH] t/vnutch-2.x


将提交推送到团队版本库:
    [devalone@devalone nutch]$ tg push
    Enumerating objects: 7, done.
    Counting objects: 100% (7/7), done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (4/4), done.
    Writing objects: 100% (4/4), 535 bytes | 535.00 KiB/s, done.
    Total 4 (delta 3), reused 0 (delta 0)
    To repo.sansovo.org:scm/vnutch
       b3bd8d1a..dec79976  t/vnutch-2.x -> t/vnutch-2.x

再次查看特性分支状态信息:  
    [devalone@devalone nutch]$ tg summary
      r      t/vnutch-1.x                   [PATCH] t/vnutch-1.x
    > r      t/vnutch-2.x                   [PATCH] t/vnutch-2.x

OK.


7.3 小问题处理
-------------------------------------------------------------------------------------------------------------------------
执行 ant eclipse 任务之后,会在当前分支根目录下产生几个没有被跟踪的文件:

    [devalone@devalone nutch]$ git status
    位于分支 t/vnutch-2.x
    未跟踪的文件:
      (使用 "git add <文件>..." 以包含要提交的内容)

            .classpath
            .project
            ivy/ivy-2.3.0.jar
            ivy/ivy-2.4.0.jar

前两个隐藏文件 .classpath 和 .project 是 eclipse 的类路径列表文件和项目文件,是由 ant eclipse 执行过程中产生的,用于
eclipse 管理项目。后面两个是 ivy 两个版本的 jar 文件,也是 ant 任务执行期间下载的文件,ivy/ivy-2.3.0.jar 是 nutch 1.x 下载
的,ivy/ivy-2.4.0.jar 是 nutch 2.x 任务下载的。

这 4 个文件与项目代码无关,而且自动由工具产生和修改。为了保持代码库干净,可以将它们加入到项目根目录下的 .gitignore 文件中,
使其被 Git 忽略。

[devalone@devalone nutch]$ vi .gitignore

加入:

.classpath
.project
ivy/ivy-2.3.0.jar
ivy/ivy-2.4.0.jar

保存退出。

由于修改了 .gitignore 文件,它是由 Git 管理的文件,因此需要再次提交推送:

    [devalone@devalone nutch]$ git status
    位于分支 t/vnutch-2.x
    尚未暂存以备提交的变更:
      (使用 "git add <文件>..." 更新要提交的内容)
      (使用 "git checkout -- <文件>..." 丢弃工作区的改动)

            修改:     .gitignore

    修改尚未加入提交(使用 "git add" 和/或 "git commit -a")

    [devalone@devalone nutch]$ git add .gitignore
    [devalone@devalone nutch]$ git commit -m "修改 .gitignore 文件,保持代码库干净、整洁。"
    [t/vnutch-2.x 1c8c3123] 修改 .gitignore 文件,保持代码库干净、整洁。
     1 file changed, 4 insertions(+), 1 deletion(-)
 
    [devalone@devalone nutch]$ tg summary
      r      t/vnutch-1.x                   [PATCH] t/vnutch-1.x
    > rL     t/vnutch-2.x                   [PATCH] t/vnutch-2.x

    [devalone@devalone nutch]$ tg push
    Enumerating objects: 5, done.
    Counting objects: 100% (5/5), done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 427 bytes | 427.00 KiB/s, done.
    Total 3 (delta 1), reused 0 (delta 0)
    To repo.sansovo.org:scm/vnutch
       dec79976..1c8c3123  t/vnutch-2.x -> t/vnutch-2.x
   
再次查看特性分支状态信息:
    [devalone@devalone nutch]$ tg summary
      r      t/vnutch-1.x                   [PATCH] t/vnutch-1.x
    > r      t/vnutch-2.x                   [PATCH] t/vnutch-2.x

    [devalone@devalone nutch]$ git status
    位于分支 t/vnutch-2.x
    无文件要提交,干净的工作区

OK.

同样的方法处理 t/vnutch-1.x 分支。

 

                                                         (本篇完)

 

系列目录:

利用 Topgit 对 Nutch 定制开发进行代码管理(一)

利用 Topgit 对 Nutch 定制开发进行代码管理(二)

 

-------------------------------------------------------------------------------------------------------------------------
参考:

    https://github.com/mackyle/topgit
    https://wiki.apache.org/nutch/RunNutchInEclipse

如何利用GitHub-Hexo搭建个人博客 如何利用GitHub-Hexo搭建个人博客 0X01前言 一、博客 Blog是以网络作为载体,简易迅速便捷地发布自己的心得,及时有效轻松地与他人进行交流,集丰富多彩的个性化展示于一体的综合性平台。Blog是继Email、BBS、ICQ、之后出现的第四种网络交流方式,至今已十分受大家的欢迎,是网络时代的个人“读者文摘”,是以超级链接为入口的网络日记,是代表着新的生活方式和新的工作方式,更代表着新的学... 阅读详情

相关推荐

代码管理Topgit 原理及安装

代码管理Topgit 原理及安装 针对网友 dd 对 topgit 的疑问,我将写作中的 topgit 部分章节摘录如下。关于 dd 问到 windows 如何安装,应该可以在 cygwin 的环境下安装 topgit。我暂时还没有试验,因此并不是十分确定。Windows 下的 Git 我准备专门一章加以介绍,还没有开始呢。

【Git原理与使用】-- 多人协作

理解分布式版本控制系统,学习远程仓库与本地仓库的交互操作,掌握多⼈协作开发模 式

weixin_64609308的博客 3321

topgit:TopGit现在保持在

topgit:TopGit现在保持在

gitLab常见报错解决。

**push报错:**gitLab报错failed to push some refs to ‘git@1xxxxxxxxxx.com/xcxVIP.git’; pull报错: $ git pull error: You have not concluded your merge (MERGE_HEAD exists). hint: Please, commit your changes befo...

沉默的小猴子的博客 9813

Fusion 360嵌入式外壳建模实战:从草图到可装配结构

参数化三维建模是现代电子结构设计的核心能力,其本质是通过几何约束与特征驱动实现设计意图的精确表达和快速迭代。Fusion 360作为集成CAD/CAM/CAE的云端平台,以时间轴驱动的参数化工作流、基于基准面的草图约束机制和面向制造的特征操作逻辑,显著提升了嵌入式硬件的结构验证效率。该技术价值在于支持工程师在无专业机械背景前提下,独立完成PCB适配、散热布局、接口开孔与装配干涉检查等关键任务,广泛应用于3D打印原型、CNC加工外壳及IoT终端结构开发。本文以ESP32冰箱监控终端为实例,详解从基准定义、草图

weixin_35671843的博客 588

【C#】控制设备管理器中设备的启用/禁用_20220506

通过C#代码实现设备管理器的启用/停止 引入Manamger程序集,查找到所需设备,控制启停

weixin_45475139的博客 4527

利用 Topgit 对 Nutch 定制开发进行代码管理(一)

对开源项目的定制开发,源代码管理是一个人抓狂的问题。随着主代码版本的推进和定制版本开发越来越远,要使用主代码中新版本的特性,势必要将主代码中的新版本合并到自己的定制版本中。这时可能出现大量的冲突,而且冲突的数量会随着时间的推移和两个分支上代码量的增加而显著增多。解决这些冲突要耗费大量的时间和精力,而且可能会弄得一塌糊涂,令人望而生畏。然而这个过程不会结束,每隔一段时间就会由于主代码版本发布新的版本...

devalone 的专栏 1020

手把手教学:利用AutoDL与vLLM快速部署DeepSeek-R1大模型实战指南

本文详细介绍了如何利用AutoDL平台和vLLM框架快速部署DeepSeek-R1大模型的实战指南。从服务器配置、vLLM安装优化到模型部署的两种方案,再到性能调优和生产环境建议,手把手教你高效完成大模型部署。特别针对国内开发者遇到的网络问题提供了稳定解决方案,并分享了显存优化、磁盘清理等实用技巧。

weixin_42531779的博客 327

git总结(6)里程碑,分支,远程版本库

git总结(6)里程碑先从命令开始 git tag ##查看里程碑 git tag -n1##查看里程碑包含说明,n后面的数字代表最多显示几行 git tag -l my*##过滤自己想要的里程碑 git log --decorate ##可以查看提交对应的里程碑,及其他引用 git describe ##显示当前提交对应的里程碑,如果当前提交没有对应的里程碑就

lm744713145的博客 711

从厘米级到公里级:北斗网格10级精度在ArcPro中的完整应用指南

本文提供了北斗网格十级精度体系在ArcGIS Pro中的完整应用指南。详细解析了从660公里到1.5厘米的十级网格尺度及其编码逻辑,并重点演示了如何在ArcPro中生成网格、计算编码,以及根据项目需求(如滑坡监测)选择合适精度层级的实战策略。指南旨在帮助GIS专业人士利用这套统一的网格框架,高效管理多尺度空间数据并优化分析工作流。

Black的专栏 471

用例设计:滴滴打车从轿车到完成支付如何测?

滴滴打车全流程测试用例设计从业务场景覆盖、功能逻辑分解、异常流验证三个维度展开,系统化地构建了测试方案。首先,业务流主干场景被分解为叫车、行程中、支付结算三个阶段,每个阶段都设计了核心测试用例,包括正向和异常用例,如定位准确性、车型选择逻辑、路径偏移监控、费用实时计算、多支付方式兼容等。专项测试补充了状态机验证、资损防控测试和性能测试,确保系统在不同情况下的稳定性和安全性。测试数据策略采用等价类划分设计,实战技巧包括流量回放技术、混沌工程注入和计费沙盒验证,以提高测试的覆盖率和准确性。最终输出交付物包括流程

海姐软件测试的博客 1524

git clone项目文件时报错解决remote: Enumerating objects: 19, done. remote: Counting objects: 100% (19/19), don

操作: git clone https://github.com/... 1 报错: remote: Enumerating objects: 19, done. remote: Counting objects: 100% (19/19), done. remote: Compressing objects: 100% (19/19), done. error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull functio

盏茶作酒的博客 6133

单细胞分析避坑指南:SCTransform和Harmony参数设置详解

本文深入解析了单细胞分析中SCTransform标准化与Harmony批次校正的关键参数设置。针对10x Genomics等数据,详细探讨了如何通过调整`vars.to.regress`、`theta`等核心参数,在有效去除技术噪音的同时,避免过度校正以保留关键的生物学差异,从而提升分析结果的可靠性与可解释性。

weixin_29053073的博客 608

git clone 错误

remote: Enumerating objects: 214525, done. remote: Counting objects: 100% (214525/214525), done. remote: Compressing objects: 100% (57777/57777), done. packet_write_wait: Connection to 140.143.221.161...

狼族小子的专栏 3211

告别C盘空间焦虑!Miniforge环境路径精准配置全攻略

本文深入解析Miniforge虚拟环境默认占用C盘空间的根本原因,即未正确配置`.condarc`文件中的`envs_dirs`路径优先级。通过详细的诊断步骤与配置命令,指导用户将环境路径精准迁移至指定磁盘(如D盘),并分享禁用自动激活、使用`--prefix`参数等高阶技巧,帮助开发者彻底告别C盘空间焦虑,实现虚拟环境的整洁与可控管理。

weixin_28831399的博客 238

深度学习实战103-基于KDD Cup 99数据集的搭建神经网络的检测系统(NIDS),通过对网络流量数据进行分析,提供完整代码

接下来,我们定义一个全连接神经网络模型。return x# 创建数据集和数据加载器# 初始化模型通过以上步骤,我们实现了一个基于PyTorch的简单网络入侵检测系统。这个系统使用KDD Cup 99数据集进行训练和评估。实际应用中,您可以根据需求调整模型结构、超参数以及数据预处理方法。希望对大家有所帮助!如果有任何问题或需要进一步的解释,请随时咨询。

微学AI的博客 1582

git合并分支时如何解决冲突

在项目开发过程,我们合并分支时经常会碰到冲突的问题,下面通过一个简单的例子演示下冲突是如何产生的以及如何去解决冲突。 1、冲突的产生 1.1、主干分支代码 在主干分支有两个文件 main.cpp #include <stdio.h> #include <string.h> int main() { char data[100] = "my branch name is master"; int length = str...

new9232的博客 1万+

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

Python 文本进度条

Python 文本进度条

程永强 7986

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

关于git遇到的一些冲突问题 记录踩坑记(一)

当我在用git项目提交的时候,经常会遇到这个问题: ! [rejected] development -> development (non-fast-forward) 在踩过好几次坑和浏览了很多网上解析后,终于找到一个觉得比较好用的方法。 在push 远程的时候出现冲突 在开发中,在我们向远程Git 仓库push 代码的时候,经常会因为本地的版本落后于远程的,报出类似下面的...

weixin_44976078的博客 1332

Git标签管理

Git标签管理

m0_63486615的博客 367

Git的git fetch, git merge和git pull, git rebase操作

Gitlab的仓库的迁移指南 git的reset操作 http://blog.youkuaiyun.com/guoguo295/article/details/17410617 git的Index概念介绍 http://www.360doc.com/content/14/1203/11/21412_430057163.shtml gitpull request的概念 https://www.zhihu.com/question/21682976 git合并单个文件的操作 https://ww..

好好学习,天天向上 6204

MacOS如何将本地的代码上传到个人的GitHub主页

最近第一次尝试在GitHub主页里上传自己的代码,怕自己忘记需要的过程,所以特地记录一下,免得时间长了自己忘记了。 首先,我们默认你是第一次在GitHub上上传代码,那么需要执行以下步骤: 1. 创建GitHub个人账户; 2. 在GitHub的个人主页里点击repository,如下图: 3.接着点击new,新建一个repository,如下图: 4.新建repository,比如我起了个名字叫 “w-lever”,其他信息自己看情况填,这里我先直接点击 Create repos...

爱喝酸奶的小刀屁 627

Git push码云后Large files detected报错的解决记录

今天上传Gitee(码云)后报错,后发现是有个超过100M的大文件问题,报错代码如下: Enumerating objects: 57, done. Counting objects: 100% (57/57), done. Delta compression using up to 4 t...

chiweilian1995的博客 432

GIT的使用--以及idea上的使用

GIT的使用–以及idea上的使用 git是一个版本管理的仓库,接下来就是版本的一些实战信息。 git 中文件的状态有 :暂存(staged)、已经修改(modified)、已经提交(commited) 下载安装好我们的git后,创建一个空文件夹1.然后进入这个文件夹里面,使用 **git init **创建仓库,使用命令后就会存在.git的文件夹 [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-5UuXdsBx-1637326959149)(GIT的使用.assets/ima

魔芋小灰菜 1108

GIT上传代码Enumerating objects:类型报错解决,实测可用

最近使用在idea中Git上传代码经常反复出现Enumerating objects: 29, done. Delta compression using up to 8 threads Total开头的这个问题。经过网上查询与实操,发现问题是由于Git文件上传大小引起的,需要使用Git命令执行扩容: $ git config --global http.postBuffer 524288000 $ git config https.postBuffer 524288000 上面语句实测可用

httpmc2018的博客 1万+
上一篇: 利用 Topgit 对 Nutch 定制开发进行代码管理(一)
下一篇: CentOS 更改 MySQL 5.7数据库存储位置及 SELinux 设置
devalone
博客等级 码龄17年 108粉丝 80原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值