2023-05-27 04:28:07 ANS Forth calls TIB the Terminal Input Buffer and doesn't say much about what it is or when it's used 2023-05-27 04:28:26 Forth 83 calls it the Text Input Buffer and says it's part of the input stream from all different sources 2023-05-27 04:28:44 Kind of a weird annoying change 2023-05-27 04:29:15 There's not a ton of situations where SOURCE is more useful than TIB and #TIB 2023-05-27 06:42:38 MrMobius: that sounds weird to me. is there a difference between the terminal settings (stty -a) those Enter-is-^M configurations and the Enter-is-^J tmux/xfce-terminal pair? 2023-05-27 06:43:09 s/those/in those/ 2023-05-27 07:55:58 veltas: if your Forth had a mechanism like this ring-based string stack we've been discussing, then do you really need TIB at all? Couldn't you just have QUERY leave a line of input on the string stack? 2023-05-27 07:57:14 That kind of thing seems to happen a good bit - you add a feature to a system and it starts to affect how the system itself might sensibly operate. 2023-05-27 07:58:24 Of course if it does work that way - : query ( -- addr) ... ; - then you're faced with where to put that address while you interpret the data. 2023-05-27 07:58:49 Because that addr just covered up the information the user input stream just put on the stack. 2023-05-27 07:59:28 But you perhaps might have TIB just be a pointer and you'd save that address there. 2023-05-27 07:59:53 I.e., the next input char would come from TIB @ >IN @ + C@ 2023-05-27 08:00:21 QUERY TIB ! >IN OFF INTERPRET 2023-05-27 08:14:29 In that video I linked last night on the micromice maze running contests, I had to particularly admire one sneaky entrant. 2023-05-27 08:15:25 The rules say that your timer starts when you leave the starting box. so one guy included on his mouse a camera that he could run up into the air, and before he left the box he hoisted up the camera and visually inspected the maze and did some processing before leaving the box. 2023-05-27 08:15:41 In theory he could have wholly worked out the best path right then and just run right through it. 2023-05-27 08:15:58 Seems a bit counter to the "spirit" of the contest, but... I guess the rules are the rules. 2023-05-27 08:17:36 On the more "honest" front, one guy won one year by NOT taking the shortest route. You actually win on time, not route length, and he found a route that was over five meters longer than the shortest route but which had long straight runs where he could accelerate to very high speeds. 2023-05-27 08:18:28 Other clever innovations included making your mouse narrow enough to proceed diagonally through corners instead of restricting to 90 degree turns. 2023-05-27 08:19:29 Still another was to mount a fan on the mouse you could use to "suction" the mouse down against the ground for faster cornering. 2023-05-27 08:20:03 Apparently it's an addiction - it's like once it sucks you in it's a bottomless pit of things to try. 2023-05-27 08:20:07 if they hadn't considered the Z-axis in relation to the guy who hoisted a camera to determine where the exit is, would they have allowed someone to turn their mouse into a bat and fly to the exit instead? 2023-05-27 08:20:35 No, that's explicitly prohibited. 2023-05-27 08:20:40 No flying or climbing. 2023-05-27 08:21:16 I don't really think the camera should be allowed, but at least that year the rules had not foreseen that. 2023-05-27 08:21:33 That one really strikes me as a little underhanded. 2023-05-27 08:22:12 the maze periscope idea is definitely clever though 2023-05-27 08:22:26 The way the contest works, you get to make three runs. Each run begins when you leave the starting box and ends when you reach the finish box, BUT you don't move your mouse back to the start - it has to return there on its own. 2023-05-27 08:22:43 And the rules do not require you to go back any particular way, so you can use that to do additional exploration. 2023-05-27 08:22:55 So your third run you have the most stored knowledge of the maze. 2023-05-27 08:23:44 That does seem like a slippery slope, though - seems like you could just refuse to re-enter the start box until you've fully explored the maze. 2023-05-27 08:23:51 There must be some fine print around that. 2023-05-27 08:24:16 Turns out neither depth first search nor breadth first search is optimal. 2023-05-27 08:24:31 The original early "best strategy" was a "flood fill" kind of thing. 2023-05-27 08:24:40 It describes how it works in the video. 2023-05-27 08:24:49 That's a Veritasium video - I usually quite enjoy those. 2023-05-27 08:26:07 But it's a great example of hardware+software, electrical plus mechanical, etc. etc. A nice "all around challenge" type of thing. 2023-05-27 08:26:49 Of course the maze structure isn't revealed until the beginning of the event, and no further changes to the mice are allowed after that. 2023-05-27 08:27:26 It's pretty damn impressive watching the modern runs vs. the old ones. 2023-05-27 08:27:36 They've really really pushed the envelope on performance. 2023-05-27 08:28:24 some of them run through there so fast you can hardly keep up with them. And when they come to a long straight run the acceleration is really impressive. 2023-05-27 08:29:01 And in a lot of cases the difference among the top few times is just milliseconds. 2023-05-27 08:30:17 Bet that come become a fairly expensive hobby. 2023-05-27 10:22:07 This startup procedure that I'm looking at is somewhat involved. 2023-05-27 10:23:06 But what I want is to have a word I can run that will re-start with adjusted configuration parameters. So that means copying the hard-coded config into a volatile place before using it to construct the system. 2023-05-27 10:23:37 Then I can have a word that will send me back to the originally loaded image at a place where it will tear down the old config and use info passed in to build a new one. 2023-05-27 10:24:07 It's not complicated - it's pretty straightforward, actually. There's just a fair bit to do. 2023-05-27 10:25:13 Allocate the ram regions, copy the right stuff into them, make my little patches that go from running "initial Forth" to "live Forth," etc. 2023-05-27 10:25:49 All capped off by a primitive that will change the registers to operate from the live image rather than the original. 2023-05-27 10:27:44 Somewhere in there there will be a jmp rax instruction, and rax will at that time point to the instruction immediately following that jump *in the copy*. 2023-05-27 11:07:13 unjust: the only thing that seems to differ is iutf8 but it isn't correlated to the problem 2023-05-27 11:07:39 and when it inserts ^M for enter, Ctrl+J works for enter 2023-05-27 11:07:46 https://docs.google.com/spreadsheets/d/11PNDUil4O-JUDjdPBdukA9KUblswGiG0tVeiJbdcJyA/edit?usp=sharing 2023-05-27 11:38:10 It just seems like this is something that should be easy to tweak. 2023-05-27 12:07:59 MrMobius: seen this? https://askubuntu.com/questions/1281034/cant-send-enter-key-in-vim-and-ncurses-apps-under-byobu-and-tmux 2023-05-27 12:08:53 a commentard on the accepted answer says: "Thanks, the keyboard on my Evolve Maestro Ebook11 is the same way and this also fixes the problem for me. I stuck it in ~/.Xmodmap to load it automatically – BytePorter" 2023-05-27 12:09:40 "Tinkering around with xev I found that Enter button on this keyboard sends the wrong keycode. I'm leaving here my findings and how I solved, so it can be useful to others." 2023-05-27 12:17:29 dear lord 2023-05-27 12:17:37 yes? 2023-05-27 12:19:42 deer john 2023-05-27 12:20:27 green your phuture is 2023-05-27 12:28:29 Heh. Reminds me of an old Picket Fences episode. That show had this really flamboyant defense laywer, Douglas Wambaugh, I think. Totally outrageous. In one episdoe he talked about a defendent "running over Dear John with a John Deere." 2023-05-27 12:28:45 Ray Walston played the circuit judge, and he was also awesome on that show. 2023-05-27 12:35:16 unjust: that did the trick. thank you sooooo much 2023-05-27 12:38:20 Ah, NICE. 2023-05-27 12:38:25 It's good to have friends, eh? 2023-05-27 12:40:20 hehe 2023-05-27 12:46:52 np, though it's the OP there that deserves the thanks 2023-05-27 12:47:57 great when people post follow up on those sorts of posts with what solved their issue 2023-05-27 12:56:28 Yeah, more often than not I can find solutions to such things online. 2023-05-27 12:56:43 I'm rarely the first person to encounter anything. 2023-05-27 13:03:58 ya that is great 2023-05-27 13:04:13 I just wouldnt have suspected it's a hardware problem with the keyboard :/ 2023-05-27 13:09:55 i wonder what the motivation was behind using the scancode for keypad enter 2023-05-27 13:10:46 does xev list any of the other keys that you'd also find on a numpad with a "KP_" symbol prefix? 2023-05-27 13:10:59 ie. "KP_add" instead of "plus" for the + key 2023-05-27 13:13:30 i guess it's probably a bug in the keyboard controller firmware to blame rather than a routing issue with the key matrix 2023-05-27 15:05:19 I just used tmux in a nifty way. I've got this program called pianobarfly. It's a console Pandora interface, with the very nice feature of capturing mp3 files of all of the songs it plays. 2023-05-27 15:05:49 Some years ago I wrote up a script that started pianobarfly in the background and used a named pipe to provide a way to send it commands. 2023-05-27 15:06:23 My script keeps separate directories for different genres, and among other things I could have it change genres and it would manipulate directory names to keep ti all straight. 2023-05-27 15:06:46 So I could just say things like "music on" "music off" "music " etc. 2023-05-27 15:07:00 pause, resume, like, dislike, skip the remainder of a song, etc. 2023-05-27 15:07:27 Anyway, I hadn't used it in a while and earlier when I checked it it wasn't working. 2023-05-27 15:07:35 Commands weren't passing through the pipe properly. 2023-05-27 15:07:42 Probably some sort of buffering issue - not sure. 2023-05-27 15:07:56 Anyway, I replaced the named pipe approach with a background tmux session. 2023-05-27 15:08:19 tmux has a "send-keys" feature that make it easy to pipe stuff into whatever is running in the session. 2023-05-27 15:08:32 I changed the right bits of the script to use that, and it just immediately worked. 2023-05-27 15:09:09 "music off" will send in q to quit. "music on" actually sends the pianobarfly command in. And so on. 2023-05-27 15:09:20 No rought spots at all - it just does as advertised. 2023-05-27 15:11:29 Some manual intervention is required to establish new genres - this interface is really just for the simple stuff. To add a genre I'd attach to the tmux session and do the right stuff there and then add the specific info related to the new genre to the script. 2023-05-27 15:11:54 The genre change requires modifying the config file - the script does that with sed -i 2023-05-27 15:12:52 Anyway, you can build up a music library pretty quick with that. 2023-05-27 15:13:31 And you get quite a better diversity of stuff that on most stations that lean heavily toward the "popular" songs. 2023-05-27 15:19:59 And I like this better because it gives me access to the "proper" interface, just by attaching to the session, whenever I want it. 2023-05-27 22:02:35 Well, I backed away from trying to be able to run Forth words from the initial load. It turned out to be cleaner to just have the initial assembly do the region allocation, the content copies, and the offset-to-address translations. 2023-05-27 22:04:02 I'm putting a little table of region descriptors at the beginning of the image; I just step through those and call a subroutine that handles that region. Then init the registers and go. And that funky jump I described earlier isn't necessary - just running NEXT (a jmp instruction) handles the transfer. 2023-05-27 22:05:30 So Forth will start with a collection of values on the stack that I'll just store in their appropriate variables. 2023-05-27 22:10:54 Fibonacci trees are kind of interesting. 2023-05-27 22:11:07 They look good for large priority queues. 2023-05-27 22:11:13 https://www.youtube.com/watch?v=6JxvKfSV9Ns 2023-05-27 23:03:49 What's less than entirely pleasing about that algorithm is that it's not "rigorous." In it's big-O related aspects. It stipulates a "rule of thumb" that keeps you from damaging the desirable structure of the trees "most of the time." 2023-05-27 23:04:14 I assume there are probably papers studying that that show on average it gives better performance that the rigorous algorithm. 2023-05-27 23:04:24 But it's still just a little less than fully satisfying. 2023-05-27 23:05:40 Plus the whole thing is a little sloppy - it takes a "lazy approach" to some of the operations and lets their cost be paid back by one of the other operations (which makes sense because that other operation already requires traversing the data structure in a way that makes bearing the cost there less painful). 2023-05-27 23:05:57 It makes sense, but the whole thing just has kind of a "fast and loose" feel to it. 2023-05-27 23:10:41 Also, the *worst case* operation times aren't guaranteed to meet the O() claims - the *average* is. 2023-05-27 23:10:52 I guess that's what matters when you consider handling a large workload. 2023-05-27 23:11:19 This is a data structure that might be used, for example, in a rounter processing a huge pile of packets in some priority order.