- State Design Pattern allows an object to change its behavior when its internal state changes.
- It is a behavioral type design pattern.
- It has State Interface which represents all behaviors (methods) the context will exhibit.
- The Concrete States in the state design pattern are the implementations of the State Interface that define behaviors specific to each state.
- It has Context Class that holds a reference to the current state and expose methods to clients.
- Useful to manage states in the applications and swtich between them.
- Easy to maintian since each state is a different class and state-specific behavior is encapsulated in its respective class.
- New states can be easily added by writing an extra class for the new state.
- E.g. States in a document, states in a game, or different modes in a GUI.
- Make sure you have
xauth
installed. (See:xauth info
orxauth list
) - On the server your
/etc/ssh/sshd_config
file should have these lines:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no
- Make sure on client side you have
X server
installed. - On the client side your
~/.ssh/config
file should have these lines if not create new config file and add:
- Assume this is the hash of the lastest block (shortened to 30 characters):
00000000000001adf44c7d69767585
- Following are the hashes of a few valid transactions waiting for inclusion (shortened).
5572eca4dd4
db7d0c0b845
- And this the hash of one special transaction that you just crafted, which gives 10BTC (the current reward) to yourself:
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
colours = np.array([ | |
bytearray(msg.data[rgb_field.offset + 2::msg.point_step]), | |
bytearray(msg.data[rgb_field.offset + 1::msg.point_step]), | |
bytearray(msg.data[rgb_field.offset + 0::msg.point_step]) | |
]).transpose().astype(np.float32)/255.0 |
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 unittest | |
import copy | |
from itertools import cycle | |
def row(matrix, n): | |
# returns row n of a 2d matrix | |
return matrix.pop(n) | |
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 bash | |
## If no bucket name is passed, prompt user to enter one from their account. | |
## Else, assign $1 to bucket_name. | |
get_bucket_name () { | |
if [[ $# -eq 0 ]]; then | |
echo | |
echo "$buckets" | |
echo |
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 boto3 | |
session = boto3.Session( | |
aws_access_key_id='AWS_ACCESS_KEY_ID', | |
aws_secret_access_key='AWS_SECRET_KEY', | |
) | |
s3 = session.resource('s3') | |
bucket = s3.Bucket('bucket-name') | |
bucket.objects.all().delete() | |
s3.meta.client.upload_file(Filename='filename-with-path', Bucket='qbot.co.robot.software.deployment.mk7', Key='only-filename-in-the-bucket') |
NewerOlder