小编Him*_*dav的帖子

无法在OS X"El Capitan"上安装宝石

我无法fakes3在El Capitan Beta 5上安装和运行gem.

我试过了:

sudo gem install fakes3
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/fakes3
Run Code Online (Sandbox Code Playgroud)

然后我尝试用cocoapods方式做.它适用于cocoapods,但不适用于fakes3.

mkdir -p $HOME/Software/ruby
export GEM_HOME=$HOME/Software/ruby
gem install cocoapods
[...]
1 gem installed
gem install fakes3
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
Run Code Online (Sandbox Code Playgroud)

ruby macos rubygems

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

无法在Windows上打开配置文件:/usr/local/ssl/openssl.cnf

我已经安装了OpenSSL 64.我想为我的nodejs https服务器使用证书.我运行了以下命令:

openssl genrsa -out subdomain.domain.com.key 1024
Run Code Online (Sandbox Code Playgroud)

但我得到了错误:

WARNING: can't open config file: /usr/local/ssl/openssl.cnf
Loading 'screen' into random state - done
Generating RSA private key, 1024 bit long modulus
.........++++++
.........................................++++++
unable to write 'random state'
e is 65537 (0x10001)
Run Code Online (Sandbox Code Playgroud)

我该如何解决?
这是正确的命令吗?

windows openssl

136
推荐指数
5
解决办法
23万
查看次数

安装Skype后,XAMPP apache服务器无法启动

我得到以下控制台日志:

1:14:33 PM  [apache]    Possible problem detected! 
1:14:33 PM  [apache]    Port 80 in use by "c:\program files (x86)\skype\phone\skype.exe"!
1:14:33 PM  [apache]    Possible problem detected! 
1:14:33 PM  [apache]    Port 443 in use by "c:\program files (x86)\skype\phone\skype.exe"!
1:14:33 PM  [main]  Starting Check-Timer
1:14:33 PM  [main]  Control Panel Ready
1:15:10 PM  [apache]    Starting apache app...
1:15:11 PM  [apache]    Status change detected: running
1:15:11 PM  [apache]    Status change detected: stopped
Run Code Online (Sandbox Code Playgroud)

它说"检测到状态变化:正在运行"到"停止".我试过:

  • 关闭内部网络的Windows防火墙
  • 在两个位置的httpd.conf文件中将端口80更改为99收听:80和ServerName localhost:80
  • 在相同的两个位置将httpd.conf文件中的端口443更改为445.
  • Apache服务器未作为Windows服务安装在我的计算机上.
  • 今天的日期没有生成错误或访问日志.

apache xampp skype

42
推荐指数
4
解决办法
7万
查看次数

增加Bootstrap 2.3的Glyphicons的大小

有没有一种简单的方法来增加Glyphicons的大小?
我找到了像Font Awesome这样的解决方案,但不希望包含新的CSS库只是为了增加2号图标.

javascript css jquery twitter-bootstrap

38
推荐指数
4
解决办法
9万
查看次数

jQuery:找到所有可见的必填字段

我试图找到所有具有required属性的字段,它们也应该是visible.因为页面也可以隐藏必填字段.这是我尝试过的:

function validateRequiredFields()
{
    $('input,textarea,select').attr('required',true).filter(':visible:first').each(function(i, requiredField){

        if($(requiredField).val()=='')
        {
            alert($(requiredField).attr('name'));
        }
    });
}
Run Code Online (Sandbox Code Playgroud)

javascript jquery

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

使用节点js创建HTTPS服务器

我想为我的localhost创建一个https服务器.
Node JS文档提供了现成的解决方案,但我对它有些困惑.

var https = require('https');
var fs = require('fs');

var options = {
  key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
  cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};

https.createServer(options, function (req, res) {
  res.writeHead(200);
  res.end("hello world\n");
}).listen(8000);
Run Code Online (Sandbox Code Playgroud)

要么

var options = {
  pfx: fs.readFileSync('server.pfx')
};
Run Code Online (Sandbox Code Playgroud)

在这里我如何获得我的localhost的密钥,证书或pfx?

https node.js

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

找到所有作为回文的子串

如果输入是'ABBA',那么可能回文是a,b,B,A,BB,ABBA.
我知道确定弦是否是回文很容易.这将是:

public static boolean isPalindrome(String str) {
 int len = str.length();
 for(int i=0; i<len/2; i++) {
     if(str.charAt(i)!=str.charAt(len-i-1) {
         return false;
     }
 return true;  
}
Run Code Online (Sandbox Code Playgroud)

但找到回文子串的有效方法是什么?

java algorithm substring palindrome

20
推荐指数
4
解决办法
5万
查看次数

Swift:如何记住cookie以获取更多的http请求

我正在开发一个登录应用程序.成功登录后,响应cookie数据.
如何使用/保存此数据以用于将来的请求?
对于初学者我试图保存它NSHTTPCookieStorage.但这也行不通.
登录方式(部分):

let task = session.dataTaskWithRequest(request) { (data, responseData, error) -> Void in
            if let response = responseData as? NSHTTPURLResponse {
                statusCode = response.statusCode
                print("Response code: \(statusCode)")
            }

            var json: NSDictionary?
            do {
                json = try NSJSONSerialization.JSONObjectWithData(data!, options: .MutableLeaves) as? NSDictionary
            } catch {
                print(error)
                err = error
            }

            if(statusCode != 200) {

                let jsonStr = NSString(data: data!, encoding: NSUTF8StringEncoding)
                print("Error could not parse JSON: '\(jsonStr)'")
            }
            else {

                print("Everything Looks good: \(responseData)")
                self.setCookies(responseData!)
                self.shouldPerformSegueWithIdentifier("showHomeController", sender: …
Run Code Online (Sandbox Code Playgroud)

cookies ios swift ios9

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

尽管我已经通过taskdef添加了ant-contrib,但Apache ant并不识别'for'任务/宏

我在做ant构建时得到了以下内容:

Build\build.xml:247: Problem: failed to create task or type
for
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
Run Code Online (Sandbox Code Playgroud)

build.xml第247行是 <for param="file">

已经定义<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>,它没有用.然后我特意添加了以下但它仍然无法正常工作.

<taskdef resource="net/sf/antcontrib/antcontrib.properties">
        <classpath>
            <pathelement location="${env.ANT_HOME}/lib/ant-contrib-1.0b3.jar"/>
        </classpath>
    </taskdef>
Run Code Online (Sandbox Code Playgroud)

我在C:\ Softwares\apache-ant-1.8.4\lib目录下有ant-contrib-1.0b3.jar.这里缺少什么?

ant build

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

iOS MDM服务入门

我想从iOS MDM服务开始.计划是做一个概念验证,首先感受一下iOS MDM api然后把它提交给我的经理.关于这个的几个问题:

  1. 企业开发者帐户是否仅用于POC目的?我的理解是企业帐户仅用于分发目的.
  2. MDM api有哪些可用的教程?
  3. 我看到了这份文件,它很好地介绍了MDM服务.还有其他类似的文件吗?

mdm ios

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