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 | |
# Author: Anup Sawant | |
# Purpose: Doc2vec vectors of Science Direct Articles | |
# Created: 9/21/2015 | |
import sys | |
import os | |
import pandas as pd | |
from pandas import Series, DataFrame |
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
[ | |
[ | |
{ | |
"time": "0", | |
"y": 0 | |
}, | |
{ | |
"time": "1", | |
"y": 0 | |
}, |
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
public int largestSum(int[] A){ | |
if(A.length == 0) return 0; | |
if(A.length == 1) return A[0]; | |
int max = Integer.MIN_VALUE; | |
int curr = 0; | |
for(int i = 0; i < A.length; 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
public class Search{ | |
private int binarySearch(int arr[], int key){ | |
if(arr == null) | |
throw new RuntimeException("Null array found"); | |
int l = 0; // lower limit | |
int h = arr.length - 1; // upper limit | |
int m; | |
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
public class DataSource { | |
private Connection connection = null; | |
private static DataSource datasource = null; | |
// private constructor | |
private DataSource(){ | |
connection = getConnection(); | |
} | |
// method to get an instance. |
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
public class Puzzle{ | |
public Puzzle(){ | |
//TODO | |
} | |
public static String[] sortStrings(String[] arr){ | |
if(arr == null || arr.length == 0 || arr.length == 1) | |
return arr; |
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
public class Puzzle{ | |
public static boolean findAnagrams(String s1, String s2){ | |
if(s1 == null && s2!=null) | |
return false; | |
if(s1!=null && s2==null) | |
return false; | |
if(s1==null && s2==null) | |
return true; | |
if(s1.length()!=s2.length()) |
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
public class Puzzle { | |
public static int[] shuffleCards(int[] cards){ | |
if(cards == null || cards.length==1 || cards.length==0){ | |
return cards; | |
} | |
int cardNumber,hold; | |
for(int i =0; i < cards.length; i++){ | |
cardNumber = (int)(Math.random()*(cards.length-i)) + 1; | |
hold = cards[cardNumber]; | |
cards[cardNumber] = cards[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.operations.search; | |
public class Search{ | |
private int[] arr=null; | |
private int k=0; | |
public Search(int[] arr){ | |
this.arr = arr; | |
if(this.arr == null) | |
throw new SearchException("Cannot accept null array"); |
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
public class Sort{ | |
private int[] arr = null; | |
public Sort(int[] arr) throws SortException{ | |
this.arr = arr; | |
if(this.arr == null) | |
throw new SortException("Null array found"); | |
} |
NewerOlder