小编Pro*_*mer的帖子

Apache httpd设置和安装

这是我第一次尝试在我的盒子中本地安装Apache HTTP服务器作为普通用户(非root用户).

我已经下载了Apache 2.4.1版本的Apache HTTP服务器[http://httpd.apache.org/download.cgi].但是,当我尝试在我的框中本地构建和安装时,我收到以下错误:

httpd/httpd-2.4.1 1059> ./configure
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu

Configuring Apache Portable Runtime library ...

checking for APR... no
configure: error: APR not found.  Please read the documentation.
Run Code Online (Sandbox Code Playgroud)

我不确定它正在寻找什么依赖 - 我的意思是下载包不包含它?我需要做什么来构建/部署Apache HTTP服务器?

提前致谢.

apache apr

80
推荐指数
4
解决办法
22万
查看次数

建立GCC需要GMP 4.2 +,MP​​FR 2.3.1+和MPC 0.8.0+

我从http://www.netgull.com/gcc/releases/gcc-4.5.0/下载了GCC 4.5,但是当我尝试设置/构建时,我收到以下错误:

Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1040> /x/home/prakash_satya/shared_scripts/bin/gcc/gcc-4.5.0/configure CC="gcc -m64" --prefix=/x/home/prakash_satya/shared_scripts/bin/gcc/gcc-4.5.0 --with-gmp-lib=/usr/lib64 --with-mpfr-lib=/usr/lib64 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... gcc -m64
checking for C compiler default output file name... a.out
checking whether …
Run Code Online (Sandbox Code Playgroud)

gcc mpfr gmp mpc

61
推荐指数
4
解决办法
8万
查看次数

删除本地开发分支

我最近在我的系统中克隆了我们的开发代码分支的回购:

git clone https://gitserver.com/product
Run Code Online (Sandbox Code Playgroud)

克隆成功后,我在查询时获得以下状态:

$ git branch
* develop
Run Code Online (Sandbox Code Playgroud)

我意识到现在需要删除这个分支,因此:

$ git checkout develop
Already on 'develop'
Your branch is up-to-date with 'origin/develop'.

$ git branch -d develop
error: Cannot delete branch 'develop' checked out at 'C:/work/test'
Run Code Online (Sandbox Code Playgroud)

我不确定是否应该尝试使用GIT命令或Unix命令'rm -rf'来删除本地开发分支库?最后为什么没有人可以删除'develop'分支.

git branch git-branch

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

Python字典使用正则表达式搜索键的值

我试图实现在Python字典中搜索特定键值的值(使用正则表达式作为键).

例:

我有一个Python字典,其值如下:

{'account_0':123445,'seller_account':454545,'seller_account_0':454676, 'seller_account_number':3433343}
Run Code Online (Sandbox Code Playgroud)

我需要搜索其键为'seller_account'的值?我写了一个示例程序,但想知道是否可以做得更好.主要原因是我不确定正则表达式并错过了一些东西(比如我如何设置re以#seller_account'开头):

#!usr/bin/python
import re
my_dict={'account_0':123445,'seller_account':454545,'seller_account_0':454676, 'seller_account_number':3433343}

reObj = re.compile('seller_account')

for key in my_dict.keys():
        if(reObj.match(key)):
                print key, my_dict[key]

~ home> python regular.py

seller_account_number 3433343
seller_account_0 454676
seller_account 454545
Run Code Online (Sandbox Code Playgroud)

python

28
推荐指数
4
解决办法
6万
查看次数

相当于NumPy中的j

j在NumPy中,Octave的等价物是什么?我如何j在Python中使用?

在Octave:

octave:1> j
ans =  0 + 1i
octave:1> j*pi/4
ans =  0.00000 + 0.78540i
Run Code Online (Sandbox Code Playgroud)

但是在Python中:

>>> import numpy as np
>>> np.imag
<function imag at 0x2368140>
>>> np.imag(3)
array(0)
>>> np.imag(3,2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: imag() takes exactly 1 argument (2 given)
>>> np.imag(32)
array(0)
>>> 
>>> 0+np.imag(1)
1
Run Code Online (Sandbox Code Playgroud)

python numpy complex-numbers

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

如何删除旧版本的Java并安装新版本

我有一个安装了Java 1.7的Linux盒子:

#java -version
java version "1.7.0_09-icedtea"
OpenJDK Runtime Environment (rhel-2.3.4.1.el6_3-x86_64)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
Run Code Online (Sandbox Code Playgroud)

但是对于一些新工具我需要安装jdk-8u45-linux-x64.tar.gz

那么如何删除旧的并安装新的呢?

java linux

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

将较小的向量与较大的向量进行比较,以检查它在较小的末尾是否不同

我们有两个大小的向量取决于运行时间,需要检查它们是否相等 - 仅在较小大小的向量结束后才有不同的元素.我使用std :: equal,但问题是我需要先找到哪个矢量尺寸较小,从而产生额外的代码行:

#include <vector>
#include <iostream>

int main()
{
  std::vector<int> a(1000, 3);
  std::vector<int> a1(100, 3);

  if(a.size() > a1.size())
  {
    if(std::equal(a1.begin(), a1.end(), a.begin()))
    {
      std::cout << "Same a gt a1" << std::endl;
    }
  }

  if(a1.size() > a.size())
  {
    if(std::equal(a.begin(), a.end(), a1.begin()))
    {
      std::cout << "Same a1 gt a" << std::endl;
    }
  }

  if(a1.size() == a.size())
  {
    if(std::equal(a.begin(), a.end(), a1.begin()))
    {
       std::cout << "Same a = a1" << std::endl;
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

可以改进比较两个向量或仅在较小向量的末尾有所不同的代码吗?

c++ size vector c++11

13
推荐指数
2
解决办法
911
查看次数

按位'&'运算符

我在按位'&'运算符中缺乏一些基本的理解.

5 = 101
4 = 100
Run Code Online (Sandbox Code Playgroud)

那么为什么以下if条件的输出是真的因为比特101 & 100应该是假的:

#include <stdio.h>
main()
{
   if(5&4)
      printf("Yes\n");
}
Run Code Online (Sandbox Code Playgroud)

c bitwise-operators

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

为什么.+算术运算在相同大小的向量上失败

>> p=[1;2;3]

p =

     1
     2
     3

>> p1 = [2;3;4]

p1 =

     2
     3
     4

>> p + p1

ans =

     3
     5
     7
Run Code Online (Sandbox Code Playgroud)

>> p .+ p1
Error: "p" was previously used as a variable, conflicting with
its use here as the name of a function or command.
See "How MATLAB Recognizes Command Syntax" in the MATLAB
documentation for details.
Run Code Online (Sandbox Code Playgroud)

>> p .* p1

ans =

     2
     6
    12

>> p * p1
Error using  * …
Run Code Online (Sandbox Code Playgroud)

matlab

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

NodeJS:警告:检测到可能的EventEmitter内存泄漏.11名听众补充道.使用emitter.setMaxListeners()来增加限制

我有以下代码:

var schild = spawn('script.sh', ["process1", "process2"]);
        schild.stderr.on('data', function (data) {
                        logger.info('stderr: ' + data);
        });

        schild.on('exit', function (code) {
          logger.info('child process exited with code ' + code);
        });

        schild.stdout.on('data', function (data) {
           logger.info('Data ' + data);
        });
Run Code Online (Sandbox Code Playgroud)

当我运行代码时,我得到以下错误:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at EventEmitter.addListener (events.js:175:15)
    at EventEmitter.once (events.js:196:8)
    at Transport.logException (/x/home/prakash/src/node_modules/winston/lib/winston/transports/transport.js:118:8)
    at logAndWait (/x/home/prakash/src/node_modules/winston/lib/winston/logger.js:613:15)
    at async.forEach (/x/home/prakash/src/node_modules/winston/node_modules/async/lib/async.js:86:13)
    at Array.forEach (native)
    at _forEach (/x/home/prakash/src/node_modules/winston/node_modules/async/lib/async.js:26:24)
    at Object.async.forEach (/x/home/prakash/src/node_modules/winston/node_modules/async/lib/async.js:85:9)
    at …
Run Code Online (Sandbox Code Playgroud)

node.js

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

标签 统计

python ×2

apache ×1

apr ×1

bitwise-operators ×1

branch ×1

c ×1

c++ ×1

c++11 ×1

complex-numbers ×1

gcc ×1

git ×1

git-branch ×1

gmp ×1

java ×1

linux ×1

matlab ×1

mpc ×1

mpfr ×1

node.js ×1

numpy ×1

size ×1

vector ×1