hey everybody welcome to live coding
with jessie i'm jesse and with me is
gemma hi i'm drinking gatorade
ambrose
in the background and cordelia you know
say hi cordelia
yeah
all right
so
anyway my kids are all here well not all
of them there's another one upstairs i
have four but uh today we're gonna
continue to work on
this uh expo react native uh app
uh so right now we're running it as a
um
as a web app so uh evan bacon's in the
channel who uh works at expo and does
some awesome stuff with uh expo web we
are gonna see some expo web stuff that's
let me bring this up on the screen
uh
let's see where it went
live stream
there we go
my computer went into sleep mode
uh and so all my
all my screens got rearranged so
i had it all set up
and then i lost it
there we go
all right so
this is the app
running
actually it's not it's not really
running uh
it's just whatever is left over from
what we ran last uh last evening
what are you holding up amber
did you make a sign
and i'm holding up hey
all right so
anyway i'm running uh react native with
uh expo
and let's see if the chat sums up with
my chat if um
somebody tried to type something in the
chat because i think my chat got
disconnected
and i'll see if i can see it because
right now i am
not able to see the messages in the chat
i could try to
open it in a new window
oh okay i opened my chat in a new window
and now i can see the messages so
hopefully this will work
okay yeah so i think
i lost some of the first messages so if
you ask me something right off the bat
then
i probably can't see it anymore but i
can see the chat now so hey everybody i
guess it was really weird there were
only like three messages in the chat and
that's very uh uncommon
um
so i def i just lost the first
few messages or whatever uh so sorry
about that but
uh
anyway um
i am
i built this uh like built the app with
expo which is a tool that helps you
build with react native
so
i'm using yarn so i just typed in yarn
start and now once expo runs and does
its thing if i hit w it'll open up
the
expo app
in a web browser uh so
you can see here having the web browser
i can refresh it's it's running here
uh which is pretty sweet and it actually
makes it way easier
cordial you don't hit that button but
you can't sit with me all right go
hitting buttons um i'll sit with you
so it's it's actually really awesome i
kind of prefer working like this unless
there's something i really need to test
uh on a mobile phone
i prefer to do most of the development
with the web uh
version of uh
of expo which is using react native web
um
it's just so much easier to be able to
do all your debugging with um
like in a web app right the um
the feedback loop is tighter right so
it's there's less time uh you know the
uh
there's a little bit of lag if you're
developing like on a mobile device that
connected your computer between when you
make a change and when it actually
updates on the device
i find like
uh i just have way less issues doing it
like this
i do have to frequently kind of keep the
mobile version open though
just to make sure i haven't messed
anything up but it definitely helps me
develop faster
this is i've i've used this
professionally and on side projects like
i'm doing here so
i definitely i like that
that aspect of it
and
let's see
trying to get my
there we go i want to get my chat all uh
situated with the uh stream data
on my other screen here okay cool
so
this is the third stream uh that we've
done with this particular app
real quick i'm going to go over the goal
of this app
we are trying to take data from a brain
computer interface which i'll i'll put
on in just a minute and i'll show you
but there's a company called nerosity
that makes a brain computer interface
that's called the notion
it's
it reads your brain waves
and then it has
an interface uh javascript interface
that you can use to get that data into
your app so that's what we're gonna do
and
for this particular app for phase one of
the app all i want to do is measure my
level of focus
and then
display a warning
whenever my focus is dropped too low
just to kind of remind me to stay
focused what do you put in your mouth
cordially
what is that it's a great gift card
all right and i'm in the background
pretending to sing with your microphone
[Music]
um
so
um that's the goal now in this
particular stream what we want to do
is we pretty much did most of the work
we needed to persist user data from one
session to another
and
we want to keep basically we want to
just uh finish that uh we're almost
finished we had kind of a little bug
with it at the end so i want to finish
that
and then uh actually
put in our threshold for
the um
uh
the focus so like we're gonna figure out
like at what level of focus should we
show a warning and what should that
warning be
uh and it's probably gonna be a
different warning on the web as opposed
to on uh on mobile
hey kids you can't all sit on my lap so
why don't you go play
uh that's for um
oh yeah don't press those buttons it
links up to my phone via bluetooth but
if you're going to be down here you
can't interrupt me okay
uh
so
all right let's see
so
here's how we're going to do this in the
stream i'm going to start a timer a
pomodoro timer it's going to go for 25
minutes during that time that 25 minutes
i'm not really going to look at the chat
too much i'm going to try to focus on
coding and explaining what i'm coding
and
then after the timer goes up i'm going
to take a break i'm going to go to the
chat and i'm going to answer all your
questions
uh i want to try to keep this stream to
just about an hour long uh and because i
want to try to get the kids to bed
help get the kids to bed so can i say
something you want to say something
gemma would like to say so try not to
get the corona virus yeah that's very
good yeah gemma gemma doesn't want
anyone to get the coronavirus so be safe
all right all right
you want to say something too yeah all
right everybody gets to say one thing
and then you gotta let me code all right
everybody play don't die
or else
don't die or else don't die all right
gemma says don't get the coronavirus
ambrose says don't die cordelia would
you like to say anything i think that's
just bro
i can do tools all by myself oh she can
do twirls all by herself
all right cool
all right now you all had your chance to
say something now you got to be quiet
let me do the coding okay all the people
all the people want to see the coding
part okay
when you get older you can have a
youtube channel too all right
all right and actually so gemma has been
working on free code camp lessons to
learn how to code and uh ambrose has
been working on coding too
and i've been working on um kindergarten
math kindergarten math yeah he's working
i told him he had to learn how to read
and he had to learn his math um
all right
so see you later thanks for being on the
show
i'll see you in about i'll see you in
about an hour be good
okay
all right so
anyway uh
i hope i hope you're all right with that
that's how it is when you uh
um
you work with kids
i don't really have an office i'm just
in my basement so
the kids can just come down whenever
uh
so let's get started i'm gonna start my
timer
[Music]
make sure it's actually working on
yesterday's show i started a timer and
then
somehow i stopped it
and um
uh
so it looks like it's running
successfully this time
all right cool
let me make this bigger
i'll make sure everybody can see
all right i'm going to make this
as small as i can i'm going to get rid
of these files on the side
i did put this on github
so if you check the description for this
video there's a link to the github repo
so you can see all this code and um
i guess
it's not going to be that useful to you
unless you have an ocean headset
but you can at least check out see what
we're doing
get a kind of a closer look at the code
but what we want to do is
the next step i guess we want to do is
like the user can put in their id email
and password and that links them up to
the brain computer interface and it gets
us data but as soon as we refresh the
page
they lose their
their subscription
to the device
as soon as you put the id in we can get
it again but what i want to do is save
the id in local storage
so that they don't even have to put the
id in again it'll just check local
storage okay so we already have the code
for that in here so we have this um
this get item
for and we're going to get the device id
right but the problem is
um
the part where we actually save
is not working right now
so
we want to
[Music]
figure out where we can make this save
so the reason it's not working is i i
think
i think that this function is actually
running first
and we're going to test that let's test
that because i don't think we really
have i'm just gonna do a console log
here
and just console.log some
some nonsense just to see if that is in
fact what's happening
and let's make
let's inspect
we'll bring up the console
and uh
i want to see if that's really the issue
that's happening here because i'm not
convinced that it is
and let me get my data
um
yep this is it
uh let me turn my device on
so this is the
neurocity notion headset if you want to
know more about this headset and how it
works uh you can go to um
you can check out a video i did on my
youtube channel
the link to my youtube channel is in the
description below i talk a lot more
about
what this headset can do
and give you a like a demo
so
all right that's going to start up it's
just going to take a few seconds to
start
and then
we should be able to connect in the
meantime let me type in our data
[Music]
okay so this is actually
running every time something changes
which is what i thought it was that was
happening
uh so
what's gonna happen now
is if i put a password in this is gonna
run and i believe it's gonna try to log
us in
uh so
what i'm gonna do is
let's just remove password from here so
this doesn't run when a password is
entered
it's going to erase my stuff but
i'll just copy it again
and let's verify
yeah see so password is not running here
so
this is going to test my theory to see
if it was actually this function
that was logging us in
uh
early it was basically we're getting
logged in too early like before we press
the the button to log in
which i should probably change that to
log in instead of press me but
remember to do that in a minute
[Music]
okay so
grab the password
all right sweet so it was this function
that was automatically logging us in
uh so just by removing password i think
we've solved that issue
and now when i hit this
this button should call this init
function
which should first save our device id to
async storage so let's let's go to our
application
and go to local storage and see right
now we don't have the device id saved
when i hit this button the device id
should be saved and we should get logged
in
which yep all right so the notions
online i just wanted to double check
so
sweet so we have our device id and now
uh let me make this bigger so i could
see
all right so we can see we have our
device id now saved
um and we are connected so we're just
we're getting some random data since
this isn't actually on my my head so
we're not getting real data uh yet
but
sweet so
i think that's going to be an easy fix
then
so we have the data so what should
happen now
is if i
log out
no that's not if i
refresh the page
what should happen
is that
it should check
as soon as this this component which is
our app component mounts it should check
to see if we have device id and async
storage and if it does it'll set the
device id
when the device id gets set it should
trigger
this function
right which should
set in motion
everything we need to stay logged in so
let's see if that is really the case
let's refresh
hey all right cool so we saw like
briefly a little flash of the uh the
login panel
until everything actually ran uh which
is fine
and now we're still focused so awesome
so that was actually like uh
that was really easy um
i ended the stream without having fixed
that and it was literally what like a
five minute fix so
that's really cool
so since we we kind of fixed that issue
i'm going to go ahead and commit this
before we move on
the next step is going to be
figuring out how to display a
notification
uh i'm just always used to doing a git
status just to make sure of what's
changed
even though we really only are editing
one file here
so um
let's do git
commit
and i'm gonna do an am flag that means
it's gonna add so it's a git ad plus a
commit with a message and so whatever i
put in this message um
is will be our commit message so i'm
gonna say
uh feed for feature
and
we're gonna say
um
let's see login
login persist
through page refresh
okay
cool so
that's the new feature that we've added
and
i'm going to do a git push
since it's pretty much just me working
on this project right now i'm just
pushing straight to master it's still a
test project
if this was really in production and
there were more people working on it i
would probably set up different branches
and then do a pull request but
i think that's a little bit of overkill
for
uh a side project right now
all right so now that we have that set
up
not only did we really want that set up
uh but also it's gonna help us develop
this a lot more quickly because we won't
have to keep logging in
which is a little bit of a pain in the
last two streams
so now
we need to
i guess
we need to keep track of our our focus
the number of our focus so let's see how
we're doing that right now
uh yeah so we have our focus here in our
uh on our state so
since
every time our focus changes
it changes state
we're going to be able to pretty much
track that right and we can come down
here
and say
[Music]
within this
[Music]
uh let's let's go to our styles should
we do styles yeah
yeah i think that would be a good way to
do it
um
[Music]
right now our background color
let me do this i'm going to move my
styles
into
my function
because that's gonna allow me to have
access to the state
right
and then now for background color
we can make it determine
based on on the focus level so let's say
focus
if focus is
less than
and uh let's say less than
i don't know 0.3
then
we want the background color to be
let's just say red
for now so
that'll be easy to see otherwise
we want the background color to be white
[Music]
let's see if that works
there we go
as you can see every time the focus
falls below
0.3
it's red
[Music]
and then we go above it
it's it's white now like i said right
now i don't even have the headset on so
it's just kind of giving us like just
random numbers because there's not real
data coming in uh i could try to put
this on so we could get some real data
i don't know how well i'm going to be
able to focus while i'm
kind of working on uh whoops
well i'm doing the stream and everything
but i'm gonna try
try my best to make sure
[Music]
okay
um i might have to drop the focus level
if i ever want to get out of the red
here
um let's drop it down to a point two
and then that way we'll get there we go
so um
right now this is like a decent
indicator
what i would really like though is uh
maybe something a little bit this
uh
oops it doesn't like that i was using
styles before i declared it so let's
let's put this up here a little bit
i don't think i'm actually even using
using this uh
loading
this is maybe
left over from
yeah i think that's left over
[Music]
from the kind of boilerplate stuff i
brought in at first
[Music]
all right so
sweet
now
what i'd like to do is have uh
i guess some type of
[Music]
notification
pop up and maybe have it like vibrate
uh really
ultimately it would be nice if the user
could pick
their choice of how to be alerted like
what type of alarm they would want
uh but you know for now this at least
gives us some indication of our our
focus level that's that's very bright
and obvious but we would have to kind of
be looking at our phone
so it's not not really ideal right if
you're trying to focus on something
then you don't really want to be looking
at your phone right so we need some sort
of notification that is going to get
your attention
even if you're focused on something else
so i think some type of audible uh or
like vibration would be best now we
can't really do a vibration on
um
you know on our
web version of this
but we can at least put in some of the
code for it and then test it out
right
okay
so
let's go into
either we're going to look either in the
expo documentation or react native
so first i'm going to look at react
native and see if we have something for
vibrate
vibration cool
so we do have an api for
vibration sweet vibration dot vibrate
so
all right cool
um
you can see that we can also check and
see what expo has
i think it's
expo.io yeah here's i have the docs in
here
vibration
i just want to see if expo has anything
different
but it looks like they have the same
the same docks here so
that's good occasionally expo will have
uh like some extra things
uh extra extra components that make it a
little bit easier
to work with these device things but
uh for now
uh this is gonna work so let's just see
if we can set it up
so that
we have this you know vibration happen
based on a state change
so first let's pull in vibration
from react native
and it looks like we need to add
something to our android manifest dot
xml
so let's do that
let's add this in
and this looks like a permission thing
so uh
looks like we need to get permission
to
[Music]
um
to use the vibrate feature i need to see
if we even have
i don't know that we even have this
because we haven't attempted to run this
yeah we've only done the web so we may
have to attempt to run this first
so let's see
i believe
we can try to do an android build if we
just type a
yep there we go
let's see what we have it may not work i
don't have android studio installed so i
may have to get that installed and then
try it on a different stream
android air
no android device found
oh okay i can
i need to connect my android device
which i can do
unless i left my cord
did i leave my cord
i left my cord in my bag that's in the
closet upstairs so
it's cool i'm going to drop into
my amazon alexa device that's upstairs
in my house and have one of my kids
bring me my bag
and then we can connect my device up
uh to the computer
so
let's do a drop-in
this is probably the most useful thing
on on amazon
so it's
hello
hello can you hear me
hey is anybody up there
hey i need i need a favor
can somebody go in the closet and get my
backpack and bring it down to me please
hello
hi daddy hey there can can you go in my
uh backpack and
get or my closet and get my backpack and
bring it down to me please
all right thank you
[Music]
all right cool
so
when i get my cord to hook up my android
phone i should be able to run this on my
android phone and um we should be able
to test out the vibration uh on my phone
uh which would be pretty cool
i'll just like hold it up to the camera
i guess so you could see it running
which is not ideal but um i don't know
that we can test the vibration
with the simulator
i i said to come down with my backpack
you came down empty-handed
oh you just came to get my my drone all
right
all right
i'm looking in your backpack for what
you have
if you have gum i would have it i don't
have any gum in here i don't think i do
okay
i just need the score actually i do have
gum here here's your reward you can have
my pack of gum
i shut the door on your way up please
thanks
okay
so i've got the cord
and
i made sure i brought this i normally
use this when i'm at work but i made
sure to bring it home because i
i figured i might need it
this is like the longest um
normal usb to usb c cord that i have
i need to find a port for it
i don't know if it's like this for you
all but like all my usb ports are always
taken up
i didn't realize this but i actually
have a usbc port
on that computer that's awesome
i can uh connect it just through usbc
so
that's pretty sweet
so now i am connected
and
let's try this again
i'm gonna run this
yeah
sweet
we're running the application on the
pixel xl
and this should be
i might have to scan this barcode
if i can find it
let's go over here see if i can find it
here
so
if i scan this barcode
i should be able to
oops
to run this on the phone
i need to find my expo app
and scan this qr code
it's still it's running the last
application that i built on here not the
new one so need to see
what is
why is it doing this
all right usually if you shake the phone
you can come up with a screen like a
screen will come up but it's not working
there we go ah no that didn't work
hmm
all right let me see
this is really weird
i don't know if i could do anything from
here
so like just you can see it is uh it's
gonna be really hard for you to see but
it's running in application right now
but this is the last application that i
worked on in expo so
it's definitely not what i
what i want
um
let's see
how
all right i'm gonna check my timer
because i may be out of time
for
yeah okay so it's almost time for me to
stop and get to the questions
uh but then also
i need to
know uh
enable rivalry the
area
get the developer menu
so i might i can just hit command m
or do adb shell input key event in my
terminal window
shake device vertically a bit
yeah my shaking of my device is just not
working i could try to reload
yeah reloading is still coming up with
the old one
all right it says i can run this
i've never tried this one before
um
i don't know where let's see if i run it
here
nope
hmm
oh yeah so an android device
can run it here but it's not
i might actually need to get the
android emulator going if this if i
can't get it to work
all right
i'm gonna take a little break though
anyway uh and answer some questions so
maybe i'll uh
i'll figure some way out
my subconscious will work on this
problem
while i'm uh
while i'm reading questions so i'm
scrolling up as far as i can remember i
i missed a few um
a few questions that got cut off from
the chat at the beginning so apologies
if i missed your question
but let's see so nds this brain computer
app what is its function
the function of this particular app is
to
give me an alert give the user an alert
whenever their level of focus has
dropped below a certain threshold
um
uh null stock says what technology is he
using for the actual brain computer
interface uh it is this device that i'm
wearing it is called the notion headset
by nerosity uh it's a
a brain computer so inside here there
there is actually a small computer very
similar similar to what you would have
in your cell phone
it's an internet of things device
um and
it's uh
really like very lightweight and just
fits fits right on your head it's
adjustable so it can fit you know
variety of different head sizes so
that's the device i'm using uh if you
want to know more about that check out
my youtube channel links in the
description i do a demo video where i
talk a lot more about the the device in
particular
you also if you do a search for
neurocity um
i'm trying to think what the what the
website is i got the website up it's
it's
neurocity.co um n-e-u-r-o-s-i-t-y
dot c-o
uh and
you can sign up to i believe right now
you can pre-order the headset but check
check out the site you'll be able to see
how
how you can maybe get the uh
the brain computer interface
uh er errored uh sorry for
mispronouncing your name says uh you are
my favorite uh i believe it's just
trying to say channel uh thank you
i appreciate that and i assume you mean
free code camp's channel which has a lot
more than just me on it and so it's not
like i'm just your favorite but
i appreciate it uh free code camp does a
lot of good good stuff
um
let's see
see a lot of you just saying hi so hey
everybody
let's see
uh yusuf says the best channel with best
lecturer oh thank you i appreciate that
uh
we got greetings from all over the world
here looks like someone's saying hi from
ghana someone from panama
um awesome
leonard asks where do you live do your
kids also have school uh so i actually
live in ohio but i'm very close to
pittsburgh pennsylvania and that's where
i work i'm right on the border
um and my kids they don't have school so
they never have school on a sunday like
a saturday or sunday but they actually
have school off because of the
coronavirus school has been canceled in
uh in the whole state of ohio
for the next three weeks so i've
actually shut down quite a few things so
there's no there's a limit on
i think like any gatherings above 100
people
are now
banned uh they they
i think they just said they're gonna
shut down all restaurants and bars
although they're allowing like
drive-throughs and um delivery and like
take out food
uh so there's a lot of restrictions now
in ohio which is probably for the best
right uh
from what i understand
you know if we can uh try to
do as much as we can as early as we can
to stop the virus then you know more
people will be healthy
um
but yeah we'll be uh
we'll all be here together in the house
for for a long time
let's see
uh sergey says are they your web team
yeah not yet but i'm training them
one day
i'm gonna train them up i have a whole
team of uh of programmers
um
that valdarg says this seems like
something that might be useful for not
quite self-driving cars considering the
only deaths so far been from people
thinking the car was fully self-driving
yeah actually what i'd like to do with
this is run it as an android auto app so
that could remind the driver
to stay focused and so whenever the
driver loses focus it would give them
some sort of
notification that wouldn't be too
distracting but would remind them to
like focus on driving so that's going to
be like one of the next steps
after we get the basics of this app
working is i really want to try to use
it with um with android auto
and i'm i'm
because i have an android phone i can
test it out with android auto but you
know ideally i know um
you know there are other so like apple i
think has their version uh i've never
used it but
i think it could potentially help
prevent accidents uh in
in cars if if i can get it to work
[Music]
let's see
leonard says here in germany we have
three weeks free of school due to
coronavirus
uh plus two weeks easter holiday so five
weeks no school okay so there's a
yeah i imagine there's probably uh quite
a few uh people out there that are in a
similar situation where school has been
cancelled or uh
you know you're working from home or
you know some something like that i i
hear um
that italy is pretty much on lockdown
i don't know if anybody's from italy
watching the stream uh you know let us
know how it is at least
from what i can get here it's just you
know online uh so i prefer to try to get
information from people who are actually
there as opposed to like the news
um
i feel like it's kind of more
authentic information and not filtered
through
you know whatever news uh source but
um
anyway i'm gonna go my timer went up
for uh for the chat so i'm gonna go back
do a little bit of code and then i'll
come back to the chat
uh in a little bit and um
uh see what's uh
see what's going on in the chat answer
some questions looks like
he's from china somebody in here said
that hello from china
hey how's it going um
so we were just talking about the
coronavirus with being from china like
how is it there uh in terms of like
you know are you uh
is it at this point do you feel like
it's pretty contained uh or is there
still a lot
um
i guess that you can't do it it's it's
starting it feels kind of like odd over
here um
at this point i think it'll get worse
than it is now in the united states uh
in china do you feel like it's going to
get worse or does it seem like it's
getting better
anyway oh wait i i may not see your
message for a while because i'm going to
go back to the chat but i just
uh kind of would would love to get like
a first-hand account of kind of what
feeling you get about it i realize china
is a very big country so different areas
of china are going to have have
different
um
effects from from the virus but
it's still good to get somebody you know
somebody that's there
uh get kind of their account of it
but
let's see
let's go back to
all right here so i'm gonna give
what i'm gonna do i'm gonna completely
quit at the expo app and go back in and
see if i can
get the new app to load
and
so let's scan this
let me go in here
uh okay unfortunately it's still the
old app i am gonna try to do a little
shake
i guess this is supposed to work i don't
know why it's not working do i not have
i don't yeah i don't understand why it's
not working
okay
um so
unfortunately i can't get the developer
menu to load
so i may have to
check out android studio
like i'm not going to try to do the
install for android studio right now so
we may just have to
um
hmm
i'm gonna try to run this
i mean i really don't think
yeah i didn't think that would work
okay
and this it looks like these directions
are assuming that we're running on a mac
so it may be that i just can't use these
instructions for
um
a windows machine
let me see
i'm just going to check the chat really
quick to see if anybody put the um
if anybody had any idea how i could get
this to refresh
looks like
oh my god
okay
um
let's see
[Music]
all right so
i guess we just do a quick google search
right because
if we can't test the uh the features on
a mobile device then we're gonna be a
little bit stuck here so
uh let me say
android
all right
let's just open up a few of them
uh
open up your simulator
so that i can press ctrl m
let's see about that
all right looks like that is not working
i wonder if i can
if i change the mode that doesn't really
do anything
oh yeah do you have some messages here
hmm no i don't think that works okay
the only thing i can think of
if i do a save
will that trigger
looks like it's only triggering
a web
refresh
okay
um
let me go back to here
all right so
control-m did not work
development node enabled
i believe we do
but let's double check make sure we have
dev mode enabled
yep we did make sure i
double check
yep we turned off production mode so it
is dev mode
hmm
i just hit r to restart metro bundler
just to see if that would do anything
which it did not
okay
all right let's try this one
this will refresh
all right let's see this one too
all right i don't think that's gonna
help
sorry i'm just trying i'm not reading
this out loud i'm trying to skim through
first to see if these are even um
like close to what what we're
experiencing
this looks like android studio
so that's not what we what we want okay
um let's see i'm gonna try to change
something in here and see if a uh if
saving it would would do anything so i
guess probably the easiest thing to
change would be
some text
so let's add in an extra space
see if we get an update
looks like nothing i didn't see anything
on the screen
uh you know this this is still updating
you know we could try to do i could try
to just completely uh quit
and then
start it up again
see if we can get a difference with the
you know total restart
and
we can press a
to run the android emulator
let's see what we have
see what other commands we have so
all right current mode is development
mode which is good that's what it needs
to be
uh let's do shift r
because that should restart and clear
the uh cache maybe that would help
shift r
maybe this will help
all right
while that's running i'm going to go to
the chat and see what's what's going on
in the chat here
oh cool so uh alex is in the chat and
he's uh one of the founders of neurosci
that's the company that makes this this
headset and he said that the the gamma
brain waves are what determines your
focus so the higher your gamma brain
wave the higher your focus so
uh
that's pretty cool
um william says i'm learning python are
apis the equivalent to modules
um
i i think api is pretty standard no
matter what the language is so
i'm not exactly sure in python what
module means
but
i don't think it would be the equivalent
of an api if anybody is more
knowledgeable about python though please
please let us know
uh mr own said i love this awesome thank
you
uh
jp
games says is your job stressful um i
wouldn't really say my job is stressful
um
it
right now um
the
project that i'm working on
is still like in development
so we're not really there's not a lot
that's dependent on our project yet
that's going to change once we start
like releasing uh to more locations so
it will get a little bit more stressful
but right now it's it's not it's not too
bad
programming i'd say in general
in itself is not stressful
but
depending on what project you're working
on and what's at stake with the project
it could be stressed like there are
external factors that could be stressful
all right so this thing's still
still doing its thing which is fine
because it gives me time to catch up on
the chat
uh ssdu
if i could explain what i'm doing
uh looks like somebody else answered in
the chat though so
um
so thank you for uh for answering that
um jpgames asks what's your favorite
musical actor group uh i don't know if i
could do a favorite i like a lot of
different kinds of music
i don't really know if i have
like a favorite
um
yeah i don't know i'd have to think
about it that's crazy that i never
thought about that
yeah i don't know what
my favorite would be
um
mustafa asked if i stream about react.js
yeah i do uh streams with react.js so
um
right now i'm more focusing on react
native that's what i work with uh more
frequently uh but i have done streams
that are just normal react and i'll
probably end up doing some normal react
stuff as well
daniel says i'm from brazil but i have a
cousin that lives in ohio uh
around avon oh okay that's awesome cool
kevin's from california okay daniel says
avon lake okay i'm not really sure where
yvonne lake is so tell you truth i'm not
originally from ohio i'm from west
virginia uh so i don't
like i've lived in
oh
i started to get
a little bit of lag i don't know if it's
from this running or
the internet is messed up it looks like
the stream is still okay so
let me know if there's anything wrong
with the stream i think we're good
uh but my my mouse rose up for a minute
there hey progress
selim is uh from israel welcome
[Music]
someone else from cali too
somewhere from vancouver canada
that's great i love when we have people
from all over for these streams
uh vail valedark says how much have you
researched about brain computer
interfaces uh i haven't done a ton of
research um myself
i'm interested in it and you know i'll
read articles when i see them
but i haven't um
i wouldn't say that i'm an expert you
know at all my main work is in
you know using javascript uh mostly
react uh to build you know apps
so uh i'm not really a brain computer
interface researcher but i'm more of
just kind of like uh
do i'm into it as a hobby yeah like i i
see it as something that could be really
awesome and helpful for a lot of people
that you know i'd like to do more with
uh whenever i can
kind of like just on the side
uh bulat says my school is closed for a
month gym is closed as well trying to
learn react native with jessie awesome
well uh hopefully you learned something
um that stinks i know a lot of the gyms
are closed
i i like to go to the gym and work out
that's going to be kind of hard i was uh
i told my kids earlier that i'm gonna
start uh using them as weights and doing
squats with them or something because uh
i can't go to the gym
i think i don't know if all the gems
around where i am are closed yet or not
i don't know for sure
uh but probably
probably not a great idea to go to the
gym although there are some gyms that
are open 24 hours a day and i kind of
wonder like if i went there
like very very early in the morning you
know could i get in and be like the only
person in there you know that might work
[Music]
let's see
[Music]
has there been any progress on this
thing
let's
i'm going to close out
some of these screens here
i'm gonna stop that and maybe
try it again
[Music]
i probably should do an update on this
when i can
uh
all right let's see
[Music]
what was it shift
i think was shift r was that it
[Music]
see if it goes any faster this time
we'll give it one more shot if that
doesn't work then uh
i don't know then maybe we'll
um
maybe we'll take a break from trying to
get the mobile version running uh on
this stream and and see if we can do
something else
i kind of want to wrap up soon anyway
though
so i think i've hit my hour
my hour limit of what i wanted to do
so we did get a little bit accomplished
today
let's see
[Music]
oh
[Music]
uh valvedark says you could try running
it in the emulator first then on the
phone i really i want to but i don't
have the um
uh the android emulator installed
and i don't since i'm on a pc i can't i
don't think i can run the ios i guess i
could try but i'm pretty sure i can't
yeah i need to have xcode
um
installed
which
i'm almost positive you can't run xcode
on
on windows
hey did it work that time
nice
all right let's give this one more shot
let's reopen expo
oh i think it's working
all right clearing the cash oh he's a
good strategy
[Laughter]
let's see
almost we're 99
99.4
[Laughter]
sweet all right check it out if you can
see this that's our
our red background
so i'm not um i'm not focused right now
so i would need to actually log in on
this device
which oh my gosh that's going to be a
pain
let's see
all right so we have it on this device
let's just test out the uh the vibration
feature
just to see if we can get it working on
a device now that we're actually hooked
up so what i want to do is uh we've
imported vibrate and what i think i'll
do is say uh
like when we press
this button so the button right now runs
in it
so let's just use
vibration dot vibrate
and then
we could just do a pattern number uh
we can do a
what's the pattern i'm gonna have to
look again i don't remember exactly what
it
what it was
[Music]
oh there we go
um
oh i remember what what got us to this
anyway is we had uh
we needed to put something in our
android file
didn't we need to
but i don't think we have it
so this is our web package
and what was it our
android
manifest.xml which i don't think we even
have
so let's see if we can get it to work
without that
and
okay it looks like we can just put a a
duration in
just as a number
and what is that i'm assuming that's
milliseconds so we got like 10 seconds
here so i'm going to save that
okay cool i think that worked
so i'm gonna press it
cool i don't know if you can hear that
[Music]
but
the phone is vibrating so our vibration
works now unfortunately we got an error
come up which i i think we got the error
because we didn't actually fill in any
of the fields
so uh
i have that ad name so we've got we got
some sort of error but our vibration
works that's really cool so
we can get the device to vibrate
so now it's just a matter of getting the
device to vibrate when the state dips
below a certain
uh a certain amount
right so
that's what we want to happen
now i'm assuming if if we actually built
something for android like to release on
you know the app store then we would
probably get that android manifest file
since we're running it through the expo
app i think we don't have to bother with
that right now
so we'll just have to remember this when
we go to bundle list i'd love to
actually build this and put it on the
app store for anybody else who has this
headset
um to uh to be able to use so that would
be really cool
also uh youtube analytics is telling me
the the signal for my stream is not
really good right now so let me know if
you can still
see what's happening on the stream
all cool
that's really cool
now what we need to do though is
let's see we need to figure out how to
set that off based on
let's see
hmm
let's get rid of that console log that
keeps coming up in my my console
so you don't want that
so right now it's it's all based on the
state
what we could do is say
maybe make a use effect
let's make one down here
so let's use use effect
okay so use effect is a react hook
that will allow us
to
do something
anytime
a piece of of data changes and in this
case we're going to track that focus
right so anytime focus changes we're
going to do a check and we're going to
say
if focus
keep doing this to me
if focus
um
is
greater than
whoops i'm gonna say less than
um
we say
0.2
yeah you know i was gonna do this as a
ternary but
yeah actually we could do it as a
we're using this statement it's a little
bit more clear so focus is great less
than point
0.2
then
we're going to
do vibrate
or vibration dot vibrate
and we'll just do
we'll do 10 seconds
else
we're going to do
vibration
dot cancel
and cancel looks like doesn't take
anything
um as an argument and it returns void so
what this will do is uh it'll
automatically cancel the vibration when
we regain focus
[Music]
so
right now we have nothing
because i didn't log in so
it's just continuing to vibrate
for 10 seconds right so we got the
vibration so basically we know that
works now which is awesome
uh what we should do though probably is
is say
um
[Music]
maybe we want to wrap this entire thing
in another if statement
that says uh if if we're actually
you know logged in so i guess if notion
is that what we want or do you want to
say use it probably user is better
so if we have a user
then we want to
you want to do this right so we don't
want to do this we're logged in so let's
save it
and make sure
okay so we save that now we're not
getting a vibration this time
that way
that's good so we won't vibrate let's
take out this vibrate on the
on that button press
okay cool
and also let's say
for the background
color at least for the first screen i
don't know that i really want it to
start out as red
i want it to be white so
we may need to switch that up as well
and maybe say
um
[Music]
uh if focus is less than two or
uh where's my or at
[Music]
why can't i find this
oh
or
we have a
or we don't have user
there we go let's see if that fixes that
i should say
no i don't want
if focus is and we have a user that's
what we need
all right so
if the focus
is less than 0.2 and we have a user
which means like we're actually logged
in then we want it to be red
cool
so that changes so you can see now like
uh the screen is white so we're not
logged in and the screen stays white so
now only if you're logged in and the
focus is less than 0.2
then it'll be red that's cool the red
wasn't really a good look for the entire
background to be read not that the uh
you know the application is not like
super good looking right now
uh but
functionally
this is this is basically a complete
application at this point which is
pretty insane so
uh that it only took us three three live
streams to do this uh so i i have let me
let me look this up on my other screen i
um
um i outlined what i wanted for the
basic nvp uh meaning uh minimum viable
product
for this project
i made a little outline for myself and
i'm gonna try to i'm going to bring it
up on the other screen to make sure
we've met all the requirements
so the requirements were
um an android app that links to notion
and alerts when focus falls below a
certain level so that was it those are
the base
requirements
so at this point if i could get this
bundled
for android
then that will meet the
the mvp
and i think we can uh we can release
that on the app store
so i think on our next stream
i'd love to actually do the
the release to the app store if i can
so what i'll need to do beforehand
though is probably
do a little bit of research to make sure
i have everything good on my end i
already have an account
uh with the app store
so i'm good there
so before the next time i stream i'll do
the research for that and then maybe if
if you all think it would be
you know good to do i'll try to do like
the build
and release
to the app store
um on the next stream
so i don't know how long it takes to get
approved to go in the app store but at
least we can do the release there and
just a heads up like the improvements
that i have here
in stages where the step two would be
um
release an ios version of the app which
should be
not that hard because the same version
should work for ios
the only thing i'll need to do is get
an app developer account for ios
and
i may need to do that release on my on
my mac
that build and release or do some
testing on my mac not on my pc uh the
next step after that would be give users
the ability to set the level of focus
they want the alert to come in at
which
that should be a pretty easy um
improvement to add after that i want to
give options for the type of alert a
user wants so i'm thinking maybe you
know do you want vibration do you want
the color to change do you want maybe
some sort of sound
after that make it available for android
auto
okay and that's kind of cool i think
that'll that will actually be very
useful to people uh and maybe preventing
accidents
um but i've never done anything with
android auto before in terms of
developing so we'll see how that goes
after that i want to release the web app
version
uh which i get that's not going to be
hard like we already have it running as
a web app so
i could maybe move that up
and uh and do that a little bit sooner
um
yeah so i could probably change the
order on that because that's not going
to be very difficult especially with
with how expo lets you
run it as a web app
and you know get that all up and running
i could probably just release it uh at
like github pages maybe um and and have
that working
uh and then the last step i had was see
if we can make it into an alexa app
which that's a big step right so that'll
be um you know totally different code
but i thought that might be kind of cool
if you could do an alexa app uh that you
could just have that running and connect
up uh so
that's that's my uh
kind of my game plan
for in my goals for uh for the focus
it's been a long time since i've done an
alex alexa app so a lot has probably
changed since then since then i may have
to do a little research on that
uh before we do it but
anyway uh that's cool i definitely want
to get android studio running so i can
um demo this in the uh the android
emulator so you all can see i know it's
it's just super hard to see it i wonder
if i i think the light's messing it up
if it's easy i think that actually makes
it harder
but like here's the app running on my
phone i know it's it's very hard to see
so like just so you can see it it
actually is running i just need to log
in
the password and device id are super
long
so that's why i didn't try to log in yet
but
i am making an assumption that that
actually works on the device
um i'm assuming it does
at this point
but um
all right cool so
i'm gonna
let's see i'm gonna take the device off
and
i'm gonna turn my device off
for now i'm gonna finish answering some
questions and then finish up i gotta i
gotta help get the kids to bed they're
probably waiting on me so
uh
i don't know if i'll be able to answer
all the questions but i'll do my best
and actually let's let's uh
make this
um
let's send what we have up to github so
you all can check out the code if you
want
so we're going to do a git add
give it the am flag
and
feed feature let's see what did we add
um
vibrate on mobile
it'll be ile when
uh
focus
falls below
0.2
[Music]
oh did i mess it up what did i do
oh i didn't get
get out it needs to be get commit
[Music]
there we go okay
you push
sweet all right so that code should be
on github now the link to the github
repo is in the description uh so you can
check out that code if you want i saw a
few you already looked like you checked
you you checked it out and like forked
it and started and stuff so um you know
definitely feel free to open any issues
or anything with that code or a pull
request if you see something that's like
um that you would like to contribute or
some obvious problem with the code
definitely i'm always open to uh to new
suggestions
uh and open to collaborate on things
all right i'm gonna try to find where i
left off in the chat
[Music]
all right so uh
ty corty says uh what's the interface
between your brain and the device how do
you control it
um
the um
it's uh i'm assuming it's the you're
talking about this notion headset uh for
now for what we're doing we um
it just tracks
the
gamma waves that your brain is is
putting off uh and that tells you your
level of focus there's a lot of other
cool stuff we can do with it which we
will do
uh i hope to make other apps that will
allow you to think of doing an action
and then make things happen in the app
or on other internet of things devices
so
uh i hope to make that happen this is
kind of my first idea for an app if i
can get this working i'm gonna move on
to more challenging things maybe some
some more fun stuff
let's see
okay uh beverly says
we had a question earlier about a python
question about whether an api and a
module were like python modules beverly
says uh
that
modules in python are more equivalent to
libraries
so uh
that's what i thought
uh but i wasn't you know obviously i
don't have enough experience with python
to really say for sure so i didn't want
to say anything um but yeah that's so um
in in python lingo i guess we would
modules are what we would call libraries
in javascript
[Music]
okay ty corty is like i would like to
learn more about your project like
papers etc i would like to make a thesis
on brain computer interfaces could you
help okay um i would check out
check out the uh neurosci website um
it's neurocity dot let me let me put the
link in the chat
it's neurocity.co
and see if you can get like the contact
info or you know twitter or something
i'm putting that in the chat right now
uh contact the people at nerocity and
see if they have any more data for you
because you know they're the ones that
are really working on the brain computer
interface side of things and we'll have
way more knowledge than i will about it
they might be able to help you out with
more of the technical info
[Music]
ruben says react native or flutter we
had a question like this on the last
stream i have not used flutter so i
don't think i can give a good um
a good answer to that question okay so i
mean i use react native it works for
what what i do um but maybe for you know
for other teams with different skill
sets uh you know maybe maybe flutter
would be the better choice
i'm just not sure
[Music]
well we've got everybody's kind of
calling out where they're from so we got
baltimore cali indianapolis
hungary
[Music]
we were talking about gyms earlier um
and uh mr coldwater canyon says gyms
aren't all that sanitary
yeah i imagine they're not you know you
got a bunch of people sweating and stuff
on the machine so
um
yeah probably not the best place to be
you know during a virus outbreak
[Music]
uh that valdarg says how do you narrow
down what you're meant to be focusing on
just focus in general seems a bit vague
to be useful
yeah i'm like i said i'm not sure what
the science is in terms of how the brain
operates but um alex who was one of the
creators of the generosity
uh
notion headset
said the uh the gamma waves are an
indicator of the level of focus your
brain has so i don't know that it's a
specific focus like you could tell
exactly what you were focusing on but
it's more a general level of focus uh so
yeah i i mean
i'd love to see
when you know get this up and running
and really test it out on a variety of
different things that i'm doing and see
you know how it works if it is specific
enough to be useful
you know or not
and someone says i need to learn this
i'm using cordova to build web apps and
run them on android
yeah i i i messed around with cordovia a
little bit back in the day
i do find
react native to be a bit easier but i i
do use react a lot so it is easier for
me uh if if you didn't know that much
about react then cordova might be a
little easier to go but in general i
think um like i haven't used any of the
newer versions of cordova but in general
i believe that uh
react native
um is
kind of a better way to go for most use
cases
[Music]
let's see
uh valedor says okay this is a good
point basically the point is
you know if you're driving and you're
trying to measure focus so you should be
driving on the road what if you have a
lot of focus on something else instead
of driving the app would still you know
would the app still register that as
focus and not warn you i don't know i
really need to test that uh so a lot of
this stuff i i kind of wondered about as
well like
will this really provide
a
you know good thing in terms of focus so
i um
in terms of like measuring what you
really want to focus on so i just
need to test it out and see how useful
it is
i had a question what should this app do
after it is finished it should warn you
whenever your levels of focus have
dropped below a certain threshold
[Music]
let's see
scott says vs code update available i
know there's
there's an update available i usually
stay updated um you know like every time
it comes up but the last two days i've
opened up vs code right before the live
stream and i didn't want to do the
update then because i needed to stream
so i just put it off till later
[Music]
uh we got hi from australia uh hi from
india
awesome
um carlos says is there any way to
develop django web applications with a
32-bit architecture system i i have no
idea i've never done anything with
django so so i don't know if anybody
knows anything about django please
let us know in the chat
[Music]
it says hello from bangladesh awesome
welcome
kev
kevin has said hello from so many
different places in the chat
i'm not sure where kevin is really from
at this point
uh
greetings from poland how's it going
all right
cool i um oh carla says hi from
venezuela awesome hey i'm gonna um wrap
this up so i've gone over by 30 minutes
what i wanted to go over so
i definitely got to get
help the kids get ready for bed
uh at this point thank you all so much
for watching
i'm really excited you know we pretty
much we we have this working the next
step is just to
build it and release it to the app store
probably want to make it look a little
bit nicer first the ui is not
not great at this point
so maybe we'll work on that as well for
the next stream
but uh it was a good stream i um
a lot of troubleshooting just remember
uh if if your um
metro bundler is not working correctly
try clearing the cache and that should
work that that worked uh for us and
it's worked for me in the past as well
uh now that i think about it that's
always a good thing to try
um
so uh
i don't know when i'll stream again
tomorrow be a little bit busier i'll be
back to work uh but
i i want to try to at the very least
maybe stream
you know at the latest some point you
know next week uh next weekend hopefully
i can get a stream in there before then
though because i'm getting really
excited because we're really close to
actually launching uh this app uh which
that'll be fun it would be my first app
that i've actually decided to put on the
app store i usually never get to that
point i just build something and play
with it a little bit and then just don't
do anything with it so
um
anyway
everyone you know everybody be safe out
there uh don't take any uh unnecessary
risks you know uh try to help each other
out
i know you know some depending on where
you're from you know things are pretty
rough right now
but uh thanks for joining me
and uh stay safe i know a lot of people
at home so i'm gonna do my best to try
to stream a little bit more and
maybe uh
it'll make things a little bit easier
for everybody that's that's stuck at
home
um yeah but until next time
uh have a great rest of your weekend
have a great week and i'll see you later