Categories
Music Live in London

New Music

I saw The Molotovs on Friday. The promoter (Lost Kitten Music) said it may be the last chance to see them in a small venue. I met them on Thursday at a gig by Blousy, who were an excellent surprise. Two of The Molotovs dressed to the nines; it was a small club in Soho and it could have been Carnaby Street in the 60s. Here’s one clip

I have no idea if this gig was typical but I loved every second of it.

I usually go to Other Side Promotions events. It’s mostly psyche and Elios and Terry have good taste. I saw Daiistar, from Austin, Texas, a couple of weeks ago. They’re on Fuzz Club. Rolling Stone magazine said that’s the best label in the world at the moment. They’ve got a good roster – my current favs Helicon and back where it started, The Jesus and Mary Chain.

Mentioning JAMC, the drummer is Justin Welch, who also plays drums in Aircooled. No surprise Aircooled supported JAMC at the Roundhouse on Good Friday. Oliver Cherer may be the front man for Aircooled (or it might be Riz Maslen). Olie plays bass in The Miki Berenyi Trio. They managed to release one track so far “Vertigo”

Emma Anderson, on the other hand, doesn’t play live but has an album called Pearlies. It stopped me dead by the time I got to track 3.

Shoegaze has a new lease of life, and seemingly and million subtribes. Keeley is my top pick among the new dreampop. (see my YouTube channel).

It’s kinda like there are lots of ‘old’ bands playing again – Slowdive, Sisters of Mercy, JAMC, Kristen Hersh, Telescopes, The Darling Buds…. Things I loved in the 80s are back, and they’re even better. And then there new bands and i’m just going to list whatever comes to mind

Black Doldrums, Pet Sematary, Helicon, Mary Anne’s Polar Rig, Daiistar, Hex Poseur, Pretty Addicted, Black Helium, Heales, Jorinde, Agathe Max, Maud Anyways, Bugeye, Madame Mutante, Marlene Ribeiro, Flowers Must Die, Sons of Vilijems, Alter Moderns, Ghost Patterns.

Beneath Eden deserve a special mention because the guitarist was the fastest and most accurate I’ve seen so far. Many of these bands have played and I’ve captured something and it’s my YouTube.

Categories
Music Live in London

My weekly rant

Heather Mccormick posted a beautiful picture with the legend “Stop imaging the apocalypse; start imaging the revolution”. I’ve been watching @DamiLeeArch. She introduced me to the term “Solarpunk”. Cyberpunk imagines technology creating a dystopian future. I might love the art but it’s not a world I want to live in. I replied “Solarpunk not cyberpunk”.

I write software. Architecture is a term used in computing to describe the structure of the programs. The design reference was called Design Patterns. It’s a collect of common design idioms. It’s modelled on a collection of architectural patterns from the 1950’s.

Many of these design patterns have been obsoleted by improvements in the languages. My main language is C++ and there’s huge difference between the current standard (2023) and when the design bible was published (1995). This is crux of my rant; Biden’s Whitehouse said don’t use C++. The NSA says it’s inherently insecure. This is just wrong. Here’s Bjarne Stroustrup explaining why.

And my life is only bearable (cyberpunk, outdated knowledge, people in authority talking about thing they don’t know, the oncoming apocalypse in climate, war, ecomics, etc) with music. Here’s Aircooled supporting The Jesus and Mary Chain at The Roundhouse, Camden. I bought a ticket for Saturday but I saw they were playing on Friday, so I bought another ticket. I’ll see JAMC twice ‘cos I’ve loved them for 30+ years.

Categories
Music Live in London

I need better equipment

I saw Freya Beer again last night. The bass was so high up in the mix you felt it in your bones. I got Write Her Off on my crappy camera phone. Compare that with same song a couple of weeks ago in Camberwell.

The low-end in non-existent in this video from last night. And the auto-focus is silly.

They were supporting Black Dolldrums but I didn’t capture any video. Here’s Sad Paradise from last year at The Black Prince, Northampton. That was the first time I stayed overnight for a band and I really like the atmosphere there.

Categories
Linear Maths in C++

..and this happened

At the end of October I got to see my friend Andrea Giommi play with his band The Glass Key. I didn’t know much about anything – the venue, the artists or the main band. They opened OSPs Psyche Festival at The Victoria, Dalston a few weeks earlier. I got there a bit a late and missed then, so I was glad to have to opportunity to see them.

Even more striking was Agathe Max on violin. I got to see her with her band Custy Gamut (Track 1 andTrack 2). She was on Radio 3’s Late Junction on International Women’s Day.

The main band was World Sanguine Report. That’s Andrew Plummer on guitar and vocals and Ruth Goller on bass. Ruth’s solo album Skylluminia get’s a 4-star review in The Guardian.

Andrea plays at Two Palms, Hackney tomorrow (14th Mar) with his band Sons of Viljems. Tickets on DICE to make things easy.

Categories
Music Live in London

Only music can save me now

Apparently everyone respects my C++ skills, but I’m so bored with it. I wanna be a rock-star. If I don’t get to see a live band often, I get miserable, especially in the winter. This week I saw three cracking acts.

On Thursday 7th March Mango In Euphoria played at the Dublin Castle, Camden. The first song is a little unsure, but I’m not sure if that’s her or us, the audience. By the time she gets to Can’t Be Cured, we’re loving it. I want to dance but I want to get another song of hers. I didn’t know what the third song is but the audience are now eating out her hand. Every is clapping along as instructed (except me, filming).

Friday 8th March I went the awesome Night Owl in Finsbury Park. The headliners JE T’AIME were bill as “Parisian post-punk cold wave hybrid”. For an all-male band they had some great tunes and sensitivity. I captured two of their songsThey were supported by PALINDRONES – “Electronic duo mixing pounding beats and blistering synth drones”. They got me dancing (when I wasn’t filming).

I had to go out and missed Agathe Max on Radio 3’s Late Junction. That programme is on the BBC Sounds app for 28 day only. I have seen Agathe Max perform before.

I keep saying I’ll perform on guitar soon. I’m going to gigs recently just watching the guitar player for all I can steal, er, I mean take and learn from. More shows next week.

Categories
Linear Maths in C++

Building for Linux from Windows

I have been a fan of Linux for a very long time. Windows was always been dated, so that you knew when you had to upgrade. That certainty breaks down with Windows 10 continual updates. There’s a Microsoft Reactor session later called “Commercial Marketplace Roadmap”. The latest upgrade gave us WSL2, that supports graphics in Linux. As a commercial programmer I was struggling with modern Windows GUIs. MFC is really old, WPF only runs in .NET, and Qt can only build UWP apps. I’m looking for something else.

I’m getting ahead of myself. Visual Studio 2017 (still dated!) added cross-platform development. The outline is to connect to a remote system using the secure shell (ssh). That remote system provides build and debug facilities. Rather than repeating it, the Microsoft blog describes Linux development.

Having installed as per instructions and restarted, under the menu “File->New->Project, there are Linux options. The most basic is “Console Application (Linux)”. This generates a “main” that looks like this

int main()
{
    printf("hello from ConsoleAppLinux!\n");
    return 0;
}

It might not look like much but it’s quite powerful. Building sends the code to the remote machine and compiles natively. I’m using WSL so I had to install g++ and gdb. Secure shell connection is managed in Visual Studio from Tools->Options and then “Cross Platform”->”Connection Manager.

Vanilla-flavoured Unix, as my professor called it, is not very interesting. WSL2 needs a major Windows update but will allow graphics. Another option under new project is for Raspberry Pi. The generated project “main” is

int main(void)
{
	wiringPiSetupSys();
	pinMode(LED, OUTPUT);

	while (true)
	{
		digitalWrite(LED, HIGH);  // On
		delay(500); // ms
		digitalWrite(LED, LOW);	  // Off
		delay(500);
	}
	return 0;
}

As you can it’s just normal code. The function calls are to a library that mimics Arduino GPIO.

Another development option to investigate is Native Android development. Google have an NDK and Android Studio has a C++ new project template.

Categories
Linear Maths in C++

Polymorphic operators

Some time ago the C++ bool operator==(Class c) returned the wrong result for some comparisons. We couldn’t see why looking at the code and to hit the deadline, we made work-around and ignored it. This happens at work but it stayed with me, and many years later a CppCon video explained that as a class member, the argument is the same type or can be coerced to that type. If coercion fails, the function fails.

The safe solution is to put the operator== outside the class. The function then takes two args, and can be a friend if you need access to private data. So I put my Matrix operators as functions in the LinearMath namespace.

Modern C++ allows us to make the coercion explicit. Is this enough to protect against spurious calls ? That experience with a failing comparison operator was not replicated.

Categories
Linear Maths in C++

Matrices

Stroud Chapter 4 is Determinants. Chapter 5 is on Matrices. Chapter 4 only really deals with 2 x 2 and 3 x 3 matrices. This is a little taster for eigenvalues of larger matrices. First, Chapter 5 tells us how to add, subtract, multiply and divide matrices. We can apply these operations with a scalar – in that case, every element does the operation with the scalar. As a example, multiplying a 2 x 2 matrix by 5 is simply M0,0 x 5, M0,1 x 5, M0,1 x 5 and M1,1 x 5 .

Operations with 2 matrices takes row-wise from the left and column-wise from the right. This means the two matrices must have the right number of elements. This is property is called compliant.

So I ask myself what type is my matrix ? It could be anything, and that in C++ and Java means a template. Disregarding best advice and best practice, I wrote 2 x 2 and 3 x 3 determinants as templated functions. They were so simple I can write a unit test later. I carried on and wrote a templated Matrix class. A C++ class has a header file defining the class and implementation in the cpp file. Now this compiles I can write unit tests. My unit tests fail on linking.

The take-away here is that template functions and classes are not regular code. They are instructions on how to produce code, or meta-code. There is another style of programming called template meta-programming. Simply put, the template is instantiated at compile time. You can do real computing in the compiler, sometimes called static programming.

I moved my template code into inline (.inl) files. These are #included like header files. There were a few other tweaks to get the types to match exactly. The unit tests all execute.

The Git Hub content is still wrong but I loaded the code into a local Git repository. I have effective change control locally. I need to move my local repository to the Web Git Hub repo. TO DO.

Categories
Linear Maths in C++

Software Engineering

When you only have a hammer everything looks like a nail. We need the right tools for the job. In some contexts this is referred to as a tool-chain. For my Windows laptop, I’m using Visual Studio Community Edition 2017. To look after my code I have a local Git repository. VS has a nice integration with Git, explain by Benjamin Perkin’s blog.

I also created Unit Tests. There’s loads of stuff on YouTube about Test Driven Development. I generally try to write the tests first. Kent Beck almost invented TDD. His book Test Driven Development by Example is a great read. He is quite pragmatic. When you don’t know, take small steps. When you’re more certain, you can take big steps.

Now I have to be honest and admit it’s gone wrong. Before I described Complex Numbers. I was feeling really confident so I wrote code and tests for a templated matrix. The Unit Test is not instantiating the template when it builds the test DLL. I haven’t set up Git Hub properly, hence I’m doing it locally first before it goes on the interweb.

It’s the second week of Corona Virus emergency. Life is up-ended. I’m lacking a UML design tool, maybe Star UML (cloud storage). IBM offers Rhapsody (not used it). I have used Microsoft Visio. It looks like a cloud-based freebie or a cash investment in the future.

Categories
Linear Maths in C++

Complex Numbers

eπi+1 = 0

Euler’s identity was the first beautiful piece of maths. The short YouTube video made it really clear.

The i symbol is the square root of -1. There is no rational number that when multiplied by itself is -1. So they made one up and called it i (or maybe j).

Arithmetic

Solutions to quadratic equations might lead to requesting the square root of -1. So now we have a value that has 2 parts – the real part and the imaginary part. Conventional maths applies. We can easily apply arithmetic operations with a scalar, it just applies to both part. Operation with complex numbers is

Addition
add real parts and add imaginary parts
Subtraction
subtract real parts and subtract imaginary parts
Multiplication
somewhat like multiplying out the bracket
Division
can’t be done directly, requires the complex conjugate

a+bj * c+dj = ac +adj +bjc + bdj2
but bdj2 would be -bd, so
a+bj * c+dj = ac – bd + (ad +bc)j

Division requires the complex conjugate. Suppose
a+bj is multiplied by a-bj, then the imaginary part goes away. To divide complex numbers, multiply top and bottom by the complex conjugate of the divisor (bottom) and the the operation is a simple scalar division.

Other forms

If we imagine the horizontal axis represents real numbers and vertical axis represents imaginary numbers, we can construct a triangle. One side is the real axis, another is imaginary axis and the hypotenuse runs from the origin to the (r, i) coordinates. An alternative representation is the length of the hypotenuse and the angle wrt to the data. This is called the polar form.

Code

In my GitHub there are 4 files

  • ComplexNumber.h
  • ComplexNumber.cpp
  • Angle.h
  • Angle.cpp

The conversion to polar form requires multiplication by sines and cosines. The standard library functions use radians rather than degrees. We understand 180° easier than π radians. The class Angle is supposed to convert between radians and degrees. It also provides arithmetic primitives. Full conversion include minutes and seconds is a TO DO.

Testing

I’m a big fan of Unit Testing. In fact, for the complex number class, I wrote those tests first. Conversion to polar form was failing because radians, with fractional parts were compared. These are not the values in Stroud’s book. After some time I realized the factional parts in Stroud’s value are minutes. This had a natural solution of the Angle class, again with it Unit test. I will add these Unit Tests to my Git Hub repository.