solarianprogrammer.com Open in urlscan Pro
167.71.102.108  Public Scan

Submitted URL: http://solarianprogrammer.com/
Effective URL: https://solarianprogrammer.com/
Submission Tags: tranco_l324
Submission: On May 27 via api from DE — Scanned from DE

Form analysis 6 forms found in the DOM

<form class="row"></form>

<form class="row"></form>

<form class="row">&nbsp;</form>

<form class="row">&nbsp;</form>

<form class="row"></form>

<form class="row"></form>

Text Content

SOLARIAN PROGRAMMER

MY PROGRAMMING RAMBLINGS



Home Archives Contact Privacy


INSTALL PYTHON WITH NUMPY SCIPY MATPLOTLIB ON MACOS BIG SUR (APPLE SILICON ARM64
VERSION)


POSTED ON JUNE 15, 2021 BY PAUL

In this article, I will show you how to install Python with NumPy, SciPy and
Matplotlib on macOS Big Sur. I will show you how to install natively the above
three libraries, using arm64 Apple Silicon versions. I assume that you have one
of the M1 or newer arm64 processors. If you have an Intel based Mac, please
check my other article.

MacOS Big Sur comes by default with Python 2.7 which, at this point, receives
only bug fixes and is EOL since 2020. Python 3 is the future and it is supported
by all major Python libraries. In this tutorial, we’ll use Python 3.9 which is
the latest stable release of Python at the time of this writing.

Start by installing the Command Line Tools for macOS. Please note, that you will
need the Command Line Tools even if you’ve already installed Xcode. Open a
Terminal and write:

1 xcode-select --install

►  Continue reading

--------------------------------------------------------------------------------


GETTING STARTED WITH CLANG AND VISUAL STUDIO CODE ON WINDOWS WITH MSYS2 AND
MINGW-W64


POSTED ON JUNE 11, 2021 BY PAUL

This is a short introduction in getting started with Clang on Windows 10 under
MSYS2 and MinGW-w64. The Clang and LLVM binaries from https://llvm.org/ require
that you to have Visual Studio 2019 installed on your machine, MSYS2 is a
lighter alternative. In the last part of this article, I will show you how to
use VS Code to build and debug a simple C++ program.

This article is split into three parts:

 * Install MSYS2, Clang and GDB
 * Compile and debug a simple C++ program from the MSYS2 terminal
 * Compile and debug a simple C++ program from VS Code

►  Continue reading

--------------------------------------------------------------------------------


ENABLE OPENSSH SERVER ON WINDOWS 10


POSTED ON OCTOBER 27, 2020 BY PAUL

In this article, I will show you how to enable the OpenSSH server on Windows 10
and how to connect through ssh to a Windows 10 machine.

By default, recent versions of Windows 10 have an OpenSSH client already
installed, this means that you can use a Windows 10 machine to connect through
ssh to other machines, typically Linux servers, that have an ssh server enabled.
How about when you want to be able to connect through ssh to another Windows
computer ?

►  Continue reading

--------------------------------------------------------------------------------


USING THE VISUAL STUDIO DEVELOPER COMMAND PROMPT FROM THE WINDOWS TERMINAL


POSTED ON OCTOBER 25, 2020 BY PAUL

In this article, I will show you how to use the Visual Studio command line
compiler from the Windows Terminal. I will assume that you’ve already installed
Visual Studio 2019 on your machine. In my case, I have installed the Community
edition with the Desktop development with C++ workload. By default, the
installer will create a few links for using the development tools from the
classical Windows Command Prompt and we are going to copy some settings from
this to the Windows Terminal. My second assumption is that you’ve also installed
the Windows Terminal, if this is not the case just open Microsoft Store, search
for Windows Terminal and install it.

If you’ve ever played with Windows Terminal you already know why it is nicer to
use than the classical Command Prompt, a few examples: tabs, vertical and
horizontal splits, a resizable window, zoom in and out, proper copy paste to and
from the Terminal, background colors and a lot of other possible customizations.

►  Continue reading

--------------------------------------------------------------------------------


GETTING STARTED WITH C++ MATHGL ON WINDOWS AND LINUX


POSTED ON JUNE 25, 2020 BY PAUL

In this article, I will show you how to install and get started with the C++
interface of MathGL on Linux and Windows. MathGL is a high quality scientific
graphics library.

In the first two parts of the article I will describe how to install the library
and how to build a C++ MathGL example. In the third part of the article we’ll
use MathGL to create a 2D function graphic and save it as an image file. As a
second example, we’ll use the FLTK GUI library to show the same 2D function:



This article is split in three parts:

 * Install MathGL on Windows
 * Install MathGL on Linux
 * C++ MathGL usage example

I recommend that you read the install part for your OS and the part that shows
how to use MathGL to create some graphics.

►  Continue reading

--------------------------------------------------------------------------------


GETTING STARTED WITH GSL - GNU SCIENTIFIC LIBRARY ON WINDOWS, MACOS AND LINUX


POSTED ON JANUARY 26, 2020 BY PAUL

In this article, I will show you how to install GSL - the GNU Scientific Library
on Windows, macOS and Linux, and how to compile and run a simple GSL program.
GSL is a C library for numerical computations. You can use GSL for example to
solve a linear system of equations, to fit a curve to a set of points, for
numerical integration, statistical calculations and so on. You can find a
detailed description of GSL capabilities in the GSL reference manual.

This article is split in a few parts:

 * Install GSL on Windows
 * Install GSL on macOS
 * Install GSL on Linux
 * GSL usage example - solving a linear system of equations
 * Create a C++ GSL CMake based project

I recommend that you read the install part for your OS and the part that shows
how to use GSL to solve a linear system of equations.

►  Continue reading

--------------------------------------------------------------------------------


INSTALL CODE::BLOCKS AND GCC 9 ON WINDOWS - BUILD C, C++ AND FORTRAN PROGRAMS


POSTED ON NOVEMBER 16, 2019 BY PAUL

In this article I will show you how to install the Code::Blocks IDE on Windows
and how to configure it to use GCC 9 for building C, C++ and Fortran programs.
The advantage of this setup is that you will be able to compile any standard
C99, C11, C++11, C++14, C++17 and Fortran program on your Windows machine.
Please note, that Code::Blocks is available in two versions: as a standalone
IDE, as an IDE and an outdated version of GCC (5.1.0). I will show you how to
use the latest version of GCC, which is 9.2 at the time of this writing, with
the Code::Blocks IDE.

I recommend that you start by installing the latest version of GCC, by following
my previous article, in which I’ve shown how to install GCC 9.2 with the MSYS2
software distribution. Once you have GCC installed, you can proceed with
installing Code::Blocks.

There is also a video version of this tutorial:



The article consists of five parts:

 * Install the Code::Blocks IDE
 * Configure Code::Blocks for building C and C++ programs
 * Building a C++ project with Code::Blocks
 * Configure Code::Blocks for building Fortran programs
 * Building a Fortran project with Code::Blocks

►  Continue reading

--------------------------------------------------------------------------------


C++ IMPLEMENTING A CHAOS GAME SIMULATOR


POSTED ON NOVEMBER 13, 2019 BY PAUL

In this article, I will show how to implement in C++ the classical Chaos Game.
We start with a regular polygon and a random initial point inside the polygon.
Next, we randomly select one of the polygon vertices and add a new point at a
fraction of the distance between the initial point and the polygon vertex. We
take as initial point the newly generated point and iterate for a large number
of steps. Following the above process can, in some cases, produce a fractal
shape.

In the next image you can see various fractal shapes generated with the program
we are going to write in this post:



►  Continue reading

--------------------------------------------------------------------------------


INSTALL GCC 9 ON WINDOWS - BUILD C, C++ AND FORTRAN PROGRAMS


POSTED ON NOVEMBER 5, 2019 BY PAUL

In this article, I will show you how the install the GCC compilers on your
Windows system using the MSYS2 software distribution.

The advantage of this setup is that you will be able to build C, C++ and Fortran
programs on your Windows machine and generate native Windows executables. Also,
MSYS2 tends to offer the latest stable versions of GCC, which at the time of
this writing is 9.2.

There is also a video version of this tutorial:



Another advantage of using the MSYS2 software distribution is that you will be
able to install, if necessary, other C and C++ libraries like SDL2 or OpenCV
using the pacman package manager which is included with MSYS2.

Please note that all graphical libraries provided by MSYS2 use the native Win32
API. This means that when you build for example an OpenGL application it will
use a native Windows Win32 window.

►  Continue reading

--------------------------------------------------------------------------------


C++20 SPAN TUTORIAL


POSTED ON NOVEMBER 3, 2019 BY PAUL

According to the latest C++20 draft, a span is a non-owning view over a
contiguous sequence of objects. In other words, a std::span is, in essence, a
pointer, length pair that gives the user a view into a contiguous sequence of
elements. The elements of a span can be, for example, stored in one of the
standard library sequential containers (like std::array, std::vector), in a
built-in C-style array or in a memory buffer.

Here is a simple example of using std::span as a general interface for a print
function that receives as argument a contiguous sequence of integers:

 1 // span_0.cpp
 2 #include <iostream>
 3 #include <vector>
 4 #include <array>
 5 #include <span>
 6 
 7 void print_content(std::span<int> container) {
 8     for(const auto &e : container) {
 9         std::cout << e << ' ';
10     }
11     std::cout << '\n';
12 }
13 
14 int main() {
15     int a[]{23, 45, 67, 89};
16     print_content(a);
17 
18     std::vector v{1, 2, 3, 4, 5};
19     print_content(v);
20 
21     std::array a2{-14, 55, 24, 67};
22     print_content(a2);
23 }

►  Continue reading

--------------------------------------------------------------------------------


A HAPPY HALLOWEEN FROM C++ AND AN IIFE LAMBDA


POSTED ON OCTOBER 31, 2019 BY PAUL

Happy Halloween, from C++:

 1 // halloween.cpp
 2 #include <iostream>
 3 
 4 const auto dummy1 = [] {
 5     std::cout << "Hold my beer!\n";
 6     return 1;
 7 }();
 8 
 9 const auto dummy2 = [] {
10     std::cout << "Hold my second beer!\n";
11     return 2;
12 }();
13 
14 
15 int main() {
16     std::cout << "C++: Happy Halloween, your program starts here!\n";
17 }

Using an IIFE, or an “Immediately invoked function expression”, lambda to
initialize a global variable can have surprising side effects:

►  Continue reading

--------------------------------------------------------------------------------


C++17 - FIND THE GREATEST COMMON DIVISOR, GCD, OF TWO OR MORE INTEGERS


POSTED ON OCTOBER 25, 2019 BY PAUL

In this article, I will show you how to find the gcd - greatest common divisor
of two or more integers with C++, by using two implementations of the classical
Euclid algorithm. As a side note, the C++ standard library has a std::gcd
function that can calculate the gcd of two numbers and I will also show you how
to use the STL version. Implementing an algorithm from scratch is the best way
to understand it, even though in practice one should use as much as possible the
solution already provided by the language standard library.

There is also a video version of this tutorial:



By definition, the gcd of two or more integers, that are not all zero, is the
largest positive integer that divides all these numbers. For example:

gcd(9, 15) = 3
gcd(9, 15, 21) = 3
gcd(0, 10) = 10

It is also useful to define:

gcd(0, 0) = 0.

►  Continue reading

--------------------------------------------------------------------------------


INSTALL OPENCV 4 WITH PYTHON 3 ON MACOS CATALINA


POSTED ON OCTOBER 21, 2019 BY PAUL

Updated 11 February 2020

In this article, I will show you how to install OpenCV 4 with Python 3 on macOS
Catalina.

There is also a video version of this tutorial:



MacOS comes by default with Python 2.7 which, at this point, receives only bug
fixes and will be EOL by 2020. Python 3.x is the future and it is supported by
all major Python libraries. In this tutorial, we’ll use the Python 3.8.

Start by installing the Command Line Tools for macOS. Please note, that you will
need the Command Line Tools even if you’ve already installed Xcode. Open a
Terminal and write:

1 xcode-select --install

Once the Command Line Tools are installed, we can install Python.

►  Continue reading

--------------------------------------------------------------------------------


COMPILING GCC 10 ON MACOS CATALINA


POSTED ON OCTOBER 12, 2019 BY PAUL

Updated 8 May 2020

In this tutorial, I will show you how to compile from source and install the
current stable version of GCC on your macOS computer. The instructions from this
tutorial were tested on Catalina (macOS 10.15).

Clang, the default compiler for macOS, supports only C, C++, Objective-C and
Objective-C++. If you are interested in a modern Fortran compiler, e.g. you will
need gfortran that comes with GCC. Another reason to have the latest stable
version of GCC on your macOS is that it provides you with an alternative C and
C++ compiler. Testing your code with two different compilers is always a good
idea.

Building GCC 10 from sources could take some time, in my case it took about two
hours on a MacBook Air with a 16GB of RAM.

►  Continue reading

--------------------------------------------------------------------------------


INSTALL OPENCV 4 ON RASPBERRY PI FOR C++ AND PYTHON DEVELOPMENT


POSTED ON SEPTEMBER 17, 2019 BY PAUL

In this article, I will show you how to install OpenCV 4 with Python and C++
support on Raspberry Pi. I assume that you have the latest Raspbian installed on
your Raspberry Pi, which at the time of this writing is based on Debian 10
Buster.

Unfortunately, there is no official binary of OpenCV 4 for Raspberry Pi, so I
had to built OpenCV with Python 2 and 3 support for Raspberry Pi Zero and up
from sources. If you want to do the build yourself check my previous articles:

 * Cross compiling OpenCV 4 for Raspberry Pi and BeagleBone Black.

 * Cross compiling OpenCV 4 for Raspberry Pi Zero.

In this article I’ll will show you how to install the already built binaries.

There is also a video version of this tutorial:



►  Continue reading

--------------------------------------------------------------------------------

Older posts →
 

Categories

C# Charts C++11 Regex Scheme Multithreading Posix Books C++ C++14 C++17 OSX
Python Objective-C Windows Clang Fortran CUDA Roguelike Perlin Cling C++20 Linux
WSL Fractals OpenGL JavaScript OpenCV BeagleBone Productivity Raspberry Pi
OpenMP iOS Node.js macOS NumPy SciPy Matplotlib GCC Swift C C99 C11 Arduino
Videos Armadillo Chromebook ChromeOS Docker x86-64 F# dotnet C17 Lisp Apple
Silicon arm64
 



Recent posts

 * Install Python with NumPy SciPy Matplotlib on macOS Big Sur (Apple Silicon
   arm64 version)
 * Getting Started with Clang and Visual Studio Code on Windows with MSYS2 and
   MinGW-w64
 * Enable OpenSSH server on Windows 10
 * Using the Visual Studio Developer Command Prompt from the Windows Terminal
 * Getting started with C++ MathGL on Windows and Linux
 * Getting started with GSL - GNU Scientific Library on Windows, macOS and Linux
 * Install Code::Blocks and GCC 9 on Windows - Build C, C++ and Fortran programs
 * C++ Implementing a Chaos Game simulator
 * Install GCC 9 on Windows - Build C, C++ and Fortran programs
 * C++20 span tutorial




Disclaimer:
All data and information provided on this site is for informational purposes
only. solarianprogrammer.com makes no representations as to accuracy,
completeness, currentness, suitability, or validity of any information on this
site and will not be liable for any errors, omissions, or delays in this
information or any losses, injuries, or damages arising from its display or use.
All information is provided on an as-is basis. solarianprogrammer.com does not
collect any personal information about its visitors except that which they
provide voluntarily when leaving comments. This information will never be
disclosed to any third party for any purpose. Some of the links contained within
this site have my referral id, which provides me with a small commission for
each sale. Thank you for understanding.

Copyright © 2023 - Paul Silisteanu