Difference between require, include, require_once and include_once?

Difference between require, include, require_once and include_once?

In PHP:When should I use require vs. include?When should I use require_once vs. include_once? 1:There are require and include_once as well.So your question should be... When should I use require vs. include?When should I use require_once

onClick within Chrome Extension not working

onClick within Chrome Extension not working

This seems to be the easiest thing to do, but it's just not working. In a normal browser the .html and .js files works perfectly, but in the Chrome extension the onClick function is not performing what it's supposed to do..js file:function

When do you use the “this” keyword? [closed]

When do you use the “this” keyword? [closed]

I was curious about how other people use the this keyword. I tend to use it in constructors, but I may also use it throughout the class in other methods. Some examples:In a constructor:public Light(Vector v){ this.dir = new Vector(v);}El

Disable/enable an input with jQuery?

Disable/enable an input with jQuery?

$input.disabled = true;or $input.disabled = "disabled";Which is the standard way? And, conversely, how do you enable a disabled input? 1:jQuery 1.6+To change the disabled property you should use the .prop() function.$("input").prop('disa

Chrome Extension Message passing: response not sent

Chrome Extension Message passing: response not sent

I am trying to pass messages between content script and the extensionHere is what I have in content-scriptchrome.runtime.sendMessage({type: "getUrls"}, function(response) { console.log(response)});And in the background script I havechrome.

How to check the delivery status of Firebase message sent to an Android application?

How to check the delivery status of Firebase message sent to an Android application?

I am testing the Firebase JSON to check the delivery receipts of the notification sent to the news app. I can successfully send the message to the Android app without any issues and I receive the message on my Android app. However, I want t

What is the default for AngularJS directive scope?

What is the default for AngularJS directive scope?

What is the default scope value of an AngularJS directive? Of course, it is not isolated scope. It is true or false. I can't find any documentation on what it is. 1: "Note, by default, directives do not create new scope -- i.e., the def

Tail recursion on R Statistical Environment

Tail recursion on R Statistical Environment

Does R support proper tail recursion and where can I find documentation about this? 1:It's quite easy to find out that R does not support tail recursion optimization:f Had tail calls been optimized to jumps, then this function would have

Difference between PriorityQueue and TreeSet in Java? [duplicate]

Difference between PriorityQueue and TreeSet in Java? [duplicate]

This question already has an answer here: When should I use a TreeMap over a PriorityQueue and vice versa? 7 answers I am trying to understand when to

How do I launch an application on system startup? (Mac OSX, Cocoa)

How do I launch an application on system startup? (Mac OSX, Cocoa)

I have a program that runs only in the toolbar (w/ time/date, spotlight, etc.) and I want to put an item in the preferences to allow the user to select whether to start my application on the system startup or not. I'm currently lost on wher

qplot and anti-aliasing in R

qplot and anti-aliasing in R

I am using ggplot2 library and am working with the qplot commandI know I can save my output as an anti-aliased image file by using the following command after my qplot ggsave(file="filename.png")But how about my LCD display? is there any wa

Function of Numpy Array with if-statement

Function of Numpy Array with if-statement

I am using Matplotlib and Numpy to produce some plots. I wish to define a function which given an array returns another array with values calculated elementwise, for example:def func(x): return x*10x = numpy.arrange(-1,1,0.01)y = func(x

What is the default buffer size for StreamWriter

What is the default buffer size for StreamWriter

For the public StreamWriter(Stream stream) constructor, MSDN says Initializes a new instance of the StreamWriter class for the specified stream by using UTF-8 encoding and the default buffer size.I want to use one of the other constructo

How do I Update the Content in Jquery UI Tooltip in Realtime?

How do I Update the Content in Jquery UI Tooltip in Realtime?

I have an element that when hovered over, it displays the price of the item (in a game). I'm using the jQuery UI tooltip to power the display of the information about each item. When the item is clicked, jQuery captures the click, uses a $.

R writing style - require vs. ::

R writing style - require vs. ::

OK, we're all familiar with double colon operator in R. Whenever I'm about to write some function, I use require(), but I was always thinking about using :: instead. Using require in custom functions is better practice than library, since r

Why does this ElasticSearch scan and scroll keep returning the same scroll id?

Why does this ElasticSearch scan and scroll keep returning the same scroll id?

So first I run the following:curl -s -XGET http://localhost:9200/my_index/_search?scroll=1m&search_type=scan&size=10This returns a scroll id which I then use in the first scroll request:curl -s -XGET http://localhost:9200/_search/scroll?scr

Detecting EOF in C

Detecting EOF in C

I am using the following C code to take input from user until EOF occurs, but problem is this code is not working, it terminates after taking first input. Can anyone tell me whats wrong with this code. Thanks in advance.float input;printf("

Rotate rectangle around its own center in SVG

Rotate rectangle around its own center in SVG

I have following piece of code : When I translate rectangle without rotation, it is working fine. But when I rotate it, I wanted to rotate it around its center axis point. What should I need to pass to rotate attribute? 1:You just nee

Compare TinyMCE and CKeditor for a Wiki

Compare TinyMCE and CKeditor for a Wiki

For a custom wiki django-wakawaka, i want to be able to add a WYSIWYG support.TinyMCE is obviously the most popular plugin, used even by Wordpress.But CK-editor seems more feature full.Those who have used either of these or both, which is b

Activating Network Location Provider in the Android Emulator?

Activating Network Location Provider in the Android Emulator?

Is it possible to activate the network location provider on the android emulator? Maybe with a fake cellid? 1:I believe that what you want to achieve is not possible at the moment. You cannot put mock location data to the emulator's netw

Calling NSString method on a String in Swift

Calling NSString method on a String in Swift

Apple's Swift documentation states that If you are working with the Foundation framework in Cocoa or Cocoa Touch, the entire NSString API is available to call on any String value you createIf I have a String object egvar newString: String

How do you set a focus on Textfield in Swing?

How do you set a focus on Textfield in Swing?

I have created one form using Swing in Java.In the form I have used one textfield on which I have to set the focus whenever I press the key.How to set focus on a particular component in Java ? 1:Would Component.requestFocus() give you wh

jQuery UI dialog - check if exists by instance method

jQuery UI dialog - check if exists by instance method

I'd like to use instance method for testing if jQuery UI Dialog widget has been initialized or not. Regarding to API, this is possible, but it doesn't work for me:Uncaught Error: cannot call methods on dialog prior to initialization; attemp

Scraping/Parsing Google search results in Ruby

Scraping/Parsing Google search results in Ruby

Assume I have the entire HTML of a Google search results page. Does anyone know of any existing code (Ruby?) to scrape/parse the first page of Google search results? Ideally it would handle the Shopping Results and Video Results sections

Keychain - Secure Data Storage

Keychain - Secure Data Storage

I am developing an application with keychain implementation . i am able to create & Save data into keychain . I am using the Keychain Wrapper classes provided By Apple.According to requirement , I have to implement best possible Security in