cg-code 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cg_code/__init__.py +4 -0
- cg_code/hci/__init__.py +10 -0
- cg_code/hci/hci_p1.py +22 -0
- cg_code/hci/hci_p10.py +25 -0
- cg_code/hci/hci_p2.py +19 -0
- cg_code/hci/hci_p3.py +13 -0
- cg_code/hci/hci_p4.py +14 -0
- cg_code/hci/hci_p5.py +18 -0
- cg_code/hci/hci_p6.py +20 -0
- cg_code/hci/hci_p7.py +12 -0
- cg_code/hci/hci_p8.py +22 -0
- cg_code/hci/hci_p9.py +39 -0
- cg_code/nlp/__init__.py +0 -0
- cg_code/om/__init__.py +15 -0
- cg_code/om/om_all.py +801 -0
- cg_code/om/om_p1_1.py +81 -0
- cg_code/om/om_p1_2.py +43 -0
- cg_code/om/om_p1_3.py +58 -0
- cg_code/om/om_p1_4.py +38 -0
- cg_code/om/om_p2_1.py +56 -0
- cg_code/om/om_p3_1.py +49 -0
- cg_code/om/om_p3_4.py +52 -0
- cg_code/om/om_p4_1.py +101 -0
- cg_code/om/om_p_2_2.py +36 -0
- cg_code/om/om_p_2_3.py +25 -0
- cg_code/om/om_p_3_2.py +21 -0
- cg_code/om/om_p_3_3.py +28 -0
- cg_code/om/om_p_4_2.py +51 -0
- cg_code/qc/__init__.py +10 -0
- cg_code/qc/qc_p1.py +32 -0
- cg_code/qc/qc_p10.py +40 -0
- cg_code/qc/qc_p2.py +25 -0
- cg_code/qc/qc_p3.py +25 -0
- cg_code/qc/qc_p4.py +42 -0
- cg_code/qc/qc_p5.py +37 -0
- cg_code/qc/qc_p6.py +32 -0
- cg_code/qc/qc_p7.py +35 -0
- cg_code/qc/qc_p8.py +42 -0
- cg_code/qc/qc_p9.py +24 -0
- cg_code-0.1.0.dist-info/METADATA +12 -0
- cg_code-0.1.0.dist-info/RECORD +44 -0
- cg_code-0.1.0.dist-info/WHEEL +5 -0
- cg_code-0.1.0.dist-info/licenses/LICENSE +15 -0
- cg_code-0.1.0.dist-info/top_level.txt +1 -0
cg_code/__init__.py
ADDED
cg_code/hci/__init__.py
ADDED
cg_code/hci/hci_p1.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import time
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
ltm = {"capital of india":"delhi"}
|
|
5
|
+
|
|
6
|
+
# Short-Term Memory
|
|
7
|
+
print("STM Test: Memorize this number at 3 seconds:")
|
|
8
|
+
stm_numbers = "23678"
|
|
9
|
+
print(stm_numbers)
|
|
10
|
+
|
|
11
|
+
time.sleep(3)
|
|
12
|
+
os.system("cls" if os.name=="nt" else "clear")
|
|
13
|
+
|
|
14
|
+
ans_num = input("Enter the number: ")
|
|
15
|
+
if stm_numbers == ans_num: print("STM Pass! You memorize the number.")
|
|
16
|
+
else:print("STM Fail! You are not memorize the number.")
|
|
17
|
+
|
|
18
|
+
# Long-Term Memory
|
|
19
|
+
ans_ltm = input("Enter capital of india: ")
|
|
20
|
+
if ans_ltm == ltm['capital of india']:
|
|
21
|
+
print("LTM Pass! You permanent memorize.")
|
|
22
|
+
else: print("LTM Fail! You are not permanent memorize.")
|
cg_code/hci/hci_p10.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import tkinter as tk
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
root = tk.Tk()
|
|
5
|
+
root.title("VCR Remote Control")
|
|
6
|
+
|
|
7
|
+
# VCR screen display
|
|
8
|
+
screen = tk.Label(root,text="VCR READY",bg="black",fg="lime",font=("Arial",14,"bold"),width=22,height=2)
|
|
9
|
+
screen.pack(pady=10)
|
|
10
|
+
|
|
11
|
+
# Icon buttons and their actions
|
|
12
|
+
icons = [
|
|
13
|
+
("▶ Play", "PLAYING TAPE..."),
|
|
14
|
+
("⏸ Pause", "PAUSED"),
|
|
15
|
+
("⏹ Stop", "STOPPED"),
|
|
16
|
+
("⏪ Rewind", "REWINDING <<"),
|
|
17
|
+
("⏩ Forward", "FAST FORWARD >>")
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
# Button for each icon
|
|
21
|
+
for icon_text, status_msg in icons:
|
|
22
|
+
tk.Button(root,text=icon_text,width=18,font=("Arial",12),
|
|
23
|
+
command=lambda m=status_msg:screen.config(text=m)).pack(pady=3)
|
|
24
|
+
|
|
25
|
+
root.mainloop()
|
cg_code/hci/hci_p2.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
|
|
3
|
+
print("Hello! I am your assistant. You can ask about time, date, or greeting.")
|
|
4
|
+
|
|
5
|
+
while True:
|
|
6
|
+
user_input = input("User: ").lower()
|
|
7
|
+
|
|
8
|
+
if "hello" in user_input or "hi" in user_input:
|
|
9
|
+
print("Assistant: Hello! how can i help you?")
|
|
10
|
+
elif "time" in user_input:
|
|
11
|
+
print(f"Assistant: Current time is {datetime.datetime.now().strftime("%H:%M:%S")}")
|
|
12
|
+
elif "date" in user_input:
|
|
13
|
+
print(f"Assistant: Today date is {datetime.datetime.today()}")
|
|
14
|
+
elif "bye" in user_input:
|
|
15
|
+
print("Assistant: Bye! Meet again.")
|
|
16
|
+
break
|
|
17
|
+
else:
|
|
18
|
+
print("Assistant: i can not understand your requirement.")
|
|
19
|
+
|
cg_code/hci/hci_p3.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import tkinter as tk
|
|
2
|
+
|
|
3
|
+
root = tk.Tk()
|
|
4
|
+
root.title("Direct Manipulate Word Processor")
|
|
5
|
+
|
|
6
|
+
text_area = tk.Text(root,height=12,width=45,undo=True,font=("Arial",12))
|
|
7
|
+
text_area.pack(pady=10)
|
|
8
|
+
|
|
9
|
+
tk.Button(root,text="Undo (Reverse Action)",command=text_area.edit_undo).pack(side=tk.LEFT,padx=20)
|
|
10
|
+
tk.Button(root,text="Clear All",command=lambda: text_area.delete("1.0",tk.END)).pack(side=tk.RIGHT,padx=20)
|
|
11
|
+
tk.Button(root,text="Redo",command=text_area.edit_redo).pack(side=tk.LEFT,padx=20)
|
|
12
|
+
|
|
13
|
+
root.mainloop() # Window continuosly open on screen
|
cg_code/hci/hci_p4.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
guidelines_db = {
|
|
2
|
+
"Know thy user (Understand user needs)": "1. Requirement Analysis Phase",
|
|
3
|
+
"Maintain screen consistency & layout": "2. UI Design Phase",
|
|
4
|
+
"Provide informative feedback & shortcuts": "3. Implementation (Coding) Phase",
|
|
5
|
+
"Prevent errors & allow easy undo": "4. Testing & Evaluation Phase"
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
book_name = input("Search name of book (e.g., Designing the user interfece): ")
|
|
9
|
+
print(f"Book Found: '{book_name} by Ben Shneiderman")
|
|
10
|
+
print("-"*56)
|
|
11
|
+
|
|
12
|
+
for guideline, sdlc_phase in guidelines_db.items():
|
|
13
|
+
print(f"Guideline: {guideline}")
|
|
14
|
+
print(f"SDLC Stage: {sdlc_phase}")
|
cg_code/hci/hci_p5.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
def klm_analysis(device, p_time):
|
|
2
|
+
H = 0.4 # Hand on mouse
|
|
3
|
+
B = 0.1 # Double clicked on button
|
|
4
|
+
M = 1.2 # Think
|
|
5
|
+
# p_time # point on icon
|
|
6
|
+
|
|
7
|
+
# Method 1: Double click on desktop icon (H + M + P + B*2)
|
|
8
|
+
method1 = H + M + p_time + B * 2
|
|
9
|
+
|
|
10
|
+
# Method 2: Start menu click on desktop icon (H + M + P + B + M + P + B)
|
|
11
|
+
method2 = H + M + p_time + B + M + p_time + B
|
|
12
|
+
|
|
13
|
+
print(f"{device} KLM Analysis")
|
|
14
|
+
print(f"Method 1 (Desktop Double-Click): {method1:.2f} sec")
|
|
15
|
+
print(f"Method 2 (Start Menu Open): {method2:.2f} sec")
|
|
16
|
+
|
|
17
|
+
klm_analysis("Mouse",1.1)
|
|
18
|
+
klm_analysis("Trackball",1.5)
|
cg_code/hci/hci_p6.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import time
|
|
2
|
+
|
|
3
|
+
# Test 1: Without color coding (Plain Text)
|
|
4
|
+
print("Test 1 (No Color): Find word DANGER from below list? (Position 1-4)")
|
|
5
|
+
print("1. SAFE 2. NORMAL 3. DANGER 4. CLEAR")
|
|
6
|
+
t1 = time.time()
|
|
7
|
+
ans1 = input("Enter position: ")
|
|
8
|
+
time1 = time.time() - t1
|
|
9
|
+
|
|
10
|
+
# Test 2: With Color coding
|
|
11
|
+
print("Test 2 (With Color): Find Red Word Position btw 1-4?")
|
|
12
|
+
print("1. SAFE 2. \033[91mDANGER\033[0m 3. NORMAL 4. CLEAR")
|
|
13
|
+
t2 = time.time()
|
|
14
|
+
ans2 = input("Enter position: ")
|
|
15
|
+
time2 = time.time() - t2
|
|
16
|
+
|
|
17
|
+
# Result Comparision
|
|
18
|
+
print("Result")
|
|
19
|
+
print(f"Without Color -> Correct: {ans1 == "3"}, Time: {time1:.2f} sec")
|
|
20
|
+
print(f"With Color -> Correct: {ans2 == "2"}, Time: {time2:.2f} sec")
|
cg_code/hci/hci_p7.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
print("=== Learning System Feedback Questionnaire ===")
|
|
3
|
+
print("Rating: 1 (Poor) to 5 (Excellent)")
|
|
4
|
+
|
|
5
|
+
q1 = int(input("1. How to easy navigation in Hypermedia system? (1-5): "))
|
|
6
|
+
q2 = int(input("2. How to easy focus on Sequential System? (1-5): "))
|
|
7
|
+
pref = input("3. Which system how more like? (Hypermedia/Sequential): ")
|
|
8
|
+
|
|
9
|
+
print("User Evaluation Summary")
|
|
10
|
+
print(f"Hypermedia Score: {q1}/5")
|
|
11
|
+
print(f"Sequential score: {q2}/5")
|
|
12
|
+
print(f"Prefered System: {pref.capitalize()}")
|
cg_code/hci/hci_p8.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
help_desk = {
|
|
3
|
+
"1":"Password Reset: Goto Login page, click 'Forgot Password' and enter new password with OTP",
|
|
4
|
+
"2":"Slow System: Cache clear from broswer and close extra tabs",
|
|
5
|
+
"3":"Payment Issue: If money debit from your account wait, refund within 24 hours"
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
while True:
|
|
9
|
+
print("Online Support System")
|
|
10
|
+
print("1. Password not remember.")
|
|
11
|
+
print("2. System slow.")
|
|
12
|
+
print("3. Payment failed")
|
|
13
|
+
|
|
14
|
+
choice = input("Choice problem number: ")
|
|
15
|
+
|
|
16
|
+
if choice == "4":
|
|
17
|
+
print("Closing Support System, Thank you!")
|
|
18
|
+
break
|
|
19
|
+
elif choice in help_desk:
|
|
20
|
+
print(f"Solution: {help_desk[choice]}")
|
|
21
|
+
else:
|
|
22
|
+
print("Wrong option selected")
|
cg_code/hci/hci_p9.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import tkinter as tk
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
root = tk.Tk()
|
|
5
|
+
root.title("Drawing Board")
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Drawing Board Using Canvas
|
|
9
|
+
canvas = tk.Canvas(root,width=350,height=220,bg="white")
|
|
10
|
+
canvas.pack()
|
|
11
|
+
|
|
12
|
+
shape = None
|
|
13
|
+
|
|
14
|
+
def draw():
|
|
15
|
+
global shape
|
|
16
|
+
shape = canvas.create_rectangle(50,50,130,90,fill="skyblue")
|
|
17
|
+
|
|
18
|
+
def move():
|
|
19
|
+
if shape: canvas.move(shape,30,20) # 30 in X-axis, 20 in Y-axis
|
|
20
|
+
|
|
21
|
+
def copy():
|
|
22
|
+
if shape:
|
|
23
|
+
x1,y1,x2,y2 = canvas.coords(shape)
|
|
24
|
+
canvas.create_rectangle(x1+20,y1+20,x2+20,y2+20,fill="lightgreen")
|
|
25
|
+
|
|
26
|
+
def rotate():
|
|
27
|
+
if shape:
|
|
28
|
+
x1,y1,x2,y2 = canvas.coords(shape)
|
|
29
|
+
canvas.coords(shape,x1,y1,x1+(y2-y1),y1+(x2-x1))
|
|
30
|
+
|
|
31
|
+
def delete():
|
|
32
|
+
if shape: canvas.delete(shape)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
for text, func in [("Draw",draw),('Move',move),("Copy",copy),("Rotate",rotate)]:
|
|
36
|
+
tk.Button(root,text=text,command=func).pack(side=tk.LEFT,padx=8,pady=8)
|
|
37
|
+
|
|
38
|
+
root.mainloop()
|
|
39
|
+
|
cg_code/nlp/__init__.py
ADDED
|
File without changes
|
cg_code/om/__init__.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from .om_p1_1 import *
|
|
2
|
+
from .om_p1_2 import *
|
|
3
|
+
from .om_p1_3 import *
|
|
4
|
+
from .om_p1_4 import *
|
|
5
|
+
from .om_p2_1 import *
|
|
6
|
+
from .om_p3_1 import *
|
|
7
|
+
from .om_p3_4 import *
|
|
8
|
+
from .om_p4_1 import *
|
|
9
|
+
from .om_all import *
|
|
10
|
+
|
|
11
|
+
from .om_p_2_2 import *
|
|
12
|
+
from .om_p_2_3 import *
|
|
13
|
+
from .om_p_3_2 import *
|
|
14
|
+
from .om_p_3_3 import *
|
|
15
|
+
from .om_p_4_2 import *
|