Skip to content

Commit 4942a9d

Browse files
Upload
1 parent 5657076 commit 4942a9d

File tree

3 files changed

+349
-0
lines changed

3 files changed

+349
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { defineCodeRunnersSetup } from '@slidev/types'
2+
import { CodeRunnerOutputs } from '@slidev/types'
3+
4+
export default defineCodeRunnersSetup(() => {
5+
return {
6+
async python(code) {
7+
const results = await godboltPythonRequest(code);
8+
return results;
9+
}
10+
}
11+
})
12+
13+
async function godboltPythonRequest(code: string): Promise<CodeRunnerOutputs> {
14+
try {
15+
// Godbolt API URL for Python 3.12
16+
const apiUrl = 'https://godbolt.org/api/compiler/python312/compile';
17+
18+
// Make an asynchronous POST request to the Godbolt API with the Python code
19+
const response = await fetch(apiUrl, {
20+
method: 'POST',
21+
headers: {
22+
'Content-Type': 'application/json',
23+
'Accept': 'application/json' // We need to explicitly ask for a JSON response, text is the default
24+
},
25+
body: JSON.stringify({
26+
source: code,
27+
options: {
28+
compilerOptions: {"executorRequest": true}, // We want to compile + execute
29+
executeParameters: {},
30+
}
31+
})
32+
});
33+
34+
// Check if the response is successful
35+
if (!response.ok) {
36+
return {
37+
error: `Bad response: ${response.statusText}`
38+
};
39+
}
40+
41+
// Parse the response as JSON
42+
const result = await response.json();
43+
44+
// Extract stdout lines and convert them into CodeRunnerOutputText objects
45+
const stdout = result.stdout.map((line: any) => ({
46+
text: line.text
47+
// Hack to keep leading whitespace
48+
.replace(/\s/g, "‎ ")
49+
.replace(/\t/g, "‎ ")
50+
}
51+
));
52+
53+
// Extract stderr lines and convert them into CodeRunnerOutputText objects
54+
const stderr = result.stderr.map((line: any) => ({
55+
text: line.text
56+
// Hack to keep leading whitespace
57+
.replace(/\s/g, "‎ ")
58+
.replace(/\t/g, "‎ "),
59+
class: 'text-red-500'
60+
}
61+
));
62+
63+
if (stderr.length !== 0) {
64+
return stderr;
65+
} else if (stdout.length !== 0) {
66+
return stdout;
67+
} else {
68+
return {
69+
text: 'No output received'
70+
};
71+
}
72+
} catch (error) {
73+
console.error('Failed to execute Python code:', error);
74+
return {
75+
error: `Failed to execute Python code: ${error.message}`
76+
};
77+
}
78+
}
79+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
---
2+
layout: intro
3+
theme: neversink
4+
color: bowdoin
5+
routerMode: hash
6+
favicon: https://avatars.githubusercontent.com/u/9260792
7+
---
8+
9+
## Intellectual Property Protections <twemoji-locked />
10+
#### Module 2: Intellectual Property
11+
12+
<br>
13+
14+
<hr><br>
15+
16+
Christopher Martin - _Bowdoin College_ <a href="https://bowdoin.edu/" class="ns-c-iconlink"><mdi-open-in-new /></a>
17+
<Email v="[email protected]" />
18+
19+
---
20+
layout: section
21+
color: bowdoin
22+
---
23+
24+
## Last class, we came to the conclusion it is important to protect IP..
25+
26+
<br>
27+
28+
### However, we also determined different things need to be protected in different ways...
29+
30+
<twemoji-thinking-face v-drag="[836,374,96,89]" />
31+
32+
---
33+
layout: top-title
34+
color: bowdoin-title
35+
---
36+
37+
:: title ::
38+
39+
# Trade Secret
40+
41+
:: content ::
42+
43+
# The first way IP can be protected is as a ==Trade Secret==!
44+
45+
### A trade secret is a confidential piece of intellectual property that gives an individual or company a competitive advantage!
46+
47+
<br>
48+
49+
### In order for IP to qualify as a trade secret, it must meet the following three criteria as defined by the Economic Espionage Act (EEA) of 1996.
50+
51+
- #### The IP is must be information is that has either actual or potential economic value and is not generally known..
52+
53+
- #### The IP must have value to others who cannot legitimately obtain the information..
54+
55+
- #### The IP must be subject to _reasonable efforts_ to maintain its secrecy..
56+
57+
### <u>Trade secret protections don't expire if these three criteria are maintained!</u>
58+
59+
<br>
60+
61+
<twemoji-shushing-face v-drag="[877,143,96,89]" />
62+
63+
---
64+
layout: top-title
65+
color: bowdoin-title
66+
---
67+
68+
:: title ::
69+
70+
# Trade Secret Weaknesses
71+
72+
:: content ::
73+
74+
### ==Reverse engineering== is an allowed method to discover a trade secret!
75+
76+
<br>
77+
78+
### May be compromised when employees leave a company or if a falling out occurs resulting in information being leaked!
79+
80+
- #### ==Non-disclosure agreements== (NDAs) are legally enforceable contracts that create a confidential relationship between parties where one party has sensitive information and another party will gain access to that information
81+
82+
- #### NDAs count as showing _reasonable efforts_ towards maintain secrecy..
83+
84+
- #### However, human memory cannot be erased! An improved idea may be brought to a new company.
85+
86+
### ==What is an example of a trade secret?==
87+
88+
---
89+
layout: top-title
90+
color: bowdoin-title
91+
---
92+
93+
:: title ::
94+
95+
# Trade Secret Law
96+
97+
:: content ::
98+
99+
## The ==Economic Espionage Act (EEA) of 1996== criminalizes trade theft under two sets of circumstances. <u>Economic espionage</u> and the <u>theft of trade interstate or foreign</u> are prosecuted by the Department of Justice and are punishable by imprisonment and/or fines.
100+
101+
<br>
102+
103+
## The ==Defend Trade Secrets Act (DTSA) of 2016== amended the EEA to establish a private civil cause of action for the misappropriation of a trade secret.
104+
105+
<br>
106+
107+
### ==Have you ever had to sign an NDA?==
108+
109+
<br>
110+
111+
### ==How will NDAs and Trade Secrets affect / protect you?==
112+
113+
---
114+
layout: top-title
115+
color: bowdoin-title
116+
---
117+
118+
:: title ::
119+
120+
# Trademark™ and Service Mark℠
121+
122+
:: content ::
123+
124+
# The second way is with a ==Trademark== or ==Service Mark==!
125+
126+
### Trademarks are used to identify goods while Service Marks are used to identify services!
127+
128+
129+
- The ™ symbol is used to identify an unregistered trademark!
130+
131+
- The ℠ symbol is used to identify an unregistered servicemark!
132+
133+
134+
- The ® symbol is used to identify a federally registered trademark or service mark!
135+
136+
<br>
137+
138+
### Trademarks and service marks are registered with the US Patent and Trademark Office but it is up to the company to defend / protect the mark.
139+
140+
<br>
141+
142+
### This gives companies the ability to establish a “brand name” which gives confidence / preference to customers!
143+
144+
---
145+
layout: top-title
146+
color: bowdoin-title
147+
---
148+
149+
:: title ::
150+
151+
# Trademark Weaknesses
152+
153+
:: content ::
154+
155+
156+
## So long as the mark is defended, the protection never expires!
157+
158+
<br>
159+
160+
### However, if brand's name becomes common noun, the mark may be lost!
161+
162+
- Companies can advertise to protect their trademarks keeping them known
163+
164+
- However, companies need to actively monitor their use and contact those who misuse them!
165+
166+
<br>
167+
168+
#### The ==Lanham Act of 1946== is the primary federal trademark statute of law in the United States. The Act prohibits several activities, including trademark infringement, trademark dilution, and false advertising!
169+
170+
<br>
171+
172+
#### ==What are some examples of a brand's name being so popular it is used as a noun?==
173+
174+
<br>
175+
176+
#### ==How will trademarks and service marks affect / protect you?==
177+
178+
---
179+
layout: top-title
180+
color: bowdoin-title
181+
---
182+
183+
:: title ::
184+
185+
# Patent
186+
187+
:: content ::
188+
189+
# The third way IP can be protected is with a ==Patent==!
190+
191+
### Patents offers protection for a limited period of time to the creators of machines, systems, and other inventions.
192+
193+
<br>
194+
195+
## They require a public document that provides detailed description of an invention!
196+
197+
<br>
198+
199+
## They provide owners with exclusive rights for 20 years!
200+
201+
<br>
202+
203+
### ==Patent licensing== assigns the ownership of a patent to a third party such that they can make, use, and sell your invention either exclusively or non-exclusively, for an amount of pre-decided royalties.
204+
205+
#### Allows an individual to make profit by selling the idea to a company!
206+
207+
---
208+
layout: top-title
209+
color: bowdoin-title
210+
---
211+
212+
:: title ::
213+
214+
# Patent Weaknesses
215+
216+
:: content ::
217+
218+
# Getting a patent is a very lengthy process defined by the Patent Act (35 U.S. Code).
219+
220+
<br>
221+
222+
# Your invention must be completely unique! It can not have been described, used, or patented by someone else!
223+
### Requires a patent attorney and time to get!
224+
225+
<br>
226+
227+
# It is possible to apply for an International Patent but the process is more complex and your US patent is public!
228+
229+
<br>
230+
231+
### ==How will trademarks and service marks affect / protect you?==
232+
233+
<twemoji-astonished-face v-drag="[856,397,96,89]" />
234+
235+
---
236+
layout: section
237+
color: bowdoin
238+
---
239+
240+
# Questions?
241+
242+
<twemoji-thinking-face v-drag="[813,227,96,89]" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { defineConfig } from 'unocss'
2+
import { colors } from '@unocss/preset-mini'
3+
4+
export default defineConfig ({
5+
rules: [
6+
['neversink-bowdoin-scheme', {
7+
'--neversink-bg-color': colors['white'],
8+
'--neversink-bg-code-color': colors['gray'][100],
9+
'--neversink-fg-code-color': colors['black'],
10+
'--neversink-fg-color': colors['black'],
11+
'--neversink-text-color': colors['black'],
12+
'--neversink-border-color': colors['gray'][950],
13+
'--neversink-highlight-color': colors['gray'][300],
14+
}],
15+
['neversink-bowdoin-title-scheme', {
16+
'--neversink-bg-color': colors['black'],
17+
'--neversink-bg-code-color': colors['gray'][100],
18+
'--neversink-fg-code-color': colors['black'],
19+
'--neversink-fg-color': colors['black'],
20+
'--neversink-text-color': colors['white'],
21+
'--neversink-border-color': colors['gray'][950],
22+
'--neversink-highlight-color': colors['gray'][300],
23+
}]
24+
],
25+
safelist: [
26+
'neversink-bowdoin-scheme', 'neversink-bowdoin-title-scheme'
27+
]
28+
})

0 commit comments

Comments
 (0)