Starting from Team Foundation Server 2017, the Code Search feature that was available for a while in VSTS, gets an on-premise equivalent.
The feature is built on top of a customized version of ElasticSearch. However the integration between the 2 products(TFS and ElasticSearch) is rather limited right now.
This webcast is a code-focused introduction to developing workflow-enabled Microsoft Windows platform applications. We cover the basics of developing, designing, and debugging workflow solutions. Gain the knowledge and insight you need to be confident choosing workflow for everyday applications.
Intro to Windows Workflow Foundation (Part 2 of 7): Simple Human Workflow Using E-mail (Level 200)
Have you thought about how you might apply the workflow concept to e-mail? In this webcast New Zealand based regional director, Chris Auld, leads attendees through a simple worked example of the use of SMTP e-mail as part of a workflow solution. Chris demonstrates how to create custom activities to query Active Directory to retrieve user data, send e-mail, and wait for e-mail responses to continue the workflow process. This code-intensive session gives users taking their first steps with workflow a good grounding in some of the key extensibility concepts.
Intro to Windows Workflow Foundation (Part 3 of 7): Hosting and Communications Options in Workflow Scenarios (Level 300)
The session looks at options for hosting workflow applications. We cover managing events, instance tracking, and persistence, and provide a close look at the simple communications mechanisms that are available for you to use in your workflow applications.
Intro to Windows Workflow Foundation (Part 4 of 7): Workflow, Messaging, and Services: Developing Distributed Applications with Workflows (Level 300)
Web service technologies have typically taken a "do-it-yourself" approach to maintaining the interoperation state of services. Using workflow, developers now have tools that allow them to describe the long-running state of their services and delegate much of the state management to the underlying platform. Managing this state correctly becomes even more challenging in applications that coordinate work across multiple services either within an organization or at an Internet scale. This session looks at how developers who use either Microsoft ASMX or Microsoft's framework for building service-oriented applications, code-named "Indigo", can create workflow-oriented applications that are both faster to write and more manageable and flexible once deployed.
Intro to Windows Workflow Foundation (Part 5 of 7): Developing Event Driven State Machine Workflows (Level 300)
State machines used to be something that you had to first draw on paper and then implement in code. This session shows how to use technologies to create event-driven workflows and how to apply this to a typical programming problem. We introduce the concept of a flexible process and show how this can help with modeling real-world processes using state and sequential workflow. Plenty of coding is included to illustrate how you can seamlessly merge state machine design and your code.
Intro to Windows Workflow Foundation (Part 6 of 7): Extending Workflow Capabilities with Custom Activities (Level 300)
It is helpful to think of activities as controls within a workflow, similar to controls used with Microsoft ASP.NET Pages or Microsoft Windows Forms. You can use activities to encapsulate execution logic, communicate with the host and decompose a workflow into reusable components. This session examines the simple process of creating custom activities. If you want to expose activities to other developers designing workflows, you are likely to find this session valuable.
Intro to Windows Workflow Foundation (Part 7 of 7): Developing Rules Driven Workflows (Level 300)
Rules can be a powerful business tool when combined with workflow. In this session, learn how to develop more advanced activities that support the modeling of rich business behavior such as human workflow. Understand when to use rules for business logic, and see how rule policies allow for the description of sophisticated behavior in an integrated and flexible way. This session gives you an interesting insight into the power of using workflow at the core of a line of business application.
Insight #1: React is here to stay
Insight #2: Angular is shifting to a new role --> enterprise apps
Insight #3: You can’t ignore Vue.js anymore
Insight #4: Knowledge of some libraries will help you earn more (but not for the reasons you might think)
Insight #5: 2018 will be the year of GraphQL
Insight #6: JavaScript != Front-end
Insight #7: Microsoft is striking back
Insight #8: JavaScript is different around the world
Insight #9: Typed JavaScript is on the rise
Insight #10: JavaScript is whatever you want it to be
ساخت اولین پروژه WebAPI با MVC 6
موشکافی ASP.NET 5
ASP.NET 5 is an entirely new web stack, rebuilt from the ground up to run fast, cross-platform, and completely configurable. Join David Fowler, one of the architects of ASP.NET 5, as he goes deep into the core of ASP.NET 5. What's the hosting model? How does the HTTP stack work? How do middleware and NuGet packages get pulled in to compose your application? How do the different servers (IIS, Kestrel, WebListener, etc.) actually work? How can you take advantage of these things to build lean, fast, optimized web apps on the new ASP.NET 5 platform? Come find out!
ارائهی MapKit JS از اپل
Use of the library does involve having an Apple Developer account at $99 a year , and to use the beta, developers will need to set up core Maps identifiers, keys, and tokens via their developer account. The beta version limits usage to 250,000 instantiations and 25,000 service calls, per API key per day, compared to Google's limit of 100,000 map instantiations per month on the free tier.
آشنایی با XSLT
اساس کار XSLT
در تصویر زیر، فایل xml به همراه xslt، به تجزیه کننده یا تحلیل کننده داده میشوند. در این قسمت هر دو فایل منبع تحلیل شده و از روی فایل xml، درختی در حافظه تهیه میشود و از فایل xslt یک سری قوانین استخراج میشوند. بعد این دو محتوای جدید تولید شده، در اختیار XSL Processor قرار گرفته و از روی آنها به ساخت درخت نتیجه (نوع درخواستی) در حافظه میرسد که در نهایت آن را به نام یک فایل مستند میکند.
پروژه نمونه
در این مقاله ما یک فایل xml داریم که قصد داریم آلبومهایی را طبق ساختار زیر، در آن قرار دهیم و سپس بر اساس قوانین xslt آن را در قالب یک فایل html نشان دهیم. فایلهای تمرینی این مقاله در این آدرس قابل دسترسی است.
ساختار فایل xml:
<Albums> <Album> <name>Modern Talking</name> <cover>http://album.com/a.jpg</cover> <Genres> <Genre>POP</Genre> <Genre>Jazz</Genre> <Genre>Classic</Genre> </Genres> <Description> this is a marvelous Album </Description> <price> 25.99$ </price> </Album> </Albums>
در ابتدا فایل، برای معرفی فایل و رعایت قرارداد، فضای نام مربوطه را یا به شکل زیر
<xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <html> .... </html> </xsl:template>
نمایش فیلدها
سپس در آن، کد html مورد نظر را وارد میکنیم و در میان این کدها، تگهای xslt را وارد مینماییم. کد زیر بخشی از صفحه هست که برای نمایش آلبومها استفاده میکنیم:
<div> <img src="" alt="image" /> <h3> <xsl:value-of select="albums/album/name" /> </h3> <h4>Artist Name 1</h4> <h5>POP</h5> <h6>25/5/2015</h6> <h7>this is description</h7> <div> <a href="#">More</a> </div> </div>
<xsl:for-each select="albums/album"> <div> <img src="" alt="image" /> <h3> <xsl:value-of select="name" /> </h3> <h4>Artist Name 1</h4> <h5>POP</h5> <h6>25/5/2015</h6> <h7>this is description</h7> <div> <a href="#">More</a> </div> </div> </xsl:for-each>
ایجاد ارتباط میان دو فایل XML و XSLT
برای اجرا و تست آن باید از طریق یک ابزار که توانایی تحلیل این دستورات را دارد، استفاده کنید. یکی از همین ابزارها، مرورگر شماست. برای اینکه به مرورگر ارتباط فایل xml و xsl را بفهمانیم، تکه کد زیر را در فایل xml جهت لینک شدن مینویسیم و سپس فایل xml را در مرورگر اجرا میکنیم:
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="index.xslt"?>
ساخت المان یا تگ
در ادامه بقیه فیلدها را تکمیل میکنیم. فیلد بعدی تصویر است که تصویر دیگر مانند متن، بین تگها قرار نمیگیرد و باید داخل attribute تگ تصویر درج شود. برای نمایش تصویر میتوانیم به دو شکل عمل کنیم. کد را به صورت زیر بنویسیم:
<img src="{cover}" width="200px" height="200px"> <xsl:value-of select="cover" /> </img>
<xsl:element name="img"> <xsl:attribute name="src"> <xsl:value-of select="cover"/> </xsl:attribute> <xsl:attribute name="width"> 200px </xsl:attribute> <xsl:attribute name="height"> 200px </xsl:attribute> <xsl:value-of select="cover"/> </xsl:element>
دستور العملهای بیشتر (مرتب سازی)
<xsl:for-each select="Albums/Album"> <xsl:sort select="name"/>
دستورات شرطی
حال تصمیم میگیریم که آلبومهای با قیمت بالاتر از 10 دلار را 2 دلار تخفیف دهیم. برای اینکار نیاز است تا با تگ if آشنا شویم:
<xsl:variable name="numprice" select="number(substring(price,1,string-length(price)-1))" /> <xsl:if test="$numprice>=10"> <h4 > <span style='text-decoration:line-through'> <xsl:value-of select="price" /> </span> <b> <xsl:value-of select="$numprice -2" />$ </b> </h4> </xsl:if>
<xsl:variable name="numprice" select="number(substring(price,1,string-length(price)-1))" /> <xsl:choose> <xsl:when test="$numprice>=10"> <h4 > <span style='text-decoration:line-through;color:red'> <xsl:value-of select="price" /> </span> <b> <xsl:value-of select="$numprice -2" />$ </b> </h4> </xsl:when> <xsl:otherwise> <b> <xsl:value-of select="$numprice" />$ </b> </xsl:otherwise> </xsl:choose>
استفاده از template ها
<xsl:template match="DateOfRelease"> <xsl:variable name="date" select="."/> <xsl:variable name="day" select="substring($date,1,2)"/> <xsl:variable name="month" select="number(substring($date,4,2))"/> <xsl:variable name="year" select="substring($date,7,4)"/> Release Date: <xsl:choose> <xsl:when test="$month = 1"> <xsl:value-of select="$day"/>,Jan/<xsl:value-of select="$year"/> </xsl:when> <xsl:when test="$month = 2"> <xsl:value-of select="$day"/>,Feb/<xsl:value-of select="$year"/> </xsl:when> <xsl:when test="$month = 3"> <xsl:value-of select="$day"/>,Mar/<xsl:value-of select="$year"/> </xsl:when> <xsl:when test="$month = 4"> <xsl:value-of select="$day"/>,Apr/<xsl:value-of select="$year"/> </xsl:when> <xsl:when test="$month = 5"> <xsl:value-of select="$day"/>,May/<xsl:value-of select="$year"/> </xsl:when> <xsl:when test="$month = 6"> <xsl:value-of select="$day"/>,Jun/<xsl:value-of select="$year"/> </xsl:when> <xsl:when test="$month = 7"> <xsl:value-of select="$day"/>,Jul/<xsl:value-of select="$year"/> </xsl:when> <xsl:when test="$month = 8"> <xsl:value-of select="$day"/>,Aug/<xsl:value-of select="$year"/> </xsl:when> <xsl:when test="$month = 9"> <xsl:value-of select="$day"/>,Sep/<xsl:value-of select="$year"/> </xsl:when> <xsl:when test="$month = 10"> <xsl:value-of select="$day"/>,Oct/<xsl:value-of select="$year"/> </xsl:when> <xsl:when test="$month = 11"> <xsl:value-of select="$day"/>,Nov/<xsl:value-of select="$year"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$day"/>,Dec/<xsl:value-of select="$year"/> </xsl:otherwise> </xsl:choose> </xsl:template>
<xsl:for-each select="Albums/Album"> <xsl:sort select="name"/> <div> <img src="{cover}" width="200px" height="200px"> <xsl:value-of select="cover" /> </img> <h3> <xsl:value-of select="name" /> </h3> <h4>POP</h4> <xsl:variable name="numprice" select="number(substring(price,1,string-length(price)-1))" /> <xsl:choose> <xsl:when test="$numprice>=10"> <h4 > <span style='text-decoration:line-through;color:red'> <xsl:value-of select="price" /> </span> <b> <xsl:value-of select="$numprice -2" />$ </b> </h4> </xsl:when> <xsl:otherwise> <h4 > <b> <xsl:value-of select="$numprice -2" />$ </b> </h4> </xsl:otherwise> </xsl:choose> <h4> <!-- محل صدا زدن قالب--> <xsl:apply-templates select="DateOfRelease"/> </h4> <h4> <xsl:value-of select="Description"/> </h4> <div> <a href="#">More</a> </div> </div> </xsl:for-each>
فیلترسازی
یکی از خصوصیات دیگری که فایل
XML داشت، فیلد ژانر موسیقی بود و قصد داریم با استفاده از فیلترسازی،
تنها سبک خاصی مثل سبک پاپ را نمایش دهیم و موسیقیهایی را که خارج از این سبک
هستند، از نتیجه حذف کنیم. به همین علت دستور for-each را به شکل زیر
تغییر میدهیم:
<xsl:for-each select="Albums/Album[contains(Genres/Genre, 'POP')]">
<xsl:for-each select="Albums/Album[not(contains(Genres/Genre, 'POP'))]">
<xsl:for-each select="Genres/Genre"> <xsl:value-of select="."/> <xsl:if test="position() != last()"> , </xsl:if> </xsl:for-each>
تبدیل xml و xsl در دات نت
string xmlfile = Application.StartupPath + "\\sampleXML.xml"; //بارگذاری فایل قوانین در حافظه XslTransform xslt = new XslTransform(); xslt.Load("sample-stylesheet.xsl"); //XPath ایجاد یک سند جدید بر اساس استاندارد XPathDocument xpath = new XPathDocument(xmlfile); //آماده سازی برای نوشتن فایل نهایی XmlTextWriter xwriter = new XmlTextWriter(xmlfile + ".html", Encoding.UTF8); //نوشتن فایل مقصد بر اساس قوانین مشخص شده xslt.Transform(xpath, null, xwriter, null); xwriter.Close();
XsltArgumentList xslArgs = new XsltArgumentList(); xslArgs.AddParam("logo", "", logo); xslArgs.AddParam("name", "", name); .... xslt.Transform(xpath, xslArgs, xwriter, null);
21.Visual Studio 2017 15.9 منتشر شد
Issues Fixed in 15.9.21
- Fixed a bug where the .NET Profiling tools couldn't be installed on non-enterprise versions of Visual Studio 2017 when using an offline installer.
- Fixed C++ compiler bug where a static_cast in a decltype would evaluate incorrectly. To minimize disruptions to existing codebases, in VS2017 this fix takes effect when the (newly added) /d1decltypeIdentityConversion switch is thrown.
- New Spectre mitigation options in C++ compiler: /Qspectre-load & /Qspectre-load-cf for speculative load hardening.
Security Advisory Notices
کتاب رایگان Go Succinctly
The Go programming language is relatively small and concise, but its depth makes it an ideal option for solving modern-day development problems. In Go Succinctly, author Mark Lewin guides readers through the basics of Go, and he provides documentation and resources that allow users to dive into the language and learn it for themselves. By the end of the book, novices and experienced programmers alike will be conversant in a language quickly gaining traction around the world.
- Welcome
- Introducing Go
- Let’s Go!
- Variables, Constants, and Assignments
- Basic Data Types
- Control Structures
- Arrays, Slices, and Maps
- User-Defined Types
- Concurrency
- Standard Packages
- Go Further