Skip to content

Instantly share code, notes, and snippets.

View ABcDexter's full-sized avatar
💭
reSearching...

AnubhavB ABcDexter

💭
reSearching...
View GitHub Profile
@ABcDexter
ABcDexter / qa_bot.py
Created February 14, 2026 11:04
GenAI LLM IBM
# Imports
from ibm_watsonx_ai.foundation_models import ModelInference
from ibm_watsonx_ai.metanames import GenTextParamsMetaNames as GenParams
from ibm_watsonx_ai.metanames import EmbedTextParamsMetaNames
from ibm_watsonx_ai import Credentials
from langchain_ibm import WatsonxLLM, WatsonxEmbeddings
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_community.vectorstores import Chroma
from langchain_community.document_loaders import PyPDFLoader
from langchain.chains import RetrievalQA
@karpathy
karpathy / microgpt.py
Last active February 15, 2026 08:21
microgpt
"""
The most atomic way to train and inference a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@rep-movsd
rep-movsd / puzzle.py
Last active May 16, 2021 10:00
Word puzzle checker
#/usr/bin/python
import sys
import json
# open grid file
with open(sys.argv[1]) as f:
lines = [line.rstrip('\n') for line in f]
# make the grid but padded on left right and bottom sides with a sentinel like this (makes it easy to grab diagonals)
const express = require('express');
const request = require('request');
const app = express();
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
next();
});
/* https://puzzling.stackexchange.com/questions/60942/biggest-army-on-a-chessboard
Reminder
Everybody knows that we can place 8 queens in a chessboard without threatening each other (see There). same reasonment can be made for knights, bishops, rooks and kings. Giving respectively 32 knights, 14 bishops, 8 rooks, and 16 kings.
Problem
If we assign to each type of piece a value invertly proportionnal of the number of this we can place. It means Knights = 1/32. Bishop = 1/14. Rook = 1/8. Queen =1/8 and King = 1/16.
What is the best sum value we can achieve mixing these pieces still with none able to take each other?*/
/*
@ABcDexter
ABcDexter / principal_component_analysis.ipynb
Created August 19, 2017 10:21 — forked from infinite-Joy/principal_component_analysis.ipynb
description for principal component analysis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@infinite-Joy
infinite-Joy / principal_component_analysis.ipynb
Last active August 29, 2017 12:21
description for principal component analysis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Installation Instructions:

  • Please install Anaconda 3.5.
  • We will be using Jupyter notebook as our IDE.
  • To check if installed correctly, open the command shell and type: $ jupyter notebook
  • It should fire up a browser. In the browser, select New -> Python (root) from the right-hand top menu. It will open another tab. In the cell, on that new tab, enter the following command : import pandas as pd
  • Click shift+enter to run it. If it runs fine, you are good to go for the workshop.
  • Please post installation issues on this meetup page.
  • Please note that there will be NO installation help provided on the day of the workshop.
  • The datasets for the workshop will be provided on the day of the workshop
#AnubhavBalodhi, Puzzling.SE, 7804, 23216, 314...
N=int(input())
for num in range(N):
for X in range(2,N-8):
if (8*((num*(num+1)-8*(X+3))))==(825*(num-4)):
print(X,num)
#BeDaBe(a)st
@pbaisla
pbaisla / proxy.sh
Last active March 14, 2017 13:29
Script to set system proxy on Linux
#
# Place this script inside /etc/profile.d/ to set proxy on log in
# AND
# Copy-paste in to your ~/.bashrc to switch between proxies easily in shells
#
#
# DEFAULTS
#
# Set default proxy details here. Eg.