小编Que*_*Guy的帖子

我可以告诉perl在运行时超过某个时间限制时发出警报/信号而不退出吗?

我正在设置一个警报类型调用,让我知道我的程序运行时间是否超过10分钟我希望程序在发送警报或信号后继续运行.我以为我可以执行以下代码,但程序会在运行时间达到十分钟时停止.

eval{
     local $SIG{ALRM} = sub { die "alarm\n"; };
     alarm (600);
     --code---
     alarm 0;
};
if($@){
     print "\Its been ten minutes\n";
}
Run Code Online (Sandbox Code Playgroud)

我希望应用程序通知我但继续运行.

perl timeout runtime

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

错误:Application' 是 'System.Windows.Application' 和 'System.Windows.Forms.Application' 之间的引用不明确

我在 Visual Studio 2013 中运行它。

因为Application.Current.Shutdown我得到:

'Application' is an ambiguous reference between 'System.Windows.Application' and 'System.Windows.Forms.Application'。

我尝试使用using SystemInformation = System.Windows.Forms.SystemInformation;代替using System.Windows.Forms作为一个网站的建议,但出现错误:

The type or namespace name 'OpenFileDialog' could not be found (are you missing a using directive or an assembly reference?)对于线OpenFileDialog dlg = new OpenFileDialog();

我该如何修复它以便我可以使用 OpenFileDialog?我想要出现一个打开文件对话框。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using …
Run Code Online (Sandbox Code Playgroud)

c# visual-studio-2013

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

C中的std :: pair的等价物

什么是std::pairC++ 的C等价物?我试图在网上找到相同的东西,除了解释它的作用之外什么都找不到.

c c++ std-pair

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

无法在Perl中安装Time :: Out模块

我正在尝试安装Time::Out.

该错误看起来来自tar文件.我还需要安装更多东西吗?我得到以下内容:

install Time::Out
Reading 'C:\Perl\cpan\Metadata'
  Database was generated on Thu, 05 Jun 2014 08:53:02 GMT   
Running install for module 'Time::Out'
Checksum for C:\Perl\cpan\sources\authors\id\P\PA\PATL\Time-Out-0.11.tar.gz ok
Scanning cache C:\Perl/cpan/build for sizes
............................................................................DONE

Time-Out-0.11/
Time-Out-0.11/MANIFEST
Time-Out-0.11/t/
Time-Out-0.11/t/01_init.t
Time-Out-0.11/t/pod.t
Time-Out-0.11/t/03_exceptions.t
Time-Out-0.11/t/02_usage.t
Time-Out-0.11/Out.pod
Time-Out-0.11/README
Time-Out-0.11/Out.pm
Time-Out-0.11/META.yml
Time-Out-0.11/Makefile.PL
Time-Out-0.11/Changes
Configuring P/PA/PATL/Time-Out-0.11.tar.gz with Makefile.PL
Set up gcc environment - 3.4.5 (mingw-vista special r3)
Checking if your kit is complete...
Looks good
Generating a dmake-style Makefile
Writing Makefile for Time::Out
Writing MYMETA.yml and MYMETA.json
  PATL/Time-Out-0.11.tar.gz …
Run Code Online (Sandbox Code Playgroud)

perl timeout module

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

如何使用foreach循环检查数组的哪些元素等于给定的字符串?

我的foreach循环不能按照我的意愿工作.我希望它循环遍历数组,并找到一个元素存在的时间和元素不存在的时间.但是,我得到了所有人的说法Not an apple.

@fruit = ('apple','orange','pear');

foreach(@fruit){
     if(@fruit != 'apple'){
          print "Not an apple\n";
     }
     else{
          print "Is an apple\n";
     }
}
Run Code Online (Sandbox Code Playgroud)

perl foreach

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

标签 统计

perl ×3

timeout ×2

c ×1

c# ×1

c++ ×1

foreach ×1

module ×1

runtime ×1

std-pair ×1

visual-studio-2013 ×1