answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What is a Unix or Linux variant?

The original UNIX was an operating system developed by Bell Labs in the early 70's. What makes UNIX significant is that many of the ideas that were part of it became standards in computers, even today.

As time passed, those standards evolved, and became the basis for a number of newer systems, such as BSD, Linux, and even Mac OS X. Since they share similar standards they are called "UNIX variants".

In 1992, Linux was created. What makes Linux different from many of the other UNIX variants is that no one owns Linux, and it is essentially "community property". It has been freely adapted for many purposes.

Linux "distributions" are versions of Linux that are tailored for a specific audience. Since no one person's needs are exactly the same, there are many different versions to choose from.

They are the same operating system, just with different things added.

What is the micro-texture of pavement?

Macrotexture is defined as texture ("bumps and dips") in a pavement with a wavelength (distance from "bump" to "bump) less than .5 mm.

How do you add verification steps to tests?

we can add verification steps through various Checkpointsin QTP

We can also verify the script through VerifyFilemethod.

A word for writing computer software?

The work for writing computer software is programming.

Programming is a name for writing computer software.

What is difference between getimage and putimage in c plus plus?

#include <iostream.h>

#include <conio.h>

# include <process.h> //exit(0)

# include <dos.h>

# include <stdlib.h>

# include <graphics.h>

# include <stdio.h>

int MaxX, MaxY, MidX, MidY ;

int bri[5][20] ;

bricks(); //to display bricks and paddle and bulb rounded form

delbrick(int,int);

int graphmode= CGAHI, graphdriver = CGA; //CGAHI = 640 x 200 (col x row)

void MousePos(int* x)

{ union REGS in,out;

in.x.ax=3;

int86(0x33,&in,&out);

*x=(int)out.x.cx;

}

main()

{

int BallX, BallY, Base1, Base2, dx = 1, dy = -1, OldX, OldY ;

int totallayer[5] = { 10, 20, 30, 40, 50 }, max = 50, layer = 4 ;

int i, flag = 0, speed = 10, score = 0, chance = 4, areareq ;

char *m1, *m2 ; //pointers to memory

initgraph ( &graphdriver, &graphmode, "c:\\tc\\bgi" ) ;

MaxX = getmaxx() ;

MaxY = getmaxy() ;

MidX = MaxX / 2 ;

MidY = MaxY / 2 ;

/* draw the four layer of bricks, the paddle and the ball */

rectangle ( 0, 0, MaxX, MaxY - 12 ) ;

bricks() ;

rectangle ( MidX - 25, MaxY - 19, MidX + 25, MaxY - 12 ) ;

circle ( MidX, MaxY -25, 12 ) ;

/* memory allocation for storing the image of the ball */

areareq = imagesize ( MidX - 12, MaxY - 18, MidX + 12, MaxY - 8 ) ;

m1 =((char*) malloc ( areareq )) ;

/* memory allocation for storing the image of the paddle */

areareq = imagesize ( MidX - 25, MaxY - 7, MidX + 25, MaxY - 1 ) ;

m2 =((char *) malloc ( areareq ) );

/* image of the paddle and the ball is stored into allocated memory */

getimage ( MidX - 12, MaxY - 7 - 12 - 12 + 1, MidX + 12, MaxY - 8 -12,m1 ) ;

getimage ( MidX - 25, MaxY - 7 - 12, MidX + 25, MaxY - 1 - 12, m2 ) ;

/* store current position of the paddle and ball */

Base1 = MidX - 25 ;

Base2 = MaxY - 19 ;

BallX = MidX - 12 ;

BallY = MaxY - 7 - 12 + 1 - 12 ;

/* display balls remaining ( initially 3 ) */

gotoxy ( 45, 25 ) ;

cout<< "Balls :" ;

for ( i = 0 ; i < 3 ; i++ )

{

circle ( 515 + i * 35, MaxY - 5, 12 ) ;

}

/* display starting score */

gotoxy ( 1, 25 ) ;

cout<< "Score: ";

gotoxy(16,25);

cout<<score;

while ( !kbhit() )

{

flag = 0 ;

/* saving current x and y coordinates of the ball */

OldX = BallX ;

OldY = BallY ;

/* update ballx and bally to move the ball in correct direction */

BallX = BallX + dx ;

BallY = BallY + dy ;

/* according to the position of ball the layer of bricks isdetermined*/

if ( BallY > 40 )

{

max = 50 ;

layer = 4 ;

}

else

{

if ( BallY > 30 )

{

max = 40 ;

layer = 3 ;

}

else

{

if ( BallY > 20 )

{

max = 30 ;

layer = 2 ;

}

else

{

if ( BallY > 10 )

{

max = 20 ;

layer = 1 ;

}

else

{

max = 10 ;

layer = 0 ;

}

}

}

}

/* if the ball hits the right boundary, move it to the left */

if ( BallX > ( MaxX - 24 - 1 ) )

{

BallX = MaxX - 24 - 1 ;

dx = -dx ;

}

/* if the ball hits the left boundary, move it to the right */

if ( BallX < 1 )

{

BallX = 1 ;

dx = -dx ;

}

/* if the ball hits the top boundary, move it down */

if ( BallY < 1 )

{

BallY = 1 ;

dy = -dy ;

}

/* if the ball is in the area of the bricks */

if ( BallY < max )

{

/* if there is no brick at the top of the ball */

if ( bri[layer][ ( BallX + 10 ) / 32 ] 800 - ( ( 4 - chance ) * 10 ) )

{

outtextxy ( MidX, MidY, "Winner !!" ) ;

if ( score < 800 )

outtextxy ( MidX, MidY + 30, "Try to score 800" ) ;

else

outtextxy ( MidX, MidY + 30, " GREAT!" ) ;

closegraph() ;

restorecrtmode() ;

exit ( 0 ) ;

}

/* introduce delay for few seconds */

delay ( speed ) ;

/* put the image of the paddle at the old coordinates */

putimage ( Base1, Base2, m2, OR_PUT ) ;

/* erase the image of the paddle at the old coordinates */

putimage ( Base1, Base2, m2, XOR_PUT ) ;

MousePos(&Base1);

/* if paddle goes beyond left boundary */

if ( Base1 < 1 )

Base1 = 1 ;

/* if paddle goes beyond right boundary */

if ( Base1 > 588 )

Base1 = 588 ;

/* put the image of the paddle at the proper position */

putimage ( Base1, Base2, m2, XOR_PUT ) ;

}

closegraph(); /* Return the system to text mode */

return(0);

}

bricks()

{

int i, j, lx = 0, ly = 0 ;

for ( i = 0 ; i < 5 ; i++ ) /* 5 rows */

{

for ( j = 0 ; j < 20 ; j++ ) /* 20 columns */

{

rectangle ( lx, ly, lx + 20, ly + 7 ) ;

floodfill ( lx + 1, ly + 1, 2 ) ;

lx = lx + 32 ;

}

lx = 0 ;

ly = ly + 10 ;

}

}

delbrick ( int b, int l )

{

/* b - brick number, l - layer */

setcolor ( BLACK ) ;

rectangle ( b * 32, l * 10, ( b * 32 ) + 20 , ( l * 10 ) + 7 ) ;

rectangle ( b * 32 + 1, l * 10, ( b * 32 ) + 20 - 1, ( l * 10 ) + 7 -1 );

rectangle ( b * 32 + 2, l * 10, ( b * 32 ) + 20 - 2, ( l * 10 ) + 7 -2 );

rectangle ( b * 32 + 3, l * 10, ( b * 32 ) + 20 - 3, ( l * 10 ) + 7 -3 );

rectangle ( b * 32 + 4, l * 10, ( b * 32 ) + 20 - 4, ( l * 10 ) + 7 -4 );

rectangle ( b * 32 + 5, l * 10, ( b * 32 ) + 20 - 5, ( l * 10 ) + 7 -5 );

rectangle ( b * 32 + 6, l * 10, ( b * 32 ) + 20 - 6, ( l * 10 ) + 7 -6 );

setcolor ( CGA_YELLOW ) ;

}

What are easy programming languages for becoming a website and software developer?

Hey,

For website developing you'll want to learn html, javascript, asp and such, start with html and you'll just naturaly get to the other languages. for software developing I highly recommend python, it is the easiest language to start with and very powerful (I started with it).

hope this was helpful and good luck!

roy

Which module is supplied along with the programming language translator to make the language easier?

I'm assuming you mean easier to use rather than easier to learn. You also fail to mention which specific language(s) you are referring to so I shall assume that you mean languages such as C or C++, both of which provide a "standard library"; a library (or module) that builds upon the language's built-in types to provide useful functions, algorithms, utilities and types (or classes) that the majority of programmers require in order to make best use of the language.

How many megabytes can you convert to a pdf file?

I think its limited to the amount the software can use on your PC. So it may vary from system to system.

Why programming efficiency is important today?

Efficiency saves time, and time is money. It removes unneeded loops from programs, and the efficient code is usually easier to manage because it means a disciplined programmer.

What is a social paradigm?

Social Paradigm is how the models (archetypes) and history of a person/nation affects it perspective.

How would we write a program that display an equipment color one an input letter match its first letter in turbo c?

#include <stdio.h>

#include <conio.h>

void main()

{

char color;

clrscr();

printf("Enter character (R/G/B): ");

color= getchar();

switch (color)

{

case 'R':

printf ("Red") ;

break;

case 'G':

printf("Green");

break;

case 'B':

printf("Blue");

break;

}

getch();

}

In searching using Boolean operations will give you?

Searching with Boolean operations will only tell you if a value exists or does not exist in a data sequence. Ideally, when searching, you want to return some value that either refers to the value you are looking for or otherwise indicates that the value does not exist. Typically, we define a data sequence with begin and end iterators, where the end iterator is "one past the end" of the sequence, and return an iterator to the value, using the end iterator to denote the value was not found. When searching for multiple occurrences of a value, we typically return a collection of iterators, with an empty collection indicating no values were found.

How can I initialize a type that is a pointer to a struct in Go?

For the purpose of clarification, you cannot initialise types, you can only initialise variables (or constants) of a type. A variable (or constant) is known as an "instance" or "object" of the type. All instances of a type must be named. A pointer variable allows us to "refer" to a named object of the pointer's type. this is achieved by storing the memory address (the starting address) of that object. By changing the address stored in the pointer variable, the same pointer variable can be used to refer to different objects in memory. This is useful when passing objects to functions because if we pass objects directly (by name), the function receives a copy of the object. This is known as "pass by value". However, when a function expects a pointer variable rather than a named variable, the address of the object is copied instead. This is known as "pass by reference" and allows the function to operate (indirectly) upon the object being referenced rather than a copy of the object (any changes to a copy are not reflected in the original object).

Passing by reference is particularly useful when the object is large and complex. To improve efficiency, we must avoid making any unnecessary copies of large or complex objects. Functions that do not modify an object are a prime example; there is no point in copying an object that will not be modified. If we wish a function to modify the object, we must pass the object by reference. The only time we should copy an object is when we're not interested in the modifications made by a function, or when we want to compare the changes that were made. In these cases we simply make a copy of the object before passing that copy to the function by reference. When working with concurrency, however, it is best to use pass by value semantics. In this way, each thread works with a local copy of your object, and thus avoids "race conditions", where one task is accessing an object that is being modified by another task, which can lead to unpredictable results.

Pointer variables are said to "point at" the memory the refer to (hence they are called pointers). To access the value being pointed at, the pointer variable must be dereferenced. However, in the case of pointer to struct variables, the dereferencing is transparent.

All variables in Go are implicitly initialised with the default "zero" value for its type. The zero value of a pointer variable is always "nil" (regardless of which type of pointer). You must never dereference a pointer variable that holds the nil value so always check the pointer is non-nil. Equally, you must never dereference a pointer to an object that no longer exists in memory. Always nil your pointers as soon as you are finished with them.

The following example demonstrates how to initialise a pointer variable to a struct:

package main

import "fmt"

type Point struct {

X int

Y int

}

func main () {

v := Point{1, 2} // instantiate an object of type Point

p := &v // assign the address of v to pointer p (p's type is inferred from v)

fmt.Println(*p) // print the indirect value of v (dereference p)

}

What is the difference between freeware software and open-source software?

Freeware is software for which the author or authors are not seeking monetary compensation. Open-source software is software whose authors have decided to allow other programmers to access the software they have created so as to invite community improvement.

What does the acronym SIDS stand for?

Sudden Infant Death Syndrome

That happens more in male babies then female.

Using EZTRIEVE how do you change low-value fields to blanks?

redefine the fields that contain low-values as alpha-numeric and move ' ' to them.

How does batch file work?

well the text file is made with commands that are read line by line.

then it is saved as nameofbatchfile.bat and has the "all files" file type.

Then you open it and it runs the lines of code. Below is an example script:

_____________________________________________________________________

@echo off

echo This is an example script

echo press a button and this will open good websites on batch

pause

cls

color 02

start Http://pphbatcher.webs.com

start www.commandwindows.com

start www.computerhope.com/batch.htm

________________________________________________________________________

That will open Some of my favorite websites on batch. hope this helps!

2 examples of fields in a database holding details about school pupils?

A Table field is one that stores the data corresponding to one attribute of the table. for a school student db it might be roll number, name, date of birth, grade etc.

Ex:

Name Roll No. Age Grade

John 101 12 5

Julie 102 12 5

Here name, roll no, age etc are fields

What is FIFO in Australia?

generally fifo means FLY In Fly Out for the remote mining sector, or First In First Out.

for the funny side of life FIFO also means fly in fly out - fit in or F#*k off.