In this post I touch briefly on types of number literals in C# programming language.
An illustration is
var f = 0f; // float
var d = 0d; // double
var m = 0m; // decimal (money)
var u = 0u; // unsigned int
var l = 0l; // long
var ul = 0ul; // unsigned long
For example, this menas if you see a number with “m” suffix, it is a decimal literal.
That’s all for now. Till next time, happy software development.
In this post, we talk about how to assign data to properties when instantiating an object in c#.
Suppose you have a class like
public class Album
{
public string Name {get; set;}
public string Artist {get; set;}
public int Year {get; set;}
public Album()
{ }
public Album(string name, string artist, int year)
{
this.Name = name;
this.Artist = artist;
this.Year = year;
}
}
You can create an instance of Album class either via the constructor e.g.
var albumData = new Album("Albumius")
{
Artist = "Artistus",
Year = 2013
};
After compilation, this is similar to the following:
var albumData = new Album("Albumius");
albumData.Artist = "Artistus";
albumData.Year = 2013;
That’s all for now. Till next time, happy software development.
References
C# : assign data to properties via constructor vs. instantiating. stackoverflow. https://stackoverflow.com/questions/19138195/c-sharp-assign-data-to-properties-via-constructor-vs-instantiating
In this post I go over how to convert a .mov file to a .mp4 file using the terminal. Why should you know this skill? Well, you may have recorded a video using an iPhone. Usually these videos are formatted as .mov files. Let’s imagine you need to convert this to mp4 for whatever reason, how do you go about it?
If you have ffmpeg installed, you can use it for the conversion via the terminal. The command to run looks like:
In this short post I talk about how to write verbatim string literals in C#. You write this by using using the @ keyword just before the string. What does a verbatim string literal mean? It means that the characters in it will be interpreted verbatim. This means that escape sequences such as \ \ for backslash, hexadecimal escape sequences such as \x0041 for uppercase A, and Unicode sequences such as \u0041 for uppercase A, are interpreted literally. To demonstrate this, consider that the following two strings are equivalent.
In this short post we talk about how to work around an error I got when trying to build a Kotlin project. The error looks like:
java.lang.reflect.InaccessibleObjectException: Unable to make field private static final java.lang.ProcessEnivironment java.lang.ProcessEnvironment.theEnvironment accessible: module java.lang.base does not “opens java.lang” to unnamed module
After some research, I found a way to build the project. The workaround is as follows:
In this post I will talk about an easy way to type in Yoruba on a Mac. The little challenge with typing Yoruba properly with a standard keyboard is that it takes some effort to add diacritics, which are various dots and squiggles that appear on certain Yoruba alphabets. One solution to writing Yoruba easily is to use the Yoruba keyboard layout talked about on the Manemo Matemu website.
Once you install the layout in your Library/Keyboard Layouts folder, you can then select the layout as your keyboard input source.
Then you can type Yoruba as follows:
All the keys remain the same as on the regular U.S. keyboard
To add a dot under e, s, and o: ALT + letter (eg ALT + o to type ọ).
Capital s, e or o with dot: SHIFT + ALT + letter
High tone (mi): ALT + h
Low tone (do): ALT + l
That’s all for now. Till next time, happy Yoruba writing.
Tonic sol-fa is a tool for teaching sight singing, invented boy Sarah Ann Glover.
It is based on movable do solfège.
You use it to learn the notes of the major scale, which is one of the most commonly used music scales, especially in Western music.
There are 7 notes in the major scale in the key of C. C major scale is the easiet scale to learn because it has all white keys.
The notes of the C major scale are C D E F G A and B.
The names we give to these keys in tonic sol-fa are:
do re mi fa sol la and ti
or in shorter form we call them:
d r m f s l t
To remember these you can use the song Do-Re-mi
It goes as follows:
Doe – a dear, a female dear (do)
Ray – a drop of golden sun (re)
Me – a name I call myself (mi)
Far – a long long way to run (fa)
Sew – a needle pulling thread (sol)
La – a note to follow so (la)
Tea – a drink with jam and bread (ti)
and that brings us back to to Doe.
See Do-Re-Mi video below:
The solfège syllables for all notes of the scale are shown below:
Major scale degree
Mova. do solfège syllable
# of half steps from Do
Trad. pron.
1
Do
0
/doʊ/
Raised 1
Di
1
/diː/
Lowered 2
Ra
1
/ɹɑː/
2
Re
2
/ɹeɪ/
Raised 2
Ri
3
/ɹiː/
Lowered 3
Me (& Ma)
3
/meɪ/ (/mɑː/)
3
Mi
4
/miː/
4
Fa
5
/fɑː/
Raised 4
Fi
6
/fiː/
Lowered 5
Se
6
/seɪ/
5
Sol
7
/soʊ/
Raised 5
Si
8
/siː/
Lowered 6
Le (& Lo)
8
/leɪ/ (/loʊ/)
6
La
9
/lɑː/
Raised 6
Li
10
/liː/
Lowered 7
Te (& Ta)
10
/teɪ/ (/tɑː/)
7
Ti
11
/tiː/
That’s all for now. Till next time, happy music learning.
Here’s another article on relationships. Again I’ll follow up on my previous article on choice of spouse.
The new point to add here is that you must not take things at the surface when choosing a spouse, rather you must pay close attention to all factors you cosider important in a potential spouse, and seek and apply wisdom from God and from people who have more experience than you.
You must not overemphasize one factor to the detriment of other important factors when picking a spouse.
For example, one may you may be looking for a husband or wife who is caring, responsible etc. i.e. you’re interested in the behaviour of the person. That’s fine. But you must not ignore the person’s background. This is important because the behaviour that a person exhibits during courtship may or may not be their real behaviour.
If you want to know a person’s real behaviour, yes, it’s important to observe how they act towards you, but you must also consider the family the person grew up in. How do people in the person’s family behave? Also, you must consider the behaviour of the friends the person mingles with. This is how you would really know if a person’s beviour is likely to be their real behaviour, or an act.
As a Christian, I also believe it’s imprtant to put one’s endeavours in God’s hands, including choosing a spouse, for only God can give the grace to make good decisions.