Search Results

Search found 4772 results on 191 pages for 'complex'.

Page 11/191 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • URGENT : Consuming apachesoap:Map complex datatype in webservice using .net with webservice methods

    - by aaaaaa
    web service methods written in java & a method return type is map how can i get value from map type? when i call getDetails then it return result properly but when i call getCit method it return a nothing in response because of map type. i .net there is no data type like map type Dim objweb As New WebRef.FetchService Dim oht As WebRef.Pat Dim ohtm As New WebRef.Map oht = objweb.getDetails("17") ohtm = objweb.getCit(New String() {"21"}, aa, 1) thx

    Read the article

  • How to return a complex object from an axis web service

    - by jani
    Hi all, I am writing a simple web service to return an object with 2 properties. I am embedding the service into an existing web application. My wsdd looks like this. <globalConfiguration> <parameter name="adminPassword" value="admin"/> <parameter name="sendXsiTypes" value="true"/> <parameter name="sendMultiRefs" value="true"/> <parameter name="sendXMLDeclaration" value="true"/> <parameter name="axis.sendMinimizedElements" value="true"/> <requestFlow> <handler type="java:org.apache.axis.handlers.JWSHandler"> <parameter name="scope" value="session"/> </handler> <handler type="java:org.apache.axis.handlers.JWSHandler"> <parameter name="scope" value="request"/> <parameter name="extension" value=".jwr"/> </handler> </requestFlow> </globalConfiguration> <handler name="LocalResponder" type="java:org.apache.axis.transport.local.LocalResponder"/> <handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper"/> <handler name="Authenticate" type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/> <transport name="http"> <requestFlow> <handler type="URLMapper"/> <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/> </requestFlow> </transport> <transport name="local"> <responseFlow> <handler type="LocalResponder"/> </responseFlow> </transport> <service name="helloService" provider="java:RPC" style="document" use="literal"> <parameter name="className" value="ws.example.HelloService"/> <parameter name="allowedMethods" value="*"/> <parameter name="scope" value="application"/> </service> I am able to deploy it successfully. If I try to invoke the method which returns a String, it is successfully returning the String. But when I invoke the method which returns an object, I am getting the following error. AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: org.xml.sax.SAXParseException: Premature end of file. faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Premature end of file. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:424) at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2765) at org.apache.axis.client.Call.invoke(Call.java:2748) at org.apache.axis.client.Call.invoke(Call.java:2424) at org.apache.axis.client.Call.invoke(Call.java:2347) at org.apache.axis.client.Call.invoke(Call.java:1804) at ws.example.ws.HelloServiceSoapBindingStub.getAwardById(HelloServiceSoapBindingStub.java:202) at Test.main(Test.java:21) Can any body help?

    Read the article

  • Complex regex question, data may or may not be in brackets

    - by martinpetts
    I need to extract data from a source that presents it in one of two ways. The data could be formatted like this: Francis (Lab) 18,077 (60.05%); Waller (LD) 4,140 (13.75%); Evans (PC) 3,545 (11.78%); Rees-Mogg (C) 3,064 (10.18%); Wright (Veritas) 768 (2.55%); La Vey (Green) 510 (1.69%) Or like this: Lab 8,994 (33.00%); C 7,924 (29.07%); LD 5,197 (19.07%); PC 3,818 (14.01%); Others 517 (1.90%); Green 512 (1.88%); UKIP 296 (1.09%) The data I need to extract is the percentage and the party (these are election results), which is either in brackets (first example) or is the only non-numeric text. So far I have this: preg_match('/(.*)\(([^)]*)%\)/', $value, $match); Which is giving me the following matches (for first example): Array ( [0] => Francis (Lab) 18,077 (60.05%) [1] => Francis (Lab) 18,077 [2] => 60.05 ) So I have the percentage, but I also need the party label, which may or may not be in brackets and may or may not be the only text. Can anyone help?

    Read the article

  • Semi-complex aggregate select statement confusion

    - by Ian Henry
    Alright, this problem is a little complicated, so bear with me. I have a table full of data. One of the table columns is an EntryDate. There can be multiple entries per day. However, I want to select all rows that are the latest entry on their respective days, and I want to select all the columns of said table. One of the columns is a unique identifier column, but it is not the primary key (I have no idea why it's there; this is a pretty old system). For purposes of demonstration, say the table looks like this: create table ExampleTable ( ID int identity(1,1) not null, PersonID int not null, StoreID int not null, Data1 int not null, Data2 int not null, EntryDate datetime not null ) The primary key is on PersonID and StoreID, which logically defines uniqueness. Now, like I said, I want to select all the rows that are the latest entries on that particular day (for each Person-Store combination). This is pretty easy: --Figure 1 select PersonID, StoreID, max(EntryDate) from ExampleTable group by PersonID, StoreID, dbo.dayof(EntryDate) Where dbo.dayof() is a simple function that strips the time component from a datetime. However, doing this loses the rest of the columns! I can't simply include the other columns, because then I'd have to group by them, which would produce the wrong results (especially since ID is unique). I have found a dirty hack that will do what I want, but there must be a better way -- here's my current solution: select cast(null as int) as ID, PersonID, StoreID, cast(null as int) as Data1, cast(null as int) as Data2, max(EntryDate) as EntryDate into #StagingTable from ExampleTable group by PersonID, StoreID, dbo.dayof(EntryDate) update Target set ID = Source.ID, Data1 = Source.Data1, Data2 = Source.Data2, from #StagingTable as Target inner join ExampleTable as Source on Source.PersonID = Target.PersonID and Source.StoreID = Target.StoreID and Source.EntryDate = Target.EntryDate This gets me the correct data in #StagingTable but, well, look at it! Creating a table with null values, then doing an update to get the values back -- surely there's a better way to do this? A single statement that will get me all the values the first time? It is my belief that the correct join on that original select (Figure 1) would do the trick, like a self-join or something... but how do you do that with the group by clause? I cannot find the right syntax to make the query execute. I am pretty new with SQL, so it's likely that I'm missing something obvious. Any suggestions? (Working in T-SQL, if it makes any difference)

    Read the article

  • Complex Query with Sphinx

    - by maSnun
    I am using -- http://sphinxsearch.com/ . Its working fine for me except one problem. I need to exclude some entries where a specific field doesn't contain a word. Something that would look like this in mysql: Select * from table where yescolumn = 'query' and othercolumn not like '%keyword%' Please help. Thanks.

    Read the article

  • Java complex validation in Dropwizard?

    - by miku
    I'd like to accept JSON on an REST endpoint and convert it to the correct type for immediate validation. The endpoint looks like this: @POST public Response createCar(@Valid Car car) { // persist to DB // ... } But there are many subclasses of Car, e.g. Van, SelfDrivingCar, RaceCar, etc. How could I accept the different JSON representations on the endpoint, while keeping the validation code in the Resource as concise as something like @Valid Car car? Again: I send in JSON like (here, it's the representation of a subclass of Car, namely SelfDrivingCar): { "id" : "t1", // every Car has an Id "kind" : "selfdriving", // every Car has a type-hint "max_speed" : "200 mph", // some attribute "ai_provider" : "fastcarsai ltd." // this is SelfDrivingCar-specific } and I'd like the validation machinery look into the kind attribute, create an instance of the appropriate subclass, here e.g. SelfDrivingCar and perform validation. I know I could create different endpoints for all kind of cars, but thats does not seem DRY. And I know that I could use a real Validator instead of the annotation and do it by hand, so I'm just asking if there's some elegant shortcut for this problem.

    Read the article

  • Rails: keeping DRY with ActiveRecord models that share similar complex attributes

    - by Greg
    This seems like it should have a straightforward answer, but after much time on Google and SO I can't find it. It might be a case of missing the right keywords. In my RoR application I have several models that share a specific kind of string attribute that has special validation and other functionality. The closest similar example I can think of is a string that represents a URL. This leads to a lot of duplication in the models (and even more duplication in the unit tests), but I'm not sure how to make it more DRY. I can think of several possible directions... create a plugin along the lines of the "validates_url_format_of" plugin, but that would only make the validations DRY give this special string its own model, but this seems like a very heavy solution create a ruby class for this special string, but how do I get ActiveRecord to associate this class with the model attribute that is a string in the db Number 3 seems the most reasonable, but I can't figure out how to extend ActiveRecord to handle anything other than the base data types. Any pointers? Finally, if there is a way to do this, where in the folder hierarchy would you put the new class that is not a model? Many thanks.

    Read the article

  • Serializing Complex ViewModel with Json.Net Destabilization Error on Latest Version

    - by dreadlocks1221
    I just added the latest Version of JSON.Net and I get the System.Security.VerificationException: Operation could destabilize the runtime error when trying to use a controller (while running the application). I read in other posts that this issue should have been fixed in release 6 but I still have the problem. I even added *Newtonsoft.* to the ignore modules in the intellitrace options, which seems to have suppressed the error, but the post will just run forever and not return anything. Any help I can get would be greatly appreciated. [HttpPost] public string GetComments(int ShowID, int Page) { int PageSize = 10; UserRepository UserRepo = new UserRepository(); ShowCommentViewModel viewModel = new ShowCommentViewModel(); IQueryable<Comment> CommentQuery = showRepository.GetShowComments(ShowID); var paginatedComments = new PaginatedList<Comment>(CommentQuery, Page, PageSize); viewModel.Comments = new List<CommentViewModel>(); foreach (Comment comment in CommentQuery.Take(10).ToList()) { CommentViewModel CommentModel = new CommentViewModel { Comment = comment, PostedBy = UserRepo.GetUserProfile(comment.UserID) }; IQueryable<Comment> ReplyQuery = showRepository.GetShowCommentReplies(comment.CommentID); int ReplyPage = 0; var paginatedReplies = new PaginatedList<Comment>(ReplyQuery, ReplyPage, 3); CommentModel.Replies = new List<ReplyModel>(); foreach (Comment reply in ReplyQuery.Take(3).ToList()) { ReplyModel rModel = new ReplyModel { Reply = reply, PostedBy = UserRepo.GetUserProfile(reply.UserID) }; CommentModel.Replies.Add(rModel); } CommentModel.RepliesNextPage = paginatedReplies.HasNextPage; CommentModel.RepliesPeviousPage = paginatedReplies.HasPreviousPage; CommentModel.RepliesTotalPages = paginatedReplies.TotalPages; CommentModel.RepliesPageIndex = paginatedReplies.PageIndex; CommentModel.RepliesTotalCount = paginatedReplies.TotalCount; viewModel.Comments.Add(CommentModel); } viewModel.CommentsNextPage = paginatedComments.HasNextPage; viewModel.CommentsPeviousPage = paginatedComments.HasPreviousPage; viewModel.CommentsTotalPages = paginatedComments.TotalPages; viewModel.CommentsPageIndex = paginatedComments.PageIndex; viewModel.CommentsTotalCount = paginatedComments.TotalCount; return JsonConvert.SerializeObject(viewModel, Formatting.Indented); }

    Read the article

  • Complex query in mysql

    - by Satish
    I have two tables reports and holidays. reports: (username varchar(30),activity varchar(30),hours int(3),report_date date) holidays: (holiday_name varchar(30), holiday_date date) select * from reports gives +----------+-----------+---------+------------+ | username | activity | hours | date | +----------+-----------+---------+------------+ | prasoon | testing | 3 | 2009-01-01 | | prasoon | coding | 4 | 2009-01-03 | | gautam | coding | 1 | 2009-01-05 | | prasoon | coding | 4 | 2009-01-06 | | prasoon | coding | 4 | 2009-01-10 | | gautam | coding | 4 | 2009-01-10 | +----------+-----------+---------+------------+ select * from holidays gives +--------------+---------------+ | holiday_name | holiday_date | +--------------+---------------+ | Diwali | 2009-01-02 | | Holi | 2009-01-05 | +--------------+---------------+ When I used the following query SELECT dates.date AS date, CASE WHEN holiday_name IS NULL THEN COALESCE(reports.activity, 'Absent') WHEN holiday_name IS NOT NULL and reports.activity IS NOT NULL THEN reports.activity ELSE '' END AS activity, CASE WHEN holiday_name IS NULL THEN COALESCE(reports.hours, 'Absent') WHEN holiday_name IS NOT NULL and reports.hours IS NOT NULL THEN reports.hours ELSE '' END AS hours, CASE WHEN holiday_name IS NULL THEN COALESCE(holidays.holiday_name, '') ELSE holidays.holiday_name END AS holiday_name FROM dates LEFT OUTER JOIN reports ON dates.date = reports.date LEFT OUTER JOIN holidays ON dates.date = holidays.holiday_date where reports.username='gautam' and dates.date>='2009-01-01' and dates.date<='2009-01-10'; I got the following output +----------+-----------+---------+------------+ | date | activity | hours | holiday | +----------+-----------+---------+------------+ |2009-01-05| coding | 1 | Holi | +----------+-----------+---------+------------+ |2009-01-10| coding | 4 | | +----------+-----------+---------+------------+ but I expected this +----------+-----------+---------+------------+ | date | activity | hours | holiday | +----------+-----------+---------+------------+ |2009-01-01| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-02| | | Diwali | +----------+-----------+---------+------------+ |2009-01-03| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-04| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-05| Coding | 1 | Holi | +----------+-----------+---------+------------+ |2009-01-06| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-07| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-08| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-09| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-10| Coding | 4 | | +----------+-----------+---------+------------+ How can I modify the above query to get the desired output(for a particular user (gautam in this case))?

    Read the article

  • Calling Oracle Function with "complex" return value from C#

    - by devdimi
    I have an Oracle function returning record defined in the package, so one can do: select a,b,c FROM my_function(...); Calling this oracle function from .NET is as simple as executing normal sql query. Unfortunately the function has to do updates now and when it is called like this Oracle complains that updates are not allowed within selects and that makes sense. So now I am left with the choice to change the function call or to split the function. Basically I have to get rid of the select in the function call and need something like this in C#: EXEC :var:= my_func(...); where the type of var is custom tuple defined in the package. I have already tried using ParameterDirection.ReturnValue without success. Does anyone have an idea?

    Read the article

  • Using complex data types from Java in Axis webservice

    - by Manuel Ferreria
    I am currently developing a Java app which handles a SOAP webservice. The problem lies after I parse the WSDL [the Parser object from Apache Axis does it for me], and I create the call. When I try to invoke it, I have to pass a Object[] to assign the parameters [taken from the Action of the WSDL]. A normal action is easy, but when I have custom datatypes, I can't get it to fill it out for me. I try to pass Object[]{ new Object { }}, but it assigns the first field instead. I can't pass it already processed, because it changes the '< ' to '--lt --gt', and the server doesn't recognize it'. This is a fragment of the WSDL. <s:element name="FERecuperaQTYRequest"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="argAuth" type="tns:FEAuthRequest" /> </s:sequence> </s:complexType> </s:element> <s:complexType name="FEAuthRequest"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Token" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Sign" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="cuit" type="s:long" /> </s:sequence> </s:complexType> And this is the troublesome Java Fragment QTY = (String) call.invoke ( new Object[]{ new Object[]{ tokenConexion.getToken (), tokenConexion.getSign (), tokenConexion.getCUIT () } });

    Read the article

  • How to use PropertyCriteria on complex property?

    - by user1394710
    I'm new to EPiSERVER. Currently trying to search for a page with a specific property set to a specific value. I need the property CatalogEntryPoint (a ContentReference) to equal something. Here is the criterea: PropertyCriteria secCriteria = new PropertyCriteria(); secCriteria.Condition = CompareCondition.Equal; secCriteria.Name = "CatalogEntryPoint.ID"; secCriteria.Type = PropertyDataType.Number; secCriteria.Value = currentContent.ContentLink.ID.ToString(); secCriteria.Required = true; And here is an excerpt from the search index: { "CatalogEntryPoint": { "$type": "EPiServer.Find.Cms.IndexableContentReference, EPiServer.Find.Cms", "ID$$number": 1073742170, "WorkID$$number": 0, "ProviderName$$string": "CatalogContent", "GetPublishedOrLatest$$bool": false, "IsExternalProvider$$bool": true, "___types": [ "EPiServer.Find.Cms.IndexableContentReference", "EPiServer.Core.ContentReference", "System.Object", "System.IComparable", "EPiServer.Data.Entity.IReadOnly" ] }, It would seem that the CatalogEntryPoint.ID-notation does not work as I'm getting 0 results. How should I write it?

    Read the article

  • Drupal CCK field type with complex fAPI child fields

    - by Cliff Smith
    This question is basically a follow-up to this one: http://stackoverflow.com/questions/1640534/drupal-custom-cck-field-with-multiple-child-fields I need to build a CCK field type that stores several pieces of data, and fAPI form elements to accept the input for each piece of data already exist. These elements are built out into multiple HTML form inputs with fAPI #process functions. The problem is that when I try to use these elements in my CCK field, the input from the widget doesn't line up with the database columns specified in hook_field_settings(). The widget returns something like this: Array ( [thumbnail_image] => [imceimage_path] => ... [imceimage_alt] => ... [imceimage_width] => ... [imceimage_height] => ... [user_address] => [address_number] => ... [address_street] => ... [address_city] => ... [address_state] => ... Unless there's a way to specify "sub-columns" in hook_field_settings(), it appears to me that I can't use form element types with sub-elements in CCK fields. I've tried using CCK field validation to pull out the "imce_xxx" values from thumbnail_image and likewise with user_address, but that doesn't get me anywhere. Is it not possible to use form elements with child elements in CCK field definitions? Thanks, Cliff Smith

    Read the article

  • BindAttribute, Exclude nested properties for complex types

    - by David Board
    I have a 'Stream' model: public class Stream { public int ID { get; set; } [Required] [StringLength(50, ErrorMessage = "Stream name cannot be longer than 50 characters.")] public string Name { get; set; } [Required] [DataType(DataType.Url)] public string URL { get; set; } [Required] [Display(Name="Service")] public int ServiceID { get; set; } public virtual Service Service { get; set; } public virtual ICollection<Event> Events { get; set; } public virtual ICollection<Monitor> Monitors { get; set; } public virtual ICollection<AlertRule> AlertRules { get; set; } } For the 'create' view for this model, I have made a view model to pass some additional information to the view: public class StreamCreateVM { public Stream Stream { get; set; } public SelectList ServicesList { get; set; } public int SelectedService { get; set; } } Here is my create post action: [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create([Bind(Include="Stream, Stream.Name, Stream.ServiceID, SelectedService")] StreamCreateVM viewModel) { if (ModelState.IsValid) { db.Streams.Add(viewModel.Stream); db.SaveChanges(); return RedirectToAction("Index", "Service", new { id = viewModel.Stream.ServiceID }); } return View(viewModel); } Now, this all works, apart from the [Bind(Include="Stream, Stream.Name, Stream.ServiceID, SelectedService")] bit. I can't seem to Include or Exclude properties within a nested object.

    Read the article

  • Looking for ideas how to refactor my (complex) algorithm

    - by _simon_
    I am trying to write my own Game of Life, with my own set of rules. First 'concept', which I would like to apply, is socialization (which basicaly means if the cell wants to be alone or in a group with other cells). Data structure is 2-dimensional array (for now). In order to be able to move a cell to/away from a group of another cells, I need to determine where to move it. The idea is, that I evaluate all the cells in the area (neighbours) and get a vector, which tells me where to move the cell. Size of the vector is 0 or 1 (don't move or move) and the angle is array of directions (up, down, right, left). This is a image with representation of forces to a cell, like I imagined it (but reach could be more than 5): Let's for example take this picture: Forces from lower left neighbour: down (0), up (2), right (2), left (0) Forces from right neighbour : down (0), up (0), right (0), left (2) sum : down (0), up (2), right (0), left (0) So the cell should go up. I could write an algorithm with a lot of if statements and check all cells in the neighbourhood. Of course this algorithm would be easiest if the 'reach' parameter is set to 1 (first column on picture 1). But what if I change reach parameter to 10 for example? I would need to write an algorithm for each 'reach' parameter in advance... How can I avoid this (notice, that the force is growing potentialy (1, 2, 4, 8, 16, 32,...))? Can I use specific design pattern for this problem? Also: the most important thing is not speed, but to be able to extend initial logic. Things to take into consideration: reach should be passed as a parameter i would like to change function, which calculates force (potential, fibonacci) a cell can go to a new place only if this new place is not populated watch for corners (you can't evaluate right and top neighbours in top-right corner for example)

    Read the article

  • Complex sorting of XML subnodes in .Net3.5 onwards

    - by MicMit
    XML structure expressed in Xpath kind of Records/Record/Actions/Action/ActionDate the other node on the same level Records/Record/Actions/Action/CTCDate Is there easy or not easy way to sort it on "order by ActionDate,CTCDate" ( in SQL notation ), but per Actions for each selected Record when we iterate somehow ( not per XML file ). File around 50M

    Read the article

  • Using SQLXML Bulk Load in .NET Environment - Error with One to Many relationship on Complex Type

    - by user331111
    Hi, I have an error when I am importing an XML file using SQLXMLBulkLoad, wondering if anyone could help. Error: Data mapping to column 'Attribute' was already found in the data. Make sure that no two schema definitions map to the same column Full files and details can be found here http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_26102239.html Exert from XSD: <sql:relationship name="EnvironmentDECAttributes" parent="Environment" parent-key="intEnvironmentID" child="DECAttributes" child-key="intEnvironmentID"/> <complexType name="Environment"> <sequence> <element name="ESANumber" minOccurs="0"> <annotation> <documentation> Environmentally Sensitive Area Number </documentation> </annotation> <simpleType> <restriction base="string"> <maxLength value="15"/> <whiteSpace value="collapse"/> </restriction> </simpleType> </element> <element name="Conditions" minOccurs="0" sql:relation="Conditions" sql:relationship="EnvironmentConditions"> <complexType> <sequence> <element name="Condition" type="vms:EnvironmentalConditions" minOccurs="0" maxOccurs="5"/> </sequence> </complexType> </element> <element name="DECDistrict" minOccurs="0"> <annotation> <documentation> Department of Environment &amp; Conservation District </documentation> </annotation> <simpleType> <restriction base="string"> <maxLength value="31"/> <whiteSpace value="collapse"/> </restriction> </simpleType> </element> <element name="DECAttributes" minOccurs="0" maxOccurs="1" sql:relation="DECAttributes" sql:relationship="EnvironmentDECAttributes"> <complexType> <sequence> <element name="Attribute" type="vms:DECAttributes" minOccurs="0" maxOccurs="unbounded" sql:field="Attribute"> <annotation> <documentation> Department of Environment &amp; Conservation attributes. </documentation> </annotation> </element> </sequence> </complexType> </element> </sequence> </complexType> Exert from XML: <Environment> <DECAttributes> <Attribute>WA</Attribute> <Attribute>SA</Attribute> </DECAttributes> </Environment> Any help/ comments would be appreciated Thanks C

    Read the article

  • XML Deserialization of complex object

    - by nils_gate
    I have xml structure like this: <Group id="2" name="Third" parentid="0" /> <Group id="6" name="Five" parentid="4" /> <Group id="3" name="Four" parentid="2" /> <Group id="4" name="Six" parentid="1" /> parent is denotes Group's Id. The Constructor of Group reads like: public Group(string name, int ID, Group parent) While De-serializing, how do I get parent using Id and pass into group?

    Read the article

  • Complex SQL query... names of returned variables

    - by Andrew P.
    Excuse me for what I'm sure is an elementary question for most of you, but I have an issue with table columns from separate tables having the same name as one another, and trying to select from both tables in the same query. Okay, so this is my code: $q_value = $mdb2->quote($_POST['query']); $field = $_POST['field']; $sql = "SELECT m.*, l.name FROM memberlist m, mail_lists l WHERE m.$field=$q_value AND l.id = m.list ORDER BY m.id"; $l_list = $mdb2->queryAll($sql, '', 'MDB2_FETCHMODE_ASSOC'); The table memberlist has the following columns: id, email, list, sex, name and the table mail_lists has the following columns: id, name After running the query, I later loop through the results with a foreach like so: foreach ($l_list as $l){ //blahblah } The problem is that the column 'name' in mail_lists refers to the names of the list, while the column 'name' in memberlist refers to the name of the member. When I later access $l-name (within the foreach), will I get m.name, or l.name? Furthermore, how do I get access to the other? Or will I just have to do two separate queries?

    Read the article

  • Lucene complex structure search

    - by archer
    Basically I do have pretty simple database that I'd like to index with Lucene. Domains are: // Person domain class Person { Set<Pair> keys; } // Pair domain class Pair { KeyItem keyItem; String value; } // KeyItem domain, name is unique field within the DB (!!) class KeyItem{ String name; } I've tens of millions of profiles and hundreds of millions of Pairs, however, since most of KeyItem's "name" fields duplicates, there are only few dozens KeyItem instances. Came up to that structure to save on KeyItem instances. Basically any Profile with any fields could be saved into that structure. Lets say we've profile with properties - name: Andrew Morton - eduction: University of New South Wales, - country: Australia, - occupation: Linux programmer. To store it, we'll have single Profile instance, 4 KeyItem instances: name, education,country and occupation, and 4 Pair instances with values: "Andrew Morton", "University of New South Wales", "Australia" and "Linux Programmer". All other profile will reference (all or some) same instances of KeyItem: name, education, country and occupation. My question is, how to index all of that so I can search for Profile for some particular values of KeyItem::name and Pair::value. Ideally I'd like that kind of query to work: name:Andrew* AND occupation:Linux* Should I create custom Indexer and Searcher? Or I could use standard ones and just map KeyItem and Pair as Lucene components somehow?

    Read the article

  • maps, iterators, and complex structs - STL errors

    - by Austin Hyde
    So, I have two structs: struct coordinate { float x; float y; } struct person { int id; coordinate location; } and a function operating on coordinates: float distance(const coordinate& c1, const coordinate& c2); In my main method, I have the following code: map<int,person> people; // populate people map<int,map<float,int> > distance_map; map<int,person>::iterator it1,it2; for (it1=people.begin(); it1!=people.end(); ++it1) { for (it2=people.begin(); it2!=people.end(); ++it2) { float d = distance(it1->second.location,it2->second.location); distance_map[it1->first][d] = it2->first; } } However, I get the following error upon build: stl_iterator_base_types.h: In instantiation of ‘std::iterator_traits<coordinate>’: stl_iterator_base_types.h:129: error: no type named ‘iterator_category’ in ‘struct coordinate’ stl_iterator_base_types.h:130: error: no type named ‘value_type’ in ‘struct coordinate’ stl_iterator_base_types.h:131: error: no type named ‘difference_type’ in ‘struct coordinate’ stl_iterator_base_types.h:132: error: no type named ‘pointer’ in ‘struct coordinate’ stl_iterator_base_types.h:133: error: no type named ‘reference’ in ‘struct coordinate’ And it blames it on the line: float d = distance(it1->second.location,it2->second.location); Why does the STL complain about my code?

    Read the article

  • How to bind dropdownlist data to complex class?

    - by chobo2
    Hi I am using asp.net mvc 2.0(default binding model) and I have this problem. I have a strongly typed view that has a dropdownlist <%= Html.DropDownList("List", "-----")%> Now I have a model class like Public class Test() { public List { get; set; } public string Selected {get; set;} } Now I have in my controller this public ActionResult TestAction() { Test ViewModel = new Test(); ViewModel.List = new SelectList(GetList(), "value", "text", "selected"); return View(Test); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult TestAction(Test ViewModel) { return View(); } Now when I load up the TestAction page for the first time it populates the dropdown list as expected. Now I want to post the selected value back to the server(the dropdownlist is within a form tag with some other textboxes). So I am trying to bind it automatically when it comes in as seen (Test ViewModel) However I get this big nasty error. Server Error in '/' Application. No parameterless constructor defined for this object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.MissingMethodException: No parameterless constructor defined for this object. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [MissingMethodException: No parameterless constructor defined for this object.] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) +98 System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +241 System.Activator.CreateInstance(Type type, Boolean nonPublic) +69 System.Activator.CreateInstance(Type type) +6 System.Web.Mvc.DefaultModelBinder.CreateModel(ControllerContext controllerContext, ModelBindingContext bindingContext, Type modelType) +403 System.Web.Mvc.DefaultModelBinder.BindSimpleModel(ControllerContext controllerContext, ModelBindingContext bindingContext, ValueProviderResult valueProviderResult) +544 System.Web.Mvc.DefaultModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) +479 System.Web.Mvc.DefaultModelBinder.GetPropertyValue(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor, IModelBinder propertyBinder) +45 System.Web.Mvc.DefaultModelBinder.BindProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor) +658 System.Web.Mvc.DefaultModelBinder.BindProperties(ControllerContext controllerContext, ModelBindingContext bindingContext) +147 System.Web.Mvc.DefaultModelBinder.BindComplexElementalModel(ControllerContext controllerContext, ModelBindingContext bindingContext, Object model) +98 System.Web.Mvc.DefaultModelBinder.BindComplexModel(ControllerContext controllerContext, ModelBindingContext bindingContext) +2504 System.Web.Mvc.DefaultModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) +548 System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) +474 System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +181 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +830 System.Web.Mvc.Controller.ExecuteCore() +136 System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +111 System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +39 System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__4() +65 System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +44 System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +42 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +141 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +54 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +52 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8836913 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184 So how can I do this?

    Read the article

  • complex mysql rank !

    - by silversky
    I have a tb with this col: ein, los, id ... I whant to order the table by this index: win / ( win + los ) * 30 + win / SUM(win) * 70 and then to find the rank for two id's. I'm not very good on mysql, so whath I wrote it's totally wrong: $stmt=$con-prepare("SET @rk := 0"); $stmt=$con-prepare("SELECT rank, id FROM ( SELECT @rk := @rk + 1 AS rank, (win/(win+los)*30+win/SUM(win)*70) AS index, win, los, id FROM tb_name ORDER BY index DESC) as result WHERE id=? AND id=?"); $stmt - bind_param ("ii", $id1, $id2); $stmt - execute(); $stmt - bind_result($rk, $idRk); And also this query it supouse to run maybe every 5-10 sec for every user, so I'm trying to find something very, very fast. if it's necesary I could add, change, delete any column, in order to be as faster as posible.

    Read the article

  • Mysql - Help me change this single complex query to use temporary tables

    - by sandeepan-nath
    About the system: - There are tutors who create classes and packs - A tags based search approach is being followed.Tag relations are created when new tutors register and when tutors create packs (this makes tutors and packs searcheable). For details please check the section How tags work in this system? below. Following is the concerned query Can anybody help me suggest an approach using temporary tables. We have indexed all the relevant fields and it looks like this is the least time possible with this approach:- SELECT SUM(DISTINCT( t.tag LIKE "%Dictatorship%" OR tt.tag LIKE "%Dictatorship%" OR ttt.tag LIKE "%Dictatorship%" )) AS key_1_total_matches , SUM(DISTINCT( t.tag LIKE "%democracy%" OR tt.tag LIKE "%democracy%" OR ttt.tag LIKE "%democracy%" )) AS key_2_total_matches , COUNT(DISTINCT( od.id_od )) AS tutor_popularity, CASE WHEN ( IF(( wc.id_wc > 0 ), ( wc.wc_api_status = 1 AND wc.wc_type = 0 AND wc.class_date > '2010-06-01 22:00:56' AND wccp.status = 1 AND ( wccp.country_code = 'IE' OR wccp.country_code IN ( 'INT' ) ) ), 0) ) THEN 1 ELSE 0 END AS 'classes_published' , CASE WHEN ( IF(( lp.id_lp > 0 ), ( lp.id_status = 1 AND lp.published = 1 AND lpcp.status = 1 AND ( lpcp.country_code = 'IE' OR lpcp.country_code IN ( 'INT' ) ) ), 0) ) THEN 1 ELSE 0 END AS 'packs_published', td . *, u . * FROM tutor_details AS td JOIN users AS u ON u.id_user = td.id_user LEFT JOIN learning_packs_tag_relations AS lptagrels ON td.id_tutor = lptagrels.id_tutor LEFT JOIN learning_packs AS lp ON lptagrels.id_lp = lp.id_lp LEFT JOIN learning_packs_categories AS lpc ON lpc.id_lp_cat = lp.id_lp_cat LEFT JOIN learning_packs_categories AS lpcp ON lpcp.id_lp_cat = lpc.id_parent LEFT JOIN learning_pack_content AS lpct ON ( lp.id_lp = lpct.id_lp ) LEFT JOIN webclasses_tag_relations AS wtagrels ON td.id_tutor = wtagrels.id_tutor LEFT JOIN webclasses AS wc ON wtagrels.id_wc = wc.id_wc LEFT JOIN learning_packs_categories AS wcc ON wcc.id_lp_cat = wc.id_wp_cat LEFT JOIN learning_packs_categories AS wccp ON wccp.id_lp_cat = wcc.id_parent LEFT JOIN order_details AS od ON td.id_tutor = od.id_author LEFT JOIN orders AS o ON od.id_order = o.id_order LEFT JOIN tutors_tag_relations AS ttagrels ON td.id_tutor = ttagrels.id_tutor LEFT JOIN tags AS t ON t.id_tag = ttagrels.id_tag LEFT JOIN tags AS tt ON tt.id_tag = lptagrels.id_tag LEFT JOIN tags AS ttt ON ttt.id_tag = wtagrels.id_tag WHERE ( u.country = 'IE' OR u.country IN ( 'INT' ) ) AND CASE WHEN ( ( tt.id_tag = lptagrels.id_tag ) AND ( lp.id_lp > 0 ) ) THEN lp.id_status = 1 AND lp.published = 1 AND lpcp.status = 1 AND ( lpcp.country_code = 'IE' OR lpcp.country_code IN ( 'INT' ) ) ELSE 1 END AND CASE WHEN ( ( ttt.id_tag = wtagrels.id_tag ) AND ( wc.id_wc > 0 ) ) THEN wc.wc_api_status = 1 AND wc.wc_type = 0 AND wc.class_date > '2010-06-01 22:00:56' AND wccp.status = 1 AND ( wccp.country_code = 'IE' OR wccp.country_code IN ( 'INT' ) ) ELSE 1 END AND CASE WHEN ( od.id_od > 0 ) THEN od.id_author = td.id_tutor AND o.order_status = 'paid' AND CASE WHEN ( od.id_wc > 0 ) THEN od.can_attend_class = 1 ELSE 1 END ELSE 1 END AND ( t.tag LIKE "%Dictatorship%" OR t.tag LIKE "%democracy%" OR tt.tag LIKE "%Dictatorship%" OR tt.tag LIKE "%democracy%" OR ttt.tag LIKE "%Dictatorship%" OR ttt.tag LIKE "%democracy%" ) GROUP BY td.id_tutor HAVING key_1_total_matches = 1 AND key_2_total_matches = 1 ORDER BY tutor_popularity DESC, u.surname ASC, u.name ASC LIMIT 0, 20 The problem The results returned by the above query are correct (AND logic working as per expectation), but the time taken by the query rises alarmingly for heavier data and for the current data I have it is like 10 seconds as against normal query timings of the order of 0.005 - 0.0002 seconds, which makes it totally unusable. Somebody suggested in my previous question to do the following:- create a temporary table and insert here all relevant data that might end up in the final result set run several updates on this table, joining the required tables one at a time instead of all of them at the same time finally perform a query on this temporary table to extract the end result All this was done in a stored procedure, the end result has passed unit tests, and is blazing fast. I have never worked with temporary tables till now. Only if I could get some hints, kind of schematic representations so that I can start with... Is there something faulty with the query? What can be the reason behind 10+ seconds of execution time? How tags work in this system? When a tutor registers, tags are entered and tag relations are created with respect to tutor's details like name, surname etc. When a Tutors create packs, again tags are entered and tag relations are created with respect to pack's details like pack name, description etc. tag relations for tutors stored in tutors_tag_relations and those for packs stored in learning_packs_tag_relations. All individual tags are stored in tags table. The explain query output:- Please see this screenshot - http://www.test.examvillage.com/Explain_query_improved.jpg

    Read the article

  • Complex string split in Java

    - by c0mrade
    Consider the following String : 5|12345|value1|value2|value3|value4+5|777|value1|value2|value3|value4?5|777|value1|value2|value3|value4+ Here is how I want to split string, split it with + so I get this result : myArray[0] = "5|12345|value1|value2|value3|value4"; myArray[1] = "5|777|value1|value2|value3|value4?5|777|value1|value2|value3|value4"; if string has doesn't contain char "?" split it with "|" and continue to part II, if string does contain "?" split it and for each part split it with "|" and continue to part II. Here is part II : myObject.setAttribute1(newString[0]); ... myObject.setAttribute4(newString[3]); Here what I've got so far : private static String input = "5|12345|value1|value2|value3|value4+5|777|value1|value2|value3|value4?5|777|value1|value2|value3|value4+"; public void mapObject(String input){ String[] myArray = null; if (input.contains("+")) { myArray = input.split("+"); } else { myArray = new String[1]; myArray[0] = input; } for (int i = 0; i < myArray.length; i++) { String[] secondaryArray = null; String[] myObjectAttribute = null; if (myArray[i].contains("?")) { secondaryArray = temporaryString.myArray[i].split("?"); for (String string : secondaryArray) { myObjectAttribute = string.split("\\|"); } } else { myObjectAttribute = myArray[i].toString().split("\\|"); } myObject.setAttribute1(myObjectAttribute[0]); ... myObject.setAttribute4(myObjectAttribute[3]); System.out.println(myObject.toString()); } Problem : When I split myArray, going trough for with myArray[0], everything set up nice as it should. Then comes the myArray[1], its split into two parts then the second part overrides the value of the first(how do I know that?). I've overridden toString() method of myObject, when I finish I print the set values so I know that it overrides it, does anybody know how can I fix this?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >