answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Is it true or false - one problem with OOPS is that once a class is created it can never be changed?

If would have to say false. You would usually add a number of getters/setters to dynamically modify the contents of an object. You can also often respecify one object as another to allow access, for example, to its parent modifiers. You can also build a new class which inherits an existing class and builds upon it.

What is the difference between c and c plus plus and c minus minus?

The main difference between the two is that C++ is an object oriented programming language while C is a structured programming language. Although C++ is derived from C, they are in fact completely separate languages that share a common syntax. However, C++ is backwardly compatible with C so while you may include C-style code within C++ programs, you cannot include C++ code in C programs.

Why is Md5 insecure?

Technically

The algorithm has a greater chance of hash collisions than other, similar hashing algorithms. This means it is less computationally expensive to crack than similar ones (such as SHA-1) and is thus less secure.

For the Layman, briefly:

MD5 is insecure because computer attackers have figured out a way to trick the MD5 security system into verifying that no tampering has occurred, when in fact the attacker has injected malicious code. It's like purchasing a lock for your bike that has a 5 buttons. Pressing one button will open the lock. The criminal can just try every possible combination in a short time, and thus the lock is considered insecure.

Why is MD5 Insecure? Technical answer:

Bob owns some web space on blue host, and he uploads an executable there that he intends other people to download and run so they can install his video game: angry_birds_installer.exe.

Bob uploads angry_birds_installer.exe to blue host and has allowed other people to download it through the browser and install the game so they can install/play it. Bob generates profit by people buying the unlocked version of the game, therefore Bob wants to make absolutely sure that the attacker doesn't use the installer to install malware on the customers who install the game.

Description of the security problem:

Bob's executable is super-insecure now because suppose an attacker breaks in to his blue host account and somehow gets the ability to make a change to angry_birds_installer.exe. The attacker could drop in the new executable, and nobody is the wiser. Now, users who install angry_birds_installer.exe also install Conficker, a malicious bot-net on the customer's computer.

Why would an attacker go to all this trouble?

Answer: profit. The attacker wants to get in between Bob and his customers so he can install Conficker. With that, he can do the following things:

  • Do Distributed Denial of Service attacks to take down the Internet in other countries by taking out the name servers and DNS servers.
  • Launching trillions of spam emails.
  • Acquire credit card numbers and incur charges via identity theft.
  • Draining bank accounts of people who don't check their balance often.
  • Many other brilliant illegal for-profit ideas to freeze your soul.

Bob has a lot to be worried about on behalf of his customers who don't know the difference between browser security, antivirus software and a hole in the ground.

Bob increases security with MD5 Sums

Bob has a plan, he will protect his executable by taking an MD5 check sum on angry_birds_installer.exe and store the result somewhere else (say on his go daddy web space) that has a different security system. The security conscious users who want to run angry_birds_installer.exe will also run an MD5 check sum against the executable they downloaded, and make sure that the check sums exactly match. If they do match, we can be relatively certain that the attacker has not modified the original angry_birds_installer.exe.

Security problem solved?

No. Mal-ware creators are clever, they were able to figure out that MD5 is insecure. They were able to find a way to break the algorithm for MD5 in order to run trillions of MD5 sums every second and find a "hash collision" between the original angry_birds_installer.exe and the modified: angry_birds_with_malware.exe. The attacker only has to compromise the blue host security and can drop-in the new executable that generates the SAME MD5 sum as the original, and the users who do check sums declare that the executable is safe, when it contains malware to install Conficker.

MD5 sum is insecure because Bob thinks he is protecting the users from evil mal ware creators, but in reality, the mal ware creators have figured out a way to completely bypass the security model. MD5 Sums do not deliver any significant security enhancements as it was originally envisioned to be.

Is array list a value type or reference type?

Array lists are objects and are of the reference data types. If you pass an array list from a java method to another as an argument, you need not return this from the target method because the modifications to the list would be happening in its value and hence would be available in the parent or calling method without being received as an output from the called method.

Which license prevails if code stating all rights reserved is put into a public GPL repository by the author or his later employer?

The term "All Rights Reserved" no longer has any meaning because all of the countries it applied to became members of the Berne Union by 2000. All rights reserved is a copyright notice, it is not a license.

If the work states it is under the GPL then the terms of that license apply.

What is prori analysis and posteriori testing of algorithms?

A priori analysis of an algorithm refers to its time and space complexity analysis using mathematical (algebraic) methods or using a theoritical model such as a finite state machine. (In short, analysis prior to running on real machine.)

A posteriori analysis of an algorithm refers to the statistical analysis of its space and time complexity after it is actualy run on a practical machine. (in short, anaysis of its statistics after running it on a real machine)

What does the term data user mean?

A data user is someone who controls the collection, holding, processing, or the use of the data. As examples:

Collection

  1. A Census Enumerator goes into the field and asks residents a series of questions the US Census Bureau needs for population studies.
  2. A sociologist or anthropologist (any Social Sciences researcher) goes into the field to study a particular group, say 8th graders and their experiences of bullying.
  3. A computer company wants to know who uses their website, which pages they visit, what they buy, and also links a survey to some webpages.

Holding

  1. The US Census Bureau collects the forms of census questions that residents filled out.
  2. The 'social science researcher' is often doing the study on behalf of an institution or company. For example, Masters and Ph.D. candidates must do a research study to fulfill the requirements of a degree. A pharmaceutical company hires scientists to study the side effects of a particular drug.
  3. The computer company collects the data they need through use of cookies, web page analytics, and survey forms.

Processing

  • Data may be processed and studied
  1. quantitatively - meaning simply counting the numbers, like 100 people visited x webpage showing sweaters; only 1 person bought a sweater. Census data is typically all quantitative data.
  2. qualitatively - this is a specific type of studying data that isn't about numbers, but about people and their stories. For example, a sociologist may ask questions about bullying to answer "What do 8th grade students do when bullied".
  3. Or Mixed research, which uses Numbers and Stories.

Use of Data

  • Use of data may be restricted, especially to protect privacy. For example, the public does not see census data for 70 years. However, during that time, many researchers and social scientists work with that data, compiling it into meaningful units of information.
  • Data by itself or numbers by themselves offer little meaning without contexts. We want to know what people are doing, for example, census might show a city has 3% less population than 10 years ago. We want to know why people do what they do. We want to know what others do that impact people, and what factors make people do what they do.
  • For social change, researchers might want to apply a study's data to creating a theory that applies to many or most people. For example, The Stages of Death and Dying originated from a study of people who lost a loved one; the data was then generalized to 'most people' and how humans react to death.
  • Data should always have a purpose; if not, why collect it.

To bring this down to an everyday experience, let's talk about a 10th grade student assigned to write a 15 page term paper on the fall of the Berlin Wall. The student:

  1. Reads and Collects "data" from books, journal articles, and popular magazines. He might copy short quotes from these authors. He writes notes on index cards. When he is finished with his "research", he has 35 index cards and 12 notebook pages written with pieces of "data".
  2. Because the student has a term paper due, she "holds" or holds onto this data she collected. She might throw it all away in 6 months, but for now, she is "holding" a select set of "data".
  3. The student must now "do something" with the data collected. This is called processing. During processing, we review each piece of "data". For example, "This author argued that the Berlin Wall was a peacekeeping tactic." Another author said, "The Berlin Wall robbed people of their freedom." These are 2 pieces of "data". Processing involves thinking about how our data fits together. Then, we must think about how we think about the data. For example, even before data collection, a student believed the Berlin Wall interfered with individual freedoms. She found 2 author quotes that say this; and 2 authors disagreed. How will she include both "sides" in her term paper is part of processing the data.
  4. Lastly, every researcher -- even a 10th grade student -- makes detailed decisions about how the data will be used. Let's say the student read 3 books, 24 articles, and 2 popular magazines. He realizes he can't include all the data. He picks 2 books, 2 articles, and both popular magazines that both support and oppose his thesis. He decides how he will write about (use) the data. Who's voice comes first; which "side" takes prominence; how will he show opposing data. "Use of data" in the real world is both short and long term. A HS student can throw away her data after she writes the paper. However, professional research may go on in longitudinal studies over many decades, so protecting the data as it is being used is even more important.

How secondary storage devices are classified?

Secondary storage is?æthe devices for permanent storage and it is not affected if the computer is turned on or not. Secondary storage is?æmostly known as auxiliary storage or external hardware.

What does programming error-exception occurred mean on DVD shrink?

A program error exception in ANY program means that some error occured in the program that was unexpected, hence the word "exception" here. An error that a program expects might happen wouldn't be an exception per se, and it would be programmed to deal with that. You might try to update to a newer version of the program that might have a fix built into it to deal with that, or post a bug report (if it's repeatable) on the creator's website so they know that issue exists.

How do you print series 1 10 2 9 3 8 4 7 5 6 using for loop in c language?

#include<iostream.h>

#include<conio.h>

long int counter1, counter2=10;

int main(){

do{

counter1++;

cout<<counter1<<"-"<<counter2<<"-";

counter2--;

}while(counter1<10);

getch();}

this is the code, is quite easy -- but it is not in C, sadly.

Try this:

int main (void)

{

int i;

for (i=1; i<=5; ++i) printf ("%d %d ", i, 11-i);

printf ("\n");

return 0;

}

Menu driven program that implements singly linked list for the following operations?

#include<stdio.h>

int a[10],i=(-1),st=(-1);

void push();

void pop();

void isfull();

void isnull();

void display();

main()

{

int st=(-1);

int a[10],n,ch,i=(-1);

char choice='Y';

while(choice=='Y' choice=='y')

{

printf(" 1.PUSH\n 2.POP\n 3.IS FULL\n 4.IS NULL\n 5.DISPLAY\n");

printf("Enter your choice :");

scanf("%d",&ch);

switch(ch)

{

case 1:

push();

break;

case 2:

pop();

break;

case 3:

isfull();

break;

case 4:

isnull();

break;

case 5:display();

break;

default:

printf("you have entered a wrong entry.");

}

printf("Do you want to continue?");

scanf(" %c",&choice);

}

}

void push()

{

if(st==(-1))

printf("The stack is empty.");

i=i+1;

if(i>=10)

printf("The stack is full.");

else

{

printf("Enter a number :");

scanf("%d",&a[i]);

st=st+1;

}

}

void pop()

{

if(st==(-1))

printf("The stack is empty. UNDERFLOW condition");

if(st>(-1))

{

printf("The deleted element is :%d",a[i]);

i=i-1;

st=st-1;

}

}

void isfull()

{

if(st<9)

printf("The stack is not full\n");

if(st>=9)

printf("The stack is full");

}

void isnull()

{

if(st==(-1))

printf("The stack is empty");

if(st>(-1))

printf("The stack is not empty");

}

void display()

{

int z;

if (st==(-1))

printf("The stack is empty.");

else

printf("The elements present in the array are :");

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

printf(" %d",a[z]);

printf("\n");

}

Why language is the source of misunderstanding?

Language is the source of misunderstanding because of the confusion that takes place when two persons of different nationalities who only speak their own language try to talk with each other. The Bible speaks of the story of the construction of the Tower of Babel. God gave these people who spoke only one language at that time different languages to speak so that they won't understand each other. The people stopped building the tower as a result and dispersed to the ends of the earth to find their own territory.

Differentitate between overload function and function template?

An overloaded function is a function that has two or more implementations that each operate upon a different type.

Function templates allow the compiler to generate overloaded functions on an as required basis for any function where the implementations only differ by type.

Why CMPS instruction is used in 8086 programming?

The CMPS instruction in the 8086/8088 is compare string. It iterates until CX is zero, or [DS:SI] is not equal to [ES:DI], incrementing (or decrementing if DF is set) SI and DI, and decrementing CX along the way.

How do you draw pascals triangle in gwbasic?

I suggest using an array with as many elements as the longest row you need. To keep it simple, keep two copies of the array, and calculate each element of the "new" array as the sum of the corresponding element, plus the previous element, of the "old" array. Then copy the information back for the next step.

What Boolean logic process could be used to convert the binary form of all decimal digits to the hexadecimal representation of its ASCII character ex 00001000 converted to 00111000 OR 8 converted?

You don't need boolean logic, you simply add 0x30 (48 decimal) to the digit to obtain its ASCII character value. The digits 0 to 9 have ASCII codes 0x30 to 0x39 (48 to 57 decimal), respectively. Therefore adding 48 to any value in the range 0 to 9 will reveal the character code for that value.

Thus the following are all equivalent to obtaining the ASCII character code for the digit '8':

8 + 48 = 56

8 + 0x30 = 56

8 + '0' = 56

56 decimal is 0x38 hexadecimal, or 00111000 in binary.

Note that some programming languages may not support all forms of the above. The last form (8 + '0') is the preferred method where supported as it makes it perfectly clear what the intent is: to add a value to the ASCII code '0'.

Most programming languages permit you to format the underlying binary value as decimal or hexadecimal for printing purposes, so there's usually no need to manually convert to hexadecimal. E.g, for a given value, the following will print the value in both hex and decimal:

printf("Decimal: %d, Hex: %x\n", value, value );

In the interest of completeness, the algorithm for converting any given decimal value to its hex equivalent is as follows (in pseudocode):

  1. Let the output string be an empty string.
    1. Let ch be value % 16 (modus, or remainder of division).
    2. If ch is less than 10, add 48 to ch, otherwise add 65 to ch.*
    3. Prepend ch to the output string.
    4. Let value be value / 16.
  2. While the value is non-zero...
  3. end while
  4. Print the string.**

*65 is the ASCII character code for 'A'. For lower case, add 97 instead (character code for 'a').

**You must prepend characters. If you append them, you must reverse the string before printing.

What is dotnet?

Microsoft's applications development framework.

Most commonly written as: ".Net".

How do you set up instant message?

You need to download the instant messenger service. If you want to use msn messenger and have xp or vista it comes pre installed on those operating systems

Intel GMA X3100 Dynamic Video Memory Technology 4.0 memory?

Many graphic-intensive applications (especially games) require a minimum amount of video memory in order to operate correctly (or even to run at all). So how much video memory does an Intel® chipset-based system with "integrated graphics" have? The answer: it depends. The amount of video memory is dependent upon the amount of pre-allocated memory set for your system plus something called Dynamic Video Memory Technology (DVMT). DVMT, as its name implies, dynamically allocates system memory for use as video memory to ensure the most efficient use of available resources for maximum 2D/3D graphics performance. The amount of video memory allocated depends upon the amount requested by the operating system. When the memory is no longer required, it is returned to the operating system for use by other applications or system functions. DVMT allocates memory based on system needs. Some newer systems have an option in the system BIOS to adjust the amount of memory available for DVMT. Memory can be allocated up to the maximum limit set by the graphics driver. The maximum limit of video memory allocated by DVMT depends on your specific Intel chipset and the version of the graphics driver installed. Specific information for each integrated graphics chipset can be found via the links below. * DVMT White Paper - Mobile Intel® 945GM Express Chipset Family * DVMT White Paper - Intel® 945G Express Chipset Family * DVMT White Paper - Intel® 82865G graphics controller (Intel® 865 chipset family) * DVMT White Paper - Intel® 82852/82855 GM/GME graphics controllers (Intel® 852/855 chipset families) * DVMT White Paper - Intel® 82845G graphics controller (Intel® 845 chipset family) * DVMT White Paper - Intel® 82815 graphics controller (Intel® 815 chipset family) * DVMT White Paper - Intel® 82810 graphics controller (Intel® 810 chipset family)

What is a stack Is it a part of RAM?

The satck is a piece of memory that is allocated on the RAM, that a thread of a computer program uses for most of its variables.

What is the name of the kernel component that uses the iptables rules to filter network traffic?

system-config-firewall (FEDORA) or system-config-securitylevel (RHEL), "that is where you build you firewall"

the netfilter component is a set of tables that hold rules that the kernel uses to control network packet filtering. "Fedora and RedHat Enterprise Linux... fifth edition"

What does the NOTS program have to do with?

The Nots Program has to do with.......this question is on traffic school test