What does it mean to evaluate cobol?
The word evaluate in the programming language COBOL can be used to replace a nested if statement. Instead of long statement evaluate allows one to shorten the coding required and write cleaner code.
What is code switching in easy terms?
Code switching is the process of switching back in forth between two languages in the same conversation. It is sometimes done because some words are easier to say in one language or the other.
Yes, this is correct.
In terms of the compiled machine language, the variable represents a memory location. So, anytime the variable is referenced, and you either set the variable to a value, or retrieve a value from the variable, you are actually referencing the memory location pointed to by the variable.
Why doesn't the string class have to be imported into your programs?
The String class is part of java.langpackage which is automatically and implicitly imported in all classes. In other words, adding the statement "import java.lang.String" is redundant.
In what programming language is SSCANF a reference?
SSCANF is the Go Programming Language and originated from the C Programming Language. SSCANF is a function that reads data with specified format from a given stream source.
Non-canonical data is that which has not been put into some standard or agreed or canonical form for the sake of efficiency or security or some other purpose.
Here is a kind of non-canonical data that occurs in clinical trials results. Physicians participating on trials often record offering patients acetylsalycylic acid but they record this in various ways:
ASA
A.S.A.
A.s.a.
aspirin
Aspirin
acetylsalycylic acid
Statisticial analysis of data is almost always easier if these variants can all be mapped to one that appears in the pharmacopoeia for the country whose laws are governing the trial. The original data would usually be left on the trial's database but they would be made available for subsequent processing in canonical form. Perhaps all of these data values would be recoded as 'aspirin'.
Please see the link.
What does it mean when a webpage says 'syntax error'?
When a webpage displays a "Syntax Error" it means that the code for the particular page was written incorrectly and does not follow standard rules of the Syntax programming language so nothing except the error will be displayed as the code cannot be understood.
What is the GM Family First program?
The GM Family First program is where family members of a GM employee can lease or purchase a new GM vehicle but get it at the price the employee pays. They even will let you combine the discount with most current offers as well!
What are the benefits of using the gSOAP software?
gSOAP is a programming language. The main benefits are the ease of use of the software, and the low cost involved in purchasing it. Upgrades are provided free of charge.
What are the main specifications of the KML programming language?
The KML programming language includes specifications for features for viewing in Google Earth, Maps and Mobile and other geobrowser programs. The current specification for KML is 2.2.
What kind of program is TeamView?
TeamViewer is a computer program that allows a person to share things through other nearby computers. It is a great program to use at school or for an important business meeting.
What is correct - each program has or each program have?
"Each" is a singular word, so "Each program has . . ." is correct.
What type of binary coding does Xusenet use?
Uuencode is the oldest code that xusenet uses to program it's binary coding and is considered a reliable source of coding by many of its many international computer users.
What languages is the software Blender written in?
The code of Blender includes programming languages C (most lines), C++ (second most lines) and Python (the least amount of lines). Altogether, there are more than 300,000 lines of script.
Depending on the configuration of the servers and clients, most any modern language could be acceptable, including, but not limited to, Java, Silverlight, HTML5/JavaScript, Perl, PHP, and Ruby. Of course, traditional languages such as C++ are also up to this task. The language of choice will be ultimately determined by time needed to develop, the associated costs, the intended use of the application (e.g. desktop application, web application), target platform(s), and so on. Internet-based solutions depend on additional security settings, such as Java requiring a signature for cross-server communication, or Flash's need for a crossdomain.xml file, while traditional applications will need more security permissions on the operating system, such as firewall access and user approval for installation.
What is the process of creating a new derived class from a base class?
To derive a new class from an existing class, your new class must inherit from the existing class. This is achieved in the declaration of the class:
class oldclass{};
class newclass : public oldclass {};
In the above example, newclass inherits publicly from oldclass. What this means is that the public and protected members of oldclass are public and protected members of newclass. If you specify protected inheritance, the public members of oldclass become protected members of newclass. If you specify private inheritance, the public and protected members of oldclass become private members of newclass. Regardless of the type of inheritance specified at this point, you can still override the access of individually inherited members. In most cases you will use public inheritance unless there is a specific need to alter access rights to the base class members. Note that this does not affect the base class itself; only objects derived from the base class are affected.
Having inherited the base class and all its public and protected members, you can then override the base class behaviour to provide more specific methods and data members for your derivative. However, note that only virtual methods are expected to be overridden. If you override a non-virtual method, you will effectively hide the base class method along with any and all overloads of that method. Thus it is important to ensure the base class has a virtual destructor. If it doesn't, this will only lead to problems when your derived class falls from scope because derived classes must be destroyed in sequence, from the most-derived to the least-derived. This can only be achieved when all destructors other than the most-derived destructor are declared virtual.
It should also be noted that there's no point in having a base class with no virtual methods other than the destructor. The only reason for having a virtual destructor in the first place is because the base class has one or more virtual methods.
Abstract base classes are similar to normal classes except they also contain one or more pure-virtual methods. This means that you must provide an implementation for all the pure-virtual methods inherited from the base class (with normal virtual methods, overriding is optional) otherwise your derivative becomes an abstract base class itself. However, derived classes can inherit implementations of pure-virtual methods from other intermediate base classes, other than the one that initially declared the method pure-virtual, which itself may or may not provide an implementation.
It's often the case that, where an implementation is provided by a base class virtual method, you are expected to call that method from your derived class override. However some implementations may be expected to be completely overridden. The documentation for the base class will determine if and when to call the base class implementation.
In some cases, you may wish to derive a class from two or more base classes, known as multiple inheritance. To do so, you simply provide a comma-separated list, like so:
class base1{};
class base2{};
class derived : public base1, public base2 {};
When you combine multiple inheritance with multi-level inheritance, be aware that this may result in two or more instances of a common base class:
class base {};
class inter1 : public base {};
class inter2 : public base {};
class derived : public inter1, inter2 {};
This creates an ambiguity because derived inherits two separate instances of base, one from inter1 and the other from inter2. There are various ways to remove the ambiguity, however the preferred method is to make base a virtual base class, like so:
class base {};
class inter1 : virtual public base {};
class inter2 : public virtual base {};
class derived : public inter1, inter2 {};
Note that the virtual keyword can be placed before or after the inheritance specifier, it makes no difference. Now derived will inherit directly from base, and that one instance is shared with both inter1 and inter2. There may still be ambiguity where both inter1 and inter2 override the same virtual method of base, but this can be easily dealt with by providing a more specific override in the derived class.
How to save the program in gw basic?
It tells you at the bottom of the screen: 4 Save''. This means press F4 to save your program and specify the file name. After that you can use F3 to load the program.
Should you avoid local variable scope?
No. In most designs, local variables are considered a good thing thanks to the isolation that they provide (no other code can "abuse" your variable). However, it is important to distinguish between local static variables, local automatic variables, and locally made references to the heap.
Local static variables are initialized only once at application initialization time, and retain their most recently assigned value over multiple invocations of the function which contains them. Local static variables must be used with care and can lead to non-reentrant code (the famous example being the strtok() CRT function). However, these variables are usually great to track the total number of something, or the minimum or maximum value of a particular item, etc.
In C, local automatic variables are the most common form of local variables. These are typically allocated on the stack, so care must be taken when declaring large automatic variables, or when using recursion.
When the size of a local automatic variable is a concern, dynamic memory management method should be considered those maintain a local auto pointer on the stack but place the data in the heap. This method allows to allocate large amounts of data without burden on the stack, and the lifetime of such data is no longer limited by the lifetime of the scope in which it was allocated.
Very rare cases exist where local variables are generally avoided; these are mostly in the area of very resource limited embedded programming.
How do you simplify the square root of 156?
The easiest way before learning to be more efficient is to break it down into it's multiplicative tree. So 156 becomes 78 x 2: 78 = 39 x 2. What is left now is 2 x 2 x 39 (39 is 13 x 3 and does not simply further) and 4 x 39 can be simplified. Pulling out the 4 from the radical becomes 2 * sqrt(39) where sqrt means "Take the square root of" what's in parentheses.
What is an example of a file manager utility?
Task Manager would be a good example of a file manager, it manages all your applications, processes and network activity that the computer and you are using.
Also documents is a good location as it stores all your documents in a secure place.
How to program on engraving machine gravograph is 6000?
To program the Gravograph IS6000 engraving machine, start by installing the appropriate software, such as Gravostyle. Create or import your design using the software, ensuring it is formatted correctly for the engraving process. Once your design is ready, connect the machine to your computer, select the engraving settings (such as depth and speed), and send the job to the machine for execution. Always consult the user manual for specific instructions and safety precautions.
How do you do Particle Swarm Optimization in C plus plus?
#include
#include
#include
struct dimension
{
static const size_t size;
double dimension_0;
double dimension_1;
double& operator[](size_t dim){ return( dim?dimension_1:dimension_0 ); }
dimension():
dimension_0(0.0),
dimension_1(0.0)
{}
};
const size_t dimension::size=2;
struct particle
{
dimension m_position;
double m_fitness;
dimension m_velocity;
dimension m_best_position;
double m_best_fitness;
particle(
dimension position,
double fitness,
dimension velocity,
dimension best_position,
double best_fitness):
m_position(position),
m_fitness(fitness),
m_velocity(velocity),
m_best_position(best_position),
m_best_fitness(best_fitness)
{}
};
static double objective_function(dimension x)
{
return( 3.0 + (x[0] * x[0]) + (x[1] * x[1]) );
}
int main()
{
srand((unsigned)time(NULL));
std::cout<<"\nBegin Particle Swarm Optimization demonstration\n"< std::cout<<"\nObjective function to minimize has dimension = 2"< std::cout<<"Objective function is f(x) = 3 + (x0^2 + x1^2)"< const size_t numberParticles = 10; size_t numberIterations = 1000; size_t iteration = 0; double minX = -100.0; double maxX = 100.0; std::cout<<"Range for all x values is "< std::cout<<"\nNumber iterations = "< std::cout<<"Number particles in swarm = "< std::vector dimension bestGlobalPosition; // best solution found by any particle in the swarm. implicit initialization to all 0.0 double bestGlobalFitness = DBL_MAX; // smaller values better double minV = -1.0 * maxX; double maxV = maxX; size_t i,j; std::cout<<"\nInitializing swarm with random positions/solutions"< for(i=0; i { dimension randomPosition; dimension randomVelocity; for(j=0; j { double lo = minX; double hi = maxX; randomPosition[j]=(hi - lo) * rand() + lo; lo = -1.0 * std::abs(maxX - minX); hi = std::abs(maxX - minX); randomVelocity[j]=(hi - lo) * rand() + lo; } //double fitness = SphereFunction(randomPosition); // smaller values are better //double fitness = GP(randomPosition); // smaller values are better double fitness = objective_function(randomPosition); swarm.push_back( new particle(randomPosition, fitness, randomVelocity, randomPosition, fitness)); // does current Particle have global best position/solution? if( swarm[i]->m_fitness < bestGlobalFitness) { bestGlobalFitness = swarm[i]->m_fitness; bestGlobalPosition = swarm[i]->m_position; } } std::cout<<"\nInitialization complete"< std::cout.precision(4); std::cout<<"Initial best fitness = "< std::cout<<"Best initial position/solution:"< for(i=0; i std::cout<<"x"< double w = 0.729; // inertia weight. see http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=00870279 double c1 = 1.49445; // cognitive/local weight double c2 = 1.49445; // social/global weight double r1, r2; // cognitive and social randomizations std::cout<<"\nEntering main PSO processing loop"< while(iteration++ { dimension newVelocity; dimension newPosition; double newFitness; for(i=0; i { particle& currP(*swarm[i]); for(j=0; j { r1 = rand(); r2 = rand(); newVelocity[j] = (w * currP.m_velocity[j]) + (c1 * r1 * (currP.m_best_position[j] - currP.m_position[j])) + (c2 * r2 * (bestGlobalPosition[j] - currP.m_position[j])); if (newVelocity[j] < minV) newVelocity[j] = minV; else if (newVelocity[j] > maxV) newVelocity[j] = maxV; } currP.m_velocity=newVelocity; for(j=0; j { newPosition[j] = currP.m_position[j] + newVelocity[j]; if (newPosition[j] < minX) newPosition[j] = minX; else if (newPosition[j] > maxX) newPosition[j] = maxX; } currP.m_position = newPosition; newFitness = objective_function(newPosition); currP.m_fitness = newFitness; if(newFitness < currP.m_best_fitness) { currP.m_best_position = newPosition; currP.m_best_fitness = newFitness; } if (newFitness < bestGlobalFitness) { bestGlobalPosition = newPosition; bestGlobalFitness = newFitness; } } } std::cout<<"\nProcessing complete"< std::cout.precision(4); std::cout<<"Final best fitness = "< std::cout<<"Best position/solution:"< for(i=0; i { std::cout<<"x"< std::cout< } std::cout< std::cout<<"\nEnd PSO demonstration\n"< } Output Begin Particle Swarm Optimization demonstration Objective function to minimize has dimension = 2 Objective function is f(x) = 3 + (x0^2 + x1^2) Range for all x values is -100 <= x <= 100 Number iterations = 1000 Number particles in swarm = 10 Initializing swarm with random positions/solutions Initialization complete Initial best fitness = 3917271700003.0000 Best initial position/solution: x0 = 1423700.0000 x1 = 1374900.0000 Entering main PSO processing loop Processing complete Final best fitness = 3.0000 Best position/solution: x0 = 0.0000 x1 = 0.0000 End PSO demonstration