본문 바로가기

전체 글823

벨로그 워드클라우드 서비스 벨로그 워드클라우드 월간 사이드 프로젝트를 기획 진행하고 있다. 첫 시작인 5월에는 벨로그의 글을 워드클라우드 형태로 분석해서 보여주는 서비스를 만들어보았다. 웹 페이지에서 벨로그 아이디만 입력하면 최근에 작성한 3개 글을 분석하여 워드클라우드 형태로 보여준다. 내가 만든 워드클라우드는 불용어를 제외한 명사들만 분석하여 보여주는데, 예를 들어 ‘나는’, ‘는데’, ‘습니다’, ‘그리고’, ‘또한’, 같은 단어들을 제외하여 의미가 유효한 단어들만 보여준다. 개발 목적 예전부터 블로그를 단어 단위로 분석해보고 싶었다. 특히 개발자마다 어떤 단어들을 많이 사용하는지 확인해보고 싶었는데, 이번 기회에 글을 워드클라우드 형태로 보여주고자 했다. 워드 클라우드란? 쉽게 말해 글을 아래 이미지처럼 보여주는 것이다. .. 2022. 5. 29.
Grasshopper - Terminal game move function Terminal game move function In this game, the hero moves from left to right. The player rolls the dice and moves the number of spaces indicated by the dice two times. In SQL, you will be given a table moves with columns position and roll. Return a table which uses the current position of the hero and the roll (1-6) and returns the new position in a column res. Example: move(3, 6) should equal 15.. 2022. 5. 29.
Easy SQL: Cube Root and Natural Log Given the following table 'decimals': ** decimals table schema ** id number1 number2 Return a table with two columns (cuberoot, logarithm) where the values in cuberoot are the cube root of those provided in number1 and the values in logarithm are changed to the natural logarithm of those in number2. Solution: SELECT CBRT(number1) as cuberoot, LN(number2) as logarithm FROM decimals The cube root .. 2022. 5. 27.
심플 팩토리 패턴 팩토리 패턴 개요 팩토리란, 다른 클래스의 객체를 생성하는 클래스를 일컫는다. 클라이언트는 특정 ‘인자’와 함께 ‘메서드’를 호출하고 팩토리는 해당 객체를 생성하고 반환한다. 직접 객체를 생성하지 않고 팩토리를 사용하는 이유 객체 생성과 클래스 구현을 나눠 상호 의존도를 줄이기 위함. 클라이언트는 인터페이스와 메소드, 인자 등의 정보만 있으면 된다. 코드를 수정하지 않고 팩토리에 새로운 클래스를 추가할 수 있다. 이미 생성된 객체를 팩토리가 재활용할 수 있다. 팩토리 패턴 3가지 종류 심플 팩토리 패턴 - 인터페이스는 객체 생성 로직을 숨기고 객체를 생성 팩토리 메소드 패턴 - 인터페이스를 통해 객체를 생성하지만 서브 클래스가 객체 생성에 필요한 클래스를 선택 추상 팩토리 패턴 - 객체 생성에 필요한 클.. 2022. 5. 27.
Grasshopper - Check for factor This function should test if the factor is a factor of base. Return true if it is a factor or false if it is not. About factors Factors are numbers you can multiply together to get another number. 2 and 3 are factors of 6 because: 2 * 3 = 6 You can find a factor by dividing numbers. If the remainder is 0 then the number is a factor. You can use the mod operator (%) in most languages to check for.. 2022. 5. 26.
SQL Basics: Maths with String Manipulations Given a demographics table in the following format: demographics table schema id name birthday race return a single column named calculation where the value is the bit length of name, added to the number of characters in race. Solution: SELECT BIT_LENGTH(name)+ CHAR_LENGTH(race) AS calculation FROM demographics 'BIT_LENGTH' can obtain the bit length. 'CHAR_LENGTH' or 'LENGTH' can obtain the char.. 2022. 5. 25.