'잡동사니'에 해당되는 글 13674건

  1. 2020.10.08 c# delagate 대리자
  2. 2020.10.07 c# out
  3. 2020.10.06 rancher
  4. 2020.10.06 우분투에서 부팅 USB 만들기(iso)
  5. 2020.10.06 google coral
  6. 2020.10.06 yolo on rpi?
  7. 2020.10.05 stormbook 14 pro 64GB 모델
  8. 2020.10.05 FFT와 고조파(harmonic)
  9. 2020.10.05 jaaa - JACK and ALSA Audio Analyser
  10. 2020.10.05 c# 타입? 변수명;
Programming/c# & winform2020. 10. 8. 08:13

함수포인터의 문법화라는 느낌

node.js에서 흔하게 사용하던 그 문법

 

그런데 람다가 있는데 굳이 delegate 라는걸 또 표현하는 이유는 좀 모르겠다.

두개가 용도가 다른가?

 

[링크 : http://docs.microsoft.com/ko-kr/dotnet/csharp/programming-guide/delegates/]

[링크 : https://docs.microsoft.com/ko-kr/dotnet/standard/delegates-lambdas]

 

반대로.. delegate에 대응되는 다른 언어의 용어를 찾아봐야겠다.

'Programming > c# & winform' 카테고리의 다른 글

winform 에서 이미지 넣기  (0) 2020.10.12
c# strong type langugae  (0) 2020.10.08
c# out  (0) 2020.10.07
c# 타입? 변수명;  (0) 2020.10.05
c# using 키워드, 예외처리  (0) 2020.10.05
Posted by 구차니
Programming/c# & winform2020. 10. 7. 17:05

함수 인자로 out을 사용하면 기존의 c 언어에서 포인터로 값을 빼내오듯 사용이 가능하다.

 

OutArgExample() 함수에서도 out 을 이용하여 number 인자는 입력이 아닌 출력으로 사용한다고 명시하고

해당 함수를 호출 할때도 out initializeInMethod 라는 변수가 출력용 변수임을 명시한다.

 

 

int initializeInMethod;
OutArgExample(out initializeInMethod);
Console.WriteLine(initializeInMethod);     // value is now 44

void OutArgExample(out int number)
{
    number = 44;
}

 

[링크 : https://docs.microsoft.com/ko-kr/dotnet/csharp/language-reference/keywords/out-parameter-modifier]

 

기존의 C로 보면 이걸 문법적으로 표현해주는 느낌이다.

int initializeInMethod;
OutArgExample(&initializeInMethod);
Console.WriteLine(initializeInMethod);     // value is now 44

void OutArgExample(int *number)
{
    *number = 44;
}

[링크 : https://dojang.io/mod/page/view.php?id=550]

 

+

[링크 : https://docs.microsoft.com/ko-kr/dotnet/csharp/language-reference/keywords/in-parameter-modifier] in

[링크 : https://docs.microsoft.com/ko-kr/dotnet/csharp/language-reference/keywords/ref] ref

 

+

2020.10.14

unsafe 옵션과 키워드를 사용해서 사용은 가능하다

using System;

class Touttest
{
	static void Main()
	{
		unsafe{
		int initializeInMethod;
		OutArgExample(&initializeInMethod);
		Console.WriteLine(initializeInMethod);     // value is now 44

		void OutArgExample(int *number)
		{
			*number = 44;
		}
		}
	}
}
$ csc /unsafe out2.cs

unsafe 옵션과 키워드를 사용해서 사용은 가능하다

 

 

+

포인터는 기본적으로 막히고..

out2.cs(8,17): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context
out2.cs(8,3): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context
out2.cs(13,4): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context
out2.cs(13,13): error CS0266: Cannot implicitly convert type 'int' to 'int*'. An explicit conversion exists (are you missing a cast?)
out2.cs(13,4): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context
out2.cs(11,22): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context

 

/unsafe 옵션을 주지 않고 빌드하면 경고가 아닌 에러가 발생한다 ㄷㄷ

out2.cs(7,3): error CS0227: Unsafe code may only appear if compiling with /unsafe

'Programming > c# & winform' 카테고리의 다른 글

c# strong type langugae  (0) 2020.10.08
c# delagate 대리자  (0) 2020.10.08
c# 타입? 변수명;  (0) 2020.10.05
c# using 키워드, 예외처리  (0) 2020.10.05
c# @문자열  (0) 2020.10.05
Posted by 구차니

쿠버네티스 관리 도구

 

[링크 : http://rancher.com/]

'프로그램 사용 > kubernetes' 카테고리의 다른 글

kubernetes selector  (0) 2019.07.16
kubernetes delete pods with namespace  (0) 2019.07.16
kubernetes ImagePullBackOff 에러  (0) 2019.07.16
yaml  (0) 2019.07.16
kubectl  (0) 2019.07.16
Posted by 구차니
Linux/Ubuntu2020. 10. 6. 15:43

USB sd 리더에서 해보긴 했는데

fat32 였던지라 넣으면 바로 인식해서 마운트 되는 바람에

수동으로 umount를 해주어야 했지만 그래도 꽤 편하게 쓸 수 있는 툴

 

woeusbgui로 실행하면 된다.

 

[링크 : https://ncube.net/우분투에서-윈도우-10-설치-부팅-usb-만들기/]

[링크 : https://shiinachianti.tistory.com/32]

 

+

ntpasswd를 만들어봤는데 부팅이 안된다?

'Linux > Ubuntu' 카테고리의 다른 글

ubuntu 20.04 한글입력기  (2) 2020.12.07
/dev/ipmi를 보고 싶다!!!  (0) 2020.11.07
jaaa - JACK and ALSA Audio Analyser  (0) 2020.10.05
ipmitool  (0) 2020.09.24
rsync with ssh  (0) 2020.09.23
Posted by 구차니

구글의 텐서플로우 가속기 라고 해야하려나?

아무튼 TPU accelerator인데 회사에 USB 버전이 있어서 한번 만져 볼까 싶네

 

[링크 : https://coral.ai/]

[링크 : https://coral.ai/products/accelerator/...E]

[링크 : https://coral.ai/docs/accelerator/get-started/#requirements]

'프로그램 사용 > google coral' 카테고리의 다른 글

edgetpu_c.h 파일 내용 분석  (0) 2022.02.07
tensorflow brace-enclosed initializer list  (4) 2022.02.07
google coral, tpu yolo  (0) 2022.01.27
coral tpu delegate example  (0) 2022.01.25
google coral, ubuntu 18.04  (0) 2020.10.20
Posted by 구차니

 

[링크 : https://j-remind.tistory.com/53]

[링크 : https://www.pyimagesearch.com/2020/01/27/yolo-and-tiny-yolo-object-detection-on-the-raspberry-pi-and-movidius-ncs/] tiny yolo

'프로그램 사용 > yolo_tensorflow' 카테고리의 다른 글

yolo lite  (0) 2021.01.08
SSDnnn (Single Shot Detector)  (0) 2021.01.08
CNN - YOLO  (0) 2021.01.07
yolo BFLOPs  (0) 2020.10.21
yolo3 on ubuntu 18.04  (0) 2020.10.20
Posted by 구차니
개소리 왈왈/컴퓨터2020. 10. 5. 22:11

오늘은 재활용날이라 버리는 김에 쭈욱 둘러보는데 하얀거 발견!

zum 으로 보이는 이 마법은 머지 ㅋㅋㅋ

아무튼 다시 보니 imuz 제품. 묘하게 이 그램스러운 느낌은 머지 하고 일단 검색해보니

 

2017년 1월 출시모델

아톰 x5-z8350 체리트레일

14.1인치 FHD

 

오오.. 일단 주워와야지 하고 가져왔는데

밖에서 전원 누르니 불은 들어오더니 이제 안된다 -_ㅠ

 

아무튼 부랴부랴 검색해보는데

오호.. 인증번호 동일하다는건.. 규격이 같다는 거고..

그럼 회사에 가져가서 아쉬운대로 iptime USB 허브 어댑터를 쓰면 전원 충전은 가능하다는거네?!?!

 

스톰북 14 Pro 어댑터 / 안전인증 HA10090-16012

[링크 : http://itempage3.auction.co.kr/DetailView.aspx?itemno=B643548711]

 

iptime UH308 어댑터 / 안전인증 HA10090-16012

[링크 : http://itempage3.auction.co.kr/DetailView.aspx?itemno=B453620234]

 

+

2020.10.06

회사와서 연결하니 잘되네 ㅋ

근데 묘하게 이어폰 굵기랑 비슷해서 이어폰에 꽂아놨던건 함정 -_-

왜 안켜져? 하고 잘 보니 이어폰 구멍 ㅠㅠ

 

+ 복구 유틸

[링크 : https://m.shop.imuz.com/board/view.php?mypageFl=&bdId=data&sno=488]

 

+ 키보드 5.5만 ㄷㄷㄷ

[링크 : https://shop.imuz.com/board/view.php?&bdId=ascenter&sno=4]

 

윈도우 잠겨있어서 배터리 몇 % 인지 확인을 못한다 -_ㅠ

2시간 충전했는데 1/4도 충전 안된 듯..

 

+

35.9만원이었던 녀석!

[링크 : https://namu.wiki/w/아이뮤즈%20스톰북%20시리즈#s-3.1.2]

'개소리 왈왈 > 컴퓨터' 카테고리의 다른 글

컴퓨터 득템?  (0) 2020.10.14
어쩌다 보니 득템?  (0) 2020.10.11
G840에 이어 G860..  (0) 2020.09.22
다이소 유선 마우스 뽑기 실패인가..  (6) 2020.09.14
지름신님 조합(?)  (0) 2020.09.10
Posted by 구차니
이론 관련/전기 전자2020. 10. 5. 18:24

그러니까 얘를 줄일수 있는거야 없는거야?

있으면 어떻게 판단해야 하는거야? ㅠㅠ

 

[링크 : http://www.rfdh.com/bas_rf/begin/harmonic.htm]

[링크 : https://www.researchgate.net/post/How_can_I_filter_out_the_harmonics_and_sideband]

[링크 : https://kr.mathworks.com/matlabcentral/answers/407416-how-to-remove-particular-harmonic-in-the-time-series]

'이론 관련 > 전기 전자' 카테고리의 다른 글

emc2301 fan controller  (0) 2021.06.11
dBFS  (0) 2021.01.29
Audio Induction Loop  (0) 2020.09.21
quadrature sampling(I/Q signal)  (0) 2020.09.06
가변저항과 전압  (2) 2020.03.09
Posted by 구차니
Linux/Ubuntu2020. 10. 5. 17:14

흐으으으음... 

별 신기한 패키지가 다 있네?

$ jaaa

Jaaa-0.8.4

  (C) 2004-2010 Fons Adriaensen  <fons@kokkinizita.net>

Options:
  -h                 Display this text
  -name <name>       Jack and X11 name
  -J                 Use JACK, with options:
    -s <server>        Select Jack server
  -A                 Use ALSA, with options:
    -d <device>        Alsa device [hw:0]
    -C <device>        Capture device
    -P <device>        Playback device
    -r <rate>          Sample frequency [48000]
    -p <period>        Period size [1024]
    -n <nfrags>        Number of fragments [2]

  Either -J or -A is required.

 

실행은 아래 옵션으로 했음.

$ jaaa -A -d hw:0
playback :
  nchan  : 2
  fsamp  : 48000
  fsize  : 1024
  nfrag  : 2
  format : S32_LE
capture  :
  nchan  : 2
  fsamp  : 48000
  fsize  : 1024
  nfrag  : 2
  format : S32_LE
synced
Connected to ALSA with 2 inputs and 2 outputs
Can't create ALSA thread with RT priority
Warning: memory lock failed.

 

[링크 : http://manpages.ubuntu.com/manpages/xenial/man1/jaaa.1.html]

 

 

+

부랴부랴 audacity 설치하고 생성에서 1kHz 짜리 파형을 생성! 확대해서 보니 음.. 이쁜 정현파군?

 

노트북에 이어폰 꼽고, 마이크에 가져다 대고 jaaa를 실행하니

1k에 피크가 뜨긴 한데.. 이걸 어떻게 프로그램적으로 검사하지?

그리고 저 망할(?) 2k에는 왜 뜨는거야.. FFT 한계인가 문제인가? ㅠㅠ

'Linux > Ubuntu' 카테고리의 다른 글

/dev/ipmi를 보고 싶다!!!  (0) 2020.11.07
우분투에서 부팅 USB 만들기(iso)  (0) 2020.10.06
ipmitool  (0) 2020.09.24
rsync with ssh  (0) 2020.09.23
ubuntu 18.04 계산기 키가 작동하지 않을때  (0) 2020.09.22
Posted by 구차니
Programming/c# & winform2020. 10. 5. 15:05

발단은.. 여기 이녀석.

string? item;

이게 무언가 했는데... string* item; 처럼 보려고 하니 보이기도 하고?

 

string manyLines=@"This is line one
This is line two
Here is line three
The penultimate line is line four
This is the final, fifth line.";

using (var reader = new StringReader(manyLines))
{
    string? item;
    do {
        item = reader.ReadLine();
        Console.WriteLine(item);
    } while(item != null);
}

[링크 : https://docs.microsoft.com/ko-kr/dotnet/csharp/language-reference/keywords/using-statement]

 

 

변수가 Nullable<T> 형으로 컴파일러에게 알려주는 역할(?) 라는데..

 

class Program
{
    static void Main(string[] args)
    {
        Int32? x;
        Nullable<Int32> y;
    }
}

[링크 : https://gunnarpeipman.com/csharp-question-marks/]

 

 

 

읽어봐도 무슨 소리인지 모르겠네 ㅠㅠ

형식은 값을 할당 하거나 할당할 수 있는 경우 null을 허용 하는 것으로 간주 됩니다 null . 즉, 형식에 값이 없음을 의미 합니다. 기본적으로와 같은 모든 참조 형식은 nullable 이지만 String 와 같은 모든 값 형식은 Int32 이 아닙니다.

C # 및 Visual Basic에서는 값 형식 다음에 표기법을 사용 하 여 값 형식을 nullable로 표시 합니다 ? . 예를 들어 int? c #에서 또는 Integer? Visual Basic는 할당할 수 있는 정수 값 형식을 선언 null 합니다.

Nullable<T>참조 형식은 의도적으로 null을 허용 하므로 구조체는 값 형식만 nullable 형식으로 사용 하도록 지원 합니다.

Nullable클래스는 구조체를 보완 하도록 지원 합니다 Nullable<T> . Nullable클래스는 nullable 형식의 내부 형식 및 내부 값 형식이 제네릭 비교 및 같음 연산을 지원 하지 않는 nullable 형식 쌍에 대 한 비교 및 같음 연산을 지원 합니다.

[링크 : https://docs.microsoft.com/ko-kr/dotnet/api/system.nullable-1?view=netcore-3.1]

 

 

한글로 봐도 모르는데 영어로 본다고 알리가 있냐!!! ㅠㅠ

A type is said to be nullable if it can be assigned a value or can be assigned null, which means the type has no value whatsoever. By default, all reference types, such as String, are nullable, but all value types, such as Int32, are not.

In C# and Visual Basic, you mark a value type as nullable by using the ? notation after the value type. For example, int? in C# or Integer? in Visual Basic declares an integer value type that can be assigned null.

The Nullable class provides complementary support for the Nullable<T> structure. The Nullable class supports obtaining the underlying type of a nullable type, and comparison and equality operations on pairs of nullable types whose underlying value type does not support generic comparison and equality operations.

[링크 : https://docs.microsoft.com/en-us/dotnet/api/system.nullable?view=netcore-3.1]

 

 

현재까지 결론

string은 NULL이 의미를 지니는 타입이기에 ?를 써서 Nullable class를 사용할 수 있는데

string? item;

은 그냥 nullable string 변수를 선언했다고 보면된다.

 

 

+

정작 빌드해보면 string? 으로 하면 경고가 뜨고 string으로 하면 경고가 안뜨는데 실행결과는 동일하다.

 

Microsoft (R) Visual C# Compiler version 3.6.0-4.20224.5 (ec77c100)
Copyright (C) Microsoft Corporation. All rights reserved.

using.cs(18,11): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

 

먼가 너무 파고들어서 산으로 가는건가? ㅠㅠ

변수 이름 뒤에 null 허용 연산자 !를 사용하여 이 동작을 재정의할 수 있습니다. 예를 들어 name 변수가 null이 아닌 것으로 알고 있는데 컴파일러 경고가 발생하는 경우 다음 코드를 작성하여 컴파일러 분석을 재정의할 수 있습니다.

name!.Length;

[링크 : https://docs.microsoft.com/ko-kr/dotnet/csharp/nullable-references]

'Programming > c# & winform' 카테고리의 다른 글

c# delagate 대리자  (0) 2020.10.08
c# out  (0) 2020.10.07
c# using 키워드, 예외처리  (0) 2020.10.05
c# @문자열  (0) 2020.10.05
winform socket  (0) 2020.09.29
Posted by 구차니