761 Posted Topics

Member Avatar for darkdai

Where you have a printf (except as a prompt), use fprintf. You will also need to open the file for writing and be sure to close it after you are done. Google got me to this URL in under 15 seconds [url]http://hackerslife.blogspot.com/2005/01/write-to-file-in-c.html[/url]

Member Avatar for Aia
0
152
Member Avatar for Babatuda
Member Avatar for Yathini

Apparently that isn't available yet in MySql, though there is a bug about it: [url]http://bugs.mysql.com/bug.php?id=27793[/url]

Member Avatar for rajarajan2017
0
162
Member Avatar for SHARKASI
Member Avatar for alakaboom1

I suspect you are dealing with a timing issue, where you have modules levelOne and levelTwo that each import common. After that, levelOne changes the value, but levelTwo has already got its own copy, so it doesn't see the change. If this is the problem, then the simplest solution is …

Member Avatar for TrustyTony
0
137
Member Avatar for loveforfire33

That sounds about right to me. If the program is data centered (as is probable in this environment), start with the data design, normalize the schema, and see how that affects your UML layout. Or vice versa if the program is calculation centered. Most web services deal with an MVC …

Member Avatar for griswolf
0
272
Member Avatar for z3r0acidk

You probably don't want charAt(). If you want to extend yourself, think about doing a regular expression that matches three words, the middle one "hello" and with sub-matches for the word before and the word after. That would be maybe three lines (for that part). Start here: [url]http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/package-summary.html[/url] ... and …

Member Avatar for z3r0acidk
0
152
Member Avatar for lsmurfl

If you go with the random number as a day in the year, then you can use datetime.datetime.strptime(str(number),"%j") to generate an actual date (in year 1900). The range of day number strings is "1" through "366" (though if you want to deal with leap years, you need to specify a …

Member Avatar for griswolf
0
256
Member Avatar for wes_solar

I learned most of this stuff by asking questions of an expert, so don't have much experience with tutorials online. Google gives some help, of course: [LIST] [*]This one starts very far back (flat file storage), but seems to cover the bases pretty well: [url]http://www.tekstenuitleg.net/en/articles/software/database-design-tutorial/intro.html[/url] [*][url]http://www.databaseanswers.org/tutorial4_db_schema/index.htm[/url] (slide show and or …

Member Avatar for griswolf
0
333
Member Avatar for gmunk

Well, you know that sum(each visited node) == node(3,3), so you can work the problem backward: There are two legal cells adjacent to (3,3): (3,2) and (2,3). The sum just prior to reaching those cells would have to be (3,3) - (that cell). And so forth backward. You can prune …

Member Avatar for gmunk
0
94
Member Avatar for blackmagic01021

I don't know zlib, but most compression algorithms have these properties: [LIST] [*]There is a 'lookup table' overhead, so for files that are quite short, a 'compressed file' may be longer than the raw file. The lookup table can be considered constant size (for long enough files), so other things …

Member Avatar for jwenting
0
175
Member Avatar for yuvaraj.ragupat

The main thing is that if you want to call a function directly you have to know how to spell its name at the time when you write the code. To call a function via a pointer to it, your code can just dereference the pointer and call the result: …

Member Avatar for griswolf
0
999
Member Avatar for Syphilis

It is always good to read the docs: [url]http://docs.python.org/library/internet.html[/url]

Member Avatar for SoulMazer
0
100
Member Avatar for mahak bisht

Talk to your mentor/team leader at IRDE. Tbey will either have something they want done, or at least some ideas about what is good or not so good to spend your time on.

Member Avatar for griswolf
-1
45
Member Avatar for sreejithbabu

You might want to think about some other things than just the course work and the kind of work itself. For instance: Some companies, and particularly if you work in the internal IT department, the job will be a lot of very urgent (probably small) problems that need to be …

Member Avatar for griswolf
1
602
Member Avatar for wade2462
Member Avatar for wade2462
0
342
Member Avatar for tyson.crouch
Member Avatar for Tullulah
Member Avatar for vinsbg

Also: please provide the exact input and output. As far as I can see (quickly, not carefully) there is no possible 'No added students' output.

Member Avatar for vinsbg
0
123
Member Avatar for niconico96

[CODE]# put it at the end cat tomove.html >> toreceive # note >>, not >[/CODE] There are a variety of ways to put it at a particular spot in the file. You will need a temporary file to hold either the original torecieve or the new one. Lets assume you …

Member Avatar for niconico96
0
158
Member Avatar for Ole Raptor

You appear to be translating from (postgresql?) where type text is the best option. In MySQL, varchar(size) is a better choice if possible. However, it does work, so I have not changed it. The syntax issue is the single quotes. If you want to quote table or column names, you …

Member Avatar for griswolf
0
957
Member Avatar for mesuge6666

What you show isn't python, I think. I think you should start with a hello world python program, in a text file, then extend it one step at a time until you get where you need to go. Working in the python line editing environment is fine for a quick …

Member Avatar for griswolf
0
121
Member Avatar for emmas4impact

I recommend that you use some paper or a text editor to lay out some idea of how the program should flow, ignoring coding details. After you are happy that you see how the program will flow, then start filling in code, starting with whatever part makes most sense to …

Member Avatar for abhimanipal
0
119
Member Avatar for lionaneesh

The % operator is modulo: Remainder after dividing the first operand by the second. The comments are actually helpful.

Member Avatar for WaltP
0
214
Member Avatar for epicasian

In lieu of caffeine: What change did you make to the code between compiles. Go back to the previous one and work [B]very slowly[/B] toward the next one. When the compiler doesn't return it is sometimes just working very slowly through some kind of template instantiation, and by the time …

Member Avatar for epicasian
0
142
Member Avatar for epicasian

what you need is a collection of animation coordinate arrays. The STL is your friend here: Do you want to always iterate through all the sprites? Then use a vector. Do you want to look up sprites by name? Use a map. Each Player instance then has one collection of …

Member Avatar for mrnutty
0
137
Member Avatar for oaktrees

[CODE]import datetime now = datetime.datetime.now() suffix = now.strftime("%Y%m%d_%M%S) result = open('Results%s.csv'%suffix,'wb')[/CODE]

Member Avatar for oaktrees
0
111
Member Avatar for ayesha789

As a general rule, it is better to have the database engine do as much work as possible. The engine will be able to make use of internals, hidden optimizations, etc; and you will avoid the overhead of transmitting partial results across the network to and from the db server. …

Member Avatar for griswolf
0
64
Member Avatar for ivh90

[url]http://code.google.com/apis/maps/documentation/places/[/url] : [QUOTE]Query limits for the Google Places API will be set closer to launch and may be specific to each application depending on the use case and traffic estimates [COLOR="Red"] Note:[/COLOR] the Places API may only be used in conjunction with displaying results on a Google map; using Place …

Member Avatar for griswolf
0
97
Member Avatar for sarosh

If you invoke the python interpreter from the command line, like this: [ICODE]python[/ICODE] and then type in the small program, then "no" you exit the interpreter with a control key (unix and unix-like shells, it is Ctrl-D, don't know in Windows) If, on the other hand, you put your program …

Member Avatar for vegaseat
0
128
Member Avatar for shwick

Very quickly, here's code that works for the first sentence. The others are parallel. Note that I had to fall out of regex just a little bit in order to filter out the short words. [CODE]#!/usr/bin/python import re s0 = r"You would stomp (?P<mob>(\S+\s)+)into the ground." r0 = re.compile(s0) test0 …

Member Avatar for TrustyTony
0
110
Member Avatar for blazahjazz

All recursion is basically the same: Solve a big problem by splitting it into smaller problems that you solve by splitting them into smaller problems that... eventually are so small that you just do the work and return. To make it a recursive problem, the method for solving each sub …

Member Avatar for griswolf
0
157
Member Avatar for jimJohnson

Best solution: Create some BSTs, calculate their correct height by careful thought, test that your method gives you the expected answer. Just looking at it, I'd say your code gives you the right answer, but it works hard to do so. You might consider whether there is a way to …

Member Avatar for griswolf
0
98
Member Avatar for TheUbuntu

You are looking for [B]sprites[/B] ... Here's one url: [url]http://css-tricks.com/css-sprites/[/url]

Member Avatar for abeltenny0210
0
94
Member Avatar for aaronmk2
Member Avatar for arshad115
0
133
Member Avatar for Alerwiali

You should read the 'Read me first" thread before you post here. [http://www.daniweb.com/forums/thread78060.html](http://www.daniweb.com/forums/thread78060.html) In particular, it is much easier for us to read your code if you use the CODE-tags as described in that thread.

Member Avatar for abhimanipal
-1
166
Member Avatar for SenTnel

So we have two tables that look like [CODE=sql] create some_table ( id integer not null primary key, areas_sub_local_obj integer /* etc */ ) [/CODE] where [ICODE]areas_sub_local_obj[/ICODE] is a reference to some other row in the same table. Is that right? And the merge needs to maintain the reference relationship. …

Member Avatar for SenTnel
0
142
Member Avatar for zilch

Usually, you would use either of [ICODE]'' or ""[/ICODE] (adjacent quotation marks) to show an empty trailing field. The other option is to pick a 'never otherwise used' marker and use it whenever a NULL is needed

Member Avatar for griswolf
0
90
Member Avatar for supidProgrammer

If you want to know whether one chunk of code or another is faster you need to actually run the tests. Repeatedly and on your platform. If you do it with profiling on, you will also find out what the hot spots are so that you can optimize as needed. …

Member Avatar for supidProgrammer
0
199
Member Avatar for dbphydb

Do you need to interact with the user after the code is running, or do you want to accept the specification on the command line? Interactive: Use [ICODE]user_answer = raw_input(prompt)[/ICODE] Command line: use [ICODE]sys.argv[/ICODE] beware that argv[0] is the name of the python script, at least on unix-like OSs

Member Avatar for dbphydb
0
163
Member Avatar for TGeorge824

There is [B]no[/B] job I've ever heard of that is all skittles and beer. Doing programming for a living involves things that are at least occasionally unpleasant. For instance, you will, from time to time [LIST] [*]find yourself dealing with ignorant people who control your time [*]have deadlines that are …

Member Avatar for jwenting
0
123
Member Avatar for nramya82

The specification of the line count is ambiguous: Does a # line increase the line count but not the character count, or is it skipped entirely. Gribouillis' code ignores the line count, but you need to deal with it one way or the other.

Member Avatar for TrustyTony
0
113
Member Avatar for aqidis

It looks to me as if you find the first match, but then don't look for the overlap correctly. You should actually have a state machine like this (you don't have to call it that, of course) state 0: looking for the first place it can match : string1[k] == …

Member Avatar for griswolf
0
538
Member Avatar for ijah

For how many cases within an empty domain is any predicate true? The answer is of course zero. So depending on the quantifier of the predicate, you can predict the behavior.

Member Avatar for griswolf
0
55
Member Avatar for funfullson

There really are good reasons to prefer one language or another [B]for a particular task[/B]. There is no good way to make a general decision about what language is 'better' than another without more specification. This (I think it is silly) discussion seems to be a theme for the last …

Member Avatar for jcao219
0
266
Member Avatar for Charls Frdinand

This is a great opportunity to refactor the tables so that a student is a person and some things about being a student; a teacher is a person and some things about being a teacher. Then the select is done on the person table and your problem disappears. like: [CODE=sql] …

Member Avatar for Charls Frdinand
0
238
Member Avatar for bjoernh

line 10 should be [ICODE][B]print[/B] search, 'found at index', index[/ICODE] With that change, works for me P.S. Tabs in python files are seen as a newbie mistake. Indents are usually 2 or 3 spaces

Member Avatar for griswolf
0
543
Member Avatar for aaronmk2

I think maybe Que::add is the problem: Which 'front' is the internal one? Which order should you do things in? Debugging technique: in PrintHelper, cout << 'END'<<endl if you get a null temp.

Member Avatar for griswolf
0
97
Member Avatar for lewashby

pygame 1.9 [B]compiles[/B] with Python 3, but it doesn't [B]run[/B], if I understand what they are saying. At the pygame site, there is also pgreloaded which is a rewrite of pygame. Only alpha quality, they say, but it does work with Python 3.1. [url]http://pygame.org/wiki/pgreloaded[/url] These are all things that you …

Member Avatar for griswolf
0
350
Member Avatar for neti1987

[url]http://dev.mysql.com/doc/refman/5.0/en/string-functions.html[/url] should give you some ideas

Member Avatar for neti1987
0
244

The End.