내부에서 만든 패키지를 참조 해서 사용할때가 있다.

  "dependencies": {
    "@내꺼/orm": "@회사/내꺼-orm",
    }

이렇게 하면 항상 publilsh 된것만 써야 한다.

npm-link를 이용해도 되지만,

번거로워 보인다.

 

필요할 때 검색 할때는 잘 안되서 포기 했었는데,

문제가 생겨서 다시 해보니 잘된다.

 

https://docs.npmjs.com/files/package.json#git-urls-as-dependencies

  "dependencies": {
    "@내꺼/orm": "https://github.com/회사/내꺼-orm#feature/2712",
    }

'Develop' 카테고리의 다른 글

make date range list  (0) 2020.07.03
ecs-params: assign_public_ip  (0) 2020.06.02
mysql index hint  (0) 2020.03.26
The CloudFormation template is invalid  (0) 2020.01.14
C# HttpListener External IP  (0) 2019.08.13
create table t1
(
	id int null,
	created_at datetime null,
	type int null,
	constraint t1_pk
		primary key (id)
);

create index idx_created_at
	on t1 (created_at);

create index idx_type
	on t1 (type);

 

이런 테이블이 있다.

show index from t1;

 

cardinality가

created_at : 300000

type : 4

 

일 때

 

select * from t1 where created_at >= '2020-03-26 00:00:00' and type = 1

을 하면 어떤 index를 탈까?

 

explain을 해본다면

idx_type은 const이고 idx_created_at는 range라서 idx_type을 탄다.

 

이 때는 fullscan과 다르지 않다.

 

select * from t1 use index (idx_created_at) where created_at >= '2020-03-26 00:00:00' and type = 1

는 idx_created_at을 타라고 hint를 줬기 때문에 cardinality가 더 높은 idx_created_at을 탈것이고

더 빠른 성능을 보여준다.

 

조금더 많은 컬럼과 index가 존재 할 때 hint를 두개 주면

상황에 따라 두개 중에 유리한것을 mysql이 선택한다.

 

예를 들면

type의 cardinality가 200000 이라면, 

type은 상수값으로 접근 하기 때문에 idx_type을 탈것이다.

 

정확한 내용은 아닐 수 있지만, 인덱스로 고생할 때 이 정보를 가지고 튜닝하다보면 좋은 결과를 얻는데 도움이 될 것이다.

'Develop' 카테고리의 다른 글

ecs-params: assign_public_ip  (0) 2020.06.02
node packages github branch로 사용  (0) 2020.05.26
The CloudFormation template is invalid  (0) 2020.01.14
C# HttpListener External IP  (0) 2019.08.13
Flutter Error 1  (0) 2019.08.04

환경:

  • serverless
  • aws
  • lambda
  • apigateway

발생: The CloudFormation template is invalid: [/Resources/XXXXXXXXLambdaFunction/Type/Description] Template contains invalid characters

 

원인: serverless가 생성한 CloudFormation Template에 문제가 있다.

 

원인 찾기: 로컬에서 template을 생성하고 validation을 해보자

  1. sls package --stage prod
  2. aws cloudformation validate-template --template-body ./cloudformation-template-update-stack.json

발생에 나오는 것 처럼 경로를 알려준다.

Type/Description 이라고 해서 Type 아래에 있는 Description은 아니다.

 

이번 경우에는 git에서 commit message에 \0xxx 같은 글자가 들어있어서 문제가 되었다.

 

'Develop' 카테고리의 다른 글

node packages github branch로 사용  (0) 2020.05.26
mysql index hint  (0) 2020.03.26
C# HttpListener External IP  (0) 2019.08.13
Flutter Error 1  (0) 2019.08.04
PowerShell - 덤프파일 압축  (0) 2019.04.29

C#의 HttpListener를 사용 할 때 외부 IP는 접속이 안되는 경우가 있다.

관리자 권한으로 실행해야 하며, 

netsh 명령으로 ip를 등록 해줘야 한다.

 

HttpListener listener = new HttpListener();
listener.Prefixes.Add($"http://*:{port}/");
listener.Start();
listener.BeginGetContext(this.OnRequest, null);
netsh http add iplisten [ip]
netsh http show iplisten

'Develop' 카테고리의 다른 글

mysql index hint  (0) 2020.03.26
The CloudFormation template is invalid  (0) 2020.01.14
Flutter Error 1  (0) 2019.08.04
PowerShell - 덤프파일 압축  (0) 2019.04.29
wpf textbox twoway  (0) 2018.12.13

안드로이드 빌드 시 발생 하는 에러.

 

 

I/flutter (14592): PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 12500: , null)

 

아래 링크의 내용을 보면

 

https://github.com/flutter/flutter/issues/33393#issuecomment-510395178 

 

google sign in ^4.0.1+3 plugin: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null) ·

Details After sigining in to google at this line (Android) GoogleSignInAccount googleUser = await _googleSignIn.signIn(); I get this exception PlatformException(sign_in_failed, com.google.android.g...

github.com

구글 api console에서 credentials 에 내용을 체워 넣으면 된다고 한다.

https://console.developers.google.com/apis/credentials

 

Google Cloud Platform

하나의 계정으로 모든 Google 서비스를 Google Cloud Platform을 사용하려면 로그인하세요.

accounts.google.com

 

그리고 해보면 잘 된다.

'Develop' 카테고리의 다른 글

The CloudFormation template is invalid  (0) 2020.01.14
C# HttpListener External IP  (0) 2019.08.13
PowerShell - 덤프파일 압축  (0) 2019.04.29
wpf textbox twoway  (0) 2018.12.13
c# interface method 정의  (0) 2018.12.04
using System;
using System.Collections.Generic;

namespace ConsoleApp3.EventHandler
{
  public class MyEventHandlerDic
  {
    private Dictionary> dic
      = new Dictionary>();

    public void Register(int key, EventHandler newHandler)
    {
      if (this.dic.ContainsKey(key))
      {
        this.dic[key] += newHandler;
      }
      else
      {
        this.dic.Add(key, newHandler);
      }
    }

    public void Unregister(int key, EventHandler newHandler)
    {
      if (this.dic.ContainsKey(key))
      {
        this.dic[key] -= newHandler;
      }
    }

    public void Run()
    {
      foreach (var keyValue in this.dic)
      {
        keyValue.Value?.Invoke(null, keyValue.Key);
      }
    }
  }

  public class Runner
  {
    public int Key { get; set; }
    public void Update(object obj, int arg)
    {
      Console.WriteLine($"key:{this.Key} arg:{arg}");
    }
  }

  public static class EventHandlerTest
  {
    public static void Run()
    {
      var handlerDic = new MyEventHandlerDic();
      Runner r1 = new Runner { Key = 1 };
      Runner r2 = new Runner { Key = 2 };
      Runner r3 = new Runner { Key = 3 };
      Runner r4 = new Runner { Key = 4 };
      Runner r5 = new Runner { Key = 5 };

      handlerDic.Register(1, r1.Update);
      handlerDic.Register(1, r2.Update);
      handlerDic.Run();
      Console.WriteLine(1);

      handlerDic.Unregister(1, r2.Update);
      handlerDic.Run();
      Console.WriteLine(2);

      handlerDic.Unregister(1, r1.Update);
      handlerDic.Run();
      Console.WriteLine(3);

      handlerDic.Register(2, r2.Update);
      handlerDic.Register(3, r3.Update);
      handlerDic.Run();
      Console.WriteLine(4);
      
    }

  }
}
key:1 arg:1
key:2 arg:1
1
key:1 arg:1
2
3
key:2 arg:2
key:3 arg:3
param([string]$srcPath, [string]$destPath)

if (-Not (Test-Path $srcPath))
{
    echo "Wrong path srcPath" 
    return
}

if (-Not (Test-Path $destPath))
{
    echo "Wrong path destPath" 
    return
}

$srcpath=Join-Path -Path $srcPath -ChildPath "*.dmp" 

$fileList=Get-ChildItem -path $srcpath

if ($fileList.Length -lt 1)
{
    echo "list empty"
    return
}

$targetFile=$fileList[0]
$zipFile= $destPath + $targetFile.BaseName + ".zip"

echo "Target File " + $targetFile.FullName

Compress-Archive -Path $targetFile -DestinationPath $zipFile

echo "Compress complete" + $zipFile

Remove-Item -Path $targetFile 

echo "Delete " + $targetFile

 

 

'Develop' 카테고리의 다른 글

C# HttpListener External IP  (0) 2019.08.13
Flutter Error 1  (0) 2019.08.04
wpf textbox twoway  (0) 2018.12.13
c# interface method 정의  (0) 2018.12.04
WPF Binding  (0) 2018.11.12
<TextBox x:Name="CommandInputText" Grid.Row="1" Grid.Column="1" 
	TextWrapping="Wrap" 
	Text="{Binding Path=CommandInputText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
	Width="auto" Height="auto" TextAlignment="Left" 
	VerticalContentAlignment="Center" Background="LightGray"
	TextChanged="CommandInputText_TextChanged"/>

private string commandInputText;
public string CommandInputText
{
  get
  {
	return this.commandInputText;
  }
  set
  {
	this.commandInputText = value;
	this.NotifyOfPropertyChange("CommandInputText");
  }
}


Caliburn.Micro 사용


'Develop' 카테고리의 다른 글

Flutter Error 1  (0) 2019.08.04
PowerShell - 덤프파일 압축  (0) 2019.04.29
c# interface method 정의  (0) 2018.12.04
WPF Binding  (0) 2018.11.12
perforce ignore  (0) 2018.09.05
interface IAAA
{
  int Run();
}

class AAA : IAAA
{
  public int Run()
  {
    return 1;
  }
}

class BBB : AAA
{
  public int Run()
  {
    return 2;
  }
}

class CCC : AAA
{
  public new int Run()
  {
    return 3;
  }
}

static private void func7()
{
  var aaa = new AAA();
  Console.WriteLine(aaa.Run());
  aaa = new BBB();
  Console.WriteLine(aaa.Run());
  aaa = new CCC();
  Console.WriteLine(aaa.Run());
}

/// 출력
1
1
1


class override 랑은 다르다

'Develop' 카테고리의 다른 글

PowerShell - 덤프파일 압축  (0) 2019.04.29
wpf textbox twoway  (0) 2018.12.13
WPF Binding  (0) 2018.11.12
perforce ignore  (0) 2018.09.05
python AES 암호화  (0) 2018.05.17

slider.Value를 바인딩 할 때 지정한 Converter를 사용하라

라는 의미

<Window x:Class="WpfApp1.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:local="clr-namespace:WpfApp1"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <Grid.Resources>
            <local:Light x:Key="LightConvert"/>
        </Grid.Resources>
        <StackPanel>
            <TextBlock Text="TextBlock"/>
            <TextBox Text="TextBox" Background="{Binding Value, ElementName=slider, Converter={StaticResource LightConvert}}"/>
            <ProgressBar Value="50" Width="60" Height="20"/>
            <Slider Value="5" Width="60" x:Name="slider"/>
            <PasswordBox Password="Secret"/>
        </StackPanel>
    </Grid>
</Window>
namespace WpfApp1
{
  public class Light : IValueConverter
  {
    public object Convert(object value,
      Type targetType, object parameter, CultureInfo cluture)
    {
      
      var iValue = (double)value;
      if (iValue > 7)
      {
        return "Red";
      }
      else if (iValue < 7 && iValue >= 4)
      {
        return "Yellow";
      }
      else
      {
        return "Green";
      }
    }
  }
}




"WPF MVVM 일주일 만에 배우기" 를 참고 하였습니다


'Develop' 카테고리의 다른 글

wpf textbox twoway  (0) 2018.12.13
c# interface method 정의  (0) 2018.12.04
perforce ignore  (0) 2018.09.05
python AES 암호화  (0) 2018.05.17
nodejs zip  (0) 2018.02.27

+ Recent posts