onsdag den 22. februar 2023

Cookie - Accept or Rejct

 

Cookie privacy settings on a random website

I unfolded all the vendors list and company and this is all the text I got. Disturbing!.

lørdag den 26. juni 2021

MySQL: I forgot to insert AUTO_INCREMENT

Book: PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide 5th Edition

Page: 133 Introduction to SQL.

2021 Today I forgot to insert insert AUTO_INCREMENT into the column?

PHP and MySQL for Dynamic Web Sites Fifth Edition


Here is a solution:

søndag den 26. juli 2020

C++ for loop sum number 50 to 100 - enhanced version

Write a program that uses a for loop to sum the numbers from 50 to 100

Simple version

int sum = 0;
    for (int i = 50; i <= 100; ++i) {
        sum += i;
    }
std::cout << "The sum is: " << sum << std::endl;
return 0;

Remember to insert the code inside of:

#include <iostream>
int main {
    insert code her
}

The Enhanced version:

int sum = 0;
int balance = 0;
for (int i = 50; i <= 100; ++i) {
    balance = sum; // balance variable befor sum+=i. Makes sense when you run the program
    sum += i;  
    std::cout << balance << " + " << i << " = " << sum << std::endl;
}
std::cout << "The sum is: " << sum << std::endl;
return 0;

mandag den 14. oktober 2019

C++ For Total Beginners - Hello World !

This guide will show you how to install the software to write and compile C++ code at a total beginner level.

søndag den 21. juli 2019

PHP - The Continue Statement

Learning PHP, MySQL & JavaScript with Jquery, css and html5 - 5th Edition 2018.

Eaxample exercise 4-36. Trapping division-by-zero erros using continue.

søndag den 14. juli 2019

C++ exercise 1.9 - C++ Primer 4th edition 2005

C++ Primer Fourth Edition 2005
ISBN-13: 978-0-201-72148-5
ISBN:10: 0-201-72148-1
Page 17.
Exercise Section 1.4.2
Exercise 1.9: What does the following for loop do? What is the final value of sum?

int sum = 0;
for(int i = -100; i <= 100; ++i)
    sum += i;

mandag den 27. maj 2019

C++ a beginner understand

When writing a simple HelloWorld program it's is a step towards a higher call. A world of imagination an complicated creativity 😛

#include <iostream>
int main()
{
    std::count << "Hello, World!" << std::endl;
}

I understand now that this small program could also have been written in a not so readable way

#include <iostream> int main(){std::count<<"Hello, World!"<< std::endl;}

It is not very readable for a human being to quickly make sense of the program

In a human readable program you have spaces, indentations, line shift and one of the most fundamental of programming is giving your code a visual structure and it doesn't matter which programming language your writing because you have to consider that at some point someone will read your code, copy your code, debug your code, and if you write "obviousVariableNames" you can save a lot of commenting 😆

I still feel like a beginner who is trying understand some of the most basic things like loops, variables, if/else statements, switch, function, objects, opp.. and classes what the hell is that?
Yes.. I'm still learning and will never stop learning. It's a struggle, a hard learning student who keeps on struggling until he meets gratification and satisfaction of a programming language.

With great powers comes great responsibility.. what a geek but he got a point.