* -LIST * INPUT('DATE_IN',8,80,'book.dat') initial_date = INPUT INPUT_FILE_NAME = INPUT INPUT_FILE_NAME2 = INPUT INPUT('INPUT_IN',10,4096,INPUT_FILE_NAME) INPUT('INPUT_IN2',11,4096,INPUT_FILE_NAME2) overall_daily_goal = 0.0 DATE_SAVE = DATE() OUTPUT = " Dennis J. Darland's Reading, etc. Since " initial_date " as of " DATE_SAVE DEFINE('GET_FIELD(FIELD_NAME,LINE_IN)','FIELDENTRY') DEFINE('GET_TITLE(LINE_IN)','TITLEENTRY') DEFINE('GET_NOTE(LINE_IN)','NOTEENTRY') DEFINE('RANGE(START,FINISH),NDAYS,days_s,days_f','RANGEENTRY') DEFINE('SHRINK(STR)','SHRINKENTRY') DEFINE('SHRINK_H(STR)','SHRINKHENTRY') DEFINE('CVT_DAYS(yr,mo,da),I,ndays','CVT_DAYSENTRY') DEFINE('MOD_DJD(M,N)','MOD_ENTRY') DEFINE('HEADER()','HEADER_ENTRY') DEFINE('TRAILER()','TRAILER_ENTRY') OUTPUT('OUTPUT',6,4096) total_cat = TABLE() &trace = 0 trace('beg_tm_fixed','value') line_cnt = 0 total_time = 0.0 overall_begin_page = 0 overall_current_page = 0 overall_total_pages = 0 overall_pages_read = 0 ualpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' lalpha = 'abcdefghijklmnopqrstuvwxyz' numer = '1234567890' numer2 = '1234567890.' numer3 = '-1234567890' numer4 = ':1234567890' pg1 = ' [goal ' span(numer2) . a_goal ']' ws = ' ' alpha = lalpha ualpha alphanum = alpha numer spec = ' ' loop1 line = INPUT_IN :F(sk2) * OUTPUT = "DJD000 " line line pg1 title = get_title(line) :F(loop1) completion = get_field('Completed Date: ',line) :S(skip_goal_1) * OUTPUT = "DJD002 not completed (not skipped) " line overall_daily_goal = overall_daily_goal + a_goal skip_goal_1 item_time = get_field('Time Spent: ',line) :S(Gotts) * OUTPUT = 'DJD1 ' item_time ttem_time = '0' gotts item_cat = get_field('Category: ',line) item_time FENCE SPAN(numer2) $ item_time2 ' H' RPOS(0) * OUTPUT = 'DJD2 ' item_time2 total_cat[item_cat] = total_cat[item_cat] + item_time2 total_time = total_time + item_time2 :(loop1) * sk2 REWIND(11) sk2 * OUTPUT = 'DJD3' total_time HEADER() loop2 line = INPUT_IN2 :F(sk5) note = ' ' line POS(0) BREAK('[') . line2 '[Note ' BREAK(']') . note ']' REM . line3 = :F(sk2note) line = line2 line3 sk2note title = get_title(line) :F(loop2) item_time = get_field('Time Spent: ',line) :S(gotts2) item_time = '0' gotts2 item_time FENCE SPAN(numer2) $ item_time2 ' H' RPOS(0) created = get_field('Start Date: ',line) :F(err3) p1 = ' [goal ' span(numer2) . time_goal '] ' 'from page' span(' ') span(numer3) . begin_page span(' ') 'of' span(' ') span(numer3) . total_pages span(' ') '-' span(' ') 'current' span(' ') span(numer3) . current_page p2 = ' [goal ' span(numer2) . time_goal '] ' 'from loc' span(' ') span(numer) . begin_loc span(' ') 'of' span(' ') span(numer) . total_locs span(' ') '-' span(' ') 'current' span(' ') span(numer) . current_loc p3 = ' [goal ' span(numer2) . time_goal '][time ' span(numer4) . time_est4 ' = ' span(numer) . pages_est4 ' pages]' title arb . title_out p2 :f(skloc1) begin_page1 = begin_loc / 16.69 total_pages1 = total_locs / 16.69 current_page1 = current_loc / 16.69 begin_page1 break('.') . begin_page total_pages1 break('.') . total_pages current_page1 break('.') . current_page :(skloc3) skloc1 title arb . title_out p3 :f(skloc3) begin_page1 = 0.0 total_pages1 = pages_est4 / 1.0 time_est4 span(numer) . hours_4 ':' span(numer) . minutes_4 current_page1 = pages_est4 * item_time2 / (hours_4 + (minutes_4 / 60.0)) begin_page1 break('.') . begin_page total_pages1 break('.') . total_pages current_page1 break('.') . current_page :(skloc2) skloc3 title arb . title_out p1 skloc2 item_time FENCE SPAN(numer2) $ item_time2 ' H' RPOS(0) created break('/') $ item_beg_mo '/' break('/') $ item_beg_da '/' break(' ') $ item_beg_yr ' ' break(':') $ item_beg_hr ':' break(' ') $ item_beg_min ' ' len(2) $ am_pm am_pm 'AM' ne(item_beg_hr,12) :s(sk_am2) am_pm 'PM' eq(item_beg_hr,12) :s(sk_am2) item_beg_hr = eq(item_beg_hr,12) item_beg_hr - 12 :s(sk_am2) item_beg_hr = item_beg_hr + 12 sk_am2 beg_tm = ' ' item_beg_hr ':' item_beg_min beg_tm_fixed = item_beg_mo '/' item_beg_da '/' item_beg_yr ' ' item_beg_hr ':' item_beg_min ":00" completion = get_field('Completed Date: ',line) :F(done2) completion break('/') $ item_com_mo '/' break('/') $ item_com_da '/' break(' ') $ item_com_yr ' ' break(':') $ item_com_hr ':' break(' ') $ item_com_min ' ' len(2) $ am_pm am_pm 'AM' ne(item_com_hr,12) :s(sk_am2B) am_pm 'PM' eq(item_com_hr,12) :s(sk_am2B) item_com_hr = eq(item_com_hr,12) item_com_hr - 12 :s(sk_am2B) item_com_hr = item_com_hr + 12 sk_am2B com_tm = ' ' item_com_hr ':' item_com_min com_tm_fixed = item_com_mo '/' item_com_da '/' item_com_yr ' ' item_com_hr ':' item_com_min ":00" ave_cc = item_time2 / RANGE(beg_tm_fixed,com_tm_fixed) :(done3) done2 ave_cc = 'NA' com_tm_fixed = 'NA' done3 pages_read = current_page - begin_page item_time FENCE SPAN(numer2) $ item_time2 ' H' RPOS(0) EQ(total_time, 0) :S(skper) percent = (item_time2 / total_time) * 100.0 :(sksk) skper percent = "NA" sksk overall_begin_page = overall_begin_page + begin_page overall_current_page = overall_current_page + current_page overall_total_pages = overall_total_pages + total_pages overall_pages_read = overall_pages_read + pages_read ave = item_time2 / RANGE(beg_tm_fixed,DATE_SAVE) ave_cc 'NA' :f(not_compl) eq(time_goal , 0.0) :s(sk_pct_goal) percent_goal = 100.0 * ave / time_goal :(past_compl) not_compl percent_goal = 100.0 * ave_cc / time_goal sk_pct_goal percent_goal = "NA" past_compl eq(item_time2,0) :s(sk_pph1) pages_per_hour = (current_page - begin_page) / item_time2 eq(pages_per_hour,0) :s(sk_hr1) hours_left = (total_pages - current_page) / pages_per_hour hours_left = lt(total_pages - current_page , 1) 0.0 eq(time_goal , 0.0) :f(sk_pct_goal2) days_left_at_goal = "NA" :(sk_pct_goal3) sk_pct_goal2 days_left_at_goal = hours_left / time_goal eq(ave,0) :s(sk_dy1) days_left = hours_left / ave :(sk_pph2) sk_pct_goal3 sk_pph1 pages_per_hour = "NA" sk_hr1 hours_left = "NA" sk_dy1 days_left = "NA" days_left_at_goal = "NA" sk_pph2 djd_a = mod_djd(line_cnt,10) ne(djd_a,0) :S(out_reg) OUTPUT = 'BookStartedCompletedTotal TimePercent TimeAverage TimeTime GoalPercent of GoalAve Time Start to CompletionStart PageCurrent PagePages ReadTotal PagesPages/HourHours LeftDays Left at AverageDays Left at GoalNote' out_reg OUTPUT = '' title_out '' beg_tm_fixed '' com_tm_fixed '' shrink_H(item_time2) '' shrink(percent) '% ' shrink_H(ave) '' shrink_H(time_goal) '' shrink(percent_goal) '' shrink_H(ave_cc) '' begin_page '' current_page '' pages_read '' total_pages '' shrink(pages_per_hour) '' shrink_H(hours_left) '' shrink(days_left) '' shrink(days_left_at_goal) '' note '' line_cnt = line_cnt + 1 :(loop2) sk5 eq(total_time,0) :S(skoverall) ave = total_time / RANGE(initial_date,DATE_SAVE) overall_pages_per_hour = (overall_current_page - overall_begin_page) / total_time overall_hours_left = (overall_total_pages - overall_current_page) / overall_pages_per_hour overall_days_left = overall_hours_left / ave overall_days_left_at_goal = overall_hours_left / overall_daily_goal overall_percent_goal = 100.0 * ave / overall_daily_goal OUTPUT = 'Overall' initial_date 'NA' shrink_H(total_time) '100.0 %' shrink_H(ave) '' shrink_H(overall_daily_goal) '' shrink(overall_percent_goal) 'NA' overall_begin_page '' overall_current_page '' overall_pages_read '' overall_total_pages '' shrink(overall_pages_per_hour) '' shrink_H(overall_hours_left) '' shrink(overall_days_left) '' shrink(overall_days_left_at_goal) '' skoverall TRAILER() :(END) RANGEENTRY START BREAK('/') . mo_s '/' BREAK('/') $ da_s '/' break(' ') $ yr_s ' ' break(':') $ hr_s ':' break(':') $ min_s FINISH BREAK('/') . mo_f '/' BREAK('/') $ da_f '/' break(' ') $ yr_f ' ' break(':') $ hr_f ':' break(':') $ min_f days_s = CVT_DAYS(yr_s, mo_s, da_s) days_f = CVT_DAYS(yr_f, mo_f, da_f) rng = (days_f - days_s) + (hr_f - hr_s) / 24.0 + (min_f - min_s) / (24.0 * 60.0) rng = LT(rng,1.0) 1.0 RANGE = rng :(return) CVT_DAYSENTRY I = 2010 ndays = 0 cvtloop EQ(I,YR) :s(cvtsk5) it = MOD_DJD(I,4) * ERROR IN NEXT SECTION - fixed 2/7/2020 EQ(it,0) :f(cvtsk1) ndays = ndays + 366 I = LT(I, yr) I + 1 :s(cvtloop)f(cvtsk5) cvtsk1 ndays = ndays + 365 I = LT(I, yr) I + 1 :s(cvtloop)f(cvtsk5) cvtsk5 it = MOD_DJD(yr,4) EQ(it,0) :f(cvtsk6) eq(mo,1) :f(lp_mo2) ndays = ndays + da :(retcvt) lp_mo2 eq(mo,2) :f(lp_mo3) ndays = ndays + da + 31 :(retcvt) lp_mo3 eq(mo,3) :f(lp_mo4) ndays = ndays + da + 31 + 29 :(retcvt) lp_mo4 eq(mo,4) :f(lp_mo5) ndays = ndays + da + 31 + 29 + 31 :(retcvt) lp_mo5 eq(mo,5) :f(lp_mo6) ndays = ndays + da + 31 + 29 + 31 + 30 :(retcvt) lp_mo6 eq(mo,6) :f(lp_mo7) ndays = ndays + da + 31 + 29 + 31 + 30 + 31 :(retcvt) lp_mo7 eq(mo,7) :f(lp_mo8) ndays = ndays + da + 31 + 29 + 31 + 30 + 31 + 30 :(retcvt) lp_mo8 eq(mo,8) :f(lp_mo9) ndays = ndays + da + 31 + 29 + 31 + 30 + 31 + 30 + 31 :(retcvt) lp_mo9 eq(mo,9) :f(lp_mo10) ndays = ndays + da + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 :(retcvt) lp_mo10 eq(mo,10) :f(lp_mo11) ndays = ndays + da + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 :(retcvt) lp_mo11 eq(mo,11) :f(lp_mo12) ndays = ndays + da + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 :(retcvt) lp_mo12 ndays = ndays + da + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 :(retcvt) cvtsk6 eq(mo,1) :f(rg_mo2) ndays = ndays + da :(retcvt) rg_mo2 eq(mo,2) :f(rg_mo3) ndays = ndays + da + 31 :(retcvt) rg_mo3 eq(mo,3) :f(rg_mo4) ndays = ndays + da + 31 + 28 :(retcvt) rg_mo4 eq(mo,4) :f(rg_mo5) ndays = ndays + da + 31 + 28 + 31 :(retcvt) rg_mo5 eq(mo,5) :f(rg_mo6) ndays = ndays + da + 31 + 28 + 31 + 30 :(retcvt) rg_mo6 eq(mo,6) :f(rg_mo7) ndays = ndays + da + 31 + 28 + 31 + 30 + 31 :(retcvt) rg_mo7 eq(mo,7) :f(rg_mo8) ndays = ndays + da + 31 + 28 + 31 + 30 + 31 + 30 :(retcvt) rg_mo8 eq(mo,8) :f(rg_mo9) ndays = ndays + da + 31 + 28 + 31 + 30 + 31 + 30 + 31 :(retcvt) rg_mo9 eq(mo,9) :f(rg_mo10) ndays = ndays + da + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 :(retcvt) rg_mo10 eq(mo,10) :f(rg_mo11) ndays = ndays + da + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 :(retcvt) rg_mo11 eq(mo,11) :f(rg_mo12) ndays = ndays + da + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 :(retcvt) rg_mo12 ndays = ndays + da + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 :(retcvt) retcvt cvt_days = ndays :(return) SHRINKENTRY str FENCE "NA" rpos(0) :s(sh_ret2) STR = STR '000000' STR LEN(6) . STR2 SHRINK = STR2 :(RETURN) sh_ret2 SHRINK = "NA" :(RETURN) SHRINKHENTRY str FENCE "NA" rpos(0) :s(shH_ret2) STR FENCE SPAN(numer) . hours len(1) SPAN(numer) . hund :f(no_dec) hund = hund '00' hund FENCE LEN(2) . hund2 minutes = hund2 * 60 / 100 STR2 = hours ' H ' minutes ' M' SHRINK_H = STR2 :(RETURN) shH_ret2 SHRINK_H = "NA" :(RETURN) no_dec shrink_h = str ' H 0 M' :(return) MOD_ENTRY MOD_DJD = M - (M / N) * N :(RETURN) * NOT CORRECT FOR NEG M - BUT I'M NOT USING THAT *MOD_ENTRY MOD_DJD = M *MOD_LOOP LT(MOD_DJD,N) :S(RETURN) * MOD_DJD = MOD_DJD - N :(MOD_LOOP) TRAILER_ENTRY OUTPUT = '' OUTPUT = 'TTS = Text to speech (mostly)
' OUTPUT = 'AB = Audiobook (mostly)
' OUTPUT = 'I almost always get Kindle when available.
' OUTPUT = 'If Audiobook is reasonable I get it in addition to kindle.
' OUTPUT = 'In case of [Audible AB] I have audiobook only. Estimates made.
' OUTPUT = 'Note: Hours left is based on pages read and time spent.
' OUTPUT = 'Days left is based on hours left and average time spent per day.
' OUTPUT = 'Kindle locations calculated as 16.69 locations/page.
' eq(total_time,0) :S(skipztot) OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '
CategoryTotal TimePercent TimeAverage Time
Computer Science' shrink_H(total_cat['CompSci']) '' shrink(total_cat['CompSci'] * 100.0 / total_time) '' shrink_H(total_cat['CompSci'] / RANGE(initial_date,DATE())) '
Conspiracy' shrink_H(total_cat['Consp']) '' shrink(total_cat['Consp'] * 100.0 / total_time) '' shrink_H(total_cat['Consp'] / RANGE(initial_date,DATE())) '
Diet' shrink_H(total_cat['Diet']) '' shrink(total_cat['Diet'] * 100.0 / total_time) '' shrink_H(total_cat['Diet'] / RANGE(initial_date,DATE())) '
Economocs' shrink_H(total_cat['Econ']) '' shrink(total_cat['Econ'] * 100.0 / total_time) '' shrink_H(total_cat['Econ'] / RANGE(initial_date,DATE())) '
Health' shrink_H(total_cat['Health']) '' shrink(total_cat['Health'] * 100.0 / total_time) '' shrink_H(total_cat['Health'] / RANGE(initial_date,DATE())) '
History' shrink_H(total_cat['Hist']) '' shrink(total_cat['Hist'] * 100.0 / total_time) '' shrink_H(total_cat['Hist'] / RANGE(initial_date,DATE())) '
Logic' shrink_H(total_cat['Logic']) '' shrink(total_cat['Logic'] * 100.0 / total_time) '' shrink_H(total_cat['Logic'] / RANGE(initial_date,DATE())) '
Philosophy' shrink_H(total_cat['Phil']) '' shrink(total_cat['Phil'] * 100.0 / total_time) '' shrink_H(total_cat['Phil'] / RANGE(initial_date,DATE())) '
Physics' shrink_H(total_cat['Physics']) '' shrink(total_cat['Physics'] * 100.0 / total_time) '' shrink_H(total_cat['Physics'] / RANGE(initial_date,DATE())) '
Poetry' shrink_H(total_cat['Poetry']) '' shrink(total_cat['Poetry'] * 100.0 / total_time) '' shrink_H(total_cat['Poetry'] / RANGE(initial_date,DATE())) '
Political' shrink_H(total_cat['Polit']) '' shrink(total_cat['Polit'] * 100.0 / total_time) '' shrink_H(total_cat['Polit'] / RANGE(initial_date,DATE())) '
Psychology' shrink_H(total_cat['Psy']) '' shrink(total_cat['Psy'] * 100.0 / total_time) '' shrink_H(total_cat['Psy'] / RANGE(initial_date,DATE())) '
Religion/Freethought' shrink_H(total_cat['Relig']) '' shrink(total_cat['Relig'] * 100.0 / total_time) '' shrink_H(total_cat['Relig'] / RANGE(initial_date,DATE())) '
Science' shrink_H(total_cat['Science']) '' shrink(total_cat['Science'] * 100.0 / total_time) '' shrink_H(total_cat['Science'] / RANGE(initial_date,DATE())) '
Science Fiction' shrink_H(total_cat['SciFict']) '' shrink(total_cat['SciFict'] * 100.0 / total_time) '' shrink_H(total_cat['SciFict'] / RANGE(initial_date,DATE())) '
' skipztot OUTPUT = 'I am using:
' OUTPUT = 'Abstract Spoon ToDo List to gather the data.
' OUTPUT = 'Then a snobol4 program I wrote to add percentages, averages and html formatting.
' OUTPUT = 'The snobol program is HERE.
' OUTPUT = '' OUTPUT = '' :(return) HEADER_ENTRY OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = "Dennis J. Darland's Time Spent Reading" OUTPUT = '' OUTPUT = '' OUTPUT = '' OUTPUT = '

Time on Reading of Dennis J. Darland

' OUTPUT = '' :(return) TITLEENTRY LINE_IN POS(0) BREAK('(') . GET_TITLE :S(RETURN)F(FRETURN) FIELDENTRY LINE_IN '(' FIELD_NAME ARB . GET_FIELD ')' :S(RETURN)F(FRETURN) err1 output = 'should not happen 1' :(END) err2 output = 'should not happen 2' :(END) err3 output = 'should not happen 3' :(END) NOTEENTRY END