Skip to content

Instantly share code, notes, and snippets.

View Kamalabot's full-sized avatar
💭
Working on Pytorch and Python Coding

Kamalabot

💭
Working on Pytorch and Python Coding
View GitHub Profile
# 1st approach:
def kth_largest(arr, k):
for i in range(k-1):
arr.remove(max(arr))
return max(arr)
# 2nd approach:
def kth_largest(arr, k):
n = len(arr)
@Kamalabot
Kamalabot / QuoraAnswers.csv
Last active January 22, 2024 17:58
The gist will be the source for multiple data sets
We can't make this file beautiful and searchable because it's too large.
slNo,Questions,Answers,Questions_formed,Answers_formed
0,Im-a-high-school-student-and-Im-interested-in-AI-Where-do-I-start-looking-into-it,"Start by learning to program and problem solving using computer languages.
AI is, what you call a self programming program. You give the AI program the data, it will comes out with its own model program to solve the problem.
If that is correct then, you as a human first need to know how to program, and check whether AI has programmed itself correctly. If you find an error in AI behaviour, then you jump in and correct the relevant code.
Learn problem solving by posting your code to online judges. I have written about it in another question. Search for it, you will get some good idea.
Language easiest to pickup currently are, Python, R and recently Julia is becoming popular. Once you master one language then think about C++
have good time learnin.",Im a high school student and Im interested in AI Where do I start looking into it?,Start by learning to program and problem sol
@nikhilkumarsingh
nikhilkumarsingh / wikitable.ipynb
Created July 11, 2020 07:45
Reading Wikipedia Tables using Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Konamiman
Konamiman / 0. WiFi for Ethernet-only devices via Raspberry Pi.md
Last active December 10, 2023 13:27
How to use a Raspberry Pi to provide WiFi for Ethernet-only devices, and how to use stunnel as a SOCKS server ro provide indirect TLS support

What's this?

I love MSX computers. I have developed quite a few things for them, including a TCP/IP stack and some networking applications. Some other MSX nerds have developed networking hardware, so boom! Here it is, Internet access from MSX, a 1980s 8 bit machine. How cool is that?

However there are a few issues that prevent us the MSX users to reach the absolute networking happiness:

  1. At the time of this writing, there isn't any solution for wireless Internet for MSX, only Ethernet hardware.
  2. InterNestor Lite, the TCP/IP stack for MSX, doesn't support TLS. It's not that the developer (me!) is too lazy to implement it, it's just that a Z80 can't handle the required encryption algorythms. Trust me, I tried.

So

@j40903272
j40903272 / Install_python3.7.md
Last active December 3, 2023 13:24
Install python3.7

Install from apt

  1. setup
python3 -V
apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
apt update
@rtimmons
rtimmons / slides.md
Created June 21, 2018 18:11
Learning C++ The Hard Way

Welcome

Who is this guy?

Goal(s)

  1. Don't WTF quite so much when looking at C++ PRs
  2. Know what you don't know (so you know what to look up to learn more)

Agenda

@mtucker
mtucker / creating_a_date_dimension_table_in_postgresql.sql
Last active December 14, 2022 14:04 — forked from duffn/creating_a_date_dimension_table_in_postgresql.sql
Creating a date dimension table in PostgreSQL
DROP TABLE if exists d_date;
CREATE TABLE d_date
(
date_dim_id INT NOT NULL,
date_actual DATE NOT NULL,
epoch BIGINT NOT NULL,
day_suffix VARCHAR(4) NOT NULL,
day_name VARCHAR(9) NOT NULL,
day_of_week INT NOT NULL,
@jakebrinkmann
jakebrinkmann / connect_psycopg2_to_pandas.py
Created July 3, 2017 14:19
Read SQL query from psycopg2 into pandas dataframe
import pandas as pd
import pandas.io.sql as sqlio
import psycopg2
conn = psycopg2.connect("host='{}' port={} dbname='{}' user={} password={}".format(host, port, dbname, username, pwd))
sql = "select count(*) from table;"
dat = sqlio.read_sql_query(sql, conn)
conn = None
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active May 19, 2024 03:58
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@benbacardi
benbacardi / gist:227f924ec1d9bedd242b
Last active May 12, 2024 09:55
Django reverse with a querystring
from django.utils.http import urlencode
def reverse_querystring(view, urlconf=None, args=None, kwargs=None, current_app=None, query_kwargs=None):
'''Custom reverse to handle query strings.
Usage:
reverse('app.views.my_view', kwargs={'pk': 123}, query_kwargs={'search': 'Bob'})
'''
base_url = reverse(view, urlconf=urlconf, args=args, kwargs=kwargs, current_app=current_app)
if query_kwargs:
return '{}?{}'.format(base_url, urlencode(query_kwargs))