Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #51463 > unrolled thread

take your pulse

Started byPaul Rubin <no.email@nospam.invalid>
First post2016-09-29 15:28 -0700
Last post2016-09-30 20:11 -0700
Articles 11 — 5 participants

Back to article view | Back to comp.lang.forth


Contents

  take your pulse Paul Rubin <no.email@nospam.invalid> - 2016-09-29 15:28 -0700
    Re: take your pulse Lars Brinkhoff <lars.spam@nocrew.org> - 2016-09-30 07:44 +0200
      Re: take your pulse Paul Rubin <no.email@nospam.invalid> - 2016-09-29 22:52 -0700
    Re: take your pulse Ilya Tarasov <ilya74.tarasov@gmail.com> - 2016-09-30 04:42 -0700
      Re: take your pulse Paul Rubin <no.email@nospam.invalid> - 2016-09-30 12:31 -0700
        Re: take your pulse Ilya Tarasov <ilya74.tarasov@gmail.com> - 2016-09-30 14:12 -0700
          Re: take your pulse Ilya Tarasov <ilya74.tarasov@gmail.com> - 2016-09-30 15:17 -0700
            Re: take your pulse Paul Rubin <no.email@nospam.invalid> - 2016-09-30 16:27 -0700
              Re: take your pulse Ilya Tarasov <ilya74.tarasov@gmail.com> - 2016-10-02 16:58 -0700
    Re: take your pulse hughaguilar96@gmail.com - 2016-09-30 19:35 -0700
      Re: take your pulse Julian Fondren <julian.fondren@gmail.com> - 2016-09-30 20:11 -0700

#51463 — take your pulse

FromPaul Rubin <no.email@nospam.invalid>
Date2016-09-29 15:28 -0700
Subjecttake your pulse
Message-ID<87h98y49z7.fsf@jester.gateway.pace.com>
Just wrote this to take my pulse before and after exercising.  Not
impressive at all, but hey, it's an actual Forth application and we
don't get many of those here ;-).

Usage: 
1. run the program
2. put your finger on your pulse (wrist or whatever)
3. hit a key to start timing (space bar works)
4. Count pulse beats for a while (I've been counting to 20)
5. hit a key to stop timing
6. Enter number of beats you counted.  Pulse in bpm is shown.

There's no error checking.  It's probably a monstrous security
vulnerability to connect this program to an open internet port, so
don't do that ;-).  Tested with gforth but should port easily
given a utime primitive (measure time in microseconds).
================================================================
#! /usr/bin/gforth
: interval ( -- f )			  \ measure interval in seconds
    ." hit a key to start" cr key drop utime
    ." hit a key to stop" cr key drop utime
    2swap d- d>f 1e-6 f* ;
: readnum ( -- f ) pad 80 accept >r 0 0 pad r> >number 2drop d>f ;
: get-count ( -- f ) ." enter pulse count: " readnum ;
: go interval fdup f. ." sec " cr
    get-count 60e f* fswap f/ f. ." bpm" cr ;

go bye
================================================================

[toc] | [next] | [standalone]


#51466

FromLars Brinkhoff <lars.spam@nocrew.org>
Date2016-09-30 07:44 +0200
Message-ID<86r382aqm8.fsf@molnjunk.nocrew.org>
In reply to#51463
Paul Rubin wrote:
> Just wrote this to take my pulse before and after exercising.  Not
> impressive at all, but hey, it's an actual Forth application and we
> don't get many of those here ;-).

You always bring along a computing device when you exercise?  It's a
good thing there are lighter options than a PDP-11 these days. :-)

[toc] | [prev] | [next] | [standalone]


#51468

FromPaul Rubin <no.email@nospam.invalid>
Date2016-09-29 22:52 -0700
Message-ID<87d1jm3pf8.fsf@jester.gateway.pace.com>
In reply to#51466
Lars Brinkhoff <lars.spam@nocrew.org> writes:
> You always bring along a computing device when you exercise?  It's a
> good thing there are lighter options than a PDP-11 these days. :-)

I'll have to get amForth or FlashForth running on this:

https://tinycircuits.com/collections/all/products/tinylily-mini-processor

;-)

[toc] | [prev] | [next] | [standalone]


#51475

FromIlya Tarasov <ilya74.tarasov@gmail.com>
Date2016-09-30 04:42 -0700
Message-ID<ff9e499f-d7d3-4d49-bc51-3f4996a0e288@googlegroups.com>
In reply to#51463
пятница, 30 сентября 2016 г., 1:28:14 UTC+3 пользователь Paul Rubin написал:
> Just wrote this to take my pulse before and after exercising.  Not
> impressive at all, but hey, it's an actual Forth application and we
> don't get many of those here ;-).
> 
> Usage: 
> 1. run the program
> 2. put your finger on your pulse (wrist or whatever)
> 3. hit a key to start timing (space bar works)
> 4. Count pulse beats for a while (I've been counting to 20)
> 5. hit a key to stop timing
> 6. Enter number of beats you counted.  Pulse in bpm is shown.
> 
> There's no error checking.  It's probably a monstrous security
> vulnerability to connect this program to an open internet port, so
> don't do that ;-).  Tested with gforth but should port easily
> given a utime primitive (measure time in microseconds).
> ================================================================
> #! /usr/bin/gforth
> : interval ( -- f )			  \ measure interval in seconds
>     ." hit a key to start" cr key drop utime
>     ." hit a key to stop" cr key drop utime
>     2swap d- d>f 1e-6 f* ;
> : readnum ( -- f ) pad 80 accept >r 0 0 pad r> >number 2drop d>f ;
> : get-count ( -- f ) ." enter pulse count: " readnum ;
> : go interval fdup f. ." sec " cr
>     get-count 60e f* fswap f/ f. ." bpm" cr ;
> 
> go bye
> ================================================================

10+ years ago I did the same with small differences.
1. Put your finger on the IR sensor, attached to a small board with FPGA.
2. Program on Forth-CPU automatically starts and calculate your pulse, pulse variations and draw you cardiogram.

[toc] | [prev] | [next] | [standalone]


#51484

FromPaul Rubin <no.email@nospam.invalid>
Date2016-09-30 12:31 -0700
Message-ID<878tu9422h.fsf@jester.gateway.pace.com>
In reply to#51475
Ilya Tarasov <ilya74.tarasov@gmail.com> writes:
> 10+ years ago I did the same with small differences.
> 1. Put your finger on the IR sensor, attached to a small board with FPGA.
> 2. Program on Forth-CPU automatically starts and calculate your pulse,
> pulse variations and draw you cardiogram.

Heh, today a thing like that would upload the data to The Cloud(tm)
where it would be sold to advertisers.  Eventually it would download
some malware and become part of a botnet used in DDOS attacks ;-).

[toc] | [prev] | [next] | [standalone]


#51486

FromIlya Tarasov <ilya74.tarasov@gmail.com>
Date2016-09-30 14:12 -0700
Message-ID<7323721d-a992-42a2-9d29-ceca4389243c@googlegroups.com>
In reply to#51484
пятница, 30 сентября 2016 г., 22:31:23 UTC+3 пользователь Paul Rubin написал:
> Ilya Tarasov <ilya74.tarasov@gmail.com> writes:
> > 10+ years ago I did the same with small differences.
> > 1. Put your finger on the IR sensor, attached to a small board with FPGA.
> > 2. Program on Forth-CPU automatically starts and calculate your pulse,
> > pulse variations and draw you cardiogram.
> 
> Heh, today a thing like that would upload the data to The Cloud(tm)
> where it would be sold to advertisers.  Eventually it would download
> some malware and become part of a botnet used in DDOS attacks ;-).

We work on handheld device measuring pulse and muscle activity. It has both Ethernet and wireless, so capable to upload data to a cloud, if customer will ask for this. Im not sure about malware, because our Forth-based TCP/IP stack is simple enough to have backdoors.

[toc] | [prev] | [next] | [standalone]


#51491

FromIlya Tarasov <ilya74.tarasov@gmail.com>
Date2016-09-30 15:17 -0700
Message-ID<cfb0c199-74e2-4f63-8dc4-9af88a899c92@googlegroups.com>
In reply to#51486
> ask for this. Im not sure about malware, because our Forth-based TCP/IP stack > is simple enough to have backdoors.

Not accurate phrase. I mean this is too simple solution and malware simple cannot pass over it. Also, Forth CPU has no ideas what to do with any x86 or ARM-based code :)

[toc] | [prev] | [next] | [standalone]


#51494

FromPaul Rubin <no.email@nospam.invalid>
Date2016-09-30 16:27 -0700
Message-ID<87zimp2ck3.fsf@jester.gateway.pace.com>
In reply to#51491
Ilya Tarasov <ilya74.tarasov@gmail.com> writes:
> Not accurate phrase. I mean this is too simple solution and malware
> simple cannot pass over it. Also, Forth CPU has no ideas what to do
> with any x86 or ARM-based code :)

Deploy a few million of them and the malware writers will figure it out ;-).

[toc] | [prev] | [next] | [standalone]


#51555

FromIlya Tarasov <ilya74.tarasov@gmail.com>
Date2016-10-02 16:58 -0700
Message-ID<538912b7-1100-4f90-a0a4-f31243f393ef@googlegroups.com>
In reply to#51494
суббота, 1 октября 2016 г., 2:27:41 UTC+3 пользователь Paul Rubin написал:
> Ilya Tarasov <ilya74.tarasov@gmail.com> writes:
> > Not accurate phrase. I mean this is too simple solution and malware
> > simple cannot pass over it. Also, Forth CPU has no ideas what to do
> > with any x86 or ARM-based code :)
> 
> Deploy a few million of them and the malware writers will figure it out ;-).

Thanks now I have only 100K units order request :)

[toc] | [prev] | [next] | [standalone]


#51500

Fromhughaguilar96@gmail.com
Date2016-09-30 19:35 -0700
Message-ID<dade1a94-06b8-4f44-9bab-c064efb701fc@googlegroups.com>
In reply to#51463
On Thursday, September 29, 2016 at 3:28:14 PM UTC-7, Paul Rubin wrote:
> Just wrote this to take my pulse before and after exercising.  Not
> impressive at all, but hey, it's an actual Forth application and we
> don't get many of those here ;-).
> 
> Usage: 
> 1. run the program
> 2. put your finger on your pulse (wrist or whatever)
> 3. hit a key to start timing (space bar works)
> 4. Count pulse beats for a while (I've been counting to 20)
> 5. hit a key to stop timing
> 6. Enter number of beats you counted.  Pulse in bpm is shown.
> 
> There's no error checking.  It's probably a monstrous security
> vulnerability to connect this program to an open internet port, so
> don't do that ;-).  Tested with gforth but should port easily
> given a utime primitive (measure time in microseconds).
> ================================================================
> #! /usr/bin/gforth
> : interval ( -- f )			  \ measure interval in seconds
>     ." hit a key to start" cr key drop utime
>     ." hit a key to stop" cr key drop utime
>     2swap d- d>f 1e-6 f* ;
> : readnum ( -- f ) pad 80 accept >r 0 0 pad r> >number 2drop d>f ;
> : get-count ( -- f ) ." enter pulse count: " readnum ;
> : go interval fdup f. ." sec " cr
>     get-count 60e f* fswap f/ f. ." bpm" cr ;
> 
> go bye
> ================================================================

This is not ANS-Forth --- you are not allowed to measure time in micro-seconds --- ANS-Forth only provides TIME&DATE that measures in seconds (also there is MS that delays for "at least" some number of milliseconds, but is not useful for measuring time).

ANS-Forth doesn't have a pulse --- it was stillborn.

[toc] | [prev] | [next] | [standalone]


#51501

FromJulian Fondren <julian.fondren@gmail.com>
Date2016-09-30 20:11 -0700
Message-ID<bfb6d87a-3b13-464f-856b-a06607aaac58@googlegroups.com>
In reply to#51500
On Friday, September 30, 2016 at 9:35:04 PM UTC-5, hughag...@gmail.com wrote:
> This is not ANS-Forth --- you are not allowed to measure time in micro-seconds

It's clear now that no process of argumentation can possibly lead you
to understanding what 'ANS Forth' even means, but that doesn't
preclude you from coming to understand it anyway.  You could have an
epiphany.  You could get hit on the head, suffer amnesia for a little
while, and then discover ANS Forth while trying to understand your
notes on Straight Forth.  I think it would be interesting to see what
you would do after such a discovery.


-- Julian

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.forth


csiph-web