Web API to retrieve difficulty changes


This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.

The showNotification() method of the ServiceWorkerRegistration interface creates a notification on an active service worker.


ServiceWorkerRegistration.showNotification(title, [options]).then(function(NotificationEvent) { ... });


A Promise that resolves to a NotificationEvent.


title The title that must be shown within the notification options Optional An object that allows to configure the notification. It can have the following properties: actions: An array of actions to display in the notification. The members of the array should be an object literal. It may contain the following values: action:...
0 0

I'm playing around with the code and tried to adjust difficulty by changing code from

bnProofOfWorkLimit = ~uint256(0) >> 1


bnProofOfWorkLimit = ~uint256(0) >> 20

inside code block for Regression Test in chainparams.cpp (bitcoin-0.10.0).

I configured, did make, then make install with binaries in a custom directory (not default /usr/local/bin/bitcoind !), started bitcoind in regtest mode and generated some blocks.
Somehow it feels like it takes same amount of time for generating blocks as before modifying the code.

What am I doing wrong?


Changed difficulty in chainparams.cpp from

bnProofOfWorkLimit = ~uint256(0) >> 1


bnProofOfWorkLimit = ~uint256(0) >> 32

still getting this:

Bitcoin version v0.10.0.0-g047a898 (Fri, 13 Feb 2015 09:55:11 +0100) Using OpenSSL version OpenSSL 1.0.1f 6 Jan 2014 Using BerkeleyDB version Berkeley DB 4.8.30: (April 9, 2010) Default data directory...
0 0

When multiple operations are contained in a change set, all the operations are considered atomic, which means that if any one of the operations fail, any completed operations will be rolled back. Like a batch request, change sets must have a Content-Type header with value set to multipart/mixed with a boundary set to include the identifier of the change set using this pattern:


The unique identifier doesn’t need to be a GUID, but should be unique. Each item within the change set must be preceded by the change set identifier with a Content-Type and Content-Transfer-Encoding header like the following:

--changeset_BBB456 Content-Type: application/http Content-Transfer-Encoding:binary

Change sets can also include a Content-ID header with a unique value. This value, when prefixed with $, represents a variable that contains the Uri for any entity created in that operation. For example, when you set the value of 1, you can refer to that entity using $1 later in...

0 0

ASP.NET Web API introduces a new API for creating REST APIs and making AJAX callbacks to the server. This new API provides a host of new great functionality that unifies many of the features of many of the various AJAX/REST APIs that Microsoft created before it - ASP.NET AJAX, WCF REST specifically - and combines them into a whole more consistent API. Web API addresses many of the concerns that developers had with these older APIs, namely that it was very difficult to build consistent REST style resource APIs easily.

While Web API provides many new features and makes many scenarios much easier, a lot of the focus has been on making it easier to build REST compliant APIs that are focused on resource based solutions and HTTP verbs. But RPC style calls that are common with AJAX callbacks in Web applications, have gotten a lot less focus and there are a few scenarios that are not that obvious, especially if you're expecting Web API to provide functionality similar to ASP.NET...

0 0

Download source


Being a Microsoft software developer is a lot like ordering breakfast at the International House of Pancakes. You get a stack of pancakes with every dish and you must choose from a variety of pancakes and syrup flavors. For web applications, a solution stack is a set of software subsystems or components needed to deliver a fully functional solution, be it a product or a service. To develop a web application for example, the Microsoft developer needs to use and understand the Microsoft Stack of components including the ever emerging set of open source tools, design patterns and 3rd party products. That's a lot of pancakes.


The goal of this article is to walk through a sample Customer Maintenance web application that implements the latest technology from the Microsoft stack, including the latest beta versions of Microsoft .NET 4.5.1, Visual Studio Express 2013, MVC 5, WebAPI 2 and Entity Framework...

0 0

Websites no longer cater solely to human readers. Many sites now support APIs that enable computer programs to harvest information. Screen scraping— the time-honored technique of parsing of HTML pages into more-digestible forms — can still come in handy. But opportunities to simplify web data extraction through the use of APIs are increasing rapidly. According to ProgrammableWeb, more than 10,000 website APIs were available at the time this article was published — an increase of more than 3,000 over the preceding 15 months. (ProgrammableWeb itself offers an API for searching for and retrieving APIs, mashups, member profiles, and other data from its catalog.)

This article begins with a look at modern-day web scraping and compares it to the API approach. Then, through Ruby examples, it shows how to extract structured information by using APIs from some popular web properties. ...

0 0

There are many options for configuring monitoring and alerting for Azure resources. The Azure portal will show some default metrics. It is also possible to enable more advanced or custom diagnostic settings. The links below provide additional details on enabling diagnostics and monitoring for two popular Azure compute resources, Azure Web Apps and Azure Virtual Machines. Visual Studio Application Insights can also be leveraged to monitor the usage and performance of applications.

As previously mentioned, the Azure portal will show some default metrics for many Azure resources. For example, the screenshot below shows the monitoring tile for an Azure Web App, which has been configured to display three key values: Average Response Time, CPU Time, and Requests.

The metric values displayed on this tile are not retained indefinitely. For an Azure Web App, the retention policy is as follows:

Minute granularity – 24 hour retention Hour granularity – 7 day...
0 0

Web API is a feature of the ASP .NET framework that dramatically simplifies building RESTful (REST like) HTTP services that are cross platform and device and browser agnostic. With Web API, you can create endpoints that can be accessed using a combination of descriptive URLs and HTTP verbs. Those endpoints can serve data back to the caller as either JSON or XML that is standards compliant. With JSON Web Tokens (Jwt), which are typically stateless, you can add an authentication and authorization layer enabling you to restrict access to some or all of your API.

The purpose of this tutorial is to develop the beginnings of a Book Store API, using Microsoft Web API with (C#), which authenticates and authorizes each requests, exposes OAuth2 endpoints, and returns data about books and reviews for consumption by the caller. The caller in this case will be Postman, a useful utility for querying API’s.

In a follow up to this post we will write a front end to interact with the...

0 0

You should always version your Web API while at the same time keeping as much of the same URI as possible. Imagine a situation where you have a Web API that is up and running on the production and is being consumed by users. Now suppose you need more functionality in the Web API yet must keep the existing functionality intact. You may have a few users who still need the old API, while others would need a version with new or extended features. This is exactly where Web API versioning comes to the rescue.

You can version your Web API in one of the following ways:

Use URLs: Version information is specified in the URL as a query string. Use Custom Request Headers: Version information for your controller is specified in the request header sans the need of any change in the URL. Use Accept Headers: Accept headers generally define the media type and character encodings. You can also pass version information for your Web API via accept headers without having to change the URL. ...
0 0
HTTP/1.1 200 OK Content-Type: application/json; odata.metadata=minimal OData-Version: 4.0 { "@odata.context":"[Organization URI]/api/data/v8.2/$metadata#accounts(accountid,parentaccountid,Account_Tasks,parentaccountid(createdon,name),Account_Tasks(subject,scheduledstart))/$entity","@odata.etag":"W/\"514069\"","accountid":"915e89f5-29fc-e511-80d2-00155db07c77", "parentaccountid":{ "@odata.etag":"W/\"514074\"","createdon":"2016-04-06T00:29:04Z", "name":"Adventure Works (sample)", "accountid":"3adbf27c-8efb-e511-80d2-00155db07c77" },"Account_Tasks":[ { "@odata.etag":"W/\"514085\"", "subject":"Sample Task 1", "scheduledstart":"2016-04-11T15:00:00Z", "activityid":"a983a612-3ffc-e511-80d2-00155db07c77" },{ "@odata.etag":"W/\"514082\"", "subject":"Sample Task 2", "scheduledstart":"2016-04-13T15:00:00Z", "activityid":"7bcc572f-3ffc-e511-80d2-00155db07c77" } ]...
0 0

Along with the release of Visual Studio 2013 came a new release of ASP.NET MVC (called MVC 5) and ASP.NET Web API (called Web API 2). Part of the enhancements to the Web API stack include some much needed features for OData that were missing in the initial release of the ASP.NET Web API OData that came out in June 2013. There were four new OData capabilities added in this release: $select, $expand, $value, and batch updates.

A quick review of the basics

OData is an open standard specification for exposing and consuming CRUD-centric (Create-Read-Update-Delete) data services over HTTP. OData follows most of the design guidelines of the REST architectural style and makes it very easy to implement data services or consume them on just about any modern development platform. OData has two main parts to it: the OData URL query syntax that allows you to perform rich queries from the client including filtering, sorting, and paging; and the full OData communication protocol...

0 0

This topic describes what's new for ASP.NET Web API 2.1.


The runtime features are released as NuGet packages on the NuGet gallery. All the runtime packages follow the Semantic Versioning specification. The latest ASP.NET Web API 2.1 RTM package has the following version: “5.1.2”. You can install or update these packages through NuGet. The release also includes corresponding localized packages on NuGet.

You can install or update to the released NuGet packages by using the NuGet Package Manager Console:

Install-Package Microsoft.AspNet.WebApi -Version 5.1.2


Tutorials and other information about ASP.NET Web API 2.1 RTM are available from the ASP.NET web site (http://www.asp.net/web-api).

New Features in ASP.NET Web API 2.1

Global Error Handling

All unhandled exceptions can now be logged through one central mechanism, and the behavior for unhandled exceptions can be customized.


0 0


Data layout & error handling inconsistency

This is really important for a good API: Almost all methods response with other data layouts. While the TF2 methods (except that for the Golden Wrenches) have a consistent layout. All other methods respond with different data. This isn't a huge problem for single applications, but for a library that wants to abstract access to the Web API.

I was happy to see the first two TF2 methods having a unified layout and error handling and integrated a pretty nice abstraction into my library Steam Condenser. But this doesn't fit all the other methods that came afterwards and pretty much obsoletes any effort to abstract API access into a single class. --Koraktor

As TF2's methods are pretty much everything that's needed, I'm fine with it the way it is, but to be honest, all reponses should more or less look like the follwoing:

response \ |-status | \ | |-code [| \-detail] # This is only needed for errors (or...
0 0

While callbacks have been traditionally used for asynchronous operations, many developers feel they are somewhat unwieldy, and difficult to read and debug because a series of asynchronous operations will build upon each other to create code that forms a “pyramid of doom” as indentation causes the code, using anonymous functions, to move further and further to the right of the page. Although this issue can be addressed by using named functions rather than anonymous functions, many developers appreciate the benefits offered by promises. A Promise object represents an operation that is not completed yet, but is expected to complete in the future.

There are many third party libraries and JavaScript frameworks which offer different implementations of promises. JQuery has offered a behavior based on the CommonJS Promises/A design via Deferred object and others insist on compliance with the Promises/A+ specification. An explanation of the differences between these implementations...

0 0

I am using the Web API framework to provide backend services for my frontend HTML5 application. I use Entity Framework for Object Relation Mapping. The Web API exposes a set of methods over HTTP for data manipulation, and the frontend consumes the WebAPI for data manipulation (retrieve, insert, update, etc.).

Below is how I perform a database operation in a Web API repository:

public class PersonRepository : IPersonRepository { private PersonDetailsContext personContext; public PersonRepository(PersonDetailsContext personContext) { this.personContext= personContext; } public sResponse DeleteAccImage(ACCTIMAGE medAccImg) { sResponse sRes = new sResponse(); sRes.IsSuccess = false; try { MEDACCTIMAGE medAccImgDelete = personContext.ACCTIMAGE.Where(X => X.ACCOUNT == medAccImg.ACCOUNT && X.CODE == medAccImg.CODE).SingleOrDefault(); if (medAccImgDelete == null) { sRes.outMessage = "Image does not exist for Account = " +...
0 0

Working with external data connections

The following sections discuss how external data connections work, and how to find edit, manage, and share the connection information with other programs and users.

Top of Page

Understanding the basics of data connections

Data in an Excel workbook can come from two different locations. The data may be stored directly in the workbook, or it may be stored in an external data source, such as a text file, a database, or an Online Analytical Processing (OLAP) cube. This external data source is connected to the workbook through a data connection, which is a set of information that describes how to locate, log in to, and access the external data source.

The main benefit of connecting to external data is that you can periodically analyze this data without repeatedly copying the data to your workbook, which is an operation that can be time consuming and prone to error. After connecting to external...

0 0

This topic describes how ASP.NET Web API converts the return value from a controller action into an HTTP response message.

A Web API controller action can return any of the following:

void HttpResponseMessage IHttpActionResult Some other type

Depending on which of these is returned, Web API uses a different mechanism to create the HTTP response.

The rest of this topic describes each option in more detail.


If the return type is void, Web API simply returns an empty HTTP response with status code 204 (No Content).

Example controller:

public class ValuesController : ApiController { public void Post() { } }

HTTP response:

HTTP/1.1 204 No Content Server: Microsoft-IIS/8.0 Date: Mon, 27 Jan 2014 02:13:26 GMT


If the action returns an HttpResponseMessage, Web API converts the return value directly into an HTTP response message, using the properties of the HttpResponseMessage object to...

0 0

Hi Michael,

Thanks for the reply! I'm building a music recommendation app pretty much
based on Spotify and want to +1 the fact that this would really take the
API to another level... Having to to get users to use Last.fm for this is
tough, most people don't even know about it.

In any case, thanks a bunch for the update and greetings to Lisa Kleinsorge
and Owen Smith, two of your colleagues who I hang out with every now and
then :)

On Fri, Aug 19, 2016 at 9:05 AM, Lachlan Heywood notifications@github.com

@thelinmichael https://github.com/thelinmichael Thanks, appreciate the
update. It's good to know that it's not completely off the table.
Personally, I think this should be given a much higher priority, as the
integrations this would enable would inevitably lead to a greater
experience for users and more opportunities for developers and third party
services. That being said, it's understandable...

0 0