Thursday, 3 September 2020

My Activity Tracker in Angular 2

My Activity Tracker solution is available here

 Hold on
Are you doing a hackerrank ?

oh wait, Are you from doing this on Fresco Play?

and Are you from TCS?

okay so I get it you may be stuck here because the question is incomplete 

You need to create an activity tracker and here I show u my code-

app.component.ts-

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  //Define your variables done,todos,newToDo,newToDoObj,error
  todos:any
  done:boolean
  newToDo : String
  newToDoObj:any
  error: boolean
   TODOS :any[]

  //Define your constructor here with todos as [] ,newToDo as '' and error as false
  constructor() {
      this.newToDo = '';
      this.todos = [];
      this.error = false;
    }
  //Define your addMore function here
  addMore(newToDo) {
      if(this.newToDo != '')
      {
        this.newToDoObj = {
          newTodo: this.newToDo,
          done: false
        }
        this.todos.push(this.newToDoObj);
        this.newToDo = '';
      }
      else
      {
        this.error = true
      }
      console.log(this.todos);
    }

  //Define your clearAll function here
  clearAll(){
    this.todos.length = 0;
  }
}

app.component.html-

<h1>Fresco PLAY Activity Tracker</h1>

<div>
    <div *ngFor="let todo of todos; let i=index" class="todoItem">
        <input type="checkbox" [(ngModel)]="todo.done" />
        <span [ngClass]="{'checked': todo.done}">{{i+1}}. {{ todo.desc }}</span>
    </div>
    <span *ngIf="todos.length == 0">No Activities to track! Start by adding one</span><br/>
    <input id="newTodo" type="text" [(ngModel)]="newToDo">
    <span *ngIf="error" style="color:red;">Please enter an activity!</span>
    <br/>
    <button id="addActivity" (click)="addMore()">Add an Activity!</button>
    <button id="clearAll" (click)="clearAll()">Clear All</button>
</div>



Tuesday, 19 May 2020

Why Netflix loads faster? (1min read)

Netflix has an entire team dedicated to development obviously, 

What I was curious about is how Netflix allows 167 million people to stream the media on their devices, apparently, the answer to this is pretty sharp and smart 
What Netflix did was contacted the ISPs(Internet Service Provider) and installed a Box called Netflix Open Connect Appliances (OCAs) right at each ISP's office, these little red-colored boxes stores entire data of Netflix i.e. your movies and series. This allows faster delivery of content from the ISP to the user eliminating the usual process of how the internet works,
for those of you who don't know how the internet works here's an explanation - (Your regular website from your laptop goes to - modem - ISP - satellite - data center - data, Data centers are the harddisks of the internet, located at 6-8 places in the entire world, basically every data on the internet is stored right in a data center)

You can read about this particular feature here
I hope this image clears everything out for you -




Well, some pretty interesting stuff coming out about Netflix - stay tuned

GPT4ALL - A new LLaMa (Large Language Model)

posted 29th March, 2023 - 11:50, GPT4ALL launched 1 hr ago  What if we use AI generated prompt and response to train another AI - Exactly th...