Sunday, January 31, 2021

C++ a modern programming language

I've been doing a lot of C/C++ development lately. There is ton of new stuff going on in C++ a good reference to what's going on is the https://isocpp.org/ site.

A few years back there were a lot of talks and articles in modern c++. The c++ core guideline is a good starter to get tips on how write code in a modern way i c++17.

Thursday, January 14, 2021

Writing a new chapter a work


It's been a while since the last post but today I start a new chapter in my working life. Changing my employer from Sogeti to Ecru Consulting Norr AB. A lot will be similar, I will continue on the same  customer assignment. But some things change, I will have more control over my assignments and work life balance. 
https://ecru.se/2021/01/14/ecru-norr-nytt-dotterbolag/

Saturday, April 06, 2019

Creating a new MVC web application with .Net Core CLI

Start a command prompt by searching for cmd in .


To check what version of .Net Core that is installed type:

dotnet --version

Make a root directory for your web application.

mkdir MvcWebApp
move into the folder.

cd  MvcWebApp


Create a mvc web application (this step can be changed to create a webapi or empty web application, see the full documentation here: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new?tabs=netcore2x)
dotnet new mvc
list the created files and folders.

dir
C:\temp\MvcWebApp>dir

Directory of C:\temp\MvcWebApp

<DIR>          .
<DIR>          ..
            36 .bowerrc
           178 appsettings.Development.json
           113 appsettings.json
           207 bower.json
           628 bundleconfig.json
<DIR>          Controllers
<DIR>          Models
           397 MvcWebApp.csproj
<DIR>          obj
           626 Program.cs
         1 428 Startup.cs
<DIR>          Views
<DIR>          wwwroot
8 File(s)          3 613 bytes
7 Dir(s)







ASP.Net Core and app.settings

Got a question from a colleague on how to handle different app.settings in ASP.Net core 1.1. When debugging in VS the command prompt shows that the ASP.Net Core web application is started in Development. So the question is how to use this to supply different app.settings on different environments.

A quick look in the documentation show that the recommended way to handle app.settings.json is by different files for different environments. 



Web front end - Angular 2

We are building an application in Angular 2. Writing down som findings to remember. The Angular CLI Command Line Interface that is used for scaffolding new projects and artefacts requires Node.js and NPM (Node Package Manager).

Installation

Node.js and NPM

Installation in Windows is made by downloading the latest installer from: https://nodejs.org/en/download/

Or installing with Chocolatey:
https://chocolatey.org/packages/nodejs

Angular CLI

Install by using NPM:
npm install -g angular-cli

https://github.com/angular/angular-cli#installation

Create a project

To create a new project:
ng new PROJECT_NAMEcd PROJECT_NAME
ng serve


https://github.com/angular/angular-cli#usage

ng new PROJECT_NAME creates the folder structure for the project and downloads the dependencies.
ng serve starts a web server with the project.



ng new TestProj




To be continued....

Saturday, September 19, 2015

Raspberry Pi 2 official touchscreen display

Installed the official touchscreen on one of my Raspberry Pi 2 devices.

It was a easy, I followed the guide Raspberry Pi Official DSI Display Assembly to install the hardware. After the hardware setup of the display I connected a USB cable for powering the Raspberry pi according to the guide in The eagerly awaited Raspberry pi display



Starting up the the device the display was working, but no touchscreen was enabled. To get the touchscreen to work I did the upgrade explained in the guide:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo reboot
After the update the display worked as expected.

Raspberry Pi 2 WiFi with WEP Open System

Tried to get the wifi going with the GUI in Raspbian but it would not start working.

Ended up googeling and found this forum post on the Raspberrypi forum. that explained how to correctly setup the file for WEP with open system:
network={
    ssid="myssid"
    key_mgmt=NONE
    wep_key0=mywepkey
    wep_tx_keyidx=0
}
Found an blogpost explaining how to edit the file:
$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf 
changed myssid to the my wifi network ssid and changed the mywebkey to the correct key.

did a reboot
$ sudo reboot
and now it works!


Monday, August 31, 2015

Solution to sound problem on HDMI TV after upgrade to Windows 10 on Surface Pro 3

Were having problem getting the sound from the Surface Pro 3 to my TV through HDMI. It worked before upgrading so Windows 10 had a different behavior. Found this http://answers.microsoft.com/en-us/surface/forum/surfpro3-surfusingwin10/no-hdmi-sound-after-upgrade-to-windows-10/45c740da-5326-48a1-9be5-1e84dca50ae8 on the internet, though it might be good to write down so I'll remember next time.

Right click on the speaker icon, on the task bar.
Choose Playback Devices.
Right Click the TV item in the list

Choose Properties
Click the "Advanced" tab in the dialog
change the default format for audio playback to a lower value.
 



Thursday, August 27, 2015

Hello World with Windows 10 Core IoT and Visual Studio 2015

Start by creating an Universal Application project in Visual Studio 2015:

Change the platform to ARM:

Change the target to Remote Machine (You have to set up your Raspberry Pi 2 unit with Windows 10 Core IoT before doing this):

Click on the minwinpc:

Choose to select:

It's possible to change size of  the mainPage.xaml:

Added a Hello world text block and run the application, On the TV connected to the Raspberry Pi 2. Tha application is started and shows "Hello World":

Wednesday, August 26, 2015

Solved: Error: this template attempted to load component assembly 'Microsoft.VisualStudio.Universal.TemplateWizards...

I got this error message:


when trying to create a Background Application (IoT) project in Visual Studio 2015:



When reading through the setup guide http://ms-iot.github.io/content/en-US/win10/SetupPCRPI.htm an extra time I found out that I've missed installing this when installing Visual Studio 2015:

The required version of Visual Studio Tools for Universal Windows Apps is 14.0.23121.00 D14OOB.

I click on the Templates | Visual C# | Windows | Universal
and from there I installed the templates and after that the error message when creating a background application disappeared.