首页 \ 问答 \ Scala + Play + Intellij IDEA问题(Scala + Play + Intellij IDEA Issue)

Scala + Play + Intellij IDEA问题(Scala + Play + Intellij IDEA Issue)

当我使用激活器创建新的Scala + Play项目时,我得到了以下错误。 我正在使用标准激活方法为项目生成Intellij Idea支持,但每次我遇到下面的问题。

我不知道如何解决以下问题。 请帮忙,

项目'play-scala-intro'具有较旧的格式并将被转换。 您可能无法使用早期版本的IntelliJ IDEA打开项目。 细节...

旧版本的项目文件将保存到:'E:\ Personal \ Scala Workspace \ play-scala-intro \ projectFilesBackup'


I was getting below error when I was making new Scala + Play project using activator. I am using standard activator method to generate Intellij Idea support for project but every time I was facing below issue.

I dont know how to resolve below issue. Please help,

#

The project 'play-scala-intro' has an older format and will be converted. You may not be able to open the project with earlier versions of IntelliJ IDEA. Details...

Old versions of project files will be saved to: 'E:\Personal\Scala Workspace\play-scala-intro\projectFilesBackup'

#


原文:https://stackoverflow.com/questions/28773709
更新时间:2023-01-26 13:01

最满意答案

这通常被称为自然排序 。 有实现它的模块: Sort :: Naturally

要获得最高价值 - 您可以排序并获取最后一个元素:

use strict; use warnings;
use Sort::Naturally;

my @names = (...);
my $name_with_biggest_number = (nsort(@names))[-1];

更新 - 手动排序

使用地图/排序/地图成语 。 但是,只有在文件名中有单个数字时才能工作:

use strict; use warnings;

my @names = (...);
my @sorted_names = 
    map { $_->[0] }
    sort { $b->[1] <=> $a->[1] } ## descending order
    map { [ $_, m/(\d+)/ ] }     ## extracting first number
    @names;
my $name_with_biggest_number = $sorted_names[0];

更新 - 无需排序

根据输入数据,避免使用sort可能更有效。 所以你可以明确的代码搜索最大数量:

sub name_with_largest_number {
        my (@names) = @_;

        my $max_number = undef;
        my $name_with_max_number = undef;
        for my $name (@names) {
                my ($number) = ($name =~ m/(\d+)/);
                if (defined $number) {
                        if (! defined $max_number || $number > $max_number) {
                                $max_number = $number;
                                $name_with_max_number = $name;
                        }
                }
        }
        return $name_with_max_number;
}

print name_with_largest_number(...);

This is usually called natural sort. There is module implementing it: Sort::Naturally

To get highest value - you can sort and get last element:

use strict; use warnings;
use Sort::Naturally;

my @names = (...);
my $name_with_biggest_number = (nsort(@names))[-1];

Update - sort manually

Using map/sort/map idiom. But will work only if there is single number in file name:

use strict; use warnings;

my @names = (...);
my @sorted_names = 
    map { $_->[0] }
    sort { $b->[1] <=> $a->[1] } ## descending order
    map { [ $_, m/(\d+)/ ] }     ## extracting first number
    @names;
my $name_with_biggest_number = $sorted_names[0];

Update - without sort

Depending on input data it can be more efficient to avoid using sort. So you can explicitly code search of max number:

sub name_with_largest_number {
        my (@names) = @_;

        my $max_number = undef;
        my $name_with_max_number = undef;
        for my $name (@names) {
                my ($number) = ($name =~ m/(\d+)/);
                if (defined $number) {
                        if (! defined $max_number || $number > $max_number) {
                                $max_number = $number;
                                $name_with_max_number = $name;
                        }
                }
        }
        return $name_with_max_number;
}

print name_with_largest_number(...);

相关问答

更多
  • 您可以使用File::Basename : use File::Basename; my @files = glob('/Perl/Assignment/*'); foreach my $file (@files){ print basename($file), "\n"; } 它长期以来一直是核心Perl的一部分。 (在这种情况下必须使用parens,否则它会认为"\n"是basename的参数而不是print 。) You could use File::Basename: use File: ...
  • 你不得不说: use utf8; 在你的Perl源代码中,如果你期望这些字符串被解释为字符而不是二进制。 % uname -a Darwin arwen 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386 % cat /tmp/makeit use utf8; $name = "abcüabc"; $path = "/tmp/$name"; ...
  • 为什么使用join而不是循环会更短或更干净? 我会说它让它变得更复杂。 你似乎在做什么只是根据条件松散地匹配 名称包含offers或已cleared name包含regup或regdn 名称以.csv结尾。 那么为什么不这样做呢: if ( $file =~ /offers|cleared/i and $file =~ /regup|regdn/i and $file =~ /csv$/i) 您可能对以下内容感兴趣: use strict; use warnings; use ...
  • Perl 6在内部使用Unicode字符串(在基于字形的表示中),并且编码发生在IO边界。 对于控制台输出,您可以通过$*OUT.encoding("...")手动设置编码。 对于目录列表,它取决于后端:使用JVM,它应该做正确的事情(或者以与Java相同的方式失败)。 使用MoarVM,它将取决于平台:在Win32上,使用Unicode API(这也应该做正确的事情),而在其他平台上, 假设使用UTF-8 。 从该片段可以看出,原则上使用不同编码的能力存在于最低级别,但它似乎没有以任何方式暴露给用户... ...
  • #!/bin/bash dir="$1" print_if_greater="45" for fname in "$dir"/[0-9]*; do num="${fname##*/}" # isolate filename from path num="${num%%[^0-9]*}" # extract leading digits from filename if (( num > print_if_greater )); then prin ...
  • File :: Temp会尝试通过将O_EXCL标志设置为sysopen来确保它不打开现有文件,这会导致sysopen在文件已存在时失败。 然而: O_EXCL可能无法在网络文件系统上工作... 所以在某些网络文件系统中,一个进程可能会打开另一个进程创建的现有临时文件。 NFS上的File :: Temp还有其他问题 ,所以你应该只在本地文件系统上使用它。 File::Temp tries to ensure that it doesn't open an existing file by setting ...
  • 这通常被称为自然排序 。 有实现它的模块: Sort :: Naturally 要获得最高价值 - 您可以排序并获取最后一个元素: use strict; use warnings; use Sort::Naturally; my @names = (...); my $name_with_biggest_number = (nsort(@names))[-1]; 更新 - 手动排序 使用地图/排序/地图成语 。 但是,只有在文件名中有单个数字时才能工作: use strict; use warning ...
  • 为每个文件追加一个时间戳,最长为毫秒: #!/usr/local/bin/perl use Time::HiRes qw(gettimeofday); my $timestamp = int (gettimeofday * 1000); print STDOUT "timestamp = $timestamp\n"; exit; 输出: timestamp = 1227593060768 Append a timestamp to each file, up to the millisecond: # ...
  • UTF-16文本由:编码层处理。 当它进入$_ ,就没有办法告诉它它曾经是UTF-16。 我不认为这是你的问题。 我的猜测是你的文件名中有一些空格(当你试图打印时你没有注意到),或者你不在你认为的目录中。 尝试 if (-e $filename) { print "File exists!" } else { print "File <$filename> not found" } 并仔细检查文件名。 你也可以use Cwd; 并打印出当前目录。 The UTF-16 text is processed ...
  • glob运算符的工作方式与命令行处理器类似。 如果您编写 ,它将查找与rawdata/*Epley或maneuver*.csv匹配的文件 您必须将glob表达式放在双引号中: my @files = <"rawdata/*$term*.csv"> The glob operator works like the command-line processor. If you write ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。