Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by jel

  1. jel

    List Quey

    Why would you want to return a list, if you only need one item? string mm = listContracts.Count > 0 ? listContracts[0].M : string.Empty; Anyways, if you want to make the whole list of M-properties first, don't forget to initialize listM (you cannot add items to a null-reference)...
  2. jel

    yield method

    O, I forgot to mention this: [code] public IEnumerable<Person> AllPersonsInClass { foreach(Person p in _studens) { yield return p; } foreach(Person p in _teachers) { yield return p; } yield return _janitor; }
  3. jel

    yield method

    (sorry for using the term 'new types', I meant you could create instances of another type then your original items)
  4. jel

    yield method

    The code in your example has no advantage - you could just return the collection, or the enumerator of the collection. However, as soon as want to do something with the items in the collection before returning them, you either have to build an enumerator-class, or use the construction with the...
  5. jel

    yield method

    No, the yield-statement helps you to implement IEnumerable, without having to build Enumerator-classes. You can use it if you need read-only collection-like functionality - only enable foreach. However, if you combine with Linq, there are lots of extra possiblities for the consumer. example...
  6. jel

    IndexOfAll

    I think it is from a (free) library: see http://vckicks.110mb.com/components/string-library.php
  7. jel

    Simple XOR encryption of string with a key

    Have a look at: http://www.eggheadcafe.com/tutorials/aspnet/8b53894c-a889-4914-8c46-122980cc44ae/simple-xor-encryption.aspx
  8. jel

    [text()= or [.= ???

    <xsl:when test="node[text()='a']"> <xsl:when test="node = 'a'"> <xsl:when test="node[. ='a']"> all match <context><node>a</node></context> However, only <xsl:when test="node[text()='a']"> matches <context><node>a<othernode>b</othernode></node></context> In general, it is not advised to have a...
  9. jel

    Exception handling concepts

    Interesting interview. However: mr. H. is not arguing that 'one should have 10 try/catch blocks per throw' as you stated in your first post. Actually the interview is about why C# does not have 'checked exceptions'. Mr H. reasons that having checked exceptions 'requires you to either catch...
  10. jel

    Problem with Grouping &amp; Totals in XSL

    '@name' means an atrribte, as in: <person name="jack" /> '/name' means a child-node, as in: <person> <name>jack</name> </person> Good to hear it works, congrats.
  11. jel

    Linking Data Together to Display Correctly

    Ow, First recheck your XML: it is not valid. if you meant something like <doc> <new id="22234" name="Bob"> <more id="22234" address="somewhere" /> <more id="22234" address="somewhere else" /> </new> <new id="22235" name="George"> <more id="22235" address="somewhere new" /> </new>...
  12. jel

    Problem with Grouping &amp; Totals in XSL

    Sorry, I don't know about Sharepoint. It seems to me that CALLS are the equivalent of Rows, and HelpCall to Row. Whether or not you have to include dsqueryresponse I can't say, as I don't know the Sharepoint output. However, you can find out a lot by by using '//nodename' (meaning any node named...
  13. jel

    Problem with Grouping &amp; Totals in XSL

    Tsuji, You're quite right. All in all, I think the best way to handle dates in this case would be just to add them in the XML on creation: a transformation should contain as little calculations and logic as possible. I love the way you calculate the max-values: more elegant and efficient then...
  14. jel

    Problem with Grouping &amp; Totals in XSL

    And just because my pc stands in the only room where I'm allowed to smoke, here's one that also calculates the current month as the last month in the xml. Notice that it is no real calculation, it's more like string-manupulation. <?xml version="1.0"?> <xsl:stylesheet version="1.0"...
  15. jel

    Problem with Grouping &amp; Totals in XSL

    Doing calculations on dates is not really funny in XSLT: for example: there is no function that gives you the current date. In this example I just use fixed string-values. Counting is not to difficult. I had to correct your xml to make this example: <CALLS> <HelpCall> <ID>1</ID>...

Part and Inventory Search

Back
Top