_reference.js的故事

本文乃译文,英文原版点这里
在Visual Studio中开发web项目的时候,_reference.js 文件是高效使用Intellisense(智能提示)的一个很关键的文件。在某种程度上,有无这个文件,是高效Intellisense和完全没有Intellisense的区别。
_r1

本文将介绍_references.js文件背后的故事,它如何工作?又是如何诞生的?

新的JavaScript编辑器

就在Visual Studio 2010发布后不久,JavaScript编辑器的所有权从ASP.NET & Web Tooling团队(我曾经是其中一员)移交到了新成立的Client Platform团队。

这个新团队将为Visual Studio 2012开发一个全新的现代化的Javascript编辑器,它将与即将面世的基于HTML/JavaScript的Windows 8 Store Apps的开发体验保持一致。

VS 2010中现有的旧的JavaScript编辑器即将从VS退休,但会在WebMatrix中获得新生,并继续开发和更新。

随着新编辑器的工作逐渐展开,我们决定重新设计其中的部分功能。其中就包括Intellisense。
Continue reading “_reference.js的故事”

Lead Gen 101: How to Create an Intuitive Website Conversion Path

start

If you’re getting your website visitors to sign up for anything on your website — an ebook, a whitepaper, a webinar, a newsletter, a blog subscription, etc. — you need to create a conversion path. A conversion path consists of five elements, four of which live on your website:

  1. A call-to-action – A button or text that lets website visitors (prospects) find your offer
  2. A landing page – The page that advertises your offer and includes a form
  3. A form – Website visitors fill out this form in order to receive your offer
  4. A thank-you page – Your new leads see this page after completing your form
  5. A confirmation email – Makes it easy for your leads to reference your offer any time

Continue reading “Lead Gen 101: How to Create an Intuitive Website Conversion Path”

Continuous Learning on Azure(5): Azure Web App vs Cloud Services

The question of the week is. When do you use Windows Azure Websites as your web platform and when do you use Cloud Services. These two platforms provide similar functionality in that you can deploy your ASP.NET or other IIS based web application projects to either of these platforms. There are some general cases of when to use one over the other and some specific differences that may help in making that decision. In this post I am going to go through these differences and attempt to give some guidance on what to use when.

When to use Websites

You Are Just Starting – Compared to Cloud Services, Websites may not be as flexible but it is definitely easier. You can build your website using Visual Studio, WebMatrix, or any other IDE of your choice without the need for an SDK or any other additional software.
You can deploy to Windows Azure Websites using WebDeploy, FTP, or even DropBox. You can sync your site code straight from GitHub, BitBucket, Codeplex, or TFS Online. It is incredibly easy and require little to know buy-in to Windows Azure if you want to create an IIS website.

Continue reading “Continuous Learning on Azure(5): Azure Web App vs Cloud Services”

Continuous Learning on Azure(4): How to deploy Cloud Service to Azure in China

Cloud Service(云服务)是Microsoft azure上最基本的service之一,了解详情请访问Get Started 页面。该文详细介绍了什么是云服务, 并且提供了DotNET版示例代码,以及如何运行(本地)和发布到azure。详细步骤本文不再重复。

那么问题是什么呢?这篇文章的部署部分针对的是微软全球azure,也成为WW Azure。而在中国,azure有一份独立的部署,专门针对中国市场,我们叫Azure in China,也叫Mooncake。WW azure和Mooncake是两个独立的平台。两个平台是基于同一份源代码(当然Mooncake的版本通常要落后于WW azure很多),但却是完全不相干的两个平台,数据、运营、支持都是分开的。 Continue reading “Continuous Learning on Azure(4): How to deploy Cloud Service to Azure in China”

Run IIS Express on Port 443 Using SSL and Wildcard Subdomains

Copy from http://benjii.me/2014/11/run-iis-express-on-port-443-using-ssl-and-wildcard-subdomains/

In this post I tackle running a website using wildcard subdomains over HTTPS and SSL all using just IISExpress.

If you have a multi-tenancy app, or rather an application that uses a wildcard subdomain to identify a user or dynamic subsite, then you may have run into trouble trying to test the subdomain functionality locally. The problem is compounded when you also want to ensure your site is served using HTTPS and SSL.

We’ll start basic and then move on to the more complex scenarios.

Important. Open Visual Studio in Adminstrator Mode.

Continue reading “Run IIS Express on Port 443 Using SSL and Wildcard Subdomains”

Continuous Learning on Azure(3): Endpoints for Azure in China Applications

Use the following table to guide you when mapping public Windows Azure and SQL Database endpoints to China specific endpoints.

Service Type Global Service URI China Service URI
Windows Azure – General *.windows.net *.ch *.chinacloudapi.cn
Windows Azure Compute *.cloudapp.net *.chinacloudapp.cn
Windows Azure Storage *.blob.core.windows.net

*.queue.core.windows.net

*.table.core.windows.net

*.blob.core.chinacloudapi.cn

*.queue.core.chinacloudapi.cn

*.table.core.chinacloudapi.cn

Windows Azure Service Management https://management.core.windows.net https://management.core.chinacloudapi.cn/
SQL Database *.database.windows.net *.database.chinacloudapi.cn
Windows Azure Management Portal http://manage.windowsazure.com http://manage.windowsazure.cn
SQL Azure Database Management API https://management.database.windows.net

See About the SQL Azure Database Management API

https://management.database.chinacloudapi.cn
Service Bus *.servicebus.windows.net *.servicebus.chinacloudapi.cn
SQL Database Import/Export service mapping endpoints
  1. China East: https://sh1prod-dacsvc.chinacloudapp.cn/dacwebservice.svc
  1. China North: https://bj1prod-dacsvc.chinacloudapp.cn/dacwebservice.svc

 

Continuous Learning on Azure(2): How to Create and Deploy a Cloud Service?

The Azure classic portal provides two ways for you to create and deploy a cloud service: Quick Create and Custom Create.

This topic explains how to use the Quick Create method to create a new cloud service and then use Upload to upload and deploy a cloud service package in Azure. When you use this method, the Azure classic portal makes available convenient links for completing all requirements as you go. If you’re ready to deploy your cloud service when you create it, you can do both at the same time using Custom Create.

Note:

If you plan to publish your cloud service from Visual Studio Team Services (VSTS), use Quick Create, and then set up VSTS publishing from Quick Start or the dashboard. For more information, see Continuous Delivery to Azure by Using Visual Studio Team Services, or see help for the Quick Start page.

Continue reading “Continuous Learning on Azure(2): How to Create and Deploy a Cloud Service?”

Continuous Learning on Azure(1): What’s azure cloud service?

Is Azure Cloud Services the choice for you? Azure provides different hosting models for running applications. Each one provides a different set of services, so which one you choose depends on exactly what you’re trying to do.

Compute Options Audience
App Service Scalable Web Apps, Mobile Apps, API Apps, and Logic Apps for any device
Cloud Services Highly available, scalable n-tier cloud apps with more control of the OS
Virtual Machines Customized Windows and Linux VMs with complete control of the OS

Continue reading “Continuous Learning on Azure(1): What’s azure cloud service?”

Continuous Learning on Python (4): Global 详解

什么是作用域?

在编程语言中,变量的作用域指代码中一个变量能被使用的有效范围。简单来说,在作用域之外,变量就不能访问了。以python为例,在一个函数里定义的临时变量,其作用域是本地作用域(Local),意味着这个变量在函数外的任何地方都不能访问,稍后我们看一下例子。

Python的作用域

不同的程语言有不同的作用域, Python作用域分4级,Built-in, Global, Enclosing和Local,如下图所示。

python_zuoyongyu

Continue reading “Continuous Learning on Python (4): Global 详解”

Git loose object(stored in .git/objects/xxxx) is corrupt 异常

使用git时遇到如下错误:

error: object file .git/objects/31/65329bb680e30595f242b7c4d8406ca63eeab0 is empty
fatal: loose object 3165329bb680e30595f242b7c4d8406ca63eeab0 (stored in .git/objects/31/65329bb680e30595f242b7c4d8406ca63eeab0) is corrupt

通常是因为之前git commit出现错误,比如命令不正确(git commit -a "Some messeage",git commit "Some message"等),导致出现空的commit。再执行git命令时就可能出现上述错误。

Continue reading “Git loose object(stored in .git/objects/xxxx) is corrupt 异常”