- Strength to Increase Rep
- +2
- Strength to Decrease Rep
- -0
- Upvotes Received
- 23
- Posts with Upvotes
- 17
- Upvoting Members
- 13
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re: Humor, you say? Okay, I'll keep looking then... :) | |
Re: The one that I stumble over, even decades after getting it "corrected", is URL. Learning networking concepts from books rather than a classroom, I still tend to read that as one syllable ("earl") instead of the accepted pronunciation as letters spelled out ("you are ell") . Occasonally I still have … | |
Re: Here's my experience. I was eligible fairly early (over 65 group comes after health & first-responeders in my state) and got both Pfizer shots last month. Minor sore arm for about 4 days after the first one, but no big deal. Really tired for a couple days after the second … | |
Re: Yes, you can do that. The normal way to do that is to create a source file with the variable definitions that you then import into other source files that want to use them. A simple example: # This is "my_app_globals.py" MY_APP_NAME = "My Application" MY_APP_VERSION = "1.02" MY_APP_NVERSION = … | |
Re: Dart has no standard array types, but it does have a built-in list data type that is much like a one-dimensional array in other languages. The usual way to represent a matrix in a language that only has lists and/or 1-D arrays is as a list of lists. There's an … | |
Re: The usual way to avoid duplicate entries is to search for a matching entry before inserting. It will be helpful to have a `find_by_id(char *id)` function that you can code and test separately before worrying about insertions. It should search the list for an entry with the given ID number … | |
Re: Your comments on lines 41-43 say why you get an error on line 46. The `data` variable is a list, so `data['hours']` is invalid. The error message says what you should already know...lists are indexed with numbers, not strings. I don't have an authorization key to use for that API, … | |
Re: Run the code. Python will tell you what is wrong and where. For example, I get syntax errors on line 14-16. Python requires consistent indentation, and you haven't done that here. Also, line 15 needs a ':' at the end of an except statement. Fix those and the program then … | |
Re: Neither C nor C++ defines specifics sizes for those data types. There are certain minimum requirements. A char is required to have at least 8 bits. Short integers require at least 16 bits, normal and long ints must be at least 32 bits and a long long integer must be … | |
Re: One good way to start on a task that seems too complicated is to take some simpler part of the task and write a method to accomplish just that. You could write an arrayMax() static method to find the maximum of an ArrayList<Integer> object. Don't forget that the built-in class … | |
Re: Your sample code doesn't say what "add" is, but I'll guess it's the full sized ArrayList with 150 elements. Do you really need to create 30 more ArrayLists to hold them in groups of 5? You can get a view of 5 consecutive elements from that list, starting at any … | |
Re: In a weird way, C++ makes this harder than plain C, provided that you know the maximum line length in advance. (The strtok() function from <string.h> will help split up a C string into comma-separated tokens.) That idea probably won't get a good grade on your C++ assignment, even though … | |
Re: First things first, if you want to get that working on a modern Python installation, change all occurrences of "Tkinter" to "tkinter". All standard module and package names are lowercase in Python 3. I don't see any other 2-vs-3 problems; and after that change the code runs in my Python … | |
Re: Try changing line 1 to: #include <graphics.h> In C, it's conventional to use ".h" as a suffix for a C header file; and that is the name of the Borland Graphics Interface header that defines functions named `initgraph()`, `circle()` and `closegraph()`. It's not a Standard C header, though, so unless … | |
Re: You need to include header files to define the standard library features you plan to use. These should appear before anything else It looks like adding: #include <iostream> ...is all you need for this program so far. If you add code that uses stream manipulators that take arguments, like setw() … | |
Re: If you want to combine a list of strings into a single string, use the string `.join()` method: res = ''.join(myarray[:temp]) print(res) If you don't need that res string for later use, Python 3 has a neat way to expand a list into separate arguments to print(), or any other … | |
Re: The reason you get 0 for an answer is in the constant expression 1/4. That's division of two int values and the fractional quotient is truncated to the next integer closer to zero. In this case, that *is* zero. And 0 times what follows is zero. Another problem is attempting … | |
Re: The first problem is that you aren't storing the password anywhere. You can't just compare characters as they come in. The user is allowed to backspace and correct mistakes. You don't compare the password to anything until the user presses enter (13). So you'll need an area large enough to … | |
Re: You need to pass the [] bracketed list as an argument to the np.array constructor, so () parentheses are needed: Y = np.array([4, 1, 0, 1, 4]) | |
Re: I'm new around here, so I don't know how well your question fits the "show some effort" rule on assignments. I don't see any harm in helping you with the syntax (regulars...help me out if this is wrong). You'll need a name for the derived Interface (or "ADT") and that … | |
Re: Excellent stuff here. Takes me back a decade or two to when I was learning Python and used writing a Sudoku solver as my first nontrivial project. When I got around to writing a GUI for it, I used Tkinter, though. Your article makes me think that learning wxPython is … | |
Re: Using "void main()" for the main function has been deprecated for, oh, over 30 years. Standard C requires a return type of int from the main function. People keep using it because compilers let it slide, and vice versa. You seem to have left out `#include <stdio.h>` at the top. … | |