America Online APPLE II DEVELOPMENT FORUM CONFERENCE LOG Tuesday, May 4, 1993 10:00 p.m. Eastern Time Topic: Debugging Your Software Forum Leader: Gary Jacobson (AFL GaryJ) AFL GaryJ Welcome to the Apple II Development Forum! Tonight our topic is "Debugging Your Software - AFL GaryJ Debugging Tools and Techniques" AFL GaryJ Ok, we can do questions on topic, or if we don't get on-topic things, we can do off-topic things. Sheppy (All these regulars probably already know just about all they wanna know about Sheppy GSBug... :) AFL GaryJ Yeah, that's true, Eric. AFL Marty Must be nobody writes buggy code. AFL GaryJ Probably the newest release of debugging software was AndyW's program. AFL GaryJ (The newest that I can think of) Sheppy I write lots of buggy code. I just usually am able to fix it, although I once Sheppy had a program that, after six months of searching, I still couldn't find one Sheppy bug. :( DanP18 what is AndyW's program? Sheppy NameOBJ. AFL GaryJ Yes, NameOBJ. DanP18 oh, that. Sheppy Yep. AFL GaryJ Don't say it like that :) DanP18 No, I think it's great. It really helps with using Orca/Disasm. Sheppy I don't program enough C and Pascal to find it useful, I'm afraid. I could Sheppy also phrase that, "I'm afraid of C and Pascal", but it isn't totally true. Sheppy Say, I finally got C 2.0. It really stinks. Wasn't worth looking forward to, Sheppy and I may revert to 1.3 for the time being. AFL Marty How do you determine whether a bug is in your own software or in the AFL Marty system software? Sheppy Marty: If you don't find it in your code, it's in the System Software. Sheppy That's really about the only way. AFL GaryJ You finally got it, eh Eric? Wow. Long time. AFL GaryJ Why do you not like it, Eric? Sheppy Yeah, Gary, about 4 months, three weeks, and, like, four days. DanP18 Go into the System software and hunt it down. Sheppy Let me put it this way: not a single program I've compiled using C 2.0 has Sheppy actually _run_ coming out of the compiler, even if it worked fine under C 1.3. Sheppy The programs crash in strange places, or just generally behave oddly. Could Sheppy be my fault, but I can't find any problems. AFL GaryJ Have you talked to Mike W about that, Eric? (I was wondering what he had AFL GaryJ to say) DanP18 I too have had great difficulty with Orca/C. Spottysoft What if it isn't there either (the OS)?? :) Sheppy Well, no, not yet, although I've posted in the Byte Works forum. DanP18 Check the ROMs. AFL GaryJ Perhaps this is a good time to announce the fact that The Byte Works forum is now AFL GaryJ connected to ADV. Sheppy Yes, I noticed. :) Sheppy 'Bout bloody time for it. AFC DYAJim You got your C, Eric? AFL Marty Does Apple maintain a list of known bugs in GSOS? AFL GaryJ (If anyone has checked the message area since yesterday, they would have noticed :) Spottysoft (gee guys... I haven't got my Orca/C yet... now I'll have nightmares :) Sheppy Yep, last Wednesday, I think. Sheppy I would honestly recommend _not_ installing C 2.0. It's not worth the head- Sheppy aches. AFL GaryJ I believe they do internally, Marty. DanP18 (Beware Pre-compiled Headers). AFL Marty They should make the list publicly available, imho. Sheppy Yes! PCH's don't work. Use the "-i" option to turn them off. Sheppy I agree, Marty. AFL GaryJ I agree, Marty. AFL GaryJ (too :) DanP18 How do you turn them off from Prizm? AFL Marty Not much sense in someone rediscovering a bug that has been known for months. Sheppy I dunno, Dan. I don't use Prizm. Won't use Prizm. Am afraid of Prizm. DanP18 I just reported one about filetype translation between prodos and HFS. AFA Jay Prizm is bizarre :) Sheppy I found a minor glitch in the CDA menu last week. Reported it, sort of... Sheppy I dunno if they already fixed it though. AFL Marty I remember that from last week, Dan. DanP18 I like prizm for the multiple windows. That's it. AFL GaryJ Ok, for those coming in late, our scheduled topic tonight is "Debugging your Software". AFL GaryJ You are welcome to discuss non-topic items if there are no on-topic items. Sheppy Can I ask my pathetic question? :) AFL GaryJ Go ahead, Eric :) Sheppy (It could take a while...) AFL Marty Didn't you do that already? AFL GaryJ :) Sheppy Okay. I'm writing an NDA to spell-check text in TextEdit controls. I need to Sheppy decide on a format for the dictionary data. I need to track both the original Sheppy word and a compressed form of the word to be used to find suggestions to offer Sheppy the user. Any ideas? I need to be able to do _really_ fast searches. I'm Sheppy writing in assembly. AFL GaryJ (AFL Gary and AFA Jay, and Dan Quayle are providing the dictionary, right? :) Sheppy Okay... go for it. :) AFL Marty What format do other dictionaries use? Sheppy I dunno. Sheppy :) AFL Marty Find out. :) AFA Jay I tried to find out the format of the AWGS Dictionary once, didn't get too far. Sheppy Gee, thanks, Marty. I was hoping to avoid that pain. I am planning to look AFL GaryJ Well, let me look at the Word Perfect IIGS dictionary right now. Sheppy at the AW Classic dictionary format, but I was hoping to get some good ideas Sheppy here instead. AFL Marty There aren't that many. AWGS, GW III, and AW 3.0 use dictionaries. AFL GaryJ (I'll see if I can make heads or tails of it) AFL Marty Medley used one too I think. AFL GaryJ Hi Matt Matt DTS Howdy! Sheppy Hi, Matt. Spottysoft AppleWorks (8-bit) uses a plain text file for the Custom Dict... but the main Spottysoft is BIN... I never tried looking into it. AFL GaryJ WordPerfect too, Marty :) AFA Jay There's a TimeOut one too, right? Sheppy Yes, I know. Just don't know the format. Yeah. Same as the AWC one, prob- Sheppy ably, since the AWC one is based on the TimeOut one, I think. AFL Marty Yes... the TimeOut dictionary is essentially the same as the one that AFL Marty comes with AW 3.0. Sheppy Right now, I've got all the code to scan through all the words in the document, Sheppy but I need to add the code to actually check the words against the dictionary Sheppy and offer suggestions for incorrect words. Sheppy Sigh. Nobody has suggestions on this? Guess I hafta come up with this one Sheppy on my own. :) AFC DYAJim sorry Eric Sheppy I do have another question, but I'll save it for later (it's a question Matt Sheppy should probably answer, though). Sheppy 'sokay. I didn't expect much, but I thought I'd try. I just don't like the Sheppy solution I came up with. AFC DYAJim Can't you find some C source or soemthing? :) L deHay use a "sounds like" routine Sheppy Huh? Er, maybe, although C source for this kind of thing would be a real pain Sheppy to port to asm. Sheppy I've already got a routine that does a pretty good job of finding close- Sheppy sounding words. I just need a data structure that's convenient, easy-to-search Sheppy and _fast_! AFL GaryJ WordPerfect Dictionary is pretty "bizarre" (looking at it now). Sheppy My current idea is to have four resources for each letter of the alphabet: Sheppy a table of words, a table of "sounds like" forms, and the appropriate indexes Sheppy to quickly find an entry in each table. Then I'd do a binary search to find Sheppy a word. Sheppy (in the case of the "sounds like" to find a suggestion, I'd have to do a more Sheppy thorough search, since there will be more than one match). Sheppy This way, if the word is "albatross", I would only have to search the "a"'s, Sheppy instead of all words, shaving a little time off the search. Sheppy Anyway, never mind... :) Sheppy I have another question, but I'll wait for others to go ahead first... :) AFL GaryJ That's an interesting problem (dictionary files). I don't have any good ideas, though. AFL GaryJ (It's something that I've thought a little bit about myself). AFA Jay I did once also, and there wasn't anything to find about it. Sheppy This is one of the programs I've kicked around for a while, and finally decided Sheppy would be really cool to have. :) Sheppy Always thought Teach and EGOed could use spell checkers. :) AFL GaryJ It would be cool. There's lots of ways it could be done. I know that in programs AFL GaryJ like WordPerfect, if you do a word search for matching words in the dictionary, the program really AFL Marty It would be neat if you could allow use of existing dictionary files. Sheppy Yes, it would be -- it would save me from having to generate a main dictionary. AFL GaryJ flies when the first letter is known (so it obviously must be keyed somehow by the first letter), and Sheppy But I'd have to come up with the format, first. Which I might try to do. I AFL GaryJ it takes a lot longer (as if it has to search all entries) if you use a wildcard AFL Marty Well, you would still need a main dictionary for those poor souls who don't AFL GaryJ for the first character. AFL Marty have one of their own. Sheppy honestly hadn't thought of that, actually. :) AFL Marty The main dictionary is almost certainly compressed. Sheppy Well, that's something like my current plan. The search will first be done on AFL Marty Probably some sort of index too. Sheppy the assumption that the first letter is correct. Then it will start looking Sheppy for words beginning with other letters that might be construed as sounding Sheppy similar. AFL GaryJ Yes, a raw file show on the WordPerfect dictionary shows no recogniziable characters. AFL GaryJ (or words, or portions of words). Sheppy Ick. AFL Marty What makes it hard to discern is that most dictionaries are licensed James S WI I think you should open up a copy of Dr Dobb's or some other programmers mag. Every other AFL Marty for use with particular applications. AFL GaryJ Very true. Sheppy I thought about compressing my dictionary, but... JWankerl I bought a rhyming dictionary today - that'd be something cool to have online... :-) James S WI page has an add for a library that iompliments a spelling checker. You could get some great Sheppy Yes. Dictionaries are all licensed, which makes it really tough. James S WI ideas from one of those.. You can get them with source (C) for as little as $30. AFC DYAJim rhyming.. lol! Sheppy Bleah. I don't like converting C code to assembly, much... Sheppy I've done some test runs with my algorithm in Applesoft, and it seems to work Sheppy pretty well. It was able to come up with good suggestions even when I spelled Sheppy "inconceivable" "enkonceevibl". :) Cletus H Hey Joe, Rhyming ;-) James S WI This has nothing to do with language. You need some help defining a data file format and AFA Jay sounds like a spell checker for the totally clueless :) James S WI posable ways to find segestions and other matches. The language the sample is written in James S WI has very little to do with anything. Sheppy Yes, I know that, James. That's not my point (exactly...). But I'm not Sheppy willing to shell out money to buy code that may or may not actually be of any Sheppy use to me. Really. :) Sheppy I'd have to actually see the code first. I mean, all I want is a data Sheppy structure, not an entire program. James S WI If you are thinking about (A) using the resource manager and (B) not compressing your James S WI dictionary then you need to do some re-thinking. Sheppy Hmmm? Yes, I know. That's why I'm asking for suggestions for a better way to Sheppy do it! :) Sheppy I said my idea was pretty bad. AFL Marty Isn't that the real trick (coming up with a data structure)? James S WI Well buy the source to one and you will get some great ideas. ;) Sheppy Sure 'nuff. The rest of the code is a snap (although I need to rewrite my Sheppy routine to determing the end of a word...). Sheppy I'll only buy source if I'm guaranteed that it will contain a data format Sheppy acceptable for my needs. Besides, I don't read Dr. Dobbs (I can't afford any Sheppy more magazines. I can't afford school.) James S WI I would sugest using balanced B Trees and hoffman (SP?) compression. AFL GaryJ I think it is, Marty. (The real trick). That's one good reason why the dictionaries are AFL GaryJ licensed and copyrighted to the software. AFC DYAJim huffman Sheppy Sigh. Now y'all are depressing me... maybe I should give it up... :( Spottysoft nyah... James S WI That's always an option. AFL Marty Nah... compressing you maybe ;) Sheppy Problem: I don't know much about compression. AFA Jay Are there an PD dictionaries? AFA Jay or do you plan on typing your own dictionary in? :) Sheppy (My idea of a big-time compression scheme is to use PackBytes) :) AFL Marty Funny you should ask, Jay Sheppy My original plan was to scan every piece of already spell-checked text I could AFC DYAJim I think there might be some PD dictionaries.. Sheppy find, building the main dictionary. AFC DYAJim One person who might now is Bryan Zak (Bryan Zak) Sheppy Yes, possibly, and if I can find those, I would be very excited. :) AFL Marty If you'll trot over to APR you'll find some Sheppy I should go look. Didn't think of that. Sheppy Okay, I've got enough to get me going again here. Thanks, all. AFL Marty There's a bunch of them.... 11 files in all I think. AFA Jay Do they come with formats? Sheppy Yes, I'd need that info. AFL Marty No... they aren't compressed. AFA Jay Well, then I guess you could do anything you please with it :) AFL Marty They are simply lists of words... but it beats scanning text. Sheppy Hmm. I'll still have to device a data format, though. Sheppy Well, I'll work on it. We'll see what happens. AFL Marty Well, it's a start. JWankerl Yeah, SoftDisk G-S has been promising a spelling checker for some time now... Sheppy Well, let somebody else ask a question. If nobody else has one, I got a much Sheppy simpler, quicker one. AFL GaryJ I'd like to hear different ideas on file formats for spell checkers too. (I'll have to dig around a AFL GaryJ bit too) Sheppy Well, if anybody happens across any info or ideas, let me know! AFL GaryJ Anyone else have a question or something they'd like to discuss this evening? Sheppy In the meantime, I'll poke at AppleWorks' format. :) Sheppy Okay, if nobody else has one... Sheppy ? Sheppy :) AFL GaryJ Go for it, Eric :) Sheppy My NDA doesn't want anything else going on while it runs. Is it okay if it Sheppy uses a modal window during its Open routine, and leaves its action routine Sheppy blank? Or is there a better way? Matt DTS That's OK with System 4.0 and later. Just return a NIL window pointer from Open. JWankerl If you do everything in Open and return a NIL window pointer, everything should be OK. Matt DTS Pretty damn unfriendly, but we've come to expect this from you, Eric. :) Sheppy Cool. That's what I'm doing. Wanted to be sure it was kosher with Apple. Sheppy Well, I figured it would be worse to allow the user to edit the text while it's Sheppy being spell-checked. :) Sheppy Or, even worse, to allow them to close their editor while the checker is AFA Jay Have it check as they type :) Sheppy running. That would cause a spectacular crash, I think. :) Sheppy Ick, Jay. Doable, but sloooowww. :) AFL Marty That'd be kinda neat. James S WI Only if you have a slow spelling checker. ;) Sheppy Yeah... it would be, huh? Hmmmm... :) James S WI There are Mac programs that check as you type. AFL Marty It could guess the word you want based on the letters you had already typed. Sheppy You set up your sounds right, and you make a typo and hear "Hey! Stupid! Sheppy Get a dictionary!" :) Sheppy Yes, I've seen that kind of program. Sheppy Hmmm.... maybe.... I could set that up as an option. You could either to a Sheppy spell-check all at once, or turn on the instant checker... hmmm.... AFA Jay you could even do it when a return key was pressed, like the end of a paragraph AFA Jay or something Sheppy interesting. I'll have to think about that one. :) James S WI All you do is check the work before the cursor every time they type a space. Should be JWankerl If it's for TextEdit, you could patch into TEKey or something... :-) James S WI very fast if your dictionaly is indexed. Sheppy Yeah, James. Exactly. Oh, yes, the dictionary will be indexed, sure. Yeah... AFL Marty Either way you still need the data format. Sheppy every time the space bar is hit, check the last word. I like. Sheppy Gee, thanks for spoiling the fun, Marty. Sigh. Yeah, a data format. :) Sheppy I like that idea, Jay. I'll see what I can do with it. :) Sheppy (wouldn't require any changes to the code I have so far, either. :) Sheppy Right now it just flashes all the words, one by one, lower-cased, in the Line- Sheppy Edit control used for making corrections. Sheppy I did that so I could look to be sure the words were being scanned properly. Matt DTS Anything else of interest going on here? Sheppy Certainly not, Matt. I'm the only interesting thing here. :D AFL GaryJ Jay: Be sure to label this chat log as "bizarre" Matt DTS That's a pretty depressing thought. :) AFL GaryJ (the word for the night) Sheppy Isn't it, though? :) AFL GaryJ :) AFA Jay It's my word for the season... AFA Jay everything is bizarre. AFL GaryJ Well, it could be "bazaar" AFA Jay or Bazyar Sheppy Say, Matt. Is it normal for Teach not to actually be able to import MacWrite Sheppy files? Sheppy It's never worked on my system. Sheppy I always get "end-of-file encountered" errors, which seems like a silly error, Sheppy since the end-of-file's always there _somewhere_. :) AFL GaryJ :) Matt DTS It's only classic MacWrite files, not MacWrite II files.