All posts by Cale

NSIS INSTALL SYSTEM

#35 NSIS INSTALL SYSTEM

NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers. It is designed to be as small and flexible as possible and is therefore very suitable for internet distribution.

Being a user’s first experience with your product, a stable and reliable installer is an important component of successful software. With NSIS you can create such installers that are capable of doing everything that is needed to setup your software.

NSIS is script-based and allows you to create the logic to handle even the most complex installation tasks. Many plug-ins and scripts are already available: you can create web installers, communicate with Windows and other software components, install or update shared components and more.

Useful links can be found here

GETTING STARTED C++

#34 GETTING STARTED C++

Download visual studio 2019 from here. Once you have installed it be certain to install the C++ components. Once completed start visual studio and select the C++ console application option. Double click on the source files folder and then write your code.

Select The C++ Components

Here is a first C++ application example I have written. All it does is print the text Hello World and displayed some simple arithmetic in the cmd console.

#include <iostream>
#include <Windows.h>

int main()
{
    std::cout << "Hello World!\n";
    int x = 8;
    int y = 6;
    std::cout << std::endl;
    std::cout << x - y << " " << x* y << " " << x + y;
    std::cout << std::endl;

    Sleep(9000);
    return 0;
}
Useful links can be found here

A SHORT HISTORY OF C++

#33 A SHORT HISTORY OF C++

C++ was developed by Bjarne Stroustrup in 1979 it was designed to be an object-oriented language. C++ implements features such as inheritance, abstraction, polymorphism and encapsulation.

Bjarne Stroustrup

C++ is an intermediate-level programming language. It allows high-level and low-level programming. Although there’s a whole bunch of newer languages, C++ is still relevant where accurate control of application’s resource consumption and performance is needed. Before 1998 C++ was being accepted and adopted on so many different platforms that many interoperability problems and porting issues surfaced. Therefore in 1998 the first standard version of C++ was ratified by the ISO Committee in ISO/IEC 14882:1998

LIVE 2D EXAMPLE

#32 LIVE 2D EXAMPLE

Live2d

Live2D is also the name of an eponymous animation software series employing the technique and the software’ developer company, created by Japanese programmer Tetsuya Nakajo.

The software, and its underlying technique, enable users to animate their illustration by providing an illustration prepared in layered parts that constitute the original illustration, such as its eyes, mouth and arms, and stitch the parts on a skeleton to generate animation. The Live2D Ltd. provides the software and SDKs under commercial licenses and for free.

Live2D has been used in a wide variety of video games, visual novels, virtual YouTuber shows, and other software. Well known examples includes FaceRig, Nekopara, Azur Lane,and Tsukino Mito [ja], a virtual avatar and YouTube celebrity from Nijisanji [ja]’s facial motion capture app.

Live2d Example

SIM900 GSM MODULE TEXT

#30 SIM900 GSM MODULE TEXT

Hi all, recently  I was thinking about the AT command. What’s the AT command you might ask? well it’s an instruction sent to a cellular modem. for example: It’s an instruction which is sent from any suitable device (in this case and Arduino and a GSM module) to a phone/modem or GSM module. you can request something to be sent back to you or you can send something to another supporting device.

The abbreviation for ATtention is AT. each AT instruction starts with “AT” followed by the rest of the command. An easy example is:

“AT+CMGF?” AT=meaning that it’s an AT command, +=An extended command, CMGF= Select SMS message format, ?=Query character.

Ok enough of that lets get into the project.

The goal is to send a message from the Arduino+GSM module to a mobile cellphone. This can be quite useful.. since you can use this message as a “trigger”  for almost anything examples can be hooking up a relay to open your garage door or triggering a servo to open a lock.

you can even program the Arduino to receive a specific message and to execute a series of commands apon receiving this message. the possibilities are endless. so I suggest you have fun 🙂

So we will need a few items to get this project going.

* Arduino Uno.
* GSM module (I’m using the SIM900)
* 4 Male to Male jumpers.

You can ignore the relay for this project!

1.
The first thing you want to do is download the Arduino IDE from this link.

2.
After you have installed the IDE you’ll need to paste and modify the included code into your sketch (save the sketch)

3.
Next you’ll want to burn the sketch onto your Arduino.

So now you need to wire up the Arduino and the GSM module.
Thankfully the GSM module already has a MAX232 chip embedded into the board so we don’t need to worry about RS232 communication.
take a look at the pictures below and wire up your board.

GND=purple goes to 5V GND on the Arduino.
RX=red goes to pin 8 on the Arduino.
TX= yellow goes to pin 7 on the Arduino.
Trigger=grey goes to pin 2 on the Ardino.

The trigger is triggered when pulled low to GND

power to the SIM900 board gets connected to +5V and GND on the Arduino.

Now all you need to do is pull pin 3 on the arduino to GND (this is the trigger, in this case it will send a SMS)

You can also list all the messages saved to the SIM card since the SIM card is basically a tiny computer in itself!
Awesome!

Well that’s it for now HERE is the code saved in a nice zip file for you guys.

BASE NUMBER SYSTEMS

#29 BASE NUMBER SYSTEMS

Well Base Number Systems are the whole entire system that our computers run on, Binary is a Base System. In this case Base 2.

Before the days of languages, such as C++, C, Visual Basic and so on, there was actually Intelligent people slaving away at computers typing up endless pages of machine code. If you want to know more about the history of Machine code and etc. Well the point I’m trying to make is that the average computer programmer, back then had done Degrees in mathematics. 80% of the time the programmers had degrees anyway, This degree in mathematics helped them understand the way a computer works, eg. the electronic pulses caused by the computers output of 1’s and 0’s. This being Binary.

The Language of Numbers.

At bottom, Computers understand only one language — the binary code of ones and zero’s that represent on-off electronic pulses. Because this code is so difficult for humans, programmers have built more concise ways of expressing the binary numbers that constitute, for example the contents of a computer’s memory or the address in memory of each piece of data. Two numbering systems that can serve as convenient short hand for the binary (base 2) are octal (base 8) and Hexadecimal (base 16). Hexadecimal is sometimes known as “Hex” by programmers. Because 8 is raised 2 to the third power ( 8 = 2 * 2 * 2) , one octal digit is the equivalent of three binary digits, similarly, one hexadecimal digit represents 4 binary digits ( 16 is raised to the forth power). The tables below list the decimal numbers 0 through 16 and there binary, octal, hexadecimal equivalents. In each system, the value of a digit is determined by the value of its place column. The letters A through F in hexadecimal represents the 11th through 16th digits in that system.

The process of Conversion

Decimal to Binary

Subtract the highest possible power of 2 from the decimal number – here, 4 from 5 – and continue subtracting the highest possible power from the remainder, marking a 1 in each binary place column where subtraction occurs and a 0 where it doesn’t . Here. one 4, no 2 and one 1 gives binary 101.

Binary to Decimal

Add the values of all the binary places occupied by 1s. Here, to convert the 12- digit binary number 100101101001, add the place values of 2048,256,64,32,8 and 1. The result is the decimal number 2409.

Binary to Octal

Starting with the rightmost digit, group the binary digits in threes, treating each three as a separate binary number with the place values of 4,2 and 1. The sum of each of trio’s place values equals one octal digit. Here, the sums of the values of each of the four groups are 4,5, 5 and 1, making octal 4551.

Binary to Hexadecimal

Again from the right, group the binary digits in fours, treating each four as 1 binary number with the place values 8, 4, 2 and 1. The sum of each group’s place values equals one hexadecimal digit. Here, the sums of the three groups are 9, 6 and 9, making hexadecimal 969.

The Principles Of Addition

Addition in Binary

Using the same rules as in decimal addition, start by adding the figures in the rightmost, or 1s column: 1 + 1. The result – 2 – is expressed in binary as 10 (one – zero). Write down the 0 and carry the 1. In the 2s column, 1 + 1 again equals 2, or binary 10;write down the 0 and carry the 1 into the 4s column. The result is 100, the binary equivalent of decimal 4.

Addition in Octal

Adding the figures in the 1s column – 7 + 1 – gives 8, expressed in the octal system as 10 (one – zero). As in binary addition, write down the 0 and carry the 1. Next, add the figures in the 8s column, the sum of 6 and 1 is 7. The result is Octal 70 – the equivalent of binary 111000, or decimal 56.

Addition in Hexadecimal

Adding the figures in the 1s column – 7 + 9 – Gives 16, the base of the hexadecimal system, expressed as 10. Write down the 0 and carry the 1. In the 16s column , add 1 to the D (13 in decimal). D plus 1 is E (14 in decimal). The result is E0 (E-Zero), Hexadecimal shorthand for binary 11100000, or decimal 224.

You can find more info about the hexadecimal number system HERE

TABULATOR JS TABLE LIBRARY

#28 TABULATOR JS TABLE LIBRARY

Tabulator Example

Tabulator is an easy to use, fully featured, interactive table JavaScript library.

Tabulator allows you to create interactive tables in seconds from any HTML Table, JavaScript Array, AJAX data source or JSON formatted data.

Simply include the library in your project and you’re ready to roll.

Tabulator has an enormous number of features to help customize your table experience to your needs.

With new features released every month, there is bound to be something to get your interactive table juices flowing.

A detailed breakdown of all of the available features can be found in the Documentation.

The easy to use, fully featured, interactive table JavaScript library.