Search Results

Search found 2551 results on 103 pages for 'sequence'.

Page 16/103 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • How can I treat a sequence value like a generated key?

    - by Jeff Knecht
    Here is my situation and my constraints: I am using Java 5, JDBC, and DB2 9.5 My database table contains a BIGINT value which represents the primary key. For various reasons that are too complicated to go into here, the way I insert records into the table is by executing an insert against a VIEW; an INSTEAD OF trigger retrieves the NEXT_VAL from a SEQUENCE and performs the INSERT into the target table. I can change the triggers, but I cannot change the underlying table or the general approach of inserting through the view. I want to retrieve the sequence value from JDBC as if it were a generated key. Question: How can I get access to the value pulled from the SEQUENCE. Is there some message I can fire within DB2 to float this sequence value back to the JDBC driver?

    Read the article

  • Followup: Python 2.6, 3 abstract base class misunderstanding

    - by Aaron
    I asked a question at Python 2.6, 3 abstract base class misunderstanding. My problem was that python abstract base classes didn't work quite the way I expected them to. There was some discussion in the comments about why I would want to use ABCs at all, and Alex Martelli provided an excellent answer on why my use didn't work and how to accomplish what I wanted. Here I'd like to address why one might want to use ABCs, and show my test code implementation based on Alex's answer. tl;dr: Code after the 16th paragraph. In the discussion on the original post, statements were made along the lines that you don't need ABCs in Python, and that ABCs don't do anything and are therefore not real classes; they're merely interface definitions. An abstract base class is just a tool in your tool box. It's a design tool that's been around for many years, and a programming tool that is explicitly available in many programming languages. It can be implemented manually in languages that don't provide it. An ABC is always a real class, even when it doesn't do anything but define an interface, because specifying the interface is what an ABC does. If that was all an ABC could do, that would be enough reason to have it in your toolbox, but in Python and some other languages they can do more. The basic reason to use an ABC is when you have a number of classes that all do the same thing (have the same interface) but do it differently, and you want to guarantee that that complete interface is implemented in all objects. A user of your classes can rely on the interface being completely implemented in all classes. You can maintain this guarantee manually. Over time you may succeed. Or you might forget something. Before Python had ABCs you could guarantee it semi-manually, by throwing NotImplementedError in all the base class's interface methods; you must implement these methods in derived classes. This is only a partial solution, because you can still instantiate such a base class. A more complete solution is to use ABCs as provided in Python 2.6 and above. Template methods and other wrinkles and patterns are ideas whose implementation can be made easier with full-citizen ABCs. Another idea in the comments was that Python doesn't need ABCs (understood as a class that only defines an interface) because it has multiple inheritance. The implied reference there seems to be Java and its single inheritance. In Java you "get around" single inheritance by inheriting from one or more interfaces. Java uses the word "interface" in two ways. A "Java interface" is a class with method signatures but no implementations. The methods are the interface's "interface" in the more general, non-Java sense of the word. Yes, Python has multiple inheritance, so you don't need Java-like "interfaces" (ABCs) merely to provide sets of interface methods to a class. But that's not the only reason in software development to use ABCs. Most generally, you use an ABC to specify an interface (set of methods) that will likely be implemented differently in different derived classes, yet that all derived classes must have. Additionally, there may be no sensible default implementation for the base class to provide. Finally, even an ABC with almost no interface is still useful. We use something like it when we have multiple except clauses for a try. Many exceptions have exactly the same interface, with only two differences: the exception's string value, and the actual class of the exception. In many exception clauses we use nothing about the exception except its class to decide what to do; catching one type of exception we do one thing, and another except clause catching a different exception does another thing. According to the exception module's doc page, BaseException is not intended to be derived by any user defined exceptions. If ABCs had been a first class Python concept from the beginning, it's easy to imagine BaseException being specified as an ABC. But enough of that. Here's some 2.6 code that demonstrates how to use ABCs, and how to specify a list-like ABC. Examples are run in ipython, which I like much better than the python shell for day to day work; I only wish it was available for python3. Your basic 2.6 ABC: from abc import ABCMeta, abstractmethod class Super(): __metaclass__ = ABCMeta @abstractmethod def method1(self): pass Test it (in ipython, python shell would be similar): In [2]: a = Super() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /home/aaron/projects/test/<ipython console> in <module>() TypeError: Can't instantiate abstract class Super with abstract methods method1 Notice the end of the last line, where the TypeError exception tells us that method1 has not been implemented ("abstract methods method1"). That was the method designated as @abstractmethod in the preceding code. Create a subclass that inherits Super, implement method1 in the subclass and you're done. My problem, which caused me to ask the original question, was how to specify an ABC that itself defines a list interface. My naive solution was to make an ABC as above, and in the inheritance parentheses say (list). My assumption was that the class would still be abstract (can't instantiate it), and would be a list. That was wrong; inheriting from list made the class concrete, despite the abstract bits in the class definition. Alex suggested inheriting from collections.MutableSequence, which is abstract (and so doesn't make the class concrete) and list-like. I used collections.Sequence, which is also abstract but has a shorter interface and so was quicker to implement. First, Super derived from Sequence, with nothing extra: from abc import abstractmethod from collections import Sequence class Super(Sequence): pass Test it: In [6]: a = Super() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /home/aaron/projects/test/<ipython console> in <module>() TypeError: Can't instantiate abstract class Super with abstract methods __getitem__, __len__ We can't instantiate it. A list-like full-citizen ABC; yea! Again, notice in the last line that TypeError tells us why we can't instantiate it: __getitem__ and __len__ are abstract methods. They come from collections.Sequence. But, I want a bunch of subclasses that all act like immutable lists (which collections.Sequence essentially is), and that have their own implementations of my added interface methods. In particular, I don't want to implement my own list code, Python already did that for me. So first, let's implement the missing Sequence methods, in terms of Python's list type, so that all subclasses act as lists (Sequences). First let's see the signatures of the missing abstract methods: In [12]: help(Sequence.__getitem__) Help on method __getitem__ in module _abcoll: __getitem__(self, index) unbound _abcoll.Sequence method (END) In [14]: help(Sequence.__len__) Help on method __len__ in module _abcoll: __len__(self) unbound _abcoll.Sequence method (END) __getitem__ takes an index, and __len__ takes nothing. And the implementation (so far) is: from abc import abstractmethod from collections import Sequence class Super(Sequence): # Gives us a list member for ABC methods to use. def __init__(self): self._list = [] # Abstract method in Sequence, implemented in terms of list. def __getitem__(self, index): return self._list.__getitem__(index) # Abstract method in Sequence, implemented in terms of list. def __len__(self): return self._list.__len__() # Not required. Makes printing behave like a list. def __repr__(self): return self._list.__repr__() Test it: In [34]: a = Super() In [35]: a Out[35]: [] In [36]: print a [] In [37]: len(a) Out[37]: 0 In [38]: a[0] --------------------------------------------------------------------------- IndexError Traceback (most recent call last) /home/aaron/projects/test/<ipython console> in <module>() /home/aaron/projects/test/test.py in __getitem__(self, index) 10 # Abstract method in Sequence, implemented in terms of list. 11 def __getitem__(self, index): ---> 12 return self._list.__getitem__(index) 13 14 # Abstract method in Sequence, implemented in terms of list. IndexError: list index out of range Just like a list. It's not abstract (for the moment) because we implemented both of Sequence's abstract methods. Now I want to add my bit of interface, which will be abstract in Super and therefore required to implement in any subclasses. And we'll cut to the chase and add subclasses that inherit from our ABC Super. from abc import abstractmethod from collections import Sequence class Super(Sequence): # Gives us a list member for ABC methods to use. def __init__(self): self._list = [] # Abstract method in Sequence, implemented in terms of list. def __getitem__(self, index): return self._list.__getitem__(index) # Abstract method in Sequence, implemented in terms of list. def __len__(self): return self._list.__len__() # Not required. Makes printing behave like a list. def __repr__(self): return self._list.__repr__() @abstractmethod def method1(): pass class Sub0(Super): pass class Sub1(Super): def __init__(self): self._list = [1, 2, 3] def method1(self): return [x**2 for x in self._list] def method2(self): return [x/2.0 for x in self._list] class Sub2(Super): def __init__(self): self._list = [10, 20, 30, 40] def method1(self): return [x+2 for x in self._list] We've added a new abstract method to Super, method1. This makes Super abstract again. A new class Sub0 which inherits from Super but does not implement method1, so it's also an ABC. Two new classes Sub1 and Sub2, which both inherit from Super. They both implement method1 from Super, so they're not abstract. Both implementations of method1 are different. Sub1 and Sub2 also both initialize themselves differently; in real life they might initialize themselves wildly differently. So you have two subclasses which both "is a" Super (they both implement Super's required interface) although their implementations are different. Also remember that Super, although an ABC, provides four non-abstract methods. So Super provides two things to subclasses: an implementation of collections.Sequence, and an additional abstract interface (the one abstract method) that subclasses must implement. Also, class Sub1 implements an additional method, method2, which is not part of Super's interface. Sub1 "is a" Super, but it also has additional capabilities. Test it: In [52]: a = Super() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /home/aaron/projects/test/<ipython console> in <module>() TypeError: Can't instantiate abstract class Super with abstract methods method1 In [53]: a = Sub0() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /home/aaron/projects/test/<ipython console> in <module>() TypeError: Can't instantiate abstract class Sub0 with abstract methods method1 In [54]: a = Sub1() In [55]: a Out[55]: [1, 2, 3] In [56]: b = Sub2() In [57]: b Out[57]: [10, 20, 30, 40] In [58]: print a, b [1, 2, 3] [10, 20, 30, 40] In [59]: a, b Out[59]: ([1, 2, 3], [10, 20, 30, 40]) In [60]: a.method1() Out[60]: [1, 4, 9] In [61]: b.method1() Out[61]: [12, 22, 32, 42] In [62]: a.method2() Out[62]: [0.5, 1.0, 1.5] [63]: a[:2] Out[63]: [1, 2] In [64]: a[0] = 5 --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /home/aaron/projects/test/<ipython console> in <module>() TypeError: 'Sub1' object does not support item assignment Super and Sub0 are abstract and can't be instantiated (lines 52 and 53). Sub1 and Sub2 are concrete and have an immutable Sequence interface (54 through 59). Sub1 and Sub2 are instantiated differently, and their method1 implementations are different (60, 61). Sub1 includes an additional method2, beyond what's required by Super (62). Any concrete Super acts like a list/Sequence (63). A collections.Sequence is immutable (64). Finally, a wart: In [65]: a._list Out[65]: [1, 2, 3] In [66]: a._list = [] In [67]: a Out[67]: [] Super._list is spelled with a single underscore. Double underscore would have protected it from this last bit, but would have broken the implementation of methods in subclasses. Not sure why; I think because double underscore is private, and private means private. So ultimately this whole scheme relies on a gentleman's agreement not to reach in and muck with Super._list directly, as in line 65 above. Would love to know if there's a safer way to do that.

    Read the article

  • Creating packages in code - Workflow

    This is just a quick one prompted by a question on the SSIS Forum, how to programmatically add a precedence constraint (aka workflow) between two tasks. To keep the code simple I’ve actually used two Sequence containers which are often used as anchor points for a constraint. Very often this is when you have task that you wish to conditionally execute based on an expression. If it the first or only task in the package you need somewhere to anchor the constraint too, so you can then set the expression on it and control the flow of execution. Anyway, back to my code sample, here’s a quick screenshot of the finished article: Now for the code, which is actually pretty simple and hopefully the comments should explain exactly what is going on. Package package = new Package(); package.Name = "SequenceWorkflow"; // Add the two sequence containers to provide anchor points for the constraint // If you use tasks, it follows exactly the same pattern, they all derive from Executable Sequence sequence1 = package.Executables.Add("STOCK:Sequence") as Sequence; sequence1.Name = "SEQ Start"; Sequence sequence2 = package.Executables.Add("STOCK:Sequence") as Sequence; sequence2.Name = "SEQ End"; // Add the precedence constraint, here we use the package's constraint collection // as it hosts the two objects we want to constrain (link) // The default constraint is a basic On Success constraint just like in the designer PrecedenceConstraint constraint = package.PrecedenceConstraints.Add(sequence1, sequence2); // Change the settings to use a (dummy) expression only constraint.EvalOp = DTSPrecedenceEvalOp.Expression; constraint.Expression = "1 == 1";   The complete code file is available to download below. SequenceWorkflow.cs

    Read the article

  • iphone - gesture not working on animated view

    - by Mike
    I have this animated view and a gesture assigned to it... [self.view setUserInteractionEnabled:YES]; UIImageView *sequence = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"frame0.png"]]; [sequence setUserInteractionEnabled:YES]; sequence.center = CGPointMake(centroX, centroY); NSMutableArray *array = [[NSMutableArray alloc] init] ; for (int i=0; i<30; i++) { UIImage *oneImage = [UIImage imageNamed:[NSString stringWithFormat:@"frame%d.png",i]]; [array addObject:oneImage]; } sequence.animationImages = array; sequence.animationDuration = 1.0; sequence.animationRepeatCount = 1; [self.view addSubview:sequence]; [sequence release]; sequence.startAnimating; sequence.image = [UIImage imageNamed:@"frame29.png"]; // doSomething never runs when I tap the image... why? UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doSomething)]; [singleTap setDelegate:self]; [singleTap setCancelsTouchesInView:NO]; [singleTap setDelaysTouchesEnded:NO]; [sequence addGestureRecognizer:singleTap]; [singleTap release]; The gesture is never called... why? I have no other gesture associated anywhere. thanks for any help.

    Read the article

  • :: Help Needed to parse ksoap response using J2ME ::

    - by Sachin
    Hi Guys, I am developing a mobile application using J2ME, LWUIT and KSOAP. The application makes .net webservice calls and fetches responses. I am able to successfully make calls and receive respone, but not able to parse the response, due to my limited knowledge in java. following is my WSDL file and j2me code snippet used to make calls. The WSDL file has complex and SIMPLETYPE elements, which needs to be mapped to JAVA classes. i request you guys to help me out with any pointers or sample code. WSDL file: <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"> <s:element name="Login"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="userLoginID" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="LoginResponse"> <s:complexType> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="User" nillable="true" type="tns:UserBin" /> </s:sequence> </s:complexType> </s:element> <s:complexType name="UserBin" abstract="true"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="CompanyCodeSeqId" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="Image" type="s:base64Binary" /> <s:element minOccurs="1" maxOccurs="1" name="DateOfBirth" type="s:dateTime" /> <s:element minOccurs="1" maxOccurs="1" name="UserSeqId" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="UserFirstName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="UserLastName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="PassWord" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="UserRole" type="tns:Roles" /> <s:element minOccurs="1" maxOccurs="1" name="UserSSN" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="EmailId" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="MobileNumber" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="CreatedDate" type="s:dateTime" /> <s:element minOccurs="1" maxOccurs="1" name="ModifiedDate" type="s:dateTime" /> <s:element minOccurs="1" maxOccurs="1" name="UserGroup" type="tns:UserGroups" /> <s:element minOccurs="1" maxOccurs="1" name="SecretQuestionID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="SecretAnswer" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="WorkPhone" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="HomePhone" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Company" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="PreviousLoginTime" type="s:dateTime" /> <s:element minOccurs="1" maxOccurs="1" name="LoginTime" type="s:dateTime" /> </s:sequence> </s:complexType> <s:simpleType name="Roles"> <s:restriction base="s:string"> <s:enumeration value="Guest" /> <s:enumeration value="Customer" /> <s:enumeration value="Driver" /> <s:enumeration value="Dispatcher" /> <s:enumeration value="CompanyCodeAdmin" /> </s:restriction> </s:simpleType> <s:simpleType name="UserGroups"> <s:restriction base="s:string"> <s:enumeration value="Invalid" /> <s:enumeration value="Customer" /> <s:enumeration value="Driver" /> <s:enumeration value="Dispatcher" /> </s:restriction> </s:simpleType> <s:complexType name="DriverBin"> <s:complexContent mixed="false"> <s:extension base="tns:UserBin"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="DriverGroupId" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="DriverTypeId" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="HireDate" type="s:dateTime" /> <s:element minOccurs="0" maxOccurs="1" name="LicenceNumber" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="ExpiryDateForLicence" type="s:dateTime" /> <s:element minOccurs="0" maxOccurs="1" name="VehicleNumber" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyPhone" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyAddress" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyRelationship" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="DriverType" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="DriverGroupName" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="VehicleID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="SocialSN" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="StreetAddress" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="City" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="State" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="Zip" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="EmergencyCity" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="EmergencyState" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyZip" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="TerminationDate" type="s:dateTime" /> <s:element minOccurs="1" maxOccurs="1" name="HireAgainFlag" type="s:boolean" /> <s:element minOccurs="0" maxOccurs="1" name="TerminationReason" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Notes" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="ImageName" type="s:string" /> </s:sequence> </s:extension> </s:complexContent> </s:complexType> <s:complexType name="CustomerBin"> <s:complexContent mixed="false"> <s:extension base="tns:UserBin"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="PassengesDetails" type="tns:ArrayOfPassengerBin" /> <s:element minOccurs="0" maxOccurs="1" name="CompanyName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="CreditCardDetailsArray" type="tns:ArrayOfCreditCardDetailsBin" /> <s:element minOccurs="0" maxOccurs="1" name="AddressArray" type="tns:ArrayOfAddressBin" /> <s:element minOccurs="1" maxOccurs="1" name="CustomerCompanyID" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="CustomerType" type="tns:CustomerType" /> <s:element minOccurs="0" maxOccurs="1" name="PassengerGradeName" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="PassengerGradeID" type="s:int" /> </s:sequence> </s:extension> </s:complexContent> </s:complexType> <s:complexType name="ArrayOfPassengerBin"> <s:sequence> <s:element minOccurs="0" maxOccurs="unbounded" name="PassengerBin" nillable="true" type="tns:PassengerBin" /> </s:sequence> </s:complexType> <s:complexType name="PassengerBin"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="CustomerSeqID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="EmailID" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="PhoneNumber" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="LastName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="FirstName" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="PassengerSeqID" nillable="true" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="IsSelf" type="s:boolean" /> </s:sequence> </s:complexType> <s:complexType name="ArrayOfCreditCardDetailsBin"> <s:sequence> <s:element minOccurs="0" maxOccurs="unbounded" name="CreditCardDetailsBin" nillable="true" type="tns:CreditCardDetailsBin" /> </s:sequence> </s:complexType> <s:complexType name="CreditCardDetailsBin"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="CardSeqID" nillable="true" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="ExpiryYear" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="ExpiryMonth" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="CardType" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="NickName" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="CVVNumber" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="CreditCardNumber" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="NameOnTheCard" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="IsPrimary" type="s:boolean" /> </s:sequence> </s:complexType> <s:complexType name="ArrayOfAddressBin"> <s:sequence> <s:element minOccurs="0" maxOccurs="unbounded" name="AddressBin" nillable="true" type="tns:AddressBin" /> </s:sequence> </s:complexType> <s:complexType name="AddressBin"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="UserSeqID" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="AddressID" nillable="true" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="ZipCode" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="IsPrimary" type="s:boolean" /> <s:element minOccurs="0" maxOccurs="1" name="State" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="StateID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="StateCode" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="City" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="CityID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="StreetAddress" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="NickName" type="s:string" /> </s:sequence> </s:complexType> <s:simpleType name="CustomerType"> <s:restriction base="s:string"> <s:enumeration value="Individual" /> <s:enumeration value="Corporate" /> </s:restriction> </s:simpleType> <s:complexType name="DispatcherBin"> <s:complexContent mixed="false"> <s:extension base="tns:UserBin"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Address1" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Address2" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="City" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Province" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="IsActive" type="s:boolean" /> <s:element minOccurs="1" maxOccurs="1" name="DispatcherHireDate" type="s:dateTime" /> <s:element minOccurs="1" maxOccurs="1" name="DispatcherSSN" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="TerminationDate" type="s:dateTime" /> <s:element minOccurs="0" maxOccurs="1" name="ReasonForTermination" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="HireAgainFlag" type="s:boolean" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyContactName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyContactNumber" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyContactAddress" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyContactRelationship" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="HireDate" type="s:dateTime" /> </s:sequence> </s:extension> </s:complexContent> </s:complexType> <s:element name="Logout"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="userLoginID" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="userSeqID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="validationKey" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="LogoutResponse"> <s:complexType /> </s:element> </s:schema> </wsdl:types> <wsdl:message name="LoginSoapIn"> <wsdl:part name="parameters" element="tns:Login" /> </wsdl:message> <wsdl:message name="LoginSoapOut"> <wsdl:part name="parameters" element="tns:LoginResponse" /> </wsdl:message> <wsdl:message name="LogoutSoapIn"> <wsdl:part name="parameters" element="tns:Logout" /> </wsdl:message> <wsdl:message name="LogoutSoapOut"> <wsdl:part name="parameters" element="tns:LogoutResponse" /> </wsdl:message> <wsdl:portType name="AccountManagementSoap"> <wsdl:operation name="Login"> <wsdl:input message="tns:LoginSoapIn" /> <wsdl:output message="tns:LoginSoapOut" /> </wsdl:operation> <wsdl:operation name="Logout"> <wsdl:input message="tns:LogoutSoapIn" /> <wsdl:output message="tns:LogoutSoapOut" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="AccountManagementSoap" type="tns:AccountManagementSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="Login"> <soap:operation soapAction="http://tempuri.org/Login" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="Logout"> <soap:operation soapAction="http://tempuri.org/Logout" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="AccountManagementSoap12" type="tns:AccountManagementSoap"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="Login"> <soap12:operation soapAction="http://tempuri.org/Login" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="Logout"> <soap12:operation soapAction="http://tempuri.org/Logout" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="AccountManagement"> <wsdl:port name="AccountManagementSoap" binding="tns:AccountManagementSoap"> <soap:address location="http://webservice.mcubeit.com/trs_webservice/services/AccountManagement.asmx" /> </wsdl:port> <wsdl:port name="AccountManagementSoap12" binding="tns:AccountManagementSoap12"> <soap12:address location="http://webservice.mcubeit.com/trs_webservice/services/AccountManagement.asmx" /> </wsdl:port> </wsdl:service> </wsdl:definitions> J2ME Code Snippet: String uname = username.getText(); String pass = password.getText(); String serviceUrl = "http://xxx.xxx.xxx/webservice/services/AccountManagement.asmx"; String serviceNameSpace = "http://tempuri.org/"; String soapAction = "http://tempuri.org/Login"; String methodName = "Login"; SoapObject rpc = new SoapObject(serviceNameSpace, methodName); rpc.addProperty("userLoginID", uname.trim()); rpc.addProperty("password", pass.trim()); //rpc.addProperty("userSeqID", String.valueOf(192).toString()); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.bodyOut = rpc; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC; HttpTransport ht = new HttpTransport(serviceUrl); ht.debug = true; ht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); String result = null; try { ht.call(soapAction, envelope); result = (envelope.getResponse()).toString(); System.out.println("Result :" + result.toString()); } catch (org.xmlpull.v1.XmlPullParserException ex2) { System.out.println("XmlPullParserException :" + ex2.toString()); System.out.println("Request \n" + ht.requestDump); System.out.println("Response \n" + ht.responseDump); } catch (SoapFault sf) { System.out.println("SoapFault :" + sf.faultstring); System.out.println("Request \n" + ht.requestDump); System.out.println("Response \n" + ht.responseDump); } catch (IOException ioe) { System.out.println("IOException :" + ioe.toString()); System.out.println("Request \n" + ht.requestDump); System.out.println("Response \n" + ht.responseDump); } RESPONSE Result :CustomerBin{CompanyCodeSeqId=-1; Image=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==; DateOfBirth=1900-01-01T00:00:00; UserSeqId=192; UserFirstName=Sachin; UserLastName=Nevase; PassWord=anyType{}; UserRole=Customer; UserSSN=-2147483648; [email protected]; MobileNumber=804131244; CreatedDate=1900-01-01T00:00:00; ModifiedDate=1900-01-01T00:00:00; UserGroup=Customer; SecretQuestionID=-2147483648; SecretAnswer=anyType{}; WorkPhone=anyType{}; HomePhone=anyType{}; Company=anyType{}; PreviousLoginTime=2010-05-04T23:38:34; LoginTime=1900-01-01T00:00:00; PassengesDetails=anyType{PassengerBin=anyType{CustomerSeqID=192; [email protected]; PhoneNumber=0804131244; LastName=Nevase; FirstName=Sachin; PassengerSeqID=55; IsSelf=true; }; }; CustomerCompanyID=-1; CustomerType=Individual; PassengerGradeName=Grade1; PassengerGradeID=1; } Thanks, Sachin

    Read the article

  • Changing the sequencing strategy for File/Ftp Adapter

    - by [email protected]
    The File/Ftp Adapter allows the user to configure the outbound write to use a sequence number. For example, if I choose address-data_%SEQ%.txt as the FileNamingConvention, then all my files would be generated as address-data_1.txt, address-data_2.txt,...and so on. But, where does this sequence number come from? The answer lies in the "control directory" for the particular adapter project(or scenario). In general, for every project that use the File or Ftp Adapter, a unique directory is created for book keeping purposes. And since this control directory is required to be unique, the adapter uses a digest to make sure that no two control directories are the same. For example, for my FlatStructure sample, the control information for my project would go under FMW_HOME/user_projects/domains/soainfra/fileftp/controlFiles/[DIGEST]/outbound where the value of DIGEST would differ from one project to another. If you look under this directory, you will see a file control_ob.properties and this is where the sequence number is maintained. Please note that the sequence number is maintained in binary form and you hence you might need a hex editor to view its content. You will also see another zero byte file, SEQ_nnn, but, ignore that for now. We'll get to it some other time. For now, please remember that this extra file is maintained as a backup. One of the challenges faced by the adapter runtime is to guard all writes to the control files so no two threads inadverently try to update them at the same time. And, it does so with the help of a "Mutex". For now, please remember that the mutex comes in different flavors: In-memory DB-based Coherence-based User-defined Again, we will talk about these mutexes some other time. Please note that there might be scenarios, particularly under heavy load, where the mutex might become a bottleneck. The adapter, however,  allows you to change the configuration so that the adapter sequence value comes from a database sequence or a stored procedure and in such situation, the mutex is acually by-passed and thereby resulting in better throughputs. In later releases, the behavior of the adapter would be defaulted to use a db-sequence.  The simplest way to achieve this is by switching your JNDI for the outbound JCA file to use "eis/HAFileAdapter" as shown   But, what does this do? Internally, the adapter runtime creates a sequence on the oracle database. For example, if you do a "select * from user_sequences" in your soa-infra schema, you will see a new sequence being created with name as SEQ_<GUID>__ where the GUID will differ from one project to another. However, if you want to use your own sequence, then it would require you to add a new property to your JCA file called SequenceName as shown below. Please note that you will need to create this sequence on your soainfra schema beforehand.     But, what if we use DB2 or MSSQL Server as the dehydration support? DB2 supports sequences natively but MSSQL Server does not. So, the adapter runtime uses a natively generated sequence for DB2, but, for MSSQL server, the adapter relies on a stored procedure that ships with the product. If you wish to achieve the same result for SOA Suite running DB2 as the dehydration store, simply change your connection factory JNDI name in the JCA file to eis/HAFileAdapterDB2 and for MSSQL, please use eis/HAFileAdapterMSSQL. And, if you wish to use a stored procedure other than the one that ships with the product, you will need to rely on binding properties to override the adapter behavior. Particularly, you will need to instruct the adapter that you wish to use a stored procedure as shown:       Please note that if you're using the File/Ftp Adapter in Append mode, then the adapter runtime degrades the mutex to use pessimistic locks as we don't want writers from different nodes to append to the same file at the same time.                    

    Read the article

  • Is there a BitTorrent client that can download files "in sequence"?

    - by Bob M
    Is there a BitTorrent client that can download files "in sequence"? For example, download clip 01.avi (high priority) clip 02.avi (normal priority) clip 03.avi (low priority) clip 04.avi (low) clip 05.avi (low) then when clip 01.avi is done, it will automatically make it: clip 01.avi (high priority) clip 02.avi (high priority) clip 03.avi (normal priority) clip 04.avi (low priority) clip 05.avi (low) this can be useful when download *.rar as well, since download clip.rar, and then clip.r00, r01, r02, in sequence can allow previewing the file by using RAR to recompose the file (even though incomplete file, but will allow previewing). Update: will making all files active still considered a bad use of BT?

    Read the article

  • Perl syntax error [closed]

    - by Linny
    I am a beginner taking a Perl programming course. We are trying to write a basic program for counting nucleotides in a DNA string. I'm getting syntax errors on the lines that have a single bracket on lines 28 & 70 and don't know why. It also reads that I have compilation errors. I have no idea where to start figuring that out. # The purpose of this program is to count the number of nucleotides in a strand. Each protein is counted separately # print "/n NOTE: Nucleotide counting /n"; # use strict; # enforce variable declarations use warnings; # enable compiler warnings # Display number of A,a,T,t,G,g,C,c, nucleotides in a word or sequence of letters. # my ($base) = ''; # an extracted letter from a string my ($nuceotide_count) = 0 ; # the current position within the word my ($position) = 0 ; # number of vowels in user-supplied word my ($word) = ''; # word to be processed my ($A_count) = 0 ; # of A nucleotides in the user-supplied sequence my ($a_count) = 0 ; # of A nucleotides in the user-supplied sequence my ($C_count) = 0 ; # of C nucleotides in the user-supplied sequence my ($c_count) = 0 ; # of C nucleotides in the user-supplied sequence my ($G_count) = 0 ; # of G nucleotides in the user-supplied sequence my ($g_count) = 0 ; # of G nucleotides in the user-supplied sequence my ($T_count) = 0 ; # of T nucleotides in the user-supplied sequence my ($t_count) = 0 ; # of T nucleotides in the user-supplied sequence word = (STDIN) for ($position = 0);($position if (($base eq 'a') or ($base eq 'A')) { ++$A_count; } # end if ++$position; if (($base eq 'T') or ($base eq 't')) { ++$T_count; } end if ++$position; if (($base eq 'G') or ($base eq 'g')) { ++$G_count; } # end if ++$position; if (($base eq 'C') or ($base eq 'c')) { ++$C_count; } # end if ++$position; } # end for # Display final results. # print " \n The number of A or a neucleotides is: $A_count"; print " \n The number of T or t neucleotides is: $T_count"; print " \n The number of G or g neucleotides is: $G_count"; print " \n The number of C or c neucleotides is: $C_count"; print " \n\n Program completed successfully. \n" ; exit ;

    Read the article

  • [EF + Oracle] Inserting Data (Sequences) (2/2)

    - by JTorrecilla
    Prologue In the previous chapter we have see how to create DB records with EF, now we are going to Some Questions about Oracle.   ORACLE One characteristic from SQL Server that differs from Oracle is “Identity”. To all that has not worked with SQL Server, this property, that applies to Integer Columns, lets indicate that there is auto increment columns, by that way it will be filled automatically, without writing it on the insert statement. In EF with SQL Server, the properties whose match with Identity columns, will be filled after invoking SaveChanges method. In Oracle DB, there is no Identity Property, but there is something similar. Sequences Sequences are DB objects, that allow to create auto increment, but there are not related directly to a Table. The syntax is as follows: name, min value, max value and begin value. 1: CREATE SEQUENCE nombre_secuencia 2: INCREMENT BY numero_incremento 3: START WITH numero_por_el_que_empezara 4: MAXVALUE valor_maximo | NOMAXVALUE 5: MINVALUE valor_minimo | NOMINVALUE 6: CYCLE | NOCYCLE 7: ORDER | NOORDER 8:    How to get sequence value? To obtain the next val from the sequence: 1: SELECT nb_secuencia.Nextval 2: From Dual Due to there is no direct way to indicate that a column is related to a sequence, there is several ways to imitate the behavior: Use a Trigger (DB), Use Stored Procedures or Functions(…) or my particularly option. EF model, only, imports Table Objects, Stored Procedures or Functions, but not sequences. By that, I decide to create my own extension Method to invoke Next Val from a sequence: 1: public static class EFSequence 2: { 3: public static int GetNextValue(this ObjectContext contexto, string SequenceName) 4: { 5: string Connection = ConfigurationManager.ConnectionStrings["JTorrecillaEntities2"].ConnectionString; 6: Connection=Connection.Substring(Connection.IndexOf(@"connection string=")+19); 7: Connection = Connection.Remove(Connection.Length - 1, 1); 8: using (IDbConnection con = new Oracle.DataAccess.Client.OracleConnection(Connection)) 9: { 10: using (IDbCommand cmd = con.CreateCommand()) 11: { 12: con.Open(); 13: cmd.CommandText = String.Format("Select {0}.nextval from DUAL", SequenceName); 14: return Convert.ToInt32(cmd.ExecuteScalar()); 15: } 16: } 17:  18: } 19: } This Object Context’s extension method are going to invoke a query with the Sequence indicated by parameter. It takes the connection strings from the App settings, removing the meta data, that was created by VS when generated the EF model. And then, returns the next value from the Sequence. The next value of a Sequence is unique, by that, when some concurrent users are going to create records in the DB using the sequence will not get duplicates. This is my own implementation, I know that it could be several ways to do and better ways. If I find any other way, I promise to post it. To use the example is needed to add a reference to the Oracle (ODP.NET) dll.

    Read the article

  • What's your favorite implementation of producing the fibonacci sequence?

    - by Terry Donaghe
    Best, most creative, most clever, fastest, smallest, written in weirdest language, etc etc. For those not familiar with this staple of programming exam question / interview question, check this out: Fibonacci Sequence at Wikipedia The question would be, write a simple program which will spit out the first n digits of the Fibonacci sequence. So, if n == 12, we produce: 0 1 1 2 3 5 8 13 21 34 55 89 144 Your implementation becomes more interesting when you set n to larger values. How long does it take your implementation to return a 25 digit sequence? How about 100?

    Read the article

  • In CQRS (event-sourced), do you need a global sequence counter in the event store?

    - by Jon M
    In trying to get my head around CQRS (and DDD in general) I have come across situations when two events occur on different aggregates but the order of them has domain meaning. If so then they could happen so close together that a timestamp (as used by the sample implementations I have seen) cannot differentiate them, meaning the event store doesn't contain a 'complete' representation of the domain as there is ambiguity over the order in which events occurred. As an example, the domain could fire a CustomerCreatedEvent which applies to the Customer aggregate, and then a CustomerAssignedToAgent event on the Agent aggregate. The CustomerAssignedToAgent event doesn't make sense if it occurs before the CustomerCreatedEvent, but typically both of these might be fired as a result of one operation which makes it likely that the timestamps would effectively be the same. So am I just modelling things badly? Should there ever be a situation where the sequence of events across different aggregates is important? Or should you keep a global sequence number on your event store, so that you can identify the exact sequence in which events occurred?

    Read the article

  • XSLT - make xsl:analyze-string return string instead of sequence of strings?

    - by tohuwawohu
    Is it possible to make xsl:analyze-string return one string instead of a sequence of strings? Background: I'd like to use xsl:analyze-string in a xsl:function that should encapsulate the pattern matching. Ideally, the function should return an xs:string to be used as sort criteria in an xsl:sort element. At the moment, i have to apply string-join() on every result of the function call since xsl:analyze-string returns a sequence of strings, and xsl:sort doesn't accept such a sequence as sort criteria. See line 24 of the stylesheet: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:my="www.my-personal-namespa.ce" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:output indent="yes" method="xml" /> <xsl:function name="my:sortierung" > <xsl:param name="inputstring" as="xs:string"/> <xsl:analyze-string select="$inputstring" regex="[0-9]+"> <xsl:matching-substring> <xsl:value-of select="format-number(number(.), '00000')" /> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="." /> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:function> <xsl:template match="/input"> <result> <xsl:apply-templates select="value" > <xsl:sort select="string-join((my:sortierung(.)), ' ')" /> </xsl:apply-templates> </result> </xsl:template> <xsl:template match="value"> <xsl:copy-of select="." /> </xsl:template> </xsl:stylesheet> with this input: <?xml version="1.0" encoding="UTF-8"?> <input> <value>A 1 b 120</value> <value>A 1 b 1</value> <value>A 1 b 2</value> <value>A 1 b 1a</value> </input> In my example, is there a way to modify the xsl:function to return a xs:string instead of a sequence?

    Read the article

  • XSD: xs:sequence & xs:choice combination for xs:extension elements?

    - by bguiz
    Hi, My question is about defining an XML schema that will validate the following sample XML: <rules> <other>...</other> <bool>...</bool> <other>...</other> <string>...</string> <other>...</other> </rules> The order of the child nodes does not matter. The cardinality of the child nodes is 0..unbounded. All the child elements of the rules node have a common base type, rule, like so: <xs:complexType name="booleanRule"> <xs:complexContent> <xs:extension base="rule"> ... </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="stringFilterRule"> <xs:complexContent> <xs:extension base="filterRule"> ... </xs:extension> </xs:complexContent> </xs:complexType> My current attempt at defining the schema for the rules node is below. However, Can I nest xs:choice within xs:sequence? If, where do I specify the maxOccurs="unbounded" attribute? Is there a better way to do this, such as an xs:sequence which specifies only the base type of its child elements? <xs:element name="rules"> <xs:complexType> <xs:sequence> <xs:choice> <xs:element name="bool" type="booleanRule" /> <xs:element name="string" type="stringRule" /> <xs:element name="other" type="someOtherRule" /> </xs:choice> </xs:sequence> </xs:complexType> </xs:element>

    Read the article

  • Xpath Query to match immediate sibling nodes in a sequence.

    - by Pritam Damania
    Hi, I'm new to XPATH and I'd like to know if there is a nice way to do this using XPATH queries. I want to match consecutive sibling nodes in a XML tree to certain predefined rules for example if there are three sibling nodes occurring immediately one after the other and they have the attributes value="A", value="B" and value="C", I want the XPATH query to match the first node/last node in such a sequence and I want to extract all such consecutive sequence of nodes from the XML tree so that I can process them later on. Thanks!

    Read the article

  • XSD: xs:sequence & xs:choice combination for xs:extension elements of a common base type?

    - by bguiz
    Hi, My question is about defining an XML schema that will validate the following XML: <rules> <other>...</other> <bool>...</bool> <other>...</other> <string>...</string> <other>...</other> </rules> The order of the child nodes does not matter. The cardinality of the child nodes is 0..unbounded. All the child elements of the rules node have a common base type, rule, like so: <xs:complexType name="booleanRule"> <xs:complexContent> <xs:extension base="rule"> ... </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="stringFilterRule"> <xs:complexContent> <xs:extension base="filterRule"> ... </xs:extension> </xs:complexContent> </xs:complexType> My current (feeble) attempt at defining the schema for the rules node is below. However, Can I nest xs:choice within xs:sequence? If, where do I specify the maxOccurs="unbounded" attribute? Is there a better way to do this, such as an xs:sequence which specifies only the base type of its child elements? <xs:element name="rules"> <xs:complexType> <xs:sequence> <xs:choice> <xs:element name="bool" type="booleanRule" /> <xs:element name="string" type="stringRule" /> <xs:element name="other" type="someOtherRule" /> </xs:choice> </xs:sequence> </xs:complexType> </xs:element>

    Read the article

  • In Android OS or Java, what's the difference between a character sequence and a string????

    - by K-RAN
    For the API (Android SDK API version 8) functions whose definitions list character sequence parameters, I can feed the function String instead. Best part is that they work the same way, no hassle, no warnings. Is there a difference between the two types? And more importantly, is there an inherent danger if I send the function a String instead of a character sequence??? Thanks for any clarifications!!! :D

    Read the article

  • Profile creation process stuck halfway Websphere

    - by ngubk
    I'm creating a cell profile on Linux Mint 12 , WAS 8.0 Network Deployment Trial. But using manageProfiles.sh or Profile Management Tool, I can not create any profile (cell, application ...). When I check the log file, the profile creation process is always stop halfway (does not show any error, just stuck there). The log is always like this <record> <date>2012-11-02T04:11:15</date> <millis>1351847475108</millis> <sequence>2985</sequence> <logger>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</logger> <level>INFO</level> <class>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</class> <method>messageLogged</method> <thread>0</thread> <message>replacing value for user.install.root (null) with (/opt/IBM/WebSphere/AppServer/profiles)</message> </record> <record> <date>2012-11-02T04:11:15</date> <millis>1351847475108</millis> <sequence>2986</sequence> <logger>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</logger> <level>INFO</level> <class>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</class> <method>messageLogged</method> <thread>0</thread> <message>replacing value for was.install.root (/opt/IBM/WebSphere/AppServer) with (/opt/IBM/WebSphere/AppServer)</message> </record> <record> <date>2012-11-02T04:11:15</date> <millis>1351847475108</millis> <sequence>2987</sequence> <logger>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</logger> <level>INFO</level> <class>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</class> <method>messageLogged</method> <thread>0</thread> <message>replacing value for was.repository.root (null) with (/opt/IBM/WebSphere/AppServer/profiles/config)</message> </record> <record> <date>2012-11-02T04:11:15</date> <millis>1351847475108</millis> <sequence>2988</sequence> <logger>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</logger> <level>INFO</level> <class>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</class> <method>messageLogged</method> <thread>0</thread> <message>replacing value for com.ibm.ws.scripting.wsadminprops (null) with (/opt/IBM/WebSphere/AppServer/profiles/properties/wsadmin.properties)</message> </record> <record> <date>2012-11-02T04:11:15</date> <millis>1351847475120</millis> <sequence>2989</sequence> <logger>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</logger> <level>INFO</level> <class>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</class> <method>messageLogged</method> <thread>0</thread> <message>Resetting listener available status to: false</message> </record> <record> <date>2012-11-02T04:11:15</date> <millis>1351847475121</millis> <sequence>2990</sequence> <logger>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</logger> <level>INFO</level> <class>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</class> <method>messageLogged</method> <thread>0</thread> <message>setting wsadmin requester timeouts</message> </record> <record> <date>2012-11-02T04:11:15</date> <millis>1351847475128</millis> <sequence>2991</sequence> <logger>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</logger> <level>INFO</level> <class>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</class> <method>messageLogged</method> <thread>0</thread> <message>wsadmin requester retry count = 240000, initialization retry count = 12000, shutdown retry count = 12000</message> </record> <record> <date>2012-11-02T04:11:15</date> <millis>1351847475128</millis> <sequence>2992</sequence> <logger>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</logger> <level>INFO</level> <class>com.ibm.ws.install.configmanager.actionengine.ant.utils.ANTLogToCmtLogAdapter</class> <method>messageLogged</method> <thread>0</thread> <message>Checking for wsadmin listener initialization</message> </record>

    Read the article

  • How to get rid of auto-generated sequence number in network's device name in Windows?

    - by Piotr Dobrogost
    Every time one plugs in the same usb wireless adapter in a new usb port, Windows creates new network device with auto-generated sequence number which looks like this Wireless-N USB Network Adapter #2, Wireless-N USB Network Adapter #3, ... The name of a device is being displayed as part of network's information in Control Panel|Network Connections. How can I get rid of this sequence number? I found out device name which is displayed in network's information is kept in the FriendlyName REG_SZ value under HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USB\VID_[device specific string]\[usb port specific string] However when I try to modify this value I get error Cannot edit FriendlyName: Error writing the value's new contents. I tried to delete extra keys under HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USB\VID_13B1&PID_0029 but got Cannot delete KEY NAME: Error while deleting key. error. Trying to solve this problem I followed this answer but trying to change owner with Replace owner on subcontainers and objects option checked I got this error - Registry Editor could not set owner on the currently selected, or some of its subkeys. To find out which subkey is the source of problem I tried changing owner of each subkey. After successfully changing owner of Properites subkey I saw it has subkeys which were previously hidden. Now trying to change owner of these subkeys looks like this: Any idea how to delete these keys?

    Read the article

  • Why does USB thumb drive screw up boot sequence?

    - by Carl B
    I am looking for understanding to a boot issue. I have at times had some files and such that I save and retrieve from my thumb drive. I use the front panel as it is nice and easy to get to and I typically power down my system nightly. If I forget to pull the drive and power on the system, it becomes the first bootable device. As there is no OS on the USB Drive I get the BOOTMGR is missing press CTRL+ALT+DELETE. When I go into BIOS to see Boot sequence, there’s the thumb drive up top, DVD drive is missing and not found in the list of devices. All of the hard drives are next in line. When I pull the USB drive, and reboot, everything is back to normal. Old boot sequence is in place, DVD drive right where it should be and no issues. So why does this happen with a USB drive in port at boot up? If it can’t be booted from, shouldn’t the next drive be attempted? Note: This happens when the thumb drive is plugged into a USB port on the front panel. It does not seem to happen on rear panel ports.

    Read the article

  • MySQL InnoDB Corruption after power outage, possible to recover?

    - by Tim Hackett
    Hey Guys, I recently started trying to get Redmine up and running after a power outage that seems to have corrupted our InnoDB database in MySQL. Redmine had an extensive set of documentation that I would like to get even if redmine isn't able to run. The service fails on startup. I have tried inserting innodb_force_recovery = 4 per the documentation from the url in the error log. (also tried 1 thru 6 as I have backed up all directories after the corruption) I have verified through "mysqld-nt --print-defaults" that it is starting with the recovery option in the params. The machine is running Windows Server 2003 SP2, Xeon E5335 with 2GB RAM, MySQL is not mirrored to another machine, nor is the machine a mirror. I do not have any backups because the previous person did not set them up. Here is the error log: InnoDB: The log sequence number in ibdata files does not match InnoDB: the log sequence number in the ib_logfiles! 100308 14:50:01 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 100308 14:50:02 InnoDB: Error: page 7 log sequence number 0 935521175 InnoDB: is in the future! Current system log sequence number 0 933419020. InnoDB: Your database may be corrupt or you may have copied the InnoDB InnoDB: tablespace but not the InnoDB log files. See InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html InnoDB: for more information. 100308 14:50:02 InnoDB: Error: page 2 log sequence number 0 935517607 InnoDB: is in the future! Current system log sequence number 0 933419020. InnoDB: Your database may be corrupt or you may have copied the InnoDB InnoDB: tablespace but not the InnoDB log files. See InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html InnoDB: for more information. 100308 14:50:02 InnoDB: Error: page 11 log sequence number 0 935517607 InnoDB: is in the future! Current system log sequence number 0 933419020. InnoDB: Your database may be corrupt or you may have copied the InnoDB InnoDB: tablespace but not the InnoDB log files. See InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html InnoDB: for more information. 100308 14:50:02 InnoDB: Error: page 5 log sequence number 0 972973045 InnoDB: is in the future! Current system log sequence number 0 933419020. InnoDB: Your database may be corrupt or you may have copied the InnoDB InnoDB: tablespace but not the InnoDB log files. See InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html InnoDB: for more information. 100308 14:50:02 InnoDB: Error: page 6 log sequence number 0 972984051 InnoDB: is in the future! Current system log sequence number 0 933419020. InnoDB: Your database may be corrupt or you may have copied the InnoDB InnoDB: tablespace but not the InnoDB log files. See InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html InnoDB: for more information. 100308 14:50:02 InnoDB: Error: page 1577 log sequence number 0 972737368 InnoDB: is in the future! Current system log sequence number 0 933419020. InnoDB: Your database may be corrupt or you may have copied the InnoDB InnoDB: tablespace but not the InnoDB log files. See InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html InnoDB: for more information. InnoDB: Error: trying to access page number 4294965119 in space 0, InnoDB: space name .\ibdata1, InnoDB: which is outside the tablespace bounds. InnoDB: Byte offset 0, len 16384, i/o type 10. InnoDB: If you get this error at mysqld startup, please check that InnoDB: your my.cnf matches the ibdata files that you have in the InnoDB: MySQL server. 100308 14:50:02InnoDB: Assertion failure in thread 960 in file .\fil\fil0fil.c line 3959 InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed bug report to http://bugs.mysql.com. InnoDB: If you get repeated assertion failures or crashes, even InnoDB: immediately after the mysqld startup, there may be InnoDB: corruption in the InnoDB tablespace. Please refer to InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html InnoDB: about forcing recovery. 100308 14:50:02 [ERROR] mysqld-nt: Got signal 11. Aborting! 100308 14:50:02 [ERROR] Aborting 100308 14:50:02 [Note] mysqld-nt: Shutdown complete

    Read the article

  • ICalendar not readable by google calendar.

    - by Sagar
    Operating system : WinXP Program and version you use to access Google Calendar (FF3.5): I'm developing a script (based on an existing vCal ASP.NET class I found online) to generate an .ics file. This file works perfectly when importing to Outlook 2003. When I try to import to Google Calendar, I get the following error: Failed to import events: Unable to process your iCal/CSV file.. I don't know too much about the vCal format or syntax, but everything looks fine to me. I'll post the sample test calendar .ics below: BEGIN:VCALENDAR PRODID:-//jpalm.se//iCalendar example with ASP.NET MVC//EN VERSION:2.0 CALSCALE:GREGORIAN METHOD:PUBLISH X-MS-OLK-FORCEINSPECTOROPEN:TRUE BEGIN:VEVENT DTSTART:20100304T000000Z DTEND:20100304T000000Z TRANSP:OPAQUE SEQUENCE:0 UID:7c9d6dd7-41f2-4171-8ae4-35820974efa4 DESCRIPTION:uba:Project20100321:sagar . SUMMARY:First Milestone END:VEVENT X-MS-OLK-FORCEINSPECTOROPEN:TRUE BEGIN:VEVENT DTSTART:20100330T230000Z DTEND:20100330T230000Z TRANSP:OPAQUE SEQUENCE:0 UID:8a982519-b99b-429a-8dad-c0f95c50d0e6 DESCRIPTION:uba:Project20100321:imanage2010 pm SUMMARY:upcoming milestones END:VEVENT X-MS-OLK-FORCEINSPECTOROPEN:TRUE BEGIN:VEVENT DTSTART:20100329T230000Z DTEND:20100329T230000Z TRANSP:OPAQUE SEQUENCE:0 UID:588750a1-6f10-4b5d-8a51-3f3818024726 DESCRIPTION:uba:Project20100321:sagar . SUMMARY:test END:VEVENT X-MS-OLK-FORCEINSPECTOROPEN:TRUE BEGIN:VEVENT DTSTART:20100407T230000Z DTEND:20100407T230000Z TRANSP:OPAQUE SEQUENCE:0 UID:36eaa726-a0a0-40a1-ba7c-09857f8ed006 DESCRIPTION:uba:Project20100321:imanage2010 pm SUMMARY:Rad apps devs END:VEVENT X-MS-OLK-FORCEINSPECTOROPEN:TRUE BEGIN:VEVENT DTSTART:20100408T125632Z DTEND:20100408T125632Z TRANSP:OPAQUE SEQUENCE:0 UID:8521ad53-916a-43cc-8eeb-42c1b3d670d3 DESCRIPTION:uba:Project20100321:imanage2010 pm SUMMARY:this is a test ms END:VEVENT X-MS-OLK-FORCEINSPECTOROPEN:TRUE BEGIN:VEVENT DTSTART:20100415T125643Z DTEND:20100415T125643Z TRANSP:OPAQUE SEQUENCE:0 UID:e4b295d8-2271-4393-9899-3e9c858f4e8c DESCRIPTION:uba:Project20100321:imanage2010 pm SUMMARY:Test msssss END:VEVENT X-MS-OLK-FORCEINSPECTOROPEN:TRUE BEGIN:VEVENT DTSTART:20100430T055201Z DTEND:20100430T055201Z TRANSP:OPAQUE SEQUENCE:0 UID:1e464698-1064-4cb2-8166-2a843b63ca5a DESCRIPTION:uba:Project20100321:imanage2010 pm SUMMARY:this is a new milestones for testing on 30th april END:VEVENT X-MS-OLK-FORCEINSPECTOROPEN:TRUE BEGIN:VEVENT DTSTART:20100731T093917Z DTEND:20100731T093917Z TRANSP:OPAQUE SEQUENCE:0 UID:5262ef58-73bc-4d66-a207-4e884e249629 DESCRIPTION:uba:Project20100321:imanage2010 pm SUMMARY:555555555555555555 END:VEVENT X-MS-OLK-FORCEINSPECTOROPEN:TRUE BEGIN:VEVENT DTSTART:20100328T230000Z DTEND:20100328T230000Z TRANSP:OPAQUE SEQUENCE:0 UID:f654262d-714e-41d9-9690-005bb467f8aa DESCRIPTION:uba:Untitled project:imanage2010 pm SUMMARY:first milestone END:VEVENT X-MS-OLK-FORCEINSPECTOROPEN:TRUE BEGIN:VEVENT DTSTART:20100401T095537Z DTEND:20100401T095537Z TRANSP:OPAQUE SEQUENCE:0 UID:3f4a6c16-f460-457d-a281-b4c010958796 DESCRIPTION:uba:ProjectIcal:imanage2010 pm SUMMARY:new ms ical END:VEVENT X-MS-OLK-FORCEINSPECTOROPEN:TRUE BEGIN:VEVENT DTSTART:20100331T230000Z DTEND:20100331T230000Z TRANSP:OPAQUE SEQUENCE:0 UID:e5bf28d1-3559-48e9-90f8-2b5233489a13 DESCRIPTION:uba:ProjectIcal:imanage2010 pm SUMMARY:new ms 2 ical END:VEVENT END:VCALENDAR And the source for generating the above code is which is nothing but the mvc view:: <%@ Import Namespace ="iManageProjectPM.Controllers" % <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage"% BEGIN:VCALENDAR VERSION:2.0<%if (Model.Events.Count 1) {% CALSCALE:GREGORIAN METHOD:PUBLISH<%}% X-MS-OLK-FORCEINSPECTOROPEN:TRUE <%foreach(var evnt in Model.Events){% BEGIN:VEVENT DTSTART<%=Model.GetTimeString(evnt.StartTime)% DTEND<%=Model.GetTimeString(evnt.EndTime)% TRANSP:OPAQUE SEQUENCE:0 UID:<%=evnt.UID% DESCRIPTION:<%=evnt.Desc% SUMMARY:<%=evnt.Title% END:VEVENT<%}% END:VCALENDAR

    Read the article

  • JAX-WS wsgen and collections of collections: wsgen broken?

    - by ayang
    I've been playing around with "bottom-up" JAX-WS and have come across something odd when running wsgen. If I have a service class that does something like: @WebService public class Foo { public ArrayList<Bar> getBarList(String baz) { ... } } then running wsgen gets me a FooService_schema1.xsd that has something like this: <xs:complexType name="getBarListResponse"> <xs:sequence> <xs:element name="return" type="tns:bar" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> which seems reasonable. However, if I want a collection of collections like: public BarCollection getBarCollection(String baz) { ... } // BarCollection is just a container for an ArrayList<Bar> then the generated schema ends up with stuff like: <xs:complexType name="barCollection"> <xs:sequence/> </xs:complexType> <xs:complexType name="getBookCollectionsResponse"> <xs:sequence> <xs:element name="return" type="tns:barCollection" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> An empty sequence is not what I had in mind at all. My original approach was to go with: public ArrayList<ArrayList<Bar>> getBarLists(String baz) { ... } but that ends up with a big chain of complexTypes that just wind up with an empty sequence at the end as well: <xs:complexType name="getBarListsResponse"> <xs:sequence> <xs:element name="return" type="tns:arrayList" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="arrayList"> <xs:complexContent> <xs:extension base="tns:abstractList"> <xs:sequence/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="abstractList" abstract="true"> <xs:complexContent> <xs:extension base="tns:abstractCollection"> <xs:sequence/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="abstractCollection" abstract="true"> <xs:sequence/> </xs:complexType> Am I missing something or is this a known hole in wsgen? JAXB? Andy

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >