DEV Community

Red for hopeless programmers - Part II

lepinekong on December 16, 2017

In part I, we learned how to download historical quotes from Google Finance. In part II, we'll learn how to parse datas and html files to generate...
Collapse
 
godwinburby profile image
Godwin Burby

Waiting for part iii(crud script) and part iv (automation script)

Collapse
 
lepinekong profile image
lepinekong

Part III is being written. Should be published next week.

Collapse
 
hightechforms profile image
HighTechForms

Did part III ever get published? And part IV? :D

Thread Thread
 
lepinekong profile image
lepinekong

Hi sorry :) Yes I explained why I didn't do it medium.com/@lepinekong/readable-hu...

But would be able to do it in 2 weeks from now ;)

Thread Thread
 
hightechforms profile image
HighTechForms

That link takes me to a page that says "The author deleted this Medium story."

Are you going to publish any follow-ups?

Thread Thread
 
cloutiy profile image
yc
Thread Thread
 
lepinekong profile image
lepinekong

Oh my sorry I completely forgot, I'm busy on other stuffs :) there's a beginning above for part III as posted by yc, thanks.

Thread Thread
 
cloutiy profile image
yc • Edited

I hope you keep doing tutorials. They are really helpful. Looking at your code really helps to see how to do things "the red way", as opposed to trying to ramming your head against the wall trying to do things the (C, java, enter your current programming language here) way, but using Red.

You really do have to think differently.

btw, HumanRedable...brilliant piece of work. I especially like the "select selector" approach you use for generating. It's a brilliant way to approach it, vs parsing->tree-walking->code generating approach I certainly would have used.

Thread Thread
 
wiredferret profile image
Heidi Waterhouse

Thank you for the helpful comment and additional data!

Thread Thread
 
lepinekong profile image
lepinekong

yes I'll do more tutorials but later. Meanwhile you can also look at some red code snippets here mycodesnippets.space/redlang/ most are simple to understand.

Collapse
 
red_adi profile image
red-adi

For Yahoo data, I had to add three lines:

...
foreach line lines [

    ; splitting each line by comma delimiter
    quote: split line ","; -> [date open high low close volume]

    ;removes the 6th column (Adj Vol) from Yahoo data
    quote/6: copy quote/7
    take/last quote

    ;For later use if needed convert string to float open high low close volume
    i: 2; starting at column 2 (skipping date column)
    foreach column skip quote 1 [; skip first date column 
      quote/:i: to-float quote/:i; quote:i refers to the ith column of quote
      i: i + 1
    ]
...
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ivobalbaert profile image
ibalbaert

Very nice!