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

LINQ equivalent of foreach for IEnumerable

LINQ equivalent of foreach for IEnumerable

I'd like to do the equivalent of the following in LINQ, but I can't figure out how:IEnumerable items = GetItems();items.ForEach(i => i.DoStuff());What is the real syntax? 1:There is no ForEach extension for IEnumerable; only for Li

Add table row in jQuery

Add table row in jQuery

What is the best method in jQuery to add an additional row to a table as the last row?Is this acceptable?$('#myTable').append('my datamore data');Are there limitations to what you can add to a table like this (suc

Differences between class declarations

Differences between class declarations

There are many ways to declare a new class type:TMyClass1 = TObject;TMyClass2 = type TObject;TMyClass3 = class end;TMyClass4 = class(TObject);TMyClass5 = class(TObject) end;It's my understanding that class 3, 4 and 5 are descendants of TObj

Force Gradle to use HTTP instead of HTTPS

Force Gradle to use HTTP instead of HTTPS

I am trying to build react-native android app, as a dependecy I see I have gradle, but it fails to load on build.Error message:* What went wrong:A problem occurred configuring root project 'MobileApp'.> Could not resolve all dependencies fo

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

SharedPreferences Clear/Save

SharedPreferences Clear/Save

Iam trying to make a checker and I want to save a value into SharedPreferences. But i'am not sure if it worksThis what I do to save the value is : * SharedPreferences prefs = getSharedPreferences("PREFERENCE", MODE_PRIVATE); boolean f

Black area on UIWebView during load

Black area on UIWebView during load

I noticed that my UITabBar gets a dark-gray color when I preform loadRequest in my UIWebView.If I scroll my WebView during loadRequest there is a black area How can I remove this? 1:I've had this problem before, and it's related to the

What's the deal with [ComVisible] default and public classes COM exposure?

What's the deal with [ComVisible] default and public classes COM exposure?

MSDN has this article about [ComVisible] attribute. I don't quite get what happens when one sets [ComVisible(true)].MSDN says The default is true, which indicates that the managed type is visible to COM. This attribute is not needed to mak

Safely delete a TFS branch project

Safely delete a TFS branch project

I'm currently reorganising our TFS source control for a very large set of solutions, and I've done this successfully so far.I have a problem at the moment where I need to delete a legacy "Release Branch" TFS project that was branched for th

How to remove all the polylines from a map

How to remove all the polylines from a map

FollowingHow to draw a path between two markersI had to add lot of polylines between two markers, to make a path.One of the markers is draggable, lets say source is draggable.So, when user starts dragging the marker, the path previously dra

How to properly compare decimal values in C#?

How to properly compare decimal values in C#?

I come from a background in C++, and I know that you cannot accurately compare floats for equality. For C#, I simply assumed the same policy applies to decimal values, or any floating point value in general.Basically, I have two decimal val

Understanding Cookies in PHP

Understanding Cookies in PHP

When the following code is run for the first time, it does not echo out the "var1" value but it does on browser refresh (f5), Why? As i understand when the browser sends the code to the server, setcookie() stores the cookie variable ("var1"

How to make text be “typed out” in console application?

How to make text be “typed out” in console application?

Just like the way the computer does it in War Games. I've started, but I don't know where to go from here.static void TypeLine(string line){ string output = null; char[] characters = line.ToCharArray(); for (int i = 0; i My idea wa

Issue with transparent texture on 3D primitive, XNA 4.0

Issue with transparent texture on 3D primitive, XNA 4.0

I need to draw a large set of cubes, all with (possibly) unique textures on each side. Some of the textures also have parts of transparency. The cubes that are behind ones with transparent textures should show through the transparent textur

How to stream response body with apache HttpClient

How to stream response body with apache HttpClient

There's an api I need to perform octet-streaming from which does not have a length. It is just a stream of real time data. The issue that I'm having is that when I make my request, it seems to try to wait out for the end of the content befo

Sending OutputStream to browser and let browser save it [duplicate]

Sending OutputStream to browser and let browser save it [duplicate]

This question already has an answer here: How to provide a file download from a JSF backing bean? 4 answers I want to export Data from a Rich Faces Dat

Add dropShadow only to border of grid pane JavaFx 2.2

Add dropShadow only to border of grid pane JavaFx 2.2

Want to add drop shadow only to the border of Grid pane not to inner child elementshere is the image of screen showing the effect. 1:Use a StackPane and place your GridPane in it. Style your StackPane with CSS to apply a background colo

3D CartoPy similar to Matplotlib-Basemap

3D CartoPy similar to Matplotlib-Basemap

I'm new to Python with a question about Cartopy being able to be used in a 3D plot. Below is an example using matplotlibBasemap.import matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dfrom mpl_toolkits.basemap import Basemapm

How to obtain a correct dump using mysqldump and single-transaction when DDL is used at the same tim

How to obtain a correct dump using mysqldump and single-transaction when DDL is used at the same tim

I'm new to MySQL and I'm figuring out the best way to perform an on-line hot logical backup using mysqldump. This page suggests this command line:mysqldump --single-transaction --flush-logs --master-data=2 --all-databases > backup

Pushing an existing Git repository to Github only sends about half the commits?

Pushing an existing Git repository to Github only sends about half the commits?

I have a local Git repository I've been developing under for a few days: it has eighteen commits so far. Tonight, I created a private Github repository I was hoping to push it to; however, when I did so, it only ended up pushing eight of th

passing column names to data.table programmatically

passing column names to data.table programmatically

I would like to be able to write a function that runs regressions in a data.table by groups and then nicely organizes the results. Here is a sample of what I would like to do:require(data.table)dtb = data.table(y=1:10, x=10:1, z=sample(1:1

Clear R Console programmatically [duplicate]

Clear R Console programmatically [duplicate]

Possible Duplicate: Function to Clear the Console in R Is there a way to invoke the Clear Console (Ctrl+L) menu command programmatically? 1:I use a function for doing that, and actually have put it in {R directory}\etc\Rprofile.site so

Why is the ciphertext 32 bytes long when encrypting 16 bytes with AES?

Why is the ciphertext 32 bytes long when encrypting 16 bytes with AES?

I use encryption AES algorithm, when i encrypt 16 byte(one block) the result is 32 byte.Is this ok?My source code that i used is:package net.sf.andhsli.hotspotlogin;import java.security.SecureRandom;import javax.crypto.Cipher;import javax.c

Celery Task Chain and Accessing **kwargs

Celery Task Chain and Accessing **kwargs

I have a situation similar to the one outlined here, except that instead of chaining tasks with multiple arguments, I want to chain tasks that return a dictionary with multiple entries. This is -- very loosely and abstractly --- what I'm t