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
package com.c3po.own; | |
public class Puzzle17 { | |
public static void main(String args[]) { | |
Puzzle17 puz = new Puzzle17(); | |
int NUMBER_OF_PEOPLE = 1000; | |
int[] handshakes = new int[NUMBER_OF_PEOPLE+1]; | |
for(int i=1; i <= NUMBER_OF_PEOPLE; i++) { | |
handshakes[i] = puz.numberOfHandshakes(i); | |
} |
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
# -*- coding: utf-8 -*- | |
"""BrexRainbowGAN.ipynb | |
Author: Anoop Dixith | |
For Brex Rainbow initiative: https://www.facebook.com/BrexHQ/posts/932319587222145 | |
""" | |
import tensorflow as tf | |
import glob |
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
import urllib2, re | |
from BeautifulSoup import BeautifulSoup | |
def find_warnings(*urls): | |
for url in urls: | |
soup = BeautifulSoup(urllib2.urlopen(url).read()) | |
for a in soup.findAll('a', href=True): | |
if(a['href'].startswith("/en/") and ":" not in a['href']): | |
city_soup = BeautifulSoup(urllib2.urlopen("http://wikitravel.org" + str(a['href'])).read()) | |
for elem in city_soup(text=re.compile(r'WARNING:|NOTE:')): |
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
package com.practice.algorithms; | |
import com.datastructures.buildingblocks.LinkedListNode; | |
public class ReverseListWithoutExtraSpace { | |
public <T> void printInReverseOrder(LinkedListNode<T> head, LinkedListNode<T> tail) { | |
LinkedListNode<T> next = null; | |
while(head != null) { | |
next = head.next; | |
head.next = tail; |
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
package com.practice.algorithms; | |
public class CheckCounting { | |
public static void countUp(int n) { | |
for(int i=0; i <=n; i++); | |
} | |
public static void countDown(int n) { | |
for(int i=n; i >=0; i--); | |
} |
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
package com.practice.algorithms; | |
public class NumberOfDigits { | |
public static void main(String args[]) { | |
for(int i= 1; i <= 10; i++) { | |
new NumberOfDigits().getAllNumbers(i); | |
} | |
} | |
public void getAllNumbers(int limit) { | |
int[] output = new int[limit]; |