Quick MSDN Search in Firefox - firefox

Is there a way to get an MSDN search bar in Firefox which will autocomplete .Net class and member names (and preferably also Win32 API methods) and take me directly to the MSDN page?
Google toolbar with Shift+Enter (I'm feeling lucky) will usually go directly to the msdn page for a .Net class, but it doesn't have targeted autocomplete. Also, since I'm too lazy to type site:msdn.microsoft.com, it doesn't always take me to MSDN. (eg, Graphics)

There are several msdn search providers available.

This search plugin (from the list flyfishr64 linked to) works quite well (suggestions and everything).

You could create a bookmark with a wildcard %s and the msdn keyword by using the following url for the bookmarked page:
http://social.msdn.microsoft.com/search/en-us/?query=%s
Now in the address bar, when I type "msdn StringBuilder" it brings me to this result page: http://social.msdn.microsoft.com/search/en-us/?query=StringBuilder
I did the same with the stackoverflow keyword and the http://stackoverflow.com/questions/tagged/%s url.
EDIT: as #AgentConundrum pointed out, using the http://www.google.com/search?hl=en&safe=off&q=%s%20site:msdn.microsoft.com url will restrict Google search to the msdn.microsoft.com site.

I ended up editing this search plugin from Shog9's answer and changing the search URL to Google's I'm Feeling Lucky.
Here's the XML:
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<!-- Created on Thu, 07 Jan 2010 15:11:13 GMT -->
<ShortName>MSDN</ShortName>
<Description>Search MSDN documentation</Description>
<Url type="text/html" method="get" template="http://www.google.com/search?hl=en&q={searchTerms}+site%3Amsdn.microsoft.com&btnI=I"/>
<Url type="application/x-suggestions+json" template="http://services.social.microsoft.com/search//Data/AutoCompleteTerms?t={searchTerms}&b=Msdn&l=en-US&m=10&rf=oss10"/>
<Image width="16" height="16">http://mycroft.mozdev.org/updateos.php/id0/msdn_schnore.ico</Image>
<Developer>Schabse Laks</Developer>
<InputEncoding>UTF-8</InputEncoding>
<moz:SearchForm>http://social.msdn.microsoft.com/Search/en-US/</moz:SearchForm>
<Url type="application/opensearchdescription+xml" rel="self" template="http://mycroft.mozdev.org/updateos.php/id0/msdn_schnore.xml"/>
</OpenSearchDescription>

Related

Microsoft Speech Synthesizer Lexicon not working

I have followed the example here for adding a custom lexicon to my speech SSML. However, it is being ignored. I tried it with my own lexicon and also with the sample. At first the sample seemed to work, but when I removed the lexicon it still expanded out BTW as "By the Way" so it appears it was having no impact for the sample either.
For reference, here is the sample code used to create the lexicon
<?xml version="1.0" encoding="UTF-8"?>
<lexicon version="1.0"
xmlns="http://www.w3.org/2005/01/pronunciation-lexicon"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2005/01/pronunciation-lexicon
http://www.w3.org/TR/2007/CR-pronunciation-lexicon-20071212/pls.xsd"
alphabet="ipa" xml:lang="en-US">
<lexeme>
<grapheme>BTW</grapheme>
<alias>By the way</alias>
</lexeme>
<lexeme>
<grapheme> Benigni </grapheme>
<phoneme> bɛˈniːnji</phoneme>
</lexeme>
</lexicon>
And here is the sample SSML (in which the lexicon is ignored)
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis"
xmlns:mstts="http://www.w3.org/2001/mstts"
xml:lang="en-US">
<voice name="en-US-JennyNeural">
<lexicon uri="MY_PATH_TO/customlexicon.xml"/>
BTW, we will be there probably at 8:00 tomorrow morning.
Could you help leave a message to Robert Benigni for me?
</voice>
</speak>
I have tried accessing the lexicon from local storage as well as from a site hosted by Azure App Service. I also looked to see if the Javascript had any sort of "addLexicon" method within SpeechConfig or SpeechSynthesizer, but I couldn't find anything. Anyone have any ideas why this isn't working and what I need to do to fix it?
According to Microsoft, a path to the lexicon on your local machine does not work. It must be hosted on the web somewhere. If you have any app service plan, this is extremely lightweight (it's just hosting an XML file) so you can just create a new app service to host it. Of course if you have other methods to expose files via web uri that should work fine too.
Also, I was having issues with the hosted files using sapi alphabet. The alphabet abbreviation in the documentation is incorrect. It should be x-microsoft-sapi, not just sapi. Once I corrected that I was able to get both ipa (which is correct as ipa) and sapi lexicons working when hosted on a remote server.

IBM SBT: Updating a subcommunity breaks subcommunity relation?

I have implemented creation of subcommunities using IBM SBT 1.0.2.20140527-1807 against IC 4.5 (thanks for heavy API changes from 1.0.1 :-/ ) and want to update a freshly created subcommunity with a nice "content" containing some HTML with links to some content inside this community. Thus I must first create the subcommunity and afterwards update the "content" attribute, because I need some data not yet present before successful creation.
The way I do this is basically as follows:
(1) Create subcommunity [proven successful, and it IS a subcommunity now]
(2) Fetch the new subcommunity using CommunityService.getCommunity(communityUuid) [proven successful]
(3) execute community.setContent(string) [no errors]
(4) execute CommunityService.updateCommunity(community) [no errors]
The REST request created and sent for CREATE is:
POST /communities/service/atom/community/subcommunities?communityUuid=8ea4ff45-ef58-4c9b-b131-def2d3e233f7
The XML data sent is:
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
<title type="text">mytitle</title>
<content type="html">mycontent</content>
<category term="community" scheme="http://www.ibm.com/xmlns/prod/sn/type"></category>
<category term="mytag"></category>
<snx:communityType xmlns:snx="http://www.ibm.com/xmlns/prod/sn">private</snx:communityType>
</entry>
The REST request created and sent for UPDATE is:
PUT /communities/service/atom/community/instance?communityUuid=ae63bedf-98f2-45d4-ad6a-4dfd1f3a58d7
The XML data sent is:
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
<title type="text">mytitle</title>
<content type="html">mycontent</content>
<category term="community" scheme="http://www.ibm.com/xmlns/prod/sn/type"></category>
<category term="mytag"></category>
<snx:communityType xmlns:snx="http://www.ibm.com/xmlns/prod/sn">private</snx:communityType>
<snx:communityUuid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">ae63bedf-98f2-45d4-ad6a-4dfd1f3a58d7</snx:communityUuid>
<id>http://communities.ibm.com:2006/service/atom/community/instance?communityUuid=ae63bedf-98f2-45d4-ad6a-4dfd1f3a58d7</id>
</entry>
Afterwards the content is indeed updated -- but the community is not a subcommunity any more, but a regular top level community.
Why is that?
What can I do about it?
For the impatient: I have found the root cause, and in some circumstances this offers the possibility for a workaround.
The root cause is that the Community representation in IBM SBT SDK (Java) currently (as of July 2014) does not offer a "parent community URL" element.
http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Connections+4.5+API+Documentation#action=openDocument&res_title=Community_entry_content_ic45&content=pdcontent says that a community XML representation has a <link rel="http://www.ibm.com/xmlns/prod/sn/parentcommunity" type="application/atom+xml" href="..." /> element (where href is the atom/instance URL, not the "community URL" with html/communityview) if it represents a subcommunity, which is ignored on PUT/POST -- but:
THIS IS NOT TRUE:
In fact this element is REQUIRED on PUT to keep a community's "sub community" nature on change. And worse: If it is broken, it cannot be "repaired": Because of other limitations for subcommunities, an existing community cannot be changed to become a subcommunity of another top level community. Subcommunities can only be CREATED (and kept, of course).
What I have done to work around that pitfall is to subclass Community and some other classes to extend the XML marshal/unmarshal mechanisms in SBT SDK to cope with parent community URLs. If you know what you're doing everything is fine, but if you want generic code which simply does not break subcommunities, you must also READ ALL COMMUNITIES as if they may be subcommunities. If you don't, you won't see this information and write back the community as top level community.
Thus it is better to wait if you can :-(
I expect IBM to extend the implementation of Community and related classes by a parent community URL field. What I am curious about is how they will deal with the fact that the complete Atom feed URL is required, including the server address and the parent community UUID. I took the q&d way and changed the community URL as returned by parentCommunity.getCommunityUrl(), but this eventually does not take into account the various AUTH variants.
IBM SBT SDK 1.1.0 of Jul 17, 2014, seems to be out. At least it is available in Maven central.
This is the better answer of course but will require several code adjustments if you have built code on top of internal structures due to some internal refactorings.

xml to wbxml conversion for activesync in iOS

I have been trying to built an app which will communicate with MS-ActiveSync Exchange. I am stuck at the provisioning part. I need to send a post HTTP request with WBXML content in body. But I could not find anything anywhere to convert xml to wbxml for active sync.
There are some C based libraries available like wbxml2, but can I use them for active sync. There are no code pages provided in the library as mentioned in MS-Activesync Exchange documentation. Please help!!!
Use libwbxml. The package has xml2wbxml and wbxml2xml. Code pages are included.
save this as prov.xml:
<?xml version="1.0"?>
<!DOCTYPE ActiveSync PUBLIC "-//MICROSOFT//DTD ActiveSync//EN" "http://www.microsoft.com/">
<Provision xmlns="Provision:">
<Policies>
<Policy>
<PolicyType>MS-WAP-Provisioning-XML</PolicyType>
</Policy></Policies></Provision>
then:
xml2wbxml -a prov.xml -o prov.wbxml
You can manipulate wbxml as text.
In https://code.google.com/p/tz-push/
In javascript:
prov.wbxml = string.fromCharCode(0x03,0x01,0x6A,0x00,0x00,0x0E,0x45,0x46,0x47,0x48,0x03,0x4D,0x53,0x2D,0x57,0x41,0x50,0x2D,0x50,0x72,0x6F,0x76,0x69,0x73,0x69,0x6F,0x6E,0x69,0x6E,0x67,0x2D,0x58,0x4D,0x4C,0x00,0x01,0x01,0x01,0x01)
wbxml2xml and xml2wbxml are command line programs included with libwbxml. I know nothing about IOS development.
Have a look at https://tz-push.googlecode.com/files/towbxml.js it is xml to wbxml converter written in js. (Can be run in Thunderbird/Workspace or Firefox/Sratchpad.) I know this is not what you want but the code may point you in the correct direction. It uses Sax. So if you have a sax parser available should be easy to port.

Bing API Azure Marketplace: how to know whether there are more results?

I am using the Bing Search API in Windows Azure Marketplace (i.e., the API that replaces the old Bing 2.0 API, that expires on 1st August 2012). The Migration Guide provided by Microsoft states:
If there are no more pages of results, the /feed/link[#rel=’next’] property will no longer appear [...].
However, it seems that this is not always the case. For example, a News query for "Roger Federer" does not contain a link element:
Request: https://api.datamarket.azure.com/Data.ashx/Bing/Search/News?Query=%27"Roger+Federer"%27
Response:
<feed xmlns:base="https://api.datamarket.azure.com/Data.ashx/Bing/Search/News"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns="http://www.w3.org/2005/Atom">
<title type="text">"Roger Federer"</title>
<subtitle type="text">Bing News Search</subtitle>
<id>https://api.datamarket.azure.com/Data.ashx/Bing/Search/News?Query='"Roger Federer"'</id>
<rights type="text"/>
<updated>2012-07-26T15:43:03Z</updated>
<entry>
<!-- ... -->
</entry>
<!-- ... -->
</feed>
Nevertheless, there are more news: https://api.datamarket.azure.com/Data.ashx/Bing/Search/News?Query=%27"Roger+Federer"%27&$skip=50
Does anybody know where the problem might be? (Or where there is reliable documentation for the API?)
One thing to do is to update your BingSearchContainer.cs - I found there was an older version when I first started using it that caused me all sorts of problems like this. When I updated a lot of things started working.
I think the problem is that the BingSearchContainer is "fixing" your query and messing you up. Try the following:
Then try to do the query without the " marks. It will probably succeed and return results.
Try to use ' instead, you will probably get some results.
I think the container is escaping all your queries as a single phrase match by default. So just adding a search will work. Now when you really do have two phrases you need to search for... That I can't get working yet either.
I cannot reproduce this anymore: the response now contains a link element.
I suppose the Bing guys have fixed the problem in the meantime.

Bind html to webbrower control?

i used this method link:http://compiledexperience.com/blog/posts/binding-html-to-the-web-browser-control
but had error message like "HTML not found in the type of webbrowercontrol property". i think it's a simple mistake but I'm new to windows phone.so please help me.
You haven't given much information, but my guess is that you are trying to set a HTML property on the WebBrowser control. The blog post you linked to describes the creation of an attached property, so you need to supply a prefix:
<Page xmlns:cxi="clr-namespace: ...">
<phone:WebBrowser cxi:WebBrowserHelper.Html="{Binding Question.Body}" />
</Page>
I would suggest reading about XAML namspaces and attached properties on MSDN.

Resources