Skip to content

Instantly share code, notes, and snippets.

View Neptune998's full-sized avatar
🎯
Focusing

Gopesh Yadav Neptune998

🎯
Focusing
View GitHub Profile
// The name of the Python script that returns the scraped data is scrape_data.py
let scrapeJSON = 'http://bluegalaxy.info/cgi/scrape_data.py'
$.get(scrapeJSON, function(data) {
// Get JSON data from Python script
if (data){
console.log("Data returned:", data)
}
jobDataJSON = JSON.parse(data)
@Neptune998
Neptune998 / scrape_data_using_python.py
Created August 29, 2020 15:18
Here we can scrape data using requests module in Python.
import requests
jsonData = requests.get(r'https://api.stagingjobshq.com/madgexWidgetJobs.php?callback=displayJobs&city=Moorhead&state=Minnesota', verify=False).text.strip()
return jsonData
@Neptune998
Neptune998 / program.slq
Created August 18, 2020 04:48
Program to output 0 or 1
def main(){
x:=H(false);
return measure(x);
}
@Neptune998
Neptune998 / function_Silq.slq
Last active August 18, 2020 09:24
How to write a function in silq
def main() {
x:=H(false);
return measure(x);
}
Read name
echo $name
class Website:
def __init__(self, name, url):
self.name = name
self.url = url
def print_url(self):
print("Name of Website " + self.name + "and URL "+ self.url)
web1 = Website("NeptuneWorld", "https://neptuneworld.in/")
web1.print_url()
@Neptune998
Neptune998 / insertion_recursive_algo.py
Last active August 13, 2020 18:19
Insertion Recursive Algorithm
# Insertion Recursive Algorithm
function insertionSortR(array A, int n)
if n > 0
insertionSortR(A, n-1)
x ← A[n]
j ← n-1
while j >= 0 and A[j] > x
A[j+1] ← A[j]
j ← j-1
end while
@Neptune998
Neptune998 / insertion_algo2.py
Created August 13, 2020 17:18
Insertion Sort Algorithm2
# Insertion Sort Algorithm2
i ← 1
while i < length(A)
x ← A[i]
j ← i - 1
while j >= 0 and A[j] > x
A[j+1] ← A[j]
j ← j - 1
end while
A[j+1] ← x
@Neptune998
Neptune998 / insertion_algo.py
Created August 13, 2020 17:15
Insertion Sort Algorithm
# Insertion Sort Algorithm
i ← 1
while i < length(A)
j ← i
while j > 0 and A[j-1] > A[j]
swap A[j] and A[j-1]
j ← j - 1
end while
i ← i + 1
end while
@Neptune998
Neptune998 / insertion_sort.py
Last active August 13, 2020 18:18
Insertion Sort
# Insertion sort
def Insertion_sort(arr, itr):
lgth = len(arr)
for i in range(1,lgth):
x,j = arr[i],i-1
while j>=0 and arr[j]>x:
arr[j+1] = arr[j]
j-=1
arr[j+1] = x
print("Iteration:",i,arr)