This file contains hidden or 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
| var getAddress = "./geth.ipc"; | |
| var web3 = new Web3(ipcClient); | |
| var reciept = await web3.Eth.Transactions.GetTransactionReceipt.SendRequestAsync(transactionHash); | |
| // If reciept is null it means the Contract creation transaction is not minded yet. | |
| if (reciept != null) | |
| contractAddress = reciept.ContractAddress; | |
This file contains hidden or 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
| var abi = @"[{""constant"":false,""inputs"":[],""name"":""destinationAddressRouteFound"",""outputs"":[{""name"......................"; | |
| var byteCode = "606060405260405160608061027e83395060c06040525160805160a05160008054600160a060020a03199081166c0100.............................."; | |
| var publicKey = "0x....."; | |
| var gas = new Nethereum.Hex.HexTypes.HexBigInteger(300000); | |
| var balance = new Nethereum.Hex.HexTypes.HexBigInteger(120); | |
| var transactionHash = await web3.Eth.DeployContract.SendRequestAsync(abi, byteCode, publicKey, gas, balance); |
This file contains hidden or 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
| // You need to have the geth running while running this code. command: c:\geth\>geth --testnet | |
| var string _getAddress = "./geth.ipc"; | |
| var ipcClient = new Nethereum.JsonRpc.IpcClient.IpcClient(_getAddress); | |
| var web3 = new Web3(ipcClient); | |
| // this will leave the account unlucked for 2 minutes | |
| var Nethereum.Hex.HexTypes.HexBigInteger accountUnlockTime = new Nethereum.Hex.HexTypes.HexBigInteger(120); | |
| var accountPublicKey = "ACCOUNT_PUBLIC_KEY"; |
This file contains hidden or 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
| contract Payout { | |
| address Victor; | |
| address Jim; | |
| address Kieren; | |
| mapping (address => uint) ownershipDistribution; | |
| function Setup() { | |
| Victor = 0xaabb; | |
| Jim = 0xccdd; |
This file contains hidden or 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 { NgModule } from '@angular/core'; | |
| import { BrowserModule } from '@angular/platform-browser'; | |
| import { MyComponent } from './my.component'; | |
| import { MyPipe } from './my.pipe'; | |
| @NgModule({ | |
| imports: [ | |
| BrowserModule, | |
| ], |
This file contains hidden or 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 } from '@angular/core'; | |
| @Component({ | |
| selector: 'my-component', | |
| template: `{{ value | myPipe }}` | |
| }) | |
| export class MyComponent { | |
| public value:any; |
This file contains hidden or 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 { Pipe, PipeTransform } from '@angular/core'; | |
| @Pipe({name: 'myPipe'}) | |
| export class MyPipe implements PipeTransform { | |
| transform(value:any, args?: any):string { | |
| let transformedValue = value; // implement your transformation logic here | |
| return transformedValue; | |
| } | |
| } |
This file contains hidden or 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
| <div> | |
| <h1>Welcome back {{fName | uppercase}} {{lName | lowercase}}</h1> | |
| <p> | |
| On {reservationMade | date} at {reservationMade | date:'shortTime'} you | |
| reserved room 205 for {reservationDate | date} for a total cost of | |
| {cost | currency}. | |
| </p> | |
| </div> |
This file contains hidden or 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 } from '@angular/core'; | |
| @Component({ | |
| moduleId: module.id, | |
| selector: 'hotel-reservation', | |
| templateUrl: './hotel-reservation.template.html' | |
| }) | |
| export class HotelReservationComponent { | |
| public fName: string = 'Joe'; | |
| public lName: string = 'SCHMO'; |
This file contains hidden or 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
| -- First of all I'll just put the data from my main table into a temp table | |
| -- just to make sure i am not destroying the actual data if something went wrong. | |
| SELECT * INTO #Temp FROM ImportedSales; | |
| ;With CTE As | |
| ( | |
| SELECT ProductName , Id , COUNT(ProductName) | |
| OVER(ORDER BY Id ROWS UNBOUNDED PRECEDING) As MyGroup FROM #Temp ), GetProduct AS ( | |
| SELECT [ProductName] , First_Value(ProductName) | |
| OVER(PARTITION BY MyGroup | |
| ORDER BY Id ROWS UNBOUNDED PRECEDING |