VSCode 내 터미널에서 현재 설치되어있는 vue 버전을 확인해보려는데 아래와 같이 에러가 남.
검색해보니 윈도우즈 운영체제의 실행규칙 때문이다. Windows PowerShell을 열어서 아래와 같이 해결했다.
VSCode 내 터미널에서 현재 설치되어있는 vue 버전을 확인해보려는데 아래와 같이 에러가 남.
검색해보니 윈도우즈 운영체제의 실행규칙 때문이다. Windows PowerShell을 열어서 아래와 같이 해결했다.
최근 넘겨받게 된 프로젝트에서 jar 파일 하나로 macOS와 Windows 환경에 설치 패키지를 만들어야하는 상황이다. Windows는 늘상 해오던 환경이라 아무 문제 없이 설치 패키지를 만들었다. 하지만 macOS 환경에서 소스와 함께 넘겨받은 PackageManager가 32bit app이어서 패키징툴 설치 자체가 불가능한 상황 ㅠㅜ
homebrew나 jpackage, pkgbuild 등의 툴과 며칠을 씨름하다가 GUI 기반의 간편한 툴로 설치 패키지 패키징 완료.
.app으로 끝나는 앱을 생성한 후 패키징을 하는 것이 아니라 Raw Package 즉, 말 그대로 "A Raw Package project lets you install files at specific locations."인 패키징이 필요했던 것. 아래 링크에서 Packages.dmg를 다운로드하여 설치 후 패키징하면 끝.
macOS Ventura 13.4.1에서 정상적으로 작업 완료.
http://s.sudre.free.fr/Software/Packages/about.html
WhiteBox - Packages
What is Packages? You are a software developer who just completed a project and it's time to work on shipping it. Or you are an administrator and you need to deploy a plugin on the Mac computers of your network. Whenever you need to create an installation
s.sudre.free.fr
1. async 키워드로 수식된 메서드는 비동기 메서드가 된다.
2. 비동기 메서드 내에서는 적어도 하나의 await 키워드가 있어야한다.
3. async 키워드로 수식된 비동기 메서드가 아니라면 await 키워드를 사용할 수 없다.
4. 이벤드 핸들러가 아닌 비동기 메서드를 만들려면 async 키워드를 지정하고 리턴형을 Task나 Task<TResult>로 지정한다.
private long DoSomething() { var sw = Stopwatch.StartNew(); Thread.Sleep(8000); sw.Stop(); return sw.ElapsedMilliseconds; } private async void btnExecute1_Click(object sender, EventArgs e) { toolStripStatusLabel1.Text = ""; var elapsed = await Task.Run(() => DoSomething()); toolStripStatusLabel1.Text = "완료 : " + elapsed.ToString(); } private async Task<long> DoSomethingAsync() { var sw = Stopwatch.StartNew(); await Task.Delay(1000); sw.Stop(); return sw.ElapsedMilliseconds; } private async void btnExecute2_Click(object sender, EventArgs e) { toolStripStatusLabel2.Text = ""; var elapsed = await DoSomethingAsync(); toolStripStatusLabel2.Text = "완료 : " + elapsed.ToString(); }
var eggsTask = FryEggsAsync(20); var baconTask = FryBaconAsync(3); var toastTask = MakeToastWithButterAndJamAsync(2); var breakfastTasks = new List<Task> { eggsTask, baconTask, toastTask }; while (breakfastTasks.Count > 0) { Task finishedTask = await Task.WhenAny(breakfastTasks); if (finishedTask == eggsTask) { Console.WriteLine("eggs are ready"); } else if (finishedTask == baconTask) { Console.WriteLine("bacon is ready"); } else if (finishedTask == toastTask) { Console.WriteLine("toast is ready"); } breakfastTasks.Remove(finishedTask); }
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System.Reflection;
using System.Web;
using System.Web.Routing;
namespace WebApplication1.Tests
{
[TestClass]
public class RouteTests
{
private HttpContextBase CreateHttpContext(String targetUrl = null, string httpMethod = "GET")
{
// Mock request 객체를 생성한다.
Mock<HttpRequestBase> mockRequest = new Mock<HttpRequestBase>();
mockRequest.Setup(m => m.AppRelativeCurrentExecutionFilePath).Returns(targetUrl);
mockRequest.Setup(m => m.HttpMethod).Returns(httpMethod);
// Mock response를 생성한다.
Mock<HttpResponseBase> mockResponse = new Mock<HttpResponseBase>();
mockResponse.Setup(m => m.ApplyAppPathModifier(It.IsAny<String>())).Returns<string>(s => s);
// request 개체와 reponse 개체를 사용하는 mock 컨텍스트 개체를 생성한다.
Mock<HttpContextBase> mockContext = new Mock<HttpContextBase>();
mockContext.Setup(m => m.Request).Returns(mockRequest.Object);
mockContext.Setup(m => m.Response).Returns(mockResponse.Object);
return mockContext.Object;
}
private void TestRouteMatch(string url, string controller, string action, object routeProperties = null, string httpMethod = "GET")
{
//Arrange
RouteCollection routes = new RouteCollection();
RouteConfig.RegisterRoutes(routes);
// Act - 라우트를 처리한다.
RouteData result = routes.GetRouteData(CreateHttpContext(url, httpMethod));
// Assert
Assert.IsNotNull(result);
Assert.IsTrue(TestIncomingRouteResult(result, controller, action, routeProperties));
}
private bool TestIncomingRouteResult(RouteData routeResult, string controller, string action, object propertySet = null)
{
Func<object, object, bool> valCompare = (v1, v2) =>
{
return StringComparer.InvariantCultureIgnoreCase.Compare(v1, v2) == 0;
};
bool result = valCompare(routeResult.Values["controller"], controller) && valCompare(routeResult.Values["action"], action);
if(propertySet != null)
{
PropertyInfo[] propInfo = propertySet.GetType().GetProperties();
foreach(PropertyInfo pi in propInfo)
{
if(!(routeResult.Values.ContainsKey(pi.Name)
&& valCompare(routeResult.Values[pi.Name],
pi.GetValue(propertySet, null))))
{
result = false;
break;
}
}
}
return result;
}
private void TestRouteFail(string url)
{
// Arrange
RouteCollection routes = new RouteCollection();
RouteConfig.RegisterRoutes(routes);
// Act
RouteData result = routes.GetRouteData(CreateHttpContext(url));
// Assert
Assert.IsTrue(result == null || result.Route == null);
}
[TestMethod]
public void TestIncomingRoutes()
{
// 성공 라우트
TestRouteMatch("~/Admin/Index", "Admin", "Index");
TestRouteMatch("~/One/Two", "One", "Two");
TestRouteMatch("~/Admin", "Admin", "Index");
TestRouteMatch("~/Admin/Index/Segment", "Admin", "Index");
TestRouteMatch("~/Admin/Index/1/userid/5", "Admin", "Index", new { search = "userid/5"});
// 실패 라우트
//TestRouteFail("~/");
}
}
}
-----------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace WebApplication1
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
//routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute("myRoute", "{controller}/{action}",
new { action = "Index" }
);
routes.MapRoute(null, "{controller}/{action}/{id}/{*search}",
new { controller = "Admin", action = "Index", id = UrlParameter.Optional });
}
}
}
System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace();
int FrameCnt = trace.FrameCount; for(int i =0; i<FrameCnt ; i++) {
Console.WriteLine(trace.GetFrame(i).GetMethod().DeclaringType.FullName + "." + trace.GetFrame(i).GetMethod().Name);
}
LDAP(Lightweighted Directory Access Protocol)
경량 디렉터리 액세스 프로토콜(LDAP)은 TCP/IP 위에서 디렉터리 서비스를 조회하고 수정하는 응용 프로토콜이다.
디렉터리는 논리, 계급 방식 속에서 조직화된, 비슷한 특성을 가진 객체들의 모임이다. 가장 일반적인 예로는 전화 번호부(telephone directory)가 있는데 가나다 순의 일련의 이름을 가지고 있고, 이름마다 전화 번호와 주소가 포함되어 있다. 이러한 기본 설계 때문에 LDAP는 인증을 위한 다른 서비스에 의해 자주 사용된다.
LDAP 디렉터리 트리는 선택된 모델에 따라 다양한 정치적, 지질학적, 조직적 경계를 반영하기도 한다. 오늘날 LDAP의 배치는 최상위 수준의 계급을 구조화하기 위해 도메인 이름 서비스의 이름을 사용하는 경향이 있다. 디렉터리 안에 들어가면 들어갈수록 사람들, 조직, 프린터, 문서, 그룹 등을 대표하는 항목들이 나타난다.
쉽게 얘기하자면 LDAP은 인증서버 역할을 한다. 관련 예제 링크는 아래를 클릭...
http://www.youcanlearnseries.com/Programming%20Tips/CSharp/WhatisLDAP.aspx
로버트 C. 마틴은 의존성 전도의 원칙(Dependency Inversion Principle)을 다음과 같이 정의하고 있다.
다시 말하자면, 작성 중인 클래스와 의존 클래스를 격리시켜 의존 클래스에 대한 직접적인 참조 대신 추상 클래스나 인터페이스에 대한 참조로 변경하는 것을 의미한다.
Fixing bugs and adding new features is a part of developing software applications. From my experience, sending application updates to users is also a critical part of developing applications, especially when the user has no advanced knowledge of computers. In the Internet era today, the software developer must make application deployment and updating easier and often makes automatic application updates to do this.I already searched through the internet on this topic, but not much seems suited to my needs. So, I tried to create one myself. This sample application is developed in C# as a library with the project name “AutoUpdater”. The DLL “AutoUpdater” can be used in a C# Windows application(WinForm and WPF).
1,Easy to implement and use.
2,Application automatic re-run after checking update.
3,Update process transparent to the user .
4,To avoid blocking the main thread using multi-threaded download.
5,Ability to upgrade the system and also the auto update program.
6,A code that doesn't need change when used by different systems and could be compiled in a library.
7,Easy for user to download the update files.