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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: jel
  • Order by date
  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>...
  16. jel

    Error when using Method Extensions

    My guess would be: there already exists an overload Object.Equals(Object, Object), and that one is indeed a static - it cannot be accessed with an instance reference. As DateTime and emums all are objects, your method has the same signature as the existing one. Have you tried changing the name...
  17. jel

    changing a variable in xml - pls help! ! ! !

    As you declare and assign the variable in a for-each, you re-assign it multiple times. It is rather inpredictable what the value is going to be. Apart from that, the variable is 'out of scope' outside the <xsl:if ...>. The scope-problem can be solved like this: <xsl:variable name="myvar">...
  18. jel

    scale graph and divide y-axis

    Using Crystal as included in VS2003, I want to make a simple graph showing the number of people participating in different groups. I made a dataset with one table, columns: date, number, groupname. I inserted a Chart, and using the Chart-expert on the Data-tab selected 'on change of': date...
  19. jel

    Merge two XML files

    In a scripting or programming-language you could use MSxml.DomDocument to copy nodes. Using XSL you could use the document() function to access another xml-file.
  20. jel

    Basic XSLT

    <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method = "xml" /> <xsl:template match="/"> <!-- always create elements new/cols --> <xsl:element name="new"> <xsl:element name="cols"> <!-- for each node in...

Part and Inventory Search

Back
Top