Skip to content

Instantly share code, notes, and snippets.

View srishilesh's full-sized avatar
🤖

Srishilesh P S srishilesh

🤖
View GitHub Profile
@srishilesh
srishilesh / Data Preprocessing
Last active May 9, 2019 08:57
Data preprocessing
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('./Data.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 3].values
@srishilesh
srishilesh / express-server-side-rendering.md
Created July 25, 2019 08:16 — forked from joepie91/express-server-side-rendering.md
Rendering pages server-side with Express (and Pug)

Terminology

  • View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
  • View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
  • HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
  • String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
@srishilesh
srishilesh / boston_house_federated_learning.ipynb
Created March 22, 2020 14:12
Boston_house_Federated_learning
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Hello all

@srishilesh
srishilesh / Event_XML.xml
Last active November 4, 2020 16:06
A sample XML file used for validation using XSD
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="validation_xsd.xsd">
<event>
<event_id>1</event_id>
<event_name>ICPC</event_name>
<event_desc>5 coding questions in 2 hrs</event_desc>
<event_tags>
<tag id="1" displayName="coding">coding</tag>
</event_tags>
<event_type_participation>Team</event_type_participation>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" />
<xs:element name="root" type="rootType" />
<xs:complexType name="rootType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="event" type="eventType" />
</xs:sequence>
</xs:complexType>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css" />
<link rel="stylesheet" href="tablecss.css" />
<!-- <link rel="stylesheet" href="../css/style.css" /> -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Sofia" />
/* USE OF GOOGLE FONTS - GOOGLE STYLESHEET IMPORTED IN HTML FILE*/
#table-title{
color: rgb(88, 40, 49);
font-family: "Times New Roman";
align-items: center;
}
/* EXAMPLE OF ELEMENT SELECTOR */
/* BORDER PROPERTY APPLIED FOR TABLE */
table {
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="events_xsl.xsl"?>
<root>
<event>
<event_id>1</event_id>
<event_name>ICPC</event_name>
<event_desc>5 coding questions in 2 hrs</event_desc>
<event_type_participation>Team</event_type_participation>
<event_timing>
<event_start_datetime>2020-04-01T10:00:00</event_start_datetime>
@srishilesh
srishilesh / voc2coco.py
Created January 11, 2022 18:00
Conversion of PASCAL VOC to COCO
import os
import argparse
import json
import xml.etree.ElementTree as ET
from typing import Dict, List
from tqdm import tqdm
import re
import xmltodict
import numpy as np