This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
// Pattern (n = 4): | |
// 1*2*3*4*17*18*19*20 | |
// --5*6*7*14*15*16 | |
// ----8*9*12*13 | |
// ------10*11 | |
int calcOveralLastNum(int n) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Solving Chinese Columnar Transposition Cipher | |
list_of_words = ['KLTNS AUEIA RDNHC', 'NABEK TYRBO', 'ENDTW YSILA', | |
'OJS BET SVE', 'RASRF EUQUO', 'TAB EGI SLL', 'KMNE SUOL', | |
'OONC DRAR LOII ANTS', 'IENIREA NTSETBL', 'OSAJAHM NKCLECI'] | |
def solve_chinese_cipher(cipher_text): | |
""" Given encrypted cipher_text, returns decrypted secret_message.""" | |
components = cipher_text.split(' ') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!upstart | |
description "ESS Server" | |
author "Aayush Sarva, <aayush@socialcops.org>" | |
env DIRECTORY=/home/dev/electoralsearch_server/ | |
# Specify Runlevel events (Refer [1]) | |
# When to start the service | |
start on runlevel [2345] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"GCD - Greatest Common Divisor" | |
def gcd(a, b): | |
'''Returns GCD of 2 numbers.''' | |
if not b: | |
return a | |
else: | |
return gcd(b, a % b) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instructions: | |
// Compilation Command: gcc mainProgram.c myLibrary.c | |
// Creates required object files. | |
// Execution Command: ./a.out | |
#include <stdio.h> | |
// Including my library |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Task using default Node.js packages | |
var http = require('http'); | |
var urls = ['http://screeningtest.vdocipher.com/file1.txt', | |
'http://screeningtest.vdocipher.com/file2.txt', | |
'http://screeningtest.vdocipher.com/file3.txt', | |
'http://screeningtest.vdocipher.com/file4.txt', | |
'http://screeningtest.vdocipher.com/file5.txt', | |
'http://screeningtest.vdocipher.com/file6.txt', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Project: Apartment Hunt | |
Get Address of properties on Magicbricks.com using Reverse-Geocoding | |
This script asks for the target property URL, reverse geocodes it | |
and prints the address of the property | |
Need: Magicbricks map functionality doesn't let users get directions. | |
Even the exact property address is not visible on the webpage. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########## Default Values ######################### | |
# GitHub Repo URL (Both SSH and HTTPS work) | |
REPO_URL="<YOUR_REPO_URL>" | |
# GitHub branch | |
BRANCH="master" | |
# Docker Image Tag | |
TAG="latest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
import os | |
def get_episode_names(season): | |
episodes = {} | |
print "Making request..." | |
url = "https://en.wikipedia.org/wiki/Friends_(season_%s)#Episodes" % season | |
print url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then | |
// use window.btoa' step. According to my tests, this appears to be a faster approach: | |
// http://jsperf.com/encoding-xhr-image-data/5 | |
function base64ArrayBuffer(arrayBuffer) { | |
var base64 = '' | |
var encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | |
var bytes = new Uint8Array(arrayBuffer) | |
var byteLength = bytes.byteLength |
OlderNewer