Skip to content

Instantly share code, notes, and snippets.

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

AnubhavB ABcDexter

💭
reSearching...
View GitHub Profile
@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.
@shadowfax92
shadowfax92 / flipkart_parser.py
Last active September 2, 2023 09:43
Flipkart Billion dollar sale hack
# Author = Nikhil Venkat Sonti
# email = [email protected]
# github ID = shadowfax92
import sys
from xml.dom.minidom import _get_StringIO
from lxml import html
import requests
import os
import re
import time
@maccath
maccath / nvl_plsql_oracle_examples.sql
Created February 14, 2013 16:19
Examples for the usage of Oracle/PLSQL's NVL() function for substitution of NULL values
# ORACLE/PLSQL - NVL(A, B) EXAMPLES
# If A IS NULL substitute with B
# Example 1. if table b contains values that over-write values in table a
SELECT NVL(b.name, a.name) AS name FROM a left join b on a.id = b.id;
# Example 2. to replace NULL values with an alternative placeholder value
SELECT NVL(a.name, 'Unnamed') AS name FROM a;