answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What is IEnumerable?

I understand the IEnumerator/IEnumerable methods and properties and also how they are interrelated. But I fail to understand from the foreach loop perspective. Say for example, if I say the following line of code, how does the compiler look at foreach loop and break it down to IEnumerable/IEnumerator for every occurance of foreach loop in your code. In other words, what happens under the hood? I tried to go through couple of articles on the web. But they were NOT looked from the foreach loop perspective or I might have failed to understand. Could somebody explain with the example or direct me to any articles that explains clearly. All help is greatly appreciated.

Answer: To keep it short the compiler doesn't do much. It just translates the foreach code into a while under the hood. Here's an example: List list = new List; ........ foreach(int item in list) { //Do stuff

} Becomes: Enumerator enum = ((IEnumerable)list).GetEnumerator(); enum.Reset(); while(enum.MoveNext()) { int item = enum.Current;

//Do stuff

} or something very close to that. The acual code compiled most likely has a try / finally block around the while to dispose the enumerator

Differences between cobol 74 and cobol 85?

COBOL 85 introduced the EVALUATE statement and scope terminators for most statements (e.g., END-READ for READ). It also introduced the ability to pass by content (CALL BY CONTENT).

How do you make mobile application with VB.NET?

You would have to use a version of Visual Studio that can target the .Net Compact Framework. Be aware that the Compact Framework is a SUBset of the .Net Framework, so there will be some missing classes and methods.

How does being computer fluent make you a sawy computer user and consumer?

depending on how fluent you are it can help you know what products arent that great, whats a good deal and what isnt, what products perform well, how to keep your computer running at peak efficiency, know how to manage and delete viruses, spyware, adware, how to multitask so while your computer is doing one thing you can be doing other things on it as well, understand the vastness and incredible potential of the internet etc. etc.

In a DOS batch file how do you copy a local variable to a global variable?

1. Start line with an ENDLOCAL command.

2. Add an ampersand and a SET global = local variable.

3. Repeat step 2 for additional variables.

Notes:

Works vice versa with the SETLOCAL command.

Works in nested arrangements of SETLOCAL and ENDLOCAL.

Local and global variables can have same names.

Spaces are permitted after a SETLOCAL or ENDLOCAL but might get added to a variable's value if put after a SET command so recommend avoiding spaces before the second and subsequent ampersands.

Spaces are permitted but not required after the ampersand and before a SET command.

The first line of this example shows where spaces are allowed, the last line shows where spaces can be omitted.

SETLOCAL & SET LTEMP=%TEMP%& SET PATH=%PATH%

SET LPATH=C:\BAT;%PATH%

SET L1=valueL1

SET P1=valueP1

ENDLOCAL&SET G1=%L1%&SET P1=%P1%&SET PATH=%LPATH%

What is reverse engineering in software?

Reverse engineering is the process of taking a bit of executable code and decompiling it into a representation of its original source code. This is often used to change the functionality of a closed-source program, or to attempt to find out how a competitor in your field solves a problem.

What is the time difference is between GMT and California?

California is in the GMT - 8 timezone. This means that the time difference between Greenwich Mean Time can be found by subtracting 8 hours. Therefore, if it's 11 am on Feb 24th in Greenwich, then it will be 3am on Feb 24th in Los Angeles.

When daylight savings time starts (which varies from year to year) California's time difference ends up being -7 rather than -8. So, on July 2nd at 4:45pm in Greenwich, the time in L.A. will be 9:45am, July 2nd.

A c program of matchstick game?

#include

#include

void main()

{

int matc=21,x,y;

char ch;

clrscr();

printf(" WELCOME TO THE WORLD OF GAMING \n");

printf("");

printf(" MATCH STICK GAME \n");

printf("/n");

printf("PRESS ANY KET TO KNOW THE RULES \n");

scanf("%c",&ch);

printf("This is a game between user and computer \n There are 21 match sticks user have to pick

1,2,3 or 4 match stick in one turn \n One who pick up the last match stick loose the game \n");

printf(" number above 4 is invalid \n");

printf("if u do this computer automatically wins");

printf("ALL THE BEST \n");

for(int i=1;i<=4;i++)

{

printf("pick up the match sticks 1-4 \n");

scanf("%d",&x);

y=5-x;

printf("i have pick up %d \n",y);

matc=matc-(x+y);

printf("the remaining match stick is %d \n",matc);

if(matc==1x>4)

break;

}

if(matc==1)

{

printf(" your turn pick up the last one \n");

scanf("%d",&x);

printf("you loose");

printf("MUMMY KO BOLO COMPLAIN PILAYE \n");

printf("\t THANKS \n");

}

else

{

printf("you loose because of abiding rules");

getch();

}

What are the advantages of linked list over arrays?

# Linked lists do not need contiguous blocks of memory; extremely large data sets stored in an array might not be able to fit in memory. # Linked list storage does not need to be preallocated (again, due to arrays needing contiguous memory blocks). # Inserting or removing an element into a linked list requires one data update, inserting or removing an element into an array requires n (all elements after the modified index need to be shifted).

What is the difference between preprocessor and macros?

Macros, which are special lines/fragments of code, differ from any other code written in the source files in the aspect that it's not passed to the compiler (either for the purpose of encoding into machine instructions, or some intermediate form instructions). Instead, macros perform textual manipulations on the source code before passing it to the compiler, where this process preliminary to compiling the source files is called "preprocessing", and the software component responsible of doing it is called the "preprocessor"

Preprocessors, statements that tell the programming language (c or c plus plus) to perform such task as combining source program files prior to compilation.

by Abrar .s. Hussain

Email for correction: hussainabrar46@gmail.com

What is Data level structure?

three levels of data abstraction

are:

1. Physical level : how the data is

stored physically and where it is

stored in

database.

2. Logical level : what information

or data is stored in the database

(like what is the

datatype or what is format of

data.

3.View level : end users work on

view level. if any amendment is

made it can be

saved by other name.

for the database to be usable it

must retrieve data efficently.this

efficency led designer to use

complex data structure in the

database

What classes should you take in 11th and 12th grade to promote your becoming of a registered nurse?

Biology, Anatomy (if offered), P-Chem, O-Chem (if offerred) all make a good start. Use of major office automation products is a plus.

Where can you download a flv to avi converter?

uSeesoft FLV Converter can do it for you

it can convert FLV and YouTube videos to almost any video/audio format with unmatchable conversion speed and high quality, such as converting FLV to WMV, converting FLV to AVI, converting FLV to MP3, converting FLV to MPEG, converting FLV to MP4, etc.

How do you assign value of one variable to another variable in unix?

If you are asking about shell usage, just assign the value as follows:

first=5

second=2

first=$second

Any 10 advantages on computer?

Some of the advantages of a computer includes is that it helps automate a number of tasks, makes a given type of work easier, solves problems with ease, its is very accurate and efficient as compared to human beings, and helps various schools, factories and hospitals.

What is mean by binary search?

Incomputer science, a binary search algorithm (or binary chop) is a technique for locating a particular value in a sorted list. The method makes progressively better guesses, and closes in on the location of the sought value by selecting the middle element in the span (which, because the list is in sorted order, is the median value), comparing its value to the target value, and determining if it is greater than, less than, or equal to the target value. A guessed index whose value turns out to be too high becomes the new upper bound of the span, and if its value is too low that index becomes the new lower bound. Only the sign of the difference is inspected: there is no attempt at an interpolation search based on the size of the difference. Pursuing this strategy iteratively, the method reduces the search span by a factor of two each time, and soon finds the target value or else determines that it is not in the list at all. A binary search is an example of adichotomic divide and conquer search algorithm.

What is the perfect username?

Just think of things you like for example: a food, color, sport or store and then add your initilals or numbers.

Which is better avi or flv?

avi is an uncompressed file format, no loss of quality, but file size is bigger than flv, flv is used for web video like YouTube, Google Video, Myspace, Metacafe, Dailymotion, iFilm, Music, eVideoShare, StreetFire, etc.

1,It depends on the purpose you use.

2,AVI is a popular media file format, primarily designed for teleivision-clip like material. Each AVI file is encoded with a "codec". A codec is responsible for converting the movie information provided by BB FlashBack into the final AVI file, and replaying it upon viewing.

AVI movies are played with common third party media playing programs such as "Windows Media Player, "RealPlayer" and "WinAmp".

AVI Advantages:

  • Choice of codecs allows experimentation with different results.
  • Plays in mainstream media players such as Windows Media Player.
  • Can be used as a starting point to create playable DVDs.

AVI Drawbacks:

  • The codec used to create your movie is required in order to view it.
  • Often produces larger file sizes than other file formats.
  • Some codecs take a long time to create your AVI movie.
  • Some codecs produce reduced visual quality.
  • AVI format does not support user interactivity (e.g. 'click to continue' pauses).

3,FLV stands for "Flash Video". It is a format designed for web video playback that offers high rates of compression and produces high quality video. FLV is becoming more and more popular on the web since it can easily be embedded in a webpage and is supported by the main operating systems via the Adobe Flash Player and web-browser plugin. At present, FLV is the file format widely used by some famous websites, such as YouTube, Google Video, MySpace, etc.

FLV 's advantages:

  • FLV file sizes are small compared to others (almost 60% less). Thus they take up less space on a server and can be easily downloaded.
  • Flash files can be easily viewed by over 90% of web visitors (mostly due to the Flash player browser plug in) , FLV file plays directly in more browsers than Windows Media, Real Player or QuickTime.
  • A variety of different types of video files can easily be converted to the Flash format.
  • FLV players can be completely customized for logos, brandings and embedded links matching your website or product.
  • FLV players can play files from a database like MySQL or MS SQL Server, and are easy to manage.
  • Flash Communications servers are easier to maintain than others, and are less prone to security threats.
  • Flash can be used for a multitude of uses, for example movies, online presentations, banner ads, internet animations, etc.

FLV files require an FLV player to review. You can free download an flv player, such as Aunsoft FLV Player, Any FLV Player.

To display FLV files on the Internet, you need web based Flash video player. Adobe Corporation haven't offered a player product that can play FLV files. So you have to make it by yourself. There are many tools that can make FLV players for web page.

In the abbreviation NAFTA the t stands for what?

Trade. NAFTA stands for North American Free Trade Agreement. The North American Free Trade Agreement (NAFTA)

What is adobe shockwave?

Adobe Shockwave is a software program that adds animation to web pages. It is also a web browser plugin that allows animated content to be viewed in the browser.

What is lua?

Lua is a powerful, fast, light-weight, embeddable scripting language. Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping. Source: http://www.lua.org/about.html