반응형
반응형

https://api.jquery.com/data/

 

.data() | jQuery API Documentation

Description: Return arbitrary data associated with the first element in the jQuery collection, as set by data() or by an HTML5 data-* attribute. The .data() method allows us to read data previously associated with DOM elements. We can retrieve several dist

api.jquery.com

일치하는 요소와 연결된 임의의 데이터를 저장하거나 일치하는 요소 집합의 첫 번째 요소에 대한 명명된 데이터 저장소의 값을 반환합니다.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>data demo</title>
  <style>
  div {
    color: blue;
  }
  span {
    color: red;
  }
  </style>
  <script src="https://code.jquery.com/jquery-3.7.0.js"></script>
</head>
<body>
 
<div>
  The values stored were
  <span></span>
  and
  <span></span>
</div>
 
<script>
$( "div" ).data( "test", { first: 16, last: "pizza!" } );
$( "span" ).first().text( $( "div" ).data( "test" ).first );
$( "span" ).last().text( $( "div" ).data( "test" ).last );
</script>
 
</body>
</html>

https://jsfiddle.net/mill01/moegwyp3/

 

jquery .data() - JSFiddle - Code Playground

 

jsfiddle.net

반응형
반응형

[python] calendar 모듈, 달력 사용하기  https://docs.python.org/ko/3/library/calendar.html

 

calendar — General calendar-related functions

Source code: Lib/calendar.py This module allows you to output calendars like the Unix cal program, and provides additional useful functions related to the calendar. By default, these calendars have...

docs.python.org

# https://docs.python.org/ko/3/library/calendar.html
import calendar

yy = 2023
mm = 5

#display the calendar
print(calendar.month(yy,mm))

#calendar 모듈 내용 확인
print(dir(calendar))

calendar 모듈을 좀 더 살펴보겠습니다.

문제 1. calendar 모듈을 임포트하는 문장을 완성하세요.

>>> ____ calendar

calendar 모듈에 무엇이 있는지 살펴보세요.

>>> dir(calendar)
['Calendar', 'EPOCH', 'FRIDAY', 'February', 'HTMLCalendar', 'IllegalMonthError', 'IllegalWeekdayError', 'January', 'LocaleHTMLCalendar', 'LocaleTextCalendar', 'MONDAY', 'SATURDAY', 'SUNDAY', 'THURSDAY', 'TUESDAY', 'TextCalendar', 'WEDNESDAY', '_EPOCH_ORD', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_colwidth', '_locale', '_localized_day', '_localized_month', '_monthlen', '_nextmonth', '_prevmonth', '_spacing', 'c', 'calendar', 'datetime', 'day_abbr', 'day_name', 'different_locale', 'error', 'firstweekday', 'format', 'formatstring', 'isleap', 'leapdays', 'main', 'mdays', 'month', 'month_abbr', 'month_name', 'monthcalendar', 'monthrange', 'prcal', 'prmonth', 'prweek', 'repeat', 'setfirstweekday', 'sys', 'timegm', 'week', 'weekday', 'weekheader']

이와 같이 모듈은 수많은 공구가 들어 있는 '공구통'이라고 생각할 수 있습니다.

문제 2. calendar 모듈에 leap이라는 문자열을 포함하는 이름은 어떤 것이 있는지 찾아보세요.1

>>> [x for x in dir(calendar) if 'leap' in x]
[____, ____]

문제 3. 주어진 해가 윤년인지 아닌지 판별하는 함수의 사용법을 확인해보세요.

>>> help(____)
Help on function ____ in module calendar:

____(year)
    Return True for leap years, False for non-leap years.

문제 4. 이 함수를 사용해서 2077년이 윤년인지 아닌지 확인해보세요.

>>> ____
False

https://github.com/ychoi-kr/wikidocs-chobo-python/blob/master/ch05/using_modules.ipynb

 

GitHub - ychoi-kr/wikidocs-chobo-python: 《왕초보를 위한 파이썬》 예제 코드

《왕초보를 위한 파이썬》 예제 코드. Contribute to ychoi-kr/wikidocs-chobo-python development by creating an account on GitHub.

github.com

{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "attractive-marketing",
   "metadata": {},
   "outputs": [],
   "source": [
    "#문제 1\n",
    "import calendar"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "greatest-event",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Calendar',\n",
       " 'EPOCH',\n",
       " 'FRIDAY',\n",
       " 'February',\n",
       " 'HTMLCalendar',\n",
       " 'IllegalMonthError',\n",
       " 'IllegalWeekdayError',\n",
       " 'January',\n",
       " 'LocaleHTMLCalendar',\n",
       " 'LocaleTextCalendar',\n",
       " 'MONDAY',\n",
       " 'SATURDAY',\n",
       " 'SUNDAY',\n",
       " 'THURSDAY',\n",
       " 'TUESDAY',\n",
       " 'TextCalendar',\n",
       " 'WEDNESDAY',\n",
       " '_EPOCH_ORD',\n",
       " '__all__',\n",
       " '__builtins__',\n",
       " '__cached__',\n",
       " '__doc__',\n",
       " '__file__',\n",
       " '__loader__',\n",
       " '__name__',\n",
       " '__package__',\n",
       " '__spec__',\n",
       " '_colwidth',\n",
       " '_locale',\n",
       " '_localized_day',\n",
       " '_localized_month',\n",
       " '_monthlen',\n",
       " '_nextmonth',\n",
       " '_prevmonth',\n",
       " '_spacing',\n",
       " 'c',\n",
       " 'calendar',\n",
       " 'datetime',\n",
       " 'day_abbr',\n",
       " 'day_name',\n",
       " 'different_locale',\n",
       " 'error',\n",
       " 'firstweekday',\n",
       " 'format',\n",
       " 'formatstring',\n",
       " 'isleap',\n",
       " 'leapdays',\n",
       " 'main',\n",
       " 'mdays',\n",
       " 'month',\n",
       " 'month_abbr',\n",
       " 'month_name',\n",
       " 'monthcalendar',\n",
       " 'monthrange',\n",
       " 'prcal',\n",
       " 'prmonth',\n",
       " 'prweek',\n",
       " 'repeat',\n",
       " 'setfirstweekday',\n",
       " 'sys',\n",
       " 'timegm',\n",
       " 'week',\n",
       " 'weekday',\n",
       " 'weekheader']"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dir(calendar)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "silver-delhi",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['isleap', 'leapdays']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#문제 2\n",
    "[x for x in dir(calendar) if 'leap' in x]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "ultimate-collaboration",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function isleap in module calendar:\n",
      "\n",
      "isleap(year)\n",
      "    Return True for leap years, False for non-leap years.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "#문제 3\n",
    "help(calendar.isleap)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ancient-newport",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#문제 4\n",
    "calendar.isleap(2077)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "arbitrary-eleven",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
반응형
반응형

스스로 좋다고 생각하는 것을 행하라.
다른 사람들의 평가에 좌우될 필요는 없다.
독립적으로 생각하지 못하면 타인의 영향 아래 놓이게 된다.
타인의 생각 속에서 늘 살아야 한다면
이것은 육체가 부자유한 것보다 훨씬 더 나쁜 노예 상태이다.
- 레프 톨스토이 ‘살아갈 날들을 위한 공부’에서


좋든 싫든 우리는 대부분 타인이 좋게 생각해줄 일을 하려합니다.
그러나 남에게 잘 보이는 것이 성공이 아닙니다.
남들에게 잘 보이는 일이 아니라, 내가 좋아하는 일,
내가 옳다고 생각하는 일, 내가 잘하고, 내가 해야 할 일을 찾아서 즐기면서
꾸준히 노력하고 성장해 나가는 것이 성공으로 가는 길입니다.

반응형

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

행동이 자신감을 회복시킨다  (0) 2023.06.01
나의 길, 새로운 길  (0) 2023.05.31
재능만 믿지 말고...  (0) 2023.05.30
지금 내 가슴을 뛰게 하는 것은  (0) 2023.05.29
기쁨  (0) 2023.05.28
반응형

재능을 가진 사람은 많다.
하지만 얼마나 많은 이들이 재능을
허비하는지 모른다. 중요한 사실은
재능을 갖는 것만으로는 충분하지
않다는 점이다. 재능을 가꿀 수
있는 재능도 가져야 한다.


- 바바라 애버크롬비의《인생을 글로 치유하는 법》중에서 -


* 재능은 선물입니다.
누구나 이 선물을 받고 태어납니다.
그러나 열심히 갈고 가꾸지 않으면 그 값진
선물조차도 자신에게 의미 없는 것이 되고 맙니다.
재능만 믿지 말고 반짝반짝 빛날 때까지
갈고 갈고 또 갈아야 합니다.

반응형

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

나의 길, 새로운 길  (0) 2023.05.31
스스로 좋다고 생각하는 것을 행하라  (0) 2023.05.30
지금 내 가슴을 뛰게 하는 것은  (0) 2023.05.29
기쁨  (0) 2023.05.28
내 인생의 '가장 젊은 날'  (0) 2023.05.26
반응형

https://responsively.app/

 

A Web Developer's Browser

A dev-tool that aids faster and precise responsive web development.

responsively.app

Mirrored Interactions

Any click, scroll or navigation that you perform in one device will be replicated to all devices in real-time.

Customizable Layout

Customize the arrangement of the devices to suit your every need.

Awesome Elements Inspector

Inspect any element in any device with just one click. No Hassle!

Extensive Built-in Device Profiles

Has 30+ built-in device profiles covering all major devices. You can even add new custom device profiles as you like.

 

반응형
반응형

지금
나의 가슴을 뛰게 하는 것은
지나온 길이 아니라 앞으로 나아갈 길이다.
내가 지나온 길을 철저하게 파헤치는 가장
큰 이유는 앞으로 나아갈 방향에 대해
단서를 얻기 위해서이다. 내가 지금
과거의 내 모습을 탐구하는 것은
내가 어떤 사람이 될 것인지,  
되지 못할 것인지에 대해
힌트를 얻기 위해서다.


- 바바라 애버크롬비의《인생을 글로 치유하는 법》중에서 -


* 어제까지 힘들었지만
오늘부터 앞으로 벌어질 일을 생각하면
가슴이 뜁니다. 지금까지 겪었던 모든 일들,
아무리 파헤쳐도 도통 이해할 수 없는 일들,
그 지나간 일들이 사실은 나로 하여금
더 힘차게 앞으로 나아가게 하는
원동력이 되고 있음을 새삼
깨닫습니다.

반응형

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

스스로 좋다고 생각하는 것을 행하라  (0) 2023.05.30
재능만 믿지 말고...  (0) 2023.05.30
기쁨  (0) 2023.05.28
내 인생의 '가장 젊은 날'  (0) 2023.05.26
얼굴의 주름, 지혜의 주름  (0) 2023.05.25

+ Recent posts