小编Bra*_*ood的帖子

如何通过JGit克隆repo后释放文件系统锁

我正在使用jGit克隆远程现有仓库,遵循指南:

https://github.com/centic9/jgit-cookbook/blob/master/src/main/java/org/dstadler/jgit/porcelain/CloneRemoteRepository.java

我正在使用CFML作为我的例子:

Git = createObject( 'java', 'org.eclipse.jgit.api.Git' );

localPath = createObject( 'java', 'java.io.File' ).init( expandPath( 'temp' ) );

result = Git.cloneRepository()
        .setURI( 'https://github.com/github/testrepo.git' )
        .setDirectory( localPath )
        .call();

result.close();
Run Code Online (Sandbox Code Playgroud)

克隆工作得很好,但在temp\.git\objects\pack我停止Java进程之前,文件锁不会在"pack"文件中发布.

然后我也注意到API文档对于结果.close()方法的行为似乎有些过于谨慎:http: //download.eclipse.org/jgit/site/4.0.1.201506240215-r/apidocs/org/eclipse/jgit/ LIB/Repository.html#close()方法

减少使用次数,并可能关闭资源.

也许?那是什么意思?为了"放弃任何底层资源",我需要做什么,如AutoCloseable.close()方法帮助实现的接口中指定的那样?

在SO上有几个类似的问题,但没有一个涉及使用静态方法org.eclipse.jgit.api.Git来克隆新的repo.

java filehandle jgit

8
推荐指数
1
解决办法
1397
查看次数

控制SQL Server最适合unicode转换

最近的一次whitehat扫描让我意识到SQL Server最适合的unicode转换.这意味着当包含unicode字符的字符串转换为非unicode字符串时,SQL Server将对其中的字符进行最佳替换,以便不会使用问号删除数据.例如:

SELECT '????'
Run Code Online (Sandbox Code Playgroud)

输出"TEST"

每个字符都替换为"相似"的ASCII等效字符.这也可以在单个字符上看到,其中unicode字符65308(<)被转换为ASCII字符60(<).

SELECT ascii(NCHAR(65308))
Run Code Online (Sandbox Code Playgroud)

输出"60"

主要问题是这个文件记录在哪里?我已经搜索了各种各样的短语并阅读了Microsoft文档,但我能找到的只是人们希望进行手动转换,而没有任何记录SQL Server明显的自动最佳拟合unicode转换的人.此外,可以关闭或配置?

虽然这种行为对于没有将字符串存储为unicode的应用程序很方便,并且可能在大多数情况下都被完全注意到,但渗透测试会将此报告为"高级"漏洞,因为unicode转换可用于规避验证例程并导致诸如XSS之类的漏洞.

sql-server unicode penetration-testing sql-server-2012

5
推荐指数
1
解决办法
210
查看次数

查询的coldfusion查询中是否有左连接?

因为根据我的同事我不习惯使用coldfusion,所以我们不能继续加入查询的coldfusion查询.所以这就是我们做一个左手连接的"技巧".例:

<cfquery datasource="Intranet" name="GroupStarsGiven">
    SELECT execoffice_status, submitterdept, COUNT(*) as 'totalstarsgiven'
    FROM CSEReduxResponses
    WHERE execoffice_status = 1
    GROUP BY execoffice_status, submitterdept
</cfquery>

<cfquery dbtype="query" name="GetTotalStarsGiven">
    SELECT *
    FROM GroupStarsGiven, GetDepartments
    WHERE GroupStarsGiven.submitterdept = GetDepartments.csedept_id
</cfquery>

<cfquery name="joinQuery2" dbtype="query" >
SELECT *
FROM GetTotalStarsGiven
WHERE GetTotalStarsGiven.csedept_id = -1
</cfquery>

<cfset QueryAddRow(joinQuery2)>

<cfquery name="GetUnion2" dbtype="query" >
SELECT *
FROM GetUnion, GetTotalStarsGiven
WHERE GetUnion.csedept_id = GetTotalStarsGiven.csedept_id

UNION

SELECT GetUnion.*, joinQuery2.*
FROM GetUnion, joinQuery2
WHERE GetUnion.csedept_id NOT IN (#ValueList(GetTotalStarsGiven.csedept_id)#)
ORDER BY csedept_name ASC
</cfquery
Run Code Online (Sandbox Code Playgroud)

这是左边加入coldfusion的方法吗?只是想确保,因为我无法找到关于此的好文章.谢谢

sql-server coldfusion

4
推荐指数
1
解决办法
6531
查看次数