#garfield Logs

Mar 24 2022

#garfield Calendar

12:00 AM rue_mohr: DB.onreadystatechange = refreshDB; <<- still applies right?
12:08 AM rue_mohr: they do love to wrap things
12:08 AM BloodMoon: yeah but..
12:08 AM rue_mohr: yes...
12:08 AM BloodMoon: 1 sec
12:08 AM rue_mohr: part of a json object thats supposed to auto update?
12:08 AM BloodMoon: no the scope is wrong
12:08 AM rue_mohr: heh
12:08 AM rue_mohr: your looking for DB.onreadystatechange = function () {...}
12:08 AM rue_mohr: aren't you
12:08 AM BloodMoon: so its on the change of the method not the containing object
12:08 AM BloodMoon: yes I am on W3schools
12:08 AM BloodMoon: .com
12:08 AM BloodMoon: pulling from what I used last week
12:08 AM rue_mohr: yea, you see, an inline function isn't the only way of doing that
12:08 AM BloodMoon: I know
12:08 AM rue_mohr: and I dont want to have an inline function jabbed in
12:08 AM BloodMoon: I used to be the guy who would shun that like you
12:08 AM BloodMoon: ok but still
12:08 AM rue_mohr: but, I do lose "this" which is annoying
12:08 AM BloodMoon: you should use this.readyState
12:08 AM BloodMoon: keeps your shit in the right context
12:08 AM rue_mohr: if I were using an inline fuction
12:09 AM rue_mohr: oh, that may require a library?
12:10 AM BloodMoon: nah
12:10 AM BloodMoon: 1 sec
12:11 AM BloodMoon: DebugPrint(JSON.stringify(obj));
12:11 AM BloodMoon: whatever debug rint is
12:11 AM BloodMoon: print*
12:12 AM rue_mohr: aha
12:12 AM rue_mohr: {"address":"4","code":"8"}
12:12 AM BloodMoon: yup like that too
12:12 AM BloodMoon: that looks like raw out put???
12:13 AM rue_mohr: its from stringify, but
12:13 AM BloodMoon: good
12:13 AM rue_mohr: its not listing all the key value pairs
12:13 AM rue_mohr: I'm not doing this right maybe
12:13 AM rue_mohr: cant name them
12:13 AM BloodMoon: for loop and string con cat ???? XD
12:14 AM rue_mohr: somehting about how I'm trying to do this doens't add up
12:14 AM BloodMoon: I'll say :D
12:14 AM rue_mohr: there is a key, and a value
12:14 AM BloodMoon: Hay I gotta go now pal
12:23 AM rue_mohr: key and value names, and an array of values for them
12:23 AM BloodMoon: You can brain this
12:23 AM rue_mohr: I'll get 'et
12:23 AM BloodMoon: :)
12:23 AM BloodMoon: gnight
12:23 AM rue_mohr: I didn't do this right
12:23 AM rue_mohr: oh each one needs to be an array if I do it like this
12:23 AM rue_mohr: but keeping them paired
12:23 AM rue_mohr: hmmmm
12:23 AM rue_mohr: do I want an array of key value pairs
12:23 AM rue_mohr: or
12:23 AM rue_mohr: a key and value that are arrays
12:23 AM rue_mohr: foreach PDB { if (this.code == "1234") ...
12:23 AM rue_mohr: is an array of key value pairs
12:43 AM rue_mohr: wtf foreach
12:43 AM rue_mohr: cmon, foreach the array you stupid thing
12:43 AM rue_mohr: WAIT
12:44 AM rue_mohr: forEach
12:44 AM rue_mohr: bastards
12:45 AM rue_mohr: ugh
12:45 AM rue_mohr: ok
12:45 AM rue_mohr: oh yea, error console helps tonnes
12:46 AM rue_mohr: now I'm really bouncing off the bumpers!
12:47 AM rue_mohr: oh YEA!
12:50 AM rue_mohr: so, moon was on to something I didn't know about, any json reply is automatically put thru an XML parser
12:51 AM rue_mohr: which is interetsing
12:51 AM rue_mohr: and onload=fn() might get automatically executed
01:54 AM rue_mohr: hah, this is lookin good
01:54 AM Tom_L: morning
01:54 AM Tom_L: couldn't sleep
01:54 AM rue_mohr: oh god, you scared me, thought it was 2am
01:54 AM rue_mohr: already
01:54 AM Tom_L: heh
01:54 AM rue_mohr: happens when I'm coding
01:55 AM rue_mohr: too often
01:55 AM Tom_L: i know
01:55 AM rue_mohr: the javascript thing is comming along nicely
01:55 AM Tom_L: i've pulled a few all nighters in the past
01:55 AM rue_mohr: my errors were mostly casing function calls right
01:56 AM rue_mohr: its working, you load the page, it gets the database, parses it and rewrites the page
01:56 AM rue_mohr: you hit 'last card refresh' and it gets the last card record and updates
01:56 AM rue_mohr: you hit search and it goes thru its local memory of the database and does the right things
01:57 AM Tom_L: what's it for?
01:57 AM rue_mohr: there is more work to do, but less effort, the groundwork is working
01:57 AM rue_mohr: so
01:57 AM rue_mohr: wiegand door access sytsems
01:57 AM rue_mohr: they cost too much
01:57 AM Tom_L: oh that's right
01:57 AM rue_mohr: so I'm making a cheap one
01:57 AM rue_mohr: just stand-alone
01:58 AM rue_mohr: something that would work for 99% of all the apartments out here
01:58 AM rue_mohr: it can store 511 ;] cards
01:58 AM rue_mohr: nice little web interface for card managemnt
01:59 AM rue_mohr: using an atmega8 and an esp8266
01:59 AM * Tom_L goes back to try and sleep
01:59 AM rue_mohr: I was going to use a tiny26, but realized that I didn't need to try to make the project harder
01:59 AM rue_mohr: so I'll make the cpu card a generic module for it
01:59 AM rue_mohr: I can use whatever I can get :)
02:00 AM Tom_L: 8 was a bit odd
02:00 AM rue_mohr: 8 88 32u2...
02:00 AM rue_mohr: :)
02:00 AM Tom_L: no
02:00 AM Tom_L: 48 88 ...
02:00 AM Tom_L: 8 was a bit odd
02:00 AM rue_mohr: oh no, I mean I'll set up this project to use anything
02:01 AM Tom_L: right
02:01 AM rue_mohr: the cpu's tasks are super simple
02:01 AM rue_mohr: all the heavy lifting is done in the web browser
02:01 AM rue_mohr: its all user interface stuff anyhow
02:01 AM Tom_L: i know this guy with a handfull of u2
02:02 AM rue_mohr: the esp8266 is pretty simple, its a static page it issues, and just does command passthru to a serial port
02:02 AM rue_mohr: :)
02:02 AM rue_mohr: the avr takes the serial port and does basic i2c memory manament
02:03 AM Tom_L: i forget if the U2 has a serial port
02:03 AM Tom_L: it has the usb one
02:03 AM rue_mohr: if its any kinda m32, it would
02:04 AM Tom_L: i never used it for that so i never looked
02:04 AM rue_mohr: I wonder when my osh baords arrive...
02:04 AM Tom_L: you think you can use that copper?
02:04 AM rue_mohr: I'm all excited to etch some pcbs for some reason
02:04 AM rue_mohr: It looks like it has a few marks, but its great
02:05 AM Tom_L: that stack was behind the shop's shear on the floor
02:05 AM rue_mohr: you got a sheer!?
02:05 AM Tom_L: some is tarnished because of exposure to the chemicals
02:05 AM Tom_L: no, they did
02:05 AM rue_mohr: oh
02:05 AM Tom_L: i wanted it but didn't have room
02:05 AM rue_mohr: oh it was like a table sheet metal sheer then?
02:06 AM Tom_L: probably 4' wide i think
02:06 AM Tom_L: heavy
02:06 AM rue_mohr: oo a good old one
02:06 AM Tom_L: yeah
02:06 AM rue_mohr: they sure did love large iron castings
02:06 AM Tom_L: it _was_ the era
02:06 AM rue_mohr: should I try setting up to cast iron some day?
02:07 AM rue_mohr: I hear brake disks melt down great
02:08 AM Tom_L: i gotta get up in a couple hrs so i better try to sleep
02:08 AM rue_mohr: k, so I'll need to make a login/logout thing
02:08 AM rue_mohr: and stitch in a password
02:08 AM rue_mohr: nobody ever changes the password on these
02:09 AM rue_mohr: you can walk up to any entery phone and log in for programming using the default password
02:09 AM Tom_L: user: admin, password: password
02:09 AM rue_mohr: usually its something like hold * and 0 for 3 seconds, and the code is 1234
02:09 AM rue_mohr: #, and your in
02:12 AM rue_mohr: oh and door release time
05:00 AM Tom_L: morning
05:01 AM rue_mohr: oh damnit this time it is 2
05:02 AM * Tom_L sets rue_mohr's alarm for snooze
05:02 AM rue_mohr: I cant get onClick to take a javascript function
05:05 AM rue_mohr: ah, got it
07:14 PM rue_mohr: I can barely hold my eyes open
07:26 PM Tom_L: i can see why
07:27 PM Tom_L: 04:49:34 <rue_mohr>