Another open source rant
-
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 BlogMarc Clifton wrote:
Why is it that the quality of what "we" as supposed professionals produce is so obviously bad?
That I can tell you. Computers are very complex, at least if you look at how many transistors are working in them at high speed. Still everybody and his dog believes to be able to do everything while being absolutely clueless.
Sent from my BatComputer via HAL 9000 and M5
-
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 BlogMarc 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.
-
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.
Ain't that the truth. I used to work at a Naval ship yard and we used to joke that we were amazed that the ships came back up. Yeah submarines .... They always asked me if I wanted to tour one of the boats ... how cool it would be to go out for a cruise in one ... and I was like ... no I'm fine! Thanks! :omg:
The environment that nurtures creative programmers kills management and marketing types - and vice versa. - Orson Scott Card
-
Ain't that the truth. I used to work at a Naval ship yard and we used to joke that we were amazed that the ships came back up. Yeah submarines .... They always asked me if I wanted to tour one of the boats ... how cool it would be to go out for a cruise in one ... and I was like ... no I'm fine! Thanks! :omg:
The environment that nurtures creative programmers kills management and marketing types - and vice versa. - Orson Scott Card
That's just terrific terrifying. Somehow I feel a little less safe. :~ Perhaps it is not that different from how the developers at Microsoft don't use Visual Studio (I forget where I saw that post). Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
-
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 -
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 BlogMy 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? :mad:
.-. |o,o| ,| \_\\=/\_ .-""-. ||/\_/\_\\\_\\ /\[\] \_ \_\\ |\_/|(\_)|\\\\ \_|\_o\_LII|\_ \\.\_./// / | ==== | \\ |\\\_/|"\` |\_| ==== |\_| |\_|\_| ||" || || |-|-| ||LI o || |\_|\_| ||'----'|| /\_/ \\\_\\ /\_\_| |\_\_\\
-
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? :mad:
.-. |o,o| ,| \_\\=/\_ .-""-. ||/\_/\_\\\_\\ /\[\] \_ \_\\ |\_/|(\_)|\\\\ \_|\_o\_LII|\_ \\.\_./// / | ==== | \\ |\\\_/|"\` |\_| ==== |\_| |\_|\_| ||" || || |-|-| ||LI o || |\_|\_| ||'----'|| /\_/ \\\_\\ /\_\_| |\_\_\\
Lloyd Atkinson wrote:
Why can't they just release a binary?
for every platform the code could possibly be compiled on?
-
Lloyd Atkinson wrote:
Why can't they just release a binary?
for every platform the code could possibly be compiled on?
No, just a binary for Windows would be great.
.-. |o,o| ,| \_\\=/\_ .-""-. ||/\_/\_\\\_\\ /\[\] \_ \_\\ |\_/|(\_)|\\\\ \_|\_o\_LII|\_ \\.\_./// / | ==== | \\ |\\\_/|"\` |\_| ==== |\_| |\_|\_| ||" || || |-|-| ||LI o || |\_|\_| ||'----'|| /\_/ \\\_\\ /\_\_| |\_\_\\
-
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 BlogUm, The difference between a professional and an amateur is that a professional gets paid. Open Source = Free?
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost "All users always want Excel" --Ennis Lynch
-
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 -
Ain't that the truth. I used to work at a Naval ship yard and we used to joke that we were amazed that the ships came back up. Yeah submarines .... They always asked me if I wanted to tour one of the boats ... how cool it would be to go out for a cruise in one ... and I was like ... no I'm fine! Thanks! :omg:
The environment that nurtures creative programmers kills management and marketing types - and vice versa. - Orson Scott Card
One of my friends was a plane mechanic working on-board a Navy carrier... he said when they ran out of bolts of one size, they would go one size down, wrap them in something metallic like wire and jam them in. I'm guessing duct tape was the next viable option. ..sounds safe... :rolleyes:
-
No, just a binary for Windows would be great.
.-. |o,o| ,| \_\\=/\_ .-""-. ||/\_/\_\\\_\\ /\[\] \_ \_\\ |\_/|(\_)|\\\\ \_|\_o\_LII|\_ \\.\_./// / | ==== | \\ |\\\_/|"\` |\_| ==== |\_| |\_|\_| ||" || || |-|-| ||LI o || |\_|\_| ||'----'|| /\_/ \\\_\\ /\_\_| |\_\_\\
Think Chris is just pointing out how it's a problem for them anyway... if they have to support a bunch of platforms, it's easier for them to make you compile it, although you may not like that option. I guess I can see how it's an issue all around, both from the devs perspective and from the user perspective.
-
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 BlogWho said open-source was supposed to be "professional" level quality ? Everyone including your mom could push something out as open source...
Nihil obstat
-
Um, The difference between a professional and an amateur is that a professional gets paid. Open Source = Free?
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost "All users always want Excel" --Ennis Lynch
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 -
Um, The difference between a professional and an amateur is that a professional gets paid. Open Source = Free?
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost "All users always want Excel" --Ennis Lynch
Ennis Ray Lynch, Jr. wrote:
difference between a professional and an amateur is that a professional gets paid
...to provide a crappy product just like their amateur counterparts... :laugh: ;P
-
Who said open-source was supposed to be "professional" level quality ? Everyone including your mom could push something out as open source...
Nihil obstat
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).
-
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? :mad:
.-. |o,o| ,| \_\\=/\_ .-""-. ||/\_/\_\\\_\\ /\[\] \_ \_\\ |\_/|(\_)|\\\\ \_|\_o\_LII|\_ \\.\_./// / | ==== | \\ |\\\_/|"\` |\_| ==== |\_| |\_|\_| ||" || || |-|-| ||LI o || |\_|\_| ||'----'|| /\_/ \\\_\\ /\_\_| |\_\_\\
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 -
Think Chris is just pointing out how it's a problem for them anyway... if they have to support a bunch of platforms, it's easier for them to make you compile it, although you may not like that option. I guess I can see how it's an issue all around, both from the devs perspective and from the user perspective.
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 || |\_|\_| ||'----'|| /\_/ \\\_\\ /\_\_| |\_\_\\
-
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 || |\_|\_| ||'----'|| /\_/ \\\_\\ /\_\_| |\_\_\\
...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.
-
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).
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