Skip to content

Instantly share code, notes, and snippets.

View hackrio1's full-sized avatar

Hackrio hackrio1

  • Hackrio
  • Gurugram
View GitHub Profile
# 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]
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)
genesis_block_hash: 3495953456182427352
block1_hash: -554281952046316805
genesis_block_hash: 3220110016770526666
block1_parent_hash: 3495953456182427352
#include <stdio.h>
union PersonUnion {
int height;
double weight;
};
struct PersonStruct {
int height;
double weight;
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
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,
<h1>{{ message }}</h1>
<form>
<div>
<label for="message">essage: </label>
<input type="text" [(ngModel)]="message" name="message">
</div>
</form>
<app-demo></app-demo>
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
import React, { Component } from 'react';
import './App.css';
class Hello extends Component {
render() {
return (
<h3>Hello World!</h3>
);
}
}