set

In PowerPoint VBA, how to nudge all the present shapes in the window (not only one)?

As far as I understand, this code "grabs" only the first shape in the active window and nudges it: Set oShape = oSlide.Shapes(1) oShape.Left = oShape.Left + 5 How can I "grab" all the shapes in the window and nudge them all at once? ...

How can I concatenate set of results in MySQL?

I would like to join results returned in the set in MySQL with a comma as a separator string. For example, set returned contains: COLUMN_X john jerry maria joseph gugla I would like to receive the result as: COLUMN_X-concat john,jerry,maria,joseph,gugla is that possible? thanks. SELECT CONCAT(rooms.ID,",") FROM rooms AS rooms LEF...

Getting Union, Intersection, or Difference of Sets in C++

I have a couple questions about how to use C++ sets (std::set) Is there a way to get the union, intersection, or difference of two C++ sets? (It's pretty easy to write my own functionto do that but I wanted to know if there was a built in function for it) Can C++ sets be used as keys in a map? ...

In JScript, is it possible to implement getters and setters that look like object properties from the outside?

While trying to port and generally playing around with some non-browser code, I came across getters and setters that looked like normal object properties. Something like this: js> var o = { a: 4, get b(){ return this.a + 3; }, set b(val){ this.a = val - 3; } }; js> o.a 4 js> o.b 7 js> o.b=10 10 js> o....

Check if a combination matches a given set

Basically I'm looking for a solution which returns if a given combination matches a given set. Example: I have an array which stores which computer room and which workplace has which equipment. I need to find out if a given number of users with specific needs can fit into the computer room or not. The index is the workplace number in my...

C# AppSettings: Is there a easy way to put a collection into <appSetting>

i tried <appSettings > <add key="List" value="1"/> <add key="List" value="2"/> <add key="List" value="3"/> </appSettings > and System.Configuration.ConfigurationManager.AppSettings.GetValues("List"); But i only get the last member . How could i solve this easily? ...

Creating a surface of triangles from a set of 2D points...

Hi, I have a set of points and I need to convert the set to (non-overlapping) triangles (or a big polygon if equivalent)... The application: I have a list of locations (latitude,longitude) from a country, and I need to find if a given point is inside the counrty or not... X X *---------* ...

Javascript - if statement not working?

I'm trying to set a class to active depending on the url. I'm trying to use the code below, but in every case, it activates the active class for the second tab. var pathname = window.location.pathname; if(pathname = '/learn/subsection2') { $("ul.tabs li:eq(1)").addClass("active").show(); //Activate second tab ...

How to set output path in a Qt project

After building, Qt Creator puts my output exe in folder "Debug". I want to change the output folder by adding output path to the .pro file. Any idea? ...

Google Translate set default language

Maybe this has an obvious solution that I'm overlooking, but I can't seem to find the correct parameter to put in to make this happen. Using the Google Translate widget on a site, I need to set the default language that the user sees when entering the site, even though the site is english. function googleTranslateElementInit() { new...

Visual C++ Express, the debugger, sorted associative containers and memory deallocation

So you have this simple program that creates a set from a file : #include <fstream> #include <string> #include <set> int main() { std::set<std::string> Sdictionnary; std::set<std::string>::const_iterator it = Sdictionnary.begin(); std::ifstream file("french.txt"); // A file containing 200 000 lines std::string line; while(getline...

How to centrally define IComparable on abstract (interface) types in F#

This question is kind of the next level of http://stackoverflow.com/questions/895769/f-set-using-custom-class -- I want to define IComparable for a generic interface. I have an arbitrary set of types which implement a shared metadata exchange interface, ITree. I want to compare across these types, using only the exposed data in ITree. ...

Efficient algorithm to remove any map that is contained in another map from a collection of maps.

I have set (s) of unique maps (Java HashMaps currently) and wish to remove from it any maps that are completely contained by some other map in the set (i.e. remove m from s if m.entrySet() is a subset of n.entrySet() for some other n in s.) I have an n^2 algorithm, but it's too slow. Is there a more efficient way to do this? Edit: th...

Set combination question

Got this as an homework assignment and not really sure where to start! Given the set {1,2,3,4}, you can form six combinations of length two from that set, viz: {1,2},{1,3},{1,4},{2,3},{2,4},{3,4} If I was to choose one of the combinations, ({1,2} for example), how can I tell how many of the others are not disjoint to it? In this cas...

Java: .equals() failing for sets (JGraphT)

I can't figure out what's going wrong here. This test fails: @Test public void testSimpleCase() { assertTrue(JGraphtUtilities.graphEquality(ChooseRootTest.generateSimpleCaseGraph(), ChooseRootTest.generateSimpleCaseGraph())); } public static <V, E> boolean graphEquality(Graph<V, E> g0, Graph<V, E> g1) { boolean result = ...

Static fields question

im trying to understand the get and set properties for fields, and run in to this issue, can somone explaine to me why i had to make the int X field Static to make this work? using System; namespace ConsoleApplication1 { class Program { public static int X = 30; public static void Main() { va...

Ranking Elements of multiple Lists by their count in Python

I want to rank multiple lists according to their elements how often they appear in each list. Example: list1 = 1,2,3,4 list2 = 4,5,6,7 list3 = 4,1,8,9 result = 4,1,2,3,4,5,6,7,8 (4 is counted three times, 1 two times and the rest once) I've tried the following but i need something more intelligent and something i can do with any ammou...

jsp:setProperty for bean not working properly

Hi I am having issue of set property tag not working properly. I have a jsp which I am including in webcenter as portlet. <jsp:useBean id="pathEditor" class="backing.bean.AppletBean" scope="page"/> <jsp:getProperty name="pathEditor" property="username" /> ${pageContext.request.remoteUser} <jsp:setProperty name="pathEditor" property="us...

Creating a MySQL SET's from a string

Is there a way to create a set from a string of separated values in MySQL? For example: 'the,quick,brown,fox' => 'the','quick','brown','fox' A sort of inverse EXPORT_SET without the bit fiddeling. Regards ...

Finding the closest number in a random set

Say I got a set of 10 random numbers between 0 and 100. An operator gives me also a random number between 0 and 100. Then I got to find the number in the set that is the closest from the number the operator gave me. example set = {1,10,34,39,69,89,94,96,98,100} operator number = 45 return = 39 And how do translate this into code? (...