VIRTUAL DAN

VIRTUAL DAN

Notes from my travels around the internet

VIRTUAL DAN
  • My Pacific Northwest Solar
  • About
Monthly Archives: February 2020

Blazor – First Look

I have been anxiously anticipating the release of Blazor – Microsoft’s new .Net component framework that should help free developers from Javascript hell.

Blazor is a new tool for .net developers to allow running C# in the browser, inside web assembly.

What I most like about it is, it is such an clean and simple architecture from the developer’s point of view. Writing a blazor app is very similar to writing your typical MVC/Razor app, that runs on the server. I have always felt that MVC/Razor was ultimately the wrong model – very anti-client/server since all the data/template rendering happens on the server. Until now, there has been no way to run c# in the browser, and have the browser pull the data and assemble the page.

Because MVC/Razor does all the work on the server, JavaScript has been the only option to run in-browser code and pull data popularizing the single page application (SPA) model. From a C# developer’s point of view, Javascript is a terrible language. Its not strongly typed, its interpreted (not compiled), and until recently it has been difficult to debug. Because of all this, frameworks such as Angular, React and Vue have become popular to help hide the mess that can be created by JavaScript. In my opinion, this has in many ways made the problem worse, because additional libraries and packages need to be installed to support frameworks, bloating the code and slowing development time thru trying to orchestrate all this 3rd party code.

Blazor finally replaces all this mess. To do this, they had to wait until all the modern browsers support WebAssembly. Today, the only ‘modern’ browser not supporting it is Internet Explorer 11, and hopefully with the demise of Windows 7 traffic using IE 11 should diminish. There is even an answer if you do need to support older browsers – Blazor Server. Blazor apps can also be written to run on the server, so the codebase can be the same whether you decide to run it on the client or the server. Very elegant.

Using a sample provided by Microsoft, I downloaded, compiled and ran the app in my browser in under 5 minutes. Browsing thru the code, its very readable and understandable. within an hour I was able to customize the demo to call my own API and retrieve data from display it – all without javascript. Contrast that to setting up an Angular app, which could take an hour or two by the time you assembly all the pieces to get the code to run. This article has a great overview of Blazor and the code in the demo. Note that when you first run a Blazor app, it takes all the compiled code (that traditionally runs on the server), and downloads it to the browser. So the first load of the page takes a little time, but once the app is loaded its very fast. One current limitation of Blazor is because the code is running in the browser, inline debugging, setting of breakpoints does not easily work from within Microsoft’s Visual Studio, so this is a step backward in productivity as compared with server development. However, because Blazor consumes class libraries, you can debug class libraries as per usual, prior to implementing them in Blazor. Also, the Blazor team has stated that getting debugging working is a top priority.

Blazor client is still in preview until May of 2020. I think this will be a huge boon to productivity, and I am starting to develop Blazor apps now in preparation for releasing after May. Already it is such an improvement over the JavaScript framework model. As of now, I think the future is bright for client side application development.

Buy Now
PRETTYGARDEN Women’s Casual Blazers Long Sleeve Open Front Button Work Office Blazer …
Read More
Buy Now
Aeropress Original Coffee and Espresso Maker, Barista Level Portable Coffee Maker wit…
Read More
Buy Now
HHIP 3900-0265 4-Piece Drift/Center Key Set (Mt 1-2-3- and 4/5/6) (Misc.)
Read More
Buy Now
Web Development with Blazor: A hands-on guide for .NET developers to build interactive UIs with C# (Kindle Edition)
Read More
Buy Now
Microsoft Blazor: Building Web Applications in .NET 6 and Beyond (Paperback)
Read More
Buy Now
Microsoft Blazor: Building Web Applications in .NET (Paperback)
Read More
February 27, 2020 Dan Leave a comment

My Raspberry Pi

I have been tinkering with home automation projects over the last few years, messing around with a variety of platforms.  I started with a Wink hub and other assorted wifi enabled products,  and pretty much glued everything together using IFTTT.  This has worked OK, and I have learned a lot over the years.  Recently, with my work with the Hue API, I did my first integration that involved writing code, and running that code out at Microsoft Azure.  That was a great next step, but the stage is to run a fully programmable local hub that can manage my devices locally (IOT on the edge).

The first step I needed to decide on was what platform to run. I am a Microsoft Windows centric guy, so I was leaning towards building off Windows, but I didn’t see anything I liked.  However, now that Microsoft has released the dotnetcore programming library that allows running C# on Linux, that opened up more possibilities.  Over the last few months, I finally settled on Raspberry PI, a perfectly adequate machine that you can get for under $100.   It also runs on very low power.  I put a power meter on it – and it runs consistently at around 4.2 watts – which is about the same as my desktop PC when it is sleeping.

[amazon_link asins=’B07V5JTMV9′ template=’ProductAd’ store=’vgs0c1-20′ marketplace=’US’ link_id=’cc667a40-ba88-4ae9-8592-5b94fa18b1c8′]My first project I settled on came about because of a previous hardware purchase.  A while ago, I got a 2 terabyte USB drive at Costco, with the plan to plug it into my router to provide all my PC’s access to a shared large drive.  Unfortunately, when I plugged it into the router, it only recognized like 300mg.  I theorized that is because the drive is formatted in exFAT to accomodate the large number of bytes, and the router probably doesn’t support that file format.  Now  I probably could of futzed around for awhile and figured out a good workaround, but thats when I decided to take the plunge and get my first Raspberry PI and use that as my network attached storage.

I received my Raspberry PI from Amazon got started. The hardest part was probably just setting up my work area to start tinkering.  I didn’t want to have to swap monitors or keyboards,  so I had to dig up an old monitor, mice and keyboard.  The raspberry Pi has a HDMI port for the monitor, but unfortunately my monitor didnt support HDMI, so I had to dig up an adapter for it.  I also had to buy an 8Gg micro SD card, which delayed me a bit.  Once  I got my workarea and hardware setup, I just followed the instructions that came with the Pi and I was running Linux  in 15 minutes(!)  The Pi runs Raspian, which is a flavor of Linux recommended for the PI, and it is more Windows like than I was expecting.

So now that I was semi comfortable with Linux, the next big steps were to attach my USB drive and get Raspian to recognize it.  I also needed to figure out how to set up a share so that my windows machines can see the storage, and I decided  I wanted to have my Pi run FTP, so I  can have my security cameras stream local copies of  video recordings to the drive. Getting thos all to work of course mostly involves googling various keywords til you find a solution, and I was amazed at all the support out there for Raspberry Pi.  I found step by step instructions on mounting an external drive, setting up a network share (using Samba), and installing FTP and getting FTP to recognize the external drive.  Getting FTP to recognize the external drive was probably the most difficult, as there are a couple FTP packages supported by Raspian.  But thanks to Ryan Fitton’s post I got it to work.

So now everything is up and running just as I had hoped.  Every machine on my network can see the storage, and my cameras are streaming copies of images to the drive.  The next step on my roadmap is to start building out the Pi platform.  Getting a dotnetcore program to run on my Pi will be the next step.  After that.. the sky is the limit.

 

,

APPIP ERROR: amazon-search[

]
February 14, 2020 Dan 1 Comment

Archives

  • August 2021 (1)
  • May 2021 (1)
  • April 2021 (1)
  • March 2021 (1)
  • February 2021 (1)
  • January 2021 (1)
  • December 2020 (2)
  • November 2020 (2)
  • October 2020 (2)
  • September 2020 (2)
  • August 2020 (2)
  • July 2020 (2)
  • June 2020 (2)
  • May 2020 (2)
  • April 2020 (2)
  • March 2020 (2)
  • February 2020 (2)
  • January 2020 (3)
  • December 2019 (2)
  • November 2019 (2)
  • October 2019 (2)
  • September 2019 (1)
  • August 2019 (2)
  • July 2019 (2)
  • June 2019 (1)
  • May 2019 (3)
  • April 2019 (2)
  • March 2019 (2)
  • February 2019 (2)
  • January 2019 (3)
  • December 2018 (2)
  • November 2018 (2)
  • October 2018 (2)
  • September 2018 (2)
  • August 2018 (2)
  • July 2018 (2)
  • June 2018 (2)
  • May 2018 (2)
  • April 2018 (2)
  • March 2018 (2)
  • February 2018 (1)
  • January 2018 (3)
  • December 2017 (2)
  • November 2017 (2)
  • October 2017 (2)
  • September 2017 (2)
  • August 2017 (2)
  • July 2017 (2)
  • June 2017 (3)
  • May 2017 (2)
  • April 2017 (1)
  • March 2017 (3)
  • February 2017 (3)
  • January 2017 (2)
  • December 2016 (2)
  • November 2016 (3)
  • October 2016 (2)
  • September 2016 (2)
  • August 2016 (2)
  • July 2016 (2)
  • June 2016 (2)
  • May 2016 (2)
  • April 2016 (2)
  • March 2016 (2)
  • February 2016 (3)
  • January 2016 (4)
  • December 2015 (2)
  • November 2015 (2)
  • October 2015 (3)
  • September 2015 (3)
  • August 2015 (2)
  • July 2015 (4)
  • June 2015 (2)
  • May 2015 (4)
  • April 2015 (3)
  • March 2015 (4)
  • February 2015 (4)
  • January 2015 (4)
  • December 2014 (5)
  • November 2014 (3)
  • October 2014 (5)
  • September 2014 (3)
  • August 2014 (5)
  • July 2014 (4)
  • June 2014 (4)
  • May 2014 (3)
  • April 2014 (3)
  • March 2014 (5)
  • February 2014 (2)
  • January 2014 (5)
  • December 2013 (4)
  • November 2013 (6)
  • October 2013 (3)
  • September 2013 (3)
  • August 2013 (4)
  • July 2013 (3)
  • June 2013 (3)
  • May 2013 (5)
  • April 2013 (2)
  • March 2013 (6)
  • February 2013 (6)
  • January 2013 (5)
  • December 2012 (5)
  • November 2012 (4)
  • October 2012 (3)
  • September 2012 (4)
  • August 2012 (3)
  • July 2012 (3)
  • June 2012 (2)
  • May 2012 (3)
  • March 2012 (3)
  • February 2012 (2)
  • January 2012 (1)
  • December 2011 (3)
  • November 2011 (3)
  • October 2011 (2)
  • September 2011 (2)
  • August 2011 (3)
  • July 2011 (4)
  • June 2011 (4)
  • May 2011 (3)
  • April 2011 (6)
  • March 2011 (8)
WEBSITE DISCLAIMER: The operator of this site (Vertical Financial Systems, Inc) are not registered investment advisers, broker/dealers, or research analysts/organizations. The content on this website is issued solely for information purposes and should not to be construed as an offer to buy, sell, or trade in any way, any security mentioned herein. All information presented on this website is believed to be reliable and written in good faith, but no representation or warranty, expressed or implied is made as to their accuracy, completeness or correctness. You are responsible for doing your own research before investing in any securities mentioned herein. Readers are urged to consult with their own independent financial advisors with respect to any investment. Neither Vertical Financial Systems, Inc, nor its officers or employees accept any liability whatsoever for any direct or consequential loss arising from any use of information on this website.
Full Disclosure: As an Amazon Associate I earn from qualifying purchases
Powered by WordPress | theme SG Simple