access method 'System.Web.Http.HttpConfiguration.DefaultFormatters()' failed

access method 'System.Web.Http.HttpConfiguration.DefaultFormatters()' failed

I have problem with unit testing my WEB API controller, I'm using moq to mock up my repository, do the setup and response for it. Then initiate the controller with mocked repository. The problem is when I try to execute a call from the cont

How to convert & rotate raw NV21 array image (android.media.Image) from front cam portrait mode

How to convert & rotate raw NV21 array image (android.media.Image) from front cam portrait mode

Note: All info in my post only goes for Samsung Galaxy S7 device. I do not know how emulators and other devices behave.In onImageAvailable I convert continuously each image to a NV21 byte array and forward it to an API expecting raw NV21 fo

Retrieving Data from JDBC Database into Jtable

Retrieving Data from JDBC Database into Jtable

Hi I have successfully linked my jTable to JDBC database.However, I am having trouble retrieving them. I want the saved data to appear when I restart the program but it is not working.alarm.setText(""); DefaultTableModel model =(Defaul

Get Json Data From Asp.Net Webmethod and Consume in angularJS

Get Json Data From Asp.Net Webmethod and Consume in angularJS

Can any one guide me how to get json data from asp.net webmethod, and consume it in angularJS.app.controller('MainController', ['$scope', function ($scope, $http) { try { $http({ method: 'GET', url: 'ProblemList.aspx/GetProblemList'

How to read until ESC button is pressed from cin in C++

How to read until ESC button is pressed from cin in C++

I'm coding a program that reads data directly from user input and was wondering how could I read all data until ESC button on keyboard is pressed. I found only something like this:std::string line;while (std::getline(std::cin, line)){ st

angular 2 - Injected service in http error handler

angular 2 - Injected service in http error handler

I have a method handleError() like in the documentation https://angular.io/docs/ts/latest/guide/server-communication.html#!#error-handlingprivate handleError(error: any) { console.error(error); console.log(this.loginService); // My pr

Best way to display a progress form while a method is executing code?

Best way to display a progress form while a method is executing code?

I have a WinForm load method that takes a long time to gather some data to display to the user.I display a form with a large font with the word "Loading" while this method is executing.However sometimes this error comes up and the "Loading"

Overriding shortcut keys in firefox and chrome

Overriding shortcut keys in firefox and chrome

I have a script that is supposed to open a section of a web page and save changes on Ctrl + n and Ctrl + s repectivly I got it working in IE but it doesn't seem to work in firefox and chrome. Any ideas?My over ride function.function preven

Aborting upload from a servlet to limit file size

Aborting upload from a servlet to limit file size

I'd like to limit the size of the file that can be uploaded to an application. To achieve this, I'd like to abort the upload process from the server side when the size of the file being uploaded exceeds a limit.Is there a way to abort an up

PHP Socket with android

PHP Socket with android

I would like to ask how to create a PHP socket which able receive request from android phone in real time? For now, i done this part of code and able test it using telnet. However, when the android phone try to connect, it unable receive or

How can I programmatically determine if I have write privileges using C# in .Net?

How can I programmatically determine if I have write privileges using C# in .Net?

How can I determine if I have write permission on a remote machine in my intranet using C# in .Net? 1:The simple answer would be to try it and see. The Windows security APIs are not for the faint of heart, and may be possible you have w

add custom attribute or metadata to file java

add custom attribute or metadata to file java

I have files that need an extra attribute called "encryption used". But this gives "IllegalArgumentExeption". I know why it gives that error, "encryption used" isn't known as an attribute, but is there a way I can force it to be? Or add cus

How to get wifi hotspot state

How to get wifi hotspot state

I am creating wifi hotspot in my phone and I want get its state change event when I switched on or off hotspot. 1:Please look at the following code. This will help youpublic class WifiApManager { private final WifiManager mWifiManager

Upload+ read an excel file in a jsp using POI

Upload+ read an excel file in a jsp using POI

I want to read an excel file in JSP,for this I first uploaded the file in a folder in the :D partition named uploads using a web application project,and I tried to read the excel uploaded file with an another java projet.The both codes are

How to binary (de)serialize object into/form string?

How to binary (de)serialize object into/form string?

I need serialize objects into String and deserialize.I readed sugestion on stackoverflow and make this code:class Data implements Serializable {int x = 5;int y = 3; }public class Test {public static void main(String[] args) { Data data

How to access JsonResult data when testing in ASP.NET MVC

How to access JsonResult data when testing in ASP.NET MVC

I have this code in C# mvc Controller: [HttpPost] public ActionResult Delete(string runId) { if (runId == "" || runId == null) { return this.Json(new { error = "Null or empty params" }); } try

Configure elasticsearch mapping with java api

Configure elasticsearch mapping with java api

I have a few elasticsearch fields that I don't want to analyze before indexing. I have read that the right way to do this is by altering the index mapping. Right now my mapping looks like this:{ "test" : { "general" : { "properties"

Java Delay/Wait

Java Delay/Wait

How do I delay a while loop to 1 second intervals without slowing down the entire code / computer it's running on to the one second delay (just the one little loop). 1:Thread.sleep(1000); // do nothing for 1000 miliseconds (1 second)

How to read UTF8 encoded file using RandomAccessFile?

How to read UTF8 encoded file using RandomAccessFile?

I have text file that was encoded with UTF8 (for language specific characters). I need to use RandomAccessFile to seek specific position and read from. I want read line-by-line. String str = myreader.readLine(); //returns wrong text, not

How to XML Serialize a 'Type'

How to XML Serialize a 'Type'

How do I serialize a 'Type'?I want to serialize to XML an object that has a property that is a type of an object. The idea is that when it is deserialized I can create an object of that type.public class NewObject{}[XmlRoot]public class Xm

Getting “The entity type  is not part of the model for the current context.”

Getting “The entity type is not part of the model for the current context.”

I am having this issue updating my database 1 column at a time in asp.net using web api. I am trying to query a PUT to just update one value in the row instead of updating that one and setting the rest to null. I made a separate model outsi

How to get crash dialog with report button

How to get crash dialog with report button

I purposely make my own application crash. I get the following dialog.However, I wish to get the following crash dialog with report button.May I know how I can do so? I had signed my application. (But I transfer the APK locally to my phone,

Class.forName() throws ClassNotFoundException

Class.forName() throws ClassNotFoundException

A Thinking in Java program is as follows:package typeinfo;import static util.Print.*;class Candy { static { print("Loading Candy"); }}class Gum { static { print("Loading Gum"); }}class Cookie { static { print("Loading Cookie"); }}public cla

How do I access android:label for an Activity

How do I access android:label for an Activity

GivenAndroid.xml:Strings.xml:Icon ListHow do I access to the string 'Icon List' given IconListActivity.class? 1:PackageManager#getActivityInfo() returns an ActivityInfo structure, which has a labelRes and a name field, one of which shoul

Embed TypeScript code in an HTML document

Embed TypeScript code in an HTML document

Is it possible to embed TypeScript code in a web page? I want to embed TypeScript code inside script tags, like this (so that it is automatically compiled to Javascript): 1:Actually there are several projects that allow you to use TypeSc