搜索词>>Merge 耗时0.0030
  • Idea Git Merge 操作不自动提交

    背景该方式用于合并代码非常有用背景该方式用于合并代码非常有用。步骤1:拉取需要合并的分支到本地步骤2:Merge提示:不要直接点右下角的分支,"Merge into current",该操作会合并后自动本地提交​​勾选需要合并的分支(例如上面的将master分支同步到dev-new-redis)勾选 "No commit" ,"No fast forward"两个项目(表示合并不本地提交)Commit Message ,提交说明,根据实际情况填写说明信息即可,也可不填写最后点击Merge其他1:查看合并的文件变化通过点击commit可以查看到本次提交的文件变化情况提交:​变化情况:​查看改动情况:​其他2:快速回滚本次合并再未进行本地提交前,可进行快速回滚​​注意:勾上 "Delete local copies of added files",勾上后才能删除新增文件,否则回滚后新增文件还在,只是没有版本控制最后点击,终止合并​快速回滚搞定。
  • PowerDesigner 表导出为excel文件

    PowerDesigner 表格导出为excel选中tablesctrl + shift +x 弹出以下对话框​将以下脚本内容填入上面的对话框中,然后点击Run'**************************************PowerDesigner 表格导出为excel选中tablesctrl + shift +x 弹出以下对话框​将以下脚本内容填入上面的对话框中,然后点击Run'****************************************************************************** Option Explicit Dim rowsNum rowsNum = 0 '----------------------------------------------------------------------------- ' Main function '----------------------------------------------------------------------------- ' Get the current active model Dim Model Set Model = ActiveModel If (Model Is Nothing) Or (Not Model.IsKindOf(PdPDM.cls_Model)) Then MsgBox "The current model is not an PDM model." Else ' Get the tables collection '创建EXCEL APP dim beginrow DIM EXCEL, SHEET, SHEETLIST set EXCEL = CREATEOBJECT("Excel.Application") EXCEL.workbooks.add(-4167)'添加工作表 EXCEL.workbooks(1).sheets(1).name ="表结构" set SHEET = EXCEL.workbooks(1).sheets("表结构") EXCEL.workbooks(1).sheets.add EXCEL.workbooks(1).sheets(1).name ="目录" set SHEETLIST = EXCEL.workbooks(1).sheets("目录") ShowTableList Model,SHEETLIST ShowProperties Model, SHEET,SHEETLIST EXCEL.workbooks(1).Sheets(2).Select EXCEL.visible = true '设置列宽和自动换行 sheet.Columns(1).ColumnWidth = 20 sheet.Columns(2).ColumnWidth = 20 sheet.Columns(3).ColumnWidth = 20 sheet.Columns(4).ColumnWidth = 40 sheet.Columns(5).ColumnWidth = 10 sheet.Columns(6).ColumnWidth = 10 sheet.Columns(1).WrapText =true sheet.Columns(2).WrapText =true sheet.Columns(4).WrapText =true '不显示网格线 EXCEL.ActiveWindow.DisplayGridlines = False End If '----------------------------------------------------------------------------- ' Show properties of tables '----------------------------------------------------------------------------- Sub ShowProperties(mdl, sheet,SheetList) ' Show tables of the current model/package rowsNum=0 beginrow = rowsNum+1 Dim rowIndex rowIndex=3 ' For each table output "begin" Dim tab For Each tab In mdl.tables ShowTable tab,sheet,rowIndex,sheetList rowIndex = rowIndex +1 Next if mdl.tables.count > 0 then sheet.Range("A" & beginrow + 1 & ":A" & rowsNum).Rows.Group end if output "end" End Sub '----------------------------------------------------------------------------- ' Show table properties '----------------------------------------------------------------------------- Sub ShowTable(tab, sheet,rowIndex,sheetList) If IsObject(tab) Then Dim rangFlag rowsNum = rowsNum + 1 ' Show properties Output "================================" sheet.cells(rowsNum, 1) =tab.name sheet.cells(rowsNum, 1).HorizontalAlignment=3 sheet.cells(rowsNum, 2) = tab.code 'sheet.cells(rowsNum, 5).HorizontalAlignment=3 'sheet.cells(rowsNum, 6) = "" 'sheet.cells(rowsNum, 7) = "表说明" sheet.cells(rowsNum, 3) = tab.comment 'sheet.cells(rowsNum, 8).HorizontalAlignment=3 sheet.Range(sheet.cells(rowsNum, 3),sheet.cells(rowsNum, 7)).Merge '设置超链接,从目录点击表名去查看表结构 '字段中文名 字段英文名 字段类型 注释 是否主键 是否非空 默认值 sheetList.Hyperlinks.Add sheetList.cells(rowIndex,2), "","表结构"&"!B"&rowsNum rowsNum = rowsNum + 1 sheet.cells(rowsNum, 1) = "字段中文名" sheet.cells(rowsNum, 2) = "字段英文名" sheet.cells(rowsNum, 3) = "字段类型" sheet.cells(rowsNum, 4) = "注释" sheet.cells(rowsNum, 5) = "是否主键" sheet.cells(rowsNum, 6) = "是否非空" sheet.cells(rowsNum, 7) = "默认值" '设置边框 sheet.Range(sheet.cells(rowsNum-1, 1),sheet.cells(rowsNum, 7)).Borders.LineStyle = "1" 'sheet.Range(sheet.cells(rowsNum-1, 4),sheet.cells(rowsNum, 9)).Borders.LineStyle = "1" '字体为10号 sheet.Range(sheet.cells(rowsNum-1, 1),sheet.cells(rowsNum, 7)).Font.Size=10 Dim col ' running column Dim colsNum colsNum = 0 for each col in tab.columns rowsNum = rowsNum + 1 colsNum = colsNum + 1 sheet.cells(rowsNum, 1) = col.name 'sheet.cells(rowsNum, 3) = "" 'sheet.cells(rowsNum, 4) = col.name sheet.cells(rowsNum, 2) = col.code sheet.cells(rowsNum, 3) = col.datatype sheet.cells(rowsNum, 4) = col.comment If col.Primary = true Then sheet.cells(rowsNum, 5) = "Y" Else sheet.cells(rowsNum, 5) = " " End If If col.Mandatory = true Then sheet.cells(rowsNum, 6) = "Y" Else sheet.cells(rowsNum, 6) = " " End If sheet.cells(rowsNum, 7) = col.defaultvalue next sheet.Range(sheet.cells(rowsNum-colsNum+1,1),sheet.cells(rowsNum,7)).Borders.LineStyle = "3" 'sheet.Range(sheet.cells(rowsNum-colsNum+1,4),sheet.cells(rowsNum,9)).Borders.LineStyle = "3" sheet.Range(sheet.cells(rowsNum-colsNum+1,1),sheet.cells(rowsNum,7)).Font.Size = 10 rowsNum = rowsNum + 2 Output "FullDescription: " + tab.Name End If End Sub '----------------------------------------------------------------------------- ' Show List Of Table '----------------------------------------------------------------------------- Sub ShowTableList(mdl, SheetList) ' Show tables of the current model/package Dim rowsNo rowsNo=1 ' For each table output "begin" SheetList.cells(rowsNo, 1) = "主题" SheetList.cells(rowsNo, 2) = "表中文名" SheetList.cells(rowsNo, 3) = "表英文名" SheetList.cells(rowsNo, 4) = "表说明" rowsNo = rowsNo + 1 SheetList.cells(rowsNo, 1) = mdl.name Dim tab For Each tab In mdl.tables If IsObject(tab) Then rowsNo = rowsNo + 1 SheetList.cells(rowsNo, 1) = "" SheetList.cells(rowsNo, 2) = tab.name SheetList.cells(rowsNo, 3) = tab.code SheetList.cells(rowsNo, 4) = tab.comment End If Next SheetList.Columns(1).ColumnWidth = 20 SheetList.Columns(2).ColumnWidth = 20 SheetList.Columns(3).ColumnWidth = 30 SheetList.Columns(4).ColumnWidth = 60 output "end" End Sub好啦,excel将会在执行脚本后进行excel的生成。注意生成所需等待的时间和表的数量有关。
  • Java EE 8 JSON Pointer讲解

    Java EE 8 JSON Pointer讲解,Java EE 8包含JSON处理API的更新,并为最新的JSON标准提供最新的IEFT标准。Java EE 8包含JSON处理API的更新,并为最新的JSON标准提供最新的IEFT标准。他们是: <ul> <li>JSON Pointer (RFC 6901)</li> <li>JSON Patch (RFC 6902)</li> <li>JSON Merge Patch (RFC 7396)</li> </ul>   <h2 style="margin-left:0px; margin-right:0px; text-align:start">入门</h2> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="font-family:"Noto Sans",sans-serif"><span style="color:#000000"><span style="background-color:#ffffff">要开始使用JSON-P,您需要Maven中央存储库中的以下依赖项。</span></span></span></p> <pre> <code class="language-xml"><dependency> <groupId>javax.json</groupId> <artifactId>javax.json-api</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.json</artifactId> <version>1.1</version> </dependency></code></pre> <h2>JSON-Pointer</h2> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="font-family:"Noto Sans",sans-serif"><span style="color:#000000"><span style="background-color:#ffffff">JSON指针定义了一个字符串表达式,该表达式引用JSON文档的层次结构内的元素。通过JSON指针表达式,您可以通过检索,添加,删除和替换由表达式引用的元素或值来访问和操作JSON文档。</span></span></span></p> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="font-family:"Noto Sans",sans-serif"><span style="color:#000000"><span style="background-color:#ffffff">入口API是<em><strong>javax.json.JsonPointer</strong></em>接口。通过调用<em><strong>javax.json.Json</strong></em>  类上的静态工厂方法<strong><em>createPointer(String expression)</em></strong>并将其传递给指针表达式来创建实例。</span></span></span></p> <h3 style="margin-left:0px; margin-right:0px; text-align:start">检索一个值</h3> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="font-family:"Noto Sans",sans-serif"><span style="color:#000000"><span style="background-color:#ffffff">如果下面给出了JSON文档,并且您想要检索<strong><em>title</em></strong>元素的值,则可以创建JSON指针表达式  <em><strong>/title</strong></em>。</span></span></span></p> <pre> <code class="language-json">{ "title": "Java EE: Only What's New", "author": "Alex Theedom", "chapters": [ "Chapter 1: Java EE 8 What’s New Overview", "Chapter 2: Java API for JSON Binding 1.0 (JSR 367)", "Chapter 3: Java EE Security API 1.0 (JSR 375)" ], "released": true, "pages": 300, "sourceCode": { "repositoryName": "Java-EE-8-Only-Whats-New", "url": "github.com/readlearncode/" }, "otherBooks": [ { "title": "Professional Java EE Design Patterns", "length": 350 } ] } </code></pre> <pre> <code class="language-java">JsonObject jsonObject = ... create JSONObject from JSON document ...;</code></pre> 下面的代码片段创建一个<strong><em>JsonPointer</em> </strong>并引用<em><strong>title</strong> </em>元素。然后它调用传递<em><strong>JsonObject</strong></em>来查询的<strong><em>getValue()</em></strong>方法。 <pre> <code class="language-java">JsonValue jsonValue = Json.createPointer(“/ title”)。getValue(jsonObject);</code></pre> <h3 style="margin-left:0px; margin-right:0px; text-align:start">添加一个值</h3> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="font-family:"Noto Sans",sans-serif"><span style="color:#000000"><span style="background-color:#ffffff">要向JSON文档添加(或插入)值,请遵循与检索相同的逻辑,方法是使用JSON指针表达式来标识文档中的插入点。以下代码片段将新的<em><strong>“category”:“</strong></em></span></span></span><em><strong>Programming</strong></em><span style="font-family:"Noto Sans",sans-serif"><span style="color:#000000"><span style="background-color:#ffffff"><em><strong>”</strong></em> JSON对象添加到文档的根目录。</span></span></span></p> <pre> <code class="language-java">JsonObject jsonObject = Json .createPointer("/category") .add(jsonObject, Json.createValue("Programming"));</code></pre> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="font-family:"Noto Sans",sans-serif"><span style="color:#000000"><span style="background-color:#ffffff">返回的<em><strong>JsonObject</strong> </em>是整个新的修改对象。</span></span></span></p> <h3 style="margin-left:0px; margin-right:0px; text-align:start">删除一个值</h3> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="font-family:"Noto Sans",sans-serif"><span style="color:#000000"><span style="background-color:#ffffff">删除过程需要将删除的值的位置表示为JSON指针表达式。下面的代码片段删除<em><strong>title</strong> </em>元素,并将修改的JSON文档作为<em><strong>JsonStructure</strong> </em>实例返回</span></span></span></p> <pre> <code class="language-java">JsonStructure jsonStructure = Json.createPointer(“/ title”)。remove(jsonObject);</code></pre> <h3 style="margin-left:0px; margin-right:0px; text-align:start">替换一个值</h3> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="font-family:"Noto Sans",sans-serif"><span style="color:#000000"><span style="background-color:#ffffff">要替换要替换的元素的JSON指针表达式,并将替换元素传递给<em><strong>replace()</strong></em>方法。下面的代码片段替换<strong><em>title</em> </strong>元素的值并返回修改后的JSON文档。</span></span></span></p> <pre> <code class="language-java">JsonStructure jsonStructure = Json .createPointer("/title") .replace(jsonObject, Json.createValue("Java EE 8"));</code></pre> <h3 style="margin-left:0px; margin-right:0px; text-align:start">测试一个值</h3> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="font-family:"Noto Sans",sans-serif"><span style="color:#000000"><span style="background-color:#ffffff">可以使用<em><strong>containsValue()</strong> </em>方法测试某个位置存在的值。下面的代码片段测试以查看它在由JSON指针表达式<em><strong>/ doesNotExist</strong></em>表示的位置处有一个值。</span></span></span></p> <pre> <code class="language-java">Boolean containsValue = Json .createPointer("/doesNotExist") .containsValue(jsonObject);</code></pre> <h2 style="margin-left:0px; margin-right:0px; text-align:start">总结结</h2> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="font-family:"Noto Sans",sans-serif"><span style="color:#000000"><span style="background-color:#ffffff"><span style="font-family:inherit">上面这些,这就是关于JSON Processing新功能的第一篇文章。</span></span></span></span></p>