compare

Python create list of objects from multiple files showing intersection

拥有回忆 提交于 2019-12-25 08:04:40
问题 I'm reading from two files (lists of datetimes), called A and B. (not necessarily in order) I'd like to create a list of these datetimes as objects: class AB(object): def __init__(self, datetime, a=False, b=False): self.datetime = datetime self.a = a self.b = b a should be set to true if the datetime exists in file A, and b true if datetime exists in file B. (false otherwise) For example: file A: 20111225, 20111226 file B: 20111225, 20111227 List of objects should be: AB(20111225, a = true, b

Compare fields of two unrelated objects

泪湿孤枕 提交于 2019-12-25 07:46:41
问题 I've got two objects of different classes that share some fields with the same name and type. These two objects are not related to each other. There's no possibility for me to create an interface or a parent class. Now I want to compare those shared fields and as far as I know this should be possible using reflection. These are the steps I've written for such a compare method: Field[] inputFields = input.getClass().getDeclaredFields(); for (Field field : inputFields ) { log.info(field.getName

Search through directories for specific Excel files and compare data from these files with inputvalues

99封情书 提交于 2019-12-25 07:34:31
问题 The task: The firm I have gotten a summer-job for has an expanding test-database that consists of an increasing number of subfolders for each project, that includes everything from .jpeg files to the .xlsx's I am interested in. As I am a bit used to Python from earlier, I decided to give it a go at this task. I want to search for exceldocuments that has "test spreadsheet" as a part of its title(for example "test spreadsheet model259"). All the docs I am interested in are built the same way

Javascript/jQuery compare input value to array

前提是你 提交于 2019-12-25 07:28:20
问题 I'm relatively new to javascript and jquery. Right now I have a list of words in a txt file. I store this list in an array, and I want to compare the contents of that array to some user input. If there's a match, that specific word should be displayed. I also use Jasny Bootstrap to perform some typeahead functions to predict which words the user would like to search for. In the current stage, my function finds matches on the first input character. When using more characters the function

comparing object attribute in one array to an object attribute in another array

六眼飞鱼酱① 提交于 2019-12-25 07:27:18
问题 i seem to be having difficulties in accessing and comparing objects in NSMutableArrays in objective c. I'm very new so when explaining , some code would be nice. I have a character class and a characterfound class. The code looks like this: @implementation character @synthesize IDE, name; - (void) dealloc { [text release]; [super dealloc]; } @implementation characterfound @synthesize IDE; - (void) dealloc { [text release]; [super dealloc]; } I have two arrays which are being filled with names

Excel Find column value in another column and return value next to it

人盡茶涼 提交于 2019-12-25 07:17:37
问题 I want to do some manipulation with data in Excel. As a background, I have 2 tables in different sheets with inventory, one is for the material needed to construct a device and the other with the material in stock, both of them have the same components but are sorted different. I want to combine them as follows: The table with the material required needs to know the stock value to verify how many are needed and in that case order them. For example: TABLE 1 SHEET 1 Part # Needed Stock 1234 5 I

AutoIt - Find duplicate images by content?

时光毁灭记忆、已成空白 提交于 2019-12-25 06:44:07
问题 I am looking for a way to find duplicate images using AutoIt. I've looked into PixelSearch and SearchImage but neither do exactly what I need them to do. I am trying to compare 2 images by filename and see if they are the same image (a duplicate). The best way I've thought to do it would be to: 1) Get both image sizes in pixels 2) Use a while loop to get the color of each pixel and store it in an array 3) Check to see if both arrays are equal to each other. Does anybody have any ideas on how

How to compare two dates in AngularJS?

99封情书 提交于 2019-12-25 06:21:10
问题 First of all, I just want to say that I searched Stack Overflow and couldn't quite find the answer to my particular problem, but I apologize if I missed one and this is a duplicate. So I'm making a Task Manager using AngularJS and I have a table with a list of tasks. This is my table code: <thead> <tr> <th><b>ID</b></th> <th><b>Title</b></th> <th><b>Start Date</b></th> <th><b>End Date</b></th> <th><b>Type</b></th> <th></th> </tr> </thead> <tbody> <tr ng-repeat="task in tasks track by $index">

Comparing two list box and displaying the differences (VB.net)

人盡茶涼 提交于 2019-12-25 04:24:50
问题 Hello I am having troubles with my application. I am trying to load a list into listbox1 and then refresh the same list in listbox2 (but with possibly different results) and then compare the two and display in textbox1 the differences between the two list boxes. I have gotten to a point where I am able to tell if there are differences but when it goes to post into the textbox it displays the entire listbox and not the differences. That's a little wordy. Sorry. Below is my code: TextBox1.Text

How to compare two list based on elements it contains?

夙愿已清 提交于 2019-12-25 03:55:29
问题 In my unit test class, I am having two list. One is the expectedValue and other is returnedType . I am doing Collections.sort(expected); Collections.sort(returned); but how do I compare two list based on the type of value of one of its element? For example I have element sortOrder in both the list and it has values from 1,2 or 3 so how do i compare or say doing something like assertEqual(expected, returned) for both the list and make sure that both list has same elements and has same