This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| public class vowelBefore { | |
| public static void main(String[] args) { | |
| //Only lower case letters. | |
| //Not a good solution, sliding window should be used but as 1 marks and a hurry, so can do | |
| StringBuffer sb = new StringBuffer("nitin"); | |
| StringBuffer vowel = new StringBuffer(); | |
| StringBuffer consonent = new StringBuffer(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| public class Ques1 { | |
| static String OctToBin(String octnum) | |
| { | |
| long i = 0; | |
| String binary = ""; | |
| while (i<octnum.length()) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| public class WordPuzzle { | |
| public static void main(String[] args) { | |
| int n = 3; | |
| String s = "apple"; | |
| char grid[][] = {{'p','p','e'},{'l','a','d'},{'e','b','z'}}; | |
| System.out.println(exist(grid,s)); | |
| } | |
| public static boolean exist(char[][] board, String word) { | |
| int m = board.length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import reduce | |
| # Python Lists | |
| a = [1,2,3,4,5] | |
| a.append(10) # Adds to the list | |
| a.remove(1) #removes the specified element | |
| a.insert(1,20) #Inserts at specified index | |
| len(a) #Gives the num of elements in teh array | |
| a.pop() #Gives the last element of the array. | |
| a.reverse() #reverses the array | |
| a.sort() #Sorts the array in ascending order |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import email | |
| import getpass, imaplib | |
| import os | |
| import sys | |
| import threading | |
| import json | |
| import time | |
| import emoji | |
| import pymysql | |
| from twilio.twiml.messaging_response import MessagingResponse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask,request | |
| app = Flask(__name__) | |
| @app.route('/') | |
| def hello(): | |
| review = request.args['review'] | |
| print(review) | |
| response = { | |
| "tags":["Open At Night","Bad Staff","Great to party"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>My Farmers</title> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> | |
| <link rel="stylesheet" type="text/css" href="./dash.css"> | |
| <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"> | |
| </head> | |
| <body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sklearn.feature_selection import SelectKBest, chi2 | |
| X_new = SelectKBest(chi2, k=3).fit_transform(X,d) | |
| X_new.shape | |
| features_columns = df.columns | |
| fs = SelectKBest(k=5) | |
| fs.fit(X,d) | |
| print((fs.get_support(),features_columns)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sklearn.feature_selection import SelectKBest, chi2 | |
| X_new = SelectKBest(chi2, k=3).fit_transform(X,d) | |
| X_new.shape | |
| features_columns = df.columns | |
| fs = SelectKBest(k=5) | |
| fs.fit(X,d) | |
| print((fs.get_support(),features_columns)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sklearn.feature_selection import SelectKBest, chi2 | |
| X_new = SelectKBest(chi2, k=3).fit_transform(X,d) | |
| X_new.shape | |
| feature_1 = X_new[:,:1] | |
| feature_2 = X_new[:,1:2] | |
| feature_3 = X_new[:,2:3] | |
| diagnosis = df['diagnosis'].to_numpy() |