This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A block is stored as a tuple of | |
# (parent_hash, transactions, hash_itself) | |
def get_parent_hash(block): | |
return block[0] | |
def get_transactions(block): | |
return block[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
genesis_block[1] = "Y paid $100 to X" | |
genesis_block_hash = get_hash_itself(genesis_block) | |
print "genesis_block_hash:", genesis_block_hash | |
print "block1_parent_hash:", get_parent_hash(block1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
genesis_block_hash: 3495953456182427352 | |
block1_hash: -554281952046316805 | |
genesis_block_hash: 3220110016770526666 | |
block1_parent_hash: 3495953456182427352 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
union PersonUnion { | |
int height; | |
double weight; | |
}; | |
struct PersonStruct { | |
int height; | |
double weight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Details of Union | |
Height of person1_union: 1700 | |
Weight of person2_union: 74.230000 | |
Size of person1_union object: 8 | |
Size of person2_union object: 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
@Component({ | |
selector: 'app-demo', | |
templateUrl: './demo.component.html', | |
styleUrls: './demo.component.scss' | |
}) | |
export class DemoComponent implements OnInit { | |
message: string, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>{{ message }}</h1> | |
<form> | |
<div> | |
<label for="message">essage: </label> | |
<input type="text" [(ngModel)]="message" name="message"> | |
</div> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<app-demo></app-demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { FormsModule } from '@angular/forms'; | |
import { AppModule } from './app/component'; | |
import { DemoComponent } from './components/demo/demo.component'; | |
@NgModule({ | |
declarations: [ | |
AppComponent, | |
DemoComponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import './App.css'; | |
class Hello extends Component { | |
render() { | |
return ( | |
<h3>Hello World!</h3> | |
); | |
} | |
} |