Skip to content

Instantly share code, notes, and snippets.

View SanjayShetty01's full-sized avatar

Sanjaya J Shetty SanjayShetty01

View GitHub Profile
title author date
Futures-Options Arbitrage Trade
Sanjaya J Shetty
2022-06-02

What are Futures and Options?


@SanjayShetty01
SanjayShetty01 / Rank_languages_by_popularity.R
Created September 10, 2023 05:13
This R script serves as a solution to a task on the Rosetta Code website. It uses the rvest and dplyr libraries to scrape data from the Rosetta Code website, specifically ranking programming languages by popularity based on task entries. The script fetches data from the website, processes it, and presents insights into the popularity of programm…
library(rvest)
library(dplyr)
options(stringsAsFactors=FALSE)
# getting the required table from the rosetta website
langUrl <- "https://rosettacode.org/wiki/Rosetta_Code/Rank_languages_by_popularity/Full_list"
langs <- read_html(langUrl) %>%
html_nodes(xpath='/html/body/div/div/div[1]/div[3]/main/div[2]/div[3]/div[1]/table') %>%
html_table() %>%
data.frame() %>%

Implementing Linear Regression from Scratch

Theory

The Formula for Linear Regression:

 y = a + bx

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
title author date
Implementing INDIAVIX in R
Sanjaya J Shetty
2022-06-15

Calculating India Vix from scratch using R.

We would be referring to the NSE Website for calculating the India Vix Index.

@SanjayShetty01
SanjayShetty01 / what-makes-people-buy-houses_githubcopy.ipynb
Created September 10, 2023 06:30
what makes people buy houses_githubCopy.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SanjayShetty01
SanjayShetty01 / reading_files.scala
Created September 10, 2023 06:44
Different ways to read files in Scala
package fileReader
// four nice ways to read files in scala
import org.apache.commons.io.FileUtils
import java.io.File
import java.util.Scanner
import scala.io.Source
@SanjayShetty01
SanjayShetty01 / OOP_introduction.scala
Created September 10, 2023 06:46
Rock the JVM OOP introduction in Scala
package oopPractice
object ObjectOrientation extends App {
// the extends App: public static void main(String[] args)
class Animal { // class
// creating fields
val age: Int = 0
// define methods
@SanjayShetty01
SanjayShetty01 / GetScreenColorInLinux.sc
Created December 3, 2023 17:47
Script to get color from the screen in Linux using Scala
import scala.sys.process._
val hex_value = "grabc -hex".!!
val clipboard = java.awt.Toolkit.getDefaultToolkit.getSystemClipboard
val sel = new java.awt.datatransfer.StringSelection(hex_value)
clipboard.setContents(sel, sel)
@SanjayShetty01
SanjayShetty01 / library_handling_in_R.R
Created December 26, 2023 06:32
Function for Handling Library in R
create_package_path <- function(r_version){
r_version_character <- as.character(r_version)
new_path <- sub("/\\d+\\.\\d+$",
paste0("/", r_version_character), .libPaths())
return(new_path)
}
get_old_packages <- function(old_r_version, path = NULL){
if (is.null(path)) {
old_package_path <- create_package_path(old_r_version)