Quantcast
Channel: MSDN Blogs
Viewing all 35736 articles
Browse latest View live

The MIPS R4000, part 5: Memory access (aligned)

$
0
0


The MIPS R4000 has one addressing mode:
Register indirect with displacement.



LW rd, disp16(rs) ; rd = *( int32_t*)(rs + disp16)
LH rd, disp16(rs) ; rd = *( int16_t*)(rs + disp16)
LHU rd, disp16(rs) ; rd = *(uint16_t*)(rs + disp16)
LB rd, disp16(rs) ; rd = *( int8_t*)(rs + disp16)
LBU rd, disp16(rs) ; rd = *( uint8_t*)(rs + disp16)


The load instructions load an aligned word, halfword, or byte
from the address specified by adding the 16-bit signed displacement
to the source register (known as the "base register").¹
By convention, the displacement can be omitted, in which case it is
taken to be zero.



The plain versions of these instructions sign-extend to a 32-bit value;
the U versions zero-extend.



There are corresponding aligned store instructions.



SW rs, disp16(rd) ; *( int32_t*)(rd + disp16) = (int32_t)rs
SH rs, disp16(rd) ; *( int16_t*)(rd + disp16) = (int16_t)rs
SB rs, disp16(rd) ; *( int8_t*)(rd + disp16) = ( int8_t)rs


In all cases, if the effective address turns out not to be
suitably aligned, an alignment fault occurs.
Windows NT handles the alignment fault by loading the value
using the unaligned memory access instructions (which we'll see next time),
and then resuming execution.
The overhead of the emulation swamps the cost of having done it correctly
in the first place,
so if you know that the address may be unaligned,
then you are far better off using the unaligned memory access instructions
instead of having the kernel fix it up for you.



The assembler emulates absolute addressing with the help of the
at assembler temporary register.
For example, the pseudo-instruction



LW rd, global_variable


loads an aligned word from a global variable.



Let A be the address of the global variable,
and let



  • YYYY = (int16_t)(A & 0xFFFF) and
  • XXXX = (A − YYYY) >> 16



Then the assembler generates the following two instructions:



LUI at, XXXX
LW rd, YYYY(at)


Note that if the bottom 16 bits of the address
are greater than 0x8000,
then that results in a negative value for YYYY,
and XXXX will be one greater than the upper 16 bits
of the address.



Another pseudo-instruction is



LW rd, imm32(rs)


You may want to do this if indexing a global array.
A straightforward implementation of the pseudo-instruction would be



LUI at, XXXX ; load high part
ADDIU at, at, YYYY ; add in the low part
ADDU at, at, rs ; add in the byte offset
LW rd, (at) ; load the word


but this can be shortened by an instruction
by merging the fixed offset YYYY into the displacement
of the effective address calculation in the LW.
The result is



LUI at, XXXX
ADDU at, at, rs
LW rd, YYYY(at)


While the assembler emulation is convenient,
it may not be the most efficient.
If you are accessing the global variable more than once,
or if you are accessing more than one variable within the same
64KB
region,
you can share the LUI instruction among them.



For example, suppose global1 and
global2 reside in the same
64KB
block of memory.


; lazy version of global2 = global1 + 1
LW r1, global1
ADDIU r1, r1, 1
SW r1, global2


This expands to



LUI at, XXXX
LW r1, YYYY(at)
ADDIU r1, r1, 1
LUI at, XXXX
SW r1, ZZZZ(at)


You can factor out the XXXX into a register
that you reuse for the entire section of code.



; sneakier version of global2 = global1 + 1
LUI r2, XXXX
LW r1, YYYY(r2)
ADDIU r1, r1, 1
SW r1, ZZZZ(r2)
; can keep using r2 to access other variables in the block


In theory, you could even store constants in your data segment,
but since loading a 32-bit constant takes only two instructions
at most, you probably won't bother.



Next time, we'll look at unaligned access.



¹
In earlier versions of the MIPS architecture,
there was a load delay slot:
The value retrieved by a load instruction was not available
until two instructions later.
That means that in the sequence



LW r1, (r2) ; load word from r2 into r1
ADDIU r3, r1, 1 ; r3 = r1 + 1


the ADDIU instruction operated on the old
value of r1, not the value that was loaded from memory.
If you want to add 1 to the value loaded from memory, you need
to insert some other instruction in the load delay slot:



LW r1, (r2) ; load word from r2 into r1
NOP ; load delay slot
ADDIU r3, r1, 1 ; r3 = r1 + 1


The MIPS III architecture removed the load delay slot.
On the R4000,
if you try to access the value of a register immediately after
loading it, the processor stalls until the value becomes ready.
Sure, the stall is bad, but it's better than running ahead with
the wrong value!


How Minecraft Improves Social and Emotional Learning, And More On The Friday Five

$
0
0

Mocking a REST API With Model First Development

Oscar Garcia is a Principal Software Architect who resides in Sunny South Florida. He is a Microsoft MVP and certified solutions developer with many years of experience building solutions using .Net framework and multiple open source frameworks. Currently, he specializes in building solutions using technologies like SharePoint, ASP.NET, NodeJS, AngularJS, and other JavaScript frameworks. You can follow Oscar on Twitter via @ozkary or visiting his blog at ozkary.com.

Getting Smart Podcast: How Minecraft Improves SEL Outcomes

Michelle Zimmerman, PhD, is a Microsoft Innovative Educator Expert and Surface Expert. She has 17 years of experience in the classroom (PreK-10), 10 years implementing research into practice, and co-designing Renton Prep, selected as a Microsoft Showcase School. She briefed Satya Nadella and team. She and her students have presented since 2007 including American Education Research Association to NYU, UCLA, SXSWEdu, and New York Academy of Sciences. Her research is published in Springer’s International Human Computer Interaction Series and VentureBeat. Follow her on Twitter @mrzphd.

    Clustering FileServer Data Deduplication On Windows 2016, Step By Step

    Robert Smit is a Senior Technical Evangelist and a Microsoft MVP since 2009, now in Cloud and Datacenter management. Robert has more than 20 years experience in IT, particularly in the educational, healthcare and finance industries.Robert’s past IT experience in the trenches of IT gives him knowledge and insight which  allows him to communicate effectively with IT professionals. Based in the Netherlands, Robert currently holds a position at Insight at the Caase.com Division as Cloud Architect/Azure Technical Lead. Follow him on Twitter @Clustermvp.

    Developing Product Recommendations On WideWorldImporters Using SQL Graph

    Sergio Govoni has been a software developer for almost 20 years. He received a Computer Science degree from Italy State University in 2000. He’s since worked at Centro Software, which produces an international multi-company ERP on the Windows platform. At Centro Software, Sergio currently serves as Technical Lead and manages the architecture and mission-critical technical details on team projects. Based in Bologna, Italy, Sergio has been a Microsoft Data Platform MVP (SQL Server category) since 2010. Follow him on Twitter @segovoni.

    ASP.NET Core 2.0 – Applying CORS Policies

    Jaliya Udagedara is from Sri Lanka and is currently working as a Technical Lead for a software company headquartered in Australia. He's been a Microsoft MVP since January 2014, initially under Visual C# category, then .NET and now under Visual Studio & Development Technologies. He's passionate about everything related to .NET. Jaliya is also a TechNet Wiki Ninja and a blog author at TNWiki Ninja’s official blog. Follow him on Twitter @JaliyaUdagedara.

     

    SSAS translation for client application

    $
    0
    0

    Tested on: Excel 2013, Excel 2016, Reporting Services 2012/2014/2016.

     

    Hello Everyone, in this blog I will discuss on how to view SSAS translation in different client Application.

     

    Before I begin with the details on this blog, if anyone doesn’t know what Translation in SSAS is, then I request you to go and check out the link below:

    https://docs.microsoft.com/en-us/sql/analysis-services/translation-support-in-analysis-services

     

    Requirement: I am sure everyone wants to view the Translation language of SSAS cube in the client application that they are using to pull the data from SSAS. So, how can we do it?

    Well here I will talk about 3 client application- Excel, Reporting Services and Power BI.

     

    For Excel:

     

    1. Open an Excel sheet, go to the Data section-> Get Data and choose from Analysis Services.
    2. Enter the server name, credentials and choose the database and cube that you want and click on Next.
    3. In the next page note down the File Name where the model will be saved (it will be in .odc extension) and click on Finish then Import the data.
    4. Now close the Excel and go to the folder where the model is saved.
    5. Open the .odc file in a notepad.
    6. In the Connection String section, you will have to add a parameter called “Locale Identifier”
    7. The default is 1033 which is English default (e.g.: Locale Identifier=1033)
    8. You need to add the value as per your translation language in SSAS. Please the link below to know the Locale Identifier code for each language.

    https://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).aspx

    1. Once the Locale Identifier is set, save the file.
    2. Now a new Excel file and go to the Data section.
    3. Click on Existing Connection and choose the connection which you have create recently.
    4. Once done import the data and you will see that the Language will show as per the SSAS translation language.

     

    For Reporting Services:

     

    1. Go to create Data Source section.
    2. You can either choose to write the connection string or you can also choose to Build the connection string.
    3. You can do this for both shared Data source and embedded data source.
    4. While writing a connection string, apart from data source and Initial catalog, add the parameter “Locale Identifier=1034” (For my case I have used Spanish(Spain)).
    5. If you choose to build the connection string, then click on Advanced button and look for Locale Identifier parameter.
    6. Set the Locale Identifier value as per your translation language in SSAS by referring the link above.
    7. Once done, save the data source.
    8. Now while creating the data set you will see that the Language will show as per the SSAS translation language.
    9. Please note that the report must be created based on the SSAS translation and the translation cannot be changed while viewing the report.

     

    For Power BI:

     

    Well for Power Bi we don’t have official support yet from Microsoft and there is no ETA as in when it will be supported.

    HTH

     

    Author:      Jaideep Saha Roy – Support Engineer, SQL Server BI Developer team, Microsoft

    Reviewer:  Kane Conway – Support Escalation Engineer, SQL Server BI Developer team, Microsoft

    Viewing Optimization Passes in the DirectX Shader Compiler Editor

    $
    0
    0

    A few days ago I showed how we can compile and disassemble a shader using the DirectX Shader Compiler Editor, then how to run that shader. Today I'm going to look at the optimizer instead.

    We're starting again from the stock program available via Ctrl+N, and then when we click on the Optimizer tab, this is what we get.

     

    On the left, we have a list of all the available passes in dxcompiler.dll. We get this via the IDxcOptimizer interface.

    On the right, we have a specific set of passes forming a pipeline of optimizations. We get these via the IDxcCompiler interface using the /Odump argument, which produces a list of the optimization configuration used. This also takes into account other arguments such as /Od or /O1.

    You can play with the passes by moving them up or down in the pipeline, adding new ones or removing existing ones, or even changing properties by right-clicking on them and selecting Properties. This is only enabled for very few passes at the moment, but we'll add more as we need them.

    Another handy thing to do is to right-click on the pipeline and select Copy All. This copies to the clipboard the pipeline configuration in the same format you would use with the IDxcOptimizer interface.

    When you click Run Passes, the output of the optimizer run is displayed. This may include the disassembly if you have any print-module passes.

    If you used the view-cfg pass to dump a GraphViz-formatted , note that you can right-click on the graph keyword in the output and select 'Show Graph'.

    This will bring up a new window with an SVG render of that graph if dot.exe can be found. You'll get a list of probed locations if that's not the case.

    The graph would be more interesting if I had some control flow of course. You can zoom in and out using the slider at the top.

    Next time we'll explore the Interactive Editor button on the Optimizer tab.

    Enjoy!

    Top stories from the VSTS community – 2018.04.06

    $
    0
    0

    Here are top stories we found in our streams this week related to DevOps, VSTS, TFS and other interesting topics, in no specific order:

    TOP STORIES

    RADIOTFS, VIDEOS

    • 158 // This is all it is
      In this episode Greg is flying solo, sharing with you the latest VSTS news, like Sprint 132, TFS news, such as TFS 2018.2 RC1, Migration news and the April 23rd deadline, hints on batch undeleting Release Definitions, tips on SSIS with VSTS, and much more…
    • DevOps Lab new video: Unit testing your database changes
      Watch Damian Brady and Hamish Watson discuss why it’s a good idea to extend your unit testing to your database. In this video, several different ways to achieve this are discussed, to help broaden your skillset and improve your work product.

    TIP: If you want to get your VSTS news in audio form then be sure to subscribe to RadioTFS .

    Small Basic Monthly Challenges – April 2018

    $
    0
    0

    Big thanks to LitDev for hosting our monthly challenges!

    These challenges are intended for people who are learning to program for the first time or for those returning to programming who want to start using Small Basic.  Some will be easy, some will be hard - but they will all make you think, and more importantly be GREAT FUN!

    Please post your solutions / partial solutions / questions / feedback etc. into this thread that will remain 'sticky' for the month.  The only rule is that your solution must use standard Small Basic methods (no extensions).

    Post your solutions here:

     

    It would be good if people could post their problems with these challenges so that a discussion can start so that everyone can learn from each other.

    We may extend these challenges over into a second month if solutions and questions are still coming in.

    Graphics Challenge

    Draw a picture of a mountain scene, maybe some clouds, trees, snow or a lake in the view.

    Maths Challenge

    Write a program to calculate the numbers less than 1000 that are divisible, by exactly 3 different prime numbers.  How many can you get.

    e.g. 2*3*5 = 30, 7*11*5=385

    Text Challenge

    Write a TextWindow program to input a sentence and then output it with one or more of the following:

    • every vowel colored red, or
    • the first and last letter of each word colored blue

    Game Challenge

    Write a simple whack-a-mole type game.

    What Can I Expect at a Healing Service? « revnettie

    Do you have an idea for a future challenge? Please post it here!

    Imagine Cup 2018 Regional Final Winners – Pakistan

    $
    0
    0

     

    Dear Imagine Cup Participants

     

    We have had an amazing Imagine Cup 2018 – Regional Final stage, where most of you came to present your projects to our regional judges. There were a total of 110 projects that were judged across the 4 regions, and the top 25 teams have been selected. There were some brilliant ideas which could well have made it to the Finals, and we would like to congratulate all the participants of Imagine Cup – Pakistan Chapter, for taking an active part in the competition. We hope that you were able to learn from our judges remarks, and that you will only come back stronger next year! Few snaps from the event below.

     

    Without further ado, the 25 teams that will be proceeding to the National Finals are as follows:

     

    Team Names
    GenyMotion CodeCloneFinder
    Markhors Team Hyper-Rec
    NerdHerd Humachines
    Decoders & Encoders SyedChaos
    Team ILMS TechyTeam
    TechTor Fe Amaan
    IoT Solutions Code 4 Life
    Devil's Whisper Addonexus
    MAAS CUSIT Data Warriors
    E-Hanna Lublin Pakistan
    Queen Bees The Amigos
    Team MNS-UAM CESTINO - Smart Waste Management
    Marriam - GCWUF

     

    The teams above will be contacted individually by Muhammad Sohaib  (v-musoha@microsoft.com) over email, so that feedback and the judges’ comments can be shared with them and that they be able to work on their projects in the coming three weeks, to have a more complete and rounded solution for the National Final, which is scheduled for the 1st week of May.

     

    National Final Submissions are now open, and will remain open till the 30th of April, 2018, for students to re-submit their projects for National Evaluations.

     

    Experiencing Alerting failures for Availability Data Type – 04/06 – Resolved

    $
    0
    0
    Final Update: Friday, 06 April 2018 23:24 UTC

    Application Insights experienced alerting issues for GSM service. We've confirmed that all systems are back to normal with no customer impact as of 04/06, 22:27 UTC. Our logs show the incident started on 04/06 17:53 UTC and that during the 4 hours and 30 minutes that took to resolve the issue customers might have experienced below impact -

    1. All SCOM customers would have experienced failures while accessing their GSM data during the impact window.
    2. Some Application Insights users might have experienced delays or missed availability alerts during the impact window. Note - Data access for Application Insights users was not affected
    3. Download of web test result details (e.g. clicking on the dot on availability chart) was not available during impact window for all users.

    • Root Cause: The failure was due to latest configuration changes to GSM service
    • Incident Timeline: 4 Hours & 30 minutes - 04/06 17:53 UTC through 04/06, 22:27 UTC

    We understand that customers rely on Application Insights as a critical service and apologize for any impact this incident caused.

    -Sapna



    Experiencing errors while creation of Application Insights app using Visual Studio – 04/02 – Resolved

    $
    0
    0
    Final Update: Saturday, 07 April 2018 00:07 UTC

    Hotfix has been successfully deployed to EUS, SCUS, WEU, WUS2, Southeast Asia and NEU regions. At this moment we don’t expect any issue in creating Application Insights resources via Visual Studio, but in case any help or info is required with respect to this issue, please reach out to Microsoft support.

    • Root Cause: The failure was due to backend configuration changes on one of our dependent services.
    • Incident Timeline: 5 Days, 7 Hours & 12 Minutes - 04/02 16:55 UTC through 04/07 00:07 UTC

    We understand that customers rely on Application Insights as a critical service and apologize for any impact this incident caused.

    -Dheeraj


    Update: Thursday, 05 April 2018 22:28 UTC

    Hotfix has been successfully deployed and validated in EUS region. ETA for hotfix rollout completion to all regions is EOD today.
    • Work Around: Apps can be created using Azure portal without any issues
    • Next Update: Before 04/06 23:00 UTC

    -Dheeraj


    Update: Tuesday, 03 April 2018 22:24 UTC

    Hotfix has been successfully deployed in Canary and BrazilUS regions. Currently, we are trying to prioritize this Hotfix rollout for other regions in the order of EastUS, SouthCentralUS, WEU, WUS2, Southeast Asia and NEU. Current ETA for Hotfix rollout across all regions is EOD Friday.
    • Work Around: Apps can be created using Azure portal without any issues
    • Next Update: EOD Friday

    -Dheeraj


    Update: Monday, 02 April 2018 21:53 UTC

    We identified the root cause for this issue. To fix this, we are moving forward with Hotfix deployment in this order: EastUS, SouthCentralUS, WEU, WUS2, Southeast Asia, NEU. Currently we have no ETA on resolution and trying to expedite the rollout of this hotfix.
    • Work Around: Apps can be created using Azure portal without any issues
    • Next Update: Before 04/03 22:00 UTC

    -Dheeraj


    Initial Update: Monday, 02 April 2018 16:55 UTC

    We are aware of the issues within Application Insights and are actively investigating. Customers creating a new project with Application Insights on by default in Visual Studio 2015 will see a failure message as below-

    'Could not add Application Insights to project. Could not create Application Insights Resource : The downloaded template from 'https://go.microsoft.com/fwlink/?LinkID=511872' is null or empty. Provide a valid template at the template link. Please see https://aka.ms/arm-template for usage details. This can happen if communication with the Application Insights portal failed, or if there is some problem with your account.'


    • Work Around:  Apps can be created using Azure portal without any issues
    • Next Update: Before 04/02 21:00 UTC

    We are working hard to resolve this issue and apologize for any inconvenience.


    -Sapna

    COMING SOON: Enhanced API status dashboard

    $
    0
    0

    In the next few days, we’ll be rolling out enhancements to our Platform Health Blog site to provide an improved experience for tracking API health status. The site may either be accessed from the Support tab of our documentation portal or at this address.

    Following customer feedback, we have made a number of improvements to the site to acknowledge ongoing issues faster, provide different levels of information on the ongoing issues and navigational improvements geared towards better usability.

    The overall health status of each API service will now be indicated on a dashboard view on the site as shown below:

    You will now be able to quickly verify if there are any ongoing issues in the API services you are interested in or currently use. Each item on the dashboard is clickable so that you can filter down to the ongoing issues for the API service, application or platform/area in question. You may also subscribe to RSS alerts for each individual API service allowing you to only receive updates on issues that matter to you.

    In the Issues view, you will now be able to see a 90-day status view of issues and filter down to the issues applicable to a specific day shown on the calendar. This will make it easier for you to understand when issues occurred that apply to your area of interest:

    As mentioned above, we’re rolling out an improved mechanism for acknowledging ongoing issues faster, so that as soon as we can internally validate an issue, we’ll immediately surface it on the site to ensure all customers are aware. This new workflow will also provide faster updates on issue resolution.

    We hope that you’ll find our revamped status site more useful and easier to use than before. If you have any feedback to share with us on your experience with the new site or have any questions, feel free to reach out to us at bingads-feedback@microsoft.com.

    Getting Started with IoT and Microsoft Azure

    $
    0
    0

    The Festival of Creative Learning is a week long break from teaching during second semester at the University of Edinburgh. It features all sorts of events that teach people about new disciplines in fun, innovative ways. Enter the IoT Challenge - a 3 day event of making and coding during which participants created new IoT applications in teams. All this was, of course, fuelled by pizza and apple juice. image The motivation behind running the event was that the University of Edinburgh is creating its own LoRaWAN network (a bit like a city-wide Wi-Fi for IoT devices) that they want people to use for interesting projects. image The teams had access to Microsoft Azure http://aka.ms/azure4students Lots of hardware including RaspberryPi, Ardiuno and LoPy boards and a vast store of electronic components and sensors provided which could access the network and play with. The hacks are all uploaded to Devpost for the event at https://iot-challenge-2018.devpost.com/submissions 

    The winning project

    Was team Gamma with a project called “IoT Irrigation”. It consisted of low power Pycom LoPy boards that collected data about fields and then sent it through to an Azure back-end for processing. The server on Azure would decide when to turn on irrigation valves based on the incoming sensor data and external factors and then send that schedule back to the LoPy for it to execute. . Github which can be found here< https://github.com/billyjason/smart-irrigation >. The project's readme.md and presentation.pptx on GitHub provide more information about the infrastructure  and solutions proposed to be used of our projects, iot-reference-architecture We used the Azure cloud service in the following way, our Lopy's micro controllers were communicating with cloud Azure cloud directly without any other intermediary device, and also we used Azure's Redis as a database for data being sent either from the sensors, which we later could use for further analysis. All team members : - Billy Byiringiro - Computer Science with Management -David Kamberský – Computer Science -Nina Caisova – Computer Science and AI -Uhlirjan – Electrical Engineering -Lorenzo Conti - Infrastrutture and Environment Engineering The team overcame some really interesting technical challenges and it was a thoroughly deserved win. Well done to David Kambersky, Nina Caisova, Billy Byiringo, Jan Uhlir and Lorenzo Conti

    Runner up project

    Was equally impressive and came under the name “Smart IoT Lock”. The concept was to use blockchain transactions to open locks, thus opening the door to machine-to-machine transactions in, for example, toll gates on motorways. The team used IOTA as their blockchain since it has the ability to not only send value with transactions, but also send transactions that have zero-cost which is useful when you are unlocking your home. The boffins behind this were Alan Savio Paul, Nicola Sorace, Efe Sinan Hoplamaz, Anubhav Chakravarty and Gurz Singh. Along the way our participants faced some really interesting technical challenges. One example from the IoT Irrigation team was that they had to code their own HTTP library to communicate with Azure from the LoPy boards since it ran Micropython with no built in library for this other than socket support. Getting Azure for this event really helped both the organisers and the participants. The following Azure IoT workshops are also available for those wishing to learn more about IoT and Azure https://github.com/Microsoft/computerscience/tree/master/Labs/Internet-of-Things https://github.com/Microsoft/computerscience/tree/master/Labs/Content%20in%20draft/Azure%20IoT Comments from Cameron MacLeod, Partnership Manager, EaRS Edinburgh

    The organising side, it was far easier to write a workshop with Azure than other cloud based platforms that we have used before. This was mostly due to the ease of setting up an application in Azure and the quantity of existing good-quality tutorials. The participants loved it because it allowed them to learn new skills in an easy to use environment and it removed many technical challenges with cloud applications that they would have had to deal with themselves otherwise, allowing them to focus on their applications.

    The society behind the hack is the Embedded and Robotics Society and we have another hackathon coming up in April. https://createdhack.github.io. Congratulations to the Winners and attendees. image

    GreenHack–IOT Sustainability Hackathon using Azure Services

    $
    0
    0


    Green Hack 

    So what is GreenHack

    Rapid 10 hour hackathon (10am -> 10pm) https://greenhack.hackersatcambridge.com/

    • Organised by Hackers at Cambridge http://hackersatcambridge.com

    image

    • Partnered with Allia, Cambridge Carbon Footprint, Pivotal and the Cambridge Living Lab

    • Three projects are suggested by our partners for attendees to tackle (rogue projects are also welcome)Over 65 spent the weekend with a simply aim of creating something original which can really make an impact in the field of sustainability.

    The quality of the event was really high you can go to https://greenhack.devpost.com to see all the submissions which made it all the way through to the judging stage.

    The event was formatted into a set of evening workshops and then a single day hackathon.

    image

    The Cambridge University Microsoft Student Partners acted Proctors at the hackathon who were on call to help attendees with any tech problems they faced

    Workshops and Skilling Up on IOT


    In addition the Microsoft team ran a number of pre workshop events covering introductions to using Azure and Services.

    https://github.com/cambridge-msp/Azure-IoT-Workshop

    Including the following workshops which are available part of our Educator/Student Offerings.

    https://github.com/Microsoft/computerscience/tree/master/Labs/Internet-of-Things

    https://github.com/Microsoft/computerscience/tree/master/Labs/Content%20in%20draft/Azure%20IoT

    1 day hackathon to build out a set of proof of concepts

    The teams had access to Microsoft Azure http://aka.ms/azure4students , A selection of Hardware RaspberryPi running Windows 10 IOT Core, Ardinuos and sensor and various Hats supporting both Gadgetter Sensors to WeatherSheilds.

    imageimageimage

    The IoT kits were really popular with the teams.

    Here are quick summary of the Teams https://greenhack.devpost.com/submissions

    image

    Top Tips for IoT based hacks and learning from Greenhack

    Having access to Hardware and Sensors which attends can use is essential for IoT Hacks
    Loaning/Borrowing of IoT kits are really popular not all students have access to hardware or sensors
    Ensure you have a mixer of platforms, sensors and tech staff who can support users using IoT
    For Short Hackathon ensure you have IoT device pre-setup with OS as downloading and installing Windows 10 IOT Core can take some time to setup and deploy.
    Don’t limit users on hardware or software available have a pre setup selection of Windows, Raspbian, etc
    For short hacks make sure everything is pre configured and ready to go providing temp username and passwords if necessary.
    Ensure pre Workshop are completed and allow 1 –2 hours per workshop to ensure people feel confident with the technology

    Azure App service: Using Custom domain with Azure Traffic Manager

    Progressive Web Apps on Windows 10: Live Tiles, Toast Notifications and Action Center

    $
    0
    0

    Ninja Cat Loves PWAs Progressive Web Apps are gaining in popularity with web developers wanting to improve user engagement (via a Start menu presence, push notifications, live tile updates, etc.) and give their users an app like experience with support for offline and background sync. The 'Progressive' in Progressive Web Apps refers to the fact that the app adapts and takes advantage of the features of the environment it is running on. The great strength of PWAs on Windows 10, is that they can call Windows UWP APIs directly through JavaScript (or TypeScript). In this blog post, I will demo how you can add the necessary TypeScript to your existing web app, run it as a PWA, and call Windows APIs to update the app's tile, pop up a native toast and show the notification in Action Center.

    Prerequisites

    • Visual Studio Community Edition (http://visualstudio.com) at least version 15.6.2.
    • Install Node.js and NPM (https://nodejs.org/)
    • Install Angular CLI:
        npm install -g @angular/cli
      
    • Install .NET Core templates for Angular, React and React with Redux:
        dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0
      

    You can find the source code for this post here: https://github.com/appconsult/PWA-Samples/tree/master/WindowsAPIs

    Create a simple .NET Core Core Angular + MVC web app

    The name of the app will be MyNgApp

    Open an admin command prompt and type:

    md MyPWA
    
    cd MyPWA
    
    dotnet new angular -o MyNgApp
    

    You now have an Angular + MVC web app called MyNgApp

    Add Windows Runtime UWP Type declarations to the project

    Since we will be calling Windows Runtime APIs we need to add the type definitions to the project to get IntelliSense and avoid errors and warnings in the editor. The type definitions are maintained here: https://www.npmjs.com/package/@types/winrt-uwp.

    Open an admin command prompt

    cd MyPWAMyNgAppClientApp
    
    npm install –-save @types/winrt-uwp
    

    Add an Angular component to call the Windows 10 APIs

    Open an admin command prompt

    cd MyPWAMyNgAppClientApp
    
    ng generate component notifications
    

    More information: https://angular.io/tutorial/toh-pt1

    Test it

    1. Open the Angular ASP.NET MVC project in Visual Studio
    Cd MyPWAMyNgApp
    
    Start Visual Studio
    
    Open MyNgApp.csproj
    

    The Solution view should look as follows:

    MyNgApp Solution

    1. F5 (Debug | Any CPU | IIS Express)
    2. This may take a few minutes. Eventually, a browser session will start and the app will load. The load is slow on first run as the components are built.
    3. Note: Two apps are created and running: the Angular and ASP.NET MVC - note the different ports. To the user this looks like one app.

    You should see something like:

    MyNgApp Running

    More information here: https://docs.microsoft.com/en-us/aspnet/core/spa/angular?tabs=visual-studio

    Integrate the created Angular component 'Notifications' into the app

    Update the navigation menu to display the Notifications component and routing path

    1. Open nav-menu.component.html
    2. Add the following as the last row in the nav navbar-nav table:
      <li [routerLinkActive]='["link-active"]'>
          <a [routerLink]='["/notifications"]' (click)='collapse()'>
          <span class='glyphicon glyphicon-envelope'></span> Notifications
          </a>
      </li>
      
    3. Update the RouterModule so that navigation loads the Notifications componenta. Open app.module.tsb. Change:
      RouterModule.forRoot([
       { path: '', component: HomeComponent, pathMatch: 'full' },
       { path: 'counter', component: CounterComponent },
       { path: 'fetch-data', component: FetchDataComponent },
       ])
      

      To:

      RouterModule.forRoot([
      { path: '', component: HomeComponent, pathMatch: 'full' },
      { path: 'counter', component: CounterComponent },
      { path: 'fetch-data', component: FetchDataComponent },
      { path: 'notifications', component: NotificationsComponent },
      ])
      
    4. Add Windows APIs to create toast and live tile notificationsa. Open notifications.component.tsb. Add the following line to the top of the page:
      ///<reference path='../../../node_modules/@types/winrt-uwp/index.d.ts' />
      

      c. Paste the following into the notifications component class:

      public showToast(message, iconUrl) {
        if (typeof Windows !== 'undefined' &&
          typeof Windows.UI !== 'undefined' &&
          typeof Windows.UI.Notifications !== 'undefined') {
          var notifications = Windows.UI.Notifications;
          var template = notifications.ToastTemplateType.toastImageAndText01;
          var toastXml = notifications.ToastNotificationManager.getTemplateContent(template);
          var toastTextElements = toastXml.getElementsByTagName("text");
          toastTextElements[0].appendChild(toastXml.createTextNode(message));
          var toastImageElements = toastXml.getElementsByTagName("image");
          var newAttr = toastXml.createAttribute("src");
          newAttr.value = iconUrl;
          var altAttr = toastXml.createAttribute("alt");
          altAttr.value = "toast graphic";
          var attribs = toastImageElements[0].attributes;
          attribs.setNamedItem(newAttr);
          attribs.setNamedItem(altAttr);
          var toast = new notifications.ToastNotification(toastXml);
          var toastNotifier = notifications.ToastNotificationManager.createToastNotifier();
          toastNotifier.show(toast);
        }
      }
    
    public updateTile(message, imgUrl, imgAlt) {
      if (typeof Windows !== 'undefined' &&
        typeof Windows.UI !== 'undefined' &&
        typeof Windows.UI.Notifications !== 'undefined') {
        var date = new Date();
        var notifications = Windows.UI.Notifications,
          tile = notifications.TileTemplateType.tileSquare150x150PeekImageAndText01,
          tileContent = notifications.TileUpdateManager.getTemplateContent(tile),
          tileText = tileContent.getElementsByTagName('text');
        tileText[0].appendChild(tileContent.createTextNode(message || date.toTimeString()));
        var tileImage = tileContent.getElementsByTagName('image');
        var newAttr = tileContent.createAttribute("src");
        newAttr.value = imgUrl || 'https://unsplash.it/150/150/?random';
        var altAttr = tileContent.createAttribute("alt");
        altAttr.value = imgAlt || 'Random demo image';
        var attribs = tileImage[0].attributes;
        attribs.setNamedItem(newAttr);
        attribs.setNamedItem(altAttr);
        var tileNotification = new notifications.TileNotification(tileContent);
        var currentTime = new Date();
        tileNotification.expirationTime = new Date(currentTime.getTime() + 600 * 1000);
        notifications.TileUpdateManager.createTileUpdaterForApplication().update(tileNotification);
      }
    }
    
    

    d. Replace the contents of notifications.component.html with:

    <button (click)="showToast('hello world','http://icons.iconarchive.com/icons/cute-little-factory/breakfast/128/toast-icon.png')">Show Toast</button><br />
    <button (click)="updateTile('' ,'https://unsplash.it/150/150/?random','')">Update Tile</button>
    

    e. Save all files and F5 to run under the debugger. Watch output window for errors. You should now see the Notifications menu option.

    "MyNgApp running w/ notifications menu"

    f. Click on the Notification menu. Press the 'Show Toast' or 'Update Tile' button. Note that it does not work. This is because we are running in a browser context and not an application. The following JavaScript checks to see if we are in the application context. If it succeeds, it will run the WinRT JavaScript:

    if (typeof Windows !== 'undefined' && // Are we in Windows application context (a PWA or HWA?)
       typeof Windows.UI !== 'undefined' && // Is the Windows.UI namespace available on this device?
       typeof Windows.UI.Notifications !== 'undefined') // Is the Windows.UI.Notifications namespace available on this device?
    

    Let's get this running in an application context in the next step.

    Create a Hosted Web App (essentially a Progressive Web App without the web manifest or service workers)

    1. Add a Hosted Web App Project to the MyNGApp solutiona. Right click the MyNgApp solutionb. Add New Project

      c. Select JavaScript | Windows Universal | Hosted Web App (Universal Windows)

      d. Name the project MyNgHWA

    2. Configure the package.appxmanifest to the home page of the web app (MyNgApp) and set the security to allow WinRT APIs to be called.a. Open package.appxmanifest in the MyNgHWA project.b. In Application | Start page change 'Start page:' to localhost and the port the ASP.NET app is being served from. You can see this in the output when you run the web app. For example: http://localhost:61438/

      Note: This will be updated to the server url where the app is finally deployed.

      c. In Content URIs | URI include the same url as above. Make sure Rule is set to Include and WinRT Access is set to All.

      Note: In production, the URIs MUST be https.

    3. Run the web app in the HWA.a. Start the web app without debugging.
       1. With the MyNgApp as the Startup Project, press Ctrl+F5 or Debug | Start Without Debugging
      

      c. Start the HWA with debugging.

       1. Set MyNgHWA as the Startup Project.
      
       2. Press F5 to Start Debugging.
      

    After the splash screen is displayed, you will see the web app running inside the Hosted Web App.

    Test the Windows API Calls

    With MyNgHWA running, select the Notification menu, click the 'Show Toast' button. Note a toast message is immediately displayed.

    Click the Notification Center icon in the bottom right of Windows 10. Note that your toast message is listed in the Action Center list.

    Press the Windows key to view your Start menu. Right click the MyNgApp in the app list and select 'Pin to Start'.

    Back in the application, click the 'Update Tile' button. Press the Windows key to view your Start menu. After a few seconds, the tile will update with a new image and the time the tile was updated.

    For more on Progressive Web Apps see here:

    https://blogs.windows.com/msedgedev/tag/progressive-web-apps

    http://www.pwabuilder.com

    Next-generation web apps for education

    Who will be announced as the next Small Basic Guru? Read more about April 2018 competition!!

    $
    0
    0

    What is TechNet Guru Competition?

    Each month the TechNet Wiki council organizes a contest of the best articles posted that month. This is your chance to be announced as MICROSOFT TECHNOLOGY GURU OF THE MONTH!

    One winner in each category will be selected each month for glory and adoration by the MSDN/TechNet Ninjas and community as a whole. Winners will be announced in dedicated blog post that will be published in Microsoft Wiki Ninjas blog, a tweet from the Wiki Ninjas Twitter account, links will be published at Microsoft TNWiki group on Facebook, and other acknowledgement from the community will follow.

    Some of our biggest community voices and many MVPs have passed through these halls on their way to fame and fortune.

    If you have already made a contribution in the forums or gallery or you published a nice blog, then you can simply convert it into a shared wiki article, reference the original post, and register the article for the TechNet Guru Competition. The articles must be written in April 2018 and must be in English. However, the original blog or forum content can be from before April 2018.

    Come and see who is making waves in all your favorite technologies. Maybe it will be you!


    Who can join the Competition?

    Anyone who has basic knowledge and the desire to share the knowledge is welcome. Articles can appeal to beginners or discuss advanced topics. All you have to do is to add your article to TechNet Wiki from your own specialty category.


    How can you win?

    1. Please copy/Write over your Microsoft technical solutions and revelations to TechNetWiki.
    2. Add a link to your new article on THIS WIKI COMPETITION PAGE (so we know you've contributed)
    3. (Optional but recommended) Add a link to your article at the TechNetWiki group on Facebook. The group is very active and people love to help, you can get feedback and even direct improvements in the article before the contest starts.

    Do you have any question or want more information?

    Feel free to ask any questions below, or Join us at the official MicrosoftTechNet Wiki groups on facebook. Read Moreabout TechNet Guru Awards.

    If you win, people will sing your praises online and your name will be raised as Guru of the Month.

    PS: Above top banner came from Mandar Dharmadhikari.

    Ninja Ed and...


    signature   Ronen Ariely
    [Personal Site]    [Blog]    [Facebook]    [LinkedIn]

    Ramping up on Powershell & CLI

    $
    0
    0

    In this post, Senior Application Development Manager, Danny Kolke, gives a practical guide on getting started with PowerShell and Azure CLI.


    "For the things we have to learn before we can do them, we learn by doing them." Aristotle

    In working with my customers I often run into those who want to get started with Azure but just haven't done anything yet. My encouragement with them is pretty much summed up by Aristotle's famous words, or Yoda; whichever comes first to mind. With as much foresight as Aristotle had I still doubt that he was talking about Azure; of course Yoda was. Regardless, this wisdom sure holds true for me; in my experience with Azure the best way to learn is just to start building something.

    The following labs I developed as an exercise to teach Powershell and CLI for one of my customers. This customer wanted to cover things like Virtual Networks, Network Security Groups, Resource Groups, Load Balancers vs Application Gateways and how to setup failover recovery and other scenarios. But they didn't want to just learn about them, they wanted to do lots of labs. Plus this class was going to have half of the students on Windows machines and half on Mac's wanting to do both Powershell and CLI. The following is the first set of labs in a journey of labs we did together.

    The Scenario

    In these labs you will create hosted websites on virtual machines in both the East US and West US regions with a solution to manage traffic routing and failover between the two regions.

    • Traffic Manager --> East & West Regions
    • East & West US Regions
      • Resource Group
      • App Gateway in East
      • Azure Load Balancer in West
      • VNETs/Subnets
      • 2 VM's in an Availability Set

    clip_image002


    Prerequisites

    If you haven't done it already, there is some stuff you need to make sure you have installed before we begin on the lab.

    Windows, use the Webplatform Installer: https://www.microsoft.com/web/downloads/platform.aspx
    Download and run the application. This will enable you to install Microsoft Azure Powershell latest version

    Azure CLI 2.0 (Mac or Windows) https://docs.microsoft.com/en-us/cli/azure/install-azure-cli

    Pick your Editor

    If you are just getting started with Azure and don't know what tools to use to run the scripts I would recommend the following for your choice of Editors.

    • For Windows use Powershell ISE and setup the split window with your script in one window, and the terminal in the other. Highlight one line at a time and run the selection by selecting F8. In windows, you can use Powershell ISE with either the Powershell lab, or the CLI lab, both will work in ISE.
    • For Mac users, I'd recommend using VS Code and setup the same split window. You want to add the Azure CLI extension and save your file with the .azcli. Then you can highlight your code and do the same process. Rumor is you can also use VS Code to run Powershell on your mac but I haven't spent the time to try that. VS Code also works on Windows. So you can do that as well.

    One more thing, of course you will need an Azure Subscription. If you don't have one, you can sign up for a free trial at www.azure.com.

    Download the Labs and Get Going

    Download the following labs from my github.

    You can open the files as text files and copy and paste them into your editor, not terminal. When you are ready to go, it should look like this.

    clip_image004
    VS Code on Mac

    clip_image006
    Powershell ISE on Windows


    Tips & Tricks

    Read the Labs and Follow the Links

    All the instructions you need are in the labs. Follow the links to find out more about the various services and solutions you are deploying.

    You can’t run it all at once

    Note that with these labs you will not be able to just run the code all at once. You will have to read the scripts, edit them and make changes and run them. In this process hopefully you will learn a lot about Powershell and CLI and how the various solutions work. Part of the process is also learning how to read the error messages. It's all part of getting comfortable with Azure and how this stuff works.

    Edit, Select and Run

    Select each line of the code, right click and run. Read the variables and values.

    clip_image008
    Powershell ISE - Right Click Run Selection

    clip_image010
    VS Code - Right Click Run Line in Terminal

    Don’t forget the ` when using Powershell

    In the powershell example I used ` for to continue the script on the next line. So when you highlight and run a script, make sure you catch the wrapped lines.

    clip_image012


    The Virtual Machines and IIS installed for this lab to work

    For these labs we are deploying Windows VM's and in order to have them act like web servers you will need to install IIS. Do do this you will RDP to the VM's and run a powershell script on each VM to install IIS and the necessary tools. Don't worry, it's all in the instructions/comments of the script. The powershell to run on the VM's is. The biggest mistake is that students forget to remove the # when trying to run it.

    Install-WindowsFeature -name Web-Server -IncludeManagementTools

    clip_image014

    After running this, navigate to the following file on the VM and edit in Notepad.

    C:inetpubwwwrootiistart.html

    clip_image016

    Note that iistart.html is the default website homepage. We want to edit the HTML in this file so you can easily identify which VM is being hit in the tests. AGW, ALB and Traffic Manager will all mask the URL so editing the HTML makes it easy to know which machine is which. The result will look like this.

    clip_image018


    Watch What Happens

    Use portal.azure.com to see what you are building and how things show up as you are working through your labs. Also you can use resources.azure.com to see the same.


    Don’t be afraid to break stuff

    If you get stuck, do some research and figure it out. Don't be afraid to break anything. You can always delete your resource group and start over. The best way to ramp up on this stuff, is to just start doing it and learn as you go.


    Delete and Do It Again

    When you are all done, I recommend deleting your resource groups and doing it all over again. Change the setup and try again.


    Always Create a New Resource Group

    When trying new stuff, ALWAYS create a new Resource Group so you can easily delete, and or move it later if you want to keep it.


    Where to from here?

    After getting comfortable with powershell and CLI, I like to work on the following with my class

    • Try ARM template deployments with CLI and Powershell
    • Try Creating a Web App using PaaS and CosmosDB
    • Use Powershell and Update the App Gateway above to point to your Web App
    • Best practices for ramping up on ARM
    • Use the portal to select and configure your solution
    • Then export the ARM template and play with it
    • Or try finding something on github and play with it and deploy
    • Try it first on the portal to create, poke around and maybe try a "fast start"

    Have fun!

    Oh, which Yoda quote? There are too many to choose from. How about "will he finish what he begins?" or "You must unlearn what you have learned."


    Premier Support for Developers provides strategic technology guidance, critical support coverage, and a range of essential services to help teams optimize development lifecycles and improve software quality.  Contact your Application Development Manager (ADM) or email us to learn more about what we can do for you.

    Protected: Azure App service: Using Custom domain with Azure Traffic Manager

    $
    0
    0

    This content is password protected. To view it please enter your password below:

    PHP Minor Version Update for May 2018

    Localized strings in solutions that span classic and modern SharePoint sites

    $
    0
    0

    This article builds on an earlier one, Building Headers and Footers that work on Classic and Modern sites. That article, with associated sample code, was about how to create a top menu and footer that work on both modern and classic SharePoint pages. On modern pages, the solution is a SharePoint Framework extension; on classic pages, it's a stand-alone solution that just happens to use SharePoint Framework tooling like TypeScript, WebPack, and React. That allows a very high degree of common code between the classic and modern implementations.


    Figure 1

    The good news is that my POC was successful, and the partner and their customer liked it!

    The sample code has moved! It's now in the SharePoint Framework Extensions repo.

    I skipped over one key capability in my project, which was localization. The customer in this case is a large multi-national company, so it's not too surprising they would want to show some information in the user's preferred language.

    So I set out to update the POC to add multi-lingual support. Now in a real implementation, you might want to add localized text for all the hyperlinks and menu choices, or perhaps even have a completely different menu and footer for each supported language. But that seemed too easy; instead I really wanted to show how to use the SPFx localization files in a non-SPFx solution. So I removed the footer message from my JSON data file and instead made it a localized string called footerMessage.


    Figure 2

    SPFx stores localized text in a folder called loc. The first thing I did was move this folder into the common folder so the strings would be shared by both the classic and modern implementations. I also had to change the localizedResourcesproperty in config.json in my SharePoint Framework implementation, so it could find the folder.

    Within loc, a file called myStrings.d.ts declares an interface for the strings, (with a property for each string to be localized), and a module that the SPFx code can consume. Here's the myStrings.d.ts file for my solution.

    declare interface ICustomHeaderFooterApplicationCustomizerStrings {
      FooterMessage: string;
    }
    
    declare module 'CustomHeaderFooterApplicationCustomizerStrings' {
      const strings: ICustomHeaderFooterApplicationCustomizerStrings;
      export = strings;
    }
    

    Then you need to provide a JavaScript file for each supported language, which contains a module with the strings for that language and is named after the language tag, such as en-us.js. (Note this is not a TypeScript file!)

    Here is the English language file in my project; I also included a French version.

    define([], function() {
      return {
        "FooterMessage": "Contoso Corporation, all rights reserved"
      }
    });

    Now the SharePoint Framework is smart enough to generate a separate bundle for each language, and it dynamically loads only the language needed. I wasn't feeling so ambitious, and was content to put all the translations into the main bundle. So my approach was to make a shim called languageManager.ts that wraps around the SPFx language management, and introduces simple language management for the Classic bundle. Code that wants to use localized strings will get them from the language manager rather than directly from SPFx. (You can see this in the component Footer.tsx.)

    The SPFx version of languageManager.ts just reads the strings the usual way and provides them to its caller.

    import * as strings from 'CustomHeaderFooterApplicationCustomizerStrings';
    
    export class languageManager {
    
        public static GetStrings(): ICustomHeaderFooterApplicationCustomizerStrings {
            return strings;
        }
    
    }

    The classic version checks the current language and then loads the corresponding module. Since this code will run on classic pages, it can use the old _spPageContextInfo.currentUICultureName variable that classic SharePoint sets up on every page. This will keep the language in sync with the SharePoint UI.

    Here's the classic language manager:

    export class languageManager {
    
        public static GetStrings(): ICustomHeaderFooterApplicationCustomizerStrings {
    
            var localizedStrings: ICustomHeaderFooterApplicationCustomizerStrings = null;
    
            const pageContext: any = (<any>window)._spPageContextInfo;
    
            if (pageContext) {
                const uiCulture: string = pageContext.currentUICultureName;
                if (uiCulture) {
                    switch (uiCulture.toLowerCase()) {
                        case 'en-us': {
                            localizedStrings = require('./common/loc/en-us');
                            break;
                        }
                        case 'fr-fr': {
                            localizedStrings = require('./common/loc/fr-fr');
                            break;
                        }
                    }
                }
    
            }
            
            if (localizedStrings === null) {
                localizedStrings = require('./common/loc/en-us');
            }
    
            return localizedStrings;    
        }
    
    }

    When common code wants to access the localized strings, it just accesses the language manager.

    import { languageManager } from '../../languageManager';
    
    ...
    
    const strings = languageManager.GetStrings();
    
    doSomethingWith(strings.FooterMessage);

    Now people around the world can enjoy headers and footers that span classic and modern sites!

    Physical Data Center Security

    $
    0
    0

    Senior Consultant Omar Amin recently posted this article on securing a physical data center.  In this post, he highlights roles and responsibility on security across various hosting options.


    I don't spend a lot of time talking to customers about physical data center security.

    As a developer using mostly PaaS or IaaS compute platforms, I just assumed that that cloud provider had taken care of it. Helping customers with Data Security (Data at Rest, Data in Transit, Secure Compute), and Application Code security takes up most of my time.

    In this post, I wanted to step back a bit and look at the bigger picture. Lets toss out the above assumptions and look at the entire stack where we run our applications. With the proliferation of cloud platforms, you now have a wide choice of IT infrastructure to meet your business needs. A typical IT infrastructure today can encompass a mixture of SaaS, PaaS, IaaS and On-prem solutions.

    Continue reading here.


    Premier Support for Developers provides strategic technology guidance, critical support coverage, and a range of essential services to help teams optimize development lifecycles and improve software quality.  Contact your Application Development Manager (ADM) or email us to learn more about what we can do for you.

    Viewing all 35736 articles
    Browse latest View live


    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>