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
FROM centos:6.7 | |
RUN yum -y update && \ | |
yum -y localinstall --nogpgcheck http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm && \ | |
yum install -y ksh libXp libXmu libXScrnSaver && \ | |
yum install -y openssh-server openssh-clients && \ | |
yum install -y fuse-sshfs tcsh libpng-devel libjpeg libXft libGLU python-pip && \ | |
yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel xz-libs wget vim | |
# Install python3.4 and pip3 | |
RUN yum -y --disablerepo="*" --enablerepo="epel" install python34 && \ | |
curl -O https://bootstrap.pypa.io/get-pip.py && \ |
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
pragma solidity ^0.4.17; | |
contract ArrayOverflow{ | |
uint256 public target = 100; | |
uint256[] public array = [9,8]; | |
// _ means local variable | |
function modifyArray (uint256 _index, uint256 _value){ | |
array[_index] = _value; | |
} |
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
pragma solidity ^0.4.17; | |
contract ArrayOverflow{ | |
uint256 public target = 100; | |
uint256[] public array = [9,8]; | |
bytes32 hashValue; | |
// constructor | |
// _ means local variable | |
function modifyArray (uint256 _index, uint256 _value){ |
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
contract StorageTest { | |
uint256 a; // slot 0 | |
uint256[2] b; // slots 1-2 | |
struct Entry { | |
uint256 id; | |
uint256 value; | |
} | |
Entry c; // slots 3-4 | |
Entry[] d; |
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
contract StorageTest { | |
uint256 a; | |
uint256[2] b; | |
struct Entry { | |
uint256 id; | |
uint256 value; | |
} | |
Entry c; | |
} |
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 matplotlib.pyplot as plt | |
import numpy as np | |
origin_image = [ | |
[70, 70, 100, 70, 87, 87, 150, 187], | |
[85, 100, 96, 79, 87, 154, 87, 113], | |
[100, 85, 116, 79, 70, 87, 86, 196], | |
[136, 69, 87, 200, 79, 71, 117, 96], | |
[161, 70, 87, 200, 103, 71, 96, 113], | |
[161, 123, 147, 133, 113, 113, 85, 161], |
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 matplotlib.pyplot as plt | |
import numpy as np | |
origin_image = [ | |
[70, 70, 100, 70, 87, 87, 150, 187], | |
[85, 100, 96, 79, 87, 154, 87, 113], | |
[100, 85, 116, 79, 70, 87, 86, 196], | |
[136, 69, 87, 200, 103, 71, 96, 113], | |
[161, 70, 87, 200, 113, 113, 85, 161], | |
[161, 123, 147, 133, 113, 113, 85, 161], |
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
class Solution(object): | |
def sortColors(self, nums): | |
""" | |
:type nums: List[int] | |
:rtype: void Do not return anything, modify nums in-place instead. | |
""" | |
self.helper(nums, 0, len(nums) -1) | |
def helper(self, nums, left, right): | |
if len(nums) <= 1: return |
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
Attaching to pubsub_1_app_1, pubsub_1_db_1, pubsub_1_redis_1 | |
[36mapp_1 |[0m A server is already running. Check /pubsub_1/tmp/pids/server.pid. | |
[36mapp_1 |[0m => Booting Puma | |
[36mapp_1 |[0m => Rails 5.1.6 application starting in development | |
[36mapp_1 |[0m => Run `rails server -h` for more startup options | |
[36mapp_1 |[0m Exiting | |
[36mapp_1 |[0m => Booting Puma | |
[36mapp_1 |[0m => Rails 5.1.6 application starting in development | |
[36mapp_1 |[0m => Run `rails server -h` for more startup options | |
[36mapp_1 |[0m Puma starting in single mode... |
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
require 'openssl' | |
class Block < ApplicationRecord | |
belongs_to :block_chain, optional: true | |
def explain | |
p '==== Block ==== ' | |
p "Timestamp: #{created_at}" | |
p "last_hash: #{last_hash}" | |
p "hash_value: #{hash_value}" |
NewerOlder