小编Aba*_*oub的帖子

Ionic-3找不到管道

我刚刚升级到Ionic 3.0.1所以我可以使用LazyLoading,因为我不能使用我的自定义Pipes:

import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'StripHTML'
})

export class StripHTML implements PipeTransform {

  transform(value, args) {
    let striped = value.replace(/(<([^>]+)>)/g, "");

    if (args != null) {
      if (args.split != null) {
        striped = striped.split(args.split);
        if (args.index != null) {
          striped = striped[args.index];
        }
      }
    }

    return striped;
  }
}
Run Code Online (Sandbox Code Playgroud)

并在app.module.ts我已将其添加到声明中:

@NgModule({
  declarations: [
    ........,
    StripHTML
  ],
...
Run Code Online (Sandbox Code Playgroud)

现在当我试图在html模板中使用它时出错:

core.es5.js:1085 ERROR Error: Uncaught (in promise): …
Run Code Online (Sandbox Code Playgroud)

typescript ionic-framework ionic3 angular

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

类没有默认构造函数

#include "Includes.h"


enum BlowfishAlgorithm
    {
        ECB,
        CBC,
        CFB64,
        OFB64,
    };

class Blowfish
{
public:
    struct bf_key_st
    {
        unsigned long P[18];
        unsigned long S[1024];
    };
    Blowfish(BlowfishAlgorithm algorithm);
    void Dispose();
    void SetKey(unsigned char data[]);
    unsigned char Encrypt(unsigned char buffer[]);
    unsigned char Decrypt(unsigned char buffer[]);
    char EncryptIV();
    char DecryptIV();
private:
    BlowfishAlgorithm _algorithm;
    unsigned char _encryptIv[200];
    unsigned char _decryptIv[200];
    int _encryptNum;
    int _decryptNum;
};

class GameCryptography
{
public:
    Blowfish _blowfish;
    GameCryptography(unsigned char key[]);
    void Decrypt(unsigned char packet[]);
    void Encrypt(unsigned char packet[]);
    Blowfish Blowfish;
    void …
Run Code Online (Sandbox Code Playgroud)

c++

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

IntelliSense:"#using"需要启用C++/CLI

#using <mscorlib.dll>
#using <System.dll>
using namespace System;
using namespace System::Text;
using namespace System::IO;
using namespace System::Net;
using namespace System::Net::Sockets;
using namespace System::Collections;
Run Code Online (Sandbox Code Playgroud)

错误:IntelliSense:"#using"需要启用C++/CLI ....

如何解决这个问题!?

c++-cli

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

C#预处理器区分操作系统

是否可以区分C#使用中的操作系统preprocessor?喜欢 :

#if OS_WINDOWS
//windows methods
#elif OS_MAC
//mac  methods
#elif OS_LINUX
//linux methods
#endif
Run Code Online (Sandbox Code Playgroud)

c# cross-platform c-preprocessor

7
推荐指数
3
解决办法
2015
查看次数

Laravel 返回所有后代的 id

如何返回AllSubSections(所有级别)的所有 ID

class Section extends Model
{
    public function Ads()
    {
        return $this->hasMany(Ad::class);
    }

    public function AllSubSections()
    {
        return $this->SubSections()->with('AllSubSections');
    }

    public function SubSections()
    {
        return $this->hasMany(Section::class);
    }

    public function Parent()
    {
        return $this->belongsTo(Section::class);
    }
}
Run Code Online (Sandbox Code Playgroud)

我目前正在做的是:

$section = Section::where('name', 'Properties')->first();
$subSections = $section->AllSubSections;
$subSections->pluck('id')
Run Code Online (Sandbox Code Playgroud)

但它只返回第一级而不是所有级别。

php recursive-query laravel laravel-5.3

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

使用linq选择最小值

我有一本词典

Dictionary<Location2D, int> h_scores = new Dictionary<Location2D, int>();
Run Code Online (Sandbox Code Playgroud)

我想选择Key // which is Location2D最小的int值.

我试过了

h_scores.Min().Key; // not working
h_scores.OrderBy(x => x.Value).Select(y=> y.Key).Min(); //error At least one object must implement IComparable.
Run Code Online (Sandbox Code Playgroud)

那么如何通过最小的int值选择一个键呢?

c# linq

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

获取三角形内的所有点数

我有三点,例如:

Start 194 171
Right 216 131
Left  216 203
Run Code Online (Sandbox Code Playgroud)

我想得到那个三角形内的所有点.我该如何有效地做到这一点?

c# polygon fill

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

拍摄截图周围的黑色边缘

我正在关注这个例子:

package com.mtsahakis.mediaprojectiondemo;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.hardware.display.DisplayManager;
import android.hardware.display.VirtualDisplay;
import android.media.Image;
import android.media.ImageReader;
import android.media.projection.MediaProjection;
import android.media.projection.MediaProjectionManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.OrientationEventListener;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;


public class ScreenCaptureImageActivity extends Activity {

    private static final String TAG = ScreenCaptureImageActivity.class.getName();
    private static final int REQUEST_CODE = 100;
    private static String …
Run Code Online (Sandbox Code Playgroud)

android android-bitmap android-mediaprojection

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

OllyDbg捕获/抛出异常

每次我尝试使用OllyDbg 1.10(在Windows 7 32位上)进行调试时,它都会无缘无故地抛出异常.我跳过它们Shift + F7/F8/F9,最后它抛出一个例外说EIP = 00000000.

有人可以告诉我如何解决它?

reverse-engineering ollydbg

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

System.Windows.Baml2006.TypeConverterMarkupExtension'抛出异常.' 行号'6'和行位置'10

我为wpf项目添加了一个Image资源:

right-click on the Project -> Properties -> Resources -> Images -> From Existing -> ClientBackGround.png

我把它作为主窗口的背景:

<Window x:Class="Illuminate_AutoPatcher.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Width="1000" Height="750" ResizeMode="NoResize" WindowStyle="None" WindowStartupLocation="CenterScreen">
    <Window.Background>
        <ImageBrush ImageSource="pack://siteoforigin:,,,/Resources/ClientBackground.png"/>
    </Window.Background>
    <Grid>
        <Button Content="" HorizontalAlignment="Left" VerticalAlignment="Top" Width="224" Margin="766,613,0,0" Height="124" >
        </Button>
    </Grid>
</Window>
Run Code Online (Sandbox Code Playgroud)

但它没有工作它继续抛出这个恼人的错误System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '6' and line position '10,我应该如何修复它,所以我使用与项目一起构建的静态资源?

c# wpf wpf-controls

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