Python 2.2.1 DLL extension causes "abnormal program termination"
Hello, Apologies if this has already been answered in here and I can't find it, but can anyone help with this problem? I hope the example code and comments state clearly enough what is happening, but if not, please ask me for further information. Thank in advance for any help. :-) Hugh #!/usr/bin/python # 1. DLL C++ source code # # #include # static PyObject* dummy(PyObject* self, PyObject* args) # { # return Py_None; # } # static PyMethodDef py_dll_test_methods[] = # { # { "dummy", dummy, METH_VARARGS, "dummy" }, # { 0,0,0,0 } # }; # extern "C" void _declspec(dllexport) initpy_dll_test(void) # { # (void) Py_InitModule("py_dll_test", py_dll_test_methods); # } # # 2. Build release DLL using MSVC++ version 6.0, linking with "python22.lib" # # 3. Copy DLL to "c:\python22\python\dll" directory # # 4. Python source import py_dll_test import time while 1: py_dll_test.dummy() time.sleep(0.01) # 5. Run python source # c:\>c:\Python22\python console_test.py # 6. Program runs for a while, but then crashes after 24 seconds with # abnormal program termination # Note. If I reduce the sleep time, the crash happens earlier. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python 2.2.1 DLL extension causes "abnormal program termination"
Thank you very much. -- http://mail.python.org/mailman/listinfo/python-list
add without carry
I would like to perform an addition without carrying of two integers... I've got no idea how to do this in python, although I've been using it for web/cgi/db work for a few years now. Any help would be great. Hugh -- http://mail.python.org/mailman/listinfo/python-list
Re: add without carry
Sorry, here's an example... 5+7=12 added without carrying, 5+7=2 i.e the result is always less than 10 I've been thinking some more about this and my brain is starting to work something out... I just wondered if there was a function in python math to do this automatically... Hugh -- http://mail.python.org/mailman/listinfo/python-list
Re: add without carry
Thankyou everyone this gives me something to work with. Hugh -- http://mail.python.org/mailman/listinfo/python-list
Re: add without carry
Peter, That was what I was thinking along the lines of, It's been two years since I finished my CS degree and working in mechanical engineering means I've nearly forgotten it all! :( Thanks, I'll write a function in my app to handle this... Hugh > >>> (5 + 7) % 10 > 2 > > In this context '%' is called 'modulo operator'. What John and Marc > suggested is basically the same operation for the special case of binary > numbers, i. e. > > a % b == a & (b-1) > > if a >= 0 and b == 2**N. > > Peter -- http://mail.python.org/mailman/listinfo/python-list
PyGUI - Couple of questions - TextField callbacks and drop down list....
The PyGUI website specified this place as the place for general discussion about it, so here goes First off - thanks for something that is so straightforward to get running on OSX... I've been migrating some relatively straight-forward scripts-with-GUIs from Linux to OSX, and, while I used FLTK on Linux, I could not get pyfltk to install on OSX. PyGUI was so straightforward, though. Made me a very happy bunny. Fortunately, I wrote most of the pyfltk-specific code in a helper module, so I got that transferred over to PyGUI easily enough. But there were a few things that I ran up against So... A couple of questions for you all... TextField callbacks... I want to be able to generate a callback when a textfield is modified. The text field has to only allow a very specific format in it, and in fltk, I'd just have the callback be a validation function which would either reset it to the old value or allow the current one. It doesn't appear to have an "action" member... Is there anything I can do here? Or should I maybe subclass the TextField class. Drop-down lists... There's a menu, but, apparently, no drop-down list class. For now, I've replaced it with a RadioGroup, which is okay, for now, as I know that there aren't going to be any more than 3 items, but I can see situations where I'd really rather have a drop-down list a part of the GUI, rather than in the menu at the top of the screen. Anyway, any advice on this would be much appreciated! For the kind of thing that I'm doing, it's very appreciated that there's something that's very straightforward to install. Hugh Macdonald -- http://mail.python.org/mailman/listinfo/python-list
Re: PyGUI - Couple of questions - TextField callbacks and drop down list....
On Oct 21, 2:46 am, greg <[EMAIL PROTECTED]> wrote: > Hugh wrote: > > TextField callbacks... I want to be able to generate a callback when a > > textfield is modified. It doesn't appear to have an "action" member... > > I haven't got around to adding any actions to text fields > yet. > > In the meantime, you could put a key_down method on the > containing window that catches the Return or Enter key. Thanks - I think, for now, I'll probably just go with popping up an Alert when the main window's "Launch" button is pressed... I'm a little time-constrained on this project, but I'll maybe look into getting it working more like I'm after at a later date... > > Drop-down lists... > > That's another thing for the future. If you're feeling > adventurous, you could have a go at rolling your own based > on a View. Again, time constraints mean that I'll probably stick with the radio buttons that I've got at the moment - they work quite well in this situation - my query here was more of a general thing. > Anyway, glad you're finding it useful. Feel free to ask if > you have any more questions. Thanks. Will definitely do this. It didn't take me very long at all to transition over this GUI from pyfltk to PyGUI, which is definitely a good sign...! Hugh -- http://mail.python.org/mailman/listinfo/python-list
asyncio, transports, protocols, etc.
Hello, I'm trying to get my head around asyncio, and I think I'm mostly there now, (but expect to be proved wrong :-)!). It appears to be about the newest of the PEPs according to my searches, including PEP 0, so I don't expect a huge amount of supporting documentation out there yet. Looking at: https://docs.python.org/3/library/asyncio-protocol.html#tcp-echo-server I know the page introduces the relationships between protocols, transports and the servers/clients that use them. When I read this code it took me longer than I would wish :-) to realise that the example defining the Echo server was doing this through the protocol, (yes, it says it *right there* :-)!) and not a Server class, so for some time I was puzzled about where 'transport' was being defined. Given these concepts are new on this page, at least ostensibly, would it make sense to introduce this example with something like: """ Create a TCP echo server using the loop.create_server() method, send back received data. This is done by defining the Protocol, which gets the transport from the server when it is created by asyncio. """ just to refresh the connection between the things in the mind of the reader? Also, according to my reading of RFC 862, I don't think the Echo server should be closing the connection just after echoing: """ TCP Based Echo Service One echo service is defined as a connection based application on TCP. A server listens for TCP connections on TCP port 7. Once a connection is established any data received is sent back. This continues until the calling user terminates the connection. """ I could have missed something here though. (If it is this protocol that is under discussion here, then a link might be useful, as well?) Why does this matter? Because it was not clear to me whether the closing of the connection was something that had to happen, as part of the functionality of the echo service or of asyncio itself. If I'm implementing something that does something based on the cmd or cmd2 module, interpreting commands, then having some kind of dialogue with the server matters. Writing documentation so that everyone will understand it and NOT get the wrong end of the stick is difficult. I don't know if this would make things more confusing for others, or even if it might have helped me. At the moment, I think it might be in the right direction, though. Thank you, Hugh -- -- Dr. Hugh Sasse, BSc(Hons), PhD Computer Systems Electronic Engineer School of Engineering and Sustainable Development DE MONTFORT UNIVERSITY -- https://mail.python.org/mailman/listinfo/python-list
asyncio, transports, protocols, etc.
Hello, I didn't get a response to this before, possibly because of lack of concision. I'd like to ask whether (provided I'm understanding this): https://docs.python.org/3/library/asyncio-protocol.html#tcp-echo-server could be improved by adding: """ Create a TCP echo server using the loop.create_server() method, send back received data. This is done by defining the Protocol, which gets the transport from the server when it is created by asyncio. """ before it, because these concepts have only just been introduced, and also whether the echo server should really be closing the connection, given RFC 862 seems to suggest it should stay open. Original message below. Thank you, Hugh Hello, I'm trying to get my head around asyncio, and I think I'm mostly there now, (but expect to be proved wrong :-)!). It appears to be about the newest of the PEPs according to my searches, including PEP 0, so I don't expect a huge amount of supporting documentation out there yet. Looking at: https://docs.python.org/3/library/asyncio-protocol.html#tcp-echo-server I know the page introduces the relationships between protocols, transports and the servers/clients that use them. When I read this code it took me longer than I would wish :-) to realise that the example defining the Echo server was doing this through the protocol, (yes, it says it *right there* :-)!) and not a Server class, so for some time I was puzzled about where 'transport' was being defined. Given these concepts are new on this page, at least ostensibly, would it make sense to introduce this example with something like: """ Create a TCP echo server using the loop.create_server() method, send back received data. This is done by defining the Protocol, which gets the transport from the server when it is created by asyncio. """ just to refresh the connection between the things in the mind of the reader? Also, according to my reading of RFC 862, I don't think the Echo server should be closing the connection just after echoing: """ TCP Based Echo Service One echo service is defined as a connection based application on TCP. A server listens for TCP connections on TCP port 7. Once a connection is established any data received is sent back. This continues until the calling user terminates the connection. """ I could have missed something here though. (If it is this protocol that is under discussion here, then a link might be useful, as well?) Why does this matter? Because it was not clear to me whether the closing of the connection was something that had to happen, as part of the functionality of the echo service or of asyncio itself. If I'm implementing something that does something based on the cmd or cmd2 module, interpreting commands, then having some kind of dialogue with the server matters. Writing documentation so that everyone will understand it and NOT get the wrong end of the stick is difficult. I don't know if this would make things more confusing for others, or even if it might have helped me. At the moment, I think it might be in the right direction, though. Thank you, Hugh -- -- Dr. Hugh Sasse, BSc(Hons), PhD Computer Systems Electronic Engineer School of Engineering and Sustainable Development DE MONTFORT UNIVERSITY -- https://mail.python.org/mailman/listinfo/python-list
Re: Remote/Pair-Programming in-the-cloud
I might not have followed this thread closely enough. I remembered there is a thing called Copilot. It connects two machines so that two people can work together. I've never used it, and have no connection with the company. I remember reading about it on a page written by Joel Spolsky. https://www.copilot.com/About If this is the wrong answer, it may at least help define the negative space around what you want. Hugh -- https://mail.python.org/mailman/listinfo/python-list
Re: Remote/Pair-Programming in-the-cloud
On 05/08/2019 21:28, DL Neil wrote: On 6/08/19 1:43 AM, Hugh Sasse wrote: I might not have followed this thread closely enough. I remembered there is a thing called Copilot. It connects two machines so that two people can work together. https://www.copilot.com/About If this is the wrong answer, it may at least help define the negative space around what you want. Thank you Hugh. Yes, there are a few of these Copilot-style packages. The one that seems popular in 'my circle' is called TeamViewer. We will definitely offer that as an option at Wednesday's PUG mtg, and if someone requests Copilot, or similar, I'll try to adapt. No, not "negative" by any means. Many thanks! Then you may find some of the recommendations on AlternativeTo useful. I've not explored them, but I've found useful things at this site before (for other things): https://alternativeto.net/software/copilot/ You probably know that site, but I didn't notice it come up in the discussion. If not: https://en.wikipedia.org/wiki/AlternativeTo -- Dr. Hugh Sasse, BSc(Hons), PhD Computer Systems Electronic Engineer School of Engineering and Sustainable Development DE MONTFORT UNIVERSITY -- https://mail.python.org/mailman/listinfo/python-list
Can't install Python
Hi; I've spent several hours over two days unsuccessfully trying to install Python. I am trying to install it on a desktop computer running on a Windows10 64-bit / AMD CPU platform. I have tried installing various versions. I have also tried downloading Python from other websites, aside from python.org. I have tried different sequences of steps. For example, I have tried selecting Downloads > Windows > Python 3.85 from the .org download webpage. Alternatively, I have tired specifying 'Windows x86-64 executable installer' under 'Files'. Whatever I try, whenever I click on the phyton.exe file, Python seems to install, but only ultimately displays a Modify Setup screen. I have tried the modifying and repairing options, but they all just lead to the same Modify Setup screen. A message always say to contact pyton.org if the issues continue. So, that is what I am now doing. I can't think of what else I could try. Any suggestions? Cheers, Hugh -- https://mail.python.org/mailman/listinfo/python-list
C API : Creating a Py_Method object from a C function.
I've got a pure python module that parses a certain type of file. It has a load() function that allows a callback function to be passed for getting progress information. In straight python, this works fine. However, I'm now trying to use this from a C++ program. The current flow that I'm trying to get is as follows: C++ calls python interface function, passing a C++ function pointer Python interface function stores C++ function pointer Python interface function generates new Py_Object method pointer pointing to a different C python function. (This different function calls the stored C++ function pointer) Python interface function calls python function Python function calls the python method pointer it was passed C python function then calls the stored C++ function pointer. The problem in this workflow is taking the C python function that I've defined (using the standard "static PyObject *someFunction(PyObject *self, PyObject *args)" method) and converting this into a Py_Object. Any ideas? Py_Method doesn't seem to allow you to generate a new one with your own pointers inside... and I can't see anything else in the docs that might allow me to do this... Thanks for any advice! -- Hugh Macdonald -- http://mail.python.org/mailman/listinfo/python-list
Re: C API : Creating a Py_Method object from a C function.
Thanks Martin - that worked wonderfully For the record (and for anyone searching for this in future), here's the code that worked (with names changed to protect my job...) myPython is the C++/Python interface class containing static methods which pass on calls to the underlying python module. It's not really commented, but if you're trying to do this kind of thing, it should give you what you need. // myPython.h #ifndef ___MYPYTHON_H___ #define ___MYPYTHON_H___ #include using namespace std; typedef struct _object PyObject; typedef void (*loadCallback)(string message, int progress, void *callbackData); staticPyObject *myPython_doLoadCallback(PyObject *self, PyObject *args); class myPython { public: staticlist *loadDetails(string file, loadCallback callbackFunc = NULL, void *callbackData = NULL); staticvoid doLoadCallback(string message, int progress); private: staticPyObject *getResults(char *moduleName, char *functionName, PyObject *args); staticloadCallback callbackFunc; staticvoid *callbackData; }; #endif // ___MYPYTHON_H___ // myPython.cpp #include #include loadCallbackmyPython::callbackFunc = NULL; void*myPython::callbackData = NULL; list *myPython::loadDetails(string file, loadCallback newCallbackFunc, void *newCallbackData) { PyObject *pArgs, *pResult; callbackFunc = newCallbackFunc; callbackData = newCallbackData; PyMethodDef *callbackFunctionDef = new PyMethodDef; callbackFunctionDef->ml_name = "doLoadCallback"; callbackFunctionDef->ml_meth = &myPython_doLoadCallback; callbackFunctionDef->ml_flags = 1; PyObject *pyCallbackFunc = PyCFunction_New(callbackFunctionDef, NULL); pArgs = Py_BuildValue("(sO)", file.c_str(), pyCallbackFunc); pResult = getResults("myPythonModule", "loadDetails", pArgs); if(!pResult) { Py_DECREF(pArgs); return NULL; } if(PyList_Check(pResult)) { // Convert pResult into a list and return that. } return NULL; } PyObject *myPython_doLoadCallback(PyObject *self, PyObject *args) { char *message; int progress; if(!PyArg_ParseTuple(args, "si", &message, &progress)) return NULL; myPython::doLoadCallback(message, progress); return Py_None; } void myPython::doLoadCallback(string message, int progress) { if(callbackFunc) callbackFunc(message, progress, callbackData); } -- http://mail.python.org/mailman/listinfo/python-list
Reading in external file - error checking and line numbers...
I'm writing a tool at the moment that reads in an external file (which can use any Python syntax) At the moment, I'm reading the file in using: scriptLines = open(baseRippleScript).read() exec scriptLines However, if I raise an exception in my main code, in a function that is called from the external script, the stack trace just has: File "", line 8, in ? Ideally, I'd want to be able to avoid throwing exceptions and would like to, from my main code, print out an error that included the script name (easily accessible) and the line number (less easily accessible). Is there a better way of executing an external script that would let me access at any time the line number from the external script that is being executed. More specifically, if a function is called from an external script with an invalid parameter type, I want to be able to flag it accurately to the user Hope this made sense - let me know if I've confused you at all. -- Hugh Macdonald -- http://mail.python.org/mailman/listinfo/python-list
Re: Reading in external file - error checking and line numbers...
Thankyou! That was much easier than I expected. One more thing on a similar note. When raising exceptions, is it possible to remove a few items from the top of the stack trace? My stack trace is looking something like: File "ripple", line 160, in ? File "ripple", line 94, in executeRipple File "test.rip", line 8, in ? dependsOnFrame = new) File "ripple", line 133, in __init__ File "ripple", line 148, in addDependsOnFrame __main__.RippleError: 'Cannot add frame dependency to non frame-based node' I'd like to be able to remove the last two items in the stack so that it just shows the user: File "ripple", line 160, in ? File "ripple", line 94, in executeRipple File "test.rip", line 8, in ? dependsOnFrame = new) __main__.RippleError: 'Cannot add frame dependency to non frame-based node' Unfortunately, I don't know how many 'ripple' stack items there will be... This is why I'd much rather, if I can, do this without exceptions and just be able to print out my own error message with the problem line number marked Or am I asking too much? ;) -- Hugh Macdonald -- http://mail.python.org/mailman/listinfo/python-list
Hacking the scope to pieces
We're starting to version a number of our python modules here, and I've written a small function that assists with loading the versioned modules... A module would be called something like: myModule_1_0.py In anything that uses it, though, we want to be able to refer to it simply as 'myModule', with an environment variable ("MYMODULE_VERSION" - set to "1.0") that defines the version. I've written a module called 'moduleLoader' with the follwing function in: def loadModule(module, version, v = globals()): import compiler loadStr = "import %s_%s as %s" % (module, version.replace(".", "_"), module) eval(compiler.compile(loadStr, "/tmp/%s_%s_errors.txt" % (module, version.replace(".", "_")), "single")) v[module] = vars()[module] The ideal situation with this would be to be able, in whatever script, to have: import moduleLoader moduleLoader.loadModule("myModule", os.getenv("MODULE_VERSION")) However, this doesn't work. The two options that do work are: import moduleLoader moduleLoader.loadModule("myModule", os.getenv("MODULE_VERSION"), globals()) import moduleLoader moduleLoader.loadModule("myModule", os.getenv("MODULE_VERSION")) from moduleLoader import myModule What I'm after is a way of moduleLoader.loadModule working back up the scope and placing the imported module in the main global scope. Any idea how to do this? -- Hugh Macdonald -- http://mail.python.org/mailman/listinfo/python-list
Re: Hacking the scope to pieces
I will take a look! Thanks Skip -- Hugh -- http://mail.python.org/mailman/listinfo/python-list
Re: Hacking the scope to pieces
Maybe I misunderstood what you meant, but I couldn't quite manage to get this one working My initial hopes about __import__() were that I could define it inside my new module (moduleLoader) and, when the module is imported, it could do stuff (like try to hold onto the vars() and globals() from the importing scope). However, I couldn't get it to import... The route I've ended up going (which is just about as simple) is just to return the new module from moduleLoader.loadModule, so my loading code is: import moduleLoader myModule = moduleLoader.loadModule("myModule", os.getenv("MODULE_VERSION")) I've also switched over to using 'inp' for this, rather than creating a compiler string - much nicer Anyway, thanks Skip -- Hugh -- http://mail.python.org/mailman/listinfo/python-list
Horace Lives!
http://horace-vitreouschina.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: palindrome function
> Basically, it reverses the list in place, so it modifies the list which > called it. It does not return a /new/ list which is a reversed version of > the original, as you expected it to. Since it doesn't return anything > explicitly, Python makes it return None. Hence, the comparison you are doing > is between the original list and a None, which is False, naturally. > Try this: > > spam = ['a', 'n', 'n', 'a'] > eggs = spam[:] > if spam.reverse() == eggs: > print "Palindrome" > > Um, wouldn't this suffer the same problem- spam.reverse() would return None, so None==eggs test would return false? I think you meant to say: spam = ['a', 'n', 'n', 'a'] eggs = spam[:] spam.reverse() if spam == eggs: print "Palindrome" -Hugh > -- > Denis Kasak > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list
Pythong CGI scrips on Windows Server 2003
We are moving to a new server running Windows Server 2003 from existing servers runing Windows Server 2002 and IIS is giving us fits. Apparently, the IUSR_* accounts are now used to run scripts and they are not by default given the necessary rights. We gave this account the necessary rights "Adjust memory quotas for a process" and "replace a process level token", and that didn't help. So we used the adsutil IIS admin script to set CreateProcessAsUser to false. Now PERL SCRIPTS WORK, but Python scripts still do not. Does anyone have any idea what to look for next? Anyone seen this before? Hugh -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythong CGI scrips on Windows Server 2003
Tim Roberts <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hugh Beyer <[EMAIL PROTECTED]> wrote: >> >>We are moving to a new server running Windows Server 2003 from existing >>servers runing Windows Server 2002 and IIS is giving us fits. > > Do you mean Windows 2000 Server? > > My experience with IIS has been universally bad. In each and every > case, I found it much more productive to disable IIS and install the > Win32 version of Apache. Yes, I mean Windows 2000 server. Python (and other CGI languages) ran on it without a problem. Perl fruns fine on the new server; Python doesn't. Hugh -- http://mail.python.org/mailman/listinfo/python-list
Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?
On Aug 18, 6:23 pm, Standish P wrote: > On Aug 17, 6:38 pm, John Passaniti wrote: > > > You asked if Forth "borrowed" lists from Lisp. It did not. In Lisp, > > lists are constructed with pair of pointers called a "cons cell". > > That is the most primitive component that makes up a list. Forth has > > no such thing; in Forth, the dictionary (which is traditionally, but > > not necessarily a list) is a data structure that links to the previous > > word with a pointer. > > Would you show me a picture, ascii art or whatever for Forth ? I know > what lisp lists look like so I dont need that for comparison. Forth > must have a convention and a standard or preferred practice for its > dicts. However, let me tell you that in postscript the dictionaries > can be nested inside other dictionaries and any such hiearchical > structure is a nested associative list, which is what linked list, > nested dictionaries, nested tables are. You can see an example of lists in my novice package (in the list.4th file): http://www.forth.org/novice.html Also in there is symtab, which is a data structure intended to be used for symbol tables (dictionaries). Almost nobody uses linked lists for the dictionary anymore (the FIG compilers of the 1970s did, but they are obsolete). I must say, I've read through this entire thread and I didn't understand *anything* that *anybody* was saying (especially the OP). I really recommend that people spend a lot more time writing code, and a lot less time with all of this pseudo-intellectual nonsense. This whole thread (and most of what I see on C.L.F. these days) reminds me of the "dialectic method" of the early Middle Ages --- a lot of talk and no substance. Write some programs! Are we not programmers? -- http://mail.python.org/mailman/listinfo/python-list
Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?
On Aug 18, 6:13 pm, Standish P wrote: > > Mostly it had a "snowball's chance" because it was never picked up by > > the CS gurus who, AFAIK, never really took a serious look at it. > > Its quite possible that the criticism is unfair, but dont you think > that in part some responsibility must be borne by your organization in > not doing a good job of education ? > ... > She is quite humble. Take a look at this page, > > http://www.forth.com/resources/evolution/index.html That is actually pretty humorous; she managed to describe herself as a "leading expert" twice in a single short paragraph. LOL See! I do have a sense of humor! http://groups.google.com/group/comp.lang.forth/browse_thread/thread/4c4dba9135bcf03e/8086ee13095bf78c -- http://mail.python.org/mailman/listinfo/python-list
Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?
On Aug 21, 5:29 am, Alex McDonald wrote: > On 21 Aug, 06:42, Standish P wrote: > > Admittedly, I am asking a question that would be thought > > provoking to those who claim to be "experts" but these experts are > > actually very stingy and mean business people, most certainly worse > > than Bill Gates, only it did not occur to them his ideas and at the > > right time. > > What surprises may is that anyone bothered to answer, as your question > was neither "thought provoking" nor in need of attention from an > expert. Their generosity in the face of so much stupidity stands out > as remarkable. I wouldn't call the OP "stupid," which is just mean-spirited. That is not much of a welcome wagon for somebody who might learn Forth eventually and join our rather diminished ranks. Lets go with "over- educated" instead! I thought that his question was vague. It seemed like the kind of question that students pose to their professor in class to impress him with their thoughtfulness, so that he'll forget that they never did get any of their homework-assignment programs to actually work. I yet maintain that writing programs is what programming is all about. I see a lot of pseudo-intellectual blather on comp.lang.forth. The following is a pretty good example, in which Alex mixes big pseudo- intellectual words such as "scintilla" with gutter language such as "turd" in an ungrammatical mish-mash --- and defends the overuse of the return stack for holding temporary data as being readable(?!): http://groups.google.com/group/comp.lang.forth/browse_thread/thread/4b9f67406c6852dd/0218831f02564410 On Jul 23, 4:43 pm, Alex McDonald wrote: > Whereas yours contained several tens, and nearly every one of them is > wrong. Hugh, do you actually have any evidence -- even a scintilla -- > that supports this log winded opinions-as-fact post? Take any of the > statements you make, and demonstrate that you can justify it. > Reminding us that you said it before doesn't count. > > Start with this turd of an assertion and see if you can polish it; > "Most of the time, when Forth code gets really ugly, it is because of > an overuse of >R...R> --- that is a big reason why people use GCC > rather than Forth." -- http://mail.python.org/mailman/listinfo/python-list
Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?
On Aug 21, 12:32 pm, Alex McDonald wrote: > "Scintilla" gets about 2,080,000 results on google; "blather" gets > about 876,000 results. O Hugh, you pseudo-intellectual you! > > > with gutter language such as > > "turd" > > About 5,910,000 results. It has a long history, even getting a mention > in the Wyclif's 13th century bible. You looked up "blather" and "turd" on google *AND* you are not a pseudo-intellectual??? That is funny! I don't consider myself to be a pseudo-intellectual. I don't have any education however, so a pseudo-intellectual is the only kind of intellectual that I could be. -- http://mail.python.org/mailman/listinfo/python-list
Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?
On Aug 22, 3:40 pm, 1001nuits <1001nu...@gmail.com> wrote: > Another thing you learn in studying in University is the fact that you can > be wrong, which is quite difficult to accept for self taught people. Yet another thing you learn in studying in University, is the art of apple polishing! LOL If a person has graduated from college, it is not clear what if anything he has learned of a technical nature --- but it can be assumed that he has learned to be a head-bobber (someone who habitually bobs his head up and down in agreement when the boss is speaking) and has learned to readily admit to being wrong when pressured (when the boss looks at him without smiling for more than two seconds). These are the traits that bosses want in an employee --- that prove the employee to be "trainable." BTW, has anybody actually looked at my software? http://www.forth.org/novice.html All this pseudo-intellectual nonsense (including this post) is getting boring. Why don't we try discussing software for a while? I wrote that slide-rule program as a showcase of Forth. I've been thinking of porting it over to another language, possibly C. Maybe one of you C experts could write the C program though, as a comparison --- to show how much better C is than Forth. You can demonstrate that my code was badly written and strangely designed --- with a concrete example, rather than just a lot hand-waving and chest-thumping. -- http://mail.python.org/mailman/listinfo/python-list
Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?
On Aug 21, 12:18 pm, ehr...@dk3uz.ampr.org (Edmund H. Ramm) wrote: > In <2d59bfaa-2aa5-4396-bd03-22200df8c...@x21g2000yqa.googlegroups.com> Hugh > Aguilar writes: > > > [...] > > I really recommend that people spend a lot more time writing code, > > and a lot less time with all of this pseudo-intellectual nonsense. > > [...] > > I energetically second that! > -- > e-mail: dk3uz AT arrl DOT net | AMPRNET: dk...@db0hht.ampr.org > If replying to a Usenet article, please use above e-mail address. > Linux/m68k, the best U**x ever to hit an Atari! What open-source code have you posted publicly? BTW, why did you request that your post not be archived, and be removed in a few days? That doesn't seem very energetic. Also, now that I've responded to it, it will be archived forever. It is so rare that anybody agrees with me, I wanted to make a permanent record. :-) -- http://mail.python.org/mailman/listinfo/python-list
Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?
On Aug 22, 11:12 am, John Bokma wrote: > And my > experience is that a formal study in CS can't compare to home study > unless you're really good and have the time and drive to read formal > books written on CS. And my experience is that most self-educaters don't > have that time. I've read a lot of graduate-level CS books. I think most self-educated programmers have read more of these books than have 4-year degree students who were not required to in order to get their Bachelors degree and who were too busy during college to read anything that wasn't required. > On the other hand: some people I knew during my studies had no problem > at all with introducing countless memory leaks in small programs (and > turning off compiler warnings, because it gave so much noise...) I do this all the time. My slide-rule program, for example, has beau- coup memory leaks. When I have time to mess with the program I clean up these memory leaks, but it is not a big deal. The program just runs, generates the gcode and PostScript, and then it is done. I don't really worry about memory leaks except with programs that are run continuously and have a user-interface, because they can eventually run out of memory. The real problem here is that C, Forth and C++ lack automatic garbage collection. If I have a program in which I have to worry about memory leaks (as described above), I would be better off to ignore C, Forth and C++ and just use a language that supports garbage collection. Why should I waste my time carefully freeing up heap space? I will very likely not find everything but yet have a few memory leaks anyway. -- http://mail.python.org/mailman/listinfo/python-list
Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?
On Aug 24, 9:24 am, David Kastrup wrote: > Anybody worth his salt in his profession has a trail of broken things in > his history. When I was employed as a Forth programmer, I worked for two brothers. The younger one told me a funny story about when he was 13 or 14 years old. He bought a radio at a garage sale. The radio worked perfectly, except that it had no case. He was mighty proud of his radio and was admiring it, but he noticed that the tubes were dusty. That wouldn't do! Such a wonderful radio ought to look as good as it sounds! So he removed the tubes and cleaned them all off with a soft cloth. At this time it occurred to him that maybe he should have kept track of which sockets the tubes had come out of. He put the tubes back in so that they looked correct, but he couldn't be sure. Fortunately, his older brother who was in high school knew *everything* about electronics, or at least, that is what he claimed. So the boy gets his big brother and asks him. The brother says: "There is one way to know for sure if the tubes are in correctly or not --- plug the radio in." He plugs in the radio; it makes a crackling noise and begins to smoke. The boy desperately yanks the cord, but it is too late; his wonderful radio is toast. The older brother says: "Now you know!" -- http://mail.python.org/mailman/listinfo/python-list
Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?
On Aug 24, 4:17 pm, Richard Owlett wrote: > Hugh Aguilar wrote: > > [SNIP ;] > > > The real problem here is that C, Forth and C++ lack automatic garbage > > collection. If I have a program in which I have to worry about memory > > leaks (as described above), I would be better off to ignore C, Forth > > and C++ and just use a language that supports garbage collection. Why > > should I waste my time carefully freeing up heap space? I will very > > likely not find everything but yet have a few memory leaks anyway. > > IOW Hugh has surpassed GIGO to achieve AGG - > *A*utomatic*G*arbage*G*eneration ;) The C programmers reading this are likely wondering why I'm being attacked. The reason is that Elizabeth Rather has made it clear to everybody that this is what she wants: http://groups.google.com/group/comp.lang.forth/browse_thread/thread/c37b473ec4da66f1 Every Forth programmer who aspires to get a job at Forth Inc. is obliged to attack me. Attacking my software that I posted on the FIG site is preferred, but personal attacks work too. It is a loyalty test. -- http://mail.python.org/mailman/listinfo/python-list
Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?
On Aug 24, 5:16 pm, Paul Rubin wrote: > Anyway, as someone else once said, studying a subject like CS isn't done > by reading. It's done by writing out answers to problem after problem. > Unless you've been doing that, you haven't been studying. What about using what I learned to write programs that work? Does that count for anything? If I don't have a professor to pat me on the back, will my programs stop working? That sounds more like magic than technology. -- http://mail.python.org/mailman/listinfo/python-list
Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?
On Aug 21, 10:57 pm, Steven D'Aprano wrote: > Anyway, I'm looking forward to hear why overuse of the return stack is a > big reason why people use GCC rather than Forth. (Why GCC? What about > other C compilers?) Me, in my ignorance, I thought it was because C was > invented and popularised by the same universities which went on to teach > it to millions of programmers, and is firmly in the poplar and familiar > Algol family of languages, while Forth barely made any impression on > those universities, and looks like line-noise and reads like Yoda. (And > I'm saying that as somebody who *likes* Forth and wishes he had more use > for it.) In my experience, the average C programmer wouldn't recognise a > return stack if it poked him in the eye. "The Empire Strikes Back" was a popular movie. I read an article ("The puppet like, I do not") criticizing the movie though. At one point, Luke asked why something was true that Yoda had told him, and Yoda replied: "There is no why!" The general idea is that the sudent (Luke) was supposed to blindly accept what the professor (Yoda) tells him. If he asks "why?," he gets yelled at. This is also the attitude that I find among college graduates. They just believe what their professors told them in college, and there is no why. This is essentially the argument being made above --- that C is taught in college and Forth is not, therefore C is good and Forth is bad --- THERE IS NO WHY! People who promote "idiomatic" programming are essentially trying to be Yoda. They want to criticize people even when those people's programs work. They are just faking up their own expertise --- many of them have never actually written a program that works themselves. The reason why I like programming is because there is an inherent anti- bullshit mechanism in programming. Your program either works or it doesn't. If your program doesn't work, then it doesn't matter if it is idiomatic, if you have a college degree, etc., etc.. That is the way I see it, anyway. This perspective doesn't hold for much on comp.lang.forth where we have people endlessly spouting blather *about* programming, without actually doing any programming themselves. This is why I don't take c.l.f. very seriously; people attack me all of the time and I don't really care --- I know that my programs work, which is what matters in the real world. (Pardon my use of the word "bullshit" above; there is no better term available.) -- http://mail.python.org/mailman/listinfo/python-list