小编Pio*_*app的帖子

找不到管道''-Angular升级后出错

我正在尝试将Angular 4升级到最新版本(7.0.3),直到生产编译为止一切都很好。在其中收到:

ERROR in : Template parse errors:
The pipe 'filter' could not be found ("v class="form-group">
    <ul class="ui-select-list">
      <li [attr.name]="item.id" *ngFor="let [ERROR ->]item of data | filter : qModel" innerHtml="{{ 'AAA' | translate }}"></li>
    </ul>
</div>
"): C:/x/src/app/components/ui/fields/combo/ui.combo.html@2:44
The pipe 'translate' could not be found ("s="ui-select-list">
      <li [attr.name]="item.id" *ngFor="let item of data | filter : qModel" inn[ERROR ->]erHtml="{{ 'AAA' | translate }}"></li>
    </ul>
</div>
"): C:/x/src/app/components/ui/fields/combo/ui.combo.html@2:79
Run Code Online (Sandbox Code Playgroud)

为了重现此错误,我从代码中创建了一个最小的存储库:https : //github.com/ptrstpp950/myBugInAngular

结果如下:

  • ng build --prod app 产生以上错误
  • ng build app …

typescript angular

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

org.apache.hadoop.hdfs.DFSInputStream 上的 NoSuchMethodError

我在 Java 中有一个非常简单的代码,它从中读取数据 hdfs

try{
    InputStream s = new GzipCompressorInputStream(hdfsFileSystem.open(filePath), false);
    ByteStreams.copy(s, outputStream);
    s.close();
}
catch (Exception ex){
    logger.error("Problem with file "+ filePath,ex);
}
Run Code Online (Sandbox Code Playgroud)

有时(并非总是)它会抛出我异常

java.lang.NoSuchMethodError: org.apache.commons.io.IOUtils.closeQuietly(Ljava/io/Closeable;)V
        at org.apache.hadoop.hdfs.DFSInputStream.getBlockReader(DFSInputStream.java:1099)
        at org.apache.hadoop.hdfs.DFSInputStream.blockSeekTo(DFSInputStream.java:533)
        at org.apache.hadoop.hdfs.DFSInputStream.readWithStrategy(DFSInputStream.java:749)
        at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:793)
        at java.io.DataInputStream.read(DataInputStream.java:149)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
        at org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.init(GzipCompressorInputStream.java:136)
        at org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.<init>(GzipCompressorInputStream.java:129)
        [...]
Run Code Online (Sandbox Code Playgroud)

在线下线:

InputStream s = new GzipCompressorInputStream(hdfsFileSystem.open(filePath), false);
Run Code Online (Sandbox Code Playgroud)

我正在使用 bellow maven 依赖项来加载 hadoop 客户端:

    <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-client</artifactId>
        <version>2.2.0</version>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

有谁知道如何解决这个问题?当然,我可以更改catch(Exception e)catch(Error e),但这不仅仅是解决方法。

java hadoop

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

StringBuilder多次附加相同的char

有没有快速的方法StringBuilder在C#中多次追加?当然我可以编写自己的扩展来追加循环,但它看起来无效.

c# stringbuilder

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

在.NET标准中创建OWIN中间件

TL; DR;

有没有一种方法可以在.NET Standard中创建与Microsoft.Owin向后兼容的Owin中间件?

细节

我创建了一个简单的中间件,例如:

public class RequestTrackingMiddleware
{
    private readonly RequestDelegate _next;

    public RequestTrackingMiddleware(RequestDelegate next)
    {
        _next = next;
    }

    public async Task Invoke(HttpContext context)
    {
        var sw = Stopwatch.StartNew();
        await _next(context);
        sw.Stop();
        Console.WriteLine(sw);
    }
Run Code Online (Sandbox Code Playgroud)

我将它与Owin一起添加到“经典” ASP.NET应用程序中。使用方法:

public override void Configuration(IAppBuilder app)
{
    app.Use<FinaiRequestTrackingMiddleware>();
}
Run Code Online (Sandbox Code Playgroud)

但我最终得到:

Microsoft.AspNet.Identity.Owin.IdentityFactoryMiddleware`2 [....]和Microsoft.AspNetCore.Http.RequestDelegate之间没有可用的转换。

有任何想法吗?

asp.net owin asp.net-core

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

在存储库之间复制Docker映像

我有2个私人Docker存储库。有什么办法可以将一个映像从一个存储库复制到第二个?

docker

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

如何使用外部表和serde优化Hive queires

第1部分:我的环境

我有以下文件上传到Hadoop:

  1. 这是纯文本
  2. 每行包含JSON,如:

{code:[int], customerId:[string], data:{[something more here]}}

  1. code 数字从1到3000,
  2. customerId 总计高达4百万,每天高达0.5万
  3. 所有文件都是gzip
  4. 在配置单元中,我使用自定义JSON serde创建了外部表(让我们称之为CUSTOMER_DATA)
  5. 每个文件中的所有文件都date存储在单独的目录中 - 我将其用作Hive表中的分区

我做的大多数查询都是过滤的date,codecustomerId.我还有第二个格式文件(我们称之为CUSTOMER_ATTRIBUTES): [customerId] [attribute_1] [attribute_2] ... [attribute_n] 它包含我所有客户的数据,所以行数高达4百万.

我按以下方式查询和过滤我的数据:

  1. 过滤date- 分区在这里使用WHERE partitionDate IN (20141020,20141020)
  2. code使用语句进行过滤,例如`WHERE code IN(1,4,5,33,6784)
  3. 加入表CUSTOMER_ATTRIBUTESCUSTOMER_DATA同条件查询像 SELECT customerId FROM CUSTOMER_DATA JOIN CUSTOMER_ATTRIBUTES ON (CUSTOMER_ATTRIBUTES.customerId=CUSTOMER_DATA.customerId) WHERE CUSTOMER_ATTRIBUTES.attribute_1=[something]

第2部分:问题

有什么有效的方法可以优化我的查询.我读到有关索引和存储桶的信息,我不知道是否可以将它们与外部表一起使用,以及它们是否会优化我的查询.

indexing hadoop hive

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

在F5上附加到IIS

我在Visual Studio中有一个库项目,它作为网站的一部分进行部署.现在我调试它每次都附加到IIS进程,但它真的很烦人.

有没有办法配置C#Library项目附加到F5上的IIS?我正在使用VS2010和VS2012.

小更新 我通常在我的机器上运行多个w3wp进程.

c# visual-studio-2010 visual-studio-2012

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

静态Int不从0开始

public partial class MainBookingform : System.Web.UI.Page
{

    static int numberOfBeachBookingInteger = 0;
    static int numberOfBushBookingInteger = 0;
    static int totalRevenueInteger = 0;


  protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            if (Session["beachBach"] != null)
            {
                numberOfBeachBookingInteger += 1;
                beachBachLabel.Text = numberOfBeachBookingInteger.ToString();
            }
            if (Session["beachBach"] != null)
            {
                numberOfBushBookingInteger += 1;
                bushBachLabel.Text = numberOfBushBookingInteger.ToString();
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

嗨,我想在调试程序时看到这些整数从"0"开始.但是,我分配给那些整数的这些标签总是从'1'开始

请帮忙!

c#

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