761 Posted Topics

Member Avatar for tyson.crouch

I'll post this useless comment so I can listen in on the better ones.

Member Avatar for tyson.crouch
0
104
Member Avatar for tinanewtonart

[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.

Member Avatar for tinanewtonart
0
260
Member Avatar for vs.vaidyanathan

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.

Member Avatar for vs.vaidyanathan
0
630
Member Avatar for rahul8590
Member Avatar for oaktrees

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 …

Member Avatar for oaktrees
0
118
Member Avatar for Osas106

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]

Member Avatar for griswolf
0
111
Member Avatar for softdev

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?") …

Member Avatar for softdev
0
108
Member Avatar for rohit_static

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 …

Member Avatar for nezachem
0
193
Member Avatar for spikeru

You can use the range() function to dynamically decide how many steps to take, with starting ending and step size options.

Member Avatar for TrustyTony
0
504
Member Avatar for lewashby

(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 …

Member Avatar for griswolf
0
127
Member Avatar for dimios

"'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 …

Member Avatar for bandtank
0
221
Member Avatar for cutedipti

In English, a primer is the first book you should read about a subject. Could that be what you want?

Member Avatar for qualitybrains
0
96
Member Avatar for sahirak
Member Avatar for jimJohnson

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 …

Member Avatar for griswolf
0
150
Member Avatar for PatMcC

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]

Member Avatar for griswolf
0
104
Member Avatar for viliusz

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

Member Avatar for griswolf
0
140
Member Avatar for jmark13

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 …

Member Avatar for jmark13
0
877
Member Avatar for nageshkore
Member Avatar for griswolf
0
118
Member Avatar for redyugi
Member Avatar for docesam

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 …

Member Avatar for TrustyTony
-4
329
Member Avatar for juancruzhurtado

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] …

Member Avatar for griswolf
0
108
Member Avatar for ad1das

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: * …

Member Avatar for urtrivedi
0
97
Member Avatar for Euphan

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 …

Member Avatar for griswolf
0
170
Member Avatar for ranit

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 …

Member Avatar for griswolf
0
667
Member Avatar for oaktrees

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 …

Member Avatar for oaktrees
0
2K
Member Avatar for osoerland

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 …

Member Avatar for griswolf
0
117
Member Avatar for mysticstylez

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 …

Member Avatar for griswolf
0
3K
Member Avatar for pink_872

This scheme appears to use div and mod: [iCODE]19985 div 4096 = 4 remainder 3602[/iCODE] There are a myriad other possible schemes

Member Avatar for griswolf
0
66
Member Avatar for bunkus

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]

Member Avatar for bunkus
0
217
Member Avatar for vuyokazi
Member Avatar for new2programming

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 …

Member Avatar for griswolf
0
174
Member Avatar for kur3k
Member Avatar for Hawkeye Python

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. …

Member Avatar for lllllIllIlllI
0
95
Member Avatar for johndoe444

chant [ICODE]httpd -V[/ICODE] (or if necessary, find the location of httpd executable and give the full path)

Member Avatar for griswolf
0
266
Member Avatar for Onisutra

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 …

Member Avatar for Onisutra
0
101
Member Avatar for vandalised

[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]

Member Avatar for griswolf
1
2K
Member Avatar for thehivetyrant

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.

Member Avatar for griswolf
0
721
Member Avatar for pixeldroid

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 = …

Member Avatar for TrustyTony
0
246
Member Avatar for tomer999

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 ( …

Member Avatar for asaukani
0
263
Member Avatar for flyingcurry

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 …

Member Avatar for fabunmi adeniyi
1
3K
Member Avatar for jl487

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]

Member Avatar for TrustyTony
0
11K
Member Avatar for griswolf

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 …

Member Avatar for pritaeas
0
160
Member Avatar for dbphydb
Member Avatar for jpl1993

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 …

Member Avatar for griswolf
0
123
Member Avatar for tyson.crouch

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.

Member Avatar for griswolf
0
194
Member Avatar for cchris

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 …

Member Avatar for griswolf
0
300
Member Avatar for JhonRR

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 …

Member Avatar for griswolf
0
67
Member Avatar for Graffixnerd

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.

Member Avatar for griswolf
0
88
Member Avatar for qazplm114477

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 …

Member Avatar for griswolf
0
267
Member Avatar for ronnieaka

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, …

Member Avatar for griswolf
-1
128

The End.