Skip to content

Instantly share code, notes, and snippets.

View Isurie's full-sized avatar
💭
👩‍💻

Isurie K. Liyanage Isurie

💭
👩‍💻
  • University of Moratuwa
  • Galle, Sri Lanka
  • X @isuriek
View GitHub Profile
package streamexample;
public class Book {
private String author;
private String title;
public Book(String author, String title) {
this.author = author;
this.title = title;
@Isurie
Isurie / Sinhala_font_in_matplotlib.ipynb
Last active September 16, 2021 07:18
Sinhala font in Matplotlib
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Isurie
Isurie / app.component.html
Created July 14, 2021 04:28
Get more movie details
<div style="margin: 50px; position: fixed;left: 45%;" [hidden]="isShowDiv">
<div>
<mat-card><b>Movie Details : {{name}}</b></mat-card><br>
</div>
<div id="DetailsDIV">
<p> <b>Actors:</b> {{movieDetails['Actors']}}</p>
<p> <b>Awards:</b> {{movieDetails['Awards']}}</p>
<p> <b>BoxOffice:</b> {{movieDetails['BoxOffice']}}</p>
<p> <b>Country:</b> {{movieDetails['Country']}}</p>
<p> <b>Director:</b> {{movieDetails['Director']}}</p>
@Isurie
Isurie / app.component.html
Last active July 14, 2021 04:45
Fetch movie data
<div class="background">
<router-outlet></router-outlet>
<mat-toolbar>
<div class="box" style="position: relative;left: 5%;">
<h1>OMDB Search</h1>
</div>
<div class="box" style="position: relative;left: 50%;">
<input class="box" style="position: relative;left: 70%;" type="text" #movieSearchInput class="form-control" placeholder="Search a movie" />
@Isurie
Isurie / app.component.ts
Created July 3, 2021 10:47
Create Dialog box component
openDialog(row_obj:any): void {
let dialogRef = this.dialog.open(DialogBoxComponent, {
width: '250px',
data: { name: this.name }
});
dialogRef.afterClosed().subscribe(result => {
this.name = result;
if(this.name!=undefined){
if(this.name==""){
@Isurie
Isurie / app.component.html
Created July 3, 2021 10:41
Material Data Table-Actions column
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef>Actions </mat-header-cell>
<mat-cell *matCellDef="let user">
<button mat-button color="primary" (click)="openDialog(this.user)">Edit</button> |
<button mat-button color="warn" (click)="delete(this.user)">Delete</button>
</mat-cell>
</ng-container>
@Isurie
Isurie / app.component.html
Created July 3, 2021 10:34
create Material Form field
<mat-form-field apparence="legacy">
<mat-label>Name</mat-label>
<input matInput [(ngModel)]="newUser.userName" type="text" name="newuserName" id="newuserName" class="form-control" required>
</mat-form-field><br>
<mat-form-field apparence="legacy">
<mat-label>Email</mat-label>
<input matInput [(ngModel)]="newUser.email" type="text" name="email" id="email" class="form-control" pattern="[a-zA-Z0-9.-_]{1,}@[a-zA-Z.-]{2,}[.]{1}[a-zA-Z]{2,}" required>
</mat-form-field><br>
@Isurie
Isurie / app.component.html
Last active July 3, 2021 10:53
Create a material data table
<table mat-table #table [dataSource]="myDataArray" class="mat-elevation-z8">
<ng-container matColumnDef="userName">
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
<mat-cell *matCellDef="let user"><div> {{user.userName}} </div></mat-cell>
</ng-container>
<ng-container matColumnDef="email">
<mat-header-cell *matHeaderCellDef>Email</mat-header-cell>
<mat-cell *matCellDef="let user"><div> {{user.email}} </div></mat-cell>