set

Implementation of set reconciliation algorithm

I'm looking for implementations of set reconciliation algorithm. The problem is following: there are two sets with elements identified by some relatively compact value (e.g. UUID or MD5/SHA1/whatever hash) sitting on different machines. These sets differ in relatively few elements and I want to synchronize these sets while transferring m...

Non-geek in despair over menus in one site with different iframes on 2 different pages

THE SITE: http://pocketresumeguide.50webs.com/index.html THE PROBLEM: Hello, everyone. I am running into a problem with targeting pages into iframes. I am self-taught in what little HTML I know (as you will probably be able to see for yourselves.) Problem #1: My main TEXT menu that runs across the bottom works fine when I'm on the in...

What did VB replace the function "Set" with?

I've found several aspx codes for forms which include the use of a "Set" function. When I try them out on the hosting server, I get an error message that "Set is no longer supported". Anyone know what replaced the "Set" command? More specifically, how do I change this: Dim mail Set mail = Server.CreateObject("CDONTS.NewMail") mail....

What is the best way to auto generate getters and setters for a class in php?

I regularly create a class that has a few private variables. When an instance of this class is set, it should be possible to fill all variables of the class with getters and setters. Is there an easy way to do this without having to type all these setters and getters for each variable on creation of the class? now i have to type this f...

pythonic format for indices

Hello, I am after a string format to efficiently represent a set of indices. For example "1-3,6,8-10,16" would produce [1,2,3,6,8,9,10,16] Ideally I would also be able to represent infinite sequences. Is there an existing standard way of doing this? Or a good library? Or can you propose your own format? thanks! Edit: Wow! - thank...

Setting Properties In Once Class, Accessing From Another

Hi. My question is basically this: If I set dynamic data from one class, can I access that same data from another class? Below is the rough pseudocode of what I am trying to do: Public Class Person { public string ID { get; set; } public string Name { get; set; } } And, I do the below: Public Class SomeClass { private voi...

Convert type in setter method, possible? When yes how?

hey, guess I wanted to gernerate a commandline with flags and so on. Flags are of type bool but the commandline is a string like " /activeFlag". Is there a way to program a setter in C# which takes a bool but the getter returns a string? like private string activeFlag { get { return activeFlag; } set { // the value here should b...

pointers and references question

#ifndef DELETE #define DELETE(var) delete var, var = NULL #endif using namespace std; class Teste { private: Teste *_Z; public: Teste(){ AnyNum = 5; _Z = NULL; } ~Teste(){ if (_Z != NULL) DELETE(_Z); } Teste *Z(){ _Z = new Teste; return _Z; } void Z(Teste *va...

Java setting values from a Map to a Set

Hello! I am trying to make a method that takes the first Map whose values are sets and a second empty Map whose values are Lists and fills the second Map with the same key/value Mappings as the first. The 2nd map will have every key in the 1st Map, but associated with it is a List of all the same elements that are in the Set it maps to. ...

Is it possible to obtain result set of a sp as a table that I can query?

Hi, Is it possitble to get a stored-procedure's result set as a table so that I can query that? something like: SELECT PK_Item, Count(PK_Item) FROM (pMyStoredProcedure) --This sp returns a table that has PK_Item column GROUP BY PK_ITEM ORDER BY PK_ITEM DESC I am not an T-SQL expert but my friend says it is kind of impossible to do th...

XSLT Set difference but matching on a subsection of the node

Hi, I've implemented this in a recursive fashon but as most xml editors seem to run out of stack space I thought there should be a more efficient solution out there. I've looked at Jenni Tenison's set difference template: http://www.exslt.org/set/functions/difference/set.difference.template.xsl but need something slightly different. I ...

Is there a better, pythonic way to do this?

This is my first python program - Requirement: Read a file consisting of {adId UserId} in each line. For each adId, print the number of unique userIds. Here is my code, put together from reading the python docs. Could you give me feedback on how I can write this in more python-ish way? CODE : import csv adDict = {} reader = csv.rea...

How to extract the member from single-member set in python?

I recently encountered a scenario in which if a set only contained a single element, I wanted to do something with that element. To get the element, I settled on this approach: element = list(myset)[0] But this isn't very satisfying, as it creates an unnecessary list. It could also be done with iteration, but iteration seems unnatur...

Select row after refreshing DBGrid

Well, some kind of n00b question from me. I've surfed the net and similar questions here but haven't found any right answers for such simple (as I thought) problem. I have a DBGrid. I select one row and make some actions with another data linked to this row. After I finished, my DBGrid being refreshed and selected row resets to first. I...

Java: Changing the properties of an iterable object while iterating over it

The following code is just to produce an example of the problem: public static void main(String[] args) { Collection<Integer> src = new ArrayList<Integer>(); Collection<Integer> dest = new ArrayList<Integer>(); src.add(2); src.add(7); src.add(3); src.add(2201); src.add(-21); dest.add(10); while (src.size() != 0) { ...

lambda versus list comprehension performance

Hi, I recently posted a question using a lambda function and in a reply someone had mentioned lambda is going out of favor, to use list comprehensions instead. I am relatively new to Python. I ran a simple test: import time S=[x for x in range(1000000)] T=[y**2 for y in range(300)] # # time1 = time.time() N=[x for x in S for y in T if...

iterator validity ,after erase() call in std::set

Do erase call in std::set invalidate iterator ? As i have done below 5th from last line..? if yes what is better way to erase all elements from set class classA { public: classA(){}; ~classA(){}; }; struct structB { }; typedef std::set <classA*, structB> SETTYPE; typedef std::map <int, SETTYPE>MAPTYPE; int __cdecl wmain (...

Duplicate elements in java.util.Set

java.util.Set implementations removes the duplicate elements. How are duplicates elements deleted internally in a java.util.Set?? ...

Java: Generate a Powerset

This could be language agnostic/helpful answers could just be in pseudo-code. I have a program that I would like to test under a range of inputs. This program takes a set of files, one of which is designated as the root. I want to run the program with all possible subsets of files. (Two subsets, containing the same files, but with diffe...

STL: How to check that an element is in a std::set ?

How do you check that an element is in a set? Is there a simpler equivalent of the following code: myset.find(x) != myset.end() ...