Skip to main content
Code Review

Return to Question

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

I have opened a puzzle at Programming Puzzles and Code Golf a puzzle at Programming Puzzles and Code Golf. The question is not perceived well (yet) and one of the reasons is that no reference implementation is provided. To mitigate this shortcoming, I have implemented a (non-golfed and documented) reference solution.

For more details please see the question at PCG the question at PCG.

I have opened a puzzle at Programming Puzzles and Code Golf. The question is not perceived well (yet) and one of the reasons is that no reference implementation is provided. To mitigate this shortcoming, I have implemented a (non-golfed and documented) reference solution.

For more details please see the question at PCG.

I have opened a puzzle at Programming Puzzles and Code Golf. The question is not perceived well (yet) and one of the reasons is that no reference implementation is provided. To mitigate this shortcoming, I have implemented a (non-golfed and documented) reference solution.

For more details please see the question at PCG.

deleted 72 characters in body; edited tags
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238
  • ParseHtmlToObjects()ParseHtmlToObjects(), which is a bit too long for my taste
  • AddProperty()AddProperty(), which has a ref parameter and causes a side effect. If possible, please suggest a better solution, ideally with a code snippet.

I'd not like feedback about:

  • Performance, since it is ok with the largest real world test file I have
  • convertingConverting loops to LINQ, since I simply prefer the loops
  • Other nifty C# 10.5 lambda inline tricks etc. that nobody can read 6 months from now
  • Implementation language is C# 4.5
  • Input is HTML, output is JSON
  • Libraries: HtmlAgilityPack, ExCSS and JSON.NET
  • ImplemtedImplemented with R# support. The code is almost green with warnings about "Possible multiple enumreation"enumeration" inside Convert(). Maybe someone can elaborate how critical that is.
  • readRead some awkward and verbose HTML document, extract the relevant information based on various indicators (HTML elements, attributes and CSS style information)
  • outputOutput valid JSON which contains the relevant information

For more details please see the question at PCG.(If some relevant info shall be included here, just drop a comment)

  • entryEntry point is the constructor HtmlToJsonConverter()
  • and the Convert() method

I don't provide CustomJsonConverter here, since that is straight forwardstraightforward.

  • ParseHtmlToObjects(), which is a bit too long for my taste
  • AddProperty(), which has a ref parameter and causes a side effect. If possible, please suggest a better solution, ideally with a code snippet.

I'd not like feedback about

  • Performance, since it is ok with the largest real world test file I have
  • converting loops to LINQ, since I simply prefer the loops
  • Other nifty C# 10.5 lambda inline tricks etc. that nobody can read 6 months from now
  • Implementation language is C# 4.5
  • Input is HTML, output is JSON
  • Libraries: HtmlAgilityPack, ExCSS and JSON.NET
  • Implemted with R# support. The code is almost green with warnings about "Possible multiple enumreation" inside Convert(). Maybe someone can elaborate how critical that is.
  • read some awkward and verbose HTML document, extract the relevant information based on various indicators (HTML elements, attributes and CSS style information)
  • output valid JSON which contains the relevant information

For more details please see the question at PCG.(If some relevant info shall be included here, just drop a comment)

  • entry point is the constructor HtmlToJsonConverter()
  • and the Convert() method

I don't provide CustomJsonConverter here, since that is straight forward.

  • ParseHtmlToObjects(), which is a bit too long for my taste
  • AddProperty(), which has a ref parameter and causes a side effect. If possible, please suggest a better solution, ideally with a code snippet.

I'd not like feedback about:

  • Performance, since it is ok with the largest real world test file I have
  • Converting loops to LINQ, since I simply prefer the loops
  • Other nifty C# 10.5 lambda inline tricks etc. that nobody can read 6 months from now
  • Implementation language is C# 4.5
  • Input is HTML, output is JSON
  • Libraries: HtmlAgilityPack, ExCSS and JSON.NET
  • Implemented with R# support. The code is almost green with warnings about "Possible multiple enumeration" inside Convert(). Maybe someone can elaborate how critical that is.
  • Read some awkward and verbose HTML document, extract the relevant information based on various indicators (HTML elements, attributes and CSS style information)
  • Output valid JSON which contains the relevant information

For more details please see the question at PCG.

  • Entry point is the constructor HtmlToJsonConverter()
  • Convert() method

I don't provide CustomJsonConverter here, since that is straightforward.

edited title
Link
200_success
  • 145.5k
  • 22
  • 190
  • 478

Correctness and understandability Reference implementation of myHTML-to-JSON converter for PCG reference implementation

Tweeted twitter.com/#!/StackCodeReview/status/573271348375642112
Source Link
Thomas Weller
  • 1.7k
  • 14
  • 25
Loading
lang-cs

AltStyle によって変換されたページ (->オリジナル) /