What are forward declarations in C++?

What are forward declarations in C++?

At: http://www.learncpp.com/cpp-tutorial/19-header-files/The following is mentioned:add.cpp:int add(int x, int y){ return x + y;}main.cpp:#include int add(int x, int y); // forward declaration using function prototypeint main()

What is DOM Event delegation?

What is DOM Event delegation?

Can anyone please explain event delegation in JavaScript and how is it useful? 1:DOM event delegation is a mechanism of responding to ui-events via a single common parent rather than each child, through the magic of event "bubbling" (aka

console.log() async or sync?

console.log() async or sync?

I am currently reading Async Javascript by Trevor Burnham. This has been a great book so far.He talks about this snippet and console.log being 'async' in the Safari and Chrome console. Unfortunately I can't replicate this. Here is the code

Why do I need to override the equals and hashCode methods in Java?

Why do I need to override the equals and hashCode methods in Java?

Recently I read through this Developer Works Document. The document is all about defining hashCode() and equals() effectively and correctly, however I am not able to figure out why we need to override these two methods. How can I take the d

objective C underscore property vs self

objective C underscore property vs self

I'm was playing around with the standard sample split view that gets created when you select a split view application in Xcode, and after adding a few fields i needed to add a few fields to display them in the detail view.and something inte

What are the differences between typedef and using?

What are the differences between typedef and using?

What are the differences between usingtypedef Some::Nested::Namespace::TypeName TypeName;orusing Some::Nested::Namespace::TypeName;to provide the shorthand TypeName in the local scope? 1:typedef gives an alias name for the type. typed

Subfolders in .gitignore

Subfolders in .gitignore

I have many subfolders in my repo, in which there are few build/ directories I'd like to ignore when committing my code. As I understand it, there are two ways to ignore all of the folders:*/build/ (Unix wildcards)build/ (git way of ignorin

In python, if a function doesn't have a return statement, what does it return?

In python, if a function doesn't have a return statement, what does it return?

Given this example function:def writeFile(listLine,fileName): '''put a list of str-line into a file named fileName''' with open(fileName,'a',encoding = 'utf-8') as f: for line in listLine: f.writelines(line+'\r\n')

CSS - Internet Explorer and the  tag background

CSS - Internet Explorer and the tag background

I have a pretty simple layout which renders fine in both Firefox and Chrome, but Internet Explorer (version 11) seems to be unable to render any kind of background color for the element.I have the element as a child of the element and ne

“No source file named” error debugging Eclipse CDT

“No source file named” error debugging Eclipse CDT

I've got a project with a shared library (loaded dynamically), and I'm attempting to debug it. I get the following error message:No source file named /home/username/Code/path/to/project/MyFile.cpp.After having searched other threads, I've

Are there primitive types in Ruby?

Are there primitive types in Ruby?

I'm a Java developer who is just starting to learn Ruby. Does Ruby have any primitive types? I can't seem to find a list of them. If not, why? 1:A core principle of Ruby is that all data should be represented as objects. Other languages

Protractor “by.css()” vs “$()” Dollar Sign vs “$$()” 'Bling Bling'

Protractor “by.css()” vs “$()” Dollar Sign vs “$$()” 'Bling Bling'

I don't really understand what the $ and $$ commands are for. I thought they are just a replacement for 'by.css' but why the $$? I thought, that given the above, these would be equivalent:element(by.css('#eId'));andelement($('#eId'));Howeve

A .bat File, “Call” or Not to “Call”, That is the

A .bat File, “Call” or Not to “Call”, That is the

If from inside a bat file you called another batch file but still had a few remaining operations to complete, how can you make sure that the call to first bat file will after completion or error, will return to the file that called it in th

Quickest way to find the complement of two collections in C#

Quickest way to find the complement of two collections in C#

I have two collections of type ICollection; c1 and c2. I'd like to find the set of items that are in c2 that are not in c1 where the heuristic for equality is the Id property on MyType.What is the quickest way to perform this in C#.Edit: C#

How much should I worry about the Intel C++ compiler emitting suboptimal code for AMD?

How much should I worry about the Intel C++ compiler emitting suboptimal code for AMD?

We've always been an Intel shop. All the developers use Intel machines, recommended platform for end users is Intel, and if end users want to run on AMD it's their lookout. Maybe the test department had an AMD machine somewhere to check w

How to launch my app via NFC tag?

How to launch my app via NFC tag?

I'm currently working on porting an app to UWP. The app has a page with a "Write to NFC" button. After the user taps it, it waits for an NFC tag and writes a LaunchApp:WriteTag binary message.What worked fine under WP8.1, doesn't work at al

Typescript primitive types: any difference between the types “number” and “Number” (is TSC case-inse

Typescript primitive types: any difference between the types “number” and “Number” (is TSC case-inse

I meant to write a parameter of type number, but I misspelled the type, writing Number instead. On my IDE (JetBrains WebStorm) the type Number is written with the same color that is used for the primitive type number, while if I write a nam

Difference between providers of Component decorator and NgModule decorator in Angular 2

Difference between providers of Component decorator and NgModule decorator in Angular 2

providers array of Component decorator @Component({ moduleId: module.id, selector: 'hero-list', templateUrl: './hero-list.component.html', providers: [ HeroService ] }) export class HeroListComponent implements OnInit { /

In Objective-C, when should I use property and when should I use instance variable?

In Objective-C, when should I use property and when should I use instance variable?

I'm not familiar with the program language which has both property and instance variable.So I don't know good ways to use property and instance variable.Now I use only properties in my Objective-C code and I don't use any instance variables

Type definition with a trait: Differences of specifying an explicit lifetime bound?

Type definition with a trait: Differences of specifying an explicit lifetime bound?

I'm having issues understanding the lifetime bound requirements when I use a trait in a type definition. For instance:trait Kind { /* ... */ }type CollectionOfKind = Vec;// => error: explicit lifetime bound requiredThe requirement for lifet

Using WrapPanel and ScrollViewer to give a multi-column Listbox in WPF

Using WrapPanel and ScrollViewer to give a multi-column Listbox in WPF

I’m making a simple LOB app which loads data from an XML file and displays it in a list with a few buttons for editing.In my first attempt, everything was ok except that the list scrolled downwards in one long column. I would prefer the dat

Rotate and crop

Rotate and crop

I'm rotating and cropping a image with PHP, but I get the black border showing, I know you can change the background color, but I want to rotate and crop the image to fill the whole image. Basically something similar to background-size: cov

Operate on pairs of rows of a data frame

Operate on pairs of rows of a data frame

I've got a data frame in R, and I'd like to perform a calculation on all pairs of rows. Is there a simpler way to do this than using a nested for loop?To make this concrete, consider a data frame with ten rows, and I want to calculate the d

Java generics, Unbound wildcards  vs

Java generics, Unbound wildcards vs

I've read a few topics which cover certain questions about generics, such as their relationship with raw types. But I'd like an additional explanation on a certain line found in the Java SE tutorial on unbound generics .According to a sent

Is C# 4.0 compile-time turing complete?

Is C# 4.0 compile-time turing complete?

There is a well-known fact that C++ templates are turing-complete, CSS is turing-complete (!) and that the C# overload resolution is NP-hard (even without generics).But is C# 4.0 (with co/contravariance, generics etc) compile-time turing co