761 Posted Topics
Re: I'll post this useless comment so I can listen in on the better ones. | |
Re: [ICODE]while(cAns=='y' || 'Y')[/ICODE] This says: While (cAns == 'y') || 'Y' .. which is always either [I]true[/I] or [I]'Y'[/I] .. which is always true. | |
Re: Be aware that other database engines provide this information in other ways. So far as I know, every engine gives you some way to do this programmatically; and so far as I know, every database engine has associated documentation about how to do it. | |
| |
Re: The array [ICODE][][/ICODE] has no elements. You can append to it, but you cannot insert an item at index 5 by assigning as you did. The array [ICODE]['']*6[/ICODE] has the empty string at each index from 0 through 5 inclusive. If you are trying to make a list of the … | |
Re: Google is your friend. In less than 15 seconds (search for LPCWSTR) I found this thread: [url]http://www.codeguru.com/forum/showthread.php?t=360665[/url] | |
Re: I use 'design by contract' all the time. From my perspective it is another way to spell 'test first'. It is a technique for converting requirements into code in a way that makes you think about the actual requirements ("How can I test that the requirement, or 'contract' is met?") … | |
Re: The first thing: Use (CODE) button (which inserts tags) so we can refer to line numbers and see the code more pretty. for i do echo "echo $i 1>&2" echo "cat >$i <<'End of $i'" cat $i echo "End of $i" done So: Line 1 and 2 (finished in line … | |
Re: You can use the range() function to dynamically decide how many steps to take, with starting ending and step size options. | |
Re: (30 seconds with Google): [url]http://www.pygame.org/wiki/FrequentlyAskedQuestions#Does%20Pygame%20work%20with%20Python%203?[/url] [QUOTE]Does Pygame work with Python 3? Release 1.9.0 does. Pygame from SVN builds as is with Python 3.0 and later. But Python 3 support is incomplete and still in the development stage. Not all modules have been ported. No scrap, for instance. And Numeric support … | |
Re: "'Better': No, 'different': Yes" applies to all binary comparisons between programming languages. Only when you specify 'better' [B]about what[/B] does it begin to be possible to make a useful answer. My take: C++ and the STL provide a proven, effective library of tools to get your work done, but there … | |
Re: In English, a primer is the first book you should read about a subject. Could that be what you want? | |
Re: This snippet seems much more 'C-ish' than 'C++-ish' since in C++ I would expect some code like: [CODE]class Stack { private: char[] stack_storage public: // constructor // destructor void push(item); // may throw char pop(); /* for this assignment */ bool full(); }; [/CODE] and your assignment would be to … | |
Re: Of course you can hold [icode]void *anyValue[/icode] in C and cast it as appropriate. If you need to decide on the cast at run time, then you can hold an array of [code] struct anyValue { char /* or int */ dispatchTag; void *pointerToRealStruct; }[/code] | |
Re: Interesting survey, apparently perfectly safe. Odd that the questions are in English, but the navigation is in (Finnish?). Also: There is at least one question that is probably misstated (the weighing problem does not state the kind of scale) However, no 'self selected' survey has good statistical value | |
Re: Can you be a little more specific about what you mean by 'convert to binary'? What is the expected type of the result? Or do you just care that it be in some in-memory form so you can take the next step? And: is that 74 Kbits the number of … | |
Re: First: please use the code-tags around your code Second: What is the question? | |
Re: For the last couple of years, I've been working for Mozilla, using Python. The very popular email list server Mailman is (re)written in Python. I know of many websites written in python. One of the things I like about Python is that there is a [B]lot[/B] of library code which … | |
Re: In my experience 'not likely to change' means that the required changes will appear just before product release, so it is best to be prepared. Thus, you will want a table or tables to describe the questions. [LIST] [*]One table: There are columns for id, question, ordinal_in_questionnaire and questionnaire_holding_this_question. [LIST] … | |
Re: If you do not store a timestamp with the data, then there is no way to order the output by time, and thus no way to select the most recent row. Or, I guess you don't really need a timestamp: You could use a 'cookie' that has these properties: * … | |
Re: It is perfectly feasible to have a base class pointer point to a derived class. That is the primary technique for doing object oriented programming (in a language with pointers). However it is usually done with classes that inherit public, not protected. Agree with chiwawa10: Precisely what is the compiler … | |
Re: This is C++ code, and should go in the C++ forum. To make it easier to understand, please wrap your code in [CODE] tag. You can do that by selecting your code in the editor window and pressing the '#' button. Or see what that does, and duplicate it in … | |
Re: It works perfectly on my Mac as follows: Start python run the script Stop python examine the file:[QUOTE]1133% cat newfile.csv 1,2,3 A,B,C 4,"""5""","ab,c" 1134%[/QUOTE] What you have not done is flush() or close() the open file. If you remain in the python interpreter while looking, you will not see the … | |
Re: It looks like you are using the 'port forwarding trick' (because you say 'tunnel') to get outbound SSH behavior. If true, then consider recompiling with direct ssh enabled. Don't know if that will be helpful or not. See here: [url]http://www.networkcomputing.com/servers-storage/how-to-set-up-ssh-encrypted-mysql-replication.php[/url] which says, among other things [QUOTE]Although MySQL can be compiled … | |
Re: If you need to handle arbitrarily large input files, then you need to read one line, write one line in a loop (you could, of course, read some lines, write some lines, but there is no easy api for that) If you know that the input is short enough to … | |
Re: This scheme appears to use div and mod: [iCODE]19985 div 4096 = 4 remainder 3602[/iCODE] There are a myriad other possible schemes | |
Re: Not something I know about, but I did come across this which might be useful. Note that [I]We don't provide an official windows version at this stage[/I] [url]http://www.libming.net/Ming_Installation[/url] | |
Re: The error message is clear: [ICODE]'m_pScreen' : undeclared identifier[/ICODE] tells you that you have tried to use an identifier [iCODE]m_pScreen[/iCODE] and that identifier is not declared in the scope that is in effect at line 71. Judging from the horrible Hungarian notation name, it should be a member of the … | |
Re: msybe: [url]http://effbot.org/downloads/[/url] | |
Re: Here is your code, slightly modified to work. I have passed bet in as a parameter and returned it; and renamed the function to something legal (I recommend using a better name than my choice). Note also the space after the y/n: Not necessary, but much prettier in my opinion. … | |
Re: chant [ICODE]httpd -V[/ICODE] (or if necessary, find the location of httpd executable and give the full path) | |
Re: I think after reading this post three times, that you are not asking about names, but structure. And, unfortunately, if that is what you really want to discuss, you have not given enough detail to make it possible to understand the problem. What is the purpose of your 'system'? What … | |
Re: [url]http://docs.python.org/library/stdtypes.html#truth:[/url] [QUOTE]Any object can be tested for truth value, for use in an if or while condition or as operand of the Boolean operations...[/QUOTE] | |
Re: Take a look at this API, including the example: [url]http://docs.python.org/library/socket.html[/url] You should be able easily to adapt the example to your needs since what you need is pretty straight forward. | |
Re: Tonyjv's idea works just fine, but I have a pattern I use for languages that don't offer the string.join(list) function. Here it is in Python, which doesn't need it: [code=python] def sjoin(sep, aList): ret = '' s = '' for item in aList: ret = "%s%s%s"%(ret,s,item) # or ret = … | |
Re: I've been working on a real world task similar. I arrived at something like this: [code] table customer ( id integer, contact_info varchar, /*really several fields*/ contact_flags boolean /* several (dis-)allow contact options */ /* and anything else just about customers: email?, login?, hashed password? */ ) table performance ( … | |
Re: From a function, you just return to the calling function. If you need to return all the way back to main() you have two options: 1: In every function on the way from main() to this code, you must examine the return value and if it is a 'return-to-main' value … | |
Re: first: Why shell out to the system to get pattern matching when python offers the re package? second: call it like this: [CODE] os.system("grep %s sample.txt"%variable)[/CODE] | |
I need to keep track of the status for a person who registers for an event. This is going to be part of a tool that is administered by non-programmers. Various events will have different sets of status values, and it is possible for several events with distinct or overlapping … | |
Re: x.split(':') will get you most of the way there. | |
Re: For starters, why don't you simplify your data set so it is just one thing (name string, maybe), and write a recursive sort that handles that one thing. Once you have the sort working, you can extend it a little bit to pick out a particular field from the data … | |
Re: Seems like a question more about JSP and PHP than about MySql. I use PHP on one website because of external constraints, and JSP on another because of job constraints. | |
Re: If you are trying to be sure that your database schema is well designed, I believe there is no reasonable way to test. Instead, schema design is best done by careful thought followed by a second or third set of eyeballs. There are many resources available that will help you … | |
Re: if you know you want the parent to die immediately, then use the builtin exec function: exec replaces the parent process with a process running the exec-ed command. If you want to kill the parent process only sometimes, or only later, you should probably re-think what you actually need, or … | |
Re: There is a reasonably complete discussion of this issue here: [url]http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html[/url] ... be sure to read the user comments section at the bottom where there are some carefully worked out examples, including a complete answer for this question. | |
Re: What is this 'better'? You really need to specify more completely what you need before you can decide what will work better for your particular needs. - size: Auto increment works for up to about 2*10^19 items. UUID works for up to about 10^38 items. - unique key: auto_increment guarantees … | |
Re: Projects that I've worked on or thought about that seem to be about a summer's worth: - A code pretty-printer for one or more languages - with optional format-specification files (how much indent, whether to [B]boldface[/B] variable names or language builtins, etc) - with optional output options (HTML, rich text, … |
The End.