Wednesday, April 29, 2020
Sunday, April 26, 2020
AWS Lambda (serverless service)
AWS Lambda (server-less service)
- https://serverless.com/framework/docs/providers/aws/guide/quick-start (clearly describe **********)
- https://blog.cloudboost.io/how-to-create-serverless-node-js-apps-with-aws-lambda-d5ab23be0cfb (****)
- https://serverless.com/framework/docs/providers/aws/cli-reference/config-credentials/ (***********)
- https://serverless.com/framework/docs/providers/aws/ (all kind of serverless framwork information available here )
serverless config credentials --provider aws --key 1234 --secret 5678
* https://github.com/serverless/serverless/issues/2372 (********** serverless folder structure)
- https://serverless.com/blog/node-rest-api-with-serverless-lambda-and-dynamodb/ ( dynamodb, serverless framwork, ************)
Getting Started with Amazon Web Services | A Complete Beginner Roadmap
Thursday, April 16, 2020
Angular library create command
Go to the lib folder of nodejs then run these 4 command
ng new ngx-charts --create-application=false
cd ngx-charts
ng generate library ngx-charts
ng generate application ngx-charts-test
Monday, April 13, 2020
angular project publish to github page
- https://medium.com/code-sketch/how-to-deploy-an-angular-7-app-to-github-pages-9427b609645f
- https://www.youtube.com/watch?v=wElk1W1BJ2o (VVI)
- https://stackoverflow.com/questions/53698413/angular-6-build-failed-to-load-resources
command need to follow
npm install -g angular-cli-ghpages
🌹 ng build --prod --base-href https://[username].github.io/[repo]/
🌹 ngh --dir=dist/[project-name]
You need to change
<base href="/"> to <base href="./">
ng build ngx-datagrid-test --prod --base-href https://tusharghoshbd.github.io/ngx-datagrid
ngh --dir=dist/ngx-datagrid-test
some important commands use for angular
ng build [project_name] // for library ex "ng build ngx-datatable"
ng build [project_name] --prod //here project name option and only build js file in dist folder
ng serve [project_name] --prod // here project name option and run server in production mode
Can't load angular generated webpage (ng build --prod)
The problem is you're trying to run the application without a server serving the js bundles generated by Angular. Angular will load the js asynchronously.
An option run
live-server on the compiled directory// Install live-server if you haven't
npm install -g live-server
// Run live-server on you dist
cd <project-compile-dist-path>
live-server
// Note: if you don't want to install live-server globally you
// can use npx
npx live-server <path-to-directory>
https://stackoverflow.com/questions/58878123/cant-load-angular-generated-webpage-ng-build-prod
Wednesday, April 8, 2020
Runge-Kutta, SIR - susceptible (S), infected (I), and resistant (R)
Ref:
The formula basically computes next value yn+1 using current yn plus weighted average of four increments.
- k1 is the increment based on the slope at the beginning of the interval, using y
- k2 is the increment based on the slope at the midpoint of the interval, using y + hk1/2.
- k3 is again the increment based on the slope at the midpoint, using using y + hk2/2.
- k4 is the increment based on the slope at the end of the interval, using y + hk3.
SIR model
REF:
- Susceptible (S). The individual hasn't contracted the disease, but she can be infected due to transmisison from infected people
- Infected (I). This person has contracted the disease
- Recovered/Deceased (R). The disease may lead to one of two destinies: either the person survives, hence developing inmunity to the disease, or the person is deceased.
There are many versions of this model, considering birth and death (SIRD with demography), with intermediate states, etc. However, since we are in the early stages of the COVID-19 expansion and our interest is focused in the short term, we will consider that people develops immunity (in the long term, immunity may be lost and the COVID-19 may come back within a certain seasonality like the common flu) and there is no transition from recovered to the remaining two states. With this, the differential equations that govern the system are:
Where β is the contagion rate of the pathogen and γ is the recovery rate.
Thursday, April 2, 2020
ExportAs feature in angular, Angular selector
Ref:
- https://netbasal.com/angular-2-take-advantage-of-the-exportas-property-81374ce24d26 (Export As example/doc *******)
for better uderstanding
- https://github.com/michaelbromley/ngx-pagination/blob/master/src/pagination-controls.directive.ts (ngx-pagination library)
- https://github.com/ssuperczynski/ngx-easy-table/blob/master/projects/ngx-easy-table/src/lib/components/pagination/pagination.html (ngx-pagination exportas template implemented here)
exportAs is used for directives, see: http://plnkr.co/edit/IlLtBY7Ic9yKiRIpjukf?p=preview
@Directive({
selector: "div",
exportAs: "myDiv"
})
class MyDiv {
constructor(private element: ElementRef, private renderer: Renderer) {
}
toUpper() {
return this.renderer.setElementStyle(this.element.nativeElement, "text-transform", "uppercase");
}
toLower() {
return this.renderer.setElementStyle(this.element.nativeElement, "text-transform", "lowercase");
}
reset() {
return this.renderer.setElementStyle(this.element.nativeElement, "text-transform", "");
}
}
Angular selector
Selector property of @Component decorator support, element selector, attribute selector and class selector:
1. Element selector:
@Component({
selector: 'app-servers'
})
Usage: <app-servers></app-servers>
2. Attribute selector:
@Component({
selector: '[app-servers]'
})
Usage: <div app-servers></div>
3. Class selector:
@Component({
selector: '.app-servers'
})
Usage: <div class="app-servers"></div>
Note: Angular 2 does not support id and pseudo selectors
Subscribe to:
Comments (Atom)
Autoboxing and Unboxing
Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper cl...
-
let today = new Date (); let dd = String ( today . getDate ()). padStart ( 2 , '0' ); let m...
-
A quick tip that helps me remember what they do - HostBinding('value') myValue; is exactly the same as [value]="myValue...
-
What is VPC Take a small piece of AWS network and call it your own, control IP address ranges, routing patterns, tighten security etc. AWS...