Node.js developers: add some Windows Azure authentication and access control to your Node app with the newly MS Open Tech’s released open source library for Windows Azure Active Directory service.
Windows Azure Active Directory is a REST based service that provides authentication and access control functionality for web applications. Libraries are available that make integrating the service with web applications easier.
Microsoft Open Technologies, Inc., has developed the Node.js library in the form of Passport strategies and made the code available on github. You can use the Node Package Manager (npm) to use the library and package it into your Node.js. We are also working with the Windows Azure team to integrate this new Node.js library in the Windows Azure SDK.
As most Node.js applications use Passport as the authentication middleware, we created this new library as a couple of Passport strategies that can be used similarly to other ones. These 2 strategies are SAMLp and WSFed .
The GitHub repository also contains source code examples and instructions to configure the Windows Azure service.
Check out the Windows Azure Active Directory site to learn more about the service and get started today typing the following in your command prompt:
npm install passport-azure-ad
Let us know what you think in the comments below!
The first thing about designing software is this:
You know from experience that the later you make a change, the more expensive the change is. How do we reduce these costs? One way to go about it is to address the change earlier, when it's cheaper. You do more requirement-gathering and design upfront. At least you try to put extensibility hooks and some preemptive code in place for when the right time comes, then you can add new stuff without having to modify the existing stuff too much. It's a great idea, but it only takes you so far. Doing it well requires increased predictive powers, you must commit now to what you think you'll need later. Predicting the future is tricky though. Adding extensibility ahead of time is like buying extended warranty for a specific incident when you should be saving for any emergency, not just the particular ones you can foresee. Too much speculative stuff too early leads to additional complexity that gets in the way of changing the code right now for things you didn't predict. Then it becomes a self-fulfilling prophecy.
All along you were trying to reduce costs, so the first question to ask is not "how do I avoid writing this code later?", but "why is writing this later more expensive?" After all, if you can make changes cheap at any time, then suddenly you don't need to be as good at forecasting.
So what makes changing code expensive? The thing is, the cost of writing the code is roughly the same whether you do it now or later. It's the cost of understanding the context in which the code is to be written that increases. The messier the context, the more expensive it becomes to plow changes through it. Between a codebase that has no extensibility hooks in place, but is otherwise broken down in small, well-decoupled and well-encapsulated pieces, and a codebase with lots of extensibility and preemptive code built in, but otherwise made of big chunks of highly-entangled, spaghetti-woven pieces, the first one is better prepared for what comes next. It can reach into a broader set of possible futures than the one you predicted.
Simply put, the probability of any change happening is larger than the probability of a predicted change happening, for the former includes the latter, of course, so go with a design that has robustness around changes in general instead of one that tries too hard to preempt future requirements. At the end, future-proofing design is about solid fundamentals: low coupling, high cohesion, good layering, keeping things simple. The beauty about it is this: it's easier to tell if a design has good fundamentals than to try to predict the domain-specific requirements that will disrupt it.
上周我们发布了重新改造的 Internet Explorer 开发人员中心 (msdn.com/ie),以简化开发人员快速查找全面的文档的过程。作为更大规模的 Windows 开发人员中心重新设计的一部分,我们根据您的反馈对我们的网站结构进行了调整,以便能够:
我们将新的 IE 开发人员中心划分为三个主要方面:
您可以在此处下载 IE、了解关于 F12 开发人员工具,并访问我们的开发人员指南和兼容性手册以了解最新版本的 IE 中的新增内容和更改内容。
了解灵感十足的想法、更新 Web 标准的技巧、关于 Windows 8 上的 IE10 浏览体验的详细信息,以及关于免插件运行、构建自适应和触控就绪的网站和将您的网站与 Windows 集成的有用信息。
访问 Web 平台功能的门户页面、我们的 API 参考、示例库和社区论坛。
“开发”部分代表着 IE 库内容的核心。为了帮助您快速查找您需要的内容,我们重新组织了我们的高流量页面以将相同主题的所有相关资源汇集到一起。
借助重新组织的 IE 开发人员中心,您无需知道哪个版本的 IE 引入或更改了功能来了解与之相关的所有信息。取而代之,您可以通过 IE 支持的现代 Web 平台功能的按字母顺序排列的列表来方便地查找我们的开发人员指南主题,或者您也可以根据主题来按区域浏览。当然,我们将继续在介绍相关内容的特定版本的 IE 开发人员指南中发布这些相同的主题。
我们还有更多的改进正在进行中,但我们希望您立即访问全新的 IE 开发人员中心,其更加有用并且可用性更强。我们将继续努力听取各位的反馈,并寻求使我们的内容更易于访问并与您的工作更相关的方式。我们欢迎您在此处的博文中或在网站上提出您的反馈。
Erika Navara,内容开发人员
Seit der vergangenen Woche ist das neu gestaltete Internet Explorer Developer Center online (msdn.com/ie), in dem Entwickler einen noch einfacheren Zugriff auf die umfangreiche Dokumentation erhalten. Wir haben die Struktur der Website im Rahmen einer größeren Umgestaltung des Windows Dev Center anhand Ihres Feedbacks angepasst. Das neue Design bietet die folgenden Vorteile:
Wir haben das neue IE Dev Center in drei Bereiche unterteilt:
Hier können Sie IE herunterladen, mehr über die F12-Entwicklertools erfahren und auf unsere Entwicklerhandbücher und Kompatibilitäts-Cookbooks zugreifen und sich ansehen, was in den neuesten Versionen von IE hinzugekommen ist oder sich verändert hat.
Hier können Sie sich inspirieren lassen, erhalten Sie Tipps zum Aktualisieren auf Webstandards, Einblicke in die Benutzeroberfläche von IE10 unter Windows 8, nützliche Informationen zum Entwickeln ohne Plug-Ins, zum Erstellen von adaptiven und für Touchscreens vorbereiteten Websites und zum Anheften Ihrer Website in Windows.
Hier finden Sie Portalseiten mit Webplattformtechnologien, unserer API-Referenz, Galeriebeispielen und Community-Foren.
Der Bereich "Entwickeln" enthält den Grundstock der IE-Bibliotheksinhalte. Wir haben die am häufigsten besuchten Seiten neu strukturiert, indem wir alle für ein bestimmtes Thema relevanten Ressourcen zusammengeführt haben, damit Sie benötigte Informationen schneller finden.
Dank der neuen Struktur des IE Developer Center müssen Sie nicht mehr wissen, in welcher IE-Version welche Funktion eingeführt oder geändert wurde, damit Sie alle wesentlichen Informationen erhalten. Stattdessen finden Sie die Themen in unserem Entwicklerhandbuch bequem in einer alphabetischen Liste der von IE unterstützten modernen Webplattformtechnologien oder thematisch nach Bereichen geordnet. Selbstverständlich werden wir die gleichen Themen auch weiterhin in den zugehörigen Versionen des IE-Entwicklerhandbuchs veröffentlichen, in denen das Thema eingeführt wurde.
Weitere Verbesserungen befinden sich auf dem Weg, doch hoffen wir, dass Sie das neue IE Developer Center schon jetzt hilfreicher und nützlicher finden. Wir werden Ihr Feedback auch weiterhin berücksichtigen, um den Zugriff auf unsere Inhalte einfacher zu gestalten und so relevanter für Ihre Arbeit zu machen. Wir freuen uns über Ihr Feedback hier im Blog oder auf der Site.
Erika Navara, Content Developer
Nous avons lancé la semaine dernière une nouvelle version du Centre de développement Internet Explorer (msdn.com/ie), qui permet aux développeurs d'accéder plus rapidement à une documentation complète. En nous appuyant sur vos commentaires, nous avons modifié la structure de notre site, dans le cadre d'une refonte plus générale du Centre de développement Windows, pour vous aider :
Le nouveau Centre de développement IE est désormais organisé en trois sections principales :
Vous pouvez télécharger IE, obtenir plus d'informations sur les Outils de développement F12 et accéder à nos Guides du développeur ainsi qu'à nos Guides de référence sur la compatibilité, pour découvrir les modifications apportées aux dernières versions d'IE et les nouveautés.
Trouvez des idées inspirantes, des conseils sur la mise à jour pour le respect des standards du Web, des détails sur les expériences de navigation dans IE10 sur Windows 8, des informations utiles sur la navigation sans plug-in et sur la création de sites adaptatifs et compatibles avec le tactile, ainsi que sur l'intégration de votre site avec Windows.
Accédez à des pages de portail consacrées aux fonctionnalités de la plateforme Web, aux informations de référence sur les API, à une galerie d'exemples et aux forums de la communauté.
La section « Développer » constitue véritablement le cœur des contenus de la bibliothèque IE. Pour vous aider à trouver rapidement les contenus dont vous avez besoin, nous avons réorganisé nos pages les plus visitées afin de regrouper toutes les ressources pertinentes consacrées à un même sujet.
Grâce à la nouvelle organisation du Centre de développement IE, vous n'avez plus besoin de savoir quelle version d'IE a introduit ou modifié une fonctionnalité pour trouver toutes les informations la concernant. Ainsi, pour plus de praticité, vous retrouverez facilement nos sujets Guide du développeur dans une liste alphabétique regroupant les fonctionnalités de la plateforme Web moderne prises en charge par IE. Vous pouvez aussi parcourir les sujets par thème. Bien évidemment, nous continuerons à publier ces sujets dans les Guides de développement IE consacrés aux versions spécifiques dans lesquelles les fonctionnalités ont été introduites.
D'autres améliorations sont en projet, mais nous sommes convaincus que vous trouverez le nouveau Centre de développement IE plus utile et plus pratique. Nous allons continuer à écouter vos commentaires, et à chercher de nouveaux moyens de faciliter l'accès aux contenus et de les rendre encore plus pertinents pour votre travail. N'hésitez pas à nous faire part de vos commentaires sur ce blog ou sur le site.
Erika Navara, Développeur de contenus
Microsoft は先週、ページ構成を新たに整理した Internet Explorer デベロッパー センターを公開しました (msdn.com/ie)。これにより、開発者の皆様は、総合的な情報を提供するドキュメントをすぐに見つけられるようになりました。皆様のフィードバックに基づく今回のサイト構造の見直しは、より大規模な Windows デベロッパー センター再編成の一環として実施され、以下が実現されました。
新しい IE デベロッパー センターを構成する 3 つの領域を紹介します。
IE をダウンロードし、F12 開発者ツールに関する情報を入手できます。IE の最新バージョンの新機能と機能変更に関する情報を提供する開発者向けガイドと互換性クックブックにもここからアクセスできます。
インスピレーションを与えてくれるアイデア、Web 標準準拠のためのアップデートに関するヒント、Windows 8 の Internet Explorer 10 が提供するブラウジング エクスペリエンスの詳細、プラグイン フリー化に役立つ情報、適応力に優れたタッチ対応サイトの構築方法、既存サイトと Windows の連携方法などの情報を提供します。
Web プラットフォームの機能、Microsoft の API リファレンス、サンプル ギャラリー、コミュニティ フォーラムの各ポータル ページにアクセスできます。
IE ライブラリ コンテンツの中心となるのが、この「開発」セクションです。必要なコンテンツを簡単に見つけられるようにするため、最もアクセス数が多いページを起点に、同じトピックの関連リソースにアクセスできるように構造を変更しました。
IE デベロッパー センターの再編成によって、ある機能に関するすべての情報を、その機能が導入あるいは変更された IE バージョンを知らなくても見つけられるようになりました。新しい構造では、開発者向けガイドのトピックに、IE がサポートする最新の Web プラットフォーム機能のアルファベット順一覧、または分野別表示を使ってアクセスできます。もちろん、同じトピックを、該当する機能が初めて導入された IE の開発者向けガイドの中でも読めるようにする予定です。
現在もさまざまな改善が進行中の新しい IE デベロッパー センターを今すぐご覧いただき、その使いやすさと役立つ情報をご確認いただければさいわいです。引き続き皆様のフィードバックを参考に、よりアクセス性の高い、皆様の取り組みを適切にサポートできるようなコンテンツにしていきます。ご意見ご感想を、本ブログ記事またはサイトよりお聞かせください。
コンテンツ開発者 Erika Navara
지난주 우리는 개발자들이 포괄적인 설명서를 빠르게 찾아볼 수 있도록 새 단장한 Internet Explorer 개발자 센터(msdn.com/ie)를 선보였습니다. 여러분의 의견을 바탕으로 Windows 개발자 센터를 새롭게 디자인하는 차원에서 사이트 구조를 조정하고 다음과 같은 사항들을 개선했습니다.
우리는 새로운 IE 개발자 센터를 크게 세 분야로 나누었습니다.
이곳에서 IE를 다운로드할 수 있습니다. F12 개발자 도구에 대한 더 자세한 내용을 알 수 있으며 개발자 가이드나 호환성 설명서를 통해 최신 IE 버전의 새로운 사항이나 변경 내용도 볼 수 있습니다.
톡톡 튀는 아이디어, 웹 표준을 업데이트하는 방법, Windows 8에서 IE10의 브라우징 경험에 대한 자세한 내용, 플러그인에서 해방되는 것에 대한 유용한 정보, 터치 기반에서도 잘 작동하는 사이트 만들기, Windows로 여러분의 사이트를 통합하는 방법 등 다양한 정보를 볼 수 있습니다.
웹 플랫폼 기능에 대한 포털 페이지, API 참조, 샘플 갤러리, 커뮤니티 포럼에 액세스할 수 있습니다.
개발 섹션은 IE 라이브러리 콘텐츠의 진수를 보여줍니다. 필요한 콘텐츠를 빨리 찾을 수 있도록 하기 위해 가장 많이 찾는 페이지에서 연관성 있는 리소스들을 모두 같은 토픽으로 모아두었습니다.
새로운 구조로 개편된 IE 개발자 센터에서는 새로 도입되었거나 변경된 IE 기능을 알고 싶을 때 해당 IE 버전을 몰라도 관련 정보를 찾을 수 있습니다. IE가 지원하는 현대적 웹 플랫폼 기능에 대한 알파벳순 목록이나 분야별 테마에서 기존의 개발자 가이드 토픽을 찾아보면 됩니다. 물론 이러한 토픽은 원래 소개되었던 IE 개발자 가이드의 특정 버전에도 계속 게시될 것입니다.
아직도 개선 작업이 진행 중이긴 하지만 지금 선보인 새 IE 개발자 센터가 사용하기 편리하고 유용하기를 바랍니다. 여러분의 의견을 항상 기다리고 있으며, 또한 콘텐츠에 더 쉽게 접근할 수 있는 방법을 찾고 여러분의 작업에 더욱 도움이 될 수 있도록 노력하고 있습니다. 이 블로그와 사이트에 여러분의 의견을 남겨 주십시오.
콘텐츠 개발자, Erika Navara
Na semana passada, lançamos a Central de Desenvolvedores do Internet Explorer remodelada (msdn.com/ie) para que os desenvolvedores localizem com rapidez e facilidade as documentações detalhadas. Com base em seus comentários, ajustamos a estrutura de nosso site como parte de um plano mais abrangente de recriação do Centro de Desenvolvimento do Windows com o objetivo de:
Organizamos a nova Central de Desenvolvedores do IE em três áreas principais:
Aqui é possível baixar o IE, saber mais sobre as ferramentas de desenvolvedor F12 e acessar nossos Guias do Desenvolvedor e Compatibility Cookbooks para saber mais sobre as novidades e alterações nas últimas versões do IE.
Encontre ideias inspiradoras, dicas sobre a atualização dos padrões da Web, detalhes sobre a experiência de navegação do IE10 no Windows 8, informações úteis sobre o uso do navegador sem plug-ins, criação de sites adaptáveis compatíveis com toque e integração do seu site com o Windows.
Acesse as páginas do portal para consultar os recursos da plataforma Web, nossas referências de API, galeria de exemplos e fóruns da comunidade.
A seção Desenvolver é o centro do conteúdo da biblioteca do IE. Para ajudá-lo a localizar com rapidez o conteúdo de que você precisa, reorganizamos nossas páginas mais visitadas reunindo todos os recursos relevantes no mesmo tópico.
Com a nova organização da Central de Desenvolvedores do IE, não será necessário saber qual versão do IE introduziu ou alterou um recurso para que seja possível localizar todas as nossas informações sobre ele. Em vez disso, você pode localizar com facilidade nossos tópicos do Guia do Desenvolvedor por meio de uma lista alfabética dos modernos recursos da plataforma Web compatíveis com o IE, ou você pode navegá-los tematicamente por área. Claro, continuaremos a publicar esses mesmos tópicos dentro das versões específicas do Guia do Desenvolvedor do IE nas quais eles foram introduzidos.
Outras melhorias estão a caminho, mas esperamos que a nova Central do Desenvolvedores do IE seja mais útil e fácil de usar. Continuaremos a acompanhar os seus comentários e a buscar novas maneiras de facilitar o acesso ao nosso conteúdo para torná-lo mais relevante ao seu trabalho. Os seus comentários são bem-vindos aqui no blog ou no site.
Erika Navara, desenvolvedora de conteúdo
На прошлой неделе мы запустили обновленный Центр разработки для Internet Explorer (msdn.com/ie), чтобы помочь разработчикам проще и быстрее находить исчерпывающую документацию. Опираясь на ваши отзывы, мы скорректировали структуру нашего сайта в рамках более масштабной модернизации Центра разработки для Windows, чтобы достичь следующих целей:
Мы разделили Центр разработки для Internet Explorer на три основные области:
Здесь вы можете скачать Internet Explorer, больше узнать о средствах разработчика F12 и получить доступ к нашим руководствам для разработчиков и руководствам по совместимости, чтобы узнать о новых компонентах и изменениях в новейших версиях Internet Explorer.
Здесь вы найдете вдохновляющие идеи, советы по обновлению до веб-стандартов, подробные сведения о способах навигации в Internet Explorer 10 в Windows 8, полезную информацию по отказу от использования подключаемых модулей, созданию адаптивных и оптимизированных для сенсорного управления сайтов, а также по интеграции вашего сайта с Windows.
Здесь вы можете получить доступ к страницам портала, посвященным компонентам веб-платформы, к нашему справочнику по API, коллекции примеров и форумам сообщества.
Раздел "Разработка" является центральным хранилищем библиотеки по Internet Explorer. Чтобы помочь вам быстро находить необходимый контент, мы переработали наши самые посещаемые страницы и собрали все нужные ресурсы по каждой теме.
Благодаря новой организации Центра разработки для Internet Explorer вам не нужно знать, в какой версии Internet Explorer был введен или изменен тот или иной компонент, чтобы найти всю информацию о нем. Вы можете найти разделы нашего Руководства для разработчиков в списке (в алфавитном порядке) современных компонентов веб-платформы, поддерживаемых Internet Explorer, или просмотреть их по темам в зависимости от области, что очень удобно. Разумеется, мы продолжим публиковать те же разделы в соответствующих версиях Руководства по Internet Explorer для разработчиков, где они были представлены.
Еще много усовершенствований находятся в процессе реализации, но мы надеемся, что вы сразу заметите, что новый Центр разработки для Internet Explorer стал более удобным и полезным. Мы продолжим внимательно изучать ваши отзывы и искать способы упростить доступ к контенту и сделать его более полезным для вашей работы. Мы ждем ваших отзывов здесь, в блоге, или на сайте.
Эрика Навара (Erika Navara), разработчик контента
A few new posts this week over on the Project Support blog.
Enjoy!
Often, there’s a need to save out suspended messages out to a file, so that we can resubmit/inspect them later. From the BizTalk Admin Console, we can right-click the suspended service instance -> Show Messages. When the messages associated with that service instance opens up, we can right-click -> Save to File. However, for hundreds (possibly thousands) of suspended instances, this is not possible.
One of the options of doing this is using the wonderful BizTalk Terminator Tool (http://www.microsoft.com/en-us/download/details.aspx?id=2846). If you’re okay terminating these instances, you can use this to save out the suspended messages, before terminating the suspended service instances. The only drawback to this approach is that you have no option but to terminate the instances. [After you click Connect on the first Terminator window, you need to click the Delete button at the bottom, and then select the ‘Terminate Instances’ option to get to this screen].
What if you wanted to retain the suspended instances, and yet save the messages out to disk?
Well, time to write some WMI code. We chose to use a PowerShell script in this case. We could easily have called the same WMI queries using VBScript or, C#. So, here is the code -
#
# Use:
# C:\.\Save_Suspended_msgs.ps1 -action list
# C:\.\Save_Suspended_msgs.ps1 -action save
"c:\temp\Suspended_msgs" ([optional]> log.file)
#
# declare our parameters: the action to take, and an optional
# path to save messages to
#
param(
[string] $action=$(throw 'need action'),
[string] $path=$(if ($action -eq 'save') { throw 'need path' })
)
$counter = 0
function bts-get-messaging-svc-instances()
{
get-wmiobject MSBTS_ServiceInstance `
-namespace 'root\MicrosoftBizTalkServer'
-filter '(ServiceClass=1 or ServiceClass=4) and ServiceStatus = 4 '
}
#
# save the message associated to the
# specified messaging Service Instance
#
function
bts-save-message([string]$msgid, [string]$sname)
{
"msgid is $msgid"
"ServiceName is $sname"
"msg_counter is $counter"
$msg = get-wmiobject MSBTS_MessageInstance `
-namespace 'root\MicrosoftBizTalkServer'
-filter "ServiceInstanceID = '$msgid'"
$newpath = (Join-Path $path $sname)
"new path is $newpath"
$r_code= (test-path $newpath)
"return code is $r_code"
if ($r_code -eq $False)
{
md $newpath
"new directory created"
}
if ($msg.psbase.length -gt 0)
{
foreach($m in $msg)
{
$m.psbase.invokemethod('SaveToFile', ($newpath))
"Message from ServiceInstanceID=$msgid saved to $newpath."
}
}
}
#
# main script
#
switch ( $action )
{
'list' {
# bts-get-messaging-svc-instances
bts-get-messaging-svc-instances |
bts-get-messaging-svc-instances |
fl *
# fl InstanceId, ServiceName, SuspendTime,HostName,
# ServiceStatus, ServiceClass, ErrorId, ErrorDescription
}
'save' {
bts-get-messaging-svc-instances |
%{ $counter++; bts-save-message $_.InstanceID $_.ServiceName }
}
}
In the bts-get-messaging-svc-instances() function, we have –
get-wmiobject MSBTS_ServiceInstance `
-namespace 'root\MicrosoftBizTalkServer' `
-filter '(ServiceClass=1 or ServiceClass=4) and ServiceStatus = 4 '
We are filtering on Service instances with ‘ServiceClass = 1’ (this gets Orchestration suspended instances) or, ‘ServiceClass = 4’ (messaging service instances). ‘ServiceStatus = 4’ means Suspended (Resumable). These are the other Service Status codes, in case you need it:
//******** List of WMI Service Statuses ********
//ServiceStatus = 1 - Ready To Run
//ServiceStatus = 2 - Active
//ServiceStatus = 4 - Suspended (Resumable)
//ServiceStatus = 8 - Dehydrated
//ServiceStatus = 16 - Completed With Discarded Messages' in BizTalk Server 2004
//ServiceStatus = 32 - Suspended (Not Resumable)
//ServiceStatus = 64 - In Breakpoint
Usage : To use this script, save this to a file (say at the path - C:\script\Save_Suspended_msgs.ps1 ), and run this from the PowerShell command prompt:
PS C:\Users\Administrator> C:\script\Save_Suspended_msgs.ps1 -action save "c:\temp\Suspended_msgs"
This would create separate folders for each suspended instance type under the ‘Suspended_msgs’ folder specified above. So, if you have suspended instances for two different Orchestration types, it would create folders named after those Orchestrations and save out the messages in their respective folders.
All good, right? Well, this solution works great as long as your suspended orchestration instances don’t contain multiple suspended messages. We cover in Part II of this article how to handle this specific case.
Written by
Arindam Paul Roy
Reviewed by
Jainath V R
Microsoft India GTSC
Ross Heise has a quick walkthrough on adding geolocation to your Windows store Apps. Here’s a bit of code to whet your appetite:
The Windows.Devices.Geolocation namespace is used for retrieving your location. Whether you use GPS, a WiFi network, or an IP address to retrieve a user’s location depends on two primary factors:
C#
Geolocator geolocator = new Geolocator(); geolocator.DesiredAccuracy = Windows.Devices.Geolocation.PositionAccuracy.High; Geoposition pos = await geolocator.GetGeopositionAsync().AsTask(token);JavaScript
var geolocator = Windows.Devices.Geolocation.Geolocator(); geolocator.desiredAccuracy = Windows.Devices.Geolocation.PositionAccuracy.high; // Get the geoposition, capturing the request in a 'promise' object. var promise = geolocator.getGeopositionAsync();[…] For full details on using geolocation and the Bing Maps SDK, we have a new video, how-to topic , and code sample that leads you through the steps of asynchronously acquiring your location and then using the Bing Maps SDK to show where you are in a visual manner.
Create location aware apps using geolocation and Bing Maps
Technorati Tags: Windows,Windows 8,geolocation,Windows programming,Windows SDK,Windows Store app,Bing MapsBy tying together a user’s location to the business logic of your app, you can easily provide app users with weather, coupons, sporting events, or concert listings for their current location. You can use the geolocation capabilities of Windows 8, along with the Bing Maps SDK, to create great location aware Windows Store apps.
Let’s take a look at how your app can use the location service to provide users location-specific info with either an IP address, WiFi network, or GPS data. Once you have the location, you can use the Bing Maps SDK to show the user where they are.
Retrieving LocationThe Windows.Devices.Geolocation namespace is used for retrieving your location. Whether you use GPS, a WiFi network, or an IP address to retrieve a user’s location depends on two primary factors:
When requesting a location, your app should specify your desired accuracy so the location data can be returned as quickly as possible within the given range. Each of the location types have degrees of accuracy:
Consider your desired accuracy value carefully. It can affect your app’s performance and power consumption. For example, if your app is providing a weather forecast, you rarely need the high accuracy of GPS. Also be sure to indicate the accuracy of your data by displaying an error radius based on the accuracy of the data returned. Here is the C# code to set your desired accuracy:
C#
Geolocator geolocator = new Geolocator();C#
Geoposition pos = await geolocator.GetGeopositionAsync().AsTask(token);Here’s the JavaScript code that creates an instance of the Geolocator class, sets the desired accuracy, and then gets the current location. Note that the ‘promise’ variable below is a WinJS.Promise object – you’ll need to use the done method to access the data from the call to getGeopositionAsync.
JavaScript
var geolocator = Windows.Devices.Geolocation.Geolocator();The Bing Maps app is a good example of an app that adapts to the accuracy of the location data available to it. On a desktop PC, which typically doesn’t have GPS or Wi-Fi, it finds the location based on the IP address and zooms in to a region level when mapping the current location. On a laptop, which typically has a wireless card, it uses the Wi-Fi to get a more precise location and zoom in further when showing current location. If the user zooms in even further, the current location icon will show an error radius. On a device with GPS, Bing Maps gets the high accuracy location data from the GPS and displays a more accurate location.
Bing WeatherAs mentioned above, an app like the Bing Weather app only needs region information. Because of this, it can specify that it only needs low accuracy allowing it to quickly get a location value back. This makes the app more responsive to the user. Other examples of apps that may need only region level information include radio station guides, shopping deals, or local news feeds.
Displaying location data with the Bing Maps SDKAfter you have the location information from your call to GetGeopositionAsync, you’ll want to display it on a map.
C#
Location location = new Location(pos.Coordinate.Latitude, pos.Coordinate.Longitude);JavaScript:
promise.done(
C#
double zoomLevel = 13.0f;Then, you’ll need to create a <div> tag to contain the map, setting the id attribute so that you can access it.
<div id=’map-div’></div>Last, you’ll need to initialize the map control in the HTML page. Here’s some JavaScript code that does so:
// Load the Microsoft.Maps.Map module and then call getMap when the
For full details on using geolocation and the Bing Maps SDK, we have a new video, how-to topic , and code sample that leads you through the steps of asynchronously acquiring your location and then using the Bing Maps SDK to show where you are in a visual manner. The video, how-to topic, and sample guide you through enabling the location capability, getting the location asynchronously, setting the map to a given location, and setting the location icon based on the accuracy of the location data. You can also find more info in Bing Maps for Windows Store Apps.
Wrapping upLocation can be a powerful and time saving feature to add to your app. You can provide the user with more pertinent information based on where they are. Whether it’s a list of local radio stations, shopping deals, traffic information, or weather information, the control to tailor that information based on location can make your app more useful. And the ability to make that happen automatically, without user interaction, saves the user time and makes them more likely to use your app.
--Ross Heise, Senior Content Developer, Windows Developer Content
Some time ago, I showed how to get a window back on the screen when it moved far, far away. That technique still works in Windows 7 and 8, but there's an easier shortcut that takes advantage of window arrangement features added in Windows 7.
First, you switch to the application by whatever means. Then hit Win+UpArrow to maximize the window. That should put the window on-screen, albeit at the wrong size. Now you just grab the title bar of the window with the mouse and drag it off the top edge of the screen. Bingo, the window returns to its original position, and you can use the mouse to put it wherever you like.
This trick doesn't work for windows that cannot be resized (such as Calculator), but for those windows, you can use the old version of the trick.
Two new capability resources from the Microsoft Dynamics AX product management team have recently been made available.
Retail Performance White Paper for Microsoft Dynamics AX 2012
This white paper provides an overview of a series of performance tests run by Microsoft to enable customers and partners to better size capacity for the infrastructure that they require for an implementation of the Microsoft Dynamics AX 2012 Retail module.
As a part of the release process for Microsoft Dynamics AX 2012 R2, Microsoft conducted a series of performance tests to enable customers and partners to better size the capacity for the infrastructure that is required for their implementation. The performance tests showcase the ability of the solution to scale based on critical business scenarios that pertain to the Retail industry. The performance tests include many functional scenarios across different client and integration technologies providing a view of the core retail scenarios.
Visit PartnerSource to view or download the document.
Retail Benchmark Results for Microsoft Dynamics AX 2012 R2
These documents provide a set of detailed results from benchmark testing of multiple retail workloads on Microsoft Dynamics AX 2012 R2.
The benchmark showcases the ability of Microsoft Dynamics AX 2012 R2 to handle various specialized loads concurrently, without compromising performance and scalability on critical business processes. The benchmark includes many functional scenarios across different client and integration technologies, thereby providing a view of retail back-end scenarios.
Visit PartnerSource to view or download the documents.
--Kevin
When your team is collaborating on a project, you need a regular and reliable development process to ensure smooth delivery while maintaining high quality. This process typically includes frequent integrations from team members, regular builds, and testing against the new build to measure quality. Continuous integration is a great way to manage this kind of process.
In SharePoint development, continuous integration has historically meant setting up a SharePoint server together with a build server in your organization to get regular builds and run tests on it. With the launch of Office 365 and Team Foundation Service (TFS), this onerous setup is no longer required. Instead, you can simply sign-up for each of these services. In this post, we’ll walk through configuring these services so that you can enable continuous integration for your projects.
Get an Office 365 Developer accountTo develop, test, and deploy apps for Office and SharePoint, you can sign up for an Office 365 Developer Site. Follow the instructions in Sign up for an Office 365 Developer Site to start your free trial.
Get your Team Foundation Service accountTeam Foundation Service lets you plan projects, collaborate with your team, and manage your code online from anywhere without needing to set up your own Team Foundation server. Instead, it stores your source code and work items in the cloud. You can check your code directly into the cloud through Team Foundation Service using Visual Studio or Eclipse, and you can manage your work items and bugs in the browser.
Team Foundation Service offers a free plan for up to five users per account. It provides features including version control (through Team Foundation Version Control or Git), work item tracking, agile planning tools, feedback management, and build and test management. Go to the Team Foundation Service site to get started. The cloud-hosted build service on Team Foundation Service is preconfigured with the right environment for apps for Office and SharePoint 2013, and also for SharePoint 2010 or 2013 farm and sandboxed solutions.
Note that the build machines on Team Foundation Service can access only public visible SharePoint (and web) servers. This means that your target SharePoint site should be either on Office 365 (for apps) or on a SharePoint virtual machine (VM) in the cloud (for SharePoint farm and sandboxed solutions).
Start your continuous integration on Team Foundation ServiceEarlier this year, we shipped Office Developer Tools for Visual Studio 2012 for developing apps for Office and SharePoint 2013. At the same time, we also published a CodePlex project to support continuous integration for Office and SharePoint 2013 projects using TFS 2012: see Office/SharePoint 2013 Continuous Integration with TFS 2012.
This CodePlex project contains a set of Windows PowerShell scripts for deployment and a custom TFS Build workflow template, which lets you build and deploy (for testing purpose) apps for Office and SharePoint 2013 projects using TFS 2012. Here’s all you need to do:
For detailed instructions, see the Documentation page of the CodePlex project.
Using these resources, you will be able to do continuous integration for Office and SharePoint 2013 projects. Depending on your project, you may find these tips helpful:
I hope that you will give continuous integration a try. Like always, I’d love to hear from you. If you have a suggestion, question, bug, or anything else, please don’t hesitate to let me know!
Have fun!