victorshulist / sortable-code-challenge

Code challenge
0 stars 0 forks source link

Problem with output format #1

Open overthink opened 9 years ago

overthink commented 9 years ago

Hi Victor.

Could you please ensure each line in the output file is a valid JSON document? e.g. the following line is produced by your solution:

{"listings":"[{\"currency\":\"USD\",\"manufacturer\":\"Sony\",\"price\":\"139.99\",\"title\":\"Sony DSC F55 Cyber shot 2MP Digital Camera\"}]","product_name":"Sony Cyber shot DSC F55"}

but the value of the listings property should be an array of objects, not a string.

If you can fix this I can evaluate your solution. Thanks!

Mark from sortable.com

victorshulist commented 9 years ago

Done !   Updated on github.

Thanks.

(first time using Json, just needed to edit one line).

On Jun 02, 2015, at 04:08 PM, Mark Feeney notifications@github.com wrote:

Hi Victor. Could you please ensure each line in the output file is a valid JSON document? e.g. the following line is produced by your solution: {"listings":"[{\"currency\":\"USD\",\"manufacturer\":\"Sony\",\"price\":\"139.99\",\"title\":\"Sony DSC F55 Cyber shot 2MP Digital Camera\"}]","product_name":"Sony Cyber shot DSC F55"} but the value of the listings property should be an array of objects, not a string. If you can fix this I can evaluate your solution. Thanks! Mark from sortable.com — Reply to this email directly or view it on GitHub.

victorshulist commented 9 years ago

Hello

Can you confirm you received the email below

thank you

On Jun 02, 2015, at 10:01 PM, Victor Shulist victor.shulist@icloud.com wrote:

Done !   Updated on github.

Thanks.

(first time using Json, just needed to edit one line).

On Jun 02, 2015, at 04:08 PM, Mark Feeney notifications@github.com wrote:

Hi Victor. Could you please ensure each line in the output file is a valid JSON document? e.g. the following line is produced by your solution: {"listings":"[{\"currency\":\"USD\",\"manufacturer\":\"Sony\",\"price\":\"139.99\",\"title\":\"Sony DSC F55 Cyber shot 2MP Digital Camera\"}]","product_name":"Sony Cyber shot DSC F55"} but the value of the listings property should be an array of objects, not a string. If you can fix this I can evaluate your solution. Thanks! Mark from sortable.com — Reply to this email directly or view it on GitHub.

overthink commented 9 years ago

Yep, message received. Thanks.

overthink commented 9 years ago

Hi Victor. Two more issues:

1) Can you make sure the output is encoded as UTF-8? 2) The listings in the output need to be identical to the listings in the input -- looking briefly it seems that yours may be slightly modified due to tokenization or something.

Thanks, Mark

victorshulist commented 9 years ago

Hi again Mark

1) Can you make sure the output is encoded as UTF-8?

         The script just outputs the same encoding as the input ... and the sample input from the website is only ASCII.....

          [victorshulist@electron code-challenge]$ file listings.txt
         listings.txt: ASCII text, with very long lines
         [victorshulist@electron code-challenge]$ file products.txt
         products.txt: ASCII text

2) The listings in the output need to be identical to the listings in the input -- looking briefly it seems that yours may be slightly modified due to tokenization or something. I see -- some of the json variable names aren't in the same order as your same -- the way Perl hashes work :) But a good parser shouldn't mind .. unless you're doing a literal exact compare.... In any event, I committed a new version to GitHub that matches the order of name/value pairs as in listings.txt.

Cheers.

On Jun 05, 2015, at 11:00 AM, Mark Feeney notifications@github.com wrote:

Hi Victor. Two more issues:

1) Can you make sure the output is encoded as UTF-8? 2) The listings in the output need to be identical to the listings in the input -- looking briefly it seems that yours may be slightly modified due to tokenization or something.

Thanks, Mark

— Reply to this email directly or view it on GitHub.

victorshulist commented 9 years ago

Hi Mark

no update?

Sent from my iPad

On Jun 5, 2015, at 11:00 AM, Mark Feeney notifications@github.com wrote:

Hi Victor. Two more issues:

1) Can you make sure the output is encoded as UTF-8? 2) The listings in the output need to be identical to the listings in the input -- looking briefly it seems that yours may be slightly modified due to tokenization or something.

Thanks, Mark

— Reply to this email directly or view it on GitHub.