小编Pab*_*blo的帖子

在Ubuntu for Rails开发上安装OpenSSL?

我在Ubuntu 10.10上运行最新的RVM,除了OpenSSL之外,我设法让大部分开发环境都在运行.

当我尝试安装包时,我收到以下错误:

$ rvm package install openssl > error
ERROR: Error running 'tar zxf /home/ruby/.rvm/archives/openssl-0.9.8n.tar.gz -C    
/home/ruby/.rvm/src', please read /home/ruby/.rvm/log/openssl/extract.log
ERROR: Error running './config  -I/home/ruby/.rvm/usr/include -L/home/ruby/.rvm
/usr/lib     
--prefix=/home/ruby/.rvm/usr zlib no-asm no-krb5 shared  ', please read /home/ruby
/.rvm/log/openssl/configure.log
ERROR: Error running '/usr/bin/make ', please read /home/ruby/.rvm/log/openssl/make.log
ERROR: Error running '/usr/bin/make install', please read /home/ruby/.rvm/log/openssl   
/make.install.log
Run Code Online (Sandbox Code Playgroud)

当我通过RVM获取它时,似乎原始下载的文件已损坏.所以,我下载并解压缩它~/.rvm/src/openssl0.9.8并且第一个错误消失了(错误运行tar zxf),但我仍然得到其他错误.

编辑:我的Ruby版本,如果有人关心,是:

$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
Run Code Online (Sandbox Code Playgroud)

ruby ubuntu openssl rvm ubuntu-10.10

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

Typescript/ESLint 错误:无法解析模块“aws-lambda”导入/无未解析的路径

我有一个用打字稿编写的无服务器项目。当我运行 ESLint 时,出现以下错误:

  1:85  error  Unable to resolve path to module 'aws-lambda'  import/no-unresolved
Run Code Online (Sandbox Code Playgroud)

对于以下代码行:(我的 devDependency 中import { APIGatewayProxyEvent, APIGatewayProxyHandler, APIGatewayProxyResult } from 'aws-lambda';"@types/aws-lambda": "^8.10.64")。

我不明白可能是什么错误,因为类型已安装,如果我尝试从“@types/aws-lambda”导入,VS Code 会告诉我直接从“aws-lambda”导入。

我在这里做错了什么?

typescript eslint typescript-typings typescript-eslint

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

使用XPath选择下一个链接

我必须编写一个XPath表达式来获取html bellow中的href属性,它紧跟在标记为"current-page"的那个之后(在示例#noimportant/2中).

<dd>
    <a href="#notimportant/1" class="current-page">1</a>
    <a href="#notimportant/2">2</a>
    <a href="#notimportant/3">3</a>
    <a href="#notimportant/4">4</a>
    <!-- EDIT: Do not return the next sibling if @href ends with /last -->
    <a href="#notimportant/last">last</a>
</dd>
Run Code Online (Sandbox Code Playgroud)

我想从//a[@class='current-page']/../next-sibling-of-first-node/@href这样的东西开始,但我被困在这里......

有人可以帮我这个吗?我已经google了,但XPath不是我最喜欢的技能(不,我不能使用jQuery.它不是一个webapp).

xml xpath parsing html-parsing

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

RVM安装抱怨OSX中没有'bison'

在RVM的安装说明中,明确提到在安装RVM之前在OSX上安装Xcode.

我已经下载并安装了它,所以我没有必要再次安装.

但是,在遵循RVM安装时,当我尝试安装ruby版本时,例如$ rvm install 1.9.2-head,我收到以下消息:

"请确保在从头部编译之前安装野牛."

如果我使用自制软件来安装它,我会得到以下结果:

$ brew install bison
/usr/local/Library/Homebrew/brew.h.rb:441: command not found: /usr/bin/xcode-select -print-path
Warning: Xcode is not installed! Builds may fail!
Error: No available formula for bison

这对我来说很奇怪,因为我在我的OSX盒子上有Xcode.有人似乎有这样的问题吗?

ruby macos rvm

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

如果我尝试修复gps坐标,Android模拟器会重新启动

我创建了一个2.3平台(api级别9)的虚拟设备,我刚刚启动它并尝试通过telnet修复GPS位置,如下所示:

telnet localhost 5554
geo fix 41.41 174.64
Run Code Online (Sandbox Code Playgroud)

模拟器返回"OK"消息作为我的命令的输出,我只是想看看谷歌地图/谷歌纵横应用程序是否能够将这些坐标看作我的位置,但是当我加载它们时它们只会重启模拟器(实际上操作系统没有回来,我必须关闭模拟器并再次启动它).

我做错了什么或模拟器中有错误吗?

gps android android-emulator

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

用Regex替换字符串中的完整单词

我需要用正则表达式替换句子中第一个出现的单词.

部分问题已解决,但我只需要替换完整的单词,并排除部分匹配.

例如,在"快速的棕色狐狸跳过懒狗"这句话中,我想用"猫"代替"狐狸".

我可以实现的结果如下:"快速的棕色猫咪跳过懒狗".而不是"狐狸猫".

我使用Regex.Replace方法如下:

var reg = new Regex(currentKeyword, RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Multiline);

reg.Replace(input, replace, 1, 0);
Run Code Online (Sandbox Code Playgroud)

c# regex

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

为什么我会在回发中丢失对象引用?

我正在开发一个asp.net(3.5)应用程序,我对回发的行为感到困惑.

请考虑以下情形:我有一个基本上是表单的Web用户控件.但是,每个表单字段本身都是Web用户控件.

在保存按钮的单击事件中,我遍历表单中的所有控件,并检索字段值和引用我将值保存到的数据库字段的字段名称.

click事件触发回发,并且在回访期间我访问控件,这是有趣的事情:数据库字段的属性值变为null!谁能在这里曝光?

这是一些基本代码:

[Serializable]
public partial class UserProfileForm : CustomIntranetWebappUserControl
{
    protected override void OnInit(EventArgs e)
    {
        //AutoEventWireup is set to false
        Load += Page_Load;
        CancelLinkButton.Click += CancelButtonClickEvent;
        SaveLinkButton.Click += SaveButtonClickEvent;
        base.OnInit(e);
    }

    private void SaveButtonClickEvent(object sender, EventArgs e)
    {
        VisitFormFields();
    }

    private void VisitFormFields()
    {
        var userProfileVisitor = new UserProfileVisitor();

        foreach (var control in Controls)
        {
            if (control is FormFieldUserControl)
            {
                var formField = (FormFieldUserControl) control;
                formField.Visit(userProfileVisitor);
            }
        }
        userProfileVisitor.Save();
    }

    protected void Page_Load(object sender, EventArgs e) …
Run Code Online (Sandbox Code Playgroud)

asp.net postback object-reference

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