Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Another open source rant

Another open source rant

Scheduled Pinned Locked Moved The Lounge
rubytutorialcsharpphpdatabase
45 Posts 26 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L LloydA111

    I see what your both saying, but many of these "build it yourself" projects also have the package files in Linux distro repositories, so I'm sure they could make a Windows binary too.

           .-.
          |o,o|
       ,| \_\\=/\_      .-""-.
       ||/\_/\_\\\_\\    /\[\] \_ \_\\
       |\_/|(\_)|\\\\  \_|\_o\_LII|\_
          \\.\_./// / | ==== | \\
          |\\\_/|"\` |\_| ==== |\_|
          |\_|\_|    ||" ||  ||
          |-|-|    ||LI  o ||
          |\_|\_|    ||'----'||
         /\_/ \\\_\\  /\_\_|    |\_\_\\
    
    A Offline
    A Offline
    Albert Holguin
    wrote on last edited by
    #20

    ...and some do, those that have bigger dev teams do. For example LibreOffice provides binaries for just about everything (as well as source), but for example, some of the Linux drivers don't, they only provide source.... why, well the Linux kernel is constantly changing and different distros use different kernel versions, so they'd have to compile a WHOLE bunch of time with different compilers/kernel headers. So, I just see why some people don't want to do it... as a developer that has to support a bunch of different platforms, I understand the headache.

    1 Reply Last reply
    0
    • A Albert Holguin

      Maximilien wrote:

      Everyone including your mom could push something out as open source...

      Depends on who's managing the product... I'm sure you couldn't just push changes onto the Linux kernel dev tree without someone approving it, and you certainly wouldn't be able get those changes into the main kernel code unless approved by the man himself (Linus of course).

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #21

      yeah, there are some exceptions. but nothing prevents me from creating a new super-duper HTLML gizmo on sourceforge and someone thinks it looks good and download it and rant about it on CodeProject. :-\

      Nihil obstat

      A 1 Reply Last reply
      0
      • M Maximilien

        yeah, there are some exceptions. but nothing prevents me from creating a new super-duper HTLML gizmo on sourceforge and someone thinks it looks good and download it and rant about it on CodeProject. :-\

        Nihil obstat

        A Offline
        A Offline
        Albert Holguin
        wrote on last edited by
        #22

        Maximilien wrote:

        but nothing prevents me from creating a new super-duper HTLML gizmo on sourceforge and someone thinks it looks good and download it and rant about it on CodeProject.

        ...not that we're talking about anyone specifically here.... :laugh:

        1 Reply Last reply
        0
        • M Marc Clifton

          This time, my sights are on HtmlAgilityPack[^]. Besides the fact that there is no documentation and the one example provided has an absurd quote-placement error, so obviously the code was never tested, there's this:

          /// /// Selects a list of nodes matching the expression.
          ///
          /// The XPath expression.
          /// An containing a collection of nodes matching the query, or null if no node matched the XPath expression.
          public HtmlNodeCollection SelectNodes(string xpath)

          What? You return a null if no matches are found??? Which of course would blow up their "example" if no "href" tags exist:

          HtmlDocument doc = new HtmlDocument();
          doc.Load("file.htm");
          foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"])
          {

          Why is it that the quality of what "we" as supposed professionals produce is so obviously bad? On a positive note, someone did put together a HAPExplorer (albeit in WPF, why???) that at least provides some working examples, and lo-and-behold, it does compile (after I nuked the test project with an NUnit dependency), but on a bad note, the latest source download complained about a missing .cs file, so the test stuff doesn't build anyways. :sigh: Marc

          Testers Wanted!
          Latest Article: User Authentication on Ruby on Rails - the definitive how to
          My Blog

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #23

          foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"])

          Well, that's entirely consistent with reading an XmlNode. Of course, this is easily circumvented by

          HtmlNodeList nodes = doc.DocumentElement.SelectNodes("//a[@href"]);
          if (nodes != null && nodes.Count > 0)
          foreach (HtmlNode link in nodes)

          I was brought up to respect my elders. I don't respect many people nowadays.
          CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

          1 Reply Last reply
          0
          • M Marc Clifton

            This time, my sights are on HtmlAgilityPack[^]. Besides the fact that there is no documentation and the one example provided has an absurd quote-placement error, so obviously the code was never tested, there's this:

            /// /// Selects a list of nodes matching the expression.
            ///
            /// The XPath expression.
            /// An containing a collection of nodes matching the query, or null if no node matched the XPath expression.
            public HtmlNodeCollection SelectNodes(string xpath)

            What? You return a null if no matches are found??? Which of course would blow up their "example" if no "href" tags exist:

            HtmlDocument doc = new HtmlDocument();
            doc.Load("file.htm");
            foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"])
            {

            Why is it that the quality of what "we" as supposed professionals produce is so obviously bad? On a positive note, someone did put together a HAPExplorer (albeit in WPF, why???) that at least provides some working examples, and lo-and-behold, it does compile (after I nuked the test project with an NUnit dependency), but on a bad note, the latest source download complained about a missing .cs file, so the test stuff doesn't build anyways. :sigh: Marc

            Testers Wanted!
            Latest Article: User Authentication on Ruby on Rails - the definitive how to
            My Blog

            R Offline
            R Offline
            Ranjan D
            wrote on last edited by
            #24

            Agree.. In this case the SelectNodes returns IEnumerable items , we are expecting it to return zero or more items but sure not NULL's.. Yes this could be a bad design, even I faced the same issue. We could even return NULL when you are not iterating, means when you are just finding an element in a xml document, you could return NULL if no match found. Thanks,

            Ranjan.D

            1 Reply Last reply
            0
            • A AspDotNetDev

              Marc Clifton wrote:

              the quality of what "we" as supposed professionals produce is so obviously bad

              After seeing how bad so many of the so called professionals are in our industry, I no longer trust professionals in other industries. Once you do that, it becomes easier to observe that there are more flawed products than there are good ones.

              Thou mewling ill-breeding pignut!

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #25

              AspDotNetDev wrote:

              After seeing how bad so many of the so called professionals are in our industry, I no longer trust professionals in other industries.

              There's relatively many of them in IT, less in other professions. As a side-note; not every open-source writer is a professional programmer. But practice and critics can help turn into one.

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

              1 Reply Last reply
              0
              • M Marc Clifton

                This time, my sights are on HtmlAgilityPack[^]. Besides the fact that there is no documentation and the one example provided has an absurd quote-placement error, so obviously the code was never tested, there's this:

                /// /// Selects a list of nodes matching the expression.
                ///
                /// The XPath expression.
                /// An containing a collection of nodes matching the query, or null if no node matched the XPath expression.
                public HtmlNodeCollection SelectNodes(string xpath)

                What? You return a null if no matches are found??? Which of course would blow up their "example" if no "href" tags exist:

                HtmlDocument doc = new HtmlDocument();
                doc.Load("file.htm");
                foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"])
                {

                Why is it that the quality of what "we" as supposed professionals produce is so obviously bad? On a positive note, someone did put together a HAPExplorer (albeit in WPF, why???) that at least provides some working examples, and lo-and-behold, it does compile (after I nuked the test project with an NUnit dependency), but on a bad note, the latest source download complained about a missing .cs file, so the test stuff doesn't build anyways. :sigh: Marc

                Testers Wanted!
                Latest Article: User Authentication on Ruby on Rails - the definitive how to
                My Blog

                M Offline
                M Offline
                Mark_Wallace
                wrote on last edited by
                #26

                The content of their "Documentation" page: "This project does not have documentation yet." Then why have a Documentation tab prominently placed at the top of every page? They don't have a page of beanie-baby photos, either, but I don't see a "Beanie-baby Photos" tab in their main menu. Do we really need people like these to tell us anything about web design or web development? You learn from masters, not fools.

                I wanna be a eunuchs developer! Pass me a bread knife!

                M 1 Reply Last reply
                0
                • A AspDotNetDev

                  Marc Clifton wrote:

                  the quality of what "we" as supposed professionals produce is so obviously bad

                  After seeing how bad so many of the so called professionals are in our industry, I no longer trust professionals in other industries. Once you do that, it becomes easier to observe that there are more flawed products than there are good ones.

                  Thou mewling ill-breeding pignut!

                  J Offline
                  J Offline
                  JimBob SquarePants
                  wrote on last edited by
                  #27

                  Web development is saturated with individuals whose skill-set is extremely poor and who lie about their ability with no shame. It really grinds my gears. I set about a guy recently in the LinkedIn forums who was asking if anyone had any guides so he could quickly learn JavaScript though on his profile he said he was an expert!

                  JimBob SquarePants ******************************************************************* "He took everything personally, including our royalties!" David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager *******************************************************************

                  H K 2 Replies Last reply
                  0
                  • M Marc Clifton

                    Ennis Ray Lynch, Jr. wrote:

                    The difference between a professional and an amateur is that a professional gets paid. Open Source = Free?

                    There is nothing free about Open Source. ;) And, as far as professionals getting paid, most of the "paid professionals" I've had to work with are anything but professional. And frankly, that extends to other fields than just IT. Marc

                    Testers Wanted!
                    Latest Article: User Authentication on Ruby on Rails - the definitive how to
                    My Blog

                    D Offline
                    D Offline
                    descenterace
                    wrote on last edited by
                    #28

                    I think what he was getting at is that 'professional' says nothing about quality of work, only that the person is paid to do it .

                    1 Reply Last reply
                    0
                    • M Mark_Wallace

                      The content of their "Documentation" page: "This project does not have documentation yet." Then why have a Documentation tab prominently placed at the top of every page? They don't have a page of beanie-baby photos, either, but I don't see a "Beanie-baby Photos" tab in their main menu. Do we really need people like these to tell us anything about web design or web development? You learn from masters, not fools.

                      I wanna be a eunuchs developer! Pass me a bread knife!

                      M Offline
                      M Offline
                      Marc Clifton
                      wrote on last edited by
                      #29

                      Mark_Wallace wrote:

                      Then why have a Documentation tab prominently placed at the top of every page?

                      Well, I suspect that's just the boilerplate of every codeplex project. Marc

                      Testers Wanted!
                      Latest Article: User Authentication on Ruby on Rails - the definitive how to
                      My Blog

                      1 Reply Last reply
                      0
                      • J JimBob SquarePants

                        Web development is saturated with individuals whose skill-set is extremely poor and who lie about their ability with no shame. It really grinds my gears. I set about a guy recently in the LinkedIn forums who was asking if anyone had any guides so he could quickly learn JavaScript though on his profile he said he was an expert!

                        JimBob SquarePants ******************************************************************* "He took everything personally, including our royalties!" David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager *******************************************************************

                        H Offline
                        H Offline
                        Herbie Mountjoy
                        wrote on last edited by
                        #30

                        I once heard these guys described as 'enthusiastic amateurs'. Knowledge is power. Power corrupts. So does that mean knowledge corrupts?

                        1 Reply Last reply
                        0
                        • M Marc Clifton

                          Lloyd Atkinson wrote:

                          My gripe with open source is how most of the time they love being in the habit of just giving the source and saying "Build it yourself.". No thanks, I likely don't use the same toolchain or compilers as you. Why can't they just release a binary?

                          Well, if you're looking at Unix-based stuff, it's because of the various platforms and processors, but most of the Windows-based stuff I've seen, binaries are provided. I'd much rather have the source though - first of all because the binaries tend to target older Visual Studio's especially if the project isn't being maintained, and secondly because I want to be able to fix simple things and/or just see what's going on under the hood. Marc

                          Testers Wanted!
                          Latest Article: User Authentication on Ruby on Rails - the definitive how to
                          My Blog

                          S Offline
                          S Offline
                          Stuart Dootson
                          wrote on last edited by
                          #31

                          Marc Clifton wrote:

                          I'd much rather have the source though

                          Me too, if only so that I can configure it and know I've got a good chance of getting it working when I upgrade my toolchain... Which I've managed with a long-standing C++ project that was originally developed with VC++ 98 and will soon get moved to Visual Studio 2012...(and it's moved from SourceSafe, through SVN to Mercurial in the over the years too...)

                          Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p CodeProject MVP for 2010 - who'd'a thunk it!

                          1 Reply Last reply
                          0
                          • M Marc Clifton

                            This time, my sights are on HtmlAgilityPack[^]. Besides the fact that there is no documentation and the one example provided has an absurd quote-placement error, so obviously the code was never tested, there's this:

                            /// /// Selects a list of nodes matching the expression.
                            ///
                            /// The XPath expression.
                            /// An containing a collection of nodes matching the query, or null if no node matched the XPath expression.
                            public HtmlNodeCollection SelectNodes(string xpath)

                            What? You return a null if no matches are found??? Which of course would blow up their "example" if no "href" tags exist:

                            HtmlDocument doc = new HtmlDocument();
                            doc.Load("file.htm");
                            foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"])
                            {

                            Why is it that the quality of what "we" as supposed professionals produce is so obviously bad? On a positive note, someone did put together a HAPExplorer (albeit in WPF, why???) that at least provides some working examples, and lo-and-behold, it does compile (after I nuked the test project with an NUnit dependency), but on a bad note, the latest source download complained about a missing .cs file, so the test stuff doesn't build anyways. :sigh: Marc

                            Testers Wanted!
                            Latest Article: User Authentication on Ruby on Rails - the definitive how to
                            My Blog

                            S Offline
                            S Offline
                            svella
                            wrote on last edited by
                            #32

                            Marc Clifton wrote:

                            Why is it that the quality of what "we" as supposed professionals produce is so obviously bad?

                            A professional is someone who gets paid for his work, so complaining about the lack of professionalism in an open source project is kind of an oxymoron.

                            1 Reply Last reply
                            0
                            • M Marc Clifton

                              wizardzz wrote:

                              What are you using it for? If you need help, I might be able to help.

                              Well, that's cool! Nothing complicated, just replacing the img src tags with a local file (this is test code, I will shortly replace the hardcoded paths, etc.):

                              protected void SaveOffline(object sender, EventArgs args)
                              {
                              HtmlDocument doc = View.Browser.Document;
                              HtmlAgilityPack.HtmlDocument adoc = new HtmlAgilityPack.HtmlDocument();
                              adoc.LoadHtml(doc.Body.OuterHtml);
                              int n=0;

                              foreach (HtmlAgilityPack.HtmlNode img in adoc.DocumentNode.Descendants("img"))
                              {
                              	img.Attributes\["src"\].IfNotNull(a =>
                              		{
                              			string src = a.Value;
                              			string location = DownloadImage(src, "c:\\\\temp\\\\testfolder\\\\" + n.ToString() + "." + src.RightOfRightmostOf('.'));
                              			++n;
                              
                              			if (location != String.Empty)
                              			{
                              				a.Value = "file:///" + location;
                              			}
                              		});
                              }
                              
                              adoc.Save("c:\\\\temp\\\\test2.html");
                              

                              }

                              Which works great - basically, I haven't needed it for anything else, so it's probably overkill. Poking around the code to verify that if the attribute is not found it returns null rather than throwing an exception), I found this:

                              public HtmlAttribute this[string name]
                              {
                              get
                              {
                              if (name == null)
                              {
                              throw new ArgumentNullException("name");
                              }
                              HtmlAttribute value;
                              return Hashitems.TryGetValue(name.ToLower(), out value) ? value : null;
                              }
                              set { Append(value); }
                              }

                              The setter is very strange. I would expect a syntax like: node["someAttribute"]=new HtmlAttribute("foobar"); to replace the attribute if it exists or create a new one if it doesn't. What puzzles me is the Append call, which:

                                      Hashitems\[newAttribute.Name\] = newAttribute;
                                      newAttribute.\_ownernode = \_ownernode;
                                      items.Add(newAttribute);
                              

                              adds the new attribute to the items collection, but replaces it in the Hashitems dictionary. This seems wrong. Thoughts? Marc

                              Testers Wanted!
                              Latest Article: User Authentication on Ruby on Rails - the definitive how to
                              My Blog

                              W Offline
                              W Offline
                              wizardzz
                              wrote on last edited by
                              #33

                              I don't get an exception from trying to iterate the null set. Test.html contains no "img" nodes:

                              HtmlAgilityPack.HtmlDocument hd = new HtmlAgilityPack.HtmlDocument();
                              hd.LoadHtml("c:\test\test.html");

                              try
                              {
                              //code executes
                              foreach (HtmlAgilityPack.HtmlNode img in hd.DocumentNode.Descendants("img"))
                              {
                              //never executes
                              Console.WriteLine(img.ToString());
                              }
                              //code executes
                              }
                              catch (Exception ex)
                              {
                              //never executes
                              Console.WriteLine(ex.Message);
                              }

                              As far as the Dictionary, that is adding if it doesn't exist, but replacing it if it does. It's an add/replace, but I don't think will be a replace ever as the attributes would be unique. Example:

                              Dictionary<string, int> dic = new Dictionary<string, int>();
                              dic["first"] = 1;
                              Console.WriteLine(dic["first"].ToString());

                              Output: 1

                              Twits[^]

                              M 1 Reply Last reply
                              0
                              • M Marc Clifton

                                This time, my sights are on HtmlAgilityPack[^]. Besides the fact that there is no documentation and the one example provided has an absurd quote-placement error, so obviously the code was never tested, there's this:

                                /// /// Selects a list of nodes matching the expression.
                                ///
                                /// The XPath expression.
                                /// An containing a collection of nodes matching the query, or null if no node matched the XPath expression.
                                public HtmlNodeCollection SelectNodes(string xpath)

                                What? You return a null if no matches are found??? Which of course would blow up their "example" if no "href" tags exist:

                                HtmlDocument doc = new HtmlDocument();
                                doc.Load("file.htm");
                                foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"])
                                {

                                Why is it that the quality of what "we" as supposed professionals produce is so obviously bad? On a positive note, someone did put together a HAPExplorer (albeit in WPF, why???) that at least provides some working examples, and lo-and-behold, it does compile (after I nuked the test project with an NUnit dependency), but on a bad note, the latest source download complained about a missing .cs file, so the test stuff doesn't build anyways. :sigh: Marc

                                Testers Wanted!
                                Latest Article: User Authentication on Ruby on Rails - the definitive how to
                                My Blog

                                R Offline
                                R Offline
                                RafagaX
                                wrote on last edited by
                                #34

                                Open source is not equal to quality, open source is equal to I put the best I can in my spare time to fix a problem I had and I put it in the internet so anyone having this problem can see and/or use my solution. As some open source project maintainers say (although I respectfully disagree on some of the means they make this clear), if you don't like the state of the project, improve it.

                                CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...

                                1 Reply Last reply
                                0
                                • M Marc Clifton

                                  This time, my sights are on HtmlAgilityPack[^]. Besides the fact that there is no documentation and the one example provided has an absurd quote-placement error, so obviously the code was never tested, there's this:

                                  /// /// Selects a list of nodes matching the expression.
                                  ///
                                  /// The XPath expression.
                                  /// An containing a collection of nodes matching the query, or null if no node matched the XPath expression.
                                  public HtmlNodeCollection SelectNodes(string xpath)

                                  What? You return a null if no matches are found??? Which of course would blow up their "example" if no "href" tags exist:

                                  HtmlDocument doc = new HtmlDocument();
                                  doc.Load("file.htm");
                                  foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"])
                                  {

                                  Why is it that the quality of what "we" as supposed professionals produce is so obviously bad? On a positive note, someone did put together a HAPExplorer (albeit in WPF, why???) that at least provides some working examples, and lo-and-behold, it does compile (after I nuked the test project with an NUnit dependency), but on a bad note, the latest source download complained about a missing .cs file, so the test stuff doesn't build anyways. :sigh: Marc

                                  Testers Wanted!
                                  Latest Article: User Authentication on Ruby on Rails - the definitive how to
                                  My Blog

                                  T Offline
                                  T Offline
                                  Tom Falconer
                                  wrote on last edited by
                                  #35

                                  As it is open source, why don't you fix it? Then, instead of complaining about all open based on one example, you could actually be part of the solution. Just a thought...

                                  1 Reply Last reply
                                  0
                                  • M Marc Clifton

                                    This time, my sights are on HtmlAgilityPack[^]. Besides the fact that there is no documentation and the one example provided has an absurd quote-placement error, so obviously the code was never tested, there's this:

                                    /// /// Selects a list of nodes matching the expression.
                                    ///
                                    /// The XPath expression.
                                    /// An containing a collection of nodes matching the query, or null if no node matched the XPath expression.
                                    public HtmlNodeCollection SelectNodes(string xpath)

                                    What? You return a null if no matches are found??? Which of course would blow up their "example" if no "href" tags exist:

                                    HtmlDocument doc = new HtmlDocument();
                                    doc.Load("file.htm");
                                    foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"])
                                    {

                                    Why is it that the quality of what "we" as supposed professionals produce is so obviously bad? On a positive note, someone did put together a HAPExplorer (albeit in WPF, why???) that at least provides some working examples, and lo-and-behold, it does compile (after I nuked the test project with an NUnit dependency), but on a bad note, the latest source download complained about a missing .cs file, so the test stuff doesn't build anyways. :sigh: Marc

                                    Testers Wanted!
                                    Latest Article: User Authentication on Ruby on Rails - the definitive how to
                                    My Blog

                                    P Offline
                                    P Offline
                                    patbob
                                    wrote on last edited by
                                    #36

                                    Marc Clifton wrote:

                                    Why is it that the quality of what "we" as supposed professionals produce is so obviously bad?

                                    Documentation & example code isn't generally the fun part to people who work on open source projects, which is why that part of nearly every project is so dismal. The source code is also sometimes an audition.

                                    We can program with only 1's, but if all you've got are zeros, you've got nothing.

                                    1 Reply Last reply
                                    0
                                    • W wizardzz

                                      I don't get an exception from trying to iterate the null set. Test.html contains no "img" nodes:

                                      HtmlAgilityPack.HtmlDocument hd = new HtmlAgilityPack.HtmlDocument();
                                      hd.LoadHtml("c:\test\test.html");

                                      try
                                      {
                                      //code executes
                                      foreach (HtmlAgilityPack.HtmlNode img in hd.DocumentNode.Descendants("img"))
                                      {
                                      //never executes
                                      Console.WriteLine(img.ToString());
                                      }
                                      //code executes
                                      }
                                      catch (Exception ex)
                                      {
                                      //never executes
                                      Console.WriteLine(ex.Message);
                                      }

                                      As far as the Dictionary, that is adding if it doesn't exist, but replacing it if it does. It's an add/replace, but I don't think will be a replace ever as the attributes would be unique. Example:

                                      Dictionary<string, int> dic = new Dictionary<string, int>();
                                      dic["first"] = 1;
                                      Console.WriteLine(dic["first"].ToString());

                                      Output: 1

                                      Twits[^]

                                      M Offline
                                      M Offline
                                      Marc Clifton
                                      wrote on last edited by
                                      #37

                                      wizardzz wrote:

                                      I don't get an exception from trying to iterate the null set. Test.html contains no "img" nodes:

                                      The issue isn't with Descendents, it's with SelectNodes, which return null instead of an empty collection. Perhaps that is the desired behavior for a "Select" function.

                                      wizardzz wrote:

                                      that is adding if it doesn't exist, but replacing it if it does.

                                      Right, but then what's this line doing:

                                      items.Add(newAttribute);

                                      in the Append function? Why is the has replacing while the items collection is adding, leading to confusion about the use of the hash and the name "Append." I'm a bit confused by your answers, because they seem to miss the mark with regards to my earlier posts. Perhaps they were not clear enough? Marc

                                      Testers Wanted!
                                      Latest Article: User Authentication on Ruby on Rails - the definitive how to
                                      My Blog

                                      W 2 Replies Last reply
                                      0
                                      • M Marc Clifton

                                        wizardzz wrote:

                                        I don't get an exception from trying to iterate the null set. Test.html contains no "img" nodes:

                                        The issue isn't with Descendents, it's with SelectNodes, which return null instead of an empty collection. Perhaps that is the desired behavior for a "Select" function.

                                        wizardzz wrote:

                                        that is adding if it doesn't exist, but replacing it if it does.

                                        Right, but then what's this line doing:

                                        items.Add(newAttribute);

                                        in the Append function? Why is the has replacing while the items collection is adding, leading to confusion about the use of the hash and the name "Append." I'm a bit confused by your answers, because they seem to miss the mark with regards to my earlier posts. Perhaps they were not clear enough? Marc

                                        Testers Wanted!
                                        Latest Article: User Authentication on Ruby on Rails - the definitive how to
                                        My Blog

                                        W Offline
                                        W Offline
                                        wizardzz
                                        wrote on last edited by
                                        #38

                                        I'll look at the first one later, I thought you were talking about Descendants too. Regarding the append/replace: Yes. It's goofy to do it the way they did, but will it ever do a replace? Won't dic[newwattname] = newattvalue; always be an append to the dictionary? Sure they aren't using .Add to the dictionary, that's the goofy part, I get that. Some people are accustomed to using the Append/Replace way to prevent the attempt to add non unique keys to the dictionary. The other goofiness is using an Add only to the list after just doing an add/replace, yes, it's goofy, it's inconsistent. I would never do it this way, they (dictionary & list) could get out of whack and it is ugly and inconsistent, but as far as using the code they wrote; won't attributes always be unique anyways? I think it's an example of ugly code that works only in the situation they wrote it for.

                                        Twits[^]

                                        1 Reply Last reply
                                        0
                                        • L LloydA111

                                          I see what your both saying, but many of these "build it yourself" projects also have the package files in Linux distro repositories, so I'm sure they could make a Windows binary too.

                                                 .-.
                                                |o,o|
                                             ,| \_\\=/\_      .-""-.
                                             ||/\_/\_\\\_\\    /\[\] \_ \_\\
                                             |\_/|(\_)|\\\\  \_|\_o\_LII|\_
                                                \\.\_./// / | ==== | \\
                                                |\\\_/|"\` |\_| ==== |\_|
                                                |\_|\_|    ||" ||  ||
                                                |-|-|    ||LI  o ||
                                                |\_|\_|    ||'----'||
                                               /\_/ \\\_\\  /\_\_|    |\_\_\\
                                          
                                          J Offline
                                          J Offline
                                          jibalt
                                          wrote on last edited by
                                          #39

                                          Yes, yes, no doubt "they" can do all sorts of things for you. Now, perhaps you would like to contribute by making the Windows binary.

                                          L 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups