Category: Notes

Notes are mini-posts

Updated, how I track designs

Updated, how I track designs

Dendron logoBack in August I mentioned WikidPad which I had been using for ideas, design notes etc.

Recently though while waiting to get my Windows PC sorted, I’ve been doing nearly everything on an old laptop that I’ve repurposed by installing Ubuntu. All blogs since March 6th have been done on this laptop.

Today I came across Dendron which is a markdown editor (on steroids!) that runs in VS Code. Anyone who reads this blog knows that I’m a big fan of VS Code so it’s a no-brainer to combine the two.

Markdown is a way of annotating text for example *this phrase* will appear in italics. Dendron lets your have a split view so you type in the markdown text on the left and the page appears on the right.

The idea is that you create your document out of lots of pages, that are hyper linked. Dendron makes it easy to create pages and link them. Markdown is used to add formatting. WikidPad used a similar scheme but it was a Windows application holding pages in a SQLite database not an extension to VS Code as Dendron is that holds pages as individual text files.

Dendron appears a lot more powerful so I will be getting to grips with it. It’s a handy way of designing and documenting a design.

 

 

Interesting notes on C

Interesting notes on C

Notes
Image by David Schwarzenberg from Pixabay

If you are learning C there are a number of points that may not be mentioned and possibly aren’t obvious. For instance with multidimension arrays. “The array size can be derived from its initialization but that’s applicable for first dimension only. For example, ‘int arr[][2] = {1,2,3,4}’ is valid but ‘int arr[2][] = {1,2,3,4}’ is not valid.” and “Unlike ‘long long int’, there’s nothing like ‘long long double’ in C. Besides, real data types (i.e. floatdoublelong double) can’t be unsigned.”

These and a whole lot more notes can be found here. It’s definitely worth a read. The only thought I had that was worthwhile is to do with the order of execution in a for statement.

The definition is in this order: for (initialisation, end test, alter loop variable ) statement;  but the actual order of execution is initialisation; statement; alter loop variable; end test.

A blog post worth reading

A blog post worth reading

Letter C
Image by Clker-Free-Vector-Images from Pixabay

A developer called Jakub “Jorengarenar” Łukasiewicz has posted a blog entry Best aspects of C language and I’m more than happy to link to it. It says much of what I think about C but expressed very nicely and its well worth the read.

In his post he refers to a document Rationale for International Standard Programming Languages C (PDF).  This is a 2003 document (C doesn’t change very often)  and not exactly a light read at a trifle over 200 pages long. It’s an insight and commentary into what C99 is about and also lists these five principles:

  • Trust the programmer.
  • Don’t prevent the programmer from doing what needs to be done.
  • Keep the language small and simple.
  • Provide only one way to do an operation.
  • Make it fast, even if it is not guaranteed to be portable.

If you are learning C this will provide you with explanations of why some things in C99 are what thy are. Like myself you will discover things that you didn’t know. For instance I didn’t know about long double. Or that in K & R C(Kernighan and Ritchie) that all floating point arithmetic was done at double precision but that was relaxed in C89.

 

Benchmarking my Raspberry Pi

Benchmarking my Raspberry Pi

hardinfo running on Raspberry PiI played with a couple of free packages today. I can recommend hardinfo. (sudo apt install hardinfo to install then hardinfo to run ) though less about the benchmarks than the information it gives on your system.

I’ve got both 32-bit Raspbian and 64-bit Raspberry Pi OS on two sd cards and intend to run both and compare benchmarks just to see the difference.

Another benchmark utility that looks interesting is sysbench (sudo apt install sysbench to install). It runs from the terminal and lets you run benchmarks against file io, cpu, memory threads, mutex and oltp.  Just type sysbench and you’ll get a list of commands.