Pablo Moncada Isla
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Oracle prometheus metrics ## Extract date and #operations from MMINVENTORY_PRO schema ``` SELECT EXTRACT(DATE FROM timestamp) AS DATE, value as OperationCount, CASE WHEN metricname ='oracledb_table_modifications_mminventory_inserts' THEN 'INSERTS' WHEN metricname ='oracledb_table_modifications_mminventory_deletes' THEN 'DELETES' WHEN metricname ='oracledb_table_modifications_mminventory_updates' THEN 'UPDATES' else "OTHER" END AS OperationType FROM `mm-engineering-metrics-prod.oracle_metrics.prometheus` WHERE metricname like "%mminventory%" ``` ## Current Value and last value ``` SELECT timestamp, metricname, value, lag(value) over(order by timestamp) as valor_anterior, value - LAG(value) OVER (ORDER BY timestamp) as OPERATIONS FROM `mm-engineering-metrics-prod.oracle_metrics.prometheus` WHERE metricname='oracledb_table_modifications_mminventory_updates' AND timestamp BETWEEN PARSE_TIMESTAMP("%d-%m-%Y %H:%M:%S", '16-03-2021 00:00:00') AND PARSE_TIMESTAMP("%d-%m-%Y %H:%M:%S", '16-03-2021 01:00:00') order by timestamp ``` ![](https://i.imgur.com/kCvJk58.png) da valores negativos. por qué? 1. una metrica se ejecuta cada 15 min. 2. puede que no cada 15 min se saquen los valores de todas las tablas (fixed) 3. puede estar calculando contra un registro que no es exactamente igual. 5. cada registro es una tabla, pero no tiene un identificador como tal (need to be fixed)- ETL? 6. los contadores se ponen a 0 cuando se realiza un analyze de la tabla. Este analyze no se realiza bajo ningún patrón. El valor puede ser negativo a partir de ese momento. ## Extract TABLE_OWNER y TABLE_NAME ``` SELECT REGEXP_EXTRACT(tags, '"table_owner"\\:"([A-Z_0-9-]+)"',1) as table_owner, REGEXP_EXTRACT(tags, '"table_name"\\:"([A-Z_0-9-]+)"',1) as table_name, value, timestamp FROM `mm-engineering-metrics-prod.oracle_metrics.prometheus` WHERE metricname like "%global%" ``` ## + Add Operation type ``` SELECT REGEXP_EXTRACT(tags, '"table_owner"\\:"([A-Z_0-9-]+)"',1) as table_owner, REGEXP_EXTRACT(tags, '"table_name"\\:"([A-Z_0-9-]+)"',1) as table_name, value, timestamp, CASE WHEN metricname ='oracledb_global_table_modifications_inserts' THEN 'INSERTS' WHEN metricname ='oracledb_global_table_modifications_deletes' THEN 'DELETES' WHEN metricname ='oracledb_global_table_modifications_updates' THEN 'UPDATES' WHEN metricname ='oracledb_global_table_modifications_num_rows' THEN 'NUM_ROWS' else "OTHER" END AS OperationType FROM `mm-engineering-metrics-prod.oracle_metrics.prometheus` WHERE metricname like 'oracledb_global_table_modifications%' order by timestamp ``` ## Create tables to insert data modeled ``` EXECUTE IMMEDIATE "CREATE TEMP TABLE MetricsTable (table_owner STRING, table_name STRING, value FLOAT64, timestamp TIMESTAMP, OperationType STRING)"; INSERT INTO MetricsTable( SELECT REGEXP_EXTRACT(tags, '"table_owner"\\:"([A-Z_0-9-]+)"',1) as table_owner, REGEXP_EXTRACT(tags, '"table_name"\\:"([A-Z_0-9-]+)"',1) as table_name, value, timestamp, CASE WHEN metricname ='oracledb_global_table_modifications_inserts' THEN 'INSERTS' WHEN metricname ='oracledb_global_table_modifications_deletes' THEN 'DELETES' WHEN metricname ='oracledb_global_table_modifications_updates' THEN 'UPDATES' WHEN metricname ='oracledb_global_table_modifications_num_rows' THEN 'NUM_ROWS' else "OTHER" END AS OperationType FROM `mm-engineering-metrics-prod.oracle_metrics.prometheus` WHERE metricname like 'oracledb_global_table_modifications_%' AND value <>0 order by OperationType, table_owner, table_name, timestamp ); EXECUTE IMMEDIATE "CREATE TEMP TABLE MetricsTable2 (table_owner STRING, table_name STRING, OperationType STRING, timestamp TIMESTAMP, value FLOAT64, last_value FLOAT64, diferencia FLOAT64)"; INSERT INTO MetricsTable2( SELECT TABLE_OWNER, TABLE_NAME, OperationType, timestamp, value, lag(value) over(order by OperationType, table_owner, table_name, timestamp) as last_value, value - (lag(value) over(order by OperationType, table_owner, table_name, timestamp)) as Diferencia FROM MetricsTable ORDER BY OperationType, table_name, timestamp ); SELECT table_owner, table_name, OperationType, timestamp, value, last_value, if (diferencia <0, value, diferencia) FROM MetricsTable2 WHERE OperationType <> 'NUM_ROWS' AND table_name='MM_CDRSF3' AND table_owner='MAS_DATA' ORDER BY OperationType, timestamp; ``` ## V1: ``` EXECUTE IMMEDIATE "CREATE TEMP TABLE MetricsTable (table_owner STRING, table_name STRING, current_value FLOAT64 , timestamp TIMESTAMP, OperationType STRING)"; INSERT INTO MetricsTable( SELECT REGEXP_EXTRACT(tags, '"table_owner"\\:"([A-Z_0-9-]+)"',1) AS table_owner, REGEXP_EXTRACT(tags, '"table_name"\\:"([A-Z_0-9-]+)"',1) AS table_name, value, timestamp, CASE WHEN metricname ='oracledb_global_table_modifications_inserts' THEN 'INSERTS' WHEN metricname ='oracledb_global_table_modifications_deletes' THEN 'DELETES' WHEN metricname ='oracledb_global_table_modifications_updates' THEN 'UPDATES' WHEN metricname ='oracledb_global_table_modifications_num_rows' THEN 'NUM_ROWS' ELSE "OTHER" END AS OperationType FROM `mm-engineering-metrics-prod.oracle_metrics.prometheus` WHERE metricname LIKE 'oracledb_global_table_modifications_%' AND value <>0 ORDER BY OperationType, table_owner, table_name, timestamp ); EXECUTE IMMEDIATE "CREATE TEMP TABLE MetricsTable2 (table_owner STRING, table_name STRING, OperationType STRING, timestamp TIMESTAMP, current_value FLOAT64, last_value FLOAT64, changes FLOAT64)"; INSERT INTO MetricsTable2( SELECT TABLE_OWNER, TABLE_NAME, OperationType, timestamp, current_value, LAG(current_value) OVER(ORDER BY OperationType, table_owner, table_name, timestamp) AS last_value, current_value - (LAG(current_value) OVER(ORDER BY OperationType, table_owner, table_name, timestamp)) AS changes FROM MetricsTable ORDER BY OperationType, table_name, timestamp ); SELECT table_owner, table_name, OperationType, timestamp, current_value, last_value, IF (changes <0, current_value, changes) AS changes FROM MetricsTable2 WHERE OperationType <> 'NUM_ROWS' AND table_owner='MMINVENTORY_PRO' ORDER BY OperationType, timestamp; ``` ## V2 Iterate over owner ``` DECLARE i INT64 DEFAULT 0; DECLARE start_date TIMESTAMP DEFAULT '2021-01-01'; DECLARE owner_name STRING; DECLARE temp_table STRING DEFAULT 'MetricTable'; DECLARE owner ARRAY<STRING> DEFAULT [ 'RATOR', 'WO_DATA', 'APOLLO_PROP', 'NEBAREQUEST_PRO', 'MM_MIGRATIONS', 'INCIDENT', 'NEBAFAULT_PRO', 'MMINVENTORY_PRO', 'GESCAL_PRO', 'MM_CO_MIGRATION_PRO', 'MAS_DATA', 'SCAI', 'NEBAPPAI_PRO', 'FIELDORDERS', 'MM_CHVEL', 'MM_MIG_NEBA_VULA', 'ECUEVAS' ]; SET i=0; WHILE i<ARRAY_LENGTH(owner) DO --WHILE i = 0 DO SET owner_name =owner[OFFSET(i)]; SET temp_table= temp_table||i; -- DEFINO vairable de fecha para almacenar el último dato insertado. SET start_date=(SELECT MAX(timestamp) from `mm-engineering-metrics-prod.oracle_metrics.oracle_metrics_data` WHERE table_owner=owner_name); -- Creo tabla termporal para extraer datos de prometheus y convertirlos en tablas. Solo saco datos cuando el 'values' es diferente de 0. EXECUTE IMMEDIATE "CREATE TEMP TABLE MetricTable1 (table_owner STRING, table_name STRING, timestamp TIMESTAMP, current_value FLOAT64 , operation_type STRING)"; INSERT INTO MetricTable1( SELECT REGEXP_EXTRACT(tags, '"table_owner"\\:"([A-Z_0-9-]+)"',1) AS table_owner, REGEXP_EXTRACT(tags, '"table_name"\\:"([A-Z_0-9-]+)"',1) AS table_name, TIMESTAMP(REGEXP_EXTRACT(tags, '"timestamp"\\:"([0-9-]+ [0-9:]+)(?:..........)"',1)) AS metric_date, value, CASE WHEN metricname ='oracledb_all_table_modifications_inserts' THEN 'INSERTS' WHEN metricname ='oracledb_all_table_modifications_deletes' THEN 'DELETES' WHEN metricname ='oracledb_all_table_modifications_updates' THEN 'UPDATES' ELSE "OTHER" END AS operation_type FROM `mm-engineering-metrics-prod.oracle_metrics.prometheus` WHERE metricname LIKE 'oracledb_all_table_modifications_%' AND REGEXP_EXTRACT(tags, '"table_owner"\\:"([A-Z_0-9-]+)"',1) = owner_name AND value <> 0 -- valor diferente de 0 AND tags not like '%BIN$%' -- no quiero las tablas de la papelera -- AND TIMESTAMP(REGEXP_EXTRACT(tags, '"timestamp"\\:"([0-9-]+ [0-9:]+)(?:..........)"',1)) > start_date -- solo quiero datos mayores que el último que se insertó ORDER BY operation_type, table_owner, table_name, metric_date ); -- Select temp table content SELECT * FROM MetricTable1; -- Creo tabla temporal para ordenar los datos y calcular último valor y diferncia. EXECUTE IMMEDIATE "CREATE TEMP TABLE MetricsTable2 (table_owner STRING, table_name STRING, operation_type STRING, timestamp TIMESTAMP, current_value FLOAT64, last_value FLOAT64, changes FLOAT64)"; INSERT INTO MetricsTable2( SELECT table_owner, table_name, operation_type, timestamp, current_value, LAG(current_value) OVER(ORDER BY operation_type, table_owner, table_name, timestamp) AS last_value, current_value - (LAG(current_value) OVER(ORDER BY operation_type, table_owner, table_name, timestamp)) AS changes FROM MetricTable1 ORDER BY operation_type, table_name, timestamp ); CREATE TABLE IF NOT EXISTS `mm-engineering-metrics-prod.oracle_metrics.oracle_metrics_data_prueba` ( table_owner STRING, table_name STRING, operation_type STRING, timestamp TIMESTAMP, current_value FLOAT64, last_value FLOAT64, changes FLOAT64 ) PARTITION BY DATE(timestamp) CLUSTER BY table_owner, table_name, operation_type OPTIONS( description="Metricas Oracle - Cambios realizados en tablas" ); INSERT INTO `mm-engineering-metrics-prod.oracle_metrics.oracle_metrics_data_prueba` (SELECT table_owner, table_name, operation_type, timestamp, current_value, last_value, IF (changes <0, current_value, changes) AS changes FROM MetricsTable2 ORDER BY operation_type, timestamp); set i=i+1; END WHILE; ``` ## V3 - Final ``` DECLARE i INT64 DEFAULT 0; DECLARE control string DEFAULT 'Comienzo'; DECLARE metric_last_date TIMESTAMP DEFAULT '2021-01-01'; DECLARE owner_name STRING; DECLARE owner ARRAY<STRING> DEFAULT [ 'RATOR', 'WO_DATA', 'APOLLO_PROP', 'NEBAREQUEST_PRO', 'MM_MIGRATIONS', 'INCIDENT', 'NEBAFAULT_PRO', 'MMINVENTORY_PRO', 'GESCAL_PRO', 'MM_CO_MIGRATION_PRO', 'MAS_DATA', 'SCAI', 'NEBAPPAI_PRO', 'FIELDORDERS', 'MM_CHVEL', 'MM_MIG_NEBA_VULA', 'ECUEVAS' ]; -- Esta es la tabla que contendrá los datos mostrados en DataStudio CREATE TABLE IF NOT EXISTS `mm-engineering-metrics-prod.oracle_metrics.oracle_metrics_data_prueba` ( table_owner STRING, table_name STRING, operation_type STRING, metric_date TIMESTAMP, current_value FLOAT64, last_value FLOAT64, changes FLOAT64 ) PARTITION BY DATE(metric_date) CLUSTER BY table_owner, table_name, operation_type OPTIONS( description="Metricas Oracle - Cambios realizados en tablas" ); -- Creo tabla para cargar todos los datos de prometheus con formato tabla CREATE TABLE IF NOT EXISTS `mm-engineering-metrics-prod.oracle_metrics.prometheus_load` ( table_owner STRING, table_name STRING, metric_date TIMESTAMP, current_value FLOAT64 , operation_type STRING ) PARTITION BY DATE(metric_date) CLUSTER BY table_owner, table_name, operation_type OPTIONS( description="Prometheus data load" ); SET i=0; WHILE i<ARRAY_LENGTH(owner) DO -- DEFINO vairable de fecha para almacenar el último dato insertado. SET metric_last_date=(SELECT MAX(metric_date) from `mm-engineering-metrics-prod.oracle_metrics.oracle_metrics_data_prueba` WHERE table_owner=owner_name); IF metric_last_date IS NULL THEN set metric_last_date=timestamp('2001-01-01'); END IF; SET owner_name =owner[OFFSET(i)]; -- Cargo la tabla base INSERT INTO `mm-engineering-metrics-prod.oracle_metrics.prometheus_load` ( SELECT distinct REGEXP_EXTRACT(tags, '"table_owner"\\:"([A-Z_0-9-]+)"',1) AS table_owner, REGEXP_EXTRACT(tags, '"table_name"\\:"([A-Z_0-9-]+)"',1) AS table_name, TIMESTAMP(REGEXP_EXTRACT(tags, '"timestamp"\\:"([0-9-]+ [0-9:]+)(?:..........)"',1)) AS metric_date, value, CASE WHEN metricname ='oracledb_all_table_modifications_inserts' THEN 'INSERTS' WHEN metricname ='oracledb_all_table_modifications_deletes' THEN 'DELETES' WHEN metricname ='oracledb_all_table_modifications_updates' THEN 'UPDATES' ELSE "OTHER" END AS operation_type FROM `mm-engineering-metrics-prod.oracle_metrics.prometheus` WHERE metricname LIKE 'oracledb_all_table_modifications_%' AND ( REGEXP_EXTRACT(tags, '"table_owner"\\:"([A-Z_0-9-]+)"',1)) = owner_name AND (TIMESTAMP(REGEXP_EXTRACT(tags, '"timestamp"\\:"([0-9-]+ [0-9:]+)(?:..........)"',1))) > metric_last_date -- solo quiero datos mayores que el último que se insertó en la tabla promeetheus ORDER BY operation_type, table_owner, table_name, metric_date ); -- Creo tabla temporal para los datos de prometheus de esta ejecución y la cargo EXECUTE IMMEDIATE "CREATE OR REPLACE TEMP TABLE PrometheusLoadTemp (table_owner STRING, table_name STRING, metric_date TIMESTAMP, current_value FLOAT64, operation_type STRING)"; INSERT INTO PrometheusLoadTemp (SELECT distinct REGEXP_EXTRACT(tags, '"table_owner"\\:"([A-Z_0-9-]+)"',1) AS table_owner, REGEXP_EXTRACT(tags, '"table_name"\\:"([A-Z_0-9-]+)"',1) AS table_name, TIMESTAMP(REGEXP_EXTRACT(tags, '"timestamp"\\:"([0-9-]+ [0-9:]+)(?:..........)"',1)) AS metric_date, value, CASE WHEN metricname ='oracledb_all_table_modifications_inserts' THEN 'INSERTS' WHEN metricname ='oracledb_all_table_modifications_deletes' THEN 'DELETES' WHEN metricname ='oracledb_all_table_modifications_updates' THEN 'UPDATES' ELSE "OTHER" END AS operation_type FROM `mm-engineering-metrics-prod.oracle_metrics.prometheus` WHERE metricname LIKE 'oracledb_all_table_modifications_%' AND ( REGEXP_EXTRACT(tags, '"table_owner"\\:"([A-Z_0-9-]+)"',1)) = owner_name AND (TIMESTAMP(REGEXP_EXTRACT(tags, '"timestamp"\\:"([0-9-]+ [0-9:]+)(?:..........)"',1))) > metric_last_date -- solo quiero datos mayores que el último que se insertó en la tabla promeetheus ORDER BY operation_type, table_owner, table_name, metric_date ); -- Creo tabla temporal para ordenar los datos y calcular último valor y diferncia. EXECUTE IMMEDIATE "CREATE OR REPLACE TEMP TABLE MetricsTableTemp (table_owner STRING, table_name STRING, operation_type STRING, metric_date TIMESTAMP, current_value FLOAT64, last_value FLOAT64, changes FLOAT64)"; INSERT INTO MetricsTableTemp( SELECT table_owner, table_name, operation_type, metric_date, current_value, LAG(current_value) OVER(ORDER BY operation_type, table_owner, table_name, metric_date) AS last_value, current_value - (LAG(current_value) OVER(ORDER BY operation_type, table_owner, table_name, metric_date)) AS changes FROM PrometheusLoadTemp WHERE table_owner=owner_name ORDER BY operation_type, table_name, metric_date ); -- Creo tabla temporal para guardar todos los datos que f se insertarán en la tabla final que es fija. EXECUTE IMMEDIATE "CREATE TEMP TABLE IF NOT EXISTS MetricFinalTemp (table_owner STRING, table_name STRING, operation_type STRING, metric_date TIMESTAMP, current_value FLOAT64, last_value FLOAT64, changes FLOAT64)"; INSERT INTO MetricFinalTemp (SELECT table_owner, table_name, operation_type, metric_date, current_value, last_value, IF (changes <0, current_value, changes) AS changes FROM MetricsTableTemp ORDER BY operation_type, metric_date); SET i=i+1; END WHILE; -- Inserto los dataos ya tratados en la tabla final. INSERT INTO `mm-engineering-metrics-prod.oracle_metrics.oracle_metrics_data_prueba` (SELECT * FROM MetricFinalTemp );

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully