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
# Swap dimensions of ("transpose") 3rd and 4th order tensors | |
# @author Jack Peterson (jack@tinybike.net) | |
function _transpose{T<:Real}(tensor::Array{T,3}, permute::Vector{Int}) | |
shape = size(tensor) | |
ttensor = zeros(shape) | |
idx = zeros(3) | |
for idx[1] = 1:shape[1] | |
for idx[2] = 1:shape[2] | |
for idx[3] = 1:shape[3] |
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
(develop) jack@vent:~/src/pyethereum$ pyeth | |
INFO:app starting version='0.8.52_57_gf6f3b1a-py2.7.egg' | |
Traceback (most recent call last): | |
File "/usr/local/bin/pyeth", line 9, in <module> | |
load_entry_point('pyethereum==0.8.52-57-gf6f3b1a', 'console_scripts', 'pyeth')() | |
File "/usr/local/lib/python2.7/dist-packages/pyethereum-0.8.52_57_gf6f3b1a-py2.7.egg/pyethereum/eth.py", line 133, in main | |
config = create_config() | |
File "/usr/local/lib/python2.7/dist-packages/pyethereum-0.8.52_57_gf6f3b1a-py2.7.egg/pyethereum/eth.py", line 125, in create_config | |
konfig.validate_config(config) | |
File "/usr/local/lib/python2.7/dist-packages/pyethereum-0.8.52_57_gf6f3b1a-py2.7.egg/pyethereum/config.py", line 103, in validate_config |
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
centering(n::Int) = eye(n) - ones(n) * ones(n)' / n | |
centering{T<:Real}(n::Int, w::Vector{T}) = eye(n) - ones(n) * w' | |
normalize{T<:Real}(v::Vector{T}) = vec(v) / sum(v) |
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
/** | |
* Send JSON-RPC commands to Ethereum from the safety and convenience of | |
* your browser! | |
* | |
* Examples: | |
* EthRPC.eth("blockNumber"); | |
* EthRPC.net("peerCount"); | |
* | |
* @author Jack Peterson (jack@augur.net) | |
* @date 4/12/2015 |
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
function pp(o) { console.log(JSON.stringify(o, null, 2)); } |
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
jack@vent:~$ geth --rpc --mine | |
Welcome to the FRONTIER | |
I0413 04:19:40.226359 6092 backend.go:180] Protocol Version: 60, Network Id: 0 | |
I0413 04:19:40.227393 6092 chain_manager.go:186] Last block (#0) fd4af92a79c7fc2fd8bf0d342f2e832e1d4f485c85b9152d2039e03bc604fdca TD=0 | |
I0413 04:19:40.227548 6092 ethash.go:94] Making cache | |
I0413 04:19:41.486967 6092 ethash.go:99] Took: 1.259391338s | |
I0413 04:19:41.491780 6092 cmd.go:116] Starting Geth/v0.9.9/linux/go1.4.2 | |
I0413 04:19:41.491884 6092 server.go:170] Starting Server | |
I0413 04:19:42.342868 6092 nat.go:94] mapping error: no devices discovered | |
I0413 04:19:42.349954 6092 udp.go:157] Listening, enode://fabdc2ab9d1366af40b7772fad570e92da0e2378f71506fc64d60cdb13e4cf5e4c23c39e30a32a95ee82217a42325bacc746e415a637ae6e56635c29ca111abf@71.215.180.92:30303 |
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
-N- [ 00:04:13 | p2p ] Hello: Ethereum(++)/Gav's Node/v0.9.7/Release/linux/g++/int V[ 3 ] bf1d38bb… (eth,60)(shh,2) 30303 | |
-N- [ 00:04:13 | p2p | 0 ] Transition! State from Nothing , holding | |
*N* [ 00:04:13 | p2p ] p2p.host.peer.register bf1d38bb… | |
-N- [ 00:04:13 | p2p | 0 ] Status: 60 / 0 / fd4af92a… , TD: 281348177475 = 8074a3ec… | |
!N! [ 00:04:13 | p2p | 0 ] DISABLE: Disabling capability ' eth '. Reason: Peer banned for previous bad behaviour. | |
-N- [ 00:04:14 | p2p | 0 ] Status: 2 | |
!N! [ 00:04:15 | p2p ] Disconnecting 92.51.165.126:55525 (Handshake Timeout) | |
!N! [ 00:04:15 | p2p | -1 ] Error reading: Operation canceled | |
-N- [ 00:04:15 | p2p | -1 ] Closing Peer Session :-( | |
-N- [ 00:04:15 | p2p | 0 ] Aborting Sync :-( |
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
def f1(): | |
with s0 = 0: | |
with s1 = 1: | |
with s2 = 2: | |
with s3 = 3: | |
with s4 = 4: | |
with s5 = 5: | |
with s6 = 6: | |
with s7 = 7: | |
with s8 = 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
#!/usr/bin/env python | |
from pyethereum import tester as t | |
s = t.state() | |
t.gas_limit = 100000000 | |
s = t.state() | |
c = s.abi_contract("contract1.se", gas=70000000) |
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 <cstdio> | |
#include <boost/version.hpp> | |
int main() | |
{ | |
printf("Boost version: %d.%d.%d\n", BOOST_VERSION / 100000, | |
BOOST_VERSION / 100 % 1000, | |
BOOST_VERSION % 100); | |
return 0; | |
} |