반응형
반응형

긴급취재 이태원 참사 - 전반부 - PD수첩 2022년11월1일 방송

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

 

반응형
반응형

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.

 

반응형
반응형

[MSSQL] DB 복구모델 - 전체(Full) 로 변경

 

복구 모델을 보려면

  1. 데이터베이스 엔진에 연결합니다.
  2. 표준 도구 모음에서 새 쿼리를 선택합니다.
  3. 다음 예제를 복사하여 쿼리 창에 붙여넣고 실행을 선택합니다. 이 예에서는 모델 데이터베이스의 복구 모델을 배우기 위해 sys.databases 카탈로그 뷰를 쿼리하는 방법을 보여줍니다.

 

복구 모델을 변경하려면

  1. 데이터베이스 엔진에 연결합니다.
  2. 표준 도구 모음에서 새 쿼리를 선택합니다.
  3. 다음 예제를 복사하여 쿼리 창에 붙여넣고 실행을 선택합니다. 이 예에서는 model ALTER DATABASE FULL 문의 SET RECOVERY 옵션을 사용하여 데이터베이스의 복구 모델을 로 변경하는 방법을 보여 줍니다.

 

-- 복구 모델을 보려면
SELECT name, recovery_model_desc  
   FROM sys.databases  
      WHERE name = 'model' ;  
 


-- 복구 모델을 변경하려면
USE [master] ;  
ALTER DATABASE [model] SET RECOVERY FULL ;

SSMS에서 하기. 

DB 속성에서 옵션 들어가서 복구모델 선택하기. 

 

단순(Simple) 데이터베이스 복구 모델을 선택하는 몇 가지 이유는 다음과 같습니다.

  • 개발 및 테스트 데이터베이스에 가장 적합합니다.
  • 데이터 손실이 허용되는 단순한 보고 또는 애플리케이션 데이터베이스
  • 장애 시점 복구는 전체 및 개별 백업 전용입니다.
  • 관리 오버헤드 없음

다음을 지원합니다.

  1. 전체 백업
  2. 차등 백업
  3. 복사 전용 백업
  4. 파일 백업
  5. 부분 백업

장점 : 고성능 대량 복사 작업이 가능하고 로그 공간을 확보하여 공간 요청을 작게 유지합니다.

단점 : 가장 최근의 데이터베이스 또는 불일치 백업을 다시 빌드해야 하므로 변경됩니다.

Full 

전체 복구 모델을 사용하면 SQL Server는 사용자가 백업할 때까지 트랜잭션 로그를 예약합니다. 이 복구 모델에서는 모든 거래(DDL(데이터 정의 언어) + DML(데이터 조작 언어))가 트랜잭션 로그 파일에 완전히 기록됩니다. 로그 순서는 손상되지 않고 데이터베이스가 작업을 복원할 수 있도록 보존됩니다. 단순 복구 모델과 달리 트랜잭션 로그 파일은 CHECKPOINT 작업 중에 자동으로 잘리지 않습니다.

데이터베이스 오류가 발생했을 때 전체 복구 모델을 사용하여 데이터베이스를 복원하는 가장 유연성을 얻을 수 있습니다. 지정 시간 복원, 페이지 복원 및 파일 복원을 포함한 모든 복원 작업이 지원됩니다.

전체 데이터베이스 복구 모델을 선택하는 이유:

  • 미션 크리티컬 애플리케이션 지원
  • 고가용성 키 설계
  • 0 또는 명목 데이터 손실로 모든 데이터 복구를 용이하게 하기 위해
  • 데이터베이스가 여러 파일 그룹을 갖도록 설계되었으며 읽기/쓰기 보조 파일 그룹 및 선택적으로 읽기 전용 파일 그룹의 부분적 복원을 수행하려는 경우
  • 임의 시점 복원 허용
  • 개별 시트 복원
  • 높은 관리 오버헤드 유지

다음을 지원합니다.

  1. 전체 백업
  2. 차등 백업
  3. 트랜잭션 로그 백업
  4. 복사 전용 백업
  5. 파일 및/또는 파일 그룹 백업
  6. 부분 백업

장점 : 데이터 파일의 유실 또는 손상으로 인한 작업 오작동이 없습니다. 임의의 시점으로 회복될 수 있습니다.

단점 : 로그가 손상되면 가장 최근의 로그 백업 이후의 변경 사항을 다시 작성해야 합니다.

데이터베이스가 개발 또는 테스트 서버인 경우 단순 복구 모델이 대부분 적합해야 합니다. 그러나 데이터베이스가 프로덕션 데이터베이스인 경우 일반적으로 전체 복구 모델을 사용하는 것이 좋습니다. 전체 복구 모델은 대량 로그 복구 모델로 보완할 수 있습니다. 물론 데이터베이스가 작거나 데이터 웨어하우스의 일부이거나 데이터베이스가 읽기 전용인 경우에도 마찬가지입니다.

반응형
반응형

9 Projects You Can Do to Become a Front-End Master in 2023

https://levelup.gitconnected.com/9-projects-you-can-do-to-become-a-front-end-master-in-2023-a4389153148c

 

9 Projects You Can Do to Become a Front-End Master in 2023

e-commerce, blog, app, and more!

levelup.gitconnected.com

9 Projects You Can Do to Become a Front-End Master in 2023

Photo by Pankaj Patel on Unsplash

Introduction

Whether you’re new to programming or already an experienced developer in this industry, learning new concepts and languages/frameworks is
mandatory to keep up with the rapid changes.

Take, for example, React — open-sourced by Facebook just a shy four years ago, it’s already become the number one choice for JavaScript devs around the globe.

Vue and Angular, of course, also have their legitimate follower base. And then there are Svelte and universal frameworks like Next.js or Nuxt.js. And Gatsby and Gridsome and Quasar … and, and, and.

If you want to shine as an expert JavaScript developer, you should at least have some experience in different frameworks and libraries — besides doing your homework with good, old JS.

To help you become a front-end master, I have collected nine projects, each with a specific topic and a different JavaScript framework or library as a tech stack that you can build and add to your portfolio. Remember, nothing helps you more than actually building stuff so go ahead, sharpen your mind, and make this happen.

 

Build a Movie-Search App Using React (With Hooks)

The first thing you could start with is building a movie-search app using React. Below is an image of how the final app will look:

What you’ll learn

In building this application, you’ll improve your React skills using the relatively new Hooks API. The example project uses React components, many hooks, an external API, and, of course, some styling via CSS.

Tech stack and features

  • React with hooks
  • create-react-app
  • JSX
  • CSS

Without using any classes, this project gives you a perfect entry point into functional React and will definitely help you in 2020.

You can find the example project here. Follow along with the tutorial, or give it your flavor.

 

Build a Chat App With Vue

Another great project for you is to build a chat app using my favorite JavaScript library: VueJS.

The app will look something like this:

What you’ll learn

Following this tutorial, you’ll learn how to set up a Vue app from scratch — creating components, handling states, creating routes, connecting to a third-party service, and even handling authentication.

Tech stack and features

  • Vue
  • Vuex
  • Vue Router
  • Vue CLI
  • Pusher
  • CSS

This is really a great project to get started with Vue — or to improve your existing skills — to tackle development in 2023.

You can find the tutorial right here.

 

Build a Beautiful Weather App With Angular 8

This example will help you build a beautiful weather app using Google’s Angular 8:

What you’ll learn

This project will teach you valuable skills while creating an application from scratch — starting with the design over development and going all the way to a production-ready deployment.

Tech stack and features

  • Angular 8
  • Firebase
  • Server-side rendering
  • CSS with Grid Layout and Flexbox
  • Mobile friendly and responsive
  • Dark mode
  • Beautiful UI

What I really, really like about this comprehensive project is you don’t learn things in isolation. Instead, you learn the whole development process — from the design to the final deployment.

You should really do this one.

 

Build a To-Do App With Svelte

Svelte is the new kid on the block — at least compared to React, Vue, and Angular. Nonetheless, it’s one of the hotties for 2023.

OK, to-do apps aren’t necessarily the hottest topic out there, but this will really help you to sharpen your Svelte skills. It’ll look like this:

What you’ll learn

This tutorial will show you how to make an app using Svelte 3 from start to finish. It makes use of components, styling, and event handlers.

Tech stack and features

  • Svelte 3
  • Components
  • Styling via CSS
  • ES 6 syntax

There aren’t that many good Svelte starter projects out there, so I found this one to be kind of good to start with.

And, who knows, maybe you’ll be the one creating another, more comprehensive Svelte tutorial that’ll be presented in the next year’s version of this post?

 

Build an E-Commerce Shopping Cart With Next.js

Next.js is the most popular framework for creating React applications that support server-side rendering out of the box.

This project will show you how to build an e-commerce shopping cart that looks like this:

What you’ll learn

In this project, you’ll learn how to set up a Next.js development environment — creating new pages and components, fetching data, and styling and deploying a Next application.

Tech stack and features

  • Next.js
  • Components and pages
  • Data fetching
  • Styling
  • Deployment
  • SSR and SPA

It’s always great to have a real-world example, such as an e-commerce showcase, to learn something new. You can find the tutorial here.

 

Build a Full-Blown Multilanguage Blog Website With Nuxt.js

Nuxt.js is to Vue what Next.js is to React: a great framework to combine the power of server-side rendering and single-page applications.

The final app that you could create will look like this:

What you’ll learn

This example project will teach you how to build a full-blown website using Nuxt.js — from the initial setup to the final deployment.

It uses many of the cool features Nuxt has to offer, like pages and components, as well as styling with SCSS.

Tech stack and features

  • Nuxt.js
  • Components and pages
  • Storyblok module
  • Mixins
  • Vuex for state management
  • SCSS for styling
  • Nuxt middlewares

This is a really cool project for you and covers many of the great features of Nuxt.js. I personally love working with Nuxt, so you should really try this one out, as it will also make you a better Vue developer.

 

Build a Blog With Gatsby

Gatsby is a great static-site generator that uses React and GraphQL under the hood. This is the result of this project:

What you’ll learn

In this tutorial, you’ll learn how to leverage Gatsby to build an outstanding blog that you use for writing your articles while making use of React and GraphQL.

Tech stack and features

  • Gatsby
  • React
  • GraphQL
  • Plugins and themes
  • MDX/Markdown
  • Bootstrap CSS
  • Templates

If you ever wanted to start a blog, this is a great example of how to do so by leveraging React and GraphQL.

I’m not saying that WordPress always is a bad choice, but with Gatsby, you can create highly performant sites while using React — which is an awesome combination.

 

Build a Blog With Gridsome

Gridsome is to Vue … OK, we already had that with Next/Nuxt.

But the same is true for Gridsome and Gatsby. Both use GraphQL as a data layer, but Gridsome uses VueJS. It also is an awesome static-site generator that’ll help you create great blogs:

What you’ll learn

This project will teach you how to build a simple blog to get started with Gridsome, GraphQL, and Markdown.

It also covers how to deploy the application via Netlify.

Tech stack and features

  • Gridsome
  • Vue
  • GraphQL
  • Markdown
  • Netlify

This, for sure, isn’t the most comprehensive tutorial, but it does cover the basic concepts of Gridsome and Markdown and could be a good starting point.

 

Build a SoundCloud-like Audio-Player App With Quasar

Quasar is another Vue framework that can also be used to build mobile applications.

In this project, you’ll create an audio-player app like this:

What you’ll learn

While the other projects focus mainly on web applications, this one will show you how to create a mobile app using Vue via the Quasar framework.

You should already have a working Cordova setup with Android Studio/Xcode configured. If not, there is a link in the tutorial to the Quasar website, where they show you how to set this up.

Tech stack and features

  • Quasar
  • Vue
  • Cordova
  • WaveSurfer
  • UI Components

A small project that shows the power of Quasar for building mobile apps.

 

Conclusion

In this article, I showed you nine projects that you can build, each focusing on another JavaScript framework or library.

Now the choice is all yours: Will you try something new by using a framework you haven’t used before? Or do you want to strengthen your skills by doing a project for a technology you already have some knowledge of? Or will you rely on your favorite framework/library and do all the projects in 2023 with it?

If you like what I write and want to support me and my work, please follow me on Twitter to learn more about programming, making, writing & careers🥰

반응형

+ Recent posts