본문 바로가기

전체 글297

node net.connect를 이용하여 Blocking TCP Socket Message Send, Receive 테스트 진행 nest.js 가 클라이언트인 상황으로 , TCP Socket을 Listening을 하고 있는 서버에 메시지 전송 예제 입니다.  1. nestjs Client class 작성 진행import { Logger } from "@nestjs/common";export class TcpClient { static logger = new Logger(TcpClient.name); static net = require('net'); static initTcpConnection() { const client = new this.net.Socket(); let result; client.connect(35000 , 'localhost' , (data : stri.. 2024. 10. 9.
SHA256 암호화 알고리즘으로 Text 암호화 예제 (1) 암호화 역할 함수를 작성 하였습니다.//test.encrypt.helper.tsexport class TestEncryptHelper { static async encrypt(password: string): Promise { const { createHash } = require('crypto'); return createHash('sha256').update(`${password}[SaltValue]`).digest('hex'); }} (2) 단위 테스트를 진행해보기 위하여 작성 하였습니다.//test.encrypt.helper.spec.tsimport { TestEncryptHelper } from './test.encrypt.helper' describe('encryptTes.. 2024. 9. 30.
[Ubuntu 20.04] SQL Server Express 설치 진행 및 BAK File Recovery 테스트 진행 출처 : https://learn.microsoft.com/ko-kr/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-ver16&tabs=ubuntu2004 Ubuntu: SQL Server on Linux 설치 - SQL Server이 빠른 시작에서는 Ubuntu에 SQL Server 2017 이상 버전을 설치한 다음, sqlcmd를 사용하여 데이터베이스를 만들고 쿼리하는 방법을 보여 줍니다.learn.microsoft.com 체감은 Windows 에 설치한 버젼 보다 성능이 더 빠른거 같습니다 -0-; 1. 공용 리포지토리 GPG 키를 가져옵니다. $ curl https://packages.microsoft.com/keys/microsoft... 2024. 9. 24.
[WPF] Enum Type 을 ComboBox에 ItemSource로 바인딩 예제 (1). ComboBox에 정의할 Enum을 바인딩 합니다. public enum FaxTransMethodType { [Description("즉시 전송")] Immediately, [Description("예약 전송")] Reservation } (2). Converter를 작성 합니다.using GmSFaxAgentWpf.RestApis;using System;using System.Collections.Generic;using System.ComponentModel;using System.Globalization;using System.Reflection;using System.Windows.Data;namespace GmSFaxA.. 2024. 9. 16.
[JAVA] java.lang.reflect.Field 이용한 ValueObject -> JSONObject 변환 예제 입니다. [JAVA] java.lang.reflect.Field 이용한 ValueObject -> JSONObject 변환 예제 입니다. public JSONObject convertVO(Object vo) throws JSONException { JSONObject jsonObject = new JSONObject(); try { String rowData = "{"; for(Field field : vo.getClass().getDeclaredFields()) { field.setAccessible(true); String value = String.valueOf(field.. 2024. 9. 3.
[C#] Interop 한 Excel API 가 정상적으로 종료 되지 않을 때 처리 방안 [C#] Interop 한 Excel API 가 정상적으로 종료 되지 않을 때 처리 방안 WorkBook , WorkBooks 에 대하여 Close 메서드를 호출 하고ExcelApp를 Quit 메서드를 호출 , Marshal.FinalReleaseComObject 를 호출 하여도 EXCEL.exe가 종료되지 않았습니다 . 도저히 방법이 없어 , GetWindowThreadProcessId WinAPI를 이용하여 PID를 획득한 후 Process를 Kill 처리 하였습니다. [DllImport("user32.dll")]public static extern Int32 GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);IntPtr ptr = new .. 2024. 9. 3.
[Windows PowerShell] yarn start 명령어 실행 시에 보안 오류 해결 방안 yarn start 명령어 호출 시에 아래와 같은 오류가 발생 하였습니다.  관리자 권한이 아닌 사용자 영역에 대한 실행 정책 변경 시에 아래 명령어로 설정 한 후yarn start 명령어 실행 시에 정상적으로 시작 되는 것을 확인 하였습니다.PS D:\project\react\shopping_app\client> Set-ExecutionPolicy -Scope CurrentUser 2024. 8. 29.
[C#] Singletone Instance 생성을 이용한 Log File Write 처리 예제 입니다. [C#] Singletone Instance 생성을 이용한 Log File Write 처리 예제 입니다.using System;using System.Collections.Generic;using System.Diagnostics;using System.IO;using System.Linq;using System.Reflection;using System.Text;using System.Threading.Tasks; namespace GmSFaxAgentWpf.Commons{    public class CommonUtils    {        private static readonly Lazy commonUtils = new Lazy(() => new CommonUtils());        priv.. 2024. 8. 5.
[C++/WinRt] Windows Toolkit - Windows.Data.Pdf 를 이용한 PDF To Bitmap 변환 예제 [C++/WinRt] Windows Toolkit - Windows.Data.Pdf 를 이용한 PDF To Bitmap 변환 예제 입니다. Argument로 PDF 파일을 읽어들어 PDF 페이지별로 Bmp 파일로 Save하는 예제 입니다. #include "pch.h"#include using namespace winrt;using namespace Windows::Foundation;using namespace winrt::Windows::Storage;using namespace Windows::Data::Pdf;/*** [0]. id* [1]. source file fullpath * [2]. bmp files save path * * return value * 결과|PageCount|DESC* *.. 2024. 7. 29.