modified: components/mdx-components.tsx

modified:   components/video.tsx
	new file:   components/youtube.tsx
	modified:   content/posts/informatics/class-10v.mdx
main
joker 2 years ago
parent 2ea60fb663
commit ba1c3fb19b
  1. 3
      components/mdx-components.tsx
  2. 6
      components/video.tsx
  3. 19
      components/youtube.tsx
  4. 38
      content/posts/informatics/class-10v.mdx

@ -6,6 +6,7 @@ import { Callout } from '@/components/callout';
import { CodeBlock } from '@/components/code-block';
import { TableOfContents } from '@/components/table-of-contents';
import { Video } from '@/components/video';
import { YouTube } from '@/components/youtube';
import { cn } from '@/lib/utils';
/**
@ -84,4 +85,4 @@ function pre({ children }: React.HTMLProps<HTMLPreElement>) {
return <CodeBlock>{children}</CodeBlock>;
}
export const MDXComponents = { a, p, img, pre, TableOfContents, Callout, Video };
export const MDXComponents = { a, p, img, pre, TableOfContents, Callout, Video, YouTube };

@ -1,8 +1,3 @@
import { useState } from 'react';
import { Bookmark, ChevronDown } from 'lucide-react';
import { cn } from '@/lib/utils';
type TableOfContentsProps = {
children: React.ReactNode;
title: string;
@ -10,7 +5,6 @@ type TableOfContentsProps = {
};
export function Video({ children, title, src }: TableOfContentsProps) {
return (
<section className="mt-8 flex w-full flex-col rounded bg-slate-300/50 dark:bg-slate-600/50 sm:w-fit">

@ -0,0 +1,19 @@
type TableOfContentsProps = {
id: string;
};
export function YouTube({ id }: TableOfContentsProps) {
return (
<section className="mt-8 mb-10 flex w-full flex-col rounded bg-slate-300/50 dark:bg-slate-600/50 sm:w-fit">
<iframe
width="730"
height="480"
src={"https://www.youtube.com/embed/" + id}
title="YouTube video player"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
>
</iframe>
</section>
);
}

@ -90,6 +90,11 @@ def speed(v,t,s):
## Урок 15.11.23
<YouTube
id='9eijxPP5DLU?si=VaEEqLUbILv6SwyN'
/>
~~~python
# main.py
from mylib import strength_elasticity
@ -111,4 +116,35 @@ def strength_elasticity(f, x, k):
if k == 0:
return f/x
~~~
~~~
## Урок 16.11.23
<YouTube
id='VGLfEsi8v-0?si=fhGZZAyRNnP0nB69'
/>
Описание для следующей функции
~~~python
def strength_elasticity(f, x, k):
if f == 0:
return k*x
if x == 0:
return f/k
if k == 0:
return f/x
~~~
Функция strength_elasticity вычисляет коэффициент упругости в зависимости от трех параметров: силы (f), удлинения (x) и жесткости (k). Если один из параметров равен нулю, то функция использует формулу для вычисления коэффициента упругости на основе оставшихся двух параметров.
Инструкция:
1. Определите значения силы (f), удлинения (x) и жесткости (k).
2. Вызовите функцию strength_elasticity и передайте значения параметров в порядке: f, x, k.
3. Функция вернет значение коэффициента упругости в зависимости от введенных параметров.
Пример использования:
~~~python
result = strength_elasticity(10, 5, 2)
print(result) # Выведет значение коэффициента упругости
~~~

Loading…
Cancel
Save