761 Posted Topics
Re: Yes, and no. You will need to connect "somehow" to the web site; then you will need to do something that is specific to the connection and the site to scan for directories (most web connections are made to a server that serves documents, so there is no direct comparison … | |
Re: OK. masijade gives up, but I will take a swing at it: When you need something to be in your working environment "forever", then you do it by editing one of these two files: [ICODE]$HOME/.bash_profile[/ICODE] or [ICODE]$HOME/.bashrc[/ICODE] Use the first file if it exists, else the second. Use a text … | |
Re: This is a solved problem. Look at the [URL="http://docs.python.org/library/csv.html"]csv module[/URL] | |
Re: Mm. So you unzipped the distribution, looked inside, found the installation instructions and followed each of the steps religiously? If that doesn't work, then perhaps use one of these wrapper distributions: or equivalent which are supposed to make installing a working system somewhat (or much) easier. [LIST] [*][URL="http://www.wampserver.com/en/"]Wamp Server (Windows)[/URL] … | |
Re: The story is that if you try to pull on your boots (which you do by holding the bootstraps and pulling upward), and the boots are a 'perfect fit' (very tight), then you might pull yourself up into the air by your bootstraps. Hence the name 'bootstrapping': A compiler that … | |
Re: I don't do MSSQL, but for other databases, it is perfectly ok to keep all the data in one (set of) table(s) and simply run the query for the most recent N rows (or for all the rows within a time range, or however you prefer), as long as there … | |
Re: Consider [url]http://docs.python.org/library/pyexpat.html[/url] or [url]http://docs.python.org/library/xml.sax.html[/url] or [URL="http://www.crummy.com/software/BeautifulSoup/"]Beautiful Soup[/URL] | |
Re: my guess: You compiled to an executable that has the same name as an exe that displays a bouncing ball... and that existing exe is first on your path. Just a guess. | |
Re: I found the [URL="http://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string_search_algorithm"]wikipedia[/URL] article easy to understand. The main thing, for me, was to [I]get[/I] that the preprocessing allows the algorithm to skip forward by more than one character when there's a miss. | |
Re: Yes, that is approximately the usual way to create Python threads. Why do you need locking? Best to be a bit more specific about your question. | |
Re: There is also the use of a scripting language to present the UI, trigger core routines written in C, C++, Prolog, FORTRAN, or whatever. Python has a quite accessible interface for doing that. The upsides to doing it this way: [LIST] [*]You can prototype entirely in the scripting language: Quick … | |
Re: Computer Science is [B]not[/B] programming: It is a field of study. If you want to be a computer scientist: [LIST=1] [*]Go to a school with a good Computer Science department. Get excellent grades. [*]Be admitted to graduate school at a(nother) good University. [*]Work hard, get good grades. Write papers. [*]Get … | |
Re: Look here: [url]http://docs.python.org/release/2.5.2/lib/timer-objects.html[/url] | |
Re: I don't know what you mean by 'subtracting lists'. With your[icode]listSum()[/icode]you implicitly start with the accumulator set to 0. What is the initial value of the accumulator for a subtraction? Or do you want to 'subtract' one list from another? As a set or each element from its matching element? … | |
Re: At this point in your studies, you should be more than able to generate a couple of dozen ideas. Present them with your own quick take on feasibility etc; and we will be happy to add our own insights. Doing your work for you is bad form (and bad for … | |
Re: NEED NOT TO YELL at people from whom you are asking help! | |
Re: Well for starters, lines 6 through 25 make me itchy. This is what I would do (assuming you really want a single dimension array of boxes)[CODE] bricks = [] for i in range(-5,6): bricks.append(box((i,9,0),1,1,'white',materials.marble)) for i in range(-4,5): bricks.append(box((i,8,0),1,1,'white',materials.marble)) [/CODE]That seems to answer your first question. On the other hand, … | |
Re: First: Please use the (CODE) button when posting code. It does all good things, no bad things, AND it maintains indentation, which is critical for Python. Second: I would use a dictionary like this: items = { 'd': ("Dagger", 10), 's': ("Sword", 50), # and so forth } # and … | |
Re: And "the little problem" is what? I see several candidates: [LIST] [*]line 2: Why return void when you can return something useful (there may be a good reason, but a comment might help) [*]line 15: I think you want [icode]while(*itBegin < *pivot)[/icode] [*]line 17: You are not looking at the … | |
Re: You can try wget or curl, assuming the files are visible to ftp (wget is a 'pull' tool, curl can work both directions) | |
Re: If you don't need to keep track of the history of the changes, then if you merely UPDATE the row instead of adding a new row each time, your problem is solved. To keep a history, you can store a "running total" so that your "view" query only looks at … | |
Re: [LIST] [*]What are the errors? [*]Why do you make the head and tail nodes static? Don't you want distinct instances of [icode]doubleList[/icode] to have distinct head and tail? (also, see note below) [*]The normal way to name a class is [ICODE]CapitalCamelCase[/ICODE], not [ICODE]lowerCamelCase[/ICODE], so I prefer that your class be … | |
Re: You really have no useful choice about wasting space for unanswered questions: You can have a lot of little tables, one for each question, each holds a foreign key: patient_history.id and the various answer fields; or you can have one wide table that has a lot of nullable answer columns. … | |
Re: With such a generic request, you get a generic answer: [LIST=1] [*]Select your project [*]Break the code up into modules. This is where you "design" the project [*]Write a tiny little stub for each module that just returns a tiny hard coded answer or prints a hard coded value or … | |
Re: There is a known problem with tkinter on that version of Mac OS (32 versus 4 bit problem). [url]http://bugs.python.org/issue9227[/url] | |
Re: I think you have two things going (wr)on(g): [LIST=1] [*]Apparently, your regular expression is matching just 'r'. I base this on the results of your [ICODE]findall[/ICODE] attempt. [*]finditer returns a [I]match[/I] object, not just a substring. You need to use ghe [ICODE]group()[/ICODE] method on the match object. [/LIST] Here is … | |
Re: You want the SMTP module. Example [URL="http://programmingexamples.net/index.php?title=Python/Smtplib"]here[/URL] | |
Re: Data structures have several properties that are important: [LIST=1] [*]basic size [*]size is fixed or variable [*]incremental size per item [*]length/size complexity [*]add/append complexity [*]search complexity [*]remove/delete complexity [*]iteration direction [/LIST] Linked lists come in two flavors: Singly linked list and doubly linked lists. For simple singly linked lists: [LIST=1] … | |
Re: I would have used a list of pairs, or maybe if there are a lot of options and looking up the hints is important, a dictionary, though that isn't the right thing here. Either of:[CODE]words_and_hints = [('python','snake or language'), ...] # or (not really appropriate for this exercise) words_to_hints = … | |
Re: [QUOTE=arkoenig;1390193]If you're just getting started with C++, then the following advice may seem heretical; but long experience has convinced me that it is sound: [/QUOTE] Andy has a [B]lot[/B] of experience with C++; and for what its worth, I wholly agree. C++ gives you a lot of very nicely behaved, … | |
Re: There are basically three techniques: [LIST=1] [*]You can ask users for feedback on things [*]You can use a web service or RSS feed or the like if it is available [*]You can write a ([B][I]well behaved[/I][/B]) web crawler and scrape the data for yourself [/LIST]Of course, you can use any … | |
Re: The problem you are having with paragraphs is that fscanf is a bit too heavy a hammer for your needs: [B][icode]s[/icode]Matches a sequence of bytes that are not white-space characters[/B] ([url]http://opengroup.org/onlinepubs/007908775/xsh/fscanf.html[/url]) What you really want is to read line by line. That way, when you see an empty line, you … | |
Re: The issue is, I think, whether online gaming skills do actually translate into the work environment (and how well, and is the transfer useful). For instance, I can imagine some online leader whose persona is considerably rougher than I'd want a manager to have in a company where I worked. … | |
Re: Yes, this does seem somewhat complex, but you can do it in steps. After each step, make sure your program continues to work as well as it can at that step. [LIST=1] [*]First, think about how this program interacts with the user. Write something that does the interaction, but none … | |
Re: That would work, as would pulling a significant chunk (1000?) bytes from the board and comparing its hash with the last hash. I'd do it in Python because I'm a Python kinda guy, but wget or cUrl would work well from the shell. | |
Re: You need to [LIST=1] [*]Keep It Organized - [B]Do[/B] post Java questions in the [URL="http://www.daniweb.com/forums/forum9.html"]Java forum[/URL] [*]Keep It Organized - [B]Do[/B] provide evidence of having done some work yourself if posting questions from schoolwork assignments [*]Understand: [URL="http://www.daniweb.com/forums/announcement8-2.html"]We only give homework help to those who show effort[/URL] [*]Keep It Organized: [B]Do[/B] … | |
Re: [LIST] [*]you can precompile the regular expression: [icode]nonWordRE = re.compile(r'[^\w ]')[/icode] (I don't get why you have the space after the \w; and I think you need a trailing '+' so it finds multiple non-word characters...) (the ellipsis is a tiny self-referential joke) [*]You can use the regular expression directly … | |
Re: [LIST] [*]Customer last name is not a good key: Too many 'Smith' or the like. Most groceries seem to use phone number, which is better than some generated ID, and probably does a decent job of grouping people appropriately [*]Why does each customer have a hard attachment to an employee? … | |
Re: Finki: Please do not hijack (even your own) thread to ask a different question. When this first thread was done, you should have marked it 'solved' (at the link on the bottom of the page). Then, when you had another question, you should start a new thread for it. So: … | |
Re: There are three aspects you need to think about: The data that is stored, how to let people look at the data, and how to allow the data to change. This is traditionally called MVC: Model (data), View, and Controller. For the [B]model,[/B] a relational database is actually the easiest … | |
Re: First, a bit of historical information: [url]http://en.wikipedia.org/wiki/Thomas_Bowdler[/url] The word is actually [B][I]bowdlerize[/I][/B]. That's fun, but not important. Second, a list is indexed by an integer, not a key, so you want something like [CODE]for i in range(len(s)): ... s[i] ... # [B]not[/B] s[w][/CODE] Third, you will need to call your … | |
Re: Good for posting code. Not so good for not using the (CODE) button. When you re-paste, highlight your code and press the button (or press first, then paste between the code-tags). You really need that for Python: Indentation counts, and that is how you get it; you also get line … | |
Re: You don't need to have a[ICODE]break[/ICODE]commend in the[ICODE]quitLoc[/ICODE]function. Just erase the two instances at lines 5 and 11 and all will be well: if/elif will enter only one of the blocks, then exit the function with a None return value Aside: All those globals are bad form... but I'm not … | |
Re: input_number divide by 10: That's the first number (integer division truncates) input_number minus 10* first_number: That's the second number | |
Re: Please use the (CODE) button to put `your code here` tags around your code: Preserves indentation, give line numbers and syntax colors: All good things. (Press the button, then paste between the tags, or paste, then highlight and press the button) | |
Re: how do you get to the next [B][I]num[/I][/B] if you do not find a perfect number? | |
Re: Ug. How did you manage to get rid of the line numbers and code coloring? Use the (CODE) button next time, please. There are a lot of problems, but lets start with just three: 1. What you show can't even be running: It would stop with a problem on the … | |
Re: Delete duplicate post. Sigh. | |
Re: Why use partition() instead of split()? What happens with 'malformed' lines such as [ICODE]word1\tword2[/ICODE]. Using split() would fix that problem (but cause the generator to store a lot of data if the lines are long). | |
Re: You got fooled by the instruction in the posting box. code-tag must be followed by code-tag, and similarly for icode and icode. That instruction fooled me too. Easiest to use the (code) button on the bar above. To restate your code: sword, line= 0, 0 filename= raw_input("please input file name: … |
The End.