小编Chr*_*abe的帖子

jenkins/hudson无法连接到github repo

我在Ec2上使用基础amazon ami linux-我已经安装了jenkins但是当我从github拉回购时我发出以下错误:

Building in workspace /var/lib/jenkins/workspace/build social
Checkout:build social / /var/lib/jenkins/workspace/build social - hudson.remoting.LocalChannel@5c7b21b
Using strategy: Default
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone git@github.com:adulion/.git
hudson.plugins.git.GitException: Could not clone git@github.com:adulion/.git
    at hudson.plugins.git.GitAPI.clone(GitAPI.java:245)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1117)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1059)
    at hudson.FilePath.act(FilePath.java:832)
    at hudson.FilePath.act(FilePath.java:814)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1059)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:581)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:470)
    at hudson.model.Run.run(Run.java:1421)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:238)
Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin git@github.com:adulion/.git /var/lib/jenkins/workspace/build social" …
Run Code Online (Sandbox Code Playgroud)

git hudson github jenkins

21
推荐指数
4
解决办法
3万
查看次数

使用google.maps.geocoder检索lat/long的位置

我一直在尝试使用一些ajax来保存我的应用程序中的场所位置,并在堆栈溢出时偶然发现以下代码

function getLatLong(address) 
{
    var geocoder = new google.maps.Geocoder();
    var result = "";
    geocoder.geocode( { 'address': address, 'region': 'uk' }, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
            result[lat] = results[0].geometry.location.Pa;
            result[lng] = results[0].geometry.location.Qa;
        } else {
            result = "Unable to find address: " + status;
        }
    });
    return result;
}
Run Code Online (Sandbox Code Playgroud)

我的问题是当我调用函数时它什么也没有返回,当我调试并在chrome中设置断点时,它会在返回结果之前先破坏结果[lat] = results [0] .geometry.location.Pa;

我知道数组应该声明为类型数组,但即使我刚刚返回结果[0] .geometry.location对象也没有被返回

我该怎么做才能返回lat/long的位置,以便我可以存储在我的数据库中?

javascript jquery geocoding google-maps-api-3

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

pjax仍然会执行整页重新加载

我在chrome和firefox中尝试了pjax示例,我拿了示例代码并将其放入我自己的应用程序中,但它仍然会进行整页重新加载.发生AJAX请求然后页面继续运行而不更新#main div

<html>
    <head>
        <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery-1.8.0.min.js"></script>
        <script src="http://localhost:8888/jul/js/jquery.pjax.js"></script>


         <script type="text/javascript">
            // $(document).ready(function(){
            //   $('a[data-pjax]').pjax();
            // })

        // $(document).ready(function(){
        //     $('a').pjax({

        //    container: '#main'
        //  })
        $('document').ready(function(){
           $('ul a').pjax('#main')
        });


         </script>
    </head>
    <body>
        11:59:36        <div id="main">
             <div class='loader' style='display:none'><img src='http://localhost:8888/jul/imgs/spinner.gif'></div><ul>

  <li><a data-pjax='#main' href="/jul/stats/pjax_stats/index/">Index</a></li>
  <li><a data-pjax='#main' href="/jul/stats/pjax_stats/total_posts/">total_posts</a></li>

  <li><a data-pjax='#main' href="http://localhost:8888/jul/stats/pjax_stats/index">Index</a></li>
  <li><a data-pjax='#main' href="http://localhost:8888/jul/stats/pjax_stats/total_posts">total_posts</a></li>
  <li><a href="http://localhost:8888/jul/stats/pjax_stats/total_graph">total_graph</a></li>
  <li><a href="http://localhost:8888/jul/stats/pjax_stats/twitter_graph">twitter_graph</a></li>
  <li><a href="http://localhost:8888/jul/stats/pjax_stats/facebook_graph">facebook_graph</a></li>
</ul>index files




        </div>

    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

我已经尝试了多种方法来调用pjax,也许其他人可以指出我哪里出错了?Ajax/GET似乎在firebug控制台中恢复正常 - 这是我的php产生pjax响应的一个例子

public function total_posts(){
        // print_r($_SERVER);

        if (!isset($_SERVER["X_PJAX"])) {
            $this->load->view('stats/pjax_stats/header');
            $this->load->view('stats/pjax_stats/links');
        }else{
            echo "pjax";//add in for …
Run Code Online (Sandbox Code Playgroud)

javascript jquery pjax

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

11
推荐指数
3
解决办法
3万
查看次数

刷新数据库事务中的物化视图

是否可以在数据库事务中刷新物化视图?

我正在 Laravel 中为复杂查询编写测试用例,它使用事务在测试运行后回滚。

当我添加数据并刷新视图时 - 当我执行 select 语句时不会出现任何记录

postgresql transactions materialized-views rollback

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

简单的HTML主播问题

如何制作MP3链接下载而不是"在浏览器中"播放

尝试将目标更改为空白但只是在新窗口中打开了播放器

html

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

如何使用sql子查询进行分组

我现在想不清楚,我想通过station_id返回计数,输出的例子是:

station 1有3个fb帖子,6个linkedin帖子,5个邮件帖子站2个有3个fb帖子,6个linkedin帖子,5个邮件帖子

所以我需要按站ID分组,我的表结构是

CREATE TABLE IF NOT EXISTS `posts` (
  `post_id` bigint(11) NOT NULL auto_increment,
  `station_id` varchar(25) NOT NULL,
  `user_id` varchar(25) NOT NULL,
  `dated` datetime NOT NULL,
  `type` enum('fb','linkedin','email') NOT NULL,
  PRIMARY KEY  (`post_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=x ;
Run Code Online (Sandbox Code Playgroud)

到目前为止我的查询是返回0站,当它有一个时有2个帖子(db tho中有2个)

SELECT Station_id, (select count(*) FROM posts WHERE type = 'linkedin') AS linkedin_count, (select count(*) FROM posts WHERE type = 'fb') AS fb_count, (select count(*) FROM posts WHERE type = 'email') AS email_count  FROM `posts` GROUP BY station_id;
Run Code Online (Sandbox Code Playgroud)

mysql sql

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

取消jquery可拖动对象或重置

我想加载一个可以拖动到map/div的对象页面,但是想要一个清除/撤消按钮?用jquery可以吗?

你可以看到上一个问题中的代码

jQuery UI droppables - 更改已删除的图像

jquery jquery-ui

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

删除列表导航边框的最后一项

我努力去除导航列表的最后一项上的"管道"边界 - 我的代码 -

<div id="header">
    <ul id="menu">
        <li><a href="">Home</a></li>
        <li><a href="">Stories</a></li>
        <li><a href="">Tell your story</a></li>
        <li><a href="">Prizes</a></li>
        <li><a href="">How to tips</a></li>
    </li>
</div>
Run Code Online (Sandbox Code Playgroud)

而我的CSS

#menu li{
    float:left;
    list-style-type: none;
    display:inline;
    padding:0 .9em;
    border-right:1px solid #d2d2d2;;
}
#menu li.last{
    border-right:none;
}
Run Code Online (Sandbox Code Playgroud)

html css

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

XPath元素编号返回所有元素而不是第一个元素

我使用以下代码访问链接(对于phpunit/selenium):

//td[normalize-space() ='Test title 2']/following-sibling::td[3]/a[.='delete']
Run Code Online (Sandbox Code Playgroud)

在FireFox中使用XPath检查器它会返回7个元素(因为有7个链接匹配"test title 2"),但是当我[1]在最后添加时:

//td[normalize-space() ='Test title 2']/following-sibling::td[3]/a[.='delete'][1]
Run Code Online (Sandbox Code Playgroud)

它仍然返回7个链接.我在这做错了什么?

selenium xpath

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