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 cv import * #bad practice, its just that am bit lazy | |
def GetThresholdedImage(img): | |
#returns thresholded image of the blue bottle | |
imgHSV = CreateImage(GetSize(img), 8, 3) | |
#converts a BGR image to HSV | |
CvtColor(img, imgHSV, CV_BGR2HSV) | |
imgThreshed = CreateImage(GetSize(img), 8, 1) | |
#InRangeS takes source, lowerbound color, upperbound color and destination | |
#It converts the pixel values lying within the range to 255 and stores it in |
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 test.areaundercurve; | |
public class AreaUnderCurve { | |
public double getAreaUnderCurve(Term[] equation, int limit1, int limit2){ | |
double ret =0.0; | |
if(limit1 == limit2) return ret; //when limits are equal the area under the curve is equal | |
//Write your code here | |
int 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 test.decodethecode; | |
import java.util.HashMap; | |
import java.util.regex.Pattern; | |
import java.util.regex.Matcher; | |
public class DecodeTheCode { | |
HashMap<String, String> encodings = new HashMap<String, String>(); | |
public void hashInit() { |
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 java.util.*; | |
class Pair { | |
private final int left; | |
private final int right; | |
public Pair(int left, int right) { | |
this.left = left; | |
this.right = right; | |
} |
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.adp.invertbit; | |
public class InvertBit { | |
public char invertBit(char inputChar, int position, int noOfPositions) { | |
//Write your code here | |
int rem = (char)inputChar; //the reminder in each stage of division | |
byte[] charArr = new byte[8]; //storing the bit representation | |
int i = 7; |
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 main { | |
public static void main(String args[]) { | |
System.out.print("hello bloody world"); | |
} | |
} |