일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 파이썬
- matplotlib
- Mac
- math
- Google Spreadsheet
- Redshift
- django
- string
- Apache
- hive
- Google Excel
- list
- dataframe
- SQL
- c#
- google apps script
- gas
- numpy
- PANDAS
- PySpark
- Kotlin
- Python
- Github
- Tkinter
- Java
- array
- PostgreSQL
- Excel
- GIT
- Today
- Total
목록C# (91)
달나라 노트
아래 코드를 봅시다. using System; class Sample2 { public static void Main() { int x = 1; Console.WriteLine(x); Functions f = new Functions(); f.change_number(x); Console.WriteLine(x); } } class Functions { public void change_number(int x) { x = x + 10; } } -- Result 1 1 int x = 1; Console.WriteLine(x); Main 내부에서 x 변수에 1이라는 값을 할당하고 있습니다. 그리고 x 값을 출력합니다. 여기선 당연히 1이 출력될겁니다. class Functions { public void ch..

C#에서도 Lambda 식을 지원합니다. Lambda식은 무명 함수(Anonymous Function)라고도 하는데 말 그대로 이름이 없는 함수라는 의미입니다. 이에 대해 좀 더 살펴봅시다. int multiply(int x, int y) { return x * y; } 보통 C#에서 함수를 선언할 땐 위처럼 선언합니다. 위 함수는 2개의 인자를 받아 이 2개의 안자를 곱한 값을 return해주는 함수입니다. - int multiply(int x, int y) 위 부분에서 int는 함수가 return하는 값의 data type입니다. multiply는 제가 정한 함수의 이름입니다. 괄호 안에 (int x, int y)는 함수가 받는 parameter와 parameter의 data type을 의미합니다. ..

DrawImage method는 이미지를 가져와서 그려줍니다. Syntax DrawImage(Image, x, y, width, height) - Image System.Drawing.Image 객체입니다. - x, y 이미지가 그려질 x, y 좌표입니다. 이미지를 감싸는 사각형을 만들고 그 사각형의 왼쪽 위 꼭지점이 기준점이 됩니다. - width, height 이미지를 감싸는 사각형의 가로 길이, 세로 길이를 의미합니다. 예시에서는 위 이미지를 사용합니다. using System; using System.Windows.Forms; using System.Drawing; class Sample2 { public static void Main() { Form fm = new Form(); fm.Clien..

MouseMove Event는 마우스가 움직일 때 발생하는 Event입니다. 보통 이런 Event는 실시간으로 마우스의 위치를 파악해야할 때 유용합니다. 아래 코드를 봅시다. using System; using System.Windows.Forms; using System.Drawing; class Sample2 { public static void Main() { Form fm = new Form(); fm.ClientSize = new Size(300, 250); Label lbl = new Label(); lbl.Parent = fm; lbl.Width = 200; lbl.Height = 30; void mouse_realtime_location(object sender, MouseEventArgs..