From acormany at yahoo.com Sat Mar 1 13:06:41 2003 From: acormany at yahoo.com (Adam Cormany) Date: Sat Mar 1 14:06:48 2003 Subject: [Coldstuff] small fix in $list.flatten Message-ID: <20030301210641.5826.qmail@web12803.mail.yahoo.com> Unsure if anyone else has run into this, but I was running @rehash-all after adding a few hundred rooms($place) and got: [08:56 PM:/home/b] @rehash-all Rebuilding all caches.. Purging caches.. ! => Out of ticks ! Thrown by $list.flatten() line 10 ! ~methoderr: $list.flatten() line 8 ! ~methoderr: $user_soth<$admin>.rehash_all_cmd() line 29 ! ~methoderr: $user_soth<$user>.parse_line() line 52 ! ! You may want to use @report to report this problem. In $list.flatten(), just add a refresh() in the loop and you should be fine. Just wanted to pass it along. Adam __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ From acormany at yahoo.com Sat Mar 1 21:22:31 2003 From: acormany at yahoo.com (Adam Cormany) Date: Sat Mar 1 22:22:40 2003 Subject: [Coldstuff] rehash problem Message-ID: <20030302052231.75082.qmail@web12804.mail.yahoo.com> I've ran into another problem with rehash-all... I've add a lot of rooms(around 10,000) and I went to do another @rehash-all. It's now choking on $list.compress() with running out of ticks. Here's what that code looks like: arg list; var x; // [a,a,b,b,c,c,d,d] => [a,b,c,d] // removes duplicate entries in a list return hash x in (list) to ([x, 1]).keys(); What's the best way to fix this? Is there a good way to add a refresh() to this hash? Has any possibly thought of putting some sort of refresh() in the actual source code to correct this tick errors? It's nice getting the error if you coded something wrong, but for times like this, I'm not sure where to go with it. I'm pretty much at a stopping point because all my caches were purged and can't rebuilding them with $list.compress() dieing. On top of that, when it dies on rehash-all, all commands die with it. I have to kill cold from the shell, then restart it. Any ideas or suggestions would be great. Adam __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ From bruce at cubik.org Sun Mar 2 03:36:48 2003 From: bruce at cubik.org (Bruce Mitchener) Date: Sun Mar 2 03:34:36 2003 Subject: [Coldstuff] rehash problem References: <20030302052231.75082.qmail@web12804.mail.yahoo.com> Message-ID: <3E61DEC0.6060804@cubik.org> Adam Cormany wrote: > I've ran into another problem with rehash-all... I've > add a lot of rooms(around 10,000) and I went to do > another @rehash-all. It's now choking on > $list.compress() with running out of ticks. Here's > what that code looks like: > > arg list; > var x; > > // [a,a,b,b,c,c,d,d] => [a,b,c,d] > // removes duplicate entries in a list > return hash x in (list) to ([x, 1]).keys(); > > What's the best way to fix this? Is there a good way > to add a refresh() to this hash? Has any possibly > thought of putting some sort of refresh() in the > actual source code to correct this tick errors? It's > nice getting the error if you coded something wrong, > but for times like this, I'm not sure where to go with > it. I'm pretty much at a stopping point because all my > caches were purged and can't rebuilding them with > $list.compress() dieing. On top of that, when it dies > on rehash-all, all commands die with it. I have to > kill cold from the shell, then restart it. I thought the @rehash-all thing was fixed on the Cold Dark, but I can't remember any longer. At any rate, probably the 'best' fix is to have duplicate versions of some of those methods on $list, such as $list.compress_refreshed(), $list.compress_paused() and so on, that way someone who is calling them can decide which model is best for them and their usage. Then retrofit @rehash-all to use the right versions of the code. For your example above, you'd add a refresh to the hash expression like this: return hash x in (list) to (refresh() && [x, 1]).keys(); - Bruce From acormany at yahoo.com Sun Mar 2 08:54:38 2003 From: acormany at yahoo.com (Adam Cormany) Date: Sun Mar 2 09:54:45 2003 Subject: [Coldstuff] rehash problem In-Reply-To: <3E61DEC0.6060804@cubik.org> Message-ID: <20030302165438.11302.qmail@web12808.mail.yahoo.com> Thanks, adding the refresh() corrected the problem. I knew a refresh() is in order, but wasn't sure how it would react with the function 'hash'. I received another email from another person suggesting to up the max number of ticks in the source. This brings up another question. Is there a max number that you shouldn't go over in the source or is that system/memory specific? Would it be safe to up the number? I'm running on a Redhat 7.3 system with a gig of memory so I shouldn't really have to worry about memory restrictions. Adam --- Bruce Mitchener wrote: > Adam Cormany wrote: > > I've ran into another problem with rehash-all... > I've > > add a lot of rooms(around 10,000) and I went to do > > another @rehash-all. It's now choking on > > $list.compress() with running out of ticks. Here's > > what that code looks like: > > > > arg list; > > var x; > > > > // [a,a,b,b,c,c,d,d] => [a,b,c,d] > > // removes duplicate entries in a list > > return hash x in (list) to ([x, 1]).keys(); > > > > What's the best way to fix this? Is there a good > way > > to add a refresh() to this hash? Has any possibly > > thought of putting some sort of refresh() in the > > actual source code to correct this tick errors? > It's > > nice getting the error if you coded something > wrong, > > but for times like this, I'm not sure where to go > with > > it. I'm pretty much at a stopping point because > all my > > caches were purged and can't rebuilding them with > > $list.compress() dieing. On top of that, when it > dies > > on rehash-all, all commands die with it. I have to > > kill cold from the shell, then restart it. > > I thought the @rehash-all thing was fixed on the > Cold Dark, but I can't > remember any longer. > > At any rate, probably the 'best' fix is to have > duplicate versions of > some of those methods on $list, such as > $list.compress_refreshed(), > $list.compress_paused() and so on, that way someone > who is calling them > can decide which model is best for them and their > usage. > > Then retrofit @rehash-all to use the right versions > of the code. > > For your example above, you'd add a refresh to the > hash expression like > this: > > return hash x in (list) to (refresh() && [x, > 1]).keys(); > > - Bruce > > _______________________________________________ > Cold-Coldstuff mailing list > Cold-Coldstuff@cold.org > http://web.cold.org/mailman/listinfo/cold-coldstuff __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ From bruce at cubik.org Sun Mar 2 11:53:20 2003 From: bruce at cubik.org (Bruce Mitchener) Date: Sun Mar 2 11:51:09 2003 Subject: [Coldstuff] rehash problem References: <20030302165438.11302.qmail@web12808.mail.yahoo.com> Message-ID: <3E625320.1060409@cubik.org> Adam Cormany wrote: > I received another email from another person > suggesting to up the max number of ticks in the > source. This brings up another question. Is there a > max number that you shouldn't go over in the source or > is that system/memory specific? Would it be safe to up > the number? I'm running on a Redhat 7.3 system with a > gig of memory so I shouldn't really have to worry > about memory restrictions. You shouldn't do that. Cold is cooperatively multitasking, so any illusion of responsiveness that it has depends on things being timesliced well and each task being fair. If you just up the number of ticks that each task can take, then you're increasing the latency with which any other task can respond. And to what end? Would you increase the limit every time you added enough stuff for @rehash-all to throw an error? Hopefully not! Having a responsive Cold-based application requires that you think about concurrency, what each task does and how often it calls refresh() or pause(). - Bruce From alan_wood at yahoo.com Thu Mar 6 06:39:56 2003 From: alan_wood at yahoo.com (Alan Wood) Date: Thu Mar 6 07:40:07 2003 Subject: [Coldstuff] Dictionaries & Web Issues Message-ID: <20030306143956.73219.qmail@web13804.mail.yahoo.com> Sorry, sent this to cold-coldstuff-owner, and not the list! *doh* Alan --- Alan Wood wrote: > From Alan Wood Thu Mar 6 06:38:16 2003 > Received: from [65.202.173.241] by > web13808.mail.yahoo.com via HTTP; Thu, 06 Mar 2003 > 06:38:16 PST > Date: Thu, 6 Mar 2003 06:38:16 -0800 (PST) > From: Alan Wood > Subject: Web Foobared? > To: cold-coldstuff-owner@cold.org > MIME-Version: 1.0 > Content-Type: text/plain; charset=us-ascii > Content-Length: 925 > > First off, thanks for a great driver! :) > > Here are some issues with the website: > > I tried to subscribe to this mailing list through > your > web interface, and couldn't. > > It gave me an issue with the CGI script. (Using > group > nogroup, expected nobody was the gist of it) > > In addition, your CVS web interface is foobared as > well. :( > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > As for the driver: > > We are using version 1.1 of genesis, with SmallCore > as > our base. > > When we call the kfun "bind_port" on cygwin in > Win32, > we have noticed that it "port walks". Our port is > open, but it seems that the driver is continually > opening ports and "walking" down the list of ports. > I > haven't investigated the code to the driver yet, but > was unsure if 1.1 is still a good release to use. > (Your history said it was released in 1997). > > Also, are dictionaries behaving the way they are > supposed to? > > A call to: > > dict_add(mydict, "newkey", "newval") > > doesn't result in a modification to mydict. > Instead, > the "new" dictionary is returned by the dict_add > command. > > If this is the case, how do I modify dictionaries in > place? > > I have nested dictionaries in one of my data > structures: > > dict(key, dict) > > The nesting is quite deep. Thus, rebuilding all the > parent dictionaries back to the root dictionary is > not > feasible. I'll gladly make my own wrapper object > around the dictionary if the primitive can't handle > this. > > Likewise, is there a way for me to set a variable to > one of the deeper dictionaries and use it as an > alias? > Or is a "copy" made of the dictionary during an > assignment? > > (Sorry if these are primitive questions for the > group. > I'm still learning ColdC!) > > Thanks! > > Alan > From alan_wood at yahoo.com Thu Mar 6 06:52:37 2003 From: alan_wood at yahoo.com (Alan Wood) Date: Thu Mar 6 07:52:52 2003 Subject: [Coldstuff] Dictionaries & Web Issues In-Reply-To: <20030306144447.87047.qmail@web12802.mail.yahoo.com> Message-ID: <20030306145237.64941.qmail@web13806.mail.yahoo.com> It would, but since I'm storing the dictionary inside a dictionary, it would require me to walk all the way back to the root. dict3 = #[[]] dict2 = #[["mydict2", dict3]] dict1 = #[["mydict", dict2]] dict2 = 0 dict3 = 0 Now, if I want to modify the dictionary that was in dict3, I can walk down to it this way: lastDict = dict1["mydict"]; lastDict = lastDict["mydict2"]; I want to modify lastDict and add something to it. I don't think I can without modifying the dictionaries all the way back to dict1....some of these nestings can be 20-30 dictonaries long.... Non in-place modifications are fine when you don't store dictionaries inside dictionaries. But once you do, the current dictonary is not workable. The only other thing I can think of is either: 1) Modify the driver to use in-place manipulation 2) Modify $dictionary to do in-place manipulation (Is this possible? I haven't tried to access the data directly with a data type library. I'm assuming that the library is only checked for method calls, and that I don't have actual access to the data itself.) 3) Create $my_dictionary which wraps the primitive and does in-place modification of the data. #2 is the best, since it doesn't require modifications to the driver and the changes are transparent. #3 is the 2nd best. #1 is the worst. I'd like my code to run on a non-modified ColdC driver. Hope this helps clear things up! Alan --- Adam Cormany wrote: > What I do is: > mydict = dict_add(mydict, "newkey", "newval"); > > Likeways with dict_del, etc. > Hope this helps some, > Adam > > --- Alan Wood wrote: > > > Also, are dictionaries behaving the way they are > > > supposed to? > > > [...]