761 Posted Topics
Re: In linux/unix/bsd type OSs, you can chant kill -9 [I]parentProcID[/I] from the command line. No clue on Windows OSs Usually, you would call wait() or some variant after sending the kill signal to the child, then die gracefully yourself (sys.exit(0), maybe; or exit with the exit status of the child; … | |
Re: I don't have a compiler set up on this laptop, so I'm working by eye. Thus, I may have the comparisons reversed on lines 9 and 15 (?) ... and for that matter maybe one lines 7 and 13 (?). But here's approximately what I would do:[CODE]int lessthan(const void *a, … | |
Re: I would do it this way: [CODE]create table house ( id integer auto_increment primary key, name varchar(25) ); create table chair ( id integer auto_increment primary key, description varchar(16) ); create table house_chair ( house_id integer, /* which house has a chair like this */ chair_id integer, /* which chair … | |
Re: Please tell us how the program is invoked, what happens, what is the exact failure mode, and text of failure. Can you (just) process all the files? That is: If you comment out the list1.append(tokens[1] etc, and just throw the results away, does the program run to completion? What happens … | |
Re: You just have to look at the code: When you call the function what is the argument that is passed in? You can think of each invocation (whether called from 'outside' or from 'inside') as a distinct function. This is the function:[CODE]def func(depth): if depth > 0: return function(depth - … | |
Re: Is it as simple as word.txt versus word[B]s[/B].txt? Try this:[CODE]import os os.listdir('.')[/CODE] If that gets an unexpected result, it should give you a good clue. | |
Re: In my (humble?) opinion, there is very little value to the SOAP protocol. Some, maybe, but RESTful behavior offers pretty much the same thing with a lot less hassle. | |
Re: Some of the audio formats are published, some not. Most of them have at least some information about the format available via online searches. Some search like [I]type[/I] format (for [I]type[/I] being whatever data format you are interested in. As I recall it, mp3 files have a nice regular format … | |
Re: [url]http://www.merriam-webster.com/dictionary/superstition:[/url] [QUOTE][B]superstition:[/B] 1 a : a belief or practice resulting from ignorance, fear of the unknown, trust in magic or chance, or a false conception of causation b : an irrational abject attitude of mind toward the supernatural, nature, or God resulting from superstition 2 : a notion maintained despite … | |
Re: You need a system that creates an ordinal value for each hand (the rank of the hand) and you just compare the ranks. The trick, then, is to write that function. I'm not a poker expert, but I'd do something like: Recognize all the possible ways the hand can be … | |
Re: I think your comparison of B with A has already been done when you compared A with B. The cost of doing this work is [B]O[/B](n^2), which is not small for your data set. If you can reduce it by a factor of 2, it is probably worth doing. Thus, … | |
Re: Take a look at [URL="http://docs.python.org/library/urllib.html"]urllib[/URL] and [URL="http://docs.python.org/library/urllib2.html"]urllib2[/URL] | |
Re: From your description "... a varying number of fields and values..." I would think you want a non-relational data store. Depending on things you didn't say, you might want to use your described structure, using pickle/unpickle to persist it to disk; or you might want to go with something like … | |
Re: You will also want to know how to do tonyjv's lines 5, 6, 7 [LIST] [*]The very best way is to use collections.Counter if you have it in your version of Python. Discover whether you do by trying to do this:[iCODE]from collections import Counter[/iCODE] If it works, you are golden, … | |
Re: snippsat has it right. You can, however, manipulate global variables from inside a function if you declare them global, though for most purposes this is not a good idea. For instance[CODE]def makeage(): global age # set age = some calculation here # and the global age is altered[/CODE]You have a … | |
Re: You need to specify the problem much more completely, and you need to try to do the work yourself, at least some, or we won't help. What is a "time table" and what does it mean to generate one? When you post your first code, be sure to use the … | |
Re: You need that [iCODE]root[/iCODE] and [icode]root/module2[/icode] be in [icode]sys.path[/icode] which can be done like this in [iCODE]somescript[/iCODE]:[CODE]import os import sys rootpath = os.path.dirname(os.path.abspath(os.curdir)) sys.path.append(rootpath) mod2path = os.path.join(rootpath,'module2') sys.path.append(mod2path) import common import someotherscript[/CODE]Of course you also need to be sure that all these things exist; it would be nice not to … | |
Re: [LIST=1] [*]You read and understand (some part of) [URL="http://www.faqs.org/rfcs/rfc2045.html"]RFC 2045[/URL] and its linked RFCs (see the wikipedia article mentioned below) [*]You write a script that creates your email (or modifies a template) that meets that specification (Or, you find a tool that helps you do that task: Likely to be … | |
Re: The language is almost irrelevant: Some jobs need one, some another (and then only to get your first position in the firm). What matters is professionalism, background, personality, and things that schools mostly don't teach...[B]and[/B] the ability to do "the job" in one or more languages, which you do need … | |
Re: Level 0 is what amount of detail? (What [B]is[/B] the data?) Where does the data start? (Who asks or tells?) What stage(s) does the data go through on the way to the final sink/end? What is the end result? (Who receives or stores?) | |
Re: Yes, as long as you are thoughtful/careful about what you mean by "sort of substring". [url]http://dev.mysql.com/doc/refman/5.0/en/string-functions.html[/url]. Generally speaking, you may find it better to do the comparison outside the database, unless you are doing some kind of matching SELECT | |
![]() | Re: Two things: First thing is to do the change carefully so you can back out on failure. The steps are [LIST=1] [*]read the file into memory [*]update the memory version of the file [*]write the file to a new name (maybe [iCODE][I]original[/I].tmp[/iCODE] or the like) [*]rename the original file (maybe … |
Re: This is bash running on OS/X. The pv command is "pipeviewer", which invoked -L1 limits throughput to 1 byte per second. Using two windows, first I chanted [iCODE]ps -l[/icode] in window 2. The result is as seen below, and is the base case of two bash shells running. [code]508% ps … | |
Re: Just a quick hint before I run off to another task. From [url]http://www.voidspace.org.uk/python/articles/urllib2.shtml[/url][QUOTE]Headers We'll discuss here one particular HTTP header, to illustrate how to add headers to your HTTP request. Some websites (like google for example) dislike being browsed by programs, or send different versions to different browsers [2] . … | |
Re: Do a tutorial on (My)SQL. By the end of 20 minutes, you will have this and more. You may search online, or look at one or more of these:[LIST] [*][url]http://www.w3schools.com/sql/default.asp[/url] [*][url]http://www.mysqltutorial.org/[/url] [*][url]http://dev.mysql.com/tech-resources/articles/mysql_intro.html[/url] [/LIST] ![]() | |
Re: Quick tip: Use the (code) button which will tip the '/' in the closing tag the right way. To get inline code samples (see below), use begin tag (CODE) and end tag (/ICODE) What type is `results`? A list cannot work with non-integer index. My error was `TypeError: list indices … | |
Re: As you might guess, this is a much discussed topic. Here's a bunch of prime generators: [url]http://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python[/url] | |
Re: Awsome! As a general rule, non-template code that is more complex than a single loop or a single if test should be compiled into its own object file (starting from its own cpp file), and the executable then depends on that object file as well as the one holding main(). … | |
Re: [CODE]def wordReverseToLines(word): for i in range(len(word)-1,-1,-1): print (word[i]) # or def wordReverseUsingList(word): arr = [x for x in word] arr.reverse() print ("\n".join(arr))[/CODE] | |
Re: Step one: Please use the (CODE) button when you post code. All kinds of good things result (and less good things if not) Step two: What languages are of interest? If you are thinking to learn a little about all the ways of programming, then you should probably pick one … | |
Re: <sarcasm>I suggest Visual Basic since it is less general, only runs on Microsoft platforms, and is considerably less cutting edge than PHP.</sarcasm> | |
Re: First: Please us the (CODE) button when you post. It is good in lots of ways, and a requirement when you post code at DaniWeb. Second: You seem to be trying to build a baby source / revision control or backup system. Why reinvent this functionality when there are many … | |
Re: It is sometimes better to make things a [B]little bit[/B] more complex than they need to be right now if you can foresee the possibility of needing that complexity. In particular, moving toward a normal form is often worth doing to avoid having to stop everything while you rebuild a … | |
Re: Uncommon? Use the Lego robot system to deliver messages among faculty. How about using a computer program to randomly assign students to seats in their classes, and see if changing the seating changes grades. | |
Re: C and C++ are more difficult languages to start with, though very powerful/fast-running and certainly not impossible. Free if you use the various Gnu compilers. Much documentation. Since you are just starting, I recommend that you try something with a smaller entry cost. Python would be good since it is … | |
Re: [B]Money and Job Security[/B]: [B]Every[/B] (except direct service: burger flippers, janitorial staff, personal trainers) job is subject to outsourcing, and every job and industry is subject to market forces of all kinds. In some ways, you should consider that the better you are (therefore the higher you are paid) the … | |
Re: Not claiming to know anything from my own studies (though I did look at ELF layout once, many years ago). A quick web search: [url]http://www.ouah.org/RevEng/x430.htm[/url] [url]http://en.wikipedia.org/wiki/Executable_and_Linkable_Format[/url] | |
Re: Data point: (Python 3.1.2, OS/X latest) From the command line I invoked python3 and entered this code [ICODE]print(input("What: "))[/ICODE] All the usual cursor controls worked for me: Delete, emacs-style commands (^A ^B, ^D ^E and ^F), arrows all did as I expected. | |
Re: Do you mean 'find all his events forever' or 'find all his events today' or something else? You might want to think again about whether this is the best way to specify possible repeating events. You might want to allow the user to specify the count of units to repeat: … | |
Re: The real question is "Why do you want a million numbers in your excel file?" Excel probably can cope, but as long as you are handling the file now, why not do some work on the information [B]before[/B] you write it back out? You can use (g)awk to do really … | |
Re: [CODE]int main() { printf("1\n2 3\n4 5 6\n7 8 9 10\nplease help me\n"; }[/CODE] | |
Re: Suggestion zero: When you submit code, put [CODE] and [/[I][/I]CODE] tags around it. This gives line numbers and syntax highlighting in the display; and keeps your indentation: All good things. Also, when you post to DaniWeb, you agree to follow the DaniWeb rules, one of which is to use [CODE] … | |
Re: Take your thesis apart into chapters and sections. Each chapter is a main point in the outline, each section is a minor point in the outline. Below the minor points, make a one-line summary of each important point in that section: Those are the minor minor points in the outline. … | |
Re: kings_mitra is not wrong, but it is easier in my opinion to calculate start and end time as (minutes or seconds) since some past moment (like, in this case, midnight, or if the interval can include midnight, then perhaps midnight yesterday or midnight on the 1st of January 1970 (for … | |
Re: Wrong forum: This forum is about design of database only. I think you want graphic tools? | |
Re: [URL="http://www.boost.org/doc/libs/1_43_0/libs/mpl/doc/index.html"]Boost has a [B]lot[/B] of nice meta programming code.[/URL] I first saw this (or was it a Fibonacci?) quite a long time ago (probably about 15 years?). You do have to be wary that too much of this kind of thing can make the compiler run a long time, use … | |
Re: No. You have to do at least part of the work first, only then will people be willing to help you get it right/better. Hint: Step one in designing any system is deciding what it does. What are the specifications for this system? | |
Re: What is the result you want? Is it a library? executable? Something else? Whatever it is, you put that on the left of the colon, a list of the required prerequisite "things" (object files, libraries etc) on the right, and how to put them together to make your result on … | |
Re: Sending email with attachments is difficult unless you use perl, python or some other script language, or if you have mpack or mmencode. Much easier to send an email mentioning the presence of the tarball and letting you interactively get it (yeah, not much fun). You could also do this … | |
Re: Suggest: Do a web search for similar schoos: Private schools, advanced placement programs, other rural schools, schools that specialize in "distance education" and the like. At least one of them will have a nearly perfect match for your needs, already developed. You might "pay" them some extra development (added features … |
The End.