761 Posted Topics
Re: Can you access the database using the [URL="http://dev.mysql.com/doc/refman/5.0/en/connecting-disconnecting.html"]mysql[/URL] command line tool? [list=1] [*]If you can, then the issue is somewhere in PHP-land. [*]If you get the same problems using command line mysql, then the problem is somewhere on the database side of the world (including issues with the particular port)[/list] … | |
Re: What is the value of [ICODE]savingsRate[/ICODE] when you calculate [ICODE]pmt[/ICODE] on line 21? | |
Re: You want [URL="http://docs.python.org/library/datetime.html#datetime.date.strftime"]datetime.date.strftime()[/URL] (and follow the link for details) | |
Re: How did you decide this is a PHP question? If I understand correctly, OCX files are useful only on Windows systems, and have nothing (directly) to do with PHP. | |
Re: well, I see that your code is identical to what I found at the sgi site. A little more exploration yields this: [URL="http://www.sgi.com/tech/stl/hash.html"]Defined in the headers hash_map and hash_set, and in the backward-compatibility headers hash_map.h and hash_set.h. This class is an SGI extension; it is not part of the C++ … | |
Re: Well, there are two issues [LIST=1] [*]You can just do this with introductory level algebra, and you should. [*]You have a variable [icode]OtherSub[/icode] that is never initialized, and even if it were, you should be saying [ICODE]OtherSub += 1[/ICODE] at line 17 (I think you meant) [/LIST] For option 1, … | |
Re: Have line 3 run in another thread. Join the threads after line 4 | |
Re: Sigh. Please read [thread=366794]This thread[/thread] to understand how to ask for help in the best possible way. Then, please, [URL="http://docs.python.org/library/email-examples.html"]RTFM[/URL] (One of the first few hits when I googled for 'send email using Python') | |
Re: Just my own perspective: HTML was much easier for me to learn than any particular graphic package. Django is quite approachable for small projects (and this one looks "small" from the perspective of the UI) | |
Re: So what is it that makes up an operating system? (I really don't have a clear cut answer: Too many possible ways to slice things). By mentioning the idea of skipping the boot loader and kernel, you make it clear that you're experimenting with something less fundamental; so just pick … | |
Re: "[B][I]I'm having issues[/I][/B]" ... Hmm. That's not a very specific question. | |
Re: hmmm. [CODE]a = list(range(10)) a[::-2] = "ZYXWV" print (a)[/CODE] I had completely forgotten about the step option for slices. | |
Re: This: [icode]class lk(old_image):...[/icode] declares a subclass of class old_image. I'm guessing that what you want is actually to [B][I]initialize[/I][/B] an instance of lk with the old image. You do that in lk's member function [icode]def __init__(self, old_image):...[/icode] Of course this is only a guess at what you intended. By the … | |
Re: [QUOTE]... having problems getting it to compile and run.[/QUOTE] It is always best if you give the exact compilation error message, so we don't have to guess what the problem might be. And, if you read the error message carefully, thinking about how a compiler author has to be generic, … | |
Re: Confused why you need this. If you need to print with double quotes, do it like this `print('"%s"'%"qwerty")` P.S. Bad idea to name your variable "string" as it conflicts with the string module (chant `help("string")` from the Python prompt) | |
Re: You'll get best help if you show some code (using the CODE button to keep indentation, etc). However, just for starters, a [URL="http://www.cplusplus.com/reference/stl/vector/"]vector[/URL] can grow as large as you need, so you just create one and [icode]push_back[/icode] each new value in turn. There are some efficiency issues with resizing a … | |
Re: Jython questions are good in this forum. However, you will need to be much more specific about your needs before we can be helpful. The best way to be specific is to tell us exactly what you need to do [B][I]and[/I][/B] to show us the code that you are trying … | |
Re: you need [icode]grep -q[/icode] (Chant [icode]man grep[/icode] then check the -q option, then experiment a little bit until you understand how it works.) Hint: A zero status is the way Unix utilities signal 'it worked'; so you can use it in a logic test. | |
Re: You probably want a script that looks more like this:[CODE] # do any initialization while True: # prompt for user choice # clean up the choice: at least one non-white character, lower cased, # if 'q': break # if something legal, look up the appropriate fortune (but see 'get' below) … | |
Re: Or write your own very simple parser if you prefer, using regex to recognize the interesting bits. You probably need [B]start_of_tag[/B], [B]tag_contents[/B], [B]end_of_tag[/B] and some non-regex things to keep track of opening and closing tags with the same name. To avoid rolling your own, check [URL="http://www.crummy.com/software/BeautifulSoup/"]Beautiful Soup[/URL] if you are … | |
| |
Re: Why can you not find out? What have you tried doing? Do you need to check each file to see if it is still growing, or is it sufficient to know it exists? | |
Re: for my purposes (actually need to use some pseudo random things from time to time), I have been quite happy to simply import [random](http://docs.python.org/library/random.html) Of course, if you want to write your own that's different. The "bestest" random function I ever read about: Get bits from the microphone input. There … | |
Re: I had always thought they were the same. But [URL="http://en.wikipedia.org/wiki/Multiprogramming"]the wiki knows![/URL] | |
Re: In fact it depends on the use as both richieking and Gribouillis suggest. The technical terms are 'row major' (indexed as[ICODE] data[row][column][/ICODE]) and 'column major' (indexed as [ICODE]data[column][row][/ICODE]). Some math applications work much better column major, for instance. For "large" data, it can matter (perhaps not so much in Python) … | |
Re: No, someone will not do that. This forum is to [I]help [B]you[/B] do your work[/I]. It is [B]not[/B] to [I]do your work for you[/I]. See [thread=78060]These strong suggestions[/thread], particularly the last item. | |
| |
Re: I understand that you asked for "good" and this is a somewhat broader brush. [url]http://lmgtfy.com/?q=principles+of+logic+design[/url] | |
Re: You need to be specific in your own mind about what a 'Start date' is, then. I see two basic options:[list=1] [*]You always look at activity[I]N[/I]'s startDate [*]You base it on the earliest (or most recent) startDate for the user [/list] Option 1 is easy. [icode]SELECT blah, blah from activities … | |
Re: Why not do the work in a language with which you are already comfortable? I have a dozen utilities in my $HOME/bin directory (which is early in my PATH) written in Python (and several more written in bash, and a couple compiled from C and ...) For your task, I'd … | |
Re: OK. I was going to suggest bin() but apparently we cross posted. | |
Re: Are you asking for a way to determine what is the [B][I]optimum[/I][/B] order for a given B+ Tree? If you think about it, you will see that this "optimum" value depends on the cost to do these things:[list] [*]Searching[list] [*]Follow a link to a child node [*]Find the appropriate key … | |
Re: Look at the [icode]setdefault[/icode] method on dictionaries. If you first [ICODE]setdefault(key,[])[/ICODE] you can then always [ICODE]keys[key].append(pairs[1])[/ICODE] | |
Re: The first thing I'd do to change your code is to make the loop [icode]while True:[/icode] and then add [icode]if student_name.lower() == 'q': break[/icode] That allows you to move the input for student name inside the loop (and that means you only write it once). Your inner loop can be … | |
Re: [URL="http://lmgtfy.com/?q=algorithms+for+doubly+linked+lists"]http://lmgtfy.com/?q=algorithms+for+doubly+linked+lists[/URL] | |
Re: [QUOTE=Rashakil Fol;1555012]You ask them.[/QUOTE] Good but insufficient. You ask them [B][I]in a carefully structured way[/I][/B]. The important questions for you are: [LIST=1] [*]What is the data? [*]How do I access the data? [*]What interactions are necessary? [*]What is the expected outcome (for each interaction)? [*]How can the expected outcome be … | |
Re: Semantics is what you say; syntax is how you say it. You can insert numbers and strings into other strings for later output in a variety of ways. Generally, you will use the [URL="http://docs.python.org/library/string.html#formatspec"]format mini-language[/URL] and the modulus operator (%). For very simple cases it is very easy. For instance[CODE]anint … | |
Re: Is this the formula found [URL="http://www.math.hmc.edu/funfacts/ffiles/20010.5.shtml"]here[/URL]? | |
Re: you want some variation on code like this[CODE]gracefulStart() # create circle etc while True: # display the circle # do some work; pause; etc if readyToStop(): break # adjust the location of the circle gracefulEnd() [/CODE] | |
Re: This is a variation of traveling salesman problem where the cost of any outbound edge is a probabilistic function of the distance to N from that edge's other node. That function ought to be interesting to write :) As Tony points out, you can start by considering the[URL="http://en.wikipedia.org/wiki/Shortest_path_problem"] known minimum … | |
Re: So you would prevent your customers from using punctuation of any kind Wouldnt that be a little hard for them I think it would make me crazy ![]() | |
Re: Make is different in a couple of ways from most programming and scripting languages: You don't describe [I]how to do what you want[/I] (procedural languages) but instead give [I]transformation rules[/I], then ask for what you want (declarative languages). The makefile syntax/format is also odd (though if I recall correctly the … | |
Re: why is the return type of [icode]whitespace(...)[/icode] [icode]void[/icode]? | |
Re: You might want to use [URL="http://docs.python.org/library/collections.html#collections.Counter"]Counter[/URL] | |
Re: sed can do it. The trick is to deal with the 'c' so that sed doesn't remove it entirely until the new 'c' are added in. That's the point of the '%' in the first and last clauses of the script. I'm assuming that the leading digits in your example … | |
Re: Virtualization allows me to use my hardware more efficiently. People are slow, and machines are fast. Where we used to have big machines with multiple accounts running on the same OS, we can now afford to have big machines with multiple OSs running on the same hardware. The value is … | |
Re: You will be well served to think about the program flow first. Here are some questions whose answers may help you write the code you need. [list] [*]How does the program know how many numbers to work with? [list] [*]is the number specified by interaction? [*]is the number specified in … | |
Re: That is a particularly unhelpful question. Perhaps your file is named "a.out" in the same directory as your .cpp file(s)? Perhaps you could add information about how you built the project? What compiler you're using? Why there's sql involved in a C++ project? | |
Re: Huh. Why on [B]Earth[/B] would you want that? Note that if you have multiple terminal windows open, pressing ⌘-Q causes them all to close. ⌘-W is a better choice. |
The End.