小编Vik*_*ram的帖子

有没有办法通过autoproxy配置脚本配置Eclipse IDE代理设置?

我在使用autoproxy配置脚本的防火墙后面.当我在我使用的大多数浏览器(IE 7,IE 8,FF,Chrome)中启用autoproxy url时,我能够浏览互联网.供您参考在Windows上启用autoproxy url goto:设置 - >控制面板 - > Internet选项 - >连接 - > Lan设置 - >(检查)使用自动配置脚本 - >输入地址值作为autoproxy脚本URL.

我面临的问题是:我有Eclipse IDE,我想在Eclipse中配置代理设置,类似于浏览器设置,但我无法做到.我无法在Eclipse或NetBeans 6.9.1或IntelliJ Idea中找到设置来解决此问题.

我正在使用与这些IDE集成的Maven2,并且还没有设置本地存储库.Maven2尝试通过从Internet下载来安装jar,但由于代理设置而无法安装.我可以从Maven2存储库手动下载这些库,并使用Artifactory或Nexus托管内部存储库,但我想知道是否有任何方法可以从IDE本身进行...

感谢您的反馈意见.请让我知道,如果你有任何问题.

eclipse autoproxy maven

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

Jenkins的git插件无法从本地计算机克隆回购.错误代码128

错误:

Failed to connect to repository : Command "/usr/bin/git ls-remote -h file:///home/myuser/path/to/project HEAD" returned status code 128:
stdout:
stderr: fatal: 'home/myuser/path/to/project' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

我尝试过以下方法:

  • chmod 777 到repo文件夹(包含.git目录的文件夹)
  • chownedjenkins:jenkins在回购文件夹
  • 试图从这个本地repo文件夹克隆到另一个文件夹:这个工作!

当我运行上面的命令:/usr/bin/git ls-remote -h file:///home/myuser/path/to/project HEAD在cmd上我得到了分支.

我的问题是:

  1. 为什么git ls-remote -h ...命令应该被调用git clone ...
  2. 如何配置jenkins git插件从本地repo获取代码

我的环境:

RHEL 5.9

Jenkins 1.519作为服务安装(没有Web容器)

Git插件

git jenkins jenkins-plugins

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

backbone.js更改Model的url参数,fetch不更新获取的数据

我有以下型号:

window.MyModel = Backbone.Model.extend({
     initialize: function(props){
          this.url = props.url;
     } 

     parse: function(){

          // @override- parsing data fetched from URL
     }


});

 // instantiate
  var mod = new MyModel({url: 'some/url/here'});
Run Code Online (Sandbox Code Playgroud)

我使用这个全局变量'mod'从后端获取一些数据到这个模型.

 // fetch

 mod.fetch({
       success: function(){ ...},
       error: ...

 });
Run Code Online (Sandbox Code Playgroud)

以上都适用....我的问题:我希望通过更改重置url并调用fetch来重用此模型,但它不会以某种方式更新url.我尝试过以下方法:

  mod.fetch({ 
       data: {url:'/some/other/url'},
       postData: true,
       success: function(){ //process data},
       error: ...
  });


 mod.set({url: '/some/other/url'});
 // called fetch() without data: and postData: attributes as mentioned in previous
Run Code Online (Sandbox Code Playgroud)

如何为我的模型设置url以便我可以调用fetch()并从更新的url中获取数据?我错过了什么.谢谢你的任何指示......

更新1:基本上,如果我这样做,我无法获得更新的值

    model.set({url: 'new value'}); 
Run Code Online (Sandbox Code Playgroud)

其次是

    model.fetch();
Run Code Online (Sandbox Code Playgroud)

'model'是一个全局变量.创建一个新的"模型"实例:

    model = new Model({url:'/some/other/url'}); 
    model.fetch(); …
Run Code Online (Sandbox Code Playgroud)

javascript backbone.js

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

如何在解析promise之后从Promise对象获取值

请注意这是一个人为的例子.

    function longFunc(){
        var deferred = $.Deferred();

        setTimeout(function(){
            console.log("long func completed");
            deferred.resolve("hello");
        }, 3000);

        return deferred.promise();
    }

    function shortAfterLongFunc(x){
        console.log('short func completed with value: ' + x);
        return {
            a: x
        };
    }

processFurther(longFunc().then(shortAfterLongFunc)); // send the array for further processing
Run Code Online (Sandbox Code Playgroud)

问题

我无法弄清楚如何shortAfterLongFunc完成后返回任何类型的对象/函数以进行进一步的下游处理.我可以来自console.log,shortAfterLongFunc但这不是我在这里要求的. 在这里小提琴

谢谢你的期待!

更新:

好的只是为了让我的问题稍微好一些......这是一个我正在看的简单用例:

$.map(['H','E','L','L', 'O'], somefunc). // for each item in array apply somefunc function

function somefunc(x){ // gets called for each value 'H', 'E' etc. in the …
Run Code Online (Sandbox Code Playgroud)

javascript jquery promise jquery-deferred

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

表页脚自动跨越表的宽度

根据我收到的数据,我有一个动态列数的表.我有一个标签需要分散在所有列中,与表中的列数无关.

<table>
<thead>
<tr>
<th><span>ColA</span></th>
<th><span>ColB</span></th>
<th rowspan='2'><span>Col<br/>  C</span></th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<td>Footer content here</td>
</tr>
</tfoot>
</table>
Run Code Online (Sandbox Code Playgroud)

编辑colspan = 0为我工作!

<td colspan='0'>Footer content here</td>
Run Code Online (Sandbox Code Playgroud)

适用于FF,虽然不适用于Chrome,IE8 :(

编辑2

colspan ='100%'此链接解决了crossbrowser问题 /sf/answers/351966401/

html css html-table

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

我们可以使用Spring-AOP摆脱Aspects的bean定义

我的观点如下:

@Aspect
public class SomeAspect{
    //define pointcuts
    // define Advices pertaining to pointcuts
}
Run Code Online (Sandbox Code Playgroud)

我的aspect-config xml文件:

<?xml ...?>
  <beans ...
   xmlns:aop
   xmlns:context ..>
      <bean id="someAspect" class="...SomeAspect"/>
      <aop:aspectj-autoproxy />

  </beans>
Run Code Online (Sandbox Code Playgroud)

这完全没问题

我需要的是:

我想摆脱每个Aspect的写bean定义,如上面的config xml文件中所示.

我尝试了以下方法:

增加了@ComponentSomeAspect在XML中添加<context-component-scan>含我的方面希望我的课被拿起作为一个Bean并作为看点相应的包装物.但是,我的看点根本没有被提升.

有什么指针吗?

aop spring spring-aop

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

使用指向本地p2存储库的tycho构建本地eclipse插件

我正在创建一些需要第三方插件和功能的Eclipse插件和功能.为了将这些依赖项包含到我的项目中,我创建了一个p2布局存储库.

注意:我的p2工件不是Maven项目......但是,我使用的是Maven风格的建筑.这是p2存储库的pom.xml

<properties>
    <tycho-version>0.18.0</tycho-version>
  </properties>

  <repositories>
        <repository>
                <id>eclipse-platform-m6</id>
                <layout>p2</layout>
                <url>http://download.eclipse.org/eclipse/updates/3.8</url>
        </repository>
  </repositories>

  <build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.tycho.extras</groupId>
            <artifactId>tycho-p2-extras-plugin</artifactId>
            <version>${tycho-version}</version>
            <executions>
                <execution>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>publish-features-and-bundles</goal>
                    </goals>
                    <configuration>
                        <compress>false</compress>
                        <artifactRepositoryLocation>/mypath/target/repository</artifactRepositoryLocation>
                        <metadataRepositoryLocation>/mypath/target/repository</metadataRepositoryLocation>
                        <sourceLocation>/mypath/src</sourceLocation>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-p2-repository-plugin</artifactId>
            <version>${tycho-version}</version>
            <configuration>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>verify-repository</goal>
                        <goal>archive-repository</goal>
                    </goals>
                    <configuration>
                        <compress>false</compress>
                        <includeAllDependencies>true</includeAllDependencies>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>  
          <groupId>org.eclipse.tycho</groupId>
          <artifactId>tycho-p2-publisher-plugin</artifactId>
          <version>${tycho-version}</version>
          <configuration>
            <publishArtifacts>true</publishArtifacts>
          </configuration>
        </plugin>
        <plugin><!-- enable the Tycho build extension -->
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-maven-plugin</artifactId>
            <version>${tycho-version}</version>
            <extensions>true</extensions>
        </plugin>   
    </plugins>
  </build>
Run Code Online (Sandbox Code Playgroud)

以上构建成功,并创建(并验证)p2存储库.我target/在项目目录中得到以下结构

- Project …
Run Code Online (Sandbox Code Playgroud)

eclipse-plugin tycho

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

Excel now()不应更新现有时间戳

我有一个excel公式 =IF(NOT(ISBLANK(A2)), TEXT(NOW(), "mm/dd/yyyy HH:ss"),"")

我的问题是:当然,每次打开此工作表时,它都会更新与最新时间戳关联的单元格值.如果它已经存在,我不希望这个时间戳改变.

我想要的是某种方式:如果A2不是空白并且最近没有更新,那么不要更新时间戳其他更新.

如果可能的话,我正在寻找内联函数.

谢谢

excel excel-formula

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

Backbone.js Collection过滤前10个模型

我的Collection收集了一些记录,我只需要显示前10条记录.我试过了

   this.collection.each(function(){
        if (count == 10) break;
        //pass model to view
   });
Run Code Online (Sandbox Code Playgroud)

不幸的是,break不能用于underscore.js的each()API.请参考这里:如何在underscore.js中打破_.each函数

如何编写一个过滤器,只从集合中选择前十名

     this.collection.filter();
Run Code Online (Sandbox Code Playgroud)

更新:collection.first(10)提取了我的过滤列表.但是,我仍然需要将.each()链接到此集合来处理集合项.collection.first()不允许链.请参阅我选择的答案以获得解决方案.

javascript backbone.js backbone.js-collections

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

使用requirejs预加载polyfill库

我正在创建一个wirejs应用程序requirejs.对于IE 8,我使用polyfills:cujo/polyjs库并要求在加载之前预先加载此lib wirejs.

如果我用作curlAMD加载器,根据文档,我有以下选项:

curl({ preloads: [ "poly" ] });
Run Code Online (Sandbox Code Playgroud)

对我有用的是:

// in index.html

<script data-main="js/app" src="js/lib/require.js"></script>

// in js/app.js

define(function(){
   // set configuration options
   requirejs.config({// set config with paths});

   // require the library and HOPE it will load before
   // everything else!
   require(['poly']);

});
Run Code Online (Sandbox Code Playgroud)

本文档建议使用shimconfig来实现此目的.但是,我还没弄清楚如何.我试过的一些事情:

// DID NOT WORK!!
requirejs.config({

....
"shim": {
   "poly": {
     "exports": "poly"
    }
 }
});
Run Code Online (Sandbox Code Playgroud)

有没有更好的方法来解决这个问题?

任何帮助表示赞赏!...感谢您的时间!

requirejs polyfills wirejs

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

IE8错误将函数()分配给属性名称'function'

考虑在IE8和Chrome控制台中运行以下代码进行比较:

var a = function(){ console.log("function is() initialized"); };

// assign a property named 'function' to function 'a'

a.function = function afunction(f){ return (typeof f === 'function'? true: false); };

// Use our is function to test if a given variable is a function

a.function(a); // IE throws 'expected identifier' error v/s Chrome correctly outputs "true"
Run Code Online (Sandbox Code Playgroud)

任何想法如何在IE8中解决这个问题而不改变函数签名:a.function()?

javascript google-chrome internet-explorer-8

0
推荐指数
1
解决办法
61
查看次数