Subscribe To Our Newsletter
You will receive our latest post and tutorial.
Thank you for subscribing!

required
required


HTML Text Formatting

HTML has tags that display text in a special way with having to use CSS.

<p>This is <b>bold text</b>.</p>
<p>This is <strong>strongly important text</strong>.</p>
<p>This is <i>italic text</i>.</p>
<p>This is <em>emphasized text</em>.</p>
<p>This is <mark>highlighted text</mark>.</p>
<p>This is <code>computer code</code>.</p>
<p>This is <small>smaller text</small>.</p>
<p>This is <sub>subscript</sub> and <sup>superscript</sup> text.</p>
<p>This is <del>deleted text</del>.</p>
<p>This is <ins>inserted text</ins>.</p><p>This is <b>bold text</b>.</p>

<strong> and <b> tags

Both <strong> and <b> tags render the enclosed text in a bold typeface by default, but the <strong> tag indicates that its contents have strong importance, whereas the <b> tag is simply used to draw the reader’s attention without conveying any special importance.

<i> and <em> tags

<em> and <i> tags render text in italic type format. The <em> tag indicates that its contents have stressed emphasis. <i> is often used to indicate a technical term, a phrase from another language, a thought, a ship name, etc.

 

 

Source code on Github

July 15, 2020

HTML Form

Form

method : what http protocol(GET/POST)

action: defines the action to be performed when the form is submitted. Usually, this is a url or endpoint of which to process the form

autocomplete: autocomplete form

novalidate: don’t validate form on submit

<form method="POST" action="/signup" autocomplete="on" novalidate>

</form>

 

Input text

<form method="POST" action="/signup"  autocomplete="on" novalidate> 
        <div class="form-group">
            <label for="exampleInputName">Name</label>
            <input type="text" class="form-control" id="exampleInputName" aria-describedby="nameHelp" value="Folau">
            <small id="nameHelp" class="form-text text-muted">Name</small>
        </div>
</form>

 

Input radio

<div class="form-check">
    <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios1" value="option1" checked>
    <label class="form-check-label" for="exampleRadios1">
    MALE
    </label>
</div>
<div class="form-check">
    <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios2" value="option2">
    <label class="form-check-label" for="exampleRadios2">
    FEMALE
    </label>
</div>

 

Input checkbox

 <div class="form-check">
    <input class="form-check-input" type="checkbox" value="" id="defaultCheck1">
    <label class="form-check-label" for="defaultCheck1">
    Red
    </label>
</div>
<div class="form-check">
    <input class="form-check-input" type="checkbox" value="" id="defaultCheck1">
    <label class="form-check-label" for="defaultCheck1">
    Blue
    </label>
</div>

 

Textarea

<div class="form-group">
    <label for="aboutMe">About Me</label>
    <textarea class="form-control" id="aboutMe" rows="3"></textarea>
</div>

 

Select or Dropdown

<div class="form-group">
    <label for="language">Language</label>
    <select class="form-control" id="language">
    <option value="eng">English</option>
    <option value="ton">Tongan</option>
    </select>
</div>

 

Date

You can use the min and max attributes to add restrictions to dates.

<div class="form-group">
    <label for="exampleInputName">DOB</label>
    <input type="date" class="form-control" id="exampleInputName" aria-describedby="nameHelp">
    <small id="nameHelp" class="form-text text-muted">Name</small>
</div>
<div class="form-group"> 
     <label for="exampleInputName">Start</label> 
     <input type="date" class="form-control" max="1979-12-31"> 
     <small id="nameHelp" class="form-text text-muted">Name</small> 
</div>
<div class="form-group"> 
     <label for="exampleInputName">Start</label> 
     <input type="date" class="form-control" min="2000-10-31"> 
     <small id="nameHelp" class="form-text text-muted">Name</small> 
</div>

Time

<div class="form-group">
    <label for="exampleInputName">Time</label>
    <input type="time" class="form-control" >
    <small id="nameHelp" class="form-text text-muted">time</small>
</div>

 

Color

<div class="form-group">
    <label for="exampleInputName">Favorite Color</label>
    <input type="color" class="form-control" value="#ff0000">
    <small id="nameHelp" class="form-text text-muted">favorite color</small>
</div>

 

July 15, 2020

MySQL INFORMATION_SCHEMA

Information Schema

INFORMATION_SCHEMA provides access to database metadata, information about the MySQL server such as the name of a database or table, the data type of a column, or access privileges. Other terms that are sometimes used for this information are data dictionary and system catalog.

INFORMATION_SCHEMA is a database within each MySQL instance, the place that stores information about all the other databases that the MySQL server maintains. The INFORMATION_SCHEMA database contains several read-only tables. They are actually views, not base tables, so there are no files associated with them, and you cannot set triggers on them. Also, there is no database directory with that name.

Although you can select INFORMATION_SCHEMA as the default database with a  USE  statement, you can only read the contents of tables, not perform  INSERT ,  UPDATE , or  DELETE  operations on them.

Information Schema Table

Information Schema table provides information about tables in databases.

SELECT *
  FROM INFORMATION_SCHEMA.TABLES
  WHERE table_schema = 'db_name'
  [AND table_name LIKE 'wild']

SELECT
    TABLE_NAME, ENGINE, VERSION, ROW_FORMAT, TABLE_ROWS, AVG_ROW_LENGTH,
    DATA_LENGTH, MAX_DATA_LENGTH, INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT,
    CREATE_TIME, UPDATE_TIME, CHECK_TIME, TABLE_COLLATION, CHECKSUM,
    CREATE_OPTIONS, TABLE_COMMENT
  FROM INFORMATION_SCHEMA.TABLES
  WHERE table_schema = 'db_name'
  [AND table_name LIKE 'wild']

SHOW TABLE STATUS
  FROM db_name
  [LIKE 'wild']

TABLE_ROWS represents the number of rows per table. Some storage engines, such as MyISAM, store the exact count. For other storage engines, such as InnoDB, this value is an approximation, and may vary from the actual value by as much as 40% to 50%. This is important in case where you want to know how many rows or how much data a table has. For MyISAMDATA_LENGTH is the length of the data file, in bytes. For InnoDBDATA_LENGTH is the approximate amount of space allocated for the clustered index, in bytes. Specifically, it is the clustered index size, in pages, multiplied by the InnoDB page size.

SELECT 
    TABLE_NAME, TABLE_TYPE, ENGINE, VERSION, ROW_FORMAT, TABLE_ROWS, AVG_ROW_LENGTH, DATA_LENGTH,
    MAX_DATA_LENGTH, INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT, CREATE_TIME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'monomono';

// just row counts
SELECT 
    TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH, DATA_LENGTH, MAX_DATA_LENGTH, INDEX_LENGTH, DATA_FREE, 
    AUTO_INCREMENT, CREATE_TIME 
FROM INFORMATION_SCHEMA.TABLES 
WHERE TABLE_SCHEMA = 'monomono';

 

Information Schema Event

Information Schema event provides information about events in databases.

SELECT
    EVENT_SCHEMA, EVENT_NAME, DEFINER, TIME_ZONE, EVENT_TYPE, EXECUTE_AT,
    INTERVAL_VALUE, INTERVAL_FIELD, STARTS, ENDS, STATUS, ORIGINATOR,
    CHARACTER_SET_CLIENT, COLLATION_CONNECTION, DATABASE_COLLATION
  FROM INFORMATION_SCHEMA.EVENTS
  WHERE table_schema = 'db_name'
  [AND column_name LIKE 'wild']

SHOW EVENTS
  [FROM db_name]
  [LIKE 'wild']

Create an event

delimiter |

CREATE EVENT E_MIN_FIRE
    ON SCHEDULE
      EVERY 1 MINUTE
      STARTS CURRENT_TIMESTAMP
    COMMENT 'Saves total number of sessions then clears the table each day'
    DO
      BEGIN
        INSERT INTO activity(event_name, event_fired_at)
          VALUES('test-event',NOW());
      END |

delimiter ;
SELECT * 
FROM INFORMATION_SCHEMA.EVENTS
WHERE EVENT_SCHEMA = 'monomono';

SELECT 
    EVENT_SCHEMA, EVENT_NAME, CREATED, LAST_EXECUTED, DEFINER, TIME_ZONE, EVENT_DEFINITION,
    EVENT_TYPE, INTERVAL_VALUE, INTERVAL_FIELD, STARTS, ENDS, STATUS, ON_COMPLETION, EVENT_COMMENT
FROM INFORMATION_SCHEMA.EVENTS 
WHERE EVENT_SCHEMA = 'monomono';

 

Information Schema Trigger

Information schema trigger provides information about triggers.

SELECT * 
FROM INFORMATION_SCHEMA.TRIGGERS
WHERE TRIGGER_SCHEMA='database_name';


// favorite fields
SELECT 
     TRIGGER_SCHEMA, TRIGGER_NAME, EVENT_MANIPULATION, EVENT_OBJECT_SCHEMA,
     EVENT_OBJECT_TABLE, ACTION_STATEMENT, ACTION_ORIENTATION, ACTION_TIMING, CREATED
FROM INFORMATION_SCHEMA.TRIGGERS
WHERE TRIGGER_SCHEMA='database_name';

 

Information Schema ProcessList

The MySQL process list indicates the operations currently being performed by the set of threads executing within the server. 

SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;

SHOW FULL PROCESSLIST;

SHOW PROCESSLIST;

Get all column names per table per database

SELECT COLUMN_NAME FROM information_schema.columns WHERE table_name = '{tableName}' AND table_schema = '{Database}'

 

July 9, 2020

HTML Introduction

HTML is the standard markup language for creating Web pages. It is the most widely used language on the web. A markup language uses sets of markup tags to characterize text elements within a document, which gives instructions to the web browsers on how the document should appear.

Originally, HTML was developed with the intent of defining the structure of documents like headings, paragraphs, lists, and so forth to facilitate the sharing of scientific information between researchers. Now, HTML is being widely used to format web pages with the help of different tags available in HTML language.

HTML is a MUST for students and working professionals to become a great Software Engineer specially when they are working in Web Development Domain. Here are the reasons why you should learn HTML:

  • Create a Web site – You can create a website or customize an existing web template if you know HTML well.
  • Become a web designer / developer– If you want to start a carrer as a professional web designer, HTML and CSS designing is a must skill. If you want to optimize your website, to boost its speed and performance, it is good to know HTML to yield best results.
  • Learn other languages – HTML helps you understand other languages such as javascript, php, java once you have its basics down.

 

July 3, 2020

Testing

 

 

 

 

 

Resources
https://flask.palletsprojects.com/en/1.1.x/testing/

June 29, 2020