小编slu*_*dog的帖子

GIT:/.git/index.lock':文件存在

我和我的一个git repos有一个问题.我一直收到以下错误:

    fatal: Unable to create 'v:/path/to/files/.git/index.lock': File exists.

    If no other git process is currently running, this probably means a
    git process crashed in this repository earlier. Make sure no other git
    process is running and remove the file manually to continue.
Run Code Online (Sandbox Code Playgroud)

我已经尝试过:rm -f ./.git/index.lock根据stackoverflow上的另一个线程但我每次都会收到此错误:rm:无法取消链接`./.git/index.lock':权限被拒绝

当我关闭aptana(我在终端中使用git)时,我无法删除文件.

任何想法如何解决这个问题?

另外需要注意的是,当我偶尔在其中进行提交时,这个git repo非常慢(它允许我每10次尝试一次)

谢谢

git

16
推荐指数
2
解决办法
4万
查看次数

DOB Field的平均年龄 - MySQL/PHP

我不知道如何计算我的联系人的平均年龄,这些联系人都存在于带有DOB日期字段(如YYYY-MM-DD)的mysql表中.

有没有办法处理MySQL调用(请注意我使用的是cakephp,但这应该不是问题)

谢谢

mysql average date dob

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

让setTimeout工作

我有以下代码使用Jquery UI拖放.当项目被放入该区域时,放置区域将更改为公司徽标,然后我希望延迟并重定向到已删除链接中的URL.

我可以让徽标更改或者网址重定向而不是两者都有,当我同时设置时,延迟不会发生,重定向就会开始.我假设我在使用setTimeout做错了.

代码如下:

// let the trash be droppable, accepting the gallery items
$( "#droparea" ).droppable({
  accept: "ul.gallery > li a",
  activeClass: "ui-state-highlight",
  drop: function( event, ui ) {

      var thelink = $(ui.draggable).attr("href");
      $('#droparea').prepend('<img id="theImg" src="../img/logo_navigation.jpg" />');

      setTimeout(redirectLink(url),5000);
  }
});

// URL REDIRECT FUNCTION
function redirectLink(url)
{
   window.location.replace(url);
}
Run Code Online (Sandbox Code Playgroud)

javascript jquery jquery-ui jquery-droppable jquery-draggable

3
推荐指数
1
解决办法
1432
查看次数

tcpdf - 背景图片 - CakePdf

我正在尝试使用CakePdf和TcPdf引擎设置带有背景图像的pdf生成.我已设法使用以下设置将图像放到背景上:

// set background image
$img_file = APP . 'webroot/img/BC_Letterhead.jpg';
$TCPDF->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
Run Code Online (Sandbox Code Playgroud)

问题是图像似乎覆盖了整个背景.它看起来比右边短1英寸,距离页面底部约2英寸.我使用的图像是正确的大小(我仔细检查了它)

这可能是保证金问题还是类似问题?

谢谢

cakephp tcpdf

2
推荐指数
1
解决办法
1万
查看次数