union

Library for polygon operations

I've recently encountered a need for a library or set of libraries to handle operations on 2D polygons. I need to be able to perform boolean/clipping operations (difference and union) and triangulation. So far the libraries I've found are poly2tri, CGAL, and GPC. Poly2tri looks good for triangulation but I'm still left with boolean ope...

C++ Union, Struct, Member type

If I have a class: class Odp { int i; int b; union { long f; struct { WCHAR* pwszFoo; HRESULT hr; }; }; } Union means that, of all values listed, it can only take on one of those values at a time? How does that work in terms of accessing these varia...

c union and bitfields

Can bitfields be used in union? ...

Troublesome coldfusion union query in CFC with mySQL database

This works with a mySQL backend In the form... <cfselect name="to" size="1" bind="cfc:cfcs.messages.getOrganisations()" bindonload="yes" value="organisationID" display="organisationName" required="Yes"> </cfselect> in the cfc <cffunction access="remote" name="getOrganisations" output="false" returntype="query" displayname="G...

JNA union structure mapping

In JNA, how do you map a union structure like the following XEvent from Xlib typedef union _XEvent { int type; /* must not be changed */ XAnyEvent xany; XKeyEvent xkey; XButtonEvent xbutton; XMotionEvent xmotion; XCrossingEvent xcrossing; XFocusChangeEvent xfocus; XExposeEvent xexpose; XGraphicsExp...

how to ignore a column for select distict in postgresql?

Hallo everybody! i have a SQL (see above) and i would like to know how i can make sure that i don't get doubles concerning the name only. if a name appears in the first Select it's the master and should be ignored in the following selects. "SELECT name, id, 'place' AS tablename FROM places WHERE lower(name) LIKE '".strtolower($needle)....

member alignment in c struct-embedded union

Hi I am modifying a bit of C code, that goes roughly like this: typedef struct STRUCT_FOO { ULONG FooInfo; union { ULONG LongData; USHORT ShortData; UCHAR CharData; }; } FOO; ... FOO foo; ULONG dataLength = offsetof(FOO, CharData) + sizeof(foo.CharData); Obviously, the code tries to figure o...

Mysql Activity Union Query

Hi guys, right to business. I have an activity feed which gets all different kinds of activity from different parts of my site sorts them all out by means of using UNION and an ORDER BY and then a LIMIT to get the top 25 and then displays the activity. My fellow programmer says that we will run into problems when we have more rows (cur...

Selecting 2 tables from 2 different databases (ACCESS)

hi guys, here is the connection i have strCon="DBQ=" & Server.Mappath("db.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};PWD=password;" set adoCon=server.createobject("adodb.connection") adoCon.Open strCon so in order to work with the 2 databases i have 2 adoCon and when i do the select i select from each db i need now for the p...

Linked-list representation of disjoint sets - omission in Intro to Algorithms text?

Having had success with my last CLRS question, here's another: In Introduction to Algorithms, Second Edition, p. 501-502, a linked-list representation of disjoint sets is described, wherein each list member the following three fields are maintained: set member pointer to next object pointer back to first object (the set representative...

Union-ing two custom classes returns duplicates

I have two custom classes, ChangeRequest and ChangeRequests, where a ChangeRequests can contain many ChangeRequest instances. public class ChangeRequests : IXmlSerializable, ICloneable, IEnumerable<ChangeRequest>, IEquatable<ChangeRequests> { ... } public class ChangeRequest : ICloneable, IXmlSerializable, IEquatable<ChangeRequest>...

sem_t union/struct C++ inherintance

I'm porting some old C++ project on Linux (RHEL 5.3). The situation is the following #include <semaphore.h> class OldClass: public sem_t This used to work because till glibc-2.3.3.20040420 sem_t was a struct. Now, with the newer version of glib is a union =>inheritance not allowed. so the compilation doesn't work. how it was: type...

sorting error in union query

SELECT DISTINCT rt . d_rev_id , rt . d_rev_code , rt . d_reason , rt . d_rev_status , rt . d_apb , rt . d_cb , pt . d_partid , pt . d_part_no , pt . d_ab , pt . d_abd , pt . d_status , rt . d_part_name , rt . d_part_desc , rt . d_part_type , pnv . d_pn_val , pnv . d_pn_id , cfv . d_optionname , rt . d_projectid , rt . d_abd , rt . d_apbd...

Multiple Queries = joined to create a single child-parent query result

hi, I'm not sure if this is an sql question or a combined sql/php question, so if i'm in the wrong question area, I apologize in advance. I'm use to mssql and not sure how to exactly do this within mysql however... i have a number of tables, all with left joins to create individual sql queries query 1: SELECT a.itemID , b.t...

Postgres Editable Union View

I have a table which stores 'links' between 2 people. In order prevent further complications down the road on an application I am building, I want to create an editable view, that shows the link records and an inverse copy of the link records. Meaning if Joe is linked to Sally, then the view should show Joe linked to Sally and Sally li...

MySQL fulltext search on multiple tables with different fields

I am trying to join multiple tables and perform a full text search on them. Most of the tables are unrelated but have similar fields. I have had the fulltext searches working but i need to be able to create links from the results which is the next step but i don't thin k it will work becuase i haven't got enoygh fields to get enough i...

Using SQL Server Fulltext Search with a Union View

Hello, I have a view which combines two tables via UNION ALL. The view is also schemabound, if that matters (WITH SCHEMABINDING). Is it possible to enable fulltext search on this view? I understand that Fulltext Search requires a unique index, but I can't create it because of UNION. Is there another way to make Fulltext Search work on...

Clustering after minimum spanning tree cut

What would be the optimal way of clustering nodes after cutting a MST with a maximum edge-length? My output from MST edge-length cut is a 2xN array where each element is an integer. The integers are the node identifiers that describe the edges. An example of the output would is given below: >>> print array[0:3] [[ 0 1] [ 0 2] [...

LINQ-to-SQL "Member access not legal on type" exception with unioned and compiled query

I have multiple queries that I'd like to union together, then compile the entire thing. The uncompiled query runs fine, but an "InvalidOperationException: Member access 'Int32 Id' of 'UserQuery+Foo' not legal on type 'System.Linq.IQueryable`1[UserQuery+Foo]." exception is thrown when the same query is compiled and run. How do I fix thi...

Range intersection / union

Hello, I'm developing a programming language for which I want to provide a Range data type which for now is, not as usually, a list of pairs of int values (x,y) with the constraint that x < y. I say not as usually because usually a range is just a pair but in my case it is more than than, allowing to have for example 1 to 5, 7 to 11, 13...