Showing posts with label optimization. Show all posts
Showing posts with label optimization. Show all posts

Reading Notes #602

It's reading notes time! It is a habit I started a long time ago, where I share a list of all the articles, blog posts, and books that catch my interest during the week.


Having interesting content? Share it!

Cloud

Programming

AI

~Frank

Reading Notes #593

It is time to share new reading notes. It is a habit I started a long time ago where I share a list of all the articles, blog posts, and books that catch my interest during the week.

If you think you may have interesting content, share it!

Cloud

Programming

Miscellaneous

~Frank

Reading Notes #580

It is time to share new reading notes. It is a habit I started a long time ago where I share a list of all the articles, blog posts, and books that catch my interest during the week.

If you think you may have interesting content, share it!

Cloud

Programming

Miscellaneous

  • Announcing Microsoft Copilot Studio (Jared Spataro, C) - Copilot Studio was for sure one of the big announcement during Microsoft Ignite. Learn more about what it is, what it does, and how you can get it in this post.
~frank

Reading Notes #555


It is time to share new reading notes. It is a habit I started a long time ago where I share a list of all the articles, blog posts, and books that catch my interest during the week. 

If you think you may have interesting content, share it!

 

The suggestion of the week

Programming

Databases

Podcasts

Miscellaneous

~frank

Reading Notes #539


Good Monday! 
It's time to share new ReadingNotes. Here is a list of all the articles, podcasts, and blog posts, that catch my interest during the week. 

If you think you may have interesting content, share it!

 

Programming

Podcasts

  • Best of DevOps 2022 (DevOps and Docker Talk) - Nice review of 2022, DevOps style, by 3 Docker captains.


~Frank

Reading Notes #538


Good Monday, 
Already time to share new reading notes. Here is a list of all the articles, and blog posts that catch my interest during the week. 

If you think you may have interesting content, share it!


Cloud

Programming

Miscellaneous

~frank

Reading Notes #537

Screen capture during Windows 11 installation

Good Monday, it's time to share new ReadingNotes. Here is a list of all the articles, podcasts, and blog posts, that catch my interest during the week.

If you think you may have interesting content, share it!


The suggestion of the week

Cloud

  • Azure Storage Caching and Compression – The Missing Piece (Jeffrey T. Fritz) - This post shares all the gotchas learned along the way in developing and trying to optimize an application. The result is a faster application, a better experience for the client, and more money that stays in your pocket.

Programming

Databases

Miscellaneous



~Frank


Reading Notes #504


Good Monday, Already time to share new reading notes. Here is a list of all the articles, blog posts, and podcast episodes that catch my interest during the week. 

If you think you may have interesting content, share it!

Cloud

Programming

Miscellaneous

~Frank

Reading Notes #492


Good Monday, 
Already time to share new reading notes. It is a habit I started a long time ago where I share a list of all the articles, blog posts, podcast episodes, and books that catch my interest during the week. 

You think you may have interesting content, share it!

Cloud

Programming

Podcasts

Miscellaneous


~frank


Reading Notes #327

Cloud


Programming


Databases


Miscellaneous


Books

  • The Subtle Art of Not Giving a F*ck (Mark Manson) -Damn it's good!
    The title of the book let's me thought it will be very negative. Not giving a fu#*... But it's really not. Quite the opposite in fact. I really like the book and I'm planning to read/listen it another time in... One year. To see what changed.

Reading Notes #269

AzureFunctionSuggestion of the week


Cloud


Programming


Miscellaneous



First VSCode Tasks in less than 5 minutes

I'm working on solution to automating the generation of my weekly post: Reading Notes. While this work is finished, I still need to do many steps manually. I introduced in a previous post VSCode, that already supports markdown. In fact, from any markdown file, you can press Ctrl+Shift+V to preview the oupput. However, today, it's not possible to do anything with this preview. This post explains how we can use VSCode task to fix this problem.

Goal

Create a task that will quickly transform my current open markdown file in HTML.

Step 1 - Get a Markdown parser

First, we need Markdown parser. I'm sure many different are available, but in this post, I will use markdown-js, a Node.js parser that is available on github. To install it, just execute the following command:
npm install -g markdown

Step 2 - Create a Task

Secondly, we need to create our task. Open Visual Studio Code, and type Ctrl+Shift+P to open the Command Palette and then start typing Configure Task. Press Enter or select “Configure Task Runner”. This will create a new file tasks.jon, with many different samples of tasks. Before you replace the content of the page by the following code, take a look at the comment block at the top of the page. You will see different context variables that are available.

// Simple Task to transform MarkDown to Html
{
    "version": "0.1.0",
    "command": "md2html",
    "isShellCommand": true,
    "args": ["${file}"]
}

This defines our task using the json format. The command name in this case is md2html and we pass the name of the current open file as parameter using the variable ${file}. Finally, the "isShellCommand" is set to true so the task will be triggered by pressing Ctrl+Shift+B.

Step 3 - Try it

To try it, open a markdown page, hit Ctrl+Shift+B, and voilà! You should see in the output the HTML code generated.




References



~Frank

Stop losing time installing your software

Automation is the key to many hard situations. Everyone knows that, yet a lot of tasks are done manually. In this post, I will share with you some easy steps to install all your applications.

Blue Gears

Let's get started


For those how follow this blog I talked many times about Chocolatey. For all the others, Chocolatey is a Machine Package Manager, somewhat like apt-get (on Linux), but built with Windows in mind.
Assuming that you don't have Chocolatey installed, let's start by that. Open a command prompt (cmd.exe) as Administrator, and execute this command:
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
Now anytime you need an application you can simply do a choco install command. This will download the latest version of the package online the last package, and install it on your PC.
Here are some examples with popular applications:

Application Command
Notepad++ choco install notepadplusplus
Atom choco install atom
7-Zip choco install 7zip
Skype choco install skype

You can find the complete list of all applications on the Chocolatey web site. Many other commands are also available to search, list and update some packages:

Command Description
choco install atom -Version 0.140.0 Install old version (0.140.0) of Atom
choco list nunit Show all package that contain nUnit
choco update updates chocolatey to the latest version
choco update notepadplusplus updates NotePad++ to the latest version


Let's go a step further


Will it be nice if we could chain them? This is possible with Boxstarter, a repeatable, reboot resilient windows environment installations using Chocolatey packages. To install Fiddler, Atom, and Visual Studio 2013, simply type this command in Internet Explorer (IE) and Boxstarter will starts his magic.
http://boxstarter.org/package/fiddler4,atom,visualstudiocommunity2013


Note: This will work only in Internet Explorer (IE), on Chrome or Firefox you will need a "Click-Once" extension.



Turn it up to 11


Now that we know we can chain them, what is stooping us to create a script that will install ALL our favorite applications? Well, nothing!

Boxstarter is a very easy and powerful way to automate the installation of software. Here an example to show some of the great features supported by Boxstarter. In the following script I will: configure Windows, install the latest Windows updates, install Visual Studio Community 2013 with an extension and install many other applications.

# Windows Configuration
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
Disable-InternetExplorerESC
Disable-UAC #Win8
Set-TaskbarSmall

if (Test-PendingReboot) { Invoke-Reboot }

# Update Windows and reboot if necessary
Install-WindowsUpdate -AcceptEula
if (Test-PendingReboot) { Invoke-Reboot }

# Install Visual Studio Community 2013
choco install choco install visualstudiocommunity2013

# VS extensions
Install-ChocolateyVsixPackage PowerShellTools http://visualstudiogallery.msdn.microsoft.com/c9eb3ba8-0c59-4944-9a62-6eee37294597/file/112013/6/PowerShellTools.vsix


# Install WebPI (Platform Installer) 
choco install webpi

# Install
#  . SSDT
#  . Microsoft Azure SDK - 2.4.1
#  . Microsoft Azure SDK for .NET (VS 2012) - 2.4
C:\Program Files\Microsoft\Web Platform Installer>WebpiCmd.exe /Applications: SSDT, WindowsAzureSDK_2_4_1, VWDOrVs2012AzurePack.2.4


if (Test-PendingReboot) { Invoke-Reboot }

# Install Favourite Tools
choco install sourcetree
choco install resharper
choco install Atom
choco install LinqPad
choco install fiddler4

You can now execute this script executing the command in IE:
http://boxstarter.org/package/url?C:/dev/Demoscript.txt 
In this case, the file was on a local folder, put it could have been in a share folder on another server, or somewhere online like in gist.github.com.

Wrapping up


I hope it will help you to automate repetitive task and save time. For more information about Chocolatey or Boxstarter, go visit their respective web site. Any comments, suggestions and/or questions are welcome.


~Frank B

Four Simple Tips to Improve your Asp.Net MVC Project

When it's time to do the re-factoring of a solution, it's always a good idea to clean the code before doing any re-factoring. In this post, I will share with you simple but very efficient ways to improve your solution.

1- Forget the magic string


By default in Asp.Net MVC magic strings are used every where.
return View("Index");
or
@Html.ActionLink("Delete Dinner", "Delete", "Dinners", new { id = Model.DinnerID }, null)

Nothing bad here, but nothing will tell you that to did a typo, or that the method name as changed. This is where T4MVC will become a great tool do add to all your project.

To add it a simple Nuget command is enough: Install-Package T4MVC. By doing this a T4 file (T4MVC.tt) will be added to your project that will generates a number of files. These generated files will simplify your life and gives you the opportunity to code using strongly type.

Here are few transformations:
// Before ----------------
  return View("Index");

// After with T4MVC
  return View(Views.Index);
An action link in a view.
// Before ----------------
  @Html.ActionLink("Delete Product", "Delete", "Products", new { id = Model.ProductID }, null)

// After with T4MVC
  @Html.ActionLink("Delete Product", MVC.Products.Delete(Model.ProductID))

An Ajax call.
// Before ----------------
<%= Ajax.ActionLink( "RSVP for this event",
                 "Register", "RSVP",
                 new { id=Model.DinnerID }, 
                 new AjaxOptions { UpdateTargetId="rsvpmsg", OnSuccess="AnimateRSVPMessage" }) %>

// After with T4MVC
<%= Ajax.ActionLink( "RSVP for this event",
                 MVC.RSVP.Register(Model.DinnerID),
                 new AjaxOptions { UpdateTargetId="rsvpmsg", OnSuccess="AnimateRSVPMessage" }) %>

A redirection.
// Before ----------------
return RedirectToAction("Details", new { id = product.ProductID });

// After with T4MVC
return RedirectToAction(MVC.Products.Details(product.ProductID));

When writing the code, it gives you intellisense where you normally would not have any. At compile time, it validates all the code so no typo or other misspelling errors are present.

2- Clean your views


You know all those "@using" on the top of each views that we copy over and over... It's time to remove them. The way to do it is by moving them to the web.config file in the "Views" folder.

web.config location

So you can move the namespaces used globally
@using Microsoft.Security.Application
@using System.Globalization;

by including them to this section:
<system.web.webPages.razor>
  <pages pageBaseType="System.Web.Mvc.WebViewPage">
    <namespaces>
      <add namespace="System.Web.Mvc" />
      <add namespace="System.Web.Mvc.Ajax" />

      <add namespace="Microsoft.Security.Application" />
      <add namespace="System.Globalization" />

    </namespaces>
  </pages>
</system.web.webPages.razor>

3- Don't lose time debugging


To many people are losing time debugging their application or web site. Start using Glimpse right away! This will provide information in real time across all layers of your application from the UI to the server and database side. Perfect to know everything that happen on a click of a button: javascript validation, controller code and even the query in the database.







Install it in ten seconds with the Nuget command manager and pick the version you need.

PM> Install-Package Glimpse



Glimpse is secure and is configured to be accessible only from localhost by default. But don't trust me and try it by yourself, or go check this one minute Glimpse Heads Up Display youtube video.

4- Start monitoring your website health and usage


Move your website on Microsoft Azure and use the Application Insights. This will gives you the opportunity to monitor that availability, performance and usage of your live application.

Add Application Insights


To add it you got many possibilities, one of them from Visual Studio 2013, just right-click on the project and select Add Application Insights Telemetry, and voilà!

Now you just need to run or deploy the website and after few minutes or so you will have plenty of information, graphs waiting for you in the Azure Portal.



Informations



You will find a lot of information about Application Insights on the Microsoft Azure


Wrapping up

I hope it will help you, thanks for reading. Any comments, suggestions and/or questions are welcome.

~ Frank Boucher


References



Reading Notes #140

Azure2014-05_new_features 

Suggestion of the week

 

Cloud

Programming


~Frank


Reading Notes #89

Photo edited with http://www.tuxpi.com

Suggestion of the week


Cloud

 

Programming

 

Integration

I wrote a blog post a few years ago around the options for where you could put configuration settings in BizTalk (Click here).

System Management


Miscellaneous


~Frank



Reading Notes #57

 
“Cloud Book Study” by Heidi Neilson
Cloud
Check out the paper.

Programming

Miscellaneous

    ~ Frank