반응형
반응형

SQL Server 2008, SQL Server 2012

 

문자(VARCHAR)를 숫자형식(타입)으로 변경하는 방법을 소개한다.

numeric decimal 타입은 소수점 이하 값을 반올림한다.

int, float 타입 보다는 numeric decimal 타입을 사용할 것을 권장하며 그 중에서도

decimal 타입을 사용할 것을 권장 한다고 한다.

 

<숫자형>

int : 정수

float : 부동소수점

numeric : 실수

decimal : 실수 (numeric 동일)

 

numeric( [전체길이(소수점이하포함)], [소수점이하길이] )

decimal( [전체길이(소수점이하포함), [소수점이하길이] )

 

문자 -> 숫자 변환

CONVERT( [숫자형], [] )

 

SELECT CONVERT(int, '12')
           , CONVERT(float, '12.54321')
           , CONVERT(numeric, '12.54321')
           , CONVERT(numeric(6,4), '12.54321')
           , CONVERT(decimal(6,4), '12.54321')

--결과 1 : 12
--결과 2 : 12.54321
--결과 3 : 13
--결과 4 : 12.5432
--결과 5 : 12.5432
반응형
반응형

https://docs.python.org/ko/3/library/turtle.html

 

turtle — Turtle graphics

Source code: Lib/turtle.py Introduction: Turtle graphics is an implementation of the popular geometric drawing tools introduced in Logo, developed by Wally Feurzeig, Seymour Papert and Cynthia Solo...

docs.python.org

turtle — 터틀 그래픽

소스 코드: Lib/turtle.py


소개

Turtle graphics is an implementation of the popular geometric drawing tools introduced in Logo, developed by Wally Feurzeig, Seymour Papert and Cynthia Solomon in 1967.

Turtle star

turtle은 간단한 움직임을 반복하는 프로그램을 사용하여 복잡한 모양을 그릴 수 있습니다.

In Python, turtle graphics provides a representation of a physical “turtle” (a little robot with a pen) that draws on a sheet of paper on the floor.

It’s an effective and well-proven way for learners to encounter programming concepts and interaction with software, as it provides instant, visible feedback. It also provides convenient access to graphical output in general.

Turtle drawing was originally created as an educational tool, to be used by teachers in the classroom. For the programmer who needs to produce some graphical output it can be a way to do that without the overhead of introducing more complex or external libraries into their work.

Tutorial

New users should start here. In this tutorial we’ll explore some of the basics of turtle drawing.

Starting a turtle environment

In a Python shell, import all the objects of the turtle module:

from turtle import *

If you run into a No module named '_tkinter' error, you’ll have to install the Tk interface package on your system.

Basic drawing

Send the turtle forward 100 steps:

forward(100)

You should see (most likely, in a new window on your display) a line drawn by the turtle, heading East. Change the direction of the turtle, so that it turns 120 degrees left (anti-clockwise):

left(120)

Let’s continue by drawing a triangle:

forward(100)
left(120)
forward(100)

Notice how the turtle, represented by an arrow, points in different directions as you steer it.

Experiment with those commands, and also with backward() and right().

펜 제어

Try changing the color - for example, color('blue') - and width of the line - for example, width(3) - and then drawing again.

You can also move the turtle around without drawing, by lifting up the pen: up() before moving. To start drawing again, use down().

The turtle’s position

Send your turtle back to its starting-point (useful if it has disappeared off-screen):

home()

The home position is at the center of the turtle’s screen. If you ever need to know them, get the turtle’s x-y co-ordinates with:

pos()

Home is at (0, 0).

And after a while, it will probably help to clear the window so we can start anew:

clearscreen()

Making algorithmic patterns

Using loops, it’s possible to build up geometric patterns:

for steps in range(100):
    for c in ('blue', 'red', 'green'):
        color(c)
        forward(steps)
        right(30)

- which of course, are limited only by the imagination!

Let’s draw the star shape at the top of this page. We want red lines, filled in with yellow:

color('red')
fillcolor('yellow')

Just as up() and down() determine whether lines will be drawn, filling can be turned on and off:

begin_fill()

Next we’ll create a loop:

while True:
    forward(200)
    left(170)
    if abs(pos()) < 1:
        break

abs(pos()) < 1 is a good way to know when the turtle is back at its home position.

Finally, complete the filling:

end_fill()

(Note that filling only actually takes place when you give the end_fill() command.)

How to…

This section covers some typical turtle use-cases and approaches.

Get started as quickly as possible

One of the joys of turtle graphics is the immediate, visual feedback that’s available from simple commands - it’s an excellent way to introduce children to programming ideas, with a minimum of overhead (not just children, of course).

The turtle module makes this possible by exposing all its basic functionality as functions, available with from turtle import *. The turtle graphics tutorial covers this approach.

It’s worth noting that many of the turtle commands also have even more terse equivalents, such as fd() for forward(). These are especially useful when working with learners for whom typing is not a skill.

You’ll need to have the Tk interface package installed on your system for turtle graphics to work. Be warned that this is not always straightforward, so check this in advance if you’re planning to use turtle graphics with a learner.

Use the turtle module nam

반응형
반응형

Emoji 이모지 : 나무늘보 🦥, 거북이 🐢

 

https://www.emojiall.com/ko

반응형
반응형

Paint it Black(1966, 한글자막) / Rolling Stones  머나먼정글

 

https://www.youtube.com/watch?v=BCWcA6630Ag

 

https://youtu.be/VKJ1_TPib9g?si=jTb_dG-KapFk-WiF

 

반응형
반응형

자연은 남겨야 할 것과
남기면 안 되는 것을 구분합니다.
지워야 할 것과 지우지 않아야 할 것,
그 지혜를 계절은 분명히 가르칩니다. 그러나
인간은 필요 없이 남기는 게 많습니다. 많은 축적,
무분별한 미련이 오늘날 모든 모순과 불화의 원인이 아닌지.
우리가 가는 길은 진정한 제자리로 돌아오기 위한 길입니다.
가야 할 때를 알고 간다는 것은 가난한 심령을 말합니다.
뒷모습이 맑은 사람은 그 영혼이 환할 것입니다.
이 지상을 떠날 때 나도 아름다운 뒷모습을
보여줄 수 있을까요.


- 김수우, 윤석정의 《백년어》 중에서 -


* 꽃은 자신을 떨구어
말끔히 지워냄으로써 열매를 잉태합니다.
매미와 뱀은 허물을 벗고 새 몸을 얻습니다.
버리는 것과 얻는 것은 모두 자연의 섭리입니다.
버려야 얻습니다. 이를 거스르는 것이 역리(逆理)이고
이를 따르는 것이 순리(順理)입니다. 순리를 따르는
삶을 산 뒤에 맑고 아름다운 뒷모습을 남기고
가는 인생이 진정한 승리자입니다.
위대한 승리자입니다.

반응형

'아침편지' 카테고리의 다른 글

유목민 아이들의 기마놀이  (0) 2023.11.13
낮은 자세와 겸손을 배우라  (0) 2023.11.10
청년은 '허리'다  (0) 2023.11.08
'그림책'을 권합니다  (0) 2023.11.07
아이에게 '최고의 의사'는 누구일까  (0) 2023.11.06
반응형

 

 

https://www.bikeseoul.com/
https://www.bikeseoul.com:457/main.do

 

서울자전거 따릉이 - 대여소 위치확인

창닫기 자전거 추가배치 요청

www.bikeseoul.com:457

https://www.bikeseoul.com/app/station/moveStationRealtimeStatus.do

 

서울자전거 따릉이 - 무인대여시스템

창닫기 즐겨찾기 등록취소 즐겨찾기 등록 자전거 추가배치 요청

www.bikeseoul.com

 

반응형

+ Recent posts