In Python 2, what is the difference between '/' and '//' when used for division?

In Python 2, what is the difference between '/' and '//' when used for division?

Is there a benefit to using one over the other? In Python 2, they both seem to return the same results:>>> 6/32>>> 6//32 1:In Python 3.0, 5 / 2 will return 2.5 and 5 // 2 will return 2. The former is floating point division, and the lat

How to get innerHTML of DOMNode?

How to get innerHTML of DOMNode?

What function do you use to get innerHTML of a given DOMNode in the PHP DOM implementation? Can someone give reliable solution? Of course outerHTML will do too. 1:Compare this updated variant with PHP Manual User Note #89718:<?php functi

What is the most efficient method to groupby on a JavaScript array of objects?

What is the most efficient method to groupby on a JavaScript array of objects?

What is the most efficient way to groupby objects in an array?For example, given this array of objects:[ { Phase: "Phase 1", Step: "Step 1", Task: "Task 1", Value: "5" }, { Phase: "Phase 1", Step: "Step 1", Task: "Task 2", Value: "10

How to flush output of Python print?

How to flush output of Python print?

How do I force Python's print function to output to the screen?This is not a duplicate of Disable output buffering - the linked question is attempting unbuffered output, while this is more general. The top answers in that question are too p

Communicate between two windows forms in C#

Communicate between two windows forms in C#

I have two forms, one is the main form and the other is an options form. So say for example that the user clicks on my menu on the main form: Tools -> Options, this would cause my options form to be shown.My question is how can I send data

“INSERT IGNORE” vs “INSERT … ON DUPLICATE KEY UPDATE”

“INSERT IGNORE” vs “INSERT … ON DUPLICATE KEY UPDATE”

While executing an INSERT statement with many rows, I want to skip duplicate entries that would otherwise cause failure. After some research, my options appear to be the use of either: ON DUPLICATE KEY UPDATE which implies an unnecessary u

JQuery - $ is not defined

JQuery - $ is not defined

I have a simple jquery click eventand a jquery reference defined in the site.master

What is the purpose of the var keyword and when should I use it (or omit it)?

What is the purpose of the var keyword and when should I use it (or omit it)?

NOTE: This question was asked from the viewpoint of ECMAScript version 3 or 5. The answers might become outdated with the introduction of new features in the release of ECMAScript 6.What exactly is the function of the var keyword in JavaScr

How can I sort arrays and data in PHP?

How can I sort arrays and data in PHP?

Due to the enormous and ever repeating amount of "How do I sort my unique snowflake of an array?" questions, this is a reference collection of basic sorting methods in PHP. Please close any question which does not markedly differ as a dupli

commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated

commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated

Sometimes, when using , or , the action, actionListener or listener method associated with the tag are simply not being invoked. Or, the bean properties are not updated with submitted UIInput values.

How is concatenating urls in templates in angular less secure than in other locations?

How is concatenating urls in templates in angular less secure than in other locations?

I have an angularjs template which looks similar to this:However this results in an $interpolate:noconcat error. In contrast to that this template:or even:

Right click on JButton

Right click on JButton

I am trying to write a Minesweeper clone in Java for fun. I have a grid of JButtons whose labels I will change to represent the danger count, flags, etc. My problem is, I don't know how to get a right click on a JButton to depress the but

what is the basic difference between jobconf and job?

what is the basic difference between jobconf and job?

hi i wanted to know the basic difference between jobconf and job objects,currently i am submitting my job like thisJobClient.runJob(jobconf);i saw other way of submitting jobs like thisConfiguration conf = getConf();Job job = new Job(conf,

equals(…) and equalsIgnoreCase(…)

equals(…) and equalsIgnoreCase(…)

Why do we have equals() and equalsIgnoreCase() as two different methods, when equals() could have been overloaded with a special ignoreCase argument to provide equalsIgnoreCase() functionality? 1:The method equals() is inherited from Obj

Hungarian Algorithm: How to cover 0 elements with minimum lines?

Hungarian Algorithm: How to cover 0 elements with minimum lines?

I am trying to implement the Hungarian algorithm in Java. I have an NxN cost matrix. I am following this guide step by step. So I have the costMatrix[N][N] and 2 arrays to track covered rows and covered cols - rowCover[N], rowColumn[N] (1

DesignInstance not working in VS2012

DesignInstance not working in VS2012

I just spent several hours on an issue when using VS2012, WPF 4.5 and design-time data, specifically the DesignInstance attribute.Goal: I wanted to have design-time data support in my WPF project (MVVM-based), both in VS2012 and Blend, and

How to send post request with x-www-form-urlencoded body

How to send post request with x-www-form-urlencoded body

How in java, can I send a request with x-www-form-urlencoded header. I don't understand how to send a body with a key-value, like in the above screenshot.I have tried this code:String urlParameters = cafedra_name+ data_to_send;URL url;

Check two float/double values for exact equality

Check two float/double values for exact equality

What is an elegant, readable and non-verbose way of comparing two floating point value for exact equality? As simple as it may sound, its a wicked problem. The == operator doesn't get the job done for NaN and also has special treatment for

How can I disable a service via Delphi?

How can I disable a service via Delphi?

I use a routine that can start and stop services via Delphi but I also need to be able to disable them, is it possible? 1:ShellExecute(0, nil, 'cmd.exe', 'sc config "the service name" start=disabled', nil, SW_HIDE);ShellExecute(0, nil, '

How can I access OAuth's state parameter using Passport.js?

How can I access OAuth's state parameter using Passport.js?

I'm using Passport.js to do authentication, and per Google's OAuth2 documentation, I'm passing in a state variable:app.get('/authenticate/googleOAuth', function(request, response) { passport.authenticate('google', { scope: [ 'ht

Ensuring text wraps in a dataGridView column

Ensuring text wraps in a dataGridView column

I have dataGridView with a particular column. When I write long text in dataGridView it shows me a shortened version, with ellipses, because the column isn't wide enough to display the entire string.| textdsadasda... |What do I must to do

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')

Media Queries: check min-height and min-width?

Media Queries: check min-height and min-width?

I am trying to change CSS on my page based on the min-height and min-width of the browser, so I am using this:@media (min-height: 500px), (min-width: 580px) { /* CSS stuff */}But for some reason, this doesn't work. I can check for min-he

Getting the type of a MemberInfo with reflection

Getting the type of a MemberInfo with reflection

I'm using reflection to load a treeview with the class structure of a project. Each of the members in a class have a custom attribute assigned to them. I don't have a problem getting the attributes for a class using MemberInfo.GetCustomAttr