761 Posted Topics
Re: 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] | |
Re: [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 … | |
Re: 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] | |
Re: 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 /* ... */ … | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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 ] … | |
Re: 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 … | |
Re: 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 … | |
Re: 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? | |
Re: 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 … | |
![]() | Re: 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, … |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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, … | |
Re: 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 … | |
Re: A spider that searches the web for great thesis topics. It must discover itself in order to pass the test. | |
Re: if the host supports ssh, that would be the way to go. | |
Re: Yeah. I had to move to Python to avoid that all well written C programs should have at least one GOTO. ;) | |
Re: 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, … | |
Re: 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). | |
Re: 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 … | |
Re: 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: … | |
Re: 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 … | |
Re: 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: … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: You might look [URL="http://www.daniweb.com/forums/forum52.html"]here[/URL] | |
Re: 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] | |
Re: 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] | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: [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] | |
Re: In addition to the executable permissions, you need the shbang first line: [icode]#!/bin/sh[/icode] | |
Re: 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 … | |
Re: 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 … |
The End.