761 Posted Topics

Member Avatar for anurag.kyal

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; …

Member Avatar for jcao219
0
159
Member Avatar for arsenal_fan

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, …

Member Avatar for griswolf
0
95
Member Avatar for cristi08

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 …

Member Avatar for cristi08
0
158
Member Avatar for fekioh

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 …

Member Avatar for TrustyTony
0
157
Member Avatar for teddypwns

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 - …

Member Avatar for ultimatebuster
0
11K
Member Avatar for rhodi

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.

Member Avatar for vegaseat
0
87
Member Avatar for janskey15

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.

Member Avatar for griswolf
0
76
Member Avatar for fussballer

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 …

Member Avatar for griswolf
0
191
Member Avatar for vaultdweller123

[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 …

Member Avatar for dellie
0
309
Member Avatar for yari

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 …

Member Avatar for yari
0
3K
Member Avatar for Kraln00b

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, …

Member Avatar for Kraln00b
0
162
Member Avatar for wezelball

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]

Member Avatar for griswolf
0
127
Member Avatar for zyrus001

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 …

Member Avatar for griswolf
0
321
Member Avatar for Tcll

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, …

Member Avatar for Tcll
0
104
Member Avatar for student_

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 …

Member Avatar for student_
0
83
Member Avatar for naziha

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 …

Member Avatar for griswolf
0
46
Member Avatar for ultimatebuster

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 …

Member Avatar for lrh9
0
159
Member Avatar for keeda

[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 …

Member Avatar for keeda
0
2K
Member Avatar for MrBlack

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 …

Member Avatar for AuburnMathTutor
0
215
Member Avatar for batman13

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?)

Member Avatar for aman007
0
218
Member Avatar for peter_budo

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

Member Avatar for tesuji
0
393
Member Avatar for dush0805

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 …

Member Avatar for griswolf
0
136
Member Avatar for arsenal_fan

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 …

Member Avatar for griswolf
0
119
Member Avatar for Musing888

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] . …

Member Avatar for Musing888
0
235
Member Avatar for Awah Mohamed

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]

Member Avatar for rajarajan2017
0
129
Member Avatar for onthego

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 …

Member Avatar for onthego
0
238
Member Avatar for abhijat

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]

Member Avatar for TrustyTony
0
1K
Member Avatar for Andreas5

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(). …

Member Avatar for Andreas5
0
126
Member Avatar for abcdr

[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]

Member Avatar for TrustyTony
0
199
Member Avatar for manailz

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 …

Member Avatar for tong1
0
154
Member Avatar for ivyg

<sarcasm>I suggest Visual Basic since it is less general, only runs on Microsoft platforms, and is considerably less cutting edge than PHP.</sarcasm>

Member Avatar for griswolf
-1
114
Member Avatar for masifahmed

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 …

Member Avatar for griswolf
0
127
Member Avatar for alkeshtech

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 …

Member Avatar for griswolf
0
106
Member Avatar for Kakashi

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.

Member Avatar for adampaulson
0
201
Member Avatar for airsoft

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 …

Member Avatar for n.cramp
0
213
Member Avatar for emcyroyale

[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 …

Member Avatar for redleaf1
0
197
Member Avatar for dansnyderECE

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]

Member Avatar for dansnyderECE
0
193
Member Avatar for G_S

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.

Member Avatar for G_S
0
205
Member Avatar for breakid

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: …

Member Avatar for tesuji
0
159
Member Avatar for Viruthagiri

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 …

Member Avatar for cfajohnson
0
146
Member Avatar for sabalksj

[CODE]int main() { printf("1\n2 3\n4 5 6\n7 8 9 10\nplease help me\n"; }[/CODE]

Member Avatar for nateuni
-2
89
Member Avatar for Coffee198

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] …

Member Avatar for griswolf
0
112
Member Avatar for dodongmamba

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. …

Member Avatar for asaukani
-1
162
Member Avatar for shirmaster

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 …

Member Avatar for kings_mitra
0
155
Member Avatar for logodesign

Wrong forum: This forum is about design of database only. I think you want graphic tools?

Member Avatar for pritaeas
0
63
Member Avatar for mrnutty

[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 …

Member Avatar for griswolf
2
410
Member Avatar for evangelyngulip

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?

Member Avatar for rboffers
0
45
Member Avatar for habib_parisa

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 …

Member Avatar for griswolf
0
370
Member Avatar for theuman

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 …

Member Avatar for serged
0
103
Member Avatar for stevenm84

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 …

Member Avatar for griswolf
0
180

The End.