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
function uniqueSum(arr) { | |
if(!arr || arr.length === 0){ | |
return 0 | |
} | |
const stringArr = arr.map(function(num) { | |
return num.toString(); | |
}) | |
let runningSum = 0; |
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
# -*- coding: utf-8 -*- | |
"""matchy_matchy.ipynb | |
Automatically generated by Colaboratory. | |
Original file is located at | |
https://colab.research.google.com/drive/1CCjJxeSXELh08NWzuKw4WDX8Aun8gMiy | |
""" | |
from google.colab import files |
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 torch | |
import pandas as pd | |
from multi_label_class import MultiTaskBertModel # Import the model class | |
from transformers import AutoTokenizer | |
def load_model(model_path, device): | |
model = MultiTaskBertModel.from_pretrained("bert-base-cased") | |
model.load_state_dict(torch.load(model_path, map_location=device)) | |
model.to(device) |
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 csv | |
import json | |
# Define the input and output file names | |
input_csv_file = 'connection_data.csv' | |
output_json_file = 'connection_data.json' | |
# Function to preprocess text according to the specified rules | |
def preprocess_text(text): | |
# Replace internal double quotes with two double quotes |
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
function ArrayQueue(capacity) { | |
this.capacity = capacity; | |
this.start = 0; | |
this.end = 0; | |
this.length = 0; | |
this.a = new Array(capacity); | |
this.add = function(num) { | |
if(this.length == this.a.length) { | |
console.log('MAX CAPACITY'); |
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 xml.etree import ElementTree | |
from xml import etree | |
#in order to test it you have to create testing.xml file in the folder with the script | |
xmlParsedWithET = ElementTree.parse("testing.xml") | |
root = xmlParsedWithET.getroot() | |
def CDATA(text=None): | |
element = ElementTree.Element('![CDATA[') | |
element.text = text |
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 matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import numpy as np | |
import matplotlib.patches as mpatches # needed for waffle Charts | |
from wordcloud import WordCloud, STOPWORDS | |
from PIL import Image | |
import seaborn as sns | |
import pdb | |
import sys |
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
# frozen_string_literal: true | |
source "https://rubygems.org" | |
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
# gem "rails" | |
gem 'kimurai' | |
gem 'nokogiri' | |
gem 'mechanize' |
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 matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import numpy as np | |
import matplotlib.patches as mpatches # needed for waffle Charts | |
from wordcloud import WordCloud, STOPWORDS | |
from PIL import Image | |
import seaborn as sns | |
import pdb | |
from stats_reader import NCAA_DATA_FRAME as df |
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
require 'httparty' | |
require 'mechanize' | |
require 'Nokogiri' | |
require 'csv' | |
require 'pry' | |
inputs = ARGV | |
if !inputs then | |
raise "Input a year from 2018 to 2002" | |
end |
NewerOlder