#garfield Logs
Feb 21 2021
#garfield Calendar
12:53 AM rue_mohr: ok string search is working
10:24 AM rue_mohr: hmm that wasn't a nap
11:25 AM Tom_L: so what was it then?
11:59 AM rue_mohr: didnt you hear, it sounded like everyone heard
12:00 PM rue_mohr: https://twitter.com/michaelagiulia/status/1363241125495136267
12:00 PM rue_mohr: "don't worry folks, thats normal."
12:01 PM Tom_L: still turning :)
12:02 PM rue_mohr: as you can imagine it dropped some pretty big peices
12:03 PM rue_mohr: they did a lot more damage at the ground than i would expect for lightweight plane parts
12:03 PM Tom_L: velocity
12:04 PM rue_mohr: there were a few comments about the compressor staying housed, which apparently is a good thing
12:12 PM rue_mohr: so, the problem with counting lines by looking for and counting off carriage returns
12:12 PM rue_mohr: is that the first line is not prefixed by one
12:45 PM aandrew: rue_mohr: http://ladybug.xs4all.nl/arlet/fpga/ some of that might be interesting to you
12:46 PM rue_mohr: apparentl I cant write code to count the characters to the start of a line
12:48 PM rue_mohr: oh reversed a == / !=
12:49 PM rue_mohr: ARGGG
12:50 PM rue_mohr: ok, maybe?
12:50 PM rue_mohr: for( (*((this->contents)+offset) != '\n')?offset--:0 ;
12:50 PM rue_mohr: (( offset >= 0) && (*((this->contents)+offset) != '\n' ) ) ;
12:50 PM rue_mohr: (*x)++, offset-- );
12:50 PM rue_mohr: }:(
12:50 PM rue_mohr: can ONE PEICE OF THIS CODE PLEASE be elegant!
12:51 PM rue_mohr: every bit of it is like this
12:51 PM rue_mohr: unreadable barf
12:51 PM rue_mohr: with ((())()((()())))((()))))))()))()
12:52 PM ClosetMoon: no rest for the wicked ;)
12:52 PM aandrew: hm? whatw are you trying to do?
12:52 PM rue_mohr: write an editor :)
12:52 PM aandrew: "count the number of characters from position 'x' to the start of a ilne? the start of the line you're on, or the start of the next line?
12:53 PM rue_mohr: given the array 0123456789\n123456789\n0123456789
12:54 PM rue_mohr: if I say what is the x co-ord of the character at position 15
12:54 PM rue_mohr: the answer should be (awkward example) 4
12:55 PM aandrew: xpos = 0; while (*cur) { if (*cur == '\n') xpos = 0; else x++ cur++ } ?
12:55 PM aandrew: er let me fix that
12:55 PM rue_mohr: the trick is that, if I say what is the postiion of index 4, the answer should also be 4
12:55 PM aandrew: xpos = 0; while (*cur) { if (*cur == '\n') { xpos = 0; } else { x++; } cur++ } ?
12:55 PM rue_mohr: you have to count backwards to the beggining of the line
12:56 PM rue_mohr: which is why you cant use character pointers
12:56 PM rue_mohr: because there is no character marking the beggining of the array
12:56 PM aandrew: hm, maybe count backwards to start of array or \n.
12:57 PM rue_mohr: yea
12:57 PM rue_mohr: and thats where the evil begins
12:57 PM aandrew: evil is my middle name
12:57 PM rue_mohr: for( (*((this->contents)+offset) != '\n')?offset--:0 ;
12:57 PM rue_mohr: (( offset >= 0) && (*((this->contents)+offset) != '\n' ) ) ;
12:57 PM rue_mohr: (*x)++, offset-- );
12:57 PM aandrew: er no tht's supposed to be danger
12:57 PM rue_mohr: ^^ this is actually working
12:58 PM aandrew: yeah I wouldn't write it quite so densely because it's hard to read/understand
12:58 PM rue_mohr: tho one could use a character pointer and make sure its always more than the start of array pointer
12:58 PM aandrew: yeah I'd use a while personally
12:58 PM rue_mohr: every bit of this text library is comming out like that
12:58 PM aandrew: for() encodes too much into the statement
12:59 PM rue_mohr: you notice thats a for (...);
12:59 PM rue_mohr: :)
12:59 PM aandrew: pos = 0; while (cur >= start && *cur != '\n') { ++pos; } type of thing
12:59 PM aandrew: yeah, I don't like that style myself
12:59 PM rue_mohr: http://paste.debian.net/1186346/
12:59 PM rue_mohr: ^^^ see if there is any code in there that isn't ugly...
12:59 PM aandrew: forgot a --cur in that while()
01:00 PM aandrew: #include "danStuff.h" hahahaha
01:00 PM rue_mohr: OLD library
01:00 PM rue_mohr: http://paste.debian.net/1186347/
01:00 PM rue_mohr: ^^ lots of good stuff tho
01:01 PM rue_mohr: things like dealing with comparisons of floating point numbers that only differ by 1/infinity
01:03 PM rue_mohr: anyhow
01:04 PM rue_mohr: this whole thing is comming out awefull
01:04 PM rue_mohr: if I saw this code from anyone else I would ditch it and start fresh
01:07 PM rue_mohr: I should get some grid paper and rework things
01:07 PM rue_mohr: I'm having issues with things like \n\n\n\n\n\n\n\n and working out pointers to start of line, and calculating line length
01:08 PM rue_mohr: its easy to put the count on the wrong side of an if
01:08 PM rue_mohr: and I'm also not sure if these functions are going to get used like I expect
01:09 PM rue_mohr: I was trying to encapsulate it so that the outter code would never touch the offsets
01:10 PM rue_mohr: the one line buffer editor worked great
01:10 PM rue_mohr: clean, simple
01:10 PM rue_mohr: this is a freaking hydra
01:11 PM rue_mohr: *not that I'm racist against Hyrda
01:11 PM rue_mohr: :)
01:11 PM aandrew: lol
01:12 PM aandrew: yeah text processing is one of those things that everything things is really simple until they actually sit down and work through all the corner cases
01:12 PM rue_mohr: well
01:12 PM aandrew: and that's not even taking into account things like multibyte characters
01:12 PM aandrew: or text direction
01:12 PM rue_mohr: my editor has to map between screen space and file space
01:12 PM rue_mohr: and it turns out thats evil
01:13 PM rue_mohr: and I'm not handling tab OR \r\n
01:13 PM rue_mohr: or unicode
01:13 PM aandrew: one of the main reasons why long ago I made the very politically correct decision to never support anything other than traditional 8-bit, left-to-right ascii
01:13 PM aandrew: politically INcorrect
01:13 PM rue_mohr: where does reverse come up?
01:21 PM rue_mohr: for( (*p != '\n')?p--:0 ;
01:21 PM rue_mohr: (( p >= this->contents) && (*p != '\n' ) ) ;
01:21 PM rue_mohr: (*x)++, p-- );
01:21 PM rue_mohr: ok, getting closer
01:22 PM rue_mohr: for most part, its easier to deal with offsets from the start of the buffer than character pointers
01:22 PM rue_mohr: but a bunch of places it makes a horrid mess
01:25 PM rue_mohr: if (*p != '\n') p--;
01:25 PM rue_mohr: while (( p >= this->contents) && (*p != '\n' ) ) { (*x)++, p--; }
01:33 PM rue_mohr: there is all sorts of ugly handling where a location cannot be mapped back to the file
01:34 PM rue_mohr: line 0, [OK]:AB!5cdefgcdefg.12
01:34 PM rue_mohr: line 1, [OK]:012345678901
01:34 PM rue_mohr: line 2, [OK]:012345678901
01:34 PM rue_mohr: line 3, [OK]:012
01:34 PM rue_mohr: line 4, [OK]:012345678901
01:34 PM rue_mohr: 6,3 is offset 47 and points to:
01:34 PM rue_mohr: offset 47 maps to 0,3
01:34 PM rue_mohr: which is wrong
01:34 PM rue_mohr: 6,3 should come out pointing to the last valid character of line 3
01:35 PM rue_mohr: as a "as close as you get" answer
01:36 PM rue_mohr: there is an accompanying error code to say that it wasn't an exact match
01:46 PM rue_mohr: one of the other issues i'm battling is translations between size, and offset
01:47 PM rue_mohr: a line with 4 characters has offsets 0-3
01:47 PM rue_mohr: but you cant assume that max offset is size-1
01:47 PM rue_mohr: the size might be 0,
01:48 PM rue_mohr: I'm gonna see this whole thing in a different light and its all going to suddenly be simple
01:50 PM rue_mohr: I cant use \n to search for the beggining and end of lines based on the assumption that I can just go forwards or back when I find one
01:50 PM rue_mohr: finding a line is different than finding the begining and end of a line you might be in the middle of
01:52 PM rue_mohr: AB!5cdefgcdefg.12
01:52 PM rue_mohr: 012345678901
01:52 PM rue_mohr: 012345678901
01:52 PM rue_mohr: 012
01:52 PM rue_mohr: 012345678901
01:53 PM rue_mohr: Findline 0 : OK - Line length: 17
01:53 PM rue_mohr: Findline 1 : OK - Line length: 12
01:53 PM rue_mohr: Findline 2 : OK - Line length: 12
01:53 PM rue_mohr: Findline 3 : OK - Line length: 3
01:53 PM rue_mohr: Findline 4 : OK - Line length: 12
01:53 PM rue_mohr: Findline 5 : No match - Line length: 0
01:55 PM rue_mohr: I might need to define a new set of navigation primitives
01:58 PM rue_mohr: the math kinda goes to hell when you have lines that are 0 characters long, and at the start and end of the buffer
01:59 PM rue_mohr: I can start to see why most editors insist on having a newline at the end of a file
01:59 PM rue_mohr: it gives them a consistant model across the document
01:59 PM rue_mohr: they can define a line as a string ending in \n
02:00 PM rue_mohr: and they have a min. of 1 lines in the document
02:01 PM rue_mohr: I'm looking at it as a set of value-separated-fields
02:01 PM rue_mohr: technically I should have the same issues I'm having with this if I were trying to parse a csv
02:02 PM rue_mohr: tho iirc, lots of csv libraries I'v seen bail if there isn't atleast a space between commas
02:06 PM rue_mohr: ok I'm gonna go doodle on the lathe
02:16 PM Tom_L: good idea
03:19 PM rue_mohr: ok, changed capacitors on a pcb for the hospital too
03:41 PM Tom_L: what we doodling on the lathe for?
04:08 PM MoonyMoon: rue_mohr: are you in your shop?
04:10 PM Tom_L: now think about that. if he were it would say rue_shop1 or rue_shop2
04:10 PM Tom_L: :)
04:11 PM MoonyMoon: I did, but he still may reply based on what he sees
04:11 PM MoonyMoon: rue_shop2: rue_shop1: !
04:12 PM MoonyMoon: wow, I am not hinking am I
04:12 PM MoonyMoon: fuck XD
04:12 PM MoonyMoon: layers man.
04:19 PM rue_mohr: ?
04:19 PM rue_mohr: ?
04:19 PM MoonyMoon: ~
04:20 PM rue_mohr: should I take stuff to Art now or later
04:21 PM rue_mohr: hes gonna talk for a while
04:21 PM MoonyMoon: dunno, alls I know is, FUCK Pintrest!
04:22 PM rue_mohr: yes
04:22 PM MoonyMoon: HOLY FUCK all these charts are mind blogigniasnding!
04:23 PM MoonyMoon: what is my predrill for 1/4inch by 20
04:23 PM MoonyMoon: ?????
04:23 PM rue_mohr: MoonyMoon,
04:23 PM rue_mohr: I can segfault your computer
04:23 PM rue_mohr: with this code:
04:23 PM Tom_L: #12 drill
04:24 PM rue_mohr: printf("%s\n", NULL);
04:24 PM rue_mohr: http://ruemohr.org/~ircjunk/tutorials/mech/tapchart1.jpg
04:24 PM Tom_L: wait..
04:24 PM rue_mohr: #7 or 13/64
04:25 PM MoonyMoon: ah 13/64
04:25 PM MoonyMoon: thansk to the MAXXX!
04:25 PM MoonyMoon: fuck
04:25 PM Tom_L: letter F
04:25 PM Tom_L: or 7/32
04:25 PM Tom_L: depending on the % of thread desired
04:25 PM aandrew: rue needs a bouncer
04:26 PM aandrew: I'm aandrew whether Im on my phone or my laptop or a web client or whatever, all at the same time
04:26 PM Tom_L: 7/32 is 75% thread
04:26 PM rue_mohr: its been advantageous not having one
04:26 PM rue_mohr: you know when I'm not here
04:26 PM rue_mohr: unlike 100 of the nicks in #robotics
04:26 PM aandrew: but you're in the shop right now aren't you?
04:27 PM rue_mohr: nope, this is my bedroom desk
04:27 PM rue_mohr: otherwise it would be shop_n
04:27 PM rue_mohr: (only 2 stations are on)
04:27 PM aandrew: Tom_L: how do you know how much thread you want?
04:28 PM Tom_L: fit
04:28 PM Tom_L: thread grade
04:28 PM Tom_L: 1 2 or 3
04:28 PM aandrew: rue_mohr: do your various irc clients all "alert" on any of the rue_* mentions?
04:28 PM aandrew: Tom_L: oh, so a 75% thread needs a 75% screw as well?
04:28 PM rue_mohr: hah, none of them alert me to anything
04:28 PM Tom_L: 1 is sloppy as a whor... on broadway
04:29 PM rue_mohr: I think twitter just ate one of my posts
04:39 PM aandrew: rue_mohr: really? so this doesn't beep or otherwise tell you someone mentioned your nick?
04:39 PM rue_mohr: nope
04:39 PM rue_mohr: I turned off joins and parts too
04:40 PM rue_mohr: I just always have an eye on irc
04:40 PM rue_mohr: less I be at work
04:42 PM rue_mohr: the source issue is that puts(NULL); segfaults
04:42 PM rue_mohr: the printf is translated to puts
04:55 PM aandrew: wow that's impressive in that case
04:56 PM aandrew: I don't rely on the beep or anything but with like 20 IRC windows open and probably 6-10 screen windows open on the terminal I need the notice :-)
05:07 PM rue_mohr: heh
05:07 PM rue_mohr: I have 5 channels open, thats more than normal
05:11 PM aandrew: 19 for IRC for me
05:24 PM Tom_L: i don't wanna chat with anybody that much
05:25 PM rue_mohr: heh
05:25 PM rue_mohr: we do do a lot of chatting :)
05:26 PM spline: 19 damn
05:26 PM spline: how many are product or public? I tried hanging once on Python and it was like 1k people
05:26 PM spline: page every 30s of scroll.. just too much
05:26 PM rue_mohr: huh
05:26 PM aandrew: they're all public, across three IRC networks
05:26 PM aandrew: MOST I just idle in so I can scroll back if I have a question
05:26 PM aandrew: I'm active on... maybe 3 or 4
05:27 PM rue_mohr: everything I'm in is general channels
05:27 PM aandrew: yeah the big ones I'm not in
05:27 PM rue_mohr: this is the only one that doens't really fit that
05:27 PM aandrew: do any of you (polprog?) need a license for the ancient 4Front OSS sound shit?
05:27 PM rue_mohr: oh I know, I want to cut a torus out of this
05:27 PM spline: haha oss
05:27 PM spline: wowza
05:28 PM aandrew: "This license entitles the licensee free technical support until the end of year 2002 and free upgrades to OSS 3.x versions released before end of year 2004
05:28 PM spline: like I idle in #photogeeks here but it's not really so much about photography anymore
05:28 PM aandrew: most good channels aren't really about what they started out for
05:28 PM aandrew: IME
05:28 PM spline: kinda wished there was like a metal fab/welding chan somewhere but I doubt those types are on irc
05:28 PM spline: yeah
05:29 PM spline: its like a bunch of regs and they all like their own styles so I don't post so much anymore but maybe also because its just a hobby and a number of folks in there do it for a living
05:35 PM rue_mohr: there is #emc
05:35 PM rue_mohr: and me & tom do fab
05:35 PM rue_mohr: kat did too
05:36 PM Tom_L: emc is #linuxcnc
05:36 PM rue_mohr: oh
05:36 PM rue_mohr: yea that
05:36 PM Tom_L: they locked down emc due to a name conflict
05:37 PM rue_mohr: with?
05:38 PM rue_mohr: ok I designed the thing I wanted, I wonder if its what I need
05:39 PM Tom_L: i dunno, maybe some IT company
05:41 PM Tom_L: https://forum.linuxcnc.org/29-forum-announcements/16867-linuxcnc-the-new-name-of-enhanced-machine-control
06:04 PM rue_mohr: hah dell bought emc
06:04 PM rue_mohr: its not even used anymore
06:06 PM Tom_L: right
06:14 PM polprog: aandrew: whats that, even?
06:16 PM aandrew: I thought dell bought emc a long time ago
06:29 PM rue_mohr: I guess they couldn't sell it to dell if the guys were using the name for the cnc stuff
06:29 PM rue_mohr: and then dell ditched it anyhow
06:30 PM polprog: sent this off to fab for a quote today
06:30 PM polprog: https://cdn.discordapp.com/attachments/739849787238776855/813200214357442580/unknown.png
06:31 PM rue_mohr: k
07:02 PM aandrew: you guys use this stuff sometimes
07:02 PM aandrew: how the hell do I use avrdude with a tiny3216?
07:03 PM polprog: huh
07:03 PM aandrew: no matter what atmel ice variant I use, it says it's unhappy
07:03 PM polprog: what's so special about tiny3126
07:03 PM Tom_L: 2316?
07:03 PM aandrew: nope, 3216
07:03 PM Tom_L: who knows
07:03 PM Tom_L: is that an old one?
07:04 PM Tom_L: PDI
07:04 PM Tom_L: single pin programming and debugging
07:05 PM polprog: leonerd might know
07:05 PM polprog: he was doing some UPDI hacking
07:05 PM Tom_L: is that different than PDI?
07:06 PM polprog: no idea, but these are the AVR 1-series which are brand new
07:06 PM Tom_L: they seem to love changing protocols
07:06 PM polprog: he was playing with them, trying to implement support for programming them or something like that
07:06 PM polprog: yea
07:08 PM Tom_L: doesn't look like avrdude supports it
07:09 PM Tom_L: i've been out of avr so long i wouldn't venture a guess now
07:16 PM polprog: same
07:17 PM polprog: that board im making now will use a tiny4313 to control the LCD, but the last time i touched an avr was at least 6 months ago
07:18 PM polprog: i was just doing more analog stuff
07:18 PM polprog: allright
07:18 PM polprog: goodnight :)
07:20 PM aandrew: $ avrdude -c atmelice_updi -p t3216
07:20 PM aandrew: avrdude: bad response to set parameter (scope 0x12, section 0, parm 0) command: 0xa0
07:20 PM aandrew: sudo does the same, -F just says it's returning zeroes
07:20 PM aandrew: I've double and triple checked the connections, it's only 3 pins
07:21 PM aandrew: got 5V and the green light on the atmelice is on
07:26 PM Tom_L: polprog, i did a 2313 lcd board once
07:27 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/boards/serial_lcd_brd.png
07:37 PM aandrew: I'm talking to the device atmel ice just fine, I can see avr dude sending messages and getting responses
07:38 PM aandrew: but what's going out to the DUT isn't working as expected
07:44 PM rue_mohr: ice?
07:44 PM rue_mohr: usbasp?
07:45 PM rue_mohr: oh
07:45 PM rue_mohr: pdi
07:45 PM rue_mohr: you trying to program or debug?
07:45 PM aandrew: updi
07:45 PM aandrew: not pdi
07:45 PM aandrew: just program at this point
07:45 PM rue_mohr: yea, this is why I'm abandoning avr
07:46 PM rue_mohr: because of microchip
07:46 PM rue_mohr: the microchip that made the 16F877A that was in NO WAY like the 16F877
07:47 PM rue_mohr: polprog, what current do you need?
07:55 PM aandrew: rue_mohr: heh
07:58 PM rue_mohr: I think that was the last straw
07:58 PM rue_mohr: The slight-power-bump-causes-lockup was another
07:58 PM rue_mohr: along with input-clock-divided-by-4
07:59 PM rue_mohr: and charging for their C compiler
07:59 PM rue_mohr: which wasn't really real C anyhow
08:04 PM aandrew: yeah
08:04 PM aandrew: way back in the age of dinosaurs I designed a 3 phase soft starter using PIC16C74A
08:04 PM aandrew: 100% assembly because there was no C compiler and there was this "b.lo.c" semicompiler that was just crap
08:04 PM aandrew: when I was running out of memory they released the 16C77
08:05 PM aandrew: and then shortly after the flash F877
08:05 PM aandrew: I *loved* PIC back then
08:05 PM rue_mohr: lots of people did
08:05 PM aandrew: and that design (my first ever professional design) ended up like 60% of the company's total worldwide sales which was a major "holy shit" for me
08:05 PM rue_mohr: I started small microcontrollers with the 16F84 (?)
08:05 PM aandrew: 16C54 was my first intro to them
08:06 PM rue_mohr: but after about 2 years I'd had it with microchip demanding dev money
08:06 PM aandrew: but yeah when they started making them work better with compilers and then really started going batshit crazy with variants I very quickly stopped liking them
08:06 PM aandrew: I hated mplab and I even though I had the awesome ice2000 it was still tedious
08:07 PM rue_mohr: I was using free tools and stuff
08:07 PM rue_mohr: so, not being able to program the A series unless I paid $200 for a programmer was a stop
08:08 PM aandrew: yeah
08:15 PM rue_mohr: playing with ideas for a motion capture glove
08:19 PM aandrew: heh
08:19 PM aandrew: remember the nintendo powerglove?
08:19 PM aandrew: back in high school I won the only thing I ever won in my life using one of those
08:22 PM rue_mohr: I have one
08:22 PM rue_mohr: er I woulnd't have stooped to the glove idea
08:22 PM rue_mohr: :)
09:20 PM Tom_L: rue_mohr, left chicago on the 20th
09:22 PM rue_mohr: ah!
09:22 PM rue_mohr: your just excited to know if it fits }:)
09:25 PM Tom_L: damn tootin
09:27 PM rue_mohr: the other guy hasn't got back to me yet
09:28 PM Tom_L: he's got the test tank doesn't he?
09:29 PM Tom_L: if it weren't for your post i'd win on delivery hands down!
09:33 PM rue_mohr: he got a lead too
09:33 PM rue_mohr: iirc about 4 days
09:35 PM Tom_L: we had it engineered and mfg'd in what? like 2 days?
09:40 PM rue_mohr: :)
10:21 PM aandrew: sigh
10:21 PM aandrew: this entire fucking time I've beenw aiting for microchip studio to install
10:21 PM rue_mohr: it was hiding a question box?
10:21 PM aandrew: first it insisted on installing the c compiler which I don't want, and it was coming in from a 1200 baud modem hosted on an FTP server run on a C64. Now it's insisting on visual studio and I think that one is stored on someone's DSL connection on an rpi
10:22 PM rue_mohr: hmm
10:22 PM rue_mohr: stm32F103 eh?
10:23 PM rue_mohr: some of the dev platforms now amaze me
10:23 PM rue_mohr: full virtual machines, like all 15G
10:54 PM aandrew: hm?
10:54 PM aandrew: whawt about the f103?
10:55 PM rue_mohr: it might be a platform to look forward on
10:55 PM aandrew: and it looks like after I download the offline installer and install microchip studio I see the atmelice firmwre was 1.00. there was an update (to 1.29 or someshit) and now it seems to work better with avrdude
10:55 PM aandrew: yes stm32 is a good platform imo
10:56 PM rue_mohr: I still dont have a clean way to do the hords of system init
10:56 PM rue_mohr: oh I have to parse the hearing data from ma
10:58 PM rue_mohr: I need to start my motion capture glove with a 4 channel linear sensor
11:02 PM rue_mohr: arg, I'm falling asleep
11:02 PM rue_mohr: I have to put an stm32 and a w5500 in a box
11:32 PM rue_mohr: ok
11:32 PM rue_mohr: where was I with this text engine
11:32 PM rue_mohr: edge of a rewrite iirc