761 Posted Topics

Member Avatar for Guest51

Why bubble sort? Why not use the Arrays utilities? [url]http://download.oracle.com/docs/cd/E17476_01/javase/1.4.2/docs/api/index.html[/url] ... [url]http://leepoint.net/notes-java/data/arrays/70sorting.html[/url]

Member Avatar for griswolf
0
179
Member Avatar for itisgood

[QUOTE]Oh and there's no actual calculations. I have to use those numbers to form some coding...[/QUOTE]A program with no actual calculations is pretty uninteresting. For instance:[CODE]int main(void) { std::cout << "The answer is 42!\n"; return 0; }[/CODE] I suspect you are having a little trouble with English as well as …

Member Avatar for itisgood
0
105
Member Avatar for hramos

I really think there should be a class in "How to Search the Web" that is a prerequisite for just about anything. Look at this. First hit from my use of Google (singleton pattern PHP) [url]http://www.talkphp.com/advanced-php-programming/1304-how-use-singleton-design-pattern.html[/url]

Member Avatar for griswolf
0
95
Member Avatar for intills

Please wrap your code with appropiate code tags: `your code here` tags so we can see keyword highlighting, line numbers and indentation. What you want to do is look for the first non-whitespace character after a whitespace, and capitalize that. Tod do it, you need code like /* ... */ …

Member Avatar for mrnutty
0
255
Member Avatar for Simes

at line 64, I suspect you want[CODE]self.y -= amount if self.y < gridMin: self.y = gridMin[/CODE] and similar things in the other blocks. I had to make up gridMin. If I were doing this, I might have a tank constructed on a grid (the grid instance in Tank's constructor) and …

Member Avatar for Simes
0
204
Member Avatar for ds2r

yes. You want the string funcctions: [url]http://dev.mysql.com/doc/refman/5.0/en/string-functions.html[/url] . You may need to deal with the substring stuff or, and the regular expression stuff, depending on exactly what you need and what data you have.

Member Avatar for ds2r
0
92
Member Avatar for Dzero

Three things to do immediately: 1. Use code-tags as described in the 'readme first' threads 2. Remove about 75% of the code from your post, leaving enough to show the problem 3. Be quite specific about what the problem(s) is/are: Cut and paste the error messages. And a forth thing …

Member Avatar for NormR1
0
221
Member Avatar for sonja19

1) You should use the code-tags as required by DaniWeb policy. If you do (and assuming I indented as your code was indented orginally), it would look like this. Much nicer, yes? timestamp=`date +"%Y%m%d.%H%M" # Archive File echo "Archiving $File." mv $FullPath/$FileName $ArchDir/${FileName}.${timestamp} RetCode=$? if [ $RetCode -ne 0 ] …

Member Avatar for griswolf
0
180
Member Avatar for prashanth s j

Well, the first thing is that [URL="http://dirtsimple.org/2004/12/python-is-not-java.html"]"XML is not the answer"[/URL]. If you need to allow people to edit the file by hand; or if you are supporting an existing system, then maybe. Otherwise, I strongly suggest you use something else (pickle file? Python format config file?, simple ini type …

Member Avatar for jcao219
0
143
Member Avatar for keval_hack

There are several. Among others: "Never trust user input". (You have to handle it of course, but you need to sanitize it before you let it loose in the system). For instance, instead of saying [ICODE]"update mytable set user_item = $form_3"[/ICODE], make sure that $form_3 is quoted correctly to avoid …

Member Avatar for metalix
0
516
Member Avatar for baddawg12

where is the seg fault happening? Can you step into your code in a debugger or instrument the code (with printf calls) to see where it fails?

Member Avatar for baddawg12
0
177
Member Avatar for tucanoj

Mmm. I think you are working too hard at this. I used to do the same thing until one day, after reading again about recursion I went to bed in an iterative world and woke the next day in a recursive one. Once this happens, you don't [B]need[/B] to think …

Member Avatar for tucanoj
0
127
Member Avatar for Brian Perrigan

The erase function is removing the char at the Nth location, which puts the N+1-th char in the Nth location, then the code increments the index to look at the [B]next[/B]char, skipping the one that just got moved. If I were doing it along the lines you are starting with, …

Member Avatar for griswolf
0
492
Member Avatar for cotrac

Is this a database problem? In PHP, I might have an array of link keys whose values are each a two-part array whose keys are the values stored in the havechildren field of the database table. This gives me some nice features: [LIST] [*]The array of links can be edited …

Member Avatar for cotrac
0
60
Member Avatar for phaedrusGhost

Added note: You may not want to keep both the state name and the state abbreviation in the `cities` table since there is a one to one relationship between them. If you actually need both, perhaps `cities` should have a foreign key into a `states` table that holds 51 or …

Member Avatar for griswolf
0
132
Member Avatar for idb_study

What part of ancient dragon's comment do you find objectionable? There is no legal `void main()` declaration in C. In fact, as a.d. says there are only two possible legal` main` declarations, both returning `int`. [http://c-faq.com/ansi/maindecl.html](http://c-faq.com/ansi/maindecl.html) Or are you complaining about the mention of the fact that you attempt to …

Member Avatar for mitrmkar
0
305
Member Avatar for ctayn

Note: Zemeus is using Python 3, but you appear to be using Python 2.x. I would avoid the menu myself, for this exercise, instead I'd use two nested loops[CODE]more_students = True while more_students: more_score = True: grade_total_for_student = 0.0 test_count_for_student = 0 while more_score: score = int(raw_input('Please enter the next …

Member Avatar for nounlu
0
121
Member Avatar for Member 784878

What is the format of the (linux?) version of the liquibase.properties file? Can you specify it or is it already in some format? What is the actual goal here: Do you want to let the user log in to the database from the command line? Do you want to use …

Member Avatar for griswolf
0
147
Member Avatar for mtliendo

The result of raw_input is a string, not an integer, so the + operator on the two strings (+ is concatenate for strings) correctly gives you "23" from "2" + "3" If you want an integer, you can cast it: [ICODE]x = int(raw_input("Give me the first number: ")[/ICODE] and so …

Member Avatar for griswolf
0
174
Member Avatar for lewashby

Please give us a more complete snippet, including at least how [I]app[/I], [I]depot[/I] and [I]options[/I] are constructed. I am guessing that the problem is you have only one choice in the [I]options[/I] list, and need two or more.

Member Avatar for griswolf
0
100
Member Avatar for daniiii

There is a setValueAt method that could be called in the course of initializing your TableMode, assuming the JTable exists at that point. Otherwise, there are various JTable constructors that you could call. One takes an array of arrays of data: You could either build the double array along with, …

Member Avatar for daniiii
0
182
Member Avatar for sandeepxd

Apparently the SimpleHTTPServer is part of the Python standard library (I did a very quick check, not a complete one). It also appears that droopy.py can be treated as a library. So the way to combine them is to make sure that droopy.py is on your PYTHONPATH and then write …

Member Avatar for griswolf
-3
6K
Member Avatar for csinquirer

A spider that searches the web for great thesis topics. It must discover itself in order to pass the test.

Member Avatar for Nick Evan
0
528
Member Avatar for crystaliao
Member Avatar for Skyelher

Yeah. I had to move to Python to avoid that all well written C programs should have at least one GOTO. ;)

Member Avatar for griswolf
0
150
Member Avatar for Grantsarver

Sounds like you know pretty much how you will go about it. I suggest that you create a temporary table (DROP if exists tablename first) and then run your query against that and the vBullletin tables. The command I think you want is mysqlimport:[QUOTE]mysqlimport --help mysqlimport Ver 3.7 Distrib 5.1.39, …

Member Avatar for griswolf
0
117
Member Avatar for arete

Also notice that you tried to use non-matching CODE-tags. That cannot work. Use (snip) at the end if you use (code) at the beginning, or use (snip) at the end if you use (snip) at the beginning. (Case does not matter).

Member Avatar for arete
0
352
Member Avatar for Shikhin

Umm. The statement of the problem is not complete. If all you need to do is print the letters, then you could just do this: [ICODE]/*...*/ expectedOutput = "..."; printf(expectedOutput);[/ICODE] I think the problem is more likely to be: [I]Given a string with an odd number of characters, on each …

Member Avatar for Shikhin
0
178
Member Avatar for smoothe19

I am confused about the [ICODE]String[][] arrays[/ICODE] parameter in each method. What is the point of the outer (or inner) array? Remember that in Java, a String is a built in type, not like C where it is an array of characters. A very very brief web search (using Google: …

Member Avatar for NormR1
0
322
Member Avatar for r.cuevas05

Software development is as highly leveraged as automotive work, maybe more: When times are tough, the people who would like to make/get better software can always make do with what they have, when times are good, everybody wants to hire your time to make better software. If you want to …

Member Avatar for redesignunit
0
179
Member Avatar for jazz_vill

So, if you have read that, what did you do to verify or disprove the legitimacy of the claim? Whether it is primarily coding or primarily a paper, you have to do the research. You might also want to consider whether Java is the most appropriate language for this project: …

Member Avatar for TrustyTony
0
140
Member Avatar for madhuri.pinky

The answers to all your questions are here: [url]http://dev.mysql.com/doc[/url] ... just pick your version in the top left corner, then dive right in. If you have no SQL (as opposed to MySQL) experience, you should start with a very simple tutorial. For intstance: [url]http://www.w3schools.com/sql/default.asp[/url]. [I]note[/I] I have not used this …

Member Avatar for griswolf
0
146
Member Avatar for tprakashbo

Among other things, it is the idea of putting each datum in one place in the database. There's a lot more to it, but in my own (limited) experience, that's the piece that gets you the most value for the least effort (and it is easy to understand). Do a …

Member Avatar for griswolf
0
60
Member Avatar for aframe

Response to tonyjv: it is a horrible idea to self-modify your code. You can make wonderful messes, though it is kind of fun if you don't have to maintain it. I *think* that the fact the script is byte compiled means you can get away with writing to the .py …

Member Avatar for griswolf
0
2K
Member Avatar for cubespeed

What you have written makes sense against the output: You are getting an 'OR' condition on 'val1' and 'val5', you want an 'AND' condition. You may be able to use the '+' operator: [ICODE]... AND MATCH ( t3.value ) AGAINST ('"+val1" "+val5"' IN BOOLEAN MODE);[/ICODE] or you may need two …

Member Avatar for griswolf
0
177
Member Avatar for Exoskeletor

IMO the active menu item and the band name need just a little bit more contrast: I'm having a hard time reading them. Why is the logo/art work so near the top of the page? Too much empty space below it and above the menu line (unless there will be …

Member Avatar for Exoskeletor
0
299
Member Avatar for cableguy31

Another way, with regular expressions [CODE]import re extensions = ['txt', 'jpg', 'zip'] pat = '\.('+'|'.join(extensions)+')$' extRE = re.compile(pat) for f in getFilenames(): if extRE.search(f): do_something(f) [/CODE] note the absence of the '.' in the extensions: I wanted to put it once, but you could duplicate it if that makes the …

Member Avatar for TrustyTony
0
151
Member Avatar for completehoax

From [URL="http://www.cplusplus.com/reference/std/locale/ctype/is/"]here[/URL] we have an example of the "correct" way to handle locale facets, including upper and lower. [CODE] // ctype::is example #include <iostream> #include <locale> using namespace std; int main () { locale loc; char quote[] = "It is wonderful how much may be done if we are always …

Member Avatar for Kanoisa
0
104
Member Avatar for Danth6961

That would be a join table that connects employees to courses, many to many. It might also have secondary information such as 'must finish by' or 'number of attempts allowed' ... Minimally: [CODE]table tblEmployeeRequiredCourses ( employee_id integer foreign key references tblEmployee.lngEmployeeId, course_id integer foreign key references tblCourse.lngCourseID )[/CODE] You may …

Member Avatar for Danth6961
0
110
Member Avatar for TrustyTony

This is also a [B]really really should[/B] read even if you have never coded a line of Java. Even python 'professionals' might learn one or two things.

Member Avatar for snippsat
1
654
Member Avatar for chinjuuu
Member Avatar for griswolf
0
29
Member Avatar for muthulazmi

Please do two things: [LIST=1] [*]Read (and follow) [B]all[/B] the README file in the distribution [*]More information: What platform, version of python, version of mysqldb code [/LIST]

Member Avatar for muthulazmi
0
106
Member Avatar for akssps011

You should start by trying to understand the layers (and layers) of abstraction that build up from sectors of tracks on a spinning disk to the idea of a 'file'. ... and you should spend a little time searching the web. For instance look for [B]file shredder source code[/B]

Member Avatar for griswolf
0
48
Member Avatar for SJP99

First you have to decide what "normal" is. As for a server server OS, it is configured to provide services to other nodes on the network. Typically, this would be web services, but not necessarily. Most useful OSs can be used either way, it is more a matter of tuning …

Member Avatar for SJP99
0
124
Member Avatar for wiluo

It may be that wiluo is trying to use files for communication between processes, in which case it will be necessary to flush the write cache before trying to read the file inbound. Also conceivable: Multiple processes reading the same file. Most OSs cache some or all of the bytes …

Member Avatar for jcao219
0
4K
Member Avatar for vivi288

More than likely you want the UNION operator to gather all the data together. I think you can order by date and get that effect "after" the union. Be sure to test.

Member Avatar for vivi288
0
83
Member Avatar for echellwig

[CODE] # this works, but see below # allTheLists = [] # for j in range(int(L)): # allTheLists[j] = [] # more pythonic: allTheLists = [[] for x in range(int(L))] #... allTheLists[j].append(jListItem) printAllTheLiats[listIndex][itemIndex] # etc[/CODE]

Member Avatar for TrustyTony
0
48K
Member Avatar for keeda

In addition to the executable permissions, you need the shbang first line: [icode]#!/bin/sh[/icode]

Member Avatar for griswolf
0
150
Member Avatar for Robertbra

The first snippet checks whether "p p" is in sys.argv once for every item that is in sys.argv. It also won't run: The variable [ICODE]yes[/ICODE] is not defined. The second snippet looks ok. To do the "find the 3rd arg after the P arg" part, you need to know about …

Member Avatar for griswolf
0
117
Member Avatar for anita_jojo20

You start by being very clear in your own mind what the program is to do. Write that down. Now think about how to tell the computer to do it, don't worry about code, just the flow of the program. (Or: Now think about writing the code, don't worry about …

Member Avatar for griswolf
0
183

The End.