Posted on

Solfeo

¿Qué es el Solfeo?

Solfear es cantar algo marcando el compás y pronunciando los nombres de las notas.

¿Para qué sirve el solfeo?

Poder leer la música y saber como suena sin tener que recurrir a un instrumento trae los siguientes beneficios:

  • Agilizar el aprendizaje
  • Reconocimento de patrones rítmicos
  • Facilita la comunicación entre músicos
  • Puedes aprender a tocar cualquier tema / obra mucho mas rápido

¿Cómo aprender solfeo?

La forma mas sencilla es a traves de libros.

En lo personal estoy aprendiendo con este libro:

Titulo: Tratado de solfeo

Autor: Sociedad didactico musical (SDM).

Ejemplo

Veamos un ejemplo de lectura con solfeo. A continuación se muestra un extracto:

Abajo podrás encontrar 2 pistas de audio: una con la voz y otra sin la voz o (solo acompañamiento).

Aquí ire subiendo todos los acompañamientos: https://luisrosales.info/

Extracto de una de las lecciones del libro:

Extracto de una de las lecciones del libro

Asi debería escucharse este extracto:

Ejemplo con voz

Aqui tienes el acompañamiento de este extracto:

Solo acompañamiento

Si quieres obtener el acompañamiento completo puedes descargarlo en:

https://luisrosales.info/product/sdm-acompanamiento-curso-1-tema-12-leccion-16/

Si quieres comprar el libro de solfeo aqui lo tienes:

Posted on

What are super inverstors doing? 2021 Q2

TLDR

Superinvestors are buying and not selling these:

FISV, VIAC, MSFT, FB, NKE, ECL, SOFI, COIN, REGN, JNJ,

NLSN, DIDI, CRM, CTSH, OGN, BKR, VOO, NRG, PEP, EBAY, GE, DISCK

Superinvestors are buying these:

BABA, AMZN, FISV, NFLX, INTC, VIAC, MSFT, FB

Superinvestors are selling these:

GOOG, GOOGL, MSFT, FB, COF, JPM, C, ORCL, BRK.B,

BKNG, EBAY, GRA, MDLZ, BRK.A, BB, BAC, UNH, WLTW, SCHW

For example FISV stock was bought maybe in august by ValueAct Capital

From this page https://www.dataroma.com/m/allact.php?typ=a we could get the following:

These are the stocks super investors are buying

TickerAppearance (times)
BABA10
AMZN5
FISV4
NFLX3
INTC3
VIAC3
MSFT3
FB3
NKE2
BRK.B2
ECL2
SOFI2
COIN2
BI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S1
ACN1
UPS1
GPN1
BBWI1
VMC1
DHI1
FLIR1
ZBH1
IPG1
NTP1
ALNY1
FOE1
NAVI1
MGY1
IFF1
MANU1
NVDA1
PFG1
FUL1
USB1
CNX1
TEVA1
HI1
HUN1
IMKTA1
ZYME1
LUMN1
DNOW1
RPT1
TBT1
CMIIU1
PG1
FERG1
DESP1
IT1
MCFT1
EAF1
MOMO1
MSGS1
VTRS1
ANET1
ACOPF1
J1
ERFSF1
CNSWF1
FOXA1
FOX1
PEAK1
FNF1
INTC1
MELI1
NFLX1
TEAM1
KMI1
CTB1
EXP1
LEN1
JBGS1
PLD1
BAM1
SRG1
EA1
NSRGY1
CFRHF1
PDRDF1
KHC1
L1
ETN1
CON.SW1
003550.KS1
STX1
TRN1
SLM1
OUT1
ABCL1
LH1
MRK1
AXTA1
GM1
ABBV1
ZTS1
SPGI1
RL1
DIS1
M1

Only being bought

Posted on

Hedera Price Analysis

This time I would like to cover this Hedera Hashgraph – $HBAR.

Efficiency

A recent study from “UCL (University College London) Centre for Blockchain Technologies” have demonstrated the efficiency of this technology.

See:

From http://blockchain.cs.ucl.ac.uk/blockchain-energy-consumption/

From the Graph above we see that other important competitors are Cardano, Polkadot, Tezos, Algorand.

Easy of usage

It is super easy to create a coin based on HBAR. See:

Forecast

Lets compare the market cap.

CoinMarket Cap
Cardano$72,796,015,460
Polkadot$31,651,519,995
Tezos$7,393,447,535
Algorand$11,075,370,144
Hedera Hashgraph$5,999,189,951
Total$128,915,543,085

Looking at the chart above we can assume that this coin can easily reach the 20B Market cap.

Lets do some forecast:

I am assuming that circulating supply will increase by 2% per market cap growth. This is not accurate but at least includes it.

Market CapCirculating supplyPrice
5,952,261,265.9014,832,756,028.000.4013
7,000,000,000.0015,129,411,148.560.4627
8,000,000,000.0015,431,999,371.530.5184
9,000,000,000.0015,740,639,358.960.5718
10,000,000,000.0016,055,452,146.140.6228
11,000,000,000.0016,376,561,189.060.6717
12,000,000,000.0016,704,092,412.850.7184
13,000,000,000.0017,038,174,261.100.7630
14,000,000,000.0017,378,937,746.320.8056
15,000,000,000.0017,726,516,501.250.8462
16,000,000,000.0018,081,046,831.280.8849
17,000,000,000.0018,442,667,767.900.9218
18,000,000,000.0018,811,521,123.260.9569
19,000,000,000.0019,187,751,545.720.9902
20,000,000,000.0019,571,506,576.641.0219
21,000,000,000.0019,962,936,708.171.0519
22,000,000,000.0020,362,195,442.341.0804
23,000,000,000.0020,769,439,351.181.1074
24,000,000,000.0021,184,828,138.211.1329
25,000,000,000.0021,608,524,700.971.1570
26,000,000,000.0022,040,695,194.991.1796
27,000,000,000.0022,481,509,098.891.2010
28,000,000,000.0022,931,139,280.871.2210
29,000,000,000.0023,389,762,066.481.2399
30,000,000,000.0023,857,557,307.811.2575

For more detailed info regarding release scheduled you can see:

https://hedera.com/blog/introducing-the-hedera-treasury-management-report

https://hedera.com/treasury-management-report

Looking at these number this is NOT a coin that will give you 100x gain. But it is a solid PROJECT.

Posted on

Cryptocurrency Market Overview

From coinmarketcap.com we were able to get the top 5000 currencies.

From those there are 3864 based in other currencies like ETH, Cardano, etc.

Here is an overview:

Most of the cryptocurrencies are made based on Etherum, from those 5000 more than a half 66.5% (2569) are built using ETH.

Then, the other most used platform is Binance. Both platforms hold the 2nd position: Binance Smart Chain and Binance Chain used by 935 and 61 respectively. Binance Smart Chain support smart contracts and Binance Chain don’t.

This is the break down:

There are 707 coins that dont depend on other platform with circulating supply with price < 1.

I hope this gives you more sight.

Posted on

Cardano ADA Analysis

First lets see what is the current Status:

Available Supply32.1B
Total Supply45.0B
Current Market Capitalization90.58B
Current Price2.83 USD
Cardano Status 06/09/2021

Now lets see see how the Global Market capitalization Grows over the last 2 years

From https://coinmarketcap.com/charts/ we got:

Some Important notes:

DateMarket captitalization USD
04/01/200.20 T
01/06/200.27 T
01/01/210.77 T
01/06/211.63 T
01/09/212.18 T
01/01/22(Forecast)2.75 T
Market Capitalization could be 2.75 T by end of 2021

Now lets do some analysis:

  1. How Cardano will behave taking more Market capitalization related to ETH
  2. How Cardano will behave if nothing happens

How Cardano will behave taking 70% of Market capitalization related to ETH

CoinPrice (USD)Market Cap. (USD)%
BTC51312 962.96 B39.00
ETH3895456.23 B18.00
ADA2.83 90.58 B 3.75
Market Capitalization of BTC ETH and ADA as 06/09/2021

Assuming Cardano Reaches 70% of current ETH Market Capitalization:

Market Cap. = 456.23 B x 0.7 = 319.36 B

Then The price would be:

Formula: Price = MC / Av. Supply

Price = 319.23 B/ 32.1 B = 9.94 USD

How Cardano will behave if nothing happens

From the chart “Market Capitalization could be 2.75 T by end of 2021″we assume that Global Market Capitalization will be 2.75 T USD. See chart above.

Global Market Cap. at 01/01/2022 = 2.75 T USD = 2750 B USD.

Cardano Market Capitalization (01/01/2022) = 2750 B x 0.0375 = 103.2 B

Price = 103.2 B/ 32.1 B = 3.21 USD

Posted on

How to manage machine user in AWS and Cognito Pools

Consumers

If you are buildg an app you will have two types of consumers.

  • User consumers
  • Machine Consumers

User consumers

Users consumers are human users.

Also called internal user.

These are the users of Your WebApp.

Users will authenticate against a Cognito User pool using Authorization code grant.

Machine User Consumer

These are bots or programatic clients.

These users are also called external users.

They will consume the API in a different way.

Machine users are different from users, they shouldnt access a browser to authenticate themselves and also they cant confirm via email when the credentials are created or restored.

From the AWS official documentation

See Client Credentials Grant

The steps for the process are as follows:

  1. An app makes a POST request to https://AUTH_DOMAIN/oauth2/token, and specifies the following parameters:
    • grant_type – Set to “client_credentials” for this grant type.
    • client_id – The ID for the desired user pool app client.
    • scope – A space-separated list of scopes to request for the generated access token.
    In order to indicate that the app is authorized to make the request, the Authorization header for this request is set as “Basic BASE64(CLIENT_ID:CLIENT_SECRET)“, where BASE64(CLIENT_ID:CLIENT_SECRET) is the base64 representation of the app client ID and app client secret, concatenated with a colon.
  2. The Amazon Cognito authorization server returns a JSON object with the following keys:
    • access_token – A valid user pool access token.
    • expires_in – The length of time (in seconds) that the provided access token is valid for.
    • token_type – Set to ” Bearer“.
    Note that, for this grant type, an ID token and a refresh token aren’t returned.
  3. The app uses the access token to make requests to an associated resource server.
  4. The resource server validates the received token and, if everything checks out, executes the request from the app.

The following diagram illustrates the steps used in a client credentials grant:

Resource Server

To be able to configure a client settings to use the client credentials flow it is necessary to create a resource server which controls the access level of the machine user. You can add several.

Example of getting a token:

var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
 'grant_type': 'client_credentials',
'client_id': 'someid',
'client_secret': 'somecredential',
'scope': 'https://your.apidomain.com/somestage/external/api.readwrite' 
});
var config = {
  method: 'post',
  url: 'https://your.userpool.domain/oauth2/token',
  headers: { 
    'Content-Type': 'application/x-www-form-urlencoded' // this is important
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Example on how to verify the token

var jwt = require('jsonwebtoken');
var jwkToPem = require('jwk-to-pem');
var token = "sometoken";
var keys = [] // the content of the keys key of https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/.well-known/jwks.json
function validate(token, keys) {
    let pems = {};
    // console.log('antes del for', keys.length);
    for(let i = 0; i < keys.length; i++) {
        //Convert each key to PEM
        let key_id = keys[i].kid;
        let modulus = keys[i].n;
        let exponent = keys[i].e;
        let key_type = keys[i].kty;
        let jwk = { kty: key_type, n: modulus, e: exponent};
        let pem = jwkToPem(jwk);
        // console.log('key_id', key_id);
        pems[key_id] = pem;
    }
    console.log('aaaa');
    //validate the token
    const decodedJwt = jwt.decode(token, {complete: true});
    if (!decodedJwt) {
        // console.log("Not a valid JWT token");
        return false;
    }


    const kid = decodedJwt.header.kid;
    const pem = pems[kid];
    if (!pem) {
        // console.log('Invalid token');
        return false;
    }


    jwt.verify(token, pem, { algorithms: ['RS256'] }, function(err, decodedToken) {
        console.log('decoded', decodedToken);
    });

}

validate(token, keys);

Usage Plans

As our application grows we will require to measure the usage at least for the external users, the machine users.

To achieve this AWS offers a service called Usage Plans within Api Gateway.

A usage plan can hold several api keys, there should be an api key per client.

Note: API key values must be unique. If you try to create two API keys with different names and the same value, API Gateway considers them to be the same API key.

Api Gateway will read an x-api-key header then it will check if the intent does not exeed the limits defined in the usage plan and then will save the Api Consumption intent, if the limits have been reached it will deny the access.

What are usage plans and API keys?

usage plan specifies who can access one or more deployed API stages and methods—and also how much and how fast they can access them. The plan uses API keys to identify API clients and meters access to the associated API stages for each key. It also lets you configure throttling limits and quota limits that are enforced on individual client API keys.

Best practices for API keys and usage plans

The following are suggested best practices to follow when using API keys and usage plans.

  • Don’t rely on API keys as your only means of authentication and authorization for your APIs. For one thing, if you have multiple APIs in a usage plan, a user with a valid API key for one API in that usage plan can access all APIs in that usage plan. Instead, use an IAM role, a Lambda authorizer, or an Amazon Cognito user pool.
  • If you’re using a developer portal to publish your APIs, note that all APIs in a given usage plan are subscribable, even if you haven’t made them visible to your customers.

A post explaining that cognito can handle machine users:

https://medium.com/faun/setting-up-a-machine-to-machine-authentication-system-with-amazon-cognito-4c8e2de41c2e

Official documentation for API Gateway usage plans

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html

Posted on

How to debug Angular apps using the chrome dev tools

A lot of times I find myself trying to do some debugging in Angular, in this post I will share with you some of the most useful techniques I use to make this a more easy task.

The info method

This is a super simple one. In your component create an info() method that will be triggered by a button in the html.

You can see a full example here:

https://stackblitz.com/edit/angular-ivy-mxyvj6?embed=1&file=src/app/app.component.ts

The technique is rudimentary but it is good enough, you can check the state of your component at any point.

Breakpoints + debugger;

This is my recommended way to go. As a developer you need to have tools for debugging and if you are a front dev you need to know how to use your browser developer tools.

Most of the time you know where the bug could be, but if you dont you need to find the first part of the code that could be related to the bug and add a breakpoint there.

In your code, instead of using console.log(variable) use debugger;

debugger; // put this BEFORE the buggy code 
const myVariable = 'some';
// ... more code e.g. a for loop with a bug

Open your browser and refresh the page. If all went ok you should see the developer tools oppened. just there. Now add some breakpoints to start debugging.

The ng.probe (ng global variable)

Thanks to the video below I found this other way to debug:

Angular exposes the ng global variable at a window level.

There are some usful methods that you can use by passing an HTML Element.

Some of the methods are:

  • ng.getComponent
  • ng.getDirectives
  • ng.getListeners
  • ng.applyChanges
  • ng.getOwningComponent
  • ng.getContext
  • ng.getRootComponents
  • ng.getInjector
// example
// Get more info of hat $0 means -> https://developers.google.com/web/tools/chrome-devtools/console/utilities#dom
let component = ng.getComponent($0);
console.log(component);
component.someVal = 5;
ng.applyChanges($0) // will apply the changes