본문 바로가기

분류 전체보기824

0103. Powers of 2 Complete the function that takes a non-negative integer n as input, and returns a list of all the powers of 2 with the exponent ranging from 0 to n ( inclusive ). Examples n = 0 ==> [1] # [2^0] n = 1 ==> [1, 2] # [2^0, 2^1] n = 2 ==> [1, 2, 4] # [2^0, 2^1, 2^2] Solution: def powers_of_two(n: str) -> list[int]: return [pow(2, i) for i in range(n+1)] 2023. 1. 3.
0102. Enumerable Magic #25 - Take the First N Elements Create a function that accepts a list/array and a number n, and returns a list/array of the first n elements from the list/array. Solution: def take(arr, n): result = [] arrs = [arr[i-1:i] for i in range(1, n+1)] for arr in arrs: result += arr return result 2023. 1. 3.
flutter _ 날짜 사용법(DateTime, Duration, difference, isAfter, isBefore, add, substract) void main() { DateTime now = DateTime.now(); // 현재 날짜시간 print(now); // 2023-01-01 20:17:51.546 print(now.year); // 2023 //년, 월, 일, 시, 분, 초, 밀리 Duration duration = Duration(seconds: 60); // 기간을 나타냄 print(duration); // 0:01:00.000000 print(duration.inDays); // 0 print(duration.inHours); // 0 print(duration.inMinutes); // 1 print(duration.inSeconds); // 60 print(duration.inMilliseconds); // 60000 D.. 2023. 1. 1.
flutter _ PageView 와 PageController, Timer 사용방법 main import 'package:flutter/material.dart'; import 'package:image_carousel/screen/home_screen.dart'; void main() { runApp( MaterialApp( home: HomeScreen(), ), ); } 설명은 생략 HomeScreen StatefulWidget class _HomeScreenState extends State { Timer? timer; PageController controller = PageController( initialPage: 0, ); State에 Timer 와 PageController 선언 initialPage는 인덱스니까 당연히 0 @override void initState().. 2023. 1. 1.
0101. Pillars There are pillars near the road. The distance between the pillars is the same and the width of the pillars is the same. Your function accepts three arguments: number of pillars (≥ 1); distance between pillars (10 - 30 meters); width of the pillar (10 - 50 centimeters). Calculate the distance between the first and the last pillar in centimeters (without the width of the first and last pillar). So.. 2023. 1. 1.
2022년 53주차 '두근거리는 공간을 만나다' 좋았던 선택 '개발자, 한 달에 책 한 권 읽기' 모임에 참여한 것 예전부터 참가해보고 싶었던 독서 모임이었다. festa에 매월 올라오는데 기존에는 책이 두꺼워서 참석하지 않다가 이번 책은 만화도 섞여있고 실제 업무와도 관련이 깊어 신청했다. 라고 말하고 싶지만 사실은 지인의 추천으로 함께 신청함! 책 이름은 '출근했더니 스크럼 마스터가 된 건에 관하여' 너무 읽고 싶게 만드는 제목이다ㅎ 애자일과 스크럼에 대해서 이론부터 실제 적용 예시까지 알려준다. 그냥 구글링으로 보는 것과 달리 체계적으로 스크럼을 이해할 수 있었다. 결국 스크럼은 제품을 더 좋게 만들기 위해 문제를 신속히 발견하고 원인을 제거하는 것이 목적이라고 할 수 있다. 나머지는 목적을 이루기 위한 방법론으로 볼 수 있다. 중요한 것은 스크.. 2023. 1. 1.