반응형
반응형

Python 3 Cheat Sheet

https://perso.limsi.fr/pointal/_media/python:cours:mementopython3-english.pdf

반응형
반응형

Cheat-Sheets.org - 프로그램 커닝페이퍼

 

https://www.cheat-sheets.org/

 

Cheat-Sheets.org

All cheat sheets, round-ups, quick reference cards, quick reference guides and quick reference sheets in one page.

www.cheat-sheets.org

  python 3 cheat Sheet : https://perso.limsi.fr/pointal/_media/python:cours:mementopython3-english.pdf

https://overapi.com/python

 

Python Cheat Sheet | OverAPI.com

 

overapi.com

 

https://www.cheat-sheets.org/#Python

 

Cheat-Sheets.org

All cheat sheets, round-ups, quick reference cards, quick reference guides and quick reference sheets in one page.

www.cheat-sheets.org

반응형
반응형

완전한 솔직함

실리콘밸리의 피드백 문화와 관련된 책을 내서 큰 성공을 거둔 사람이 있어요. 우리나라에는 '실리콘밸리의 팀장들'이라는 제목으로 번역된 책을 쓴 '킴 스콧'이에요. 킴 스콧은 구글, 애플 등 에서 일한 경험으로 원제목인 '완전한 솔직함(Radical Candor)’이라는 책을 냈고 이 내용이 실리콘밸리 뿐 아니라 많은 곳에서 공감을 얻었어요. 

직장상사의 4가지 유형
킴 스콧은 특히 상사(Boss)의 입장에서 직원들을 어떻게 대해야 하는지에 대해 다뤘어요. 그는 개인적 관심(Care Personally)을 y축에, 직접적 대립(Challenge Directly)을 x축에 두고 사분면을 그렸어요. 개인적 관심이란 개인사를 공유한다는 것이 아니라 인간적으로 상대(부하직원)를 대한다는 것을 뜻해요. 직접적 대립은 충돌한다는 것이 아니라 어떤 문제에 대해서 회피하지 않고 정면 돌파 한다는 뜻이에요. 이 두 가지를 축으로 그는 상사를 크게 크게 4가지 유형으로 나눴어요. 

1) 불쾌한 공격 유형 🤬
상대를 인간적으로 대하지 않으면서 솔직하게 피드백을 하는 사람들. 직원의 감정같은 것은 신경쓰지 않는 상사. 우리가 상상하는 전형적인 '꼰대'와 '갑질 상사'가 대표적이에요. 

2) 파괴적 공감 유형 🤫
상대를 인간적으로는 존중하지만 솔직하지 않은 피드백을 하는 사람들. 착한 상사 콤플렉스라고 할까요? 좋은 사람이긴 하지만 상대의 성장을 만들지 못하기 때문에 직원에게도, 조직에도 파괴적인 결과를 만드는 성격이에요. 

3) 고의적 거짓 유형 🤨
인간적으로 대하지도 않고 솔직하지도 않은 사람. 겉으로는 하하호호 웃다가 뒤에서는 칼을 꽂는 상사가 되는거죠. 어떤 사람들에게는 파괴적 공감보다 나쁜 상사일수도 있어요! 

4) 완전한 솔직함 유형 😼
킴 스콧은 인간적으로 상대를 대하면서도 솔직하게 피드백을 하는 '완전한 솔직함(Radical Candor)’을 갖춘 사람이 가장 이상적인 상사라고 주장해요. 부하직원을 걱정하는 마음. 상대의 성장을 바라는 마음으로 솔직하게 피드백을 하면 상대도 그 뜻을 알아주고, 조직의 발전도 만들 수 있다는 거죠. 그가 다닌 실리콘밸리의 기업들은 이런 문화를 갖고 장려하고 있었다고 해요. 


한국에서 가능할까 
이런 '완전한 솔직함'에 공감하시는 분들이 많을 거에요. 특히, 리더의 입장에서 직원들에게 피드백을 해야하는 입장에 계시다면요. 하지만 '한국사회에서 이런 솔직함이 가능할까'라면서 회의적으로 생각하시는 분들도 많을 것 같아요.
우리나라의 경우 기업문화가 달라지면서 상사가 아랫사람에게 솔직한 피드백을 하는 것은 점점 어려워지고 있어요. (고의적 거짓과 피괴적 공감이 많아진다는 것이죠!) 반대로 아랫사람이 솔직한 피드백을 상사에게 하는 것도 여전히 쉽지 않은 상황이에요. 나이와 직책을 따지는 한국문화에서는 상사에게 반대의견을 내기가 어려워요. 그러면 비교적 젊고, 수평적인 관계인 스타트업이라고 쉬울까요? 많은 스타트업에도 소위 '젊은 꼰대'들이 있다고 해요. 

'쎈 언니' 캐릭터는 조직에서 손해?
피드백은 본질적으로 인간관계를 바탕으로 하고 있어요. 개인적인 감정뿐 아니라 사회적인 위치도 영향을 끼친다는 거에요. 스콧 킴도 여성이나 소수인종이 '솔직한 상사'가 되었을 때 조직 내에서 받을 수 있는 불이익이 있다고 설명하고 있어요. 직장에서 일하는 사람들이 모두 백인남성들이라면 서로 솔직하게 대해도 별 상관이 없다는 거죠. 하지만 흑인 여성이 이렇게 솔직한 상사가 되면 조직 내에서 그는 오히려 '악명'을 얻을 수도 있다는 거에요. 🥶

피드백은 누구에게나 힘든 일
'솔직한 피드백'에 대한 고민은 한국에서도 실리콘밸리에서도 동일하다고 생각해요. 누구든 상처를 주고 싶지 않고, 받고 싶지도 않아요. 피드백에 관한 레터를 준비하면서 두 사람의 CEO가 피드백에 대한 글을 쓴 것을 발견했어요. 두 사람의 글을 보면 수평적인 문화를 가진 미국에서도 상대에게 솔직한 피드백을 주는 것이 쉬운 일이 아니라는 것을 알 수 있어요. 


모든 피드백은 선물이다



피드백에 관한 글에서 자주 발견할 수 있는 표현이 있어요. 피드백은 선물(gift)이다. 피드백은 당근도 채찍도 아닌 그 자체로 '선물'이라는 것이에요. 피드백을 선물로 생각하면 이걸 주는 사람도 받는 사람도 다르게 보게 되요. 
받는 입장에서는 그 피드백의 내용을 떠나서 상대에게 감사해야해요. 선물이니까요. 하지만 그 선물은 내 맘에 쏙드는 것일 수도 있고 아닐수도 있죠. 그걸 받아들이는 것도 본인이 결정할 수 있어요. 어떤 선물은 평생을 함께하는 소중한 물건이 되기도 하고, 어떤 물건은 받은 그날 어딘가로 던져버리고 까맣게 잊어버릴 수도 있어요. 
주는 입장에서도 그 피드백은 선물이니까 편하게 줄 수 있어요. '내 생일선물을 싫어하지 않을까'해서 선물을 주지 않는 사람은 없죠. 하지만 일단 선물을 줘버리면 그걸 상대가 버리던 마음에 들지 않아하던 어쩔 수 없어요. 선물이니까요. 

나쁜놈(jerk)은 피드백 문화를 망친다
솔직한 문화로 유명한 넷플릭스는 4A라는 피드백 원칙을 가지고 있어요. 지난해 나온 헤이스팅스 CEO의 책 '규칙없음'에 잘 나와있는데요. 이 4A 원칙은 앞서 킴, 세스, 데보라가 얘기하는 것과 모두 상통하는고 있어요.  

Aim to Assist : 피드백은 전적으로 도움을 주는 것이어야해요. 
Actionable : 실질적인 행동으로 이어질 수 있는 피드백 이어야 해요. 
Appreciate : 피드백을 주는 사람에게 감사해야해요. 
Accept or Discard : 피드백을 받아들여도 되고 받지 않아도 되요. 

그런데 이런 솔직한 피드백 문화가 되려면 반드시 필요한 것이 있어요. 바로 넷플릭스 문화에서 가장 경계하는 '실력만 좋은 나쁜 놈(brilliant jerk)’이 조직에 없어야한다는 거죠. 사람들이 '존중'과 '의도'의 관문을 통과한 피드백만 준다면 상처받을 이유가 있을까요? 피드백의 의도가 진실한 태도로 나타난다면 오해가 발생할 일은 적을 거에요. 하지만 기본적으로 다른 사람을 존중하지 않고, 나쁜 의도를 가지고 피드백을 하는 사람이 있다면 조직 내의 선한 사람들은 상처를 받고 본인이 피드백을 하는 것을 거부할거에요. 

'실력만 좋은 나쁜 놈'은 도움을 주기보다는 상대를 괴롭히거나 자신을 상대적으로 높이기 위한 목적으로 피드백을 해요. 큰 조직이라면 사내 정치에서 승리하기 위해 부정적인 피드백을 하는 사람도 틀림없이 있을거에요. 이런 '나쁜 놈'은 조직에서 신뢰를 허물고 '솔직한 피드백'을 할 수 없는 환경을 만들어요. 그가 상사이든, 부하이든 공통적인 문제에요. 이런 사람들이 가득한 조직에서 '상처받지 않으면서 피드백 주고받기'라는 건 비현실적인 얘기일 수밖에 없어요. 😅

반응형
반응형

MSSQL 링크드서버,  linked server

 

MSSQL 은 연결된서버 기능을 제공하는데 이를 이용하면 다른 네트워크의 데이터베이스를 원격으로 접속하여

   사용할 수 있도록 해줍니다. 

-- MSSQL 연결된 서버 생성

EXEC sp_addlinkedserver
      @server = '[연결된 서버별칭]',
      @srvproduct = '',
      @provider = 'SQLOLEDB',
      @datasrc = '[서버 아이피]',
      @catalog = '[데이터 베이스명]'



-- MSSQL 연결계정 생성

EXEC sp_addlinkedsrvlogin
      @rmtsrvname= '[연결된 서버별칭]',
      @useself= 'false',
      @rmtuser = '[사용자 이름]',
      @rmtpassword = '[사용자 암호]'
      
      
-- MSSQL 연결된 서버 확인
   SELECT * FROM master.dbo.sysservers WHERE srvname = '[연결된 서버별칭]'
   

-- MSSQL 연결계정 확인
   SELECT * FROM master.sys.linked_logins WHERE remote_name = '[사용자 이름]'
   
   
-- MSSQL 연결된 서버 이용방법 
   /*연결된 서버를 등록한 후 사용하려면 [연결된 서버별칭].[데이터 베이스명].[데이터베이스 소유자명].[테이블명]
   형태로 호출하여 사용할 수 있습니다.
   SELECT 쿼리를 예로 들면 아래와 같습니다. */

 -- MSSQL 일반서버에 SELECT 쿼리시
   SELECT [컬럼명] FROM [테이블명] WHERE [조건절]

-- MSSQL 연결된 서버에 SELECT 쿼리시
   SELECT [컬럼명] FROM [연결된 서버별칭].[데이터 베이스명].[데이터베이스 소유자명].[테이블명] WHERE [조건절]

-- MSSQL 연결된 서버 삭제
  EXEC sp_dropserver
      @server = '[연결된 서버별칭]'

-- MSSQL 연결계정 삭제
   EXEC sp_droplinkedsrvlogin
      @rmtsrvname= '[연결된 서버별칭]',
      @locallogin = NULL
반응형
반응형

SQL Server 모든 테이블 크기를 조회하는 쿼리

테이블의 건수와, 테이블에 구성된 인덱스들의 합도 같이 확인할 수 있습니다.

SELECT
    OBJECT_SCHEMA_NAME(a2.object_id) AS SchemaName,
    a2.name AS TableName,
    a1.rows as [RowCount],
    CAST(ROUND(((a1.reserved + ISNULL(a4.reserved,0)) * 8) / 1024.00, 2) AS NUMERIC(36, 2)) AS ReservedSize_MB,
    CAST(ROUND(a1.data * 8 / 1024.00, 2) AS NUMERIC(36, 2)) AS DataSize_MB,
    CAST(ROUND((CASE WHEN (a1.used + ISNULL(a4.used,0)) > a1.data THEN (a1.used + ISNULL(a4.used,0)) - a1.data ELSE 0 END) * 8 / 1024.00, 2) AS NUMERIC(36, 2)) AS IndexSize_MB,
    CAST(ROUND((CASE WHEN (a1.reserved + ISNULL(a4.reserved,0)) > a1.used THEN (a1.reserved + ISNULL(a4.reserved,0)) - a1.used ELSE 0 END) * 8 / 1024.00, 2) AS NUMERIC(36, 2)) AS UnusedSize_MB
FROM
    (SELECT 
        ps.object_id,
        SUM (CASE WHEN (ps.index_id < 2) THEN row_count ELSE 0 END) AS [rows],
        SUM (ps.reserved_page_count) AS reserved,
        SUM (CASE
                WHEN (ps.index_id < 2) THEN (ps.in_row_data_page_count + ps.lob_used_page_count + ps.row_overflow_used_page_count)
                ELSE (ps.lob_used_page_count + ps.row_overflow_used_page_count)
            END
            ) AS data,
        SUM (ps.used_page_count) AS used
    FROM sys.dm_db_partition_stats ps
    GROUP BY ps.object_id) AS a1
LEFT OUTER JOIN 
    (SELECT 
        it.parent_id,
        SUM(ps.reserved_page_count) AS reserved,
        SUM(ps.used_page_count) AS used
     FROM sys.dm_db_partition_stats ps
     INNER JOIN sys.internal_tables it ON (it.object_id = ps.object_id)
     WHERE it.internal_type IN (202,204)
     GROUP BY it.parent_id) AS a4 ON (a4.parent_id = a1.object_id)
INNER JOIN sys.all_objects a2  ON ( a1.object_id = a2.object_id ) 
WHERE a2.type <> N'S' and a2.type <> N'IT'
ORDER BY ReservedSize_MB DESC
반응형
반응형

The 10 Best Data Visualizations of 2022

https://towardsdatascience.com/the-10-best-data-visualizations-of-2022-3e49d7ccb832

 

The 10 Best Data Visualizations of 2022

Awesome visualizations on the Ukraine War, Inflation, and more!

towardsdatascience.com

Last year I shared what I thought were ten of the best data visualizations from 2021. I’m back again with ten of the best data visualizations from 2022!

Similar to last year, I wanted to share a variety of types of data visualizations, and also ones that were relevant with particular events that happened this year.

Let’s dive into it!

 

Be sure to SUBSCRIBE here to never miss another article on data science guides, tricks and tips, life lessons, and more!

 

1. NATO vs Russia

 

One of the biggest events this year was the war between Russia and Ukraine. Comforting or not, the infograph above shows the difference in military power between NATO and Russia. The actual data can be found here.

I love this infograph, it’s many pictographs combined into one, it’s clean, and it’s very clear what message it’s trying to convey.

NATO out-powers Russia in every aspect other than Nuclear Weapons… I wonder how this would change if Russia’s budget towards nuclear weapons went to other things 🤔.

 

Be sure to SUBSCRIBE here to never miss another article on data science guides, tricks and tips, life lessons, and more!

 

2. Inflation and the cost of everyday items

 

One of the consequences of the war between Russia and Ukraine is inflation. If you click on the visualization above, you’ll see how inflation has impacted our cost of every day items, like gas, coffee, and corn. (On the bright side, the cost of orange juice went down!)

If you’re interested, this type of data visualization is similar to a bar chart race, which is a dynamic bar chart shown over a period of time. If you want to build one yourself, here’s a tutorial that you can check out.

3. More on inflation and wages!

 

Every day items aren’t the only things affected by inflation, wages are also impacted by inflation. What does this mean? As inflation increases, the value of the dollar decreases, meaning our dollar doesn’t go as far as it used to.

This visualization is a dynamic line chart that shows how wage growth and inflation has changed since 2015. In 2021, for the first time since 2015, inflation surpassed wage growth.

4. School Shootings

 

Sometimes, a static bar chart is all you need to convey a message. This visualization shows the number of school shootings by country from 2009 to 2018. If this doesn’t imply that the US has a gun problem, I don’t know what does!

FYI, the US has 48 times more school shootings than the second highest country… fourty eight!

 

Be sure to SUBSCRIBE here to never miss another article on data science guides, tricks and tips, life lessons, and more!

 

5. What are people studying in school?

 

While we’re on the topic of school, the image above shows the fastest growing and shrinking fields of study in US colleges. STEM fields seem to make up the fastest growing fields, while arts and history fields seem to make up the fastest shrinking fields.

This data was provided by the U.S. Department of Education.

6. Time it takes for a hacker to brute force your password in 2022

 

Ever wonder why certain websites require a variety of characters and a minimum number ? This visualization shows the time that it takes a hacker to brute force your password in 2022.

What makes this visualization so powerful is how comprehensive it is — part of this is attributed to the colour scheme depending on how long it takes to brute for the password.

The data was compiled from How Secure is My Password and this was built using Illustrator and Excel.

7. Most popular web browsers over the last 28 Years

 

Now for the “Most Popular” visualizations of the year, this visualization shows the most popular web browsers over the last 28 years! As of March 2022, it’s no surprise that Google Chrome takes 80% of the market share, but that wasn’t the case back in the day.

This type of visualization is called a pie chart race, and it’s serves a similar purpose as as bar chart race, except that it’s more useful when you’re trying to emphasize proportions as opposed to absolute numbers.

The data used to build this was taken from the following sources:

  • W3Schools (Jul-99 to present)
  • WebSideStory (Feb-99 to Jun-06)
  • GVU WWW user survey (Jan-94 to Oct-98)
  • EWS Web Server at UIUC (Jun-96 to Dec-98)

8. Most Popular websites since 1993

 

The most popular web browsers is one thing, but the most popular websites is another. This visualization shows the most popular websites since 1993. What’s surprising is that Yahoo is still the ninth most visited website as of January 2022!

This type of data visualization is called a bar chart race. I’m sure you’ve seen many of these all over YouTube and Reddit.

9. Most spoken languages in the world

 

Another simple yet powerful visualization, this bar chart shows the most spoken languages in the world, with the top three being English, Mandarin, and Hindi.

This visualization was created using ggplot in R with data provided from Wikipedia.

 

Be sure to SUBSCRIBE here to never miss another article on data science guides, tricks and tips, life lessons, and more!

 

10. Biggest Fast Food Chains

 

For the last article, this visualization shows the top 50 biggest fast food chains based on the number of stores in the US. You can see that it’s split by “food category”, and within each category, the size of each restaurant represents its magnitude.

Who know that there were more Subways and Starbucks than McDonalds?

This visualization is called a treemap and is typically used when you want to visualize hierarchical and partitioned data. If you want to learn how to build one in Python, check out this link.

 

반응형

+ Recent posts