I have University exam in 30 days. Give me plan. Analyze both haq and pyqs
cd /home/daytona/workspace && python3 -c " import pdfplumber # Extract HAQs haq_text = [] with pdfplumber.open('/home/daytona/workspace/attachments/ea66219f-da03-4c8f-9e6c-b5d3007d78cf/FMT HAQs 1st Edtn (2).pdf') as pdf: print(f'HAQ PDF pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages[:20]): t = page.extract_text() if t: haq_text.append(f'--- PAGE {i+1} ---\n{t}') with open('/home/daytona/workspace/haq_extract.txt', 'w') as f: f.write('\n'.join(haq_text)) print('HAQ extraction done, chars:', sum(len(x) for x in haq_text)) "
cd /home/daytona/workspace && python3 -c " import pdfplumber # Extract PYQs pyq_text = [] with pdfplumber.open('/home/daytona/workspace/attachments/ea66219f-da03-4c8f-9e6c-b5d3007d78cf/P 10 Years FMT.pdf') as pdf: print(f'PYQ PDF pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages[:30]): t = page.extract_text() if t: pyq_text.append(f'--- PAGE {i+1} ---\n{t}') with open('/home/daytona/workspace/pyq_extract.txt', 'w') as f: f.write('\n'.join(pyq_text)) print('PYQ extraction done, chars:', sum(len(x) for x in pyq_text)) "
python3 -c " import pdfplumber # Try all pages of PYQ with more detail with pdfplumber.open('/home/daytona/workspace/attachments/ea66219f-da03-4c8f-9e6c-b5d3007d78cf/P 10 Years FMT.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): t = page.extract_text() if t and len(t.strip()) > 50: print(f'--- PAGE {i+1} (readable) ---') print(t[:500]) print() "
python3 -c " # Convert PYQ PDF pages to images for OCR via analyse_media # First check if pdf2image / poppler is available import subprocess result = subprocess.run(['pdftoppm', '-h'], capture_output=True) print('pdftoppm available:', result.returncode in [0,1]) # Try converting first few pages to images import os os.makedirs('/home/daytona/workspace/pyq_imgs', exist_ok=True) result2 = subprocess.run( ['pdftoppm', '-r', '150', '-png', '-f', '3', '-l', '7', '/home/daytona/workspace/attachments/ea66219f-da03-4c8f-9e6c-b5d3007d78cf/P 10 Years FMT.pdf', '/home/daytona/workspace/pyq_imgs/page'], capture_output=True, text=True ) print('stdout:', result2.stdout) print('stderr:', result2.stderr[:200]) print('Files:', os.listdir('/home/daytona/workspace/pyq_imgs')) "
python3 -c " # Convert more pages - pages 3-21 cover the main content import subprocess, os # Already have 3-7, now get 8-21 result = subprocess.run( ['pdftoppm', '-r', '150', '-png', '-f', '8', '-l', '21', '/home/daytona/workspace/attachments/ea66219f-da03-4c8f-9e6c-b5d3007d78cf/P 10 Years FMT.pdf', '/home/daytona/workspace/pyq_imgs/page'], capture_output=True, text=True ) print('Files count:', len(os.listdir('/home/daytona/workspace/pyq_imgs'))) print(sorted(os.listdir('/home/daytona/workspace/pyq_imgs'))) "
python3 -c " # Start a simple HTTP server to serve images for analyse_media import subprocess, os # Let's instead use base64 approach or just read images as files # Check if we can use a local file URL approach # Actually for analyse_media we need a public URL # Let's try using python http.server in background import threading, http.server, os os.chdir('/home/daytona/workspace/pyq_imgs') print('Images ready for serving from /home/daytona/workspace/pyq_imgs') print(os.listdir('.')) "
python3 -c " import pdfplumber # Get ALL pages of HAQ for completeness haq_full = [] with pdfplumber.open('/home/daytona/workspace/attachments/ea66219f-da03-4c8f-9e6c-b5d3007d78cf/FMT HAQs 1st Edtn (2).pdf') as pdf: for i, page in enumerate(pdf.pages): t = page.extract_text() if t: haq_full.append(f'=== PAGE {i+1} ===\n{t}') full = '\n'.join(haq_full) with open('/home/daytona/workspace/haq_full.txt', 'w') as f: f.write(full) print('Total chars:', len(full)) print('Total pages with text:', len(haq_full)) "
python3 -c " # Try to host images locally via HTTP for analyse_media # Actually let's try a different approach: use pytesseract for OCR on the PYQ images import subprocess result = subprocess.run(['tesseract', '--version'], capture_output=True, text=True) print('tesseract:', result.stdout[:100], result.stderr[:100]) # Also try reading PYQ PDF with pymupdf (fitz) which may handle it better try: import fitz doc = fitz.open('/home/daytona/workspace/attachments/ea66219f-da03-4c8f-9e6c-b5d3007d78cf/P 10 Years FMT.pdf') print(f'PyMuPDF: {len(doc)} pages') for i in range(min(8, len(doc))): page = doc[i] text = page.get_text() if text.strip(): print(f'Page {i+1}: {text[:300]}') print() except ImportError: print('fitz not available') "
python3 -c " import subprocess, os imgs_dir = '/home/daytona/workspace/pyq_imgs' output_dir = '/home/daytona/workspace/pyq_ocr' os.makedirs(output_dir, exist_ok=True) imgs = sorted(os.listdir(imgs_dir)) print(f'OCRing {len(imgs)} images...') all_text = [] for img in imgs: img_path = os.path.join(imgs_dir, img) out_base = os.path.join(output_dir, img.replace('.png', '')) result = subprocess.run( ['tesseract', img_path, out_base, '-l', 'eng'], capture_output=True, text=True ) txt_file = out_base + '.txt' if os.path.exists(txt_file): with open(txt_file) as f: content = f.read().strip() if content: all_text.append(f'=== {img} ===\n{content}') combined = '\n\n'.join(all_text) with open('/home/daytona/workspace/pyq_ocr_combined.txt', 'w') as f: f.write(combined) print('OCR done. Total chars:', len(combined)) print('First 1000 chars:') print(combined[:1000]) "
python3 << 'EOF' # Frequency analysis of PYQ topics import re with open('/home/daytona/workspace/pyq_ocr_combined.txt') as f: pyq_text = f.read() # Key topics to count topics = { "Hanging / Asphyxia": ["hang", "asphyxia", "strangul", "drowning", "suffoc"], "Medical Negligence / Ethics": ["negligence", "malpractice", "vicarious", "privileged communication", "euthanasia", "infamous", "NMC", "MCI"], "Poisoning": ["poison", "methanol", "lead", "arsenic", "alcohol", "opium", "plumbism", "organophos"], "Postmortem Changes": ["rigor mortis", "livor", "lividity", "algor", "putref", "postmortem change", "mummif", "adipocere"], "Abortion / MTP": ["abortion", "MTP", "Medical Termination"], "Infanticide": ["infanticide", "live birth", "hydrostatic", "battered baby", "maceration"], "Skull Fractures / Head Injuries": ["skull fracture", "coup", "contre coup", "head injury"], "Wounds / Mechanical Injuries": ["stab wound", "incised", "laceration", "bruise", "abrasion", "firearm", "bullet"], "Burns / Thermal": ["burn", "pugilistic", "joule burn", "rule of 9"], "Sexual Offences": ["rape", "virginity", "hymen", "sexual assault"], "Identification": ["dactylography", "fingerprint", "superimposition", "gustafson"], "Forensic Psychiatry": ["insanity", "delusion", "testamentary", "lucid interval", "McNaughten"], "Inquest / Legal Procedures": ["inquest", "dying declaration", "perjury", "summons", "evidence"], "Firearm Injuries": ["firearm", "bullet", "gunshot", "rifle", "entry wound", "exit wound"], } print("=== PYQ TOPIC FREQUENCY ===") topic_counts = {} for topic, keywords in topics.items(): count = sum(pyq_text.lower().count(kw.lower()) for kw in keywords) topic_counts[topic] = count for topic, count in sorted(topic_counts.items(), key=lambda x: -x[1]): print(f" {topic}: {count}") EOF
| Priority | Topic | PYQ Hits | HAQ Stars | Verdict |
|---|---|---|---|---|
| ๐ด MUST | Hanging & Asphyxia | 30 | โ โ โ โ โ | Essay every year |
| ๐ด MUST | Poisoning (Esp. Lead, Methanol, Organophosphate, Alcohol) | 33 | โ โ โ โ โ | Short notes every year |
| ๐ด MUST | Medical Negligence / Ethics / NMC | 14 | โ โ โ โ โ โ โ | Essay or LAQ |
| ๐ด MUST | Abortion / MTP Act | 10 | โ โ โ โ | Essay alternate years |
| ๐ด MUST | Infanticide / Live Birth / Hydrostatic Test | 6 | โ โ โ โ | Short note every year |
| ๐ก HIGH | Inquest / Legal Procedures / Dying Declaration | 12 | โ โ โ โ | Short notes regularly |
| ๐ก HIGH | Postmortem Changes (Rigor, Livor, Algor, Adipocere) | 6 | โ โ โ โ โ | Short notes regularly |
| ๐ก HIGH | Forensic Psychiatry (Insanity, Delusions, Testamentary Capacity) | 9 | โ โ โ โ | Short notes regularly |
| ๐ก HIGH | Skull Fractures / Head Injuries / Coup-Contrecoup | 4 | โ โ โ โ | Short notes every 2 years |
| ๐ก HIGH | Firearm Injuries (Entry/Exit wound, Types) | 9 | โ โ โ โ | Short notes |
| ๐ข MEDIUM | Burns / Thermal (Pugilistic, Rule of 9, Joule Burn) | 7 | โ โ โ | Brief notes |
| ๐ข MEDIUM | Wounds / Mechanical Injuries (Stab, Laceration, Bruise) | 8 | โ โ โ | Brief notes |
| ๐ข MEDIUM | Sexual Offences / Virginity / Hymen | 2 | โ โ โ | Occasional |
| ๐ข MEDIUM | Identification (Fingerprint, Gustafson's, Superimposition) | 3 | โ โ โ | Brief notes |
| ๐ต LOW | Trace Evidence / DNA / Narco Analysis | - | โ โ โ | Occasional brief |
| Day | Date | Topic | Key Points from HAQ |
|---|---|---|---|
| 1 | Jul 12 | Inquest - Types, Police & Magistrate Procedure | โ โ โ โ โ โ โ in HAQ |
| 2 | Jul 13 | Evidence, Dying Declaration, Dying Deposition | โ โ โ โ โ |
| 3 | Jul 14 | Medical Negligence - Define, Elements, Types, Res Ipsa Loquitur | โ โ โ โ โ |
| 4 | Jul 15 | Vicarious Liability, Civil vs Criminal Negligence, NMC/MCI | โ โ โ โ โ |
| 5 | Jul 16 | Privilege Communication, Informed Consent, Euthanasia | โ โ โ โ โ โ โ |
| 6 | Jul 17 | Subpoena, Perjury, Conduct Money, Expert Witness | โ โ โ โ |
| 7 | Jul 18 | Revision Day: Full Legal System + Write 1 mock answer on Negligence | - |
| Day | Date | Topic | Key Points from HAQ |
|---|---|---|---|
| 8 | Jul 19 | Postmortem Changes: Rigor Mortis (Nysten's Rule, Rule of 12), Algor Mortis | โ โ โ โ โ |
| 9 | Jul 20 | Livor Mortis, Tache Noir, Changes in Eye, Putrefaction, Marbling | โ โ โ โ โ |
| 10 | Jul 21 | Mummification, Adipocere, Cadaveric Spasm - compare & contrast | โ โ โ โ |
| 11 | Jul 22 | Forensic Psychiatry: Insanity, Civil & Criminal Responsibility, McNaughten Rule | โ โ โ โ |
| 12 | Jul 23 | Delusions, Hallucinations, Lucid Interval, Testamentary Capacity, Sec 84 IPC | โ โ โ โ โ |
| 13 | Jul 24 | Identification: Gustafson's, Dactylography, Skull Superimposition, Tattoo | โ โ โ โ |
| 14 | Jul 25 | Revision Day: Write mock answers on Rigor Mortis + Insanity | - |
| Day | Date | Topic | Key Points |
|---|---|---|---|
| 15 | Jul 26 | Mechanical Injuries: Abrasion, Contusion/Bruise (Ageing), Laceration | โ โ โ โ |
| 16 | Jul 27 | Incised Wound, Stab Wound, Chop Wound, Hesitation Cuts, Harakiri | โ โ โ โ |
| 17 | Jul 28 | Skull Fractures (Types), Coup-Contrecoup, Pedestrian RTA Injuries | โ โ โ โ |
| 18 | Jul 29 | Firearm Injuries: Entry/Exit wound (rifle), Gunshot range, Abrasion collar | โ โ โ โ |
| 19 | Jul 30 | HANGING - Define, classify, types, PM findings, causes of death, judicial hanging | โ โ โ โ โ โ ESSAY |
| 20 | Jul 31 | Strangulation, Drowning (fresh vs salt water, PM findings, Diatoms) | โ โ โ โ โ |
| 21 | Aug 1 | Suffocation types, Cafรฉ Coronary, Traumatic Asphyxia, Tardieu Spots | โ โ โ โ |
| Day | Date | Topic | Key Points |
|---|---|---|---|
| 22 | Aug 2 | Poisoning General: Classification, Medico-legal aspects, Locard's principle | โ โ โ โ |
| 23 | Aug 3 | Lead Poisoning (Plumbism) - features, PM findings, treatment | โ โ โ โ โ |
| 24 | Aug 4 | Alcohol (Ethanol vs Methanol), Organophosphates, Corrosives | โ โ โ โ โ |
| 25 | Aug 5 | Abortion / MTP Act 2021 - Define, classify, criminal abortion, methods, complications | โ โ โ โ โ โ |
| 26 | Aug 6 | Infanticide - Define, live born vs dead born, Hydrostatic Test, Battered Baby | โ โ โ โ โ |
| 27 | Aug 7 | Burns: Rule of 9, Pugilistic attitude, Joule burns, Lichtenberg flowers, Frostbite | โ โ โ โ |
| 28 | Aug 8 | Sexual Offences: Rape (IPC), Virginity signs, Hymen types, Impotence/Sterility | โ โ โ โ |
| Day | Date | Task |
|---|---|---|
| 29 | Aug 9 | Solve 3 full PYQ papers (timed). Identify gaps. Focus on Trace Evidence, DNA, NDPS Act |
| 30 | Aug 10 | Write answers to all previous Essay questions from memory. Quick revision of ALL VSAQs |
| 31 | Aug 11 | Light revision - only high-starred HAQ VSAQs. No new topics. Sleep well. |