183 Posted Topics
*I wrote this a few years ago as part of a C manual I wrote, but did not finish. I thought it might be interesting to the people on DaniWeb.* # Programming Language Generations # Different types of programming languages are often grouped into large categories known as generations. Each … | |
Re: Zero. The pointer given to `free()` is not in its list of allocated blocks. Usually, `free` does not check for blocks that are inside the block that it knows is allocated; the pointer must match exactly what was given by `malloc()`. | |
Re: The command line is available in Mint by opening a terminal. There are several packages that provide a terminal to the text interface in a graphical window. I like Terminator, as it allows you to open multiple windows on one screen. | |
Re: There a few ways of using MS-Access databases with VB6, depending on whether you want to always use the same database or you want to choose which database at run-time. If you are always connecting to the same database, create a new Database project and connect to the database you … | |
Re: Are you asking about what functions and other things the DLL provides, then there are various tools that can display that information. A tool like [Dependency Walker](http://www.dependencywalker.com) can help determining the exported functions and datatypes from a DLL. | |
Re: In line 307 you tell `cin` that you want to read octal values. Use the `hex` modifier instead, then use the `oct` modifier in the `cout` statement. You might want to consider using a single more general conversion rather than all these custom conversions. 1) Determine the input base. 2) … | |
Re: Another thing to consider is what should happen if you get bad data. `scanf` stops if it does not get the type of data it is expecting, and leaves the unexpected characters on the input queue. If your program is expecting a number and you enter a non-numeric character, like … | |
Re: Operator overloading is a mechanism where you can allow existing operators to be used with your class. You can not add new symbols to be operators, nor change their precidence (order of operations), nor number of parametres. I would love to be able to assign **^** to a higher precidence … | |
Re: All member functions of a class can access all data members and all other member functions of that class, no matter what their access level (public, private etc.), and no matter which object of that class they are in. The copy constructor does not need to use the public interface … | |
Re: # Using Another Form # On Form1, in the command button Click handler, do the work you want to do and store the value in a variable, say `intResult`. Then, at the end of the handler, put: Form2.lblResult.Caption = intResult Form2.Show The first line actually sets the value that will … | |
I just noticed that my posting level went from "Poster in Training" (or something like that) to "Junior Poster". Is there a list around of the requirements for what posting level title? | |
Re: Open a terminal to get a command line interface. Please report the entire output of each of these command lines. Copy and paste everything if you can. dpkg -l > /dev/null; echo $? df -ha What program/method are you using to update Firefox? | |
Re: Really all that is happening is that in the first form, the program is ignoring the passed parameter array. It is not true overloading as you see in Java or C++. | |
Re: My suggestions for improving the code as given: Keep only the minimum needed code inside the loop; everything else should be placed before or after the loop. In particular, move the code that opens the StreamReader before the loop. You have it restarting the file each time through the loop, … | |
Re: The command to search for packages is `apt-cache search`, not `apt-file`. It does not need root permission to run, unlike `apt-get`. According to the instructions of the page you gave, `auto-apt search` would work for this utility. | |
Re: Please post what code you have already and we will give you some advice on fixing what you have. That said, depending on which system calls and other functions you have available with your C/C++ compiler system, you can look at `sleep()` or similar function calls to set a delay. | |
Re: Are the various lists supposed to be syncronized? That is, are the same length, and corresponding elements of each list refer to the same thing or event? If so, you might want to consider using a class that incorporates all that information and then make a *list* or *map* of … | |
Re: This is actually a dangerous situtation. The pointer `a` is expecting to point to an existing object of class `derive2` or one of its derived classes, but you have it pointing to essentially a random point in memeory, because you have not initiallized the pointer. You have actually **not** created … | |
Re: That kind of error does indeed indicate that your computer does not have something installed that the upgraded package depends on. First make sure that you have updated the repository lists on your computer. `sudo apt-get update && sudo apt-get upgrade` If you still get the message that some packages … | |
Re: > I want to disable unity interface on the side and have something like what I had in 10.10. Is that possible? That is exactly what I did when I installed 12.04 LTS on my Linux laptop. I installed the `gnome` package and then the next time I logged in, … | |
Re: As an Ontarion (the most populus English speaking province of Canada) I speak pretty much just English, with really rusty French. So I guess I am generally unilingual. Now as far a programming languages.... I do have the ability/habit of picking up the accents of people I am listen to … | |
Re: What specifically do you need help in understanding this code? | |
Recently, I saw somebody start a "Deal or No Deal" game in the Posting Games section. This got me thinking of writing a program to actually play the game based on the rules of the show. So I spent a couple of hours writing this in ANSI-C. I probably should … | |
Re: You could try: #/bin/sh yes > /tmp/tmpout command < /tmp/tmpout rm /tmp/tmpout You could even put it in a shell script, but then you could go back to using the pipe then as well. | |
Re: Most Linux distros, including Opensuse, have an SFTP/SSH server called OpenSSH installed and active by default. An FTP server and a telnet server are available for download and installation but they are less preferred because they are less secure and have fewer features. You would have to set these up … | |
Re: I upgraded my old laptop, which does not support PAE, by downloading and using the 12.04 LTS **mini** installer. It will download what it needs from the internet, including the non-PAE generic kernal, from the repositories, so everything will be up to date. Just make sure you have a way … | |
Re: Boot to Mint. Make sure you have `grub-pc` package installed. Run `sudo update-grub` from the command line in a terminal. This should detect which operating systems are installed and update the boot list accordingly. | |
Re: In ANSI-C++, you can use the vargs mechanism. I have not tried this in MS-Managed C++. First, `#include <stdarg.h>` at the start of your source file that will be using this capability. Actually first, think, "Do I really need to do this, or am I just being lazy in my … | |
Re: Because of the way that `pow` and `sqrt` are written internally, it is usually much more efficient to multiply doubles rather than using these functions for squaring operations. { Sum_of_sq1 = Side1*Side1 + Side2*Side2; Sum_of_sq2 = Side1*Side1 + Side3*Side3; Sum_of_sq3 = Side2*Side2 + Side3*Side3; if (Sum_of_sq1==Side3*Side3 || Sum_of_sq2==Side2*Side2 || Sum_of_sq3==Side1*Side1) … | |
Re: Please give more details. What programming features are you using? What code is not working the way you expect? Please post the suspect code if you want help with it. | |
Re: When you create a data adapter, it knows that it is dealing with "Table", so you have to tell it to map that internal "Table" to your table, or as you have seen, things don't work too well; it tries to access your database object called "Table", which is not … | |
Re: Reverse the order of an array, perhaps? Please show what you have tried already to identify when a number is received as a binary value or a decimal one. We can then give you refinements of your idea. Read your notes from class and your textbook, if you have one, … | |
Re: You can call the `Sub Form_Enter` from your `Sub Form_Load`; just pass the `sender` and `e` you got from the function call. `Form_Enter(sender, e)` | |
Re: You might want to change `Do While Not afile.EndOfData` to `Do Until afile.EndOfData` One less operation, making it easier to read and maintain, and maybe a little faster. Also, in your `Catch` block, I would use `Continue Do` instead of `Exit Do`. Just because one line is messed up does … | |
Re: First of all, in your CheckChanged handlers, check to make sure the option button/radio button has a value of 1. If 0, then this indicates that the current button is losing a previous selection. If you don't do this, you will generate unnecessary random numbers and may set the random … | |
Re: So what is your actual question regarding this code? What do need help understanding? | |
Re: Speaking as a teacher, obtuse code is also a pain to mark, let alone maintain. | |
If am writing a VB.Net module for a project I am working on and have decided to try out different ways of doing some things, without getting rid of the older code that worked. I am selecting between these methods by setting a `#Const` at the beginning of the Module … | |
Re: You are assigning, not appending. Use **&=** instead of **=** to append the given string literal to the string variable in question. By using equals assignment, you keep replacing the string variable, so only the last assignment survives. Watch your brackets. In line 21, you have too many closing brackets … | |
Re: What kind of errors are you getting? How does it not work? What version of Access are you using? Data Access Pages only exist in Access 2003 and 2007. | |
What is the recommended way to make changes to a code snippet that I have posted after the half-hour edit period is over? Would it be to add another posting with the new code or make a new posting and somehow invalidate the original, or could the edit period be … | |
Re: Do you mean you want to scramble the order of things in an array, like shuffling a deck of cards? In that case go through the array a couple of time, swapping each element with one that has been randomly chosen from elsewhere in the array. That ought give you … | |
Re: I would like to suggest a second button for **Cancel** beside the current **Submit**. | |
Re: I am hearing on the radio this morning that Long Island and Manhatten took the brunt of the storm. The subway appears to be flooded as well. New Jersey is not doing too well either. Here in the Toronto area, we had only one fatality. My prayers are with the … ![]() | |
Re: In VB.Net, the lower bound of an array is always 0, so you could change that. You are missing an opening parenthesis in front of UBound, or get rid of the closing bracket after the +1. After the +1), there should be a new line; the assignement should be on … | |
Re: Make sure that the machine with the weird behaviour has all the latest Windows Updates. What is different about that one machine? Does it have something installed that no one else does? Is it missing something that everyone else has? Does restarting the application on any of the other computers … | |
Re: There are a few methods for Structures, but there is more support for Classes. The easiest is to just assign the elements one at a time. Dim empTest As Employee empTest.inta = 1 empTest.strs = "Bill White" To create an initializer, you need to create a Sub New and pass … | |
Re: What about not adding the record to the listview if the Attendance = "OUT"? That way, the user is not tempted to choose an invalid entry. | |
Re: When you say your function will return a string, you need to return a string in every execution path. You need to return the result of the concatenation to the calling function. Also, take the return values from the recursive calls and concatentate them to this call's return value. I … | |
Re: What is the value of *custstr* when you get this error message? I think the **SELECT** statement may be malformed. Try using **VALUES** instead. BTW, this is VB.Net, not VB4/5/6; please post in the correct forum for a faster and more accurate response. |
The End.