Categories
My Go Tutorial

Declaring a variable (Part 2

MUST be declared before using it

Order of declaring a variable in your code, here is an example of the declared variable unrecognized by fmt.Println() statement. The GO compiler (go build) took each line (reading from top to bottom) of the source code. In this case, you have a variable name odometer use but not data type and memory address defined. The compilation has failed or IDE for GO may prompt it as a problem.

// Variable declared but return error message
// when compile (go build) 
// 
func main() {
     fmt.Println(odometer)
     var odometer int
}

// Corrected code compile without error and 
// execution of code will return a value 
func main() {
     var odometer int
     fmt.Println(odometer)
}

Categories
My Go Tutorial

Declare a variable (Part 1)

MUST declare before using it

Declaration Syntax

var variable_name type

var odometer int

Naming Rules (variable names and function names)

  • 1st letter
    • a-z (1st letter)
    • _ (underscore)
    • Unicode char
  • Style
    • CamelCase
  • Special Cases
    • public accessable by other Go packages
      • A-Z (lst letter capitalize)
  • No Go’s language syntax keywords

Note: If the above rule is not followed, IDE for Go will prompt for errors, and Go run compilation will fail.

Categories
Security

Secure Your Online Accounts With 2FA And Open Source

Categories
Love2D and Lua

Love2D Resources

Wikipedia and Documentation API

https://www.love2d.org/wiki/Main_Page

Categories
Love2D and Lua

How LOVE2D Work

LÖVE calls 3 functions. First it calls love.load(). After that it calls love.update() and love.draw(), repeatedly in that order.

So: love.load -> love.update -> love.draw -> love.update -> love.draw -> love.update, etc.

Behind the scenes, LÖVE calls these functions, and we to create them, and fill them with code. This is what we call a callback.

LÖVE is made out of modules, love.graphics, love.audio, love.filesystem. There are about 15 modules, and each module focuses on 1 thing. Everything that you draw is done with love.graphics. And anything with sound is done with love.audio.

Categories
Dart

Creating a Classes and Instantiate

class  className {
    type fieldName;
    // anonymous function
    type get {
      return
    }
}

class InputField {
     int maxLength;
     String name;
}

var field = new className();

field.name = “fieldname”;

print(field.name);

Categories
Flutter and Dart

Ways To Run Dart Code

  • Dart Virtual Machine (VM’s)
    • dart tools
  • Javascript compilation
    • dart2js

dart sourcode.dart

Categories
Flutter and Dart

Create a new flutter project (Windows)

After a flutter successful installation and satisfied with the flutter doctor output report.

  • Open Windows Shell (cmd)
  • Create a new flutter project folder (directory)
  • Change the current folder/directory
  • Run the command ‘ flutter create your_project_name’
  • Use Visual Studio Code (with flutter and dart plugin installed) to open the main flutter project files ( /lib/main.dar)

Categories
Uncategorized

DartPad an Online Dart Compiler

https://dartpad.dev/?null_safety=true

Categories
Flutter and Dart

Flutter Development Setup (Windows)

  • Install the Flutter SDK
  • Install Android Studio
  • Install the Android Emulator

https://flutter.dev/docs/get-started/install/windows