小编Gaa*_*aax的帖子

怎么用m!在Perl正则表达式

我第一次学习Perl和正则表达式,所以如果这是一个愚蠢的问题,我道歉.我一直在寻找自己的答案,但找不到任何东西.也许我的一部分问题是我真的不知道它叫什么.

我遇到了一段看起来像这样的代码:

$xl_file = "$curr_dir/$xl_file" unless $xl_file =~ ( m!(^[a-z]:)|[/\\]!i );
Run Code Online (Sandbox Code Playgroud)

当我查看=〜运算符时,我潜入正则表达式洞并开始了解它.但我只看过"m //"匹配运算符.我假设"我!" 是另一种匹配运算符,但我找不到任何解释它如何工作的引用.通过实验,我发现在使用它时需要"!i",但这与我能想出的一样多......

有人可以向我解释一下,或者指出一些(免费)材料的方向可以吗?

regex perl

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

如何从 powershell 脚本中执行“dotnet build”

当我直接在 powershell 终端中运行以下行时,它工作得很好:

dotnet build ./MySolution.sln --configuration Release
Run Code Online (Sandbox Code Playgroud)

但是,当我将该行放入 powershell 脚本中并从同一目录中运行它时,我收到此错误:

MSBUILD : error MSB1009: Project file does not exist.
Run Code Online (Sandbox Code Playgroud)

我尝试以不同方式传递参数,如如何使用 & 运算符从 PowerShell 调用 MSBuild? 的答案之一中提到的那样。所以我现在很茫然。我需要做什么才能在 powershell 脚本中完成这项工作?

powershell .net-core

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

在C#中旋转图像时如何防止剪裁?

我刚刚经历了一些试图找出如何使图像均匀旋转的东西.这有效,但现在它是剪辑,我不知道如何让它停止...我正在使用这个rotateImage方法:

public static Image RotateImage(Image img, float rotationAngle)
    {
        //create an empty Bitmap image
        Bitmap bmp = new Bitmap(img.Width, img.Height);

        //turn the Bitmap into a Graphics object
        Graphics gfx = Graphics.FromImage(bmp);

        //now we set the rotation point to the center of our image
        gfx.TranslateTransform((float)bmp.Width / 2, (float)bmp.Height / 2);

        //now rotate the image
        gfx.RotateTransform(rotationAngle);

        gfx.TranslateTransform(-(float)bmp.Width / 2, -(float)bmp.Height / 2);

        //set the InterpolationMode to HighQualityBicubic so to ensure a high
        //quality image once it is transformed to the specified size …
Run Code Online (Sandbox Code Playgroud)

c# image clipping rotation

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

在应用程序配置文件中找不到名为"x"的连接字符串...但它有效吗?

我已经看到了与此错误有关的几个不同的问题,但似乎没有一个我正在经历的.我刚刚在CodeProject.com上关注了一个简单的项目教程,以便更好地理解使用MVVM模式和实体框架(http://www.codeproject.com/Articles/873592/Tutorial-for-a-Basic-WPF -MVVM-Project-Using-Entity).我直接跟着它,一切似乎都很完美.

但是我有点好奇并开始改变一些事情.我想更多地了解命名空间如何在XAML中工作,因此我将MainWindowViewModel移动到一个名为ViewModels的新文件夹中.然后我向我的XAML添加了一个名为"vms"的新命名空间,其中包含适当的位置,并为窗口设置了我的数据上下文:

<Window x:Class="CpMvvMWithEntity.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vms="clr-namespace:CpMvvMWithEntity.ViewModels"
    xmlns:local="clr-namespace:CpMvvMWithEntity"
    mc:Ignorable="d"
    Title="MainWindow" Height="350" Width="525">

<Window.DataContext>
   <vms:MainWindowViewModel />
</Window.DataContext>
Run Code Online (Sandbox Code Playgroud)

但是当我这样做时,我在Visual Studio中得到一个浅蓝色下划线警告,上面写着"在应用程序配置文件中找不到名为[myEntities]的连接字符串".但是App.config文件中存在连接字符串,当我构建并运行程序时,它按预期工作.

关于为什么会发生这种情况的任何想法?

c# wpf xaml mvvm entity-framework-6

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

Vue 包版本不匹配

我正在尝试通过 jest 向现有的 vue 项目添加单元测试,但是当我尝试运行我的第一个测试时,我收到一个错误消息

Vue 包版本不匹配:

- vue@2.5.16
- vue-template-compiler@2.6.6

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.
Run Code Online (Sandbox Code Playgroud)

但是看看我的包,我当前的 vue 版本2.6.6 而不是 2.5.16。我不知道它在哪里看到这个 2.5.16 版本。我没有全局安装 vue,只有@vue/cli@3.4.0。任何帮助,将不胜感激。您可以在下面找到包含我的 jest 配置的 package.json。

- vue@2.5.16
- vue-template-compiler@2.6.6

This may cause things to work incorrectly. Make sure to use the same …
Run Code Online (Sandbox Code Playgroud)

vue.js jestjs

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

标签 统计

c# ×2

.net-core ×1

clipping ×1

entity-framework-6 ×1

image ×1

jestjs ×1

mvvm ×1

perl ×1

powershell ×1

regex ×1

rotation ×1

vue.js ×1

wpf ×1

xaml ×1