Skip to content

Instantly share code, notes, and snippets.

"""
Find the nearest BTS (Base Transceiver Station) using FAISS
and calculate the actual geodesic (Haversine) distance.
"""
import faiss
import numpy as np
from geopy.distance import geodesic
import React from 'react'
const Signup = ({ signup }) => {
return (
<div>
<center><h1>User Created</h1></center>
<div class="card">
<div class="card-body">
<h5 class="card-title">{signup.username}</h5>
<h6 class="card-subtitle mb-2 text-muted">{signup.email}</h6>
import './App.css';
import React, { Component } from 'react';
import Signup from './components/signup'
class App extends Component {
state = {
signup: []
}
import pandas
df = pandas.read_excel("customer.xlsx")
# Replace na values with None
df = df.where(df.notnull(), None)
customer_dic = df.to_dict(orient="records")
print(customer_dic)
{
"categorization": {
"properties": {
"action": {
"type": "keyword"
},
"timestamp": {
"type": "date"
},
"post": {
@Jaxx0
Jaxx0 / learn_it.go
Created February 6, 2020 08:28
Go basics
package main
import (
"encoding/json"
"errors"
"fmt"
"math"
"strings"
)
@Jaxx0
Jaxx0 / video_chat.html
Created July 17, 2019 11:00
Video chat application using jssip version jssip-3.2.12.min.js It initiates and receives videa calls automatically.
<html>
<head>
<!DOCTYPE html>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>x-ziddi Video Chat</title>
<script src="jssip-3.2.12.min.js"> </script>
</head>
class ShoppingCart(object):
def __init__(self):
self.items = {}
self.total = 0
def add_item(self, item_name, quantity, price):
self.total += price * quantity
self.items.update({item_name:quantity})
def remove_item(self, item_name, quantity, price):
@Jaxx0
Jaxx0 / Fizzbuzz Concat challenge
Last active May 23, 2019 19:01
A short program that prints each number from 1 to n on a new line. For each multiple of 3, print "Fizz" instead of the number. For each multiple of 5, print "Buzz" instead of the number. For numbers which are multiples of both 3 and 5, print "FizzBuzz" instead of the number.
import itertools
with open (file='fizz') as f:
list = [line.rstrip('\n') for line in f.readlines()]
iterations = list.pop()
# print(iterations)
# print(list)
product = []
count = 0
numbers = []