Discrepancy in SAL annotation between the Windows SDK and MSDN documentation - winapi

Can somebody explain this SAL annotation discrepancy in UnmapDebugInformation?
In the MSDN library documentation, the DebugInfo parameter is annotated as being passed in:
BOOL WINAPI UnmapDebugInformation(
_In_ PIMAGE_DEBUG_INFORMATION DebugInfo
);
In DbgHelp.h, however, the parameter is annotated as being passed out:
BOOL IMAGEAPI UnmapDebugInformation(
_Out_writes_(_Inexpressible_(unknown)) PIMAGE_DEBUG_INFORMATION DebugInfo
);
Why would this parameter be annotated as _Out_ in the SDK?
(I understand that this a deprecated function; I'm interested in understanding the SAL annotation used in the SDK.)

SAL annotations evolve separately from MSDN documentation and SDK updates. The MSDN article tends to be stale, this may well have once been annotated as _In_ in the SDK as well. Oldest one I got is SDK v6.0, it uses __out_xcount(unknown).
I supposed the passed structure may well be updated by the function, considering it contains a list so what you see is just a better version. It only really matters to code analyzers.

Related

elastic search admin API preparePutIndexedScript does not exist anymore

I need to use exactly this method on the adminClusterApi,
client.preparePutIndexedScript()
.setScriptLang("painless")
.setId("script1")
.setSource("script", "_score * doc['my_numeric_field'].value")
.execute()
.actionGet();
I tried the following elastic-search-client version.
* 5.6.1
* 5.3.1
* 5.3.3
but sadly I can't find this method and even the preparePutIndexedScript on the Java Api anymore, does someone have any idea?
according with the documentation this class still exists -> https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/indexed-scripts.html
I found the answer
All the methods related to interacting with indexed scripts have been
removed. The Java API methods for interacting with stored scripts have
been added under ClusterAdminClient class. The sugar methods that used
to exist on the indexed scripts API methods don’t exist on the methods
for stored scripts. The only way to provide scripts is by using
BytesReference implementation, if a string needs to be provided the
BytesArray class should be used.
https://www.elastic.co/guide/en/elasticsearch/reference/5.5/breaking_50_scripting.html#_indexed_scripts_java_apis
would be nice though if the other documentation part that i mentioned would be upgrade was a bit hard to find this.

New type for the deprecated grocery_or_supermarket type in google-places-API

Looks like google has deprecated a bunch of place types from their places API:
https://developers.google.com/places/web-service/supported_types
"The following types are deprecated, and will continue to be supported until February 16, 2017: establishment, finance, food, general_contractor, grocery_or_supermarket, health, place_of_worship."
I wasn't able to figure out what the new replacement types would be. "food" and "store" are too generic for a grocery related store.
Additionally, the documentation states that these types are deprecated only for the query API. The place-details results "may" still contain them.
A workaround I can implement is to fetch the places using a more generic type (e.g., store), and then filter on my end.. not ideal, but out of ideas. However, this also means that I'll rely on the more granular type (e.g., grocery_or_supermarket) to be mentioned in the response.
Can someone pls comment or share ideas on this issue? (did any of you have to deal with this? would be great if you can share your thoughts)
Thanks
Use Foursquare API for this data instead of Google, just get a Foursquare API key, check the API how to use details online and that should provide the data your need.

NoSuchMethodError using Twilio IPMessaging

I'm trying to use Twilio IP Messaging in a simple Xamarin Android project, but unfortunately running into issues with the latest Nuget libraries: Twilio.Common (v. 0.3.4.2) and Twilio.IPMessaging (I tried both 0.15.0.4 and 0.15.0.6).
My setup is complicated by the fact that the online Xamarin samples are obsoleted within the recent library releases --- so instead of calling methods to Initialize the Twilio SDK, my code simply invokes Twilio.IPMessaging.IPMessagingClient.Create. The input parameters are a bit unclear, but reading elsewhere I'm trying to bind using a signature:
IPMessagingClient IPMessagingClient.create(
Context context,
AccessManager accessManager,
IPMessagingClient.Properties clientProperties,
Constants.CallbackListener<IPMessagingClient> listener)
Invoking it this way, I invariably receive an error message: NoSuchMethodError with details:
"no static method \"Lcom/twilio/ipmessaging/IPMessagingClient;.create(Landroid/content/Context;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Lcom/twilio/ipmessaging/IPMessagingClient;\"
Any ideas? I like the idea of using Twilio, but between the outdated documentation and unfortunate crashes it's looking simpler to just implement messaging myself.
While I check nugets can you provide more insights
why IPMessagingClient.create(...) and not IPMessagingClient.Create(...)?
Is linker turned on? Turn it off please. Then check.
Signature is
public static IPMessagingClient Create (Context context, Object acess_manager, Object properties, Object listener);

Returning child elements in ASP.NET WebAPI OData

I'm using the latest ASP.Net WebAPI Nightly builds (dated 2013-01-16).
I have a simple EF database first model at the moment that has two entities - Patients and Visits. Each patient can have many visits.
I'd like to be able to query for my list of patients and have the visits entities for each patient returned inline. I know that WebAPI's OData implementation doesn't yet support $expand. I'm hoping that just means that optional client-controlled expansion is not supported and that I can force expansion server-side.
At the moment I'm not getting any of the visits inline.
For example, my PatientController's() Get() method looks like
[Queryable(AllowedQueryOptions=AllowedQueryOptions.Supported)]
public override IQueryable<Patient> Get()
{
var query = this.entities.Patients.Include("Visits");
return query;
}
I've verified that the query executing against my database does indeed include the visit information.
To use a publicly available OData service as an example, if you use the service at http://services.odata.org/OData/OData.svc/, you can get a list of Suppliers. This is http://http://services.odata.org/OData/OData.svc/Suppliers.
You can also ask for a list of suppliers that includes the list of products using http://http://services.odata.org/OData/OData.svc/Suppliers?$expand=Products
Stepping through the ASP.NET code (via the symbols server) I've got to the System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer and can see that it's CreatePropertyBag method, which builds up the list of properties to be serialized, just doesn't include the navigation properties, and they don't seem to be enumerated anywhere else apart from being written out as NavigationLinks.
I'm quite new to the ASP.NET world in general and have spent a week or so getting my head around the way things work (particularly with the changes made to OData at the end of 2012 and further changes made so far in 2013).
I suspect that if the ODataEntityTypeSerializer was to be modified (I'm happy to try) to embed this extra information in the appropriate spot (within each navigation link as an nested inline feed as best I can tell) then I'd be set.
Questions:
Have I overlooked something obvious and there's a flag I can set to turn on this behaviour? I can see why, if such a flag exists, it would be off by default (EF lazy loading and this flag wouldn't get on well)
If #1 is no, is there some other ODataEntityTypeSerializer that I could use? If so, how do I switch to it?
If #2 is no, any pointers for where I should start writing my own? Is there a place I can substitute in my own serializer or do I have to maintain my own fork of ASP.NET's Extensions project (as opposed to the Runtime project)
Thanks very much!
$expand is very high on our list of things to support for OData. But as far as I know, we don't have any flag to turn it on server-side. The formatter doesn't currently allow you to substitute your own serializers either. So I'm afraid your only option in the meantime is to create a fork and add support for $expand. If you manage to get it working, please consider sending a pull request our way:
http://aspnetwebstack.codeplex.com/SourceControl/network
You can try it already in webapi nightly builds.
Here is how to install it with nuget:
http://aspnetwebstack.codeplex.com/wikipage?title=Use%20Nightly%20Builds

Boost API doc location?

I was wondering if there is a javadoc style API reference for the boost libraries?
I have noticed that there are class descriptions with these type of urls:
http://www.boost.org/doc/libs/1_52_0/doc/html/boost/program_options/typed_value.html
Whereas documentation of particular libraries is at the following:
http://www.boost.org/doc/libs/1_52_0/doc/html/program_options/
Notice the html/boost subdirectory. Considering this, perhaps there is an organized/categorized API index for these raw indexes:
http://www.boost.org/doc/libs/1_52_0/doc/html/boost
http://www.boost.org/doc/libs/1_52_0/doc/html/boost/program_options/
Boost is a collection of many different libraries, by many different authors. There is no comprehensive documentation. Several of the libraries provide API documentation as you have already noted. I think the Asio API documentation is particularly well written.

Resources