Heatmap based on average weights and not on the number of data points

Heatmap based on average weights and not on the number of data points

I am making a heatmap with Google API v3. I'll give an example. Lets consider earthquake magnitudes. I assign weights to each point to specify their magnitude. However google considers the density of points when you zoom out. The more poin

How to test a value on being AnyVal?

How to test a value on being AnyVal?

Tried this:scala> 2.isInstanceOf[AnyVal]:8: error: type AnyVal cannot be used in a type pattern or isInstanceOf test 2.isInstanceOf[AnyVal] ^and this:scala> 12312 match { | case _: AnyVal => true

What is a Discriminator column in ASP.NET Migrations?

What is a Discriminator column in ASP.NET Migrations?

I needed to add an extra field to Role identity table in ASP.NET MVC 5.I use migrations. I have added an extension to role like:public class ApplicationRole : IdentityRole{ public ApplicationRole() : base() { } public ApplicationRole(

ASP.net MVC3 - Razor Views and PartialViews with Ajax Postbacks

ASP.net MVC3 - Razor Views and PartialViews with Ajax Postbacks

I have been very unsuccessful in getting this to work!In a [email protected] [email protected]{ ViewBag.Title = "Forgot Password";}ForgotPassword @Html.Partial("_ForgotPasswordUserNameAjax", ViewData.Model)I rend

ExpandableListView expand only on a specific Button?

ExpandableListView expand only on a specific Button?

well i´m trying to create a ExpandableListView like Spotify it does... But i don´t have any idea how do disable the LinearLayout to act like a button (Expand the list) I have created a image which should describe what i like. I like to have

Returning the timestamp field in elasticsearch

Returning the timestamp field in elasticsearch

Why can I not see the _timestamp field while being able to filter a query by it?The following query return the correct documents, but not the timestamp itself. How can I return the timestamp?{ "fields": [ "_timestamp", "_source" ],

AngularJS: Catch all response status 500

AngularJS: Catch all response status 500

This may seem like a strange request. I was wondering if there is a way using a $http interceptor to catch the first URL that has a response status of 500, then stop all subsequent requests and processes and do something? 1:Thomas answer

Skipping custom pages based on optional components in Inno Setup

Skipping custom pages based on optional components in Inno Setup

In a prior question I asked how to have three optional components, where the user could also specify the locations for each component separately (e.g. a code part and two HTML web applications). @Miral gave me a great answer which I have no

With Zxing retiring for iOS, which barcode-scanner to switch to?

With Zxing retiring for iOS, which barcode-scanner to switch to?

I have implemented ZXing to my iOS-app, however I am questioning it's maintainability as not long ago it was announced that ZXing to iOS is retiring:Retiring C++, Objective C codeI've also read that there might be compatibility issues with

How to detect if windows is going to hibernate or suspend?

How to detect if windows is going to hibernate or suspend?

I am using SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler( SystemEvents_PowerModeChanged);to tell when Windows is suspending. But how do I know if it is going into hibernate or suspend?Is there a .Net or PInvoke method

Ace Editor: Lock or Readonly Code Segment

Ace Editor: Lock or Readonly Code Segment

Using the Ace Code Editor can I lock or make readonly a segment of code but still allow other lines of code to be written or edited during a session? 1:Here is the start of a solution:$(function() { var editor = ace.edit("editor1"

Camera focus distances

Camera focus distances

I'm trying to read the focus distance (distance of subject in a photo) from an Android camera. I keep getting 0 for all focus distances on my HTC Desire even when it correctly autofocuses. Here's the whole app, only works on v2.3.3 and abov

Reserved keywords in Objective-C?

Reserved keywords in Objective-C?

At the CocoaHeads Öresund meeting yesterday, peylow had constructed a great ObjC quiz. The competition was intense and three people were left with the same score when the final question was to be evaluated: How many reserved keywords does O

Prevent page scroll on drag in IOS and Android

Prevent page scroll on drag in IOS and Android

I'm working on a html5 canvas game, but I don't know how to handle touch events. When a user touch the screen, and drag, then the browser will scroll the page. I would like to prevent it, and get the touch start, and touch end position. Is

iOS7 and iOS8: how to detect when user said No to a request for push notifications

iOS7 and iOS8: how to detect when user said No to a request for push notifications

I am building an app that targets iOS7 and iOS8. I ask the user for permission to send push notifications. But for some reason, neither iOS7 nor iOS8 ever calls my application:didFailToRegisterForRemoteNotificationsWithError handler if I cl

How to debug ruby on rails in eclipse aptana plugin

How to debug ruby on rails in eclipse aptana plugin

I'm trying to figure out this eclipse aptana plugin (coming from a visual studio background). When I try to debug my project as follows:It throws this error:Unable to find 'rdebug-ide' binary script. May need to install 'ruby-debug-ide' gem

python pandas groupby() result

python pandas groupby() result

I have the following python pandas data frame:df = pd.DataFrame( { 'A': [1,1,1,1,2,2,2,3,3,4,4,4], 'B': [5,5,6,7,5,6,6,7,7,6,7,7], 'C': [1,1,1,1,1,1,1,1,1,1,1,1] } );df A B C0 1 5 11 1 5 12 1 6 13 1 7 14 2 5

JavaFX equivalent of Swing's pack()

JavaFX equivalent of Swing's pack()

I want to resize a window to fit the contents of the window. In Swing there is the pack() method. Is there a similar method to do this in JavaFX?What I am trying to do is to create a confirmation dialog. When I create the dialog, it is wide

AngularJS ui-router: force reload

AngularJS ui-router: force reload

I have an AngularJS app starting at index.html and using ui-router. Based on a trigger I want to reload the complete page. I tried:$state.go($state.current, $stateParams, { reload: true, inherit: false, notify: true});But that does

Lifetime extension and the conditional operator

Lifetime extension and the conditional operator

local lvalue references-to-const and rvalue references can extend the lifetime of temporaries:const std::string& a = std::string("hello");std::string&& b = std::string("world");Does that also work when the initializer is not a simple expres

Collapse all sections in accordian on page load in jQuery Accordian

Collapse all sections in accordian on page load in jQuery Accordian

I am using JQuery Accordian, I want to hide all the sections on page load. Only when user clicks on header that section should open. Can any one help me out.. 1:Use this in your document ready function when initialising the accordion:$("

How to load fixtures only once in django unit tests ?

How to load fixtures only once in django unit tests ?

In unit tests I need to load fixtures, as below: class TestQuestionBankViews(TestCase): # Load fixtures fixtures = ['qbank'] def setUp(self): login = self.client.login(email="mail

WPF MVVM hiding button using BooleanToVisibilityConverter

WPF MVVM hiding button using BooleanToVisibilityConverter

In my WPF application I am trying to change the visibility of a button depending on the options chosen by a user. On load I want one of the buttons to not be visible. I am using the in built value converter BooleanToVisibilityConverter. How

What do the -n and -a options do in a bash if statement? [duplicate]

What do the -n and -a options do in a bash if statement? [duplicate]

This question already has an answer here: List of if switches anywhere? 5 answers What function do the -a and -n options perform in the following bash

java.lang.ClassNotFoundException: org.hibernate.engine.SessionFactoryImplementor

java.lang.ClassNotFoundException: org.hibernate.engine.SessionFactoryImplementor

i am trying to migrate to hibernate 4.1.0.Final with spring 3.1.1.RELEASEand following is my configuration for hibernate: hibernate.dialect=org.hibernate.dialect.MySQLDialect hiberna